Files
2024-10-19 18:17:42 +00:00

3692 lines
5.9 MiB
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var Jrt=Object.defineProperty;var eot=(n,e,t)=>e in n?Jrt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var xs=(n,e,t)=>(eot(n,typeof e!="symbol"?e+"":e,t),t);function cOe(n,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in n)){const o=Object.getOwnPropertyDescriptor(i,r);o&&Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function t(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(r){if(r.ep)return;r.ep=!0;const o=t(r);fetch(r.href,o)}})();var Co=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ja(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function oue(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return n[i]}})}),t}var uOe={exports:{}},SW={},dOe={exports:{}},Eo={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var K4=Symbol.for("react.element"),tot=Symbol.for("react.portal"),not=Symbol.for("react.fragment"),iot=Symbol.for("react.strict_mode"),rot=Symbol.for("react.profiler"),oot=Symbol.for("react.provider"),sot=Symbol.for("react.context"),aot=Symbol.for("react.forward_ref"),lot=Symbol.for("react.suspense"),cot=Symbol.for("react.memo"),uot=Symbol.for("react.lazy"),S0e=Symbol.iterator;function dot(n){return n===null||typeof n!="object"?null:(n=S0e&&n[S0e]||n["@@iterator"],typeof n=="function"?n:null)}var hOe={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},fOe=Object.assign,gOe={};function N2(n,e,t){this.props=n,this.context=e,this.refs=gOe,this.updater=t||hOe}N2.prototype.isReactComponent={};N2.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,e,"setState")};N2.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function pOe(){}pOe.prototype=N2.prototype;function sue(n,e,t){this.props=n,this.context=e,this.refs=gOe,this.updater=t||hOe}var aue=sue.prototype=new pOe;aue.constructor=sue;fOe(aue,N2.prototype);aue.isPureReactComponent=!0;var E0e=Array.isArray,mOe=Object.prototype.hasOwnProperty,lue={current:null},_Oe={key:!0,ref:!0,__self:!0,__source:!0};function vOe(n,e,t){var i,r={},o=null,s=null;if(e!=null)for(i in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)mOe.call(e,i)&&!_Oe.hasOwnProperty(i)&&(r[i]=e[i]);var a=arguments.length-2;if(a===1)r.children=t;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];r.children=l}if(n&&n.defaultProps)for(i in a=n.defaultProps,a)r[i]===void 0&&(r[i]=a[i]);return{$$typeof:K4,type:n,key:o,ref:s,props:r,_owner:lue.current}}function hot(n,e){return{$$typeof:K4,type:n.type,key:e,ref:n.ref,props:n.props,_owner:n._owner}}function cue(n){return typeof n=="object"&&n!==null&&n.$$typeof===K4}function fot(n){var e={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(t){return e[t]})}var x0e=/\/+/g;function jG(n,e){return typeof n=="object"&&n!==null&&n.key!=null?fot(""+n.key):e.toString(36)}function N$(n,e,t,i,r){var o=typeof n;(o==="undefined"||o==="boolean")&&(n=null);var s=!1;if(n===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(n.$$typeof){case K4:case tot:s=!0}}if(s)return s=n,r=r(s),n=i===""?"."+jG(s,0):i,E0e(r)?(t="",n!=null&&(t=n.replace(x0e,"$&/")+"/"),N$(r,e,t,"",function(c){return c})):r!=null&&(cue(r)&&(r=hot(r,t+(!r.key||s&&s.key===r.key?"":(""+r.key).replace(x0e,"$&/")+"/")+n)),e.push(r)),1;if(s=0,i=i===""?".":i+":",E0e(n))for(var a=0;a<n.length;a++){o=n[a];var l=i+jG(o,a);s+=N$(o,e,t,l,r)}else if(l=dot(n),typeof l=="function")for(n=l.call(n),a=0;!(o=n.next()).done;)o=o.value,l=i+jG(o,a++),s+=N$(o,e,t,l,r);else if(o==="object")throw e=String(n),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return s}function zF(n,e,t){if(n==null)return n;var i=[],r=0;return N$(n,i,"","",function(o){return e.call(t,o,r++)}),i}function got(n){if(n._status===-1){var e=n._result;e=e(),e.then(function(t){(n._status===0||n._status===-1)&&(n._status=1,n._result=t)},function(t){(n._status===0||n._status===-1)&&(n._status=2,n._result=t)}),n._status===-1&&(n._status=0,n._result=e)}if(n._status===1)return n._result.default;throw n._result}var fh={current:null},O$={transition:null},pot={ReactCurrentDispatcher:fh,ReactCurrentBatchConfig:O$,ReactCurrentOwner:lue};Eo.Children={map:zF,forEach:function(n,e,t){zF(n,function(){e.apply(this,arguments)},t)},count:function(n){var e=0;return zF(n,function(){e++}),e},toArray:function(n){return zF(n,function(e){return e})||[]},only:function(n){if(!cue(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};Eo.Component=N2;Eo.Fragment=not;Eo.Profiler=rot;Eo.PureComponent=sue;Eo.StrictMode=iot;Eo.Suspense=lot;Eo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=pot;Eo.cloneElement=function(n,e,t){if(n==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+n+".");var i=fOe({},n.props),r=n.key,o=n.ref,s=n._owner;if(e!=null){if(e.ref!==void 0&&(o=e.ref,s=lue.current),e.key!==void 0&&(r=""+e.key),n.type&&n.type.defaultProps)var a=n.type.defaultProps;for(l in e)mOe.call(e,l)&&!_Oe.hasOwnProperty(l)&&(i[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)i.children=t;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];i.children=a}return{$$typeof:K4,type:n.type,key:r,ref:o,props:i,_owner:s}};Eo.createContext=function(n){return n={$$typeof:sot,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},n.Provider={$$typeof:oot,_context:n},n.Consumer=n};Eo.createElement=vOe;Eo.createFactory=function(n){var e=vOe.bind(null,n);return e.type=n,e};Eo.createRef=function(){return{current:null}};Eo.forwardRef=function(n){return{$$typeof:aot,render:n}};Eo.isValidElement=cue;Eo.lazy=function(n){return{$$typeof:uot,_payload:{_status:-1,_result:n},_init:got}};Eo.memo=function(n,e){return{$$typeof:cot,type:n,compare:e===void 0?null:e}};Eo.startTransition=function(n){var e=O$.transition;O$.transition={};try{n()}finally{O$.transition=e}};Eo.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Eo.useCallback=function(n,e){return fh.current.useCallback(n,e)};Eo.useContext=function(n){return fh.current.useContext(n)};Eo.useDebugValue=function(){};Eo.useDeferredValue=function(n){return fh.current.useDeferredValue(n)};Eo.useEffect=function(n,e){return fh.current.useEffect(n,e)};Eo.useId=function(){return fh.current.useId()};Eo.useImperativeHandle=function(n,e,t){return fh.current.useImperativeHandle(n,e,t)};Eo.useInsertionEffect=function(n,e){return fh.current.useInsertionEffect(n,e)};Eo.useLayoutEffect=function(n,e){return fh.current.useLayoutEffect(n,e)};Eo.useMemo=function(n,e){return fh.current.useMemo(n,e)};Eo.useReducer=function(n,e,t){return fh.current.useReducer(n,e,t)};Eo.useRef=function(n){return fh.current.useRef(n)};Eo.useState=function(n){return fh.current.useState(n)};Eo.useSyncExternalStore=function(n,e,t){return fh.current.useSyncExternalStore(n,e,t)};Eo.useTransition=function(){return fh.current.useTransition()};Eo.version="18.2.0";dOe.exports=Eo;var w=dOe.exports;const te=ja(w),Rp=cOe({__proto__:null,default:te},[w]);/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var mot=w,_ot=Symbol.for("react.element"),vot=Symbol.for("react.fragment"),bot=Object.prototype.hasOwnProperty,yot=mot.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Cot={key:!0,ref:!0,__self:!0,__source:!0};function bOe(n,e,t){var i,r={},o=null,s=null;t!==void 0&&(o=""+t),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(s=e.ref);for(i in e)bot.call(e,i)&&!Cot.hasOwnProperty(i)&&(r[i]=e[i]);if(n&&n.defaultProps)for(i in e=n.defaultProps,e)r[i]===void 0&&(r[i]=e[i]);return{$$typeof:_ot,type:n,key:o,ref:s,props:r,_owner:yot.current}}SW.Fragment=vot;SW.jsx=bOe;SW.jsxs=bOe;uOe.exports=SW;var uue=uOe.exports;const _t=uue.Fragment,f=uue.jsx,N=uue.jsxs,wot="/ar-ce694fee.json",Sot="/bg-69a3d78f.json",Eot="/ca-46030ad7.json",xot="/cs-493936e5.json",kot="/da-ac9d0446.json",Tot="/de-024a20d5.json",Iot="/el-5a2b0654.json",Lot="/en-4ff495b1.json",Dot="/en_GB-8c899e51.json",Aot="/es-dfdd91ef.json",Rot="/es_ES-d398faf2.json",Not="/et-810116c9.json",Oot="/fa-48845f3e.json",Pot="/fi-1a8031c3.json",Mot="/fr-6ca6b791.json",Fot="/fr_CA-b2028567.json",Bot="/fr_CH-4debd99b.json",$ot="/he-af89a593.json",Vot="/hr-4f73ef58.json",Hot="/hu-ca989279.json",Wot="/it-568f7236.json",zot="/ja-111f1bb7.json",jot="/km_KH-238595bc.json",Uot="/lo_LA-de17854a.json",qot="/lt-71641084.json",Kot="/lv_LV-3345cb4d.json",Got="/mk_MK-23de1655.json",Yot="/nb_NO-f529bb60.json",Qot="/nl-a7042344.json",Xot="/pl-9e7a7a49.json",Zot="/pt_BR-1e0cc3ae.json",Jot="/pt_PT-cc962a3d.json",est="/ro-b688111b.json",tst="/ru_RU-69890bad.json",nst="/sk-f8cba87c.json",ist="/sl-00d9fe70.json",rst="/sq-02294f93.json",ost="/sr-77f04b9d.json",sst="/sv-aff3333d.json",ast="/th-c46d5fd5.json",lst="/tr_TR-6086253c.json",cst="/zh_TW-db09708c.json";var yOe={exports:{}},COe={};/**
* @license React
* use-sync-external-store-shim.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var XL=w;function ust(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var dst=typeof Object.is=="function"?Object.is:ust,hst=XL.useState,fst=XL.useEffect,gst=XL.useLayoutEffect,pst=XL.useDebugValue;function mst(n,e){var t=e(),i=hst({inst:{value:t,getSnapshot:e}}),r=i[0].inst,o=i[1];return gst(function(){r.value=t,r.getSnapshot=e,UG(r)&&o({inst:r})},[n,t,e]),fst(function(){return UG(r)&&o({inst:r}),n(function(){UG(r)&&o({inst:r})})},[n]),pst(t),t}function UG(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!dst(n,t)}catch{return!0}}function _st(n,e){return e()}var vst=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?_st:mst;COe.useSyncExternalStore=XL.useSyncExternalStore!==void 0?XL.useSyncExternalStore:vst;yOe.exports=COe;var wOe=yOe.exports,SOe={exports:{}},EOe={};/**
* @license React
* use-sync-external-store-shim/with-selector.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var EW=w,bst=wOe;function yst(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var Cst=typeof Object.is=="function"?Object.is:yst,wst=bst.useSyncExternalStore,Sst=EW.useRef,Est=EW.useEffect,xst=EW.useMemo,kst=EW.useDebugValue;EOe.useSyncExternalStoreWithSelector=function(n,e,t,i,r){var o=Sst(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=xst(function(){function l(g){if(!c){if(c=!0,u=g,g=i(g),r!==void 0&&s.hasValue){var p=s.value;if(r(p,g))return d=p}return d=g}if(p=d,Cst(u,g))return p;var m=i(g);return r!==void 0&&r(p,m)?p:(u=g,d=m)}var c=!1,u,d,h=t===void 0?null:t;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,t,i,r]);var a=wst(n,o[0],o[1]);return Est(function(){s.hasValue=!0,s.value=a},[a]),kst(a),a};SOe.exports=EOe;var Tst=SOe.exports,xOe={exports:{}},Lg={},kOe={exports:{}},TOe={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(n){function e($,j){var Y=$.length;$.push(j);e:for(;0<Y;){var ne=Y-1>>>1,se=$[ne];if(0<r(se,j))$[ne]=j,$[Y]=se,Y=ne;else break e}}function t($){return $.length===0?null:$[0]}function i($){if($.length===0)return null;var j=$[0],Y=$.pop();if(Y!==j){$[0]=Y;e:for(var ne=0,se=$.length,he=se>>>1;ne<he;){var xe=2*(ne+1)-1,_e=$[xe],Ie=xe+1,Re=$[Ie];if(0>r(_e,Y))Ie<se&&0>r(Re,_e)?($[ne]=Re,$[Ie]=Y,ne=Ie):($[ne]=_e,$[xe]=Y,ne=xe);else if(Ie<se&&0>r(Re,Y))$[ne]=Re,$[Ie]=Y,ne=Ie;else break e}}return j}function r($,j){var Y=$.sortIndex-j.sortIndex;return Y!==0?Y:$.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();n.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,d=null,h=3,g=!1,p=!1,m=!1,_=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y($){for(var j=t(c);j!==null;){if(j.callback===null)i(c);else if(j.startTime<=$)i(c),j.sortIndex=j.expirationTime,e(l,j);else break;j=t(c)}}function C($){if(m=!1,y($),!p)if(t(l)!==null)p=!0,H(x);else{var j=t(c);j!==null&&V(C,j.startTime-$)}}function x($,j){p=!1,m&&(m=!1,v(L),L=-1),g=!0;var Y=h;try{for(y(j),d=t(l);d!==null&&(!(d.expirationTime>j)||$&&!P());){var ne=d.callback;if(typeof ne=="function"){d.callback=null,h=d.priorityLevel;var se=ne(d.expirationTime<=j);j=n.unstable_now(),typeof se=="function"?d.callback=se:d===t(l)&&i(l),y(j)}else i(l);d=t(l)}if(d!==null)var he=!0;else{var xe=t(c);xe!==null&&V(C,xe.startTime-j),he=!1}return he}finally{d=null,h=Y,g=!1}}var k=!1,I=null,L=-1,D=5,R=-1;function P(){return!(n.unstable_now()-R<D)}function M(){if(I!==null){var $=n.unstable_now();R=$;var j=!0;try{j=I(!0,$)}finally{j?O():(k=!1,I=null)}}else k=!1}var O;if(typeof b=="function")O=function(){b(M)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,F=B.port2;B.port1.onmessage=M,O=function(){F.postMessage(null)}}else O=function(){_(M,0)};function H($){I=$,k||(k=!0,O())}function V($,j){L=_(function(){$(n.unstable_now())},j)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function($){$.callback=null},n.unstable_continueExecution=function(){p||g||(p=!0,H(x))},n.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<$?Math.floor(1e3/$):5},n.unstable_getCurrentPriorityLevel=function(){return h},n.unstable_getFirstCallbackNode=function(){return t(l)},n.unstable_next=function($){switch(h){case 1:case 2:case 3:var j=3;break;default:j=h}var Y=h;h=j;try{return $()}finally{h=Y}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function($,j){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var Y=h;h=$;try{return j()}finally{h=Y}},n.unstable_scheduleCallback=function($,j,Y){var ne=n.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?ne+Y:ne):Y=ne,$){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=Y+se,$={id:u++,callback:j,priorityLevel:$,startTime:Y,expirationTime:se,sortIndex:-1},Y>ne?($.sortIndex=Y,e(c,$),t(l)===null&&$===t(c)&&(m?(v(L),L=-1):m=!0,V(C,Y-ne))):($.sortIndex=se,e(l,$),p||g||(p=!0,H(x))),$},n.unstable_shouldYield=P,n.unstable_wrapCallback=function($){var j=h;return function(){var Y=h;h=j;try{return $.apply(this,arguments)}finally{h=Y}}}})(TOe);kOe.exports=TOe;var Ist=kOe.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var IOe=w,_g=Ist;function fn(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+n+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var LOe=new Set,uP={};function uk(n,e){ZL(n,e),ZL(n+"Capture",e)}function ZL(n,e){for(uP[n]=e,n=0;n<e.length;n++)LOe.add(e[n])}var r0=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),GJ=Object.prototype.hasOwnProperty,Lst=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,k0e={},T0e={};function Dst(n){return GJ.call(T0e,n)?!0:GJ.call(k0e,n)?!1:Lst.test(n)?T0e[n]=!0:(k0e[n]=!0,!1)}function Ast(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function Rst(n,e,t,i){if(e===null||typeof e>"u"||Ast(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function gh(n,e,t,i,r,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var Yu={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){Yu[n]=new gh(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];Yu[e]=new gh(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){Yu[n]=new gh(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){Yu[n]=new gh(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){Yu[n]=new gh(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){Yu[n]=new gh(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){Yu[n]=new gh(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){Yu[n]=new gh(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){Yu[n]=new gh(n,5,!1,n.toLowerCase(),null,!1,!1)});var due=/[\-:]([a-z])/g;function hue(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(due,hue);Yu[e]=new gh(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(due,hue);Yu[e]=new gh(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(due,hue);Yu[e]=new gh(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){Yu[n]=new gh(n,1,!1,n.toLowerCase(),null,!1,!1)});Yu.xlinkHref=new gh("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){Yu[n]=new gh(n,1,!1,n.toLowerCase(),null,!0,!0)});function fue(n,e,t,i){var r=Yu.hasOwnProperty(e)?Yu[e]:null;(r!==null?r.type!==0:i||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(Rst(e,t,r,i)&&(t=null),i||r===null?Dst(e)&&(t===null?n.removeAttribute(e):n.setAttribute(e,""+t)):r.mustUseProperty?n[r.propertyName]=t===null?r.type===3?!1:"":t:(e=r.attributeName,i=r.attributeNamespace,t===null?n.removeAttribute(e):(r=r.type,t=r===3||r===4&&t===!0?"":""+t,i?n.setAttributeNS(i,e,t):n.setAttribute(e,t))))}var S0=IOe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,jF=Symbol.for("react.element"),cI=Symbol.for("react.portal"),uI=Symbol.for("react.fragment"),gue=Symbol.for("react.strict_mode"),YJ=Symbol.for("react.profiler"),DOe=Symbol.for("react.provider"),AOe=Symbol.for("react.context"),pue=Symbol.for("react.forward_ref"),QJ=Symbol.for("react.suspense"),XJ=Symbol.for("react.suspense_list"),mue=Symbol.for("react.memo"),m1=Symbol.for("react.lazy"),ROe=Symbol.for("react.offscreen"),I0e=Symbol.iterator;function rR(n){return n===null||typeof n!="object"?null:(n=I0e&&n[I0e]||n["@@iterator"],typeof n=="function"?n:null)}var rl=Object.assign,qG;function dN(n){if(qG===void 0)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);qG=e&&e[1]||""}return`
`+qG+n}var KG=!1;function GG(n,e){if(!n||KG)return"";KG=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var i=c}Reflect.construct(n,[],e)}else{try{e.call()}catch(c){i=c}n.call(e.prototype)}else{try{throw Error()}catch(c){i=c}n()}}catch(c){if(c&&i&&typeof c.stack=="string"){for(var r=c.stack.split(`
`),o=i.stack.split(`
`),s=r.length-1,a=o.length-1;1<=s&&0<=a&&r[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(r[s]!==o[a]){if(s!==1||a!==1)do if(s--,a--,0>a||r[s]!==o[a]){var l=`
`+r[s].replace(" at new "," at ");return n.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",n.displayName)),l}while(1<=s&&0<=a);break}}}finally{KG=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?dN(n):""}function Nst(n){switch(n.tag){case 5:return dN(n.type);case 16:return dN("Lazy");case 13:return dN("Suspense");case 19:return dN("SuspenseList");case 0:case 2:case 15:return n=GG(n.type,!1),n;case 11:return n=GG(n.type.render,!1),n;case 1:return n=GG(n.type,!0),n;default:return""}}function ZJ(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case uI:return"Fragment";case cI:return"Portal";case YJ:return"Profiler";case gue:return"StrictMode";case QJ:return"Suspense";case XJ:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case AOe:return(n.displayName||"Context")+".Consumer";case DOe:return(n._context.displayName||"Context")+".Provider";case pue:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case mue:return e=n.displayName||null,e!==null?e:ZJ(n.type)||"Memo";case m1:e=n._payload,n=n._init;try{return ZJ(n(e))}catch{}}return null}function Ost(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ZJ(e);case 8:return e===gue?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function UC(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function NOe(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Pst(n){var e=NOe(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var r=t.get,o=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return r.call(this)},set:function(s){i=""+s,o.call(this,s)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(s){i=""+s},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function UF(n){n._valueTracker||(n._valueTracker=Pst(n))}function OOe(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=NOe(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function l9(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function JJ(n,e){var t=e.checked;return rl({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function L0e(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=UC(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function POe(n,e){e=e.checked,e!=null&&fue(n,"checked",e,!1)}function eee(n,e){POe(n,e);var t=UC(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?tee(n,e.type,t):e.hasOwnProperty("defaultValue")&&tee(n,e.type,UC(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function D0e(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function tee(n,e,t){(e!=="number"||l9(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var hN=Array.isArray;function oL(n,e,t,i){if(n=n.options,e){e={};for(var r=0;r<t.length;r++)e["$"+t[r]]=!0;for(t=0;t<n.length;t++)r=e.hasOwnProperty("$"+n[t].value),n[t].selected!==r&&(n[t].selected=r),r&&i&&(n[t].defaultSelected=!0)}else{for(t=""+UC(t),e=null,r=0;r<n.length;r++){if(n[r].value===t){n[r].selected=!0,i&&(n[r].defaultSelected=!0);return}e!==null||n[r].disabled||(e=n[r])}e!==null&&(e.selected=!0)}}function nee(n,e){if(e.dangerouslySetInnerHTML!=null)throw Error(fn(91));return rl({},e,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function A0e(n,e){var t=e.value;if(t==null){if(t=e.children,e=e.defaultValue,t!=null){if(e!=null)throw Error(fn(92));if(hN(t)){if(1<t.length)throw Error(fn(93));t=t[0]}e=t}e==null&&(e=""),t=e}n._wrapperState={initialValue:UC(t)}}function MOe(n,e){var t=UC(e.value),i=UC(e.defaultValue);t!=null&&(t=""+t,t!==n.value&&(n.value=t),e.defaultValue==null&&n.defaultValue!==t&&(n.defaultValue=t)),i!=null&&(n.defaultValue=""+i)}function R0e(n){var e=n.textContent;e===n._wrapperState.initialValue&&e!==""&&e!==null&&(n.value=e)}function FOe(n){switch(n){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function iee(n,e){return n==null||n==="http://www.w3.org/1999/xhtml"?FOe(e):n==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var qF,BOe=function(n){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,t,i,r){MSApp.execUnsafeLocalFunction(function(){return n(e,t,i,r)})}:n}(function(n,e){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=e;else{for(qF=qF||document.createElement("div"),qF.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=qF.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function dP(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var KN={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Mst=["Webkit","ms","Moz","O"];Object.keys(KN).forEach(function(n){Mst.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),KN[e]=KN[n]})});function $Oe(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||KN.hasOwnProperty(n)&&KN[n]?(""+e).trim():e+"px"}function VOe(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,r=$Oe(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,r):n[t]=r}}var Fst=rl({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ree(n,e){if(e){if(Fst[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(fn(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(fn(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(fn(61))}if(e.style!=null&&typeof e.style!="object")throw Error(fn(62))}}function oee(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var see=null;function _ue(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var aee=null,sL=null,aL=null;function N0e(n){if(n=Q4(n)){if(typeof aee!="function")throw Error(fn(280));var e=n.stateNode;e&&(e=LW(e),aee(n.stateNode,n.type,e))}}function HOe(n){sL?aL?aL.push(n):aL=[n]:sL=n}function WOe(){if(sL){var n=sL,e=aL;if(aL=sL=null,N0e(n),e)for(n=0;n<e.length;n++)N0e(e[n])}}function zOe(n,e){return n(e)}function jOe(){}var YG=!1;function UOe(n,e,t){if(YG)return n(e,t);YG=!0;try{return zOe(n,e,t)}finally{YG=!1,(sL!==null||aL!==null)&&(jOe(),WOe())}}function hP(n,e){var t=n.stateNode;if(t===null)return null;var i=LW(t);if(i===null)return null;t=i[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(n=n.type,i=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!i;break e;default:n=!1}if(n)return null;if(t&&typeof t!="function")throw Error(fn(231,e,typeof t));return t}var lee=!1;if(r0)try{var oR={};Object.defineProperty(oR,"passive",{get:function(){lee=!0}}),window.addEventListener("test",oR,oR),window.removeEventListener("test",oR,oR)}catch{lee=!1}function Bst(n,e,t,i,r,o,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(t,c)}catch(u){this.onError(u)}}var GN=!1,c9=null,u9=!1,cee=null,$st={onError:function(n){GN=!0,c9=n}};function Vst(n,e,t,i,r,o,s,a,l){GN=!1,c9=null,Bst.apply($st,arguments)}function Hst(n,e,t,i,r,o,s,a,l){if(Vst.apply(this,arguments),GN){if(GN){var c=c9;GN=!1,c9=null}else throw Error(fn(198));u9||(u9=!0,cee=c)}}function dk(n){var e=n,t=n;if(n.alternate)for(;e.return;)e=e.return;else{n=e;do e=n,e.flags&4098&&(t=e.return),n=e.return;while(n)}return e.tag===3?t:null}function qOe(n){if(n.tag===13){var e=n.memoizedState;if(e===null&&(n=n.alternate,n!==null&&(e=n.memoizedState)),e!==null)return e.dehydrated}return null}function O0e(n){if(dk(n)!==n)throw Error(fn(188))}function Wst(n){var e=n.alternate;if(!e){if(e=dk(n),e===null)throw Error(fn(188));return e!==n?null:n}for(var t=n,i=e;;){var r=t.return;if(r===null)break;var o=r.alternate;if(o===null){if(i=r.return,i!==null){t=i;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===t)return O0e(r),n;if(o===i)return O0e(r),e;o=o.sibling}throw Error(fn(188))}if(t.return!==i.return)t=r,i=o;else{for(var s=!1,a=r.child;a;){if(a===t){s=!0,t=r,i=o;break}if(a===i){s=!0,i=r,t=o;break}a=a.sibling}if(!s){for(a=o.child;a;){if(a===t){s=!0,t=o,i=r;break}if(a===i){s=!0,i=o,t=r;break}a=a.sibling}if(!s)throw Error(fn(189))}}if(t.alternate!==i)throw Error(fn(190))}if(t.tag!==3)throw Error(fn(188));return t.stateNode.current===t?n:e}function KOe(n){return n=Wst(n),n!==null?GOe(n):null}function GOe(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var e=GOe(n);if(e!==null)return e;n=n.sibling}return null}var YOe=_g.unstable_scheduleCallback,P0e=_g.unstable_cancelCallback,zst=_g.unstable_shouldYield,jst=_g.unstable_requestPaint,Vl=_g.unstable_now,Ust=_g.unstable_getCurrentPriorityLevel,vue=_g.unstable_ImmediatePriority,QOe=_g.unstable_UserBlockingPriority,d9=_g.unstable_NormalPriority,qst=_g.unstable_LowPriority,XOe=_g.unstable_IdlePriority,xW=null,Wv=null;function Kst(n){if(Wv&&typeof Wv.onCommitFiberRoot=="function")try{Wv.onCommitFiberRoot(xW,n,void 0,(n.current.flags&128)===128)}catch{}}var s_=Math.clz32?Math.clz32:Qst,Gst=Math.log,Yst=Math.LN2;function Qst(n){return n>>>=0,n===0?32:31-(Gst(n)/Yst|0)|0}var KF=64,GF=4194304;function fN(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function h9(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,r=n.suspendedLanes,o=n.pingedLanes,s=t&268435455;if(s!==0){var a=s&~r;a!==0?i=fN(a):(o&=s,o!==0&&(i=fN(o)))}else s=t&~r,s!==0?i=fN(s):o!==0&&(i=fN(o));if(i===0)return 0;if(e!==0&&e!==i&&!(e&r)&&(r=i&-i,o=e&-e,r>=o||r===16&&(o&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0<e;)t=31-s_(e),r=1<<t,i|=n[t],e&=~r;return i}function Xst(n,e){switch(n){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Zst(n,e){for(var t=n.suspendedLanes,i=n.pingedLanes,r=n.expirationTimes,o=n.pendingLanes;0<o;){var s=31-s_(o),a=1<<s,l=r[s];l===-1?(!(a&t)||a&i)&&(r[s]=Xst(a,e)):l<=e&&(n.expiredLanes|=a),o&=~a}}function uee(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function ZOe(){var n=KF;return KF<<=1,!(KF&4194240)&&(KF=64),n}function QG(n){for(var e=[],t=0;31>t;t++)e.push(n);return e}function G4(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-s_(e),n[e]=t}function Jst(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0<t;){var r=31-s_(t),o=1<<r;e[r]=0,i[r]=-1,n[r]=-1,t&=~o}}function bue(n,e){var t=n.entangledLanes|=e;for(n=n.entanglements;t;){var i=31-s_(t),r=1<<i;r&e|n[i]&e&&(n[i]|=e),t&=~r}}var Rs=0;function JOe(n){return n&=-n,1<n?4<n?n&268435455?16:536870912:4:1}var ePe,yue,tPe,nPe,iPe,dee=!1,YF=[],lC=null,cC=null,uC=null,fP=new Map,gP=new Map,k1=[],eat="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function M0e(n,e){switch(n){case"focusin":case"focusout":lC=null;break;case"dragenter":case"dragleave":cC=null;break;case"mouseover":case"mouseout":uC=null;break;case"pointerover":case"pointerout":fP.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":gP.delete(e.pointerId)}}function sR(n,e,t,i,r,o){return n===null||n.nativeEvent!==o?(n={blockedOn:e,domEventName:t,eventSystemFlags:i,nativeEvent:o,targetContainers:[r]},e!==null&&(e=Q4(e),e!==null&&yue(e)),n):(n.eventSystemFlags|=i,e=n.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),n)}function tat(n,e,t,i,r){switch(e){case"focusin":return lC=sR(lC,n,e,t,i,r),!0;case"dragenter":return cC=sR(cC,n,e,t,i,r),!0;case"mouseover":return uC=sR(uC,n,e,t,i,r),!0;case"pointerover":var o=r.pointerId;return fP.set(o,sR(fP.get(o)||null,n,e,t,i,r)),!0;case"gotpointercapture":return o=r.pointerId,gP.set(o,sR(gP.get(o)||null,n,e,t,i,r)),!0}return!1}function rPe(n){var e=pE(n.target);if(e!==null){var t=dk(e);if(t!==null){if(e=t.tag,e===13){if(e=qOe(t),e!==null){n.blockedOn=e,iPe(n.priority,function(){tPe(t)});return}}else if(e===3&&t.stateNode.current.memoizedState.isDehydrated){n.blockedOn=t.tag===3?t.stateNode.containerInfo:null;return}}}n.blockedOn=null}function P$(n){if(n.blockedOn!==null)return!1;for(var e=n.targetContainers;0<e.length;){var t=hee(n.domEventName,n.eventSystemFlags,e[0],n.nativeEvent);if(t===null){t=n.nativeEvent;var i=new t.constructor(t.type,t);see=i,t.target.dispatchEvent(i),see=null}else return e=Q4(t),e!==null&&yue(e),n.blockedOn=t,!1;e.shift()}return!0}function F0e(n,e,t){P$(n)&&t.delete(e)}function nat(){dee=!1,lC!==null&&P$(lC)&&(lC=null),cC!==null&&P$(cC)&&(cC=null),uC!==null&&P$(uC)&&(uC=null),fP.forEach(F0e),gP.forEach(F0e)}function aR(n,e){n.blockedOn===e&&(n.blockedOn=null,dee||(dee=!0,_g.unstable_scheduleCallback(_g.unstable_NormalPriority,nat)))}function pP(n){function e(r){return aR(r,n)}if(0<YF.length){aR(YF[0],n);for(var t=1;t<YF.length;t++){var i=YF[t];i.blockedOn===n&&(i.blockedOn=null)}}for(lC!==null&&aR(lC,n),cC!==null&&aR(cC,n),uC!==null&&aR(uC,n),fP.forEach(e),gP.forEach(e),t=0;t<k1.length;t++)i=k1[t],i.blockedOn===n&&(i.blockedOn=null);for(;0<k1.length&&(t=k1[0],t.blockedOn===null);)rPe(t),t.blockedOn===null&&k1.shift()}var lL=S0.ReactCurrentBatchConfig,f9=!0;function iat(n,e,t,i){var r=Rs,o=lL.transition;lL.transition=null;try{Rs=1,Cue(n,e,t,i)}finally{Rs=r,lL.transition=o}}function rat(n,e,t,i){var r=Rs,o=lL.transition;lL.transition=null;try{Rs=4,Cue(n,e,t,i)}finally{Rs=r,lL.transition=o}}function Cue(n,e,t,i){if(f9){var r=hee(n,e,t,i);if(r===null)sY(n,e,i,g9,t),M0e(n,i);else if(tat(r,n,e,t,i))i.stopPropagation();else if(M0e(n,i),e&4&&-1<eat.indexOf(n)){for(;r!==null;){var o=Q4(r);if(o!==null&&ePe(o),o=hee(n,e,t,i),o===null&&sY(n,e,i,g9,t),o===r)break;r=o}r!==null&&i.stopPropagation()}else sY(n,e,i,null,t)}}var g9=null;function hee(n,e,t,i){if(g9=null,n=_ue(i),n=pE(n),n!==null)if(e=dk(n),e===null)n=null;else if(t=e.tag,t===13){if(n=qOe(e),n!==null)return n;n=null}else if(t===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;n=null}else e!==n&&(n=null);return g9=n,null}function oPe(n){switch(n){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ust()){case vue:return 1;case QOe:return 4;case d9:case qst:return 16;case XOe:return 536870912;default:return 16}default:return 16}}var F1=null,wue=null,M$=null;function sPe(){if(M$)return M$;var n,e=wue,t=e.length,i,r="value"in F1?F1.value:F1.textContent,o=r.length;for(n=0;n<t&&e[n]===r[n];n++);var s=t-n;for(i=1;i<=s&&e[t-i]===r[o-i];i++);return M$=r.slice(n,1<i?1-i:void 0)}function F$(n){var e=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&e===13&&(n=13)):n=e,n===10&&(n=13),32<=n||n===13?n:0}function QF(){return!0}function B0e(){return!1}function Dg(n){function e(t,i,r,o,s){this._reactName=t,this._targetInst=r,this.type=i,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var a in n)n.hasOwnProperty(a)&&(t=n[a],this[a]=t?t(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?QF:B0e,this.isPropagationStopped=B0e,this}return rl(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var t=this.nativeEvent;t&&(t.preventDefault?t.preventDefault():typeof t.returnValue!="unknown"&&(t.returnValue=!1),this.isDefaultPrevented=QF)},stopPropagation:function(){var t=this.nativeEvent;t&&(t.stopPropagation?t.stopPropagation():typeof t.cancelBubble!="unknown"&&(t.cancelBubble=!0),this.isPropagationStopped=QF)},persist:function(){},isPersistent:QF}),e}var O2={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sue=Dg(O2),Y4=rl({},O2,{view:0,detail:0}),oat=Dg(Y4),XG,ZG,lR,kW=rl({},Y4,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Eue,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==lR&&(lR&&n.type==="mousemove"?(XG=n.screenX-lR.screenX,ZG=n.screenY-lR.screenY):ZG=XG=0,lR=n),XG)},movementY:function(n){return"movementY"in n?n.movementY:ZG}}),$0e=Dg(kW),sat=rl({},kW,{dataTransfer:0}),aat=Dg(sat),lat=rl({},Y4,{relatedTarget:0}),JG=Dg(lat),cat=rl({},O2,{animationName:0,elapsedTime:0,pseudoElement:0}),uat=Dg(cat),dat=rl({},O2,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),hat=Dg(dat),fat=rl({},O2,{data:0}),V0e=Dg(fat),gat={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pat={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},mat={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _at(n){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(n):(n=mat[n])?!!e[n]:!1}function Eue(){return _at}var vat=rl({},Y4,{key:function(n){if(n.key){var e=gat[n.key]||n.key;if(e!=="Unidentified")return e}return n.type==="keypress"?(n=F$(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?pat[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Eue,charCode:function(n){return n.type==="keypress"?F$(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?F$(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),bat=Dg(vat),yat=rl({},kW,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),H0e=Dg(yat),Cat=rl({},Y4,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Eue}),wat=Dg(Cat),Sat=rl({},O2,{propertyName:0,elapsedTime:0,pseudoElement:0}),Eat=Dg(Sat),xat=rl({},kW,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),kat=Dg(xat),Tat=[9,13,27,32],xue=r0&&"CompositionEvent"in window,YN=null;r0&&"documentMode"in document&&(YN=document.documentMode);var Iat=r0&&"TextEvent"in window&&!YN,aPe=r0&&(!xue||YN&&8<YN&&11>=YN),W0e=String.fromCharCode(32),z0e=!1;function lPe(n,e){switch(n){case"keyup":return Tat.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cPe(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var dI=!1;function Lat(n,e){switch(n){case"compositionend":return cPe(e);case"keypress":return e.which!==32?null:(z0e=!0,W0e);case"textInput":return n=e.data,n===W0e&&z0e?null:n;default:return null}}function Dat(n,e){if(dI)return n==="compositionend"||!xue&&lPe(n,e)?(n=sPe(),M$=wue=F1=null,dI=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return aPe&&e.locale!=="ko"?null:e.data;default:return null}}var Aat={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function j0e(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e==="input"?!!Aat[n.type]:e==="textarea"}function uPe(n,e,t,i){HOe(i),e=p9(e,"onChange"),0<e.length&&(t=new Sue("onChange","change",null,t,i),n.push({event:t,listeners:e}))}var QN=null,mP=null;function Rat(n){CPe(n,0)}function TW(n){var e=gI(n);if(OOe(e))return n}function Nat(n,e){if(n==="change")return e}var dPe=!1;if(r0){var eY;if(r0){var tY="oninput"in document;if(!tY){var U0e=document.createElement("div");U0e.setAttribute("oninput","return;"),tY=typeof U0e.oninput=="function"}eY=tY}else eY=!1;dPe=eY&&(!document.documentMode||9<document.documentMode)}function q0e(){QN&&(QN.detachEvent("onpropertychange",hPe),mP=QN=null)}function hPe(n){if(n.propertyName==="value"&&TW(mP)){var e=[];uPe(e,mP,n,_ue(n)),UOe(Rat,e)}}function Oat(n,e,t){n==="focusin"?(q0e(),QN=e,mP=t,QN.attachEvent("onpropertychange",hPe)):n==="focusout"&&q0e()}function Pat(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return TW(mP)}function Mat(n,e){if(n==="click")return TW(e)}function Fat(n,e){if(n==="input"||n==="change")return TW(e)}function Bat(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var v_=typeof Object.is=="function"?Object.is:Bat;function _P(n,e){if(v_(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;var t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;for(i=0;i<t.length;i++){var r=t[i];if(!GJ.call(e,r)||!v_(n[r],e[r]))return!1}return!0}function K0e(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function G0e(n,e){var t=K0e(n);n=0;for(var i;t;){if(t.nodeType===3){if(i=n+t.textContent.length,n<=e&&i>=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=K0e(t)}}function fPe(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?fPe(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function gPe(){for(var n=window,e=l9();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=l9(n.document)}return e}function kue(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function $at(n){var e=gPe(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&fPe(t.ownerDocument.documentElement,t)){if(i!==null&&kue(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var r=t.textContent.length,o=Math.min(i.start,r);i=i.end===void 0?o:Math.min(i.end,r),!n.extend&&o>i&&(r=i,i=o,o=r),r=G0e(t,o);var s=G0e(t,i);r&&s&&(n.rangeCount!==1||n.anchorNode!==r.node||n.anchorOffset!==r.offset||n.focusNode!==s.node||n.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),n.removeAllRanges(),o>i?(n.addRange(e),n.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t<e.length;t++)n=e[t],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var Vat=r0&&"documentMode"in document&&11>=document.documentMode,hI=null,fee=null,XN=null,gee=!1;function Y0e(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;gee||hI==null||hI!==l9(i)||(i=hI,"selectionStart"in i&&kue(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),XN&&_P(XN,i)||(XN=i,i=p9(fee,"onSelect"),0<i.length&&(e=new Sue("onSelect","select",null,e,t),n.push({event:e,listeners:i}),e.target=hI)))}function XF(n,e){var t={};return t[n.toLowerCase()]=e.toLowerCase(),t["Webkit"+n]="webkit"+e,t["Moz"+n]="moz"+e,t}var fI={animationend:XF("Animation","AnimationEnd"),animationiteration:XF("Animation","AnimationIteration"),animationstart:XF("Animation","AnimationStart"),transitionend:XF("Transition","TransitionEnd")},nY={},pPe={};r0&&(pPe=document.createElement("div").style,"AnimationEvent"in window||(delete fI.animationend.animation,delete fI.animationiteration.animation,delete fI.animationstart.animation),"TransitionEvent"in window||delete fI.transitionend.transition);function IW(n){if(nY[n])return nY[n];if(!fI[n])return n;var e=fI[n],t;for(t in e)if(e.hasOwnProperty(t)&&t in pPe)return nY[n]=e[t];return n}var mPe=IW("animationend"),_Pe=IW("animationiteration"),vPe=IW("animationstart"),bPe=IW("transitionend"),yPe=new Map,Q0e="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Aw(n,e){yPe.set(n,e),uk(e,[n])}for(var iY=0;iY<Q0e.length;iY++){var rY=Q0e[iY],Hat=rY.toLowerCase(),Wat=rY[0].toUpperCase()+rY.slice(1);Aw(Hat,"on"+Wat)}Aw(mPe,"onAnimationEnd");Aw(_Pe,"onAnimationIteration");Aw(vPe,"onAnimationStart");Aw("dblclick","onDoubleClick");Aw("focusin","onFocus");Aw("focusout","onBlur");Aw(bPe,"onTransitionEnd");ZL("onMouseEnter",["mouseout","mouseover"]);ZL("onMouseLeave",["mouseout","mouseover"]);ZL("onPointerEnter",["pointerout","pointerover"]);ZL("onPointerLeave",["pointerout","pointerover"]);uk("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));uk("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));uk("onBeforeInput",["compositionend","keypress","textInput","paste"]);uk("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));uk("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));uk("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gN="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),zat=new Set("cancel close invalid load scroll toggle".split(" ").concat(gN));function X0e(n,e,t){var i=n.type||"unknown-event";n.currentTarget=t,Hst(i,e,void 0,n),n.currentTarget=null}function CPe(n,e){e=(e&4)!==0;for(var t=0;t<n.length;t++){var i=n[t],r=i.event;i=i.listeners;e:{var o=void 0;if(e)for(var s=i.length-1;0<=s;s--){var a=i[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==o&&r.isPropagationStopped())break e;X0e(r,a,c),o=l}else for(s=0;s<i.length;s++){if(a=i[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==o&&r.isPropagationStopped())break e;X0e(r,a,c),o=l}}}if(u9)throw n=cee,u9=!1,cee=null,n}function ka(n,e){var t=e[bee];t===void 0&&(t=e[bee]=new Set);var i=n+"__bubble";t.has(i)||(wPe(e,n,2,!1),t.add(i))}function oY(n,e,t){var i=0;e&&(i|=4),wPe(t,n,i,e)}var ZF="_reactListening"+Math.random().toString(36).slice(2);function vP(n){if(!n[ZF]){n[ZF]=!0,LOe.forEach(function(t){t!=="selectionchange"&&(zat.has(t)||oY(t,!1,n),oY(t,!0,n))});var e=n.nodeType===9?n:n.ownerDocument;e===null||e[ZF]||(e[ZF]=!0,oY("selectionchange",!1,e))}}function wPe(n,e,t,i){switch(oPe(e)){case 1:var r=iat;break;case 4:r=rat;break;default:r=Cue}t=r.bind(null,e,t,n),r=void 0,!lee||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?n.addEventListener(e,t,{capture:!0,passive:r}):n.addEventListener(e,t,!0):r!==void 0?n.addEventListener(e,t,{passive:r}):n.addEventListener(e,t,!1)}function sY(n,e,t,i,r){var o=i;if(!(e&1)&&!(e&2)&&i!==null)e:for(;;){if(i===null)return;var s=i.tag;if(s===3||s===4){var a=i.stateNode.containerInfo;if(a===r||a.nodeType===8&&a.parentNode===r)break;if(s===4)for(s=i.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===r||l.nodeType===8&&l.parentNode===r))return;s=s.return}for(;a!==null;){if(s=pE(a),s===null)return;if(l=s.tag,l===5||l===6){i=o=s;continue e}a=a.parentNode}}i=i.return}UOe(function(){var c=o,u=_ue(t),d=[];e:{var h=yPe.get(n);if(h!==void 0){var g=Sue,p=n;switch(n){case"keypress":if(F$(t)===0)break e;case"keydown":case"keyup":g=bat;break;case"focusin":p="focus",g=JG;break;case"focusout":p="blur",g=JG;break;case"beforeblur":case"afterblur":g=JG;break;case"click":if(t.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=$0e;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=aat;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=wat;break;case mPe:case _Pe:case vPe:g=uat;break;case bPe:g=Eat;break;case"scroll":g=oat;break;case"wheel":g=kat;break;case"copy":case"cut":case"paste":g=hat;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=H0e}var m=(e&4)!==0,_=!m&&n==="scroll",v=m?h!==null?h+"Capture":null:h;m=[];for(var b=c,y;b!==null;){y=b;var C=y.stateNode;if(y.tag===5&&C!==null&&(y=C,v!==null&&(C=hP(b,v),C!=null&&m.push(bP(b,C,y)))),_)break;b=b.return}0<m.length&&(h=new g(h,p,null,t,u),d.push({event:h,listeners:m}))}}if(!(e&7)){e:{if(h=n==="mouseover"||n==="pointerover",g=n==="mouseout"||n==="pointerout",h&&t!==see&&(p=t.relatedTarget||t.fromElement)&&(pE(p)||p[o0]))break e;if((g||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,g?(p=t.relatedTarget||t.toElement,g=c,p=p?pE(p):null,p!==null&&(_=dk(p),p!==_||p.tag!==5&&p.tag!==6)&&(p=null)):(g=null,p=c),g!==p)){if(m=$0e,C="onMouseLeave",v="onMouseEnter",b="mouse",(n==="pointerout"||n==="pointerover")&&(m=H0e,C="onPointerLeave",v="onPointerEnter",b="pointer"),_=g==null?h:gI(g),y=p==null?h:gI(p),h=new m(C,b+"leave",g,t,u),h.target=_,h.relatedTarget=y,C=null,pE(u)===c&&(m=new m(v,b+"enter",p,t,u),m.target=y,m.relatedTarget=_,C=m),_=C,g&&p)t:{for(m=g,v=p,b=0,y=m;y;y=dT(y))b++;for(y=0,C=v;C;C=dT(C))y++;for(;0<b-y;)m=dT(m),b--;for(;0<y-b;)v=dT(v),y--;for(;b--;){if(m===v||v!==null&&m===v.alternate)break t;m=dT(m),v=dT(v)}m=null}else m=null;g!==null&&Z0e(d,h,g,m,!1),p!==null&&_!==null&&Z0e(d,_,p,m,!0)}}e:{if(h=c?gI(c):window,g=h.nodeName&&h.nodeName.toLowerCase(),g==="select"||g==="input"&&h.type==="file")var x=Nat;else if(j0e(h))if(dPe)x=Fat;else{x=Pat;var k=Oat}else(g=h.nodeName)&&g.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(x=Mat);if(x&&(x=x(n,c))){uPe(d,x,t,u);break e}k&&k(n,h,c),n==="focusout"&&(k=h._wrapperState)&&k.controlled&&h.type==="number"&&tee(h,"number",h.value)}switch(k=c?gI(c):window,n){case"focusin":(j0e(k)||k.contentEditable==="true")&&(hI=k,fee=c,XN=null);break;case"focusout":XN=fee=hI=null;break;case"mousedown":gee=!0;break;case"contextmenu":case"mouseup":case"dragend":gee=!1,Y0e(d,t,u);break;case"selectionchange":if(Vat)break;case"keydown":case"keyup":Y0e(d,t,u)}var I;if(xue)e:{switch(n){case"compositionstart":var L="onCompositionStart";break e;case"compositionend":L="onCompositionEnd";break e;case"compositionupdate":L="onCompositionUpdate";break e}L=void 0}else dI?lPe(n,t)&&(L="onCompositionEnd"):n==="keydown"&&t.keyCode===229&&(L="onCompositionStart");L&&(aPe&&t.locale!=="ko"&&(dI||L!=="onCompositionStart"?L==="onCompositionEnd"&&dI&&(I=sPe()):(F1=u,wue="value"in F1?F1.value:F1.textContent,dI=!0)),k=p9(c,L),0<k.length&&(L=new V0e(L,n,null,t,u),d.push({event:L,listeners:k}),I?L.data=I:(I=cPe(t),I!==null&&(L.data=I)))),(I=Iat?Lat(n,t):Dat(n,t))&&(c=p9(c,"onBeforeInput"),0<c.length&&(u=new V0e("onBeforeInput","beforeinput",null,t,u),d.push({event:u,listeners:c}),u.data=I))}CPe(d,e)})}function bP(n,e,t){return{instance:n,listener:e,currentTarget:t}}function p9(n,e){for(var t=e+"Capture",i=[];n!==null;){var r=n,o=r.stateNode;r.tag===5&&o!==null&&(r=o,o=hP(n,t),o!=null&&i.unshift(bP(n,o,r)),o=hP(n,e),o!=null&&i.push(bP(n,o,r))),n=n.return}return i}function dT(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function Z0e(n,e,t,i,r){for(var o=e._reactName,s=[];t!==null&&t!==i;){var a=t,l=a.alternate,c=a.stateNode;if(l!==null&&l===i)break;a.tag===5&&c!==null&&(a=c,r?(l=hP(t,o),l!=null&&s.unshift(bP(t,l,a))):r||(l=hP(t,o),l!=null&&s.push(bP(t,l,a)))),t=t.return}s.length!==0&&n.push({event:e,listeners:s})}var jat=/\r\n?/g,Uat=/\u0000|\uFFFD/g;function J0e(n){return(typeof n=="string"?n:""+n).replace(jat,`
`).replace(Uat,"")}function JF(n,e,t){if(e=J0e(e),J0e(n)!==e&&t)throw Error(fn(425))}function m9(){}var pee=null,mee=null;function _ee(n,e){return n==="textarea"||n==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var vee=typeof setTimeout=="function"?setTimeout:void 0,qat=typeof clearTimeout=="function"?clearTimeout:void 0,e1e=typeof Promise=="function"?Promise:void 0,Kat=typeof queueMicrotask=="function"?queueMicrotask:typeof e1e<"u"?function(n){return e1e.resolve(null).then(n).catch(Gat)}:vee;function Gat(n){setTimeout(function(){throw n})}function aY(n,e){var t=e,i=0;do{var r=t.nextSibling;if(n.removeChild(t),r&&r.nodeType===8)if(t=r.data,t==="/$"){if(i===0){n.removeChild(r),pP(e);return}i--}else t!=="$"&&t!=="$?"&&t!=="$!"||i++;t=r}while(t);pP(e)}function dC(n){for(;n!=null;n=n.nextSibling){var e=n.nodeType;if(e===1||e===3)break;if(e===8){if(e=n.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return n}function t1e(n){n=n.previousSibling;for(var e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="$"||t==="$!"||t==="$?"){if(e===0)return n;e--}else t==="/$"&&e++}n=n.previousSibling}return null}var P2=Math.random().toString(36).slice(2),pv="__reactFiber$"+P2,yP="__reactProps$"+P2,o0="__reactContainer$"+P2,bee="__reactEvents$"+P2,Yat="__reactListeners$"+P2,Qat="__reactHandles$"+P2;function pE(n){var e=n[pv];if(e)return e;for(var t=n.parentNode;t;){if(e=t[o0]||t[pv]){if(t=e.alternate,e.child!==null||t!==null&&t.child!==null)for(n=t1e(n);n!==null;){if(t=n[pv])return t;n=t1e(n)}return e}n=t,t=n.parentNode}return null}function Q4(n){return n=n[pv]||n[o0],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function gI(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(fn(33))}function LW(n){return n[yP]||null}var yee=[],pI=-1;function Rw(n){return{current:n}}function Na(n){0>pI||(n.current=yee[pI],yee[pI]=null,pI--)}function wa(n,e){pI++,yee[pI]=n.current,n.current=e}var qC={},Td=Rw(qC),Qh=Rw(!1),lx=qC;function JL(n,e){var t=n.type.contextTypes;if(!t)return qC;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r={},o;for(o in t)r[o]=e[o];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=r),r}function Xh(n){return n=n.childContextTypes,n!=null}function _9(){Na(Qh),Na(Td)}function n1e(n,e,t){if(Td.current!==qC)throw Error(fn(168));wa(Td,e),wa(Qh,t)}function SPe(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var r in i)if(!(r in e))throw Error(fn(108,Ost(n)||"Unknown",r));return rl({},t,i)}function v9(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||qC,lx=Td.current,wa(Td,n),wa(Qh,Qh.current),!0}function i1e(n,e,t){var i=n.stateNode;if(!i)throw Error(fn(169));t?(n=SPe(n,e,lx),i.__reactInternalMemoizedMergedChildContext=n,Na(Qh),Na(Td),wa(Td,n)):Na(Qh),wa(Qh,t)}var gy=null,DW=!1,lY=!1;function EPe(n){gy===null?gy=[n]:gy.push(n)}function Xat(n){DW=!0,EPe(n)}function Nw(){if(!lY&&gy!==null){lY=!0;var n=0,e=Rs;try{var t=gy;for(Rs=1;n<t.length;n++){var i=t[n];do i=i(!0);while(i!==null)}gy=null,DW=!1}catch(r){throw gy!==null&&(gy=gy.slice(n+1)),YOe(vue,Nw),r}finally{Rs=e,lY=!1}}return null}var mI=[],_I=0,b9=null,y9=0,up=[],dp=0,cx=null,Ty=1,Iy="";function NS(n,e){mI[_I++]=y9,mI[_I++]=b9,b9=n,y9=e}function xPe(n,e,t){up[dp++]=Ty,up[dp++]=Iy,up[dp++]=cx,cx=n;var i=Ty;n=Iy;var r=32-s_(i)-1;i&=~(1<<r),t+=1;var o=32-s_(e)+r;if(30<o){var s=r-r%5;o=(i&(1<<s)-1).toString(32),i>>=s,r-=s,Ty=1<<32-s_(e)+r|t<<r|i,Iy=o+n}else Ty=1<<o|t<<r|i,Iy=n}function Tue(n){n.return!==null&&(NS(n,1),xPe(n,1,0))}function Iue(n){for(;n===b9;)b9=mI[--_I],mI[_I]=null,y9=mI[--_I],mI[_I]=null;for(;n===cx;)cx=up[--dp],up[dp]=null,Iy=up[--dp],up[dp]=null,Ty=up[--dp],up[dp]=null}var lg=null,Zf=null,Ha=!1,Vm=null;function kPe(n,e){var t=gp(5,null,null,0);t.elementType="DELETED",t.stateNode=e,t.return=n,e=n.deletions,e===null?(n.deletions=[t],n.flags|=16):e.push(t)}function r1e(n,e){switch(n.tag){case 5:var t=n.type;return e=e.nodeType!==1||t.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(n.stateNode=e,lg=n,Zf=dC(e.firstChild),!0):!1;case 6:return e=n.pendingProps===""||e.nodeType!==3?null:e,e!==null?(n.stateNode=e,lg=n,Zf=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(t=cx!==null?{id:Ty,overflow:Iy}:null,n.memoizedState={dehydrated:e,treeContext:t,retryLane:1073741824},t=gp(18,null,null,0),t.stateNode=e,t.return=n,n.child=t,lg=n,Zf=null,!0):!1;default:return!1}}function Cee(n){return(n.mode&1)!==0&&(n.flags&128)===0}function wee(n){if(Ha){var e=Zf;if(e){var t=e;if(!r1e(n,e)){if(Cee(n))throw Error(fn(418));e=dC(t.nextSibling);var i=lg;e&&r1e(n,e)?kPe(i,t):(n.flags=n.flags&-4097|2,Ha=!1,lg=n)}}else{if(Cee(n))throw Error(fn(418));n.flags=n.flags&-4097|2,Ha=!1,lg=n}}}function o1e(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;lg=n}function e6(n){if(n!==lg)return!1;if(!Ha)return o1e(n),Ha=!0,!1;var e;if((e=n.tag!==3)&&!(e=n.tag!==5)&&(e=n.type,e=e!=="head"&&e!=="body"&&!_ee(n.type,n.memoizedProps)),e&&(e=Zf)){if(Cee(n))throw TPe(),Error(fn(418));for(;e;)kPe(n,e),e=dC(e.nextSibling)}if(o1e(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(fn(317));e:{for(n=n.nextSibling,e=0;n;){if(n.nodeType===8){var t=n.data;if(t==="/$"){if(e===0){Zf=dC(n.nextSibling);break e}e--}else t!=="$"&&t!=="$!"&&t!=="$?"||e++}n=n.nextSibling}Zf=null}}else Zf=lg?dC(n.stateNode.nextSibling):null;return!0}function TPe(){for(var n=Zf;n;)n=dC(n.nextSibling)}function eD(){Zf=lg=null,Ha=!1}function Lue(n){Vm===null?Vm=[n]:Vm.push(n)}var Zat=S0.ReactCurrentBatchConfig;function Lm(n,e){if(n&&n.defaultProps){e=rl({},e),n=n.defaultProps;for(var t in n)e[t]===void 0&&(e[t]=n[t]);return e}return e}var C9=Rw(null),w9=null,vI=null,Due=null;function Aue(){Due=vI=w9=null}function Rue(n){var e=C9.current;Na(C9),n._currentValue=e}function See(n,e,t){for(;n!==null;){var i=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),n===t)break;n=n.return}}function cL(n,e){w9=n,Due=vI=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(Hh=!0),n.firstContext=null)}function Np(n){var e=n._currentValue;if(Due!==n)if(n={context:n,memoizedValue:e,next:null},vI===null){if(w9===null)throw Error(fn(308));vI=n,w9.dependencies={lanes:0,firstContext:n}}else vI=vI.next=n;return e}var mE=null;function Nue(n){mE===null?mE=[n]:mE.push(n)}function IPe(n,e,t,i){var r=e.interleaved;return r===null?(t.next=t,Nue(e)):(t.next=r.next,r.next=t),e.interleaved=t,s0(n,i)}function s0(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var _1=!1;function Oue(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function LPe(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function jy(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function hC(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,Go&2){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,s0(n,t)}return r=i.interleaved,r===null?(e.next=e,Nue(i)):(e.next=r.next,r.next=e),i.interleaved=e,s0(n,t)}function B$(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,bue(n,t)}}function s1e(n,e){var t=n.updateQueue,i=n.alternate;if(i!==null&&(i=i.updateQueue,t===i)){var r=null,o=null;if(t=t.firstBaseUpdate,t!==null){do{var s={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};o===null?r=o=s:o=o.next=s,t=t.next}while(t!==null);o===null?r=o=e:o=o.next=e}else r=o=e;t={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:i.shared,effects:i.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function S9(n,e,t,i){var r=n.updateQueue;_1=!1;var o=r.firstBaseUpdate,s=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?o=c:s.next=c,s=l;var u=n.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(o!==null){var d=r.baseState;s=0,u=c=l=null,a=o;do{var h=a.lane,g=a.eventTime;if((i&h)===h){u!==null&&(u=u.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=n,m=a;switch(h=e,g=t,m.tag){case 1:if(p=m.payload,typeof p=="function"){d=p.call(g,d,h);break e}d=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=m.payload,h=typeof p=="function"?p.call(g,d,h):p,h==null)break e;d=rl({},d,h);break e;case 2:_1=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,h=r.effects,h===null?r.effects=[a]:h.push(a))}else g={eventTime:g,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=g,l=d):u=u.next=g,s|=h;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;h=a,a=h.next,h.next=null,r.lastBaseUpdate=h,r.shared.pending=null}}while(1);if(u===null&&(l=d),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=u,e=r.shared.interleaved,e!==null){r=e;do s|=r.lane,r=r.next;while(r!==e)}else o===null&&(r.shared.lanes=0);dx|=s,n.lanes=s,n.memoizedState=d}}function a1e(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;e<n.length;e++){var i=n[e],r=i.callback;if(r!==null){if(i.callback=null,i=t,typeof r!="function")throw Error(fn(191,r));r.call(i)}}}var DPe=new IOe.Component().refs;function Eee(n,e,t,i){e=n.memoizedState,t=t(i,e),t=t==null?e:rl({},e,t),n.memoizedState=t,n.lanes===0&&(n.updateQueue.baseState=t)}var AW={isMounted:function(n){return(n=n._reactInternals)?dk(n)===n:!1},enqueueSetState:function(n,e,t){n=n._reactInternals;var i=eh(),r=gC(n),o=jy(i,r);o.payload=e,t!=null&&(o.callback=t),e=hC(n,o,r),e!==null&&(a_(e,n,r,i),B$(e,n,r))},enqueueReplaceState:function(n,e,t){n=n._reactInternals;var i=eh(),r=gC(n),o=jy(i,r);o.tag=1,o.payload=e,t!=null&&(o.callback=t),e=hC(n,o,r),e!==null&&(a_(e,n,r,i),B$(e,n,r))},enqueueForceUpdate:function(n,e){n=n._reactInternals;var t=eh(),i=gC(n),r=jy(t,i);r.tag=2,e!=null&&(r.callback=e),e=hC(n,r,i),e!==null&&(a_(e,n,i,t),B$(e,n,i))}};function l1e(n,e,t,i,r,o,s){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(i,o,s):e.prototype&&e.prototype.isPureReactComponent?!_P(t,i)||!_P(r,o):!0}function APe(n,e,t){var i=!1,r=qC,o=e.contextType;return typeof o=="object"&&o!==null?o=Np(o):(r=Xh(e)?lx:Td.current,i=e.contextTypes,o=(i=i!=null)?JL(n,r):qC),e=new e(t,o),n.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=AW,n.stateNode=e,e._reactInternals=n,i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=r,n.__reactInternalMemoizedMaskedChildContext=o),e}function c1e(n,e,t,i){n=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(t,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(t,i),e.state!==n&&AW.enqueueReplaceState(e,e.state,null)}function xee(n,e,t,i){var r=n.stateNode;r.props=t,r.state=n.memoizedState,r.refs=DPe,Oue(n);var o=e.contextType;typeof o=="object"&&o!==null?r.context=Np(o):(o=Xh(e)?lx:Td.current,r.context=JL(n,o)),r.state=n.memoizedState,o=e.getDerivedStateFromProps,typeof o=="function"&&(Eee(n,e,o,t),r.state=n.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(e=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),e!==r.state&&AW.enqueueReplaceState(r,r.state,null),S9(n,t,r,i),r.state=n.memoizedState),typeof r.componentDidMount=="function"&&(n.flags|=4194308)}function cR(n,e,t){if(n=t.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(t._owner){if(t=t._owner,t){if(t.tag!==1)throw Error(fn(309));var i=t.stateNode}if(!i)throw Error(fn(147,n));var r=i,o=""+n;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===o?e.ref:(e=function(s){var a=r.refs;a===DPe&&(a=r.refs={}),s===null?delete a[o]:a[o]=s},e._stringRef=o,e)}if(typeof n!="string")throw Error(fn(284));if(!t._owner)throw Error(fn(290,n))}return n}function t6(n,e){throw n=Object.prototype.toString.call(e),Error(fn(31,n==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":n))}function u1e(n){var e=n._init;return e(n._payload)}function RPe(n){function e(v,b){if(n){var y=v.deletions;y===null?(v.deletions=[b],v.flags|=16):y.push(b)}}function t(v,b){if(!n)return null;for(;b!==null;)e(v,b),b=b.sibling;return null}function i(v,b){for(v=new Map;b!==null;)b.key!==null?v.set(b.key,b):v.set(b.index,b),b=b.sibling;return v}function r(v,b){return v=pC(v,b),v.index=0,v.sibling=null,v}function o(v,b,y){return v.index=y,n?(y=v.alternate,y!==null?(y=y.index,y<b?(v.flags|=2,b):y):(v.flags|=2,b)):(v.flags|=1048576,b)}function s(v){return n&&v.alternate===null&&(v.flags|=2),v}function a(v,b,y,C){return b===null||b.tag!==6?(b=pY(y,v.mode,C),b.return=v,b):(b=r(b,y),b.return=v,b)}function l(v,b,y,C){var x=y.type;return x===uI?u(v,b,y.props.children,C,y.key):b!==null&&(b.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===m1&&u1e(x)===b.type)?(C=r(b,y.props),C.ref=cR(v,b,y),C.return=v,C):(C=j$(y.type,y.key,y.props,null,v.mode,C),C.ref=cR(v,b,y),C.return=v,C)}function c(v,b,y,C){return b===null||b.tag!==4||b.stateNode.containerInfo!==y.containerInfo||b.stateNode.implementation!==y.implementation?(b=mY(y,v.mode,C),b.return=v,b):(b=r(b,y.children||[]),b.return=v,b)}function u(v,b,y,C,x){return b===null||b.tag!==7?(b=FE(y,v.mode,C,x),b.return=v,b):(b=r(b,y),b.return=v,b)}function d(v,b,y){if(typeof b=="string"&&b!==""||typeof b=="number")return b=pY(""+b,v.mode,y),b.return=v,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case jF:return y=j$(b.type,b.key,b.props,null,v.mode,y),y.ref=cR(v,null,b),y.return=v,y;case cI:return b=mY(b,v.mode,y),b.return=v,b;case m1:var C=b._init;return d(v,C(b._payload),y)}if(hN(b)||rR(b))return b=FE(b,v.mode,y,null),b.return=v,b;t6(v,b)}return null}function h(v,b,y,C){var x=b!==null?b.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return x!==null?null:a(v,b,""+y,C);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case jF:return y.key===x?l(v,b,y,C):null;case cI:return y.key===x?c(v,b,y,C):null;case m1:return x=y._init,h(v,b,x(y._payload),C)}if(hN(y)||rR(y))return x!==null?null:u(v,b,y,C,null);t6(v,y)}return null}function g(v,b,y,C,x){if(typeof C=="string"&&C!==""||typeof C=="number")return v=v.get(y)||null,a(b,v,""+C,x);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case jF:return v=v.get(C.key===null?y:C.key)||null,l(b,v,C,x);case cI:return v=v.get(C.key===null?y:C.key)||null,c(b,v,C,x);case m1:var k=C._init;return g(v,b,y,k(C._payload),x)}if(hN(C)||rR(C))return v=v.get(y)||null,u(b,v,C,x,null);t6(b,C)}return null}function p(v,b,y,C){for(var x=null,k=null,I=b,L=b=0,D=null;I!==null&&L<y.length;L++){I.index>L?(D=I,I=null):D=I.sibling;var R=h(v,I,y[L],C);if(R===null){I===null&&(I=D);break}n&&I&&R.alternate===null&&e(v,I),b=o(R,b,L),k===null?x=R:k.sibling=R,k=R,I=D}if(L===y.length)return t(v,I),Ha&&NS(v,L),x;if(I===null){for(;L<y.length;L++)I=d(v,y[L],C),I!==null&&(b=o(I,b,L),k===null?x=I:k.sibling=I,k=I);return Ha&&NS(v,L),x}for(I=i(v,I);L<y.length;L++)D=g(I,v,L,y[L],C),D!==null&&(n&&D.alternate!==null&&I.delete(D.key===null?L:D.key),b=o(D,b,L),k===null?x=D:k.sibling=D,k=D);return n&&I.forEach(function(P){return e(v,P)}),Ha&&NS(v,L),x}function m(v,b,y,C){var x=rR(y);if(typeof x!="function")throw Error(fn(150));if(y=x.call(y),y==null)throw Error(fn(151));for(var k=x=null,I=b,L=b=0,D=null,R=y.next();I!==null&&!R.done;L++,R=y.next()){I.index>L?(D=I,I=null):D=I.sibling;var P=h(v,I,R.value,C);if(P===null){I===null&&(I=D);break}n&&I&&P.alternate===null&&e(v,I),b=o(P,b,L),k===null?x=P:k.sibling=P,k=P,I=D}if(R.done)return t(v,I),Ha&&NS(v,L),x;if(I===null){for(;!R.done;L++,R=y.next())R=d(v,R.value,C),R!==null&&(b=o(R,b,L),k===null?x=R:k.sibling=R,k=R);return Ha&&NS(v,L),x}for(I=i(v,I);!R.done;L++,R=y.next())R=g(I,v,L,R.value,C),R!==null&&(n&&R.alternate!==null&&I.delete(R.key===null?L:R.key),b=o(R,b,L),k===null?x=R:k.sibling=R,k=R);return n&&I.forEach(function(M){return e(v,M)}),Ha&&NS(v,L),x}function _(v,b,y,C){if(typeof y=="object"&&y!==null&&y.type===uI&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case jF:e:{for(var x=y.key,k=b;k!==null;){if(k.key===x){if(x=y.type,x===uI){if(k.tag===7){t(v,k.sibling),b=r(k,y.props.children),b.return=v,v=b;break e}}else if(k.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===m1&&u1e(x)===k.type){t(v,k.sibling),b=r(k,y.props),b.ref=cR(v,k,y),b.return=v,v=b;break e}t(v,k);break}else e(v,k);k=k.sibling}y.type===uI?(b=FE(y.props.children,v.mode,C,y.key),b.return=v,v=b):(C=j$(y.type,y.key,y.props,null,v.mode,C),C.ref=cR(v,b,y),C.return=v,v=C)}return s(v);case cI:e:{for(k=y.key;b!==null;){if(b.key===k)if(b.tag===4&&b.stateNode.containerInfo===y.containerInfo&&b.stateNode.implementation===y.implementation){t(v,b.sibling),b=r(b,y.children||[]),b.return=v,v=b;break e}else{t(v,b);break}else e(v,b);b=b.sibling}b=mY(y,v.mode,C),b.return=v,v=b}return s(v);case m1:return k=y._init,_(v,b,k(y._payload),C)}if(hN(y))return p(v,b,y,C);if(rR(y))return m(v,b,y,C);t6(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,b!==null&&b.tag===6?(t(v,b.sibling),b=r(b,y),b.return=v,v=b):(t(v,b),b=pY(y,v.mode,C),b.return=v,v=b),s(v)):t(v,b)}return _}var tD=RPe(!0),NPe=RPe(!1),X4={},zv=Rw(X4),CP=Rw(X4),wP=Rw(X4);function _E(n){if(n===X4)throw Error(fn(174));return n}function Pue(n,e){switch(wa(wP,e),wa(CP,n),wa(zv,X4),n=e.nodeType,n){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:iee(null,"");break;default:n=n===8?e.parentNode:e,e=n.namespaceURI||null,n=n.tagName,e=iee(e,n)}Na(zv),wa(zv,e)}function nD(){Na(zv),Na(CP),Na(wP)}function OPe(n){_E(wP.current);var e=_E(zv.current),t=iee(e,n.type);e!==t&&(wa(CP,n),wa(zv,t))}function Mue(n){CP.current===n&&(Na(zv),Na(CP))}var Xa=Rw(0);function E9(n){for(var e=n;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var cY=[];function Fue(){for(var n=0;n<cY.length;n++)cY[n]._workInProgressVersionPrimary=null;cY.length=0}var $$=S0.ReactCurrentDispatcher,uY=S0.ReactCurrentBatchConfig,ux=0,nl=null,Tc=null,nu=null,x9=!1,ZN=!1,SP=0,Jat=0;function ad(){throw Error(fn(321))}function Bue(n,e){if(e===null)return!1;for(var t=0;t<e.length&&t<n.length;t++)if(!v_(n[t],e[t]))return!1;return!0}function $ue(n,e,t,i,r,o){if(ux=o,nl=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,$$.current=n===null||n.memoizedState===null?ilt:rlt,n=t(i,r),ZN){o=0;do{if(ZN=!1,SP=0,25<=o)throw Error(fn(301));o+=1,nu=Tc=null,e.updateQueue=null,$$.current=olt,n=t(i,r)}while(ZN)}if($$.current=k9,e=Tc!==null&&Tc.next!==null,ux=0,nu=Tc=nl=null,x9=!1,e)throw Error(fn(300));return n}function Vue(){var n=SP!==0;return SP=0,n}function ev(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nu===null?nl.memoizedState=nu=n:nu=nu.next=n,nu}function Op(){if(Tc===null){var n=nl.alternate;n=n!==null?n.memoizedState:null}else n=Tc.next;var e=nu===null?nl.memoizedState:nu.next;if(e!==null)nu=e,Tc=n;else{if(n===null)throw Error(fn(310));Tc=n,n={memoizedState:Tc.memoizedState,baseState:Tc.baseState,baseQueue:Tc.baseQueue,queue:Tc.queue,next:null},nu===null?nl.memoizedState=nu=n:nu=nu.next=n}return nu}function EP(n,e){return typeof e=="function"?e(n):e}function dY(n){var e=Op(),t=e.queue;if(t===null)throw Error(fn(311));t.lastRenderedReducer=n;var i=Tc,r=i.baseQueue,o=t.pending;if(o!==null){if(r!==null){var s=r.next;r.next=o.next,o.next=s}i.baseQueue=r=o,t.pending=null}if(r!==null){o=r.next,i=i.baseState;var a=s=null,l=null,c=o;do{var u=c.lane;if((ux&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),i=c.hasEagerState?c.eagerState:n(i,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,s=i):l=l.next=d,nl.lanes|=u,dx|=u}c=c.next}while(c!==null&&c!==o);l===null?s=i:l.next=a,v_(i,e.memoizedState)||(Hh=!0),e.memoizedState=i,e.baseState=s,e.baseQueue=l,t.lastRenderedState=i}if(n=t.interleaved,n!==null){r=n;do o=r.lane,nl.lanes|=o,dx|=o,r=r.next;while(r!==n)}else r===null&&(t.lanes=0);return[e.memoizedState,t.dispatch]}function hY(n){var e=Op(),t=e.queue;if(t===null)throw Error(fn(311));t.lastRenderedReducer=n;var i=t.dispatch,r=t.pending,o=e.memoizedState;if(r!==null){t.pending=null;var s=r=r.next;do o=n(o,s.action),s=s.next;while(s!==r);v_(o,e.memoizedState)||(Hh=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),t.lastRenderedState=o}return[o,i]}function PPe(){}function MPe(n,e){var t=nl,i=Op(),r=e(),o=!v_(i.memoizedState,r);if(o&&(i.memoizedState=r,Hh=!0),i=i.queue,Hue($Pe.bind(null,t,i,n),[n]),i.getSnapshot!==e||o||nu!==null&&nu.memoizedState.tag&1){if(t.flags|=2048,xP(9,BPe.bind(null,t,i,r,e),void 0,null),lu===null)throw Error(fn(349));ux&30||FPe(t,e,r)}return r}function FPe(n,e,t){n.flags|=16384,n={getSnapshot:e,value:t},e=nl.updateQueue,e===null?(e={lastEffect:null,stores:null},nl.updateQueue=e,e.stores=[n]):(t=e.stores,t===null?e.stores=[n]:t.push(n))}function BPe(n,e,t,i){e.value=t,e.getSnapshot=i,VPe(e)&&HPe(n)}function $Pe(n,e,t){return t(function(){VPe(e)&&HPe(n)})}function VPe(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!v_(n,t)}catch{return!0}}function HPe(n){var e=s0(n,1);e!==null&&a_(e,n,1,-1)}function d1e(n){var e=ev();return typeof n=="function"&&(n=n()),e.memoizedState=e.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:EP,lastRenderedState:n},e.queue=n,n=n.dispatch=nlt.bind(null,nl,n),[e.memoizedState,n]}function xP(n,e,t,i){return n={tag:n,create:e,destroy:t,deps:i,next:null},e=nl.updateQueue,e===null?(e={lastEffect:null,stores:null},nl.updateQueue=e,e.lastEffect=n.next=n):(t=e.lastEffect,t===null?e.lastEffect=n.next=n:(i=t.next,t.next=n,n.next=i,e.lastEffect=n)),n}function WPe(){return Op().memoizedState}function V$(n,e,t,i){var r=ev();nl.flags|=n,r.memoizedState=xP(1|e,t,void 0,i===void 0?null:i)}function RW(n,e,t,i){var r=Op();i=i===void 0?null:i;var o=void 0;if(Tc!==null){var s=Tc.memoizedState;if(o=s.destroy,i!==null&&Bue(i,s.deps)){r.memoizedState=xP(e,t,o,i);return}}nl.flags|=n,r.memoizedState=xP(1|e,t,o,i)}function h1e(n,e){return V$(8390656,8,n,e)}function Hue(n,e){return RW(2048,8,n,e)}function zPe(n,e){return RW(4,2,n,e)}function jPe(n,e){return RW(4,4,n,e)}function UPe(n,e){if(typeof e=="function")return n=n(),e(n),function(){e(null)};if(e!=null)return n=n(),e.current=n,function(){e.current=null}}function qPe(n,e,t){return t=t!=null?t.concat([n]):null,RW(4,4,UPe.bind(null,e,n),t)}function Wue(){}function KPe(n,e){var t=Op();e=e===void 0?null:e;var i=t.memoizedState;return i!==null&&e!==null&&Bue(e,i[1])?i[0]:(t.memoizedState=[n,e],n)}function GPe(n,e){var t=Op();e=e===void 0?null:e;var i=t.memoizedState;return i!==null&&e!==null&&Bue(e,i[1])?i[0]:(n=n(),t.memoizedState=[n,e],n)}function YPe(n,e,t){return ux&21?(v_(t,e)||(t=ZOe(),nl.lanes|=t,dx|=t,n.baseState=!0),e):(n.baseState&&(n.baseState=!1,Hh=!0),n.memoizedState=t)}function elt(n,e){var t=Rs;Rs=t!==0&&4>t?t:4,n(!0);var i=uY.transition;uY.transition={};try{n(!1),e()}finally{Rs=t,uY.transition=i}}function QPe(){return Op().memoizedState}function tlt(n,e,t){var i=gC(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},XPe(n))ZPe(e,t);else if(t=IPe(n,e,t,i),t!==null){var r=eh();a_(t,n,i,r),JPe(t,e,i)}}function nlt(n,e,t){var i=gC(n),r={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(XPe(n))ZPe(e,r);else{var o=n.alternate;if(n.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,t);if(r.hasEagerState=!0,r.eagerState=a,v_(a,s)){var l=e.interleaved;l===null?(r.next=r,Nue(e)):(r.next=l.next,l.next=r),e.interleaved=r;return}}catch{}finally{}t=IPe(n,e,r,i),t!==null&&(r=eh(),a_(t,n,i,r),JPe(t,e,i))}}function XPe(n){var e=n.alternate;return n===nl||e!==null&&e===nl}function ZPe(n,e){ZN=x9=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function JPe(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,bue(n,t)}}var k9={readContext:Np,useCallback:ad,useContext:ad,useEffect:ad,useImperativeHandle:ad,useInsertionEffect:ad,useLayoutEffect:ad,useMemo:ad,useReducer:ad,useRef:ad,useState:ad,useDebugValue:ad,useDeferredValue:ad,useTransition:ad,useMutableSource:ad,useSyncExternalStore:ad,useId:ad,unstable_isNewReconciler:!1},ilt={readContext:Np,useCallback:function(n,e){return ev().memoizedState=[n,e===void 0?null:e],n},useContext:Np,useEffect:h1e,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,V$(4194308,4,UPe.bind(null,e,n),t)},useLayoutEffect:function(n,e){return V$(4194308,4,n,e)},useInsertionEffect:function(n,e){return V$(4,2,n,e)},useMemo:function(n,e){var t=ev();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=ev();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=tlt.bind(null,nl,n),[i.memoizedState,n]},useRef:function(n){var e=ev();return n={current:n},e.memoizedState=n},useState:d1e,useDebugValue:Wue,useDeferredValue:function(n){return ev().memoizedState=n},useTransition:function(){var n=d1e(!1),e=n[0];return n=elt.bind(null,n[1]),ev().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=nl,r=ev();if(Ha){if(t===void 0)throw Error(fn(407));t=t()}else{if(t=e(),lu===null)throw Error(fn(349));ux&30||FPe(i,e,t)}r.memoizedState=t;var o={value:t,getSnapshot:e};return r.queue=o,h1e($Pe.bind(null,i,o,n),[n]),i.flags|=2048,xP(9,BPe.bind(null,i,o,t,e),void 0,null),t},useId:function(){var n=ev(),e=lu.identifierPrefix;if(Ha){var t=Iy,i=Ty;t=(i&~(1<<32-s_(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=SP++,0<t&&(e+="H"+t.toString(32)),e+=":"}else t=Jat++,e=":"+e+"r"+t.toString(32)+":";return n.memoizedState=e},unstable_isNewReconciler:!1},rlt={readContext:Np,useCallback:KPe,useContext:Np,useEffect:Hue,useImperativeHandle:qPe,useInsertionEffect:zPe,useLayoutEffect:jPe,useMemo:GPe,useReducer:dY,useRef:WPe,useState:function(){return dY(EP)},useDebugValue:Wue,useDeferredValue:function(n){var e=Op();return YPe(e,Tc.memoizedState,n)},useTransition:function(){var n=dY(EP)[0],e=Op().memoizedState;return[n,e]},useMutableSource:PPe,useSyncExternalStore:MPe,useId:QPe,unstable_isNewReconciler:!1},olt={readContext:Np,useCallback:KPe,useContext:Np,useEffect:Hue,useImperativeHandle:qPe,useInsertionEffect:zPe,useLayoutEffect:jPe,useMemo:GPe,useReducer:hY,useRef:WPe,useState:function(){return hY(EP)},useDebugValue:Wue,useDeferredValue:function(n){var e=Op();return Tc===null?e.memoizedState=n:YPe(e,Tc.memoizedState,n)},useTransition:function(){var n=hY(EP)[0],e=Op().memoizedState;return[n,e]},useMutableSource:PPe,useSyncExternalStore:MPe,useId:QPe,unstable_isNewReconciler:!1};function iD(n,e){try{var t="",i=e;do t+=Nst(i),i=i.return;while(i);var r=t}catch(o){r=`
Error generating stack: `+o.message+`
`+o.stack}return{value:n,source:e,stack:r,digest:null}}function fY(n,e,t){return{value:n,source:null,stack:t??null,digest:e??null}}function kee(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var slt=typeof WeakMap=="function"?WeakMap:Map;function eMe(n,e,t){t=jy(-1,t),t.tag=3,t.payload={element:null};var i=e.value;return t.callback=function(){I9||(I9=!0,Mee=i),kee(n,e)},t}function tMe(n,e,t){t=jy(-1,t),t.tag=3;var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var r=e.value;t.payload=function(){return i(r)},t.callback=function(){kee(n,e)}}var o=n.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(t.callback=function(){kee(n,e),typeof i!="function"&&(fC===null?fC=new Set([this]):fC.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),t}function f1e(n,e,t){var i=n.pingCache;if(i===null){i=n.pingCache=new slt;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(t)||(r.add(t),n=ylt.bind(null,n,e,t),e.then(n,n))}function g1e(n){do{var e;if((e=n.tag===13)&&(e=n.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return n;n=n.return}while(n!==null);return null}function p1e(n,e,t,i,r){return n.mode&1?(n.flags|=65536,n.lanes=r,n):(n===e?n.flags|=65536:(n.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=jy(-1,1),e.tag=2,hC(t,e,1))),t.lanes|=1),n)}var alt=S0.ReactCurrentOwner,Hh=!1;function Ud(n,e,t,i){e.child=n===null?NPe(e,null,t,i):tD(e,n.child,t,i)}function m1e(n,e,t,i,r){t=t.render;var o=e.ref;return cL(e,r),i=$ue(n,e,t,i,o,r),t=Vue(),n!==null&&!Hh?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,a0(n,e,r)):(Ha&&t&&Tue(e),e.flags|=1,Ud(n,e,i,r),e.child)}function _1e(n,e,t,i,r){if(n===null){var o=t.type;return typeof o=="function"&&!Que(o)&&o.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=o,nMe(n,e,o,i,r)):(n=j$(t.type,null,i,e,e.mode,r),n.ref=e.ref,n.return=e,e.child=n)}if(o=n.child,!(n.lanes&r)){var s=o.memoizedProps;if(t=t.compare,t=t!==null?t:_P,t(s,i)&&n.ref===e.ref)return a0(n,e,r)}return e.flags|=1,n=pC(o,i),n.ref=e.ref,n.return=e,e.child=n}function nMe(n,e,t,i,r){if(n!==null){var o=n.memoizedProps;if(_P(o,i)&&n.ref===e.ref)if(Hh=!1,e.pendingProps=i=o,(n.lanes&r)!==0)n.flags&131072&&(Hh=!0);else return e.lanes=n.lanes,a0(n,e,r)}return Tee(n,e,t,i,r)}function iMe(n,e,t){var i=e.pendingProps,r=i.children,o=n!==null?n.memoizedState:null;if(i.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},wa(yI,Wf),Wf|=t;else{if(!(t&1073741824))return n=o!==null?o.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:n,cachePool:null,transitions:null},e.updateQueue=null,wa(yI,Wf),Wf|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=o!==null?o.baseLanes:t,wa(yI,Wf),Wf|=i}else o!==null?(i=o.baseLanes|t,e.memoizedState=null):i=t,wa(yI,Wf),Wf|=i;return Ud(n,e,r,t),e.child}function rMe(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function Tee(n,e,t,i,r){var o=Xh(t)?lx:Td.current;return o=JL(e,o),cL(e,r),t=$ue(n,e,t,i,o,r),i=Vue(),n!==null&&!Hh?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~r,a0(n,e,r)):(Ha&&i&&Tue(e),e.flags|=1,Ud(n,e,t,r),e.child)}function v1e(n,e,t,i,r){if(Xh(t)){var o=!0;v9(e)}else o=!1;if(cL(e,r),e.stateNode===null)H$(n,e),APe(e,t,i),xee(e,t,i,r),i=!0;else if(n===null){var s=e.stateNode,a=e.memoizedProps;s.props=a;var l=s.context,c=t.contextType;typeof c=="object"&&c!==null?c=Np(c):(c=Xh(t)?lx:Td.current,c=JL(e,c));var u=t.getDerivedStateFromProps,d=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==i||l!==c)&&c1e(e,s,i,c),_1=!1;var h=e.memoizedState;s.state=h,S9(e,i,s,r),l=e.memoizedState,a!==i||h!==l||Qh.current||_1?(typeof u=="function"&&(Eee(e,t,u,i),l=e.memoizedState),(a=_1||l1e(e,t,a,i,h,l,c))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=l),s.props=i,s.state=l,s.context=c,i=a):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{s=e.stateNode,LPe(n,e),a=e.memoizedProps,c=e.type===e.elementType?a:Lm(e.type,a),s.props=c,d=e.pendingProps,h=s.context,l=t.contextType,typeof l=="object"&&l!==null?l=Np(l):(l=Xh(t)?lx:Td.current,l=JL(e,l));var g=t.getDerivedStateFromProps;(u=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==d||h!==l)&&c1e(e,s,i,l),_1=!1,h=e.memoizedState,s.state=h,S9(e,i,s,r);var p=e.memoizedState;a!==d||h!==p||Qh.current||_1?(typeof g=="function"&&(Eee(e,t,g,i),p=e.memoizedState),(c=_1||l1e(e,t,c,i,h,p,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(i,p,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(i,p,l)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===n.memoizedProps&&h===n.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&h===n.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=p),s.props=i,s.state=p,s.context=l,i=c):(typeof s.componentDidUpdate!="function"||a===n.memoizedProps&&h===n.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&h===n.memoizedState||(e.flags|=1024),i=!1)}return Iee(n,e,t,i,o,r)}function Iee(n,e,t,i,r,o){rMe(n,e);var s=(e.flags&128)!==0;if(!i&&!s)return r&&i1e(e,t,!1),a0(n,e,o);i=e.stateNode,alt.current=e;var a=s&&typeof t.getDerivedStateFromError!="function"?null:i.render();return e.flags|=1,n!==null&&s?(e.child=tD(e,n.child,null,o),e.child=tD(e,null,a,o)):Ud(n,e,a,o),e.memoizedState=i.state,r&&i1e(e,t,!0),e.child}function oMe(n){var e=n.stateNode;e.pendingContext?n1e(n,e.pendingContext,e.pendingContext!==e.context):e.context&&n1e(n,e.context,!1),Pue(n,e.containerInfo)}function b1e(n,e,t,i,r){return eD(),Lue(r),e.flags|=256,Ud(n,e,t,i),e.child}var Lee={dehydrated:null,treeContext:null,retryLane:0};function Dee(n){return{baseLanes:n,cachePool:null,transitions:null}}function sMe(n,e,t){var i=e.pendingProps,r=Xa.current,o=!1,s=(e.flags&128)!==0,a;if((a=s)||(a=n!==null&&n.memoizedState===null?!1:(r&2)!==0),a?(o=!0,e.flags&=-129):(n===null||n.memoizedState!==null)&&(r|=1),wa(Xa,r&1),n===null)return wee(e),n=e.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(e.mode&1?n.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(s=i.children,n=i.fallback,o?(i=e.mode,o=e.child,s={mode:"hidden",children:s},!(i&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=PW(s,i,0,null),n=FE(n,i,t,null),o.return=e,n.return=e,o.sibling=n,e.child=o,e.child.memoizedState=Dee(t),e.memoizedState=Lee,n):zue(e,s));if(r=n.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return llt(n,e,s,i,a,r,t);if(o){o=i.fallback,s=e.mode,r=n.child,a=r.sibling;var l={mode:"hidden",children:i.children};return!(s&1)&&e.child!==r?(i=e.child,i.childLanes=0,i.pendingProps=l,e.deletions=null):(i=pC(r,l),i.subtreeFlags=r.subtreeFlags&14680064),a!==null?o=pC(a,o):(o=FE(o,s,t,null),o.flags|=2),o.return=e,i.return=e,i.sibling=o,e.child=i,i=o,o=e.child,s=n.child.memoizedState,s=s===null?Dee(t):{baseLanes:s.baseLanes|t,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=n.childLanes&~t,e.memoizedState=Lee,i}return o=n.child,n=o.sibling,i=pC(o,{mode:"visible",children:i.children}),!(e.mode&1)&&(i.lanes=t),i.return=e,i.sibling=null,n!==null&&(t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)),e.child=i,e.memoizedState=null,i}function zue(n,e){return e=PW({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function n6(n,e,t,i){return i!==null&&Lue(i),tD(e,n.child,null,t),n=zue(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function llt(n,e,t,i,r,o,s){if(t)return e.flags&256?(e.flags&=-257,i=fY(Error(fn(422))),n6(n,e,s,i)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(o=i.fallback,r=e.mode,i=PW({mode:"visible",children:i.children},r,0,null),o=FE(o,r,s,null),o.flags|=2,i.return=e,o.return=e,i.sibling=o,e.child=i,e.mode&1&&tD(e,n.child,null,s),e.child.memoizedState=Dee(s),e.memoizedState=Lee,o);if(!(e.mode&1))return n6(n,e,s,null);if(r.data==="$!"){if(i=r.nextSibling&&r.nextSibling.dataset,i)var a=i.dgst;return i=a,o=Error(fn(419)),i=fY(o,i,void 0),n6(n,e,s,i)}if(a=(s&n.childLanes)!==0,Hh||a){if(i=lu,i!==null){switch(s&-s){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(i.suspendedLanes|s)?0:r,r!==0&&r!==o.retryLane&&(o.retryLane=r,s0(n,r),a_(i,n,r,-1))}return Yue(),i=fY(Error(fn(421))),n6(n,e,s,i)}return r.data==="$?"?(e.flags|=128,e.child=n.child,e=Clt.bind(null,n),r._reactRetry=e,null):(n=o.treeContext,Zf=dC(r.nextSibling),lg=e,Ha=!0,Vm=null,n!==null&&(up[dp++]=Ty,up[dp++]=Iy,up[dp++]=cx,Ty=n.id,Iy=n.overflow,cx=e),e=zue(e,i.children),e.flags|=4096,e)}function y1e(n,e,t){n.lanes|=e;var i=n.alternate;i!==null&&(i.lanes|=e),See(n.return,e,t)}function gY(n,e,t,i,r){var o=n.memoizedState;o===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:t,tailMode:r}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=i,o.tail=t,o.tailMode=r)}function aMe(n,e,t){var i=e.pendingProps,r=i.revealOrder,o=i.tail;if(Ud(n,e,i.children,t),i=Xa.current,i&2)i=i&1|2,e.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&y1e(n,t,e);else if(n.tag===19)y1e(n,t,e);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}i&=1}if(wa(Xa,i),!(e.mode&1))e.memoizedState=null;else switch(r){case"forwards":for(t=e.child,r=null;t!==null;)n=t.alternate,n!==null&&E9(n)===null&&(r=t),t=t.sibling;t=r,t===null?(r=e.child,e.child=null):(r=t.sibling,t.sibling=null),gY(e,!1,r,t,o);break;case"backwards":for(t=null,r=e.child,e.child=null;r!==null;){if(n=r.alternate,n!==null&&E9(n)===null){e.child=r;break}n=r.sibling,r.sibling=t,t=r,r=n}gY(e,!0,t,null,o);break;case"together":gY(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function H$(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function a0(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),dx|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(fn(153));if(e.child!==null){for(n=e.child,t=pC(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=pC(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function clt(n,e,t){switch(e.tag){case 3:oMe(e),eD();break;case 5:OPe(e);break;case 1:Xh(e.type)&&v9(e);break;case 4:Pue(e,e.stateNode.containerInfo);break;case 10:var i=e.type._context,r=e.memoizedProps.value;wa(C9,i._currentValue),i._currentValue=r;break;case 13:if(i=e.memoizedState,i!==null)return i.dehydrated!==null?(wa(Xa,Xa.current&1),e.flags|=128,null):t&e.child.childLanes?sMe(n,e,t):(wa(Xa,Xa.current&1),n=a0(n,e,t),n!==null?n.sibling:null);wa(Xa,Xa.current&1);break;case 19:if(i=(t&e.childLanes)!==0,n.flags&128){if(i)return aMe(n,e,t);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),wa(Xa,Xa.current),i)break;return null;case 22:case 23:return e.lanes=0,iMe(n,e,t)}return a0(n,e,t)}var lMe,Aee,cMe,uMe;lMe=function(n,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)n.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}};Aee=function(){};cMe=function(n,e,t,i){var r=n.memoizedProps;if(r!==i){n=e.stateNode,_E(zv.current);var o=null;switch(t){case"input":r=JJ(n,r),i=JJ(n,i),o=[];break;case"select":r=rl({},r,{value:void 0}),i=rl({},i,{value:void 0}),o=[];break;case"textarea":r=nee(n,r),i=nee(n,i),o=[];break;default:typeof r.onClick!="function"&&typeof i.onClick=="function"&&(n.onclick=m9)}ree(t,i);var s;t=null;for(c in r)if(!i.hasOwnProperty(c)&&r.hasOwnProperty(c)&&r[c]!=null)if(c==="style"){var a=r[c];for(s in a)a.hasOwnProperty(s)&&(t||(t={}),t[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(uP.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in i){var l=i[c];if(a=r!=null?r[c]:void 0,i.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(t||(t={}),t[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(t||(t={}),t[s]=l[s])}else t||(o||(o=[]),o.push(c,t)),t=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(uP.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&ka("scroll",n),o||a===l||(o=[])):(o=o||[]).push(c,l))}t&&(o=o||[]).push("style",t);var c=o;(e.updateQueue=c)&&(e.flags|=4)}};uMe=function(n,e,t,i){t!==i&&(e.flags|=4)};function uR(n,e){if(!Ha)switch(n.tailMode){case"hidden":e=n.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?n.tail=null:t.sibling=null;break;case"collapsed":t=n.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e||n.tail===null?n.tail=null:n.tail.sibling=null:i.sibling=null}}function ld(n){var e=n.alternate!==null&&n.alternate.child===n.child,t=0,i=0;if(e)for(var r=n.child;r!==null;)t|=r.lanes|r.childLanes,i|=r.subtreeFlags&14680064,i|=r.flags&14680064,r.return=n,r=r.sibling;else for(r=n.child;r!==null;)t|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=n,r=r.sibling;return n.subtreeFlags|=i,n.childLanes=t,e}function ult(n,e,t){var i=e.pendingProps;switch(Iue(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ld(e),null;case 1:return Xh(e.type)&&_9(),ld(e),null;case 3:return i=e.stateNode,nD(),Na(Qh),Na(Td),Fue(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(e6(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Vm!==null&&($ee(Vm),Vm=null))),Aee(n,e),ld(e),null;case 5:Mue(e);var r=_E(wP.current);if(t=e.type,n!==null&&e.stateNode!=null)cMe(n,e,t,i,r),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(e.stateNode===null)throw Error(fn(166));return ld(e),null}if(n=_E(zv.current),e6(e)){i=e.stateNode,t=e.type;var o=e.memoizedProps;switch(i[pv]=e,i[yP]=o,n=(e.mode&1)!==0,t){case"dialog":ka("cancel",i),ka("close",i);break;case"iframe":case"object":case"embed":ka("load",i);break;case"video":case"audio":for(r=0;r<gN.length;r++)ka(gN[r],i);break;case"source":ka("error",i);break;case"img":case"image":case"link":ka("error",i),ka("load",i);break;case"details":ka("toggle",i);break;case"input":L0e(i,o),ka("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!o.multiple},ka("invalid",i);break;case"textarea":A0e(i,o),ka("invalid",i)}ree(t,o),r=null;for(var s in o)if(o.hasOwnProperty(s)){var a=o[s];s==="children"?typeof a=="string"?i.textContent!==a&&(o.suppressHydrationWarning!==!0&&JF(i.textContent,a,n),r=["children",a]):typeof a=="number"&&i.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&JF(i.textContent,a,n),r=["children",""+a]):uP.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&ka("scroll",i)}switch(t){case"input":UF(i),D0e(i,o,!0);break;case"textarea":UF(i),R0e(i);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(i.onclick=m9)}i=r,e.updateQueue=i,i!==null&&(e.flags|=4)}else{s=r.nodeType===9?r:r.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=FOe(t)),n==="http://www.w3.org/1999/xhtml"?t==="script"?(n=s.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=s.createElement(t,{is:i.is}):(n=s.createElement(t),t==="select"&&(s=n,i.multiple?s.multiple=!0:i.size&&(s.size=i.size))):n=s.createElementNS(n,t),n[pv]=e,n[yP]=i,lMe(n,e,!1,!1),e.stateNode=n;e:{switch(s=oee(t,i),t){case"dialog":ka("cancel",n),ka("close",n),r=i;break;case"iframe":case"object":case"embed":ka("load",n),r=i;break;case"video":case"audio":for(r=0;r<gN.length;r++)ka(gN[r],n);r=i;break;case"source":ka("error",n),r=i;break;case"img":case"image":case"link":ka("error",n),ka("load",n),r=i;break;case"details":ka("toggle",n),r=i;break;case"input":L0e(n,i),r=JJ(n,i),ka("invalid",n);break;case"option":r=i;break;case"select":n._wrapperState={wasMultiple:!!i.multiple},r=rl({},i,{value:void 0}),ka("invalid",n);break;case"textarea":A0e(n,i),r=nee(n,i),ka("invalid",n);break;default:r=i}ree(t,r),a=r;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?VOe(n,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&BOe(n,l)):o==="children"?typeof l=="string"?(t!=="textarea"||l!=="")&&dP(n,l):typeof l=="number"&&dP(n,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(uP.hasOwnProperty(o)?l!=null&&o==="onScroll"&&ka("scroll",n):l!=null&&fue(n,o,l,s))}switch(t){case"input":UF(n),D0e(n,i,!1);break;case"textarea":UF(n),R0e(n);break;case"option":i.value!=null&&n.setAttribute("value",""+UC(i.value));break;case"select":n.multiple=!!i.multiple,o=i.value,o!=null?oL(n,!!i.multiple,o,!1):i.defaultValue!=null&&oL(n,!!i.multiple,i.defaultValue,!0);break;default:typeof r.onClick=="function"&&(n.onclick=m9)}switch(t){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return ld(e),null;case 6:if(n&&e.stateNode!=null)uMe(n,e,n.memoizedProps,i);else{if(typeof i!="string"&&e.stateNode===null)throw Error(fn(166));if(t=_E(wP.current),_E(zv.current),e6(e)){if(i=e.stateNode,t=e.memoizedProps,i[pv]=e,(o=i.nodeValue!==t)&&(n=lg,n!==null))switch(n.tag){case 3:JF(i.nodeValue,t,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&JF(i.nodeValue,t,(n.mode&1)!==0)}o&&(e.flags|=4)}else i=(t.nodeType===9?t:t.ownerDocument).createTextNode(i),i[pv]=e,e.stateNode=i}return ld(e),null;case 13:if(Na(Xa),i=e.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(Ha&&Zf!==null&&e.mode&1&&!(e.flags&128))TPe(),eD(),e.flags|=98560,o=!1;else if(o=e6(e),i!==null&&i.dehydrated!==null){if(n===null){if(!o)throw Error(fn(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(fn(317));o[pv]=e}else eD(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;ld(e),o=!1}else Vm!==null&&($ee(Vm),Vm=null),o=!0;if(!o)return e.flags&65536?e:null}return e.flags&128?(e.lanes=t,e):(i=i!==null,i!==(n!==null&&n.memoizedState!==null)&&i&&(e.child.flags|=8192,e.mode&1&&(n===null||Xa.current&1?Nc===0&&(Nc=3):Yue())),e.updateQueue!==null&&(e.flags|=4),ld(e),null);case 4:return nD(),Aee(n,e),n===null&&vP(e.stateNode.containerInfo),ld(e),null;case 10:return Rue(e.type._context),ld(e),null;case 17:return Xh(e.type)&&_9(),ld(e),null;case 19:if(Na(Xa),o=e.memoizedState,o===null)return ld(e),null;if(i=(e.flags&128)!==0,s=o.rendering,s===null)if(i)uR(o,!1);else{if(Nc!==0||n!==null&&n.flags&128)for(n=e.child;n!==null;){if(s=E9(n),s!==null){for(e.flags|=128,uR(o,!1),i=s.updateQueue,i!==null&&(e.updateQueue=i,e.flags|=4),e.subtreeFlags=0,i=t,t=e.child;t!==null;)o=t,n=i,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=n,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,n=s.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t=t.sibling;return wa(Xa,Xa.current&1|2),e.child}n=n.sibling}o.tail!==null&&Vl()>rD&&(e.flags|=128,i=!0,uR(o,!1),e.lanes=4194304)}else{if(!i)if(n=E9(s),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),uR(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Ha)return ld(e),null}else 2*Vl()-o.renderingStartTime>rD&&t!==1073741824&&(e.flags|=128,i=!0,uR(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(t=o.last,t!==null?t.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Vl(),e.sibling=null,t=Xa.current,wa(Xa,i?t&1|2:t&1),e):(ld(e),null);case 22:case 23:return Gue(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Wf&1073741824&&(ld(e),e.subtreeFlags&6&&(e.flags|=8192)):ld(e),null;case 24:return null;case 25:return null}throw Error(fn(156,e.tag))}function dlt(n,e){switch(Iue(e),e.tag){case 1:return Xh(e.type)&&_9(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return nD(),Na(Qh),Na(Td),Fue(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return Mue(e),null;case 13:if(Na(Xa),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(fn(340));eD()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Na(Xa),null;case 4:return nD(),null;case 10:return Rue(e.type._context),null;case 22:case 23:return Gue(),null;case 24:return null;default:return null}}var i6=!1,Cd=!1,hlt=typeof WeakSet=="function"?WeakSet:Set,di=null;function bI(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){_l(n,e,i)}else t.current=null}function Ree(n,e,t){try{t()}catch(i){_l(n,e,i)}}var C1e=!1;function flt(n,e){if(pee=f9,n=gPe(),kue(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var r=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{t.nodeType,o.nodeType}catch{t=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=n,h=null;t:for(;;){for(var g;d!==t||r!==0&&d.nodeType!==3||(a=s+r),d!==o||i!==0&&d.nodeType!==3||(l=s+i),d.nodeType===3&&(s+=d.nodeValue.length),(g=d.firstChild)!==null;)h=d,d=g;for(;;){if(d===n)break t;if(h===t&&++c===r&&(a=s),h===o&&++u===i&&(l=s),(g=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=g}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(mee={focusedElem:n,selectionRange:t},f9=!1,di=e;di!==null;)if(e=di,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,di=n;else for(;di!==null;){e=di;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,_=p.memoizedState,v=e.stateNode,b=v.getSnapshotBeforeUpdate(e.elementType===e.type?m:Lm(e.type,m),_);v.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var y=e.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(fn(163))}}catch(C){_l(e,e.return,C)}if(n=e.sibling,n!==null){n.return=e.return,di=n;break}di=e.return}return p=C1e,C1e=!1,p}function JN(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var r=i=i.next;do{if((r.tag&n)===n){var o=r.destroy;r.destroy=void 0,o!==void 0&&Ree(e,t,o)}r=r.next}while(r!==i)}}function NW(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function Nee(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function dMe(n){var e=n.alternate;e!==null&&(n.alternate=null,dMe(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[pv],delete e[yP],delete e[bee],delete e[Yat],delete e[Qat])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function hMe(n){return n.tag===5||n.tag===3||n.tag===4}function w1e(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||hMe(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Oee(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=m9));else if(i!==4&&(n=n.child,n!==null))for(Oee(n,e,t),n=n.sibling;n!==null;)Oee(n,e,t),n=n.sibling}function Pee(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(Pee(n,e,t),n=n.sibling;n!==null;)Pee(n,e,t),n=n.sibling}var Su=null,Rm=!1;function q0(n,e,t){for(t=t.child;t!==null;)fMe(n,e,t),t=t.sibling}function fMe(n,e,t){if(Wv&&typeof Wv.onCommitFiberUnmount=="function")try{Wv.onCommitFiberUnmount(xW,t)}catch{}switch(t.tag){case 5:Cd||bI(t,e);case 6:var i=Su,r=Rm;Su=null,q0(n,e,t),Su=i,Rm=r,Su!==null&&(Rm?(n=Su,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):Su.removeChild(t.stateNode));break;case 18:Su!==null&&(Rm?(n=Su,t=t.stateNode,n.nodeType===8?aY(n.parentNode,t):n.nodeType===1&&aY(n,t),pP(n)):aY(Su,t.stateNode));break;case 4:i=Su,r=Rm,Su=t.stateNode.containerInfo,Rm=!0,q0(n,e,t),Su=i,Rm=r;break;case 0:case 11:case 14:case 15:if(!Cd&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){r=i=i.next;do{var o=r,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&Ree(t,e,s),r=r.next}while(r!==i)}q0(n,e,t);break;case 1:if(!Cd&&(bI(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){_l(t,e,a)}q0(n,e,t);break;case 21:q0(n,e,t);break;case 22:t.mode&1?(Cd=(i=Cd)||t.memoizedState!==null,q0(n,e,t),Cd=i):q0(n,e,t);break;default:q0(n,e,t)}}function S1e(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new hlt),e.forEach(function(i){var r=wlt.bind(null,n,i);t.has(i)||(t.add(i),i.then(r,r))})}}function pm(n,e){var t=e.deletions;if(t!==null)for(var i=0;i<t.length;i++){var r=t[i];try{var o=n,s=e,a=s;e:for(;a!==null;){switch(a.tag){case 5:Su=a.stateNode,Rm=!1;break e;case 3:Su=a.stateNode.containerInfo,Rm=!0;break e;case 4:Su=a.stateNode.containerInfo,Rm=!0;break e}a=a.return}if(Su===null)throw Error(fn(160));fMe(o,s,r),Su=null,Rm=!1;var l=r.alternate;l!==null&&(l.return=null),r.return=null}catch(c){_l(r,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)gMe(e,n),e=e.sibling}function gMe(n,e){var t=n.alternate,i=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(pm(e,n),j_(n),i&4){try{JN(3,n,n.return),NW(3,n)}catch(m){_l(n,n.return,m)}try{JN(5,n,n.return)}catch(m){_l(n,n.return,m)}}break;case 1:pm(e,n),j_(n),i&512&&t!==null&&bI(t,t.return);break;case 5:if(pm(e,n),j_(n),i&512&&t!==null&&bI(t,t.return),n.flags&32){var r=n.stateNode;try{dP(r,"")}catch(m){_l(n,n.return,m)}}if(i&4&&(r=n.stateNode,r!=null)){var o=n.memoizedProps,s=t!==null?t.memoizedProps:o,a=n.type,l=n.updateQueue;if(n.updateQueue=null,l!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&POe(r,o),oee(a,s);var c=oee(a,o);for(s=0;s<l.length;s+=2){var u=l[s],d=l[s+1];u==="style"?VOe(r,d):u==="dangerouslySetInnerHTML"?BOe(r,d):u==="children"?dP(r,d):fue(r,u,d,c)}switch(a){case"input":eee(r,o);break;case"textarea":MOe(r,o);break;case"select":var h=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!o.multiple;var g=o.value;g!=null?oL(r,!!o.multiple,g,!1):h!==!!o.multiple&&(o.defaultValue!=null?oL(r,!!o.multiple,o.defaultValue,!0):oL(r,!!o.multiple,o.multiple?[]:"",!1))}r[yP]=o}catch(m){_l(n,n.return,m)}}break;case 6:if(pm(e,n),j_(n),i&4){if(n.stateNode===null)throw Error(fn(162));r=n.stateNode,o=n.memoizedProps;try{r.nodeValue=o}catch(m){_l(n,n.return,m)}}break;case 3:if(pm(e,n),j_(n),i&4&&t!==null&&t.memoizedState.isDehydrated)try{pP(e.containerInfo)}catch(m){_l(n,n.return,m)}break;case 4:pm(e,n),j_(n);break;case 13:pm(e,n),j_(n),r=n.child,r.flags&8192&&(o=r.memoizedState!==null,r.stateNode.isHidden=o,!o||r.alternate!==null&&r.alternate.memoizedState!==null||(que=Vl())),i&4&&S1e(n);break;case 22:if(u=t!==null&&t.memoizedState!==null,n.mode&1?(Cd=(c=Cd)||u,pm(e,n),Cd=c):pm(e,n),j_(n),i&8192){if(c=n.memoizedState!==null,(n.stateNode.isHidden=c)&&!u&&n.mode&1)for(di=n,u=n.child;u!==null;){for(d=di=u;di!==null;){switch(h=di,g=h.child,h.tag){case 0:case 11:case 14:case 15:JN(4,h,h.return);break;case 1:bI(h,h.return);var p=h.stateNode;if(typeof p.componentWillUnmount=="function"){i=h,t=h.return;try{e=i,p.props=e.memoizedProps,p.state=e.memoizedState,p.componentWillUnmount()}catch(m){_l(i,t,m)}}break;case 5:bI(h,h.return);break;case 22:if(h.memoizedState!==null){x1e(d);continue}}g!==null?(g.return=h,di=g):x1e(d)}u=u.sibling}e:for(u=null,d=n;;){if(d.tag===5){if(u===null){u=d;try{r=d.stateNode,c?(o=r.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=d.stateNode,l=d.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=$Oe("display",s))}catch(m){_l(n,n.return,m)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(m){_l(n,n.return,m)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===n)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===n)break e;for(;d.sibling===null;){if(d.return===null||d.return===n)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:pm(e,n),j_(n),i&4&&S1e(n);break;case 21:break;default:pm(e,n),j_(n)}}function j_(n){var e=n.flags;if(e&2){try{e:{for(var t=n.return;t!==null;){if(hMe(t)){var i=t;break e}t=t.return}throw Error(fn(160))}switch(i.tag){case 5:var r=i.stateNode;i.flags&32&&(dP(r,""),i.flags&=-33);var o=w1e(n);Pee(n,o,r);break;case 3:case 4:var s=i.stateNode.containerInfo,a=w1e(n);Oee(n,a,s);break;default:throw Error(fn(161))}}catch(l){_l(n,n.return,l)}n.flags&=-3}e&4096&&(n.flags&=-4097)}function glt(n,e,t){di=n,pMe(n)}function pMe(n,e,t){for(var i=(n.mode&1)!==0;di!==null;){var r=di,o=r.child;if(r.tag===22&&i){var s=r.memoizedState!==null||i6;if(!s){var a=r.alternate,l=a!==null&&a.memoizedState!==null||Cd;a=i6;var c=Cd;if(i6=s,(Cd=l)&&!c)for(di=r;di!==null;)s=di,l=s.child,s.tag===22&&s.memoizedState!==null?k1e(r):l!==null?(l.return=s,di=l):k1e(r);for(;o!==null;)di=o,pMe(o),o=o.sibling;di=r,i6=a,Cd=c}E1e(n)}else r.subtreeFlags&8772&&o!==null?(o.return=r,di=o):E1e(n)}}function E1e(n){for(;di!==null;){var e=di;if(e.flags&8772){var t=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Cd||NW(5,e);break;case 1:var i=e.stateNode;if(e.flags&4&&!Cd)if(t===null)i.componentDidMount();else{var r=e.elementType===e.type?t.memoizedProps:Lm(e.type,t.memoizedProps);i.componentDidUpdate(r,t.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var o=e.updateQueue;o!==null&&a1e(e,o,i);break;case 3:var s=e.updateQueue;if(s!==null){if(t=null,e.child!==null)switch(e.child.tag){case 5:t=e.child.stateNode;break;case 1:t=e.child.stateNode}a1e(e,s,t)}break;case 5:var a=e.stateNode;if(t===null&&e.flags&4){t=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&t.focus();break;case"img":l.src&&(t.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&pP(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(fn(163))}Cd||e.flags&512&&Nee(e)}catch(h){_l(e,e.return,h)}}if(e===n){di=null;break}if(t=e.sibling,t!==null){t.return=e.return,di=t;break}di=e.return}}function x1e(n){for(;di!==null;){var e=di;if(e===n){di=null;break}var t=e.sibling;if(t!==null){t.return=e.return,di=t;break}di=e.return}}function k1e(n){for(;di!==null;){var e=di;try{switch(e.tag){case 0:case 11:case 15:var t=e.return;try{NW(4,e)}catch(l){_l(e,t,l)}break;case 1:var i=e.stateNode;if(typeof i.componentDidMount=="function"){var r=e.return;try{i.componentDidMount()}catch(l){_l(e,r,l)}}var o=e.return;try{Nee(e)}catch(l){_l(e,o,l)}break;case 5:var s=e.return;try{Nee(e)}catch(l){_l(e,s,l)}}}catch(l){_l(e,e.return,l)}if(e===n){di=null;break}var a=e.sibling;if(a!==null){a.return=e.return,di=a;break}di=e.return}}var plt=Math.ceil,T9=S0.ReactCurrentDispatcher,jue=S0.ReactCurrentOwner,Sp=S0.ReactCurrentBatchConfig,Go=0,lu=null,fc=null,ju=0,Wf=0,yI=Rw(0),Nc=0,kP=null,dx=0,OW=0,Uue=0,eO=null,Ah=null,que=0,rD=1/0,sy=null,I9=!1,Mee=null,fC=null,r6=!1,B1=null,L9=0,tO=0,Fee=null,W$=-1,z$=0;function eh(){return Go&6?Vl():W$!==-1?W$:W$=Vl()}function gC(n){return n.mode&1?Go&2&&ju!==0?ju&-ju:Zat.transition!==null?(z$===0&&(z$=ZOe()),z$):(n=Rs,n!==0||(n=window.event,n=n===void 0?16:oPe(n.type)),n):1}function a_(n,e,t,i){if(50<tO)throw tO=0,Fee=null,Error(fn(185));G4(n,t,i),(!(Go&2)||n!==lu)&&(n===lu&&(!(Go&2)&&(OW|=t),Nc===4&&T1(n,ju)),Zh(n,i),t===1&&Go===0&&!(e.mode&1)&&(rD=Vl()+500,DW&&Nw()))}function Zh(n,e){var t=n.callbackNode;Zst(n,e);var i=h9(n,n===lu?ju:0);if(i===0)t!==null&&P0e(t),n.callbackNode=null,n.callbackPriority=0;else if(e=i&-i,n.callbackPriority!==e){if(t!=null&&P0e(t),e===1)n.tag===0?Xat(T1e.bind(null,n)):EPe(T1e.bind(null,n)),Kat(function(){!(Go&6)&&Nw()}),t=null;else{switch(JOe(i)){case 1:t=vue;break;case 4:t=QOe;break;case 16:t=d9;break;case 536870912:t=XOe;break;default:t=d9}t=SMe(t,mMe.bind(null,n))}n.callbackPriority=e,n.callbackNode=t}}function mMe(n,e){if(W$=-1,z$=0,Go&6)throw Error(fn(327));var t=n.callbackNode;if(uL()&&n.callbackNode!==t)return null;var i=h9(n,n===lu?ju:0);if(i===0)return null;if(i&30||i&n.expiredLanes||e)e=D9(n,i);else{e=i;var r=Go;Go|=2;var o=vMe();(lu!==n||ju!==e)&&(sy=null,rD=Vl()+500,ME(n,e));do try{vlt();break}catch(a){_Me(n,a)}while(1);Aue(),T9.current=o,Go=r,fc!==null?e=0:(lu=null,ju=0,e=Nc)}if(e!==0){if(e===2&&(r=uee(n),r!==0&&(i=r,e=Bee(n,r))),e===1)throw t=kP,ME(n,0),T1(n,i),Zh(n,Vl()),t;if(e===6)T1(n,i);else{if(r=n.current.alternate,!(i&30)&&!mlt(r)&&(e=D9(n,i),e===2&&(o=uee(n),o!==0&&(i=o,e=Bee(n,o))),e===1))throw t=kP,ME(n,0),T1(n,i),Zh(n,Vl()),t;switch(n.finishedWork=r,n.finishedLanes=i,e){case 0:case 1:throw Error(fn(345));case 2:OS(n,Ah,sy);break;case 3:if(T1(n,i),(i&130023424)===i&&(e=que+500-Vl(),10<e)){if(h9(n,0)!==0)break;if(r=n.suspendedLanes,(r&i)!==i){eh(),n.pingedLanes|=n.suspendedLanes&r;break}n.timeoutHandle=vee(OS.bind(null,n,Ah,sy),e);break}OS(n,Ah,sy);break;case 4:if(T1(n,i),(i&4194240)===i)break;for(e=n.eventTimes,r=-1;0<i;){var s=31-s_(i);o=1<<s,s=e[s],s>r&&(r=s),i&=~o}if(i=r,i=Vl()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*plt(i/1960))-i,10<i){n.timeoutHandle=vee(OS.bind(null,n,Ah,sy),i);break}OS(n,Ah,sy);break;case 5:OS(n,Ah,sy);break;default:throw Error(fn(329))}}}return Zh(n,Vl()),n.callbackNode===t?mMe.bind(null,n):null}function Bee(n,e){var t=eO;return n.current.memoizedState.isDehydrated&&(ME(n,e).flags|=256),n=D9(n,e),n!==2&&(e=Ah,Ah=t,e!==null&&$ee(e)),n}function $ee(n){Ah===null?Ah=n:Ah.push.apply(Ah,n)}function mlt(n){for(var e=n;;){if(e.flags&16384){var t=e.updateQueue;if(t!==null&&(t=t.stores,t!==null))for(var i=0;i<t.length;i++){var r=t[i],o=r.getSnapshot;r=r.value;try{if(!v_(o(),r))return!1}catch{return!1}}}if(t=e.child,e.subtreeFlags&16384&&t!==null)t.return=e,e=t;else{if(e===n)break;for(;e.sibling===null;){if(e.return===null||e.return===n)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function T1(n,e){for(e&=~Uue,e&=~OW,n.suspendedLanes|=e,n.pingedLanes&=~e,n=n.expirationTimes;0<e;){var t=31-s_(e),i=1<<t;n[t]=-1,e&=~i}}function T1e(n){if(Go&6)throw Error(fn(327));uL();var e=h9(n,0);if(!(e&1))return Zh(n,Vl()),null;var t=D9(n,e);if(n.tag!==0&&t===2){var i=uee(n);i!==0&&(e=i,t=Bee(n,i))}if(t===1)throw t=kP,ME(n,0),T1(n,e),Zh(n,Vl()),t;if(t===6)throw Error(fn(345));return n.finishedWork=n.current.alternate,n.finishedLanes=e,OS(n,Ah,sy),Zh(n,Vl()),null}function Kue(n,e){var t=Go;Go|=1;try{return n(e)}finally{Go=t,Go===0&&(rD=Vl()+500,DW&&Nw())}}function hx(n){B1!==null&&B1.tag===0&&!(Go&6)&&uL();var e=Go;Go|=1;var t=Sp.transition,i=Rs;try{if(Sp.transition=null,Rs=1,n)return n()}finally{Rs=i,Sp.transition=t,Go=e,!(Go&6)&&Nw()}}function Gue(){Wf=yI.current,Na(yI)}function ME(n,e){n.finishedWork=null,n.finishedLanes=0;var t=n.timeoutHandle;if(t!==-1&&(n.timeoutHandle=-1,qat(t)),fc!==null)for(t=fc.return;t!==null;){var i=t;switch(Iue(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&_9();break;case 3:nD(),Na(Qh),Na(Td),Fue();break;case 5:Mue(i);break;case 4:nD();break;case 13:Na(Xa);break;case 19:Na(Xa);break;case 10:Rue(i.type._context);break;case 22:case 23:Gue()}t=t.return}if(lu=n,fc=n=pC(n.current,null),ju=Wf=e,Nc=0,kP=null,Uue=OW=dx=0,Ah=eO=null,mE!==null){for(e=0;e<mE.length;e++)if(t=mE[e],i=t.interleaved,i!==null){t.interleaved=null;var r=i.next,o=t.pending;if(o!==null){var s=o.next;o.next=r,i.next=s}t.pending=i}mE=null}return n}function _Me(n,e){do{var t=fc;try{if(Aue(),$$.current=k9,x9){for(var i=nl.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}x9=!1}if(ux=0,nu=Tc=nl=null,ZN=!1,SP=0,jue.current=null,t===null||t.return===null){Nc=1,kP=e,fc=null;break}e:{var o=n,s=t.return,a=t,l=e;if(e=ju,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var h=u.alternate;h?(u.updateQueue=h.updateQueue,u.memoizedState=h.memoizedState,u.lanes=h.lanes):(u.updateQueue=null,u.memoizedState=null)}var g=g1e(s);if(g!==null){g.flags&=-257,p1e(g,s,a,o,e),g.mode&1&&f1e(o,c,e),e=g,l=c;var p=e.updateQueue;if(p===null){var m=new Set;m.add(l),e.updateQueue=m}else p.add(l);break e}else{if(!(e&1)){f1e(o,c,e),Yue();break e}l=Error(fn(426))}}else if(Ha&&a.mode&1){var _=g1e(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),p1e(_,s,a,o,e),Lue(iD(l,a));break e}}o=l=iD(l,a),Nc!==4&&(Nc=2),eO===null?eO=[o]:eO.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,e&=-e,o.lanes|=e;var v=eMe(o,l,e);s1e(o,v);break e;case 1:a=l;var b=o.type,y=o.stateNode;if(!(o.flags&128)&&(typeof b.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(fC===null||!fC.has(y)))){o.flags|=65536,e&=-e,o.lanes|=e;var C=tMe(o,a,e);s1e(o,C);break e}}o=o.return}while(o!==null)}yMe(t)}catch(x){e=x,fc===t&&t!==null&&(fc=t=t.return);continue}break}while(1)}function vMe(){var n=T9.current;return T9.current=k9,n===null?k9:n}function Yue(){(Nc===0||Nc===3||Nc===2)&&(Nc=4),lu===null||!(dx&268435455)&&!(OW&268435455)||T1(lu,ju)}function D9(n,e){var t=Go;Go|=2;var i=vMe();(lu!==n||ju!==e)&&(sy=null,ME(n,e));do try{_lt();break}catch(r){_Me(n,r)}while(1);if(Aue(),Go=t,T9.current=i,fc!==null)throw Error(fn(261));return lu=null,ju=0,Nc}function _lt(){for(;fc!==null;)bMe(fc)}function vlt(){for(;fc!==null&&!zst();)bMe(fc)}function bMe(n){var e=wMe(n.alternate,n,Wf);n.memoizedProps=n.pendingProps,e===null?yMe(n):fc=e,jue.current=null}function yMe(n){var e=n;do{var t=e.alternate;if(n=e.return,e.flags&32768){if(t=dlt(t,e),t!==null){t.flags&=32767,fc=t;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{Nc=6,fc=null;return}}else if(t=ult(t,e,Wf),t!==null){fc=t;return}if(e=e.sibling,e!==null){fc=e;return}fc=e=n}while(e!==null);Nc===0&&(Nc=5)}function OS(n,e,t){var i=Rs,r=Sp.transition;try{Sp.transition=null,Rs=1,blt(n,e,t,i)}finally{Sp.transition=r,Rs=i}return null}function blt(n,e,t,i){do uL();while(B1!==null);if(Go&6)throw Error(fn(327));t=n.finishedWork;var r=n.finishedLanes;if(t===null)return null;if(n.finishedWork=null,n.finishedLanes=0,t===n.current)throw Error(fn(177));n.callbackNode=null,n.callbackPriority=0;var o=t.lanes|t.childLanes;if(Jst(n,o),n===lu&&(fc=lu=null,ju=0),!(t.subtreeFlags&2064)&&!(t.flags&2064)||r6||(r6=!0,SMe(d9,function(){return uL(),null})),o=(t.flags&15990)!==0,t.subtreeFlags&15990||o){o=Sp.transition,Sp.transition=null;var s=Rs;Rs=1;var a=Go;Go|=4,jue.current=null,flt(n,t),gMe(t,n),$at(mee),f9=!!pee,mee=pee=null,n.current=t,glt(t),jst(),Go=a,Rs=s,Sp.transition=o}else n.current=t;if(r6&&(r6=!1,B1=n,L9=r),o=n.pendingLanes,o===0&&(fC=null),Kst(t.stateNode),Zh(n,Vl()),e!==null)for(i=n.onRecoverableError,t=0;t<e.length;t++)r=e[t],i(r.value,{componentStack:r.stack,digest:r.digest});if(I9)throw I9=!1,n=Mee,Mee=null,n;return L9&1&&n.tag!==0&&uL(),o=n.pendingLanes,o&1?n===Fee?tO++:(tO=0,Fee=n):tO=0,Nw(),null}function uL(){if(B1!==null){var n=JOe(L9),e=Sp.transition,t=Rs;try{if(Sp.transition=null,Rs=16>n?16:n,B1===null)var i=!1;else{if(n=B1,B1=null,L9=0,Go&6)throw Error(fn(331));var r=Go;for(Go|=4,di=n.current;di!==null;){var o=di,s=o.child;if(di.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(di=c;di!==null;){var u=di;switch(u.tag){case 0:case 11:case 15:JN(8,u,o)}var d=u.child;if(d!==null)d.return=u,di=d;else for(;di!==null;){u=di;var h=u.sibling,g=u.return;if(dMe(u),u===c){di=null;break}if(h!==null){h.return=g,di=h;break}di=g}}}var p=o.alternate;if(p!==null){var m=p.child;if(m!==null){p.child=null;do{var _=m.sibling;m.sibling=null,m=_}while(m!==null)}}di=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,di=s;else e:for(;di!==null;){if(o=di,o.flags&2048)switch(o.tag){case 0:case 11:case 15:JN(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,di=v;break e}di=o.return}}var b=n.current;for(di=b;di!==null;){s=di;var y=s.child;if(s.subtreeFlags&2064&&y!==null)y.return=s,di=y;else e:for(s=b;di!==null;){if(a=di,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:NW(9,a)}}catch(x){_l(a,a.return,x)}if(a===s){di=null;break e}var C=a.sibling;if(C!==null){C.return=a.return,di=C;break e}di=a.return}}if(Go=r,Nw(),Wv&&typeof Wv.onPostCommitFiberRoot=="function")try{Wv.onPostCommitFiberRoot(xW,n)}catch{}i=!0}return i}finally{Rs=t,Sp.transition=e}}return!1}function I1e(n,e,t){e=iD(t,e),e=eMe(n,e,1),n=hC(n,e,1),e=eh(),n!==null&&(G4(n,1,e),Zh(n,e))}function _l(n,e,t){if(n.tag===3)I1e(n,n,t);else for(;e!==null;){if(e.tag===3){I1e(e,n,t);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(fC===null||!fC.has(i))){n=iD(t,n),n=tMe(e,n,1),e=hC(e,n,1),n=eh(),e!==null&&(G4(e,1,n),Zh(e,n));break}}e=e.return}}function ylt(n,e,t){var i=n.pingCache;i!==null&&i.delete(e),e=eh(),n.pingedLanes|=n.suspendedLanes&t,lu===n&&(ju&t)===t&&(Nc===4||Nc===3&&(ju&130023424)===ju&&500>Vl()-que?ME(n,0):Uue|=t),Zh(n,e)}function CMe(n,e){e===0&&(n.mode&1?(e=GF,GF<<=1,!(GF&130023424)&&(GF=4194304)):e=1);var t=eh();n=s0(n,e),n!==null&&(G4(n,e,t),Zh(n,t))}function Clt(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),CMe(n,t)}function wlt(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,r=n.memoizedState;r!==null&&(t=r.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(fn(314))}i!==null&&i.delete(e),CMe(n,t)}var wMe;wMe=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||Qh.current)Hh=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Hh=!1,clt(n,e,t);Hh=!!(n.flags&131072)}else Hh=!1,Ha&&e.flags&1048576&&xPe(e,y9,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;H$(n,e),n=e.pendingProps;var r=JL(e,Td.current);cL(e,t),r=$ue(null,e,i,n,r,t);var o=Vue();return e.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Xh(i)?(o=!0,v9(e)):o=!1,e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Oue(e),r.updater=AW,e.stateNode=r,r._reactInternals=e,xee(e,i,n,t),e=Iee(null,e,i,!0,o,t)):(e.tag=0,Ha&&o&&Tue(e),Ud(null,e,r,t),e=e.child),e;case 16:i=e.elementType;e:{switch(H$(n,e),n=e.pendingProps,r=i._init,i=r(i._payload),e.type=i,r=e.tag=Elt(i),n=Lm(i,n),r){case 0:e=Tee(null,e,i,n,t);break e;case 1:e=v1e(null,e,i,n,t);break e;case 11:e=m1e(null,e,i,n,t);break e;case 14:e=_1e(null,e,i,Lm(i.type,n),t);break e}throw Error(fn(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Lm(i,r),Tee(n,e,i,r,t);case 1:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Lm(i,r),v1e(n,e,i,r,t);case 3:e:{if(oMe(e),n===null)throw Error(fn(387));i=e.pendingProps,o=e.memoizedState,r=o.element,LPe(n,e),S9(e,i,null,t);var s=e.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){r=iD(Error(fn(423)),e),e=b1e(n,e,i,t,r);break e}else if(i!==r){r=iD(Error(fn(424)),e),e=b1e(n,e,i,t,r);break e}else for(Zf=dC(e.stateNode.containerInfo.firstChild),lg=e,Ha=!0,Vm=null,t=NPe(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(eD(),i===r){e=a0(n,e,t);break e}Ud(n,e,i,t)}e=e.child}return e;case 5:return OPe(e),n===null&&wee(e),i=e.type,r=e.pendingProps,o=n!==null?n.memoizedProps:null,s=r.children,_ee(i,r)?s=null:o!==null&&_ee(i,o)&&(e.flags|=32),rMe(n,e),Ud(n,e,s,t),e.child;case 6:return n===null&&wee(e),null;case 13:return sMe(n,e,t);case 4:return Pue(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=tD(e,null,i,t):Ud(n,e,i,t),e.child;case 11:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Lm(i,r),m1e(n,e,i,r,t);case 7:return Ud(n,e,e.pendingProps,t),e.child;case 8:return Ud(n,e,e.pendingProps.children,t),e.child;case 12:return Ud(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,r=e.pendingProps,o=e.memoizedProps,s=r.value,wa(C9,i._currentValue),i._currentValue=s,o!==null)if(v_(o.value,s)){if(o.children===r.children&&!Qh.current){e=a0(n,e,t);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=jy(-1,t&-t),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=t,l=o.alternate,l!==null&&(l.lanes|=t),See(o.return,t,e),a.lanes|=t;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(fn(341));s.lanes|=t,a=s.alternate,a!==null&&(a.lanes|=t),See(s,t,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Ud(n,e,r.children,t),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,cL(e,t),r=Np(r),i=i(r),e.flags|=1,Ud(n,e,i,t),e.child;case 14:return i=e.type,r=Lm(i,e.pendingProps),r=Lm(i.type,r),_1e(n,e,i,r,t);case 15:return nMe(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:Lm(i,r),H$(n,e),e.tag=1,Xh(i)?(n=!0,v9(e)):n=!1,cL(e,t),APe(e,i,r),xee(e,i,r,t),Iee(null,e,i,!0,n,t);case 19:return aMe(n,e,t);case 22:return iMe(n,e,t)}throw Error(fn(156,e.tag))};function SMe(n,e){return YOe(n,e)}function Slt(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gp(n,e,t,i){return new Slt(n,e,t,i)}function Que(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Elt(n){if(typeof n=="function")return Que(n)?1:0;if(n!=null){if(n=n.$$typeof,n===pue)return 11;if(n===mue)return 14}return 2}function pC(n,e){var t=n.alternate;return t===null?(t=gp(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function j$(n,e,t,i,r,o){var s=2;if(i=n,typeof n=="function")Que(n)&&(s=1);else if(typeof n=="string")s=5;else e:switch(n){case uI:return FE(t.children,r,o,e);case gue:s=8,r|=8;break;case YJ:return n=gp(12,t,e,r|2),n.elementType=YJ,n.lanes=o,n;case QJ:return n=gp(13,t,e,r),n.elementType=QJ,n.lanes=o,n;case XJ:return n=gp(19,t,e,r),n.elementType=XJ,n.lanes=o,n;case ROe:return PW(t,r,o,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case DOe:s=10;break e;case AOe:s=9;break e;case pue:s=11;break e;case mue:s=14;break e;case m1:s=16,i=null;break e}throw Error(fn(130,n==null?n:typeof n,""))}return e=gp(s,t,e,r),e.elementType=n,e.type=i,e.lanes=o,e}function FE(n,e,t,i){return n=gp(7,n,i,e),n.lanes=t,n}function PW(n,e,t,i){return n=gp(22,n,i,e),n.elementType=ROe,n.lanes=t,n.stateNode={isHidden:!1},n}function pY(n,e,t){return n=gp(6,n,null,e),n.lanes=t,n}function mY(n,e,t){return e=gp(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function xlt(n,e,t,i,r){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=QG(0),this.expirationTimes=QG(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=QG(0),this.identifierPrefix=i,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function Xue(n,e,t,i,r,o,s,a,l){return n=new xlt(n,e,t,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=gp(3,null,null,e),n.current=o,o.stateNode=n,o.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},Oue(o),n}function klt(n,e,t){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:cI,key:i==null?null:""+i,children:n,containerInfo:e,implementation:t}}function EMe(n){if(!n)return qC;n=n._reactInternals;e:{if(dk(n)!==n||n.tag!==1)throw Error(fn(170));var e=n;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Xh(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(fn(171))}if(n.tag===1){var t=n.type;if(Xh(t))return SPe(n,t,e)}return e}function xMe(n,e,t,i,r,o,s,a,l){return n=Xue(t,i,!0,n,r,o,s,a,l),n.context=EMe(null),t=n.current,i=eh(),r=gC(t),o=jy(i,r),o.callback=e??null,hC(t,o,r),n.current.lanes=r,G4(n,r,i),Zh(n,i),n}function MW(n,e,t,i){var r=e.current,o=eh(),s=gC(r);return t=EMe(t),e.context===null?e.context=t:e.pendingContext=t,e=jy(o,s),e.payload={element:n},i=i===void 0?null:i,i!==null&&(e.callback=i),n=hC(r,e,s),n!==null&&(a_(n,r,s,o),B$(n,r,s)),s}function A9(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function L1e(n,e){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var t=n.retryLane;n.retryLane=t!==0&&t<e?t:e}}function Zue(n,e){L1e(n,e),(n=n.alternate)&&L1e(n,e)}function Tlt(){return null}var kMe=typeof reportError=="function"?reportError:function(n){console.error(n)};function Jue(n){this._internalRoot=n}FW.prototype.render=Jue.prototype.render=function(n){var e=this._internalRoot;if(e===null)throw Error(fn(409));MW(n,e,null,null)};FW.prototype.unmount=Jue.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var e=n.containerInfo;hx(function(){MW(null,n,null,null)}),e[o0]=null}};function FW(n){this._internalRoot=n}FW.prototype.unstable_scheduleHydration=function(n){if(n){var e=nPe();n={blockedOn:null,target:n,priority:e};for(var t=0;t<k1.length&&e!==0&&e<k1[t].priority;t++);k1.splice(t,0,n),t===0&&rPe(n)}};function ede(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function BW(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function D1e(){}function Ilt(n,e,t,i,r){if(r){if(typeof i=="function"){var o=i;i=function(){var c=A9(s);o.call(c)}}var s=xMe(e,i,n,0,null,!1,!1,"",D1e);return n._reactRootContainer=s,n[o0]=s.current,vP(n.nodeType===8?n.parentNode:n),hx(),s}for(;r=n.lastChild;)n.removeChild(r);if(typeof i=="function"){var a=i;i=function(){var c=A9(l);a.call(c)}}var l=Xue(n,0,!1,null,null,!1,!1,"",D1e);return n._reactRootContainer=l,n[o0]=l.current,vP(n.nodeType===8?n.parentNode:n),hx(function(){MW(e,l,t,i)}),l}function $W(n,e,t,i,r){var o=t._reactRootContainer;if(o){var s=o;if(typeof r=="function"){var a=r;r=function(){var l=A9(s);a.call(l)}}MW(e,s,n,r)}else s=Ilt(t,e,n,r,i);return A9(s)}ePe=function(n){switch(n.tag){case 3:var e=n.stateNode;if(e.current.memoizedState.isDehydrated){var t=fN(e.pendingLanes);t!==0&&(bue(e,t|1),Zh(e,Vl()),!(Go&6)&&(rD=Vl()+500,Nw()))}break;case 13:hx(function(){var i=s0(n,1);if(i!==null){var r=eh();a_(i,n,1,r)}}),Zue(n,1)}};yue=function(n){if(n.tag===13){var e=s0(n,134217728);if(e!==null){var t=eh();a_(e,n,134217728,t)}Zue(n,134217728)}};tPe=function(n){if(n.tag===13){var e=gC(n),t=s0(n,e);if(t!==null){var i=eh();a_(t,n,e,i)}Zue(n,e)}};nPe=function(){return Rs};iPe=function(n,e){var t=Rs;try{return Rs=n,e()}finally{Rs=t}};aee=function(n,e,t){switch(e){case"input":if(eee(n,t),e=t.name,t.type==="radio"&&e!=null){for(t=n;t.parentNode;)t=t.parentNode;for(t=t.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<t.length;e++){var i=t[e];if(i!==n&&i.form===n.form){var r=LW(i);if(!r)throw Error(fn(90));OOe(i),eee(i,r)}}}break;case"textarea":MOe(n,t);break;case"select":e=t.value,e!=null&&oL(n,!!t.multiple,e,!1)}};zOe=Kue;jOe=hx;var Llt={usingClientEntryPoint:!1,Events:[Q4,gI,LW,HOe,WOe,Kue]},dR={findFiberByHostInstance:pE,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},Dlt={bundleType:dR.bundleType,version:dR.version,rendererPackageName:dR.rendererPackageName,rendererConfig:dR.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:S0.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=KOe(n),n===null?null:n.stateNode},findFiberByHostInstance:dR.findFiberByHostInstance||Tlt,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var o6=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!o6.isDisabled&&o6.supportsFiber)try{xW=o6.inject(Dlt),Wv=o6}catch{}}Lg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Llt;Lg.createPortal=function(n,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ede(e))throw Error(fn(200));return klt(n,e,null,t)};Lg.createRoot=function(n,e){if(!ede(n))throw Error(fn(299));var t=!1,i="",r=kMe;return e!=null&&(e.unstable_strictMode===!0&&(t=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onRecoverableError!==void 0&&(r=e.onRecoverableError)),e=Xue(n,1,!1,null,null,t,!1,i,r),n[o0]=e.current,vP(n.nodeType===8?n.parentNode:n),new Jue(e)};Lg.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var e=n._reactInternals;if(e===void 0)throw typeof n.render=="function"?Error(fn(188)):(n=Object.keys(n).join(","),Error(fn(268,n)));return n=KOe(e),n=n===null?null:n.stateNode,n};Lg.flushSync=function(n){return hx(n)};Lg.hydrate=function(n,e,t){if(!BW(e))throw Error(fn(200));return $W(null,n,e,!0,t)};Lg.hydrateRoot=function(n,e,t){if(!ede(n))throw Error(fn(405));var i=t!=null&&t.hydratedSources||null,r=!1,o="",s=kMe;if(t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),e=xMe(e,null,n,1,t??null,r,!1,o,s),n[o0]=e.current,vP(n),i)for(n=0;n<i.length;n++)t=i[n],r=t._getVersion,r=r(t._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[t,r]:e.mutableSourceEagerHydrationData.push(t,r);return new FW(e)};Lg.render=function(n,e,t){if(!BW(e))throw Error(fn(200));return $W(null,n,e,!1,t)};Lg.unmountComponentAtNode=function(n){if(!BW(n))throw Error(fn(40));return n._reactRootContainer?(hx(function(){$W(null,null,n,!1,function(){n._reactRootContainer=null,n[o0]=null})}),!0):!1};Lg.unstable_batchedUpdates=Kue;Lg.unstable_renderSubtreeIntoContainer=function(n,e,t,i){if(!BW(t))throw Error(fn(200));if(n==null||n._reactInternals===void 0)throw Error(fn(38));return $W(n,e,t,!1,i)};Lg.version="18.2.0-next-9e3b772b8-20220608";function TMe(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(TMe)}catch(n){console.error(n)}}TMe(),xOe.exports=Lg;var Yp=xOe.exports;const VW=ja(Yp),Alt=cOe({__proto__:null,default:VW},[Yp]);function Rlt(n){n()}let IMe=Rlt;const Nlt=n=>IMe=n,Olt=()=>IMe,A1e=Symbol.for("react-redux-context"),R1e=typeof globalThis<"u"?globalThis:{};function Plt(){var n;if(!w.createContext)return{};const e=(n=R1e[A1e])!=null?n:R1e[A1e]=new Map;let t=e.get(w.createContext);return t||(t=w.createContext(null),e.set(w.createContext,t)),t}const l0=Plt();function tde(n=l0){return function(){return w.useContext(n)}}const LMe=tde(),DMe=()=>{throw new Error("uSES not initialized!")};let AMe=DMe;const Mlt=n=>{AMe=n},Flt=(n,e)=>n===e;function Blt(n=l0){const e=n===l0?LMe:tde(n);return function(i,r={}){const{equalityFn:o=Flt,stabilityCheck:s=void 0,noopCheck:a=void 0}=typeof r=="function"?{equalityFn:r}:r,{store:l,subscription:c,getServerState:u,stabilityCheck:d,noopCheck:h}=e();w.useRef(!0);const g=w.useCallback({[i.name](m){return i(m)}}[i.name],[i,d,s]),p=AMe(c.addNestedSub,l.getState,u||l.getState,g,o);return w.useDebugValue(p),p}}const Tl=Blt();function rt(){return rt=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},rt.apply(this,arguments)}function nde(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var RMe={exports:{}},Ns={};/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var gu=typeof Symbol=="function"&&Symbol.for,ide=gu?Symbol.for("react.element"):60103,rde=gu?Symbol.for("react.portal"):60106,HW=gu?Symbol.for("react.fragment"):60107,WW=gu?Symbol.for("react.strict_mode"):60108,zW=gu?Symbol.for("react.profiler"):60114,jW=gu?Symbol.for("react.provider"):60109,UW=gu?Symbol.for("react.context"):60110,ode=gu?Symbol.for("react.async_mode"):60111,qW=gu?Symbol.for("react.concurrent_mode"):60111,KW=gu?Symbol.for("react.forward_ref"):60112,GW=gu?Symbol.for("react.suspense"):60113,$lt=gu?Symbol.for("react.suspense_list"):60120,YW=gu?Symbol.for("react.memo"):60115,QW=gu?Symbol.for("react.lazy"):60116,Vlt=gu?Symbol.for("react.block"):60121,Hlt=gu?Symbol.for("react.fundamental"):60117,Wlt=gu?Symbol.for("react.responder"):60118,zlt=gu?Symbol.for("react.scope"):60119;function Ag(n){if(typeof n=="object"&&n!==null){var e=n.$$typeof;switch(e){case ide:switch(n=n.type,n){case ode:case qW:case HW:case zW:case WW:case GW:return n;default:switch(n=n&&n.$$typeof,n){case UW:case KW:case QW:case YW:case jW:return n;default:return e}}case rde:return e}}}function NMe(n){return Ag(n)===qW}Ns.AsyncMode=ode;Ns.ConcurrentMode=qW;Ns.ContextConsumer=UW;Ns.ContextProvider=jW;Ns.Element=ide;Ns.ForwardRef=KW;Ns.Fragment=HW;Ns.Lazy=QW;Ns.Memo=YW;Ns.Portal=rde;Ns.Profiler=zW;Ns.StrictMode=WW;Ns.Suspense=GW;Ns.isAsyncMode=function(n){return NMe(n)||Ag(n)===ode};Ns.isConcurrentMode=NMe;Ns.isContextConsumer=function(n){return Ag(n)===UW};Ns.isContextProvider=function(n){return Ag(n)===jW};Ns.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===ide};Ns.isForwardRef=function(n){return Ag(n)===KW};Ns.isFragment=function(n){return Ag(n)===HW};Ns.isLazy=function(n){return Ag(n)===QW};Ns.isMemo=function(n){return Ag(n)===YW};Ns.isPortal=function(n){return Ag(n)===rde};Ns.isProfiler=function(n){return Ag(n)===zW};Ns.isStrictMode=function(n){return Ag(n)===WW};Ns.isSuspense=function(n){return Ag(n)===GW};Ns.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===HW||n===qW||n===zW||n===WW||n===GW||n===$lt||typeof n=="object"&&n!==null&&(n.$$typeof===QW||n.$$typeof===YW||n.$$typeof===jW||n.$$typeof===UW||n.$$typeof===KW||n.$$typeof===Hlt||n.$$typeof===Wlt||n.$$typeof===zlt||n.$$typeof===Vlt)};Ns.typeOf=Ag;RMe.exports=Ns;var jlt=RMe.exports,sde=jlt,Ult={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},qlt={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Klt={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},OMe={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},ade={};ade[sde.ForwardRef]=Klt;ade[sde.Memo]=OMe;function N1e(n){return sde.isMemo(n)?OMe:ade[n.$$typeof]||Ult}var Glt=Object.defineProperty,Ylt=Object.getOwnPropertyNames,O1e=Object.getOwnPropertySymbols,Qlt=Object.getOwnPropertyDescriptor,Xlt=Object.getPrototypeOf,P1e=Object.prototype;function PMe(n,e,t){if(typeof e!="string"){if(P1e){var i=Xlt(e);i&&i!==P1e&&PMe(n,i,t)}var r=Ylt(e);O1e&&(r=r.concat(O1e(e)));for(var o=N1e(n),s=N1e(e),a=0;a<r.length;++a){var l=r[a];if(!qlt[l]&&!(t&&t[l])&&!(s&&s[l])&&!(o&&o[l])){var c=Qlt(e,l);try{Glt(n,l,c)}catch{}}}}return n}var Zlt=PMe;const M1e=ja(Zlt);var MMe={exports:{}},Os={};/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var lde=Symbol.for("react.element"),cde=Symbol.for("react.portal"),XW=Symbol.for("react.fragment"),ZW=Symbol.for("react.strict_mode"),JW=Symbol.for("react.profiler"),ez=Symbol.for("react.provider"),tz=Symbol.for("react.context"),Jlt=Symbol.for("react.server_context"),nz=Symbol.for("react.forward_ref"),iz=Symbol.for("react.suspense"),rz=Symbol.for("react.suspense_list"),oz=Symbol.for("react.memo"),sz=Symbol.for("react.lazy"),ect=Symbol.for("react.offscreen"),FMe;FMe=Symbol.for("react.module.reference");function Qp(n){if(typeof n=="object"&&n!==null){var e=n.$$typeof;switch(e){case lde:switch(n=n.type,n){case XW:case JW:case ZW:case iz:case rz:return n;default:switch(n=n&&n.$$typeof,n){case Jlt:case tz:case nz:case sz:case oz:case ez:return n;default:return e}}case cde:return e}}}Os.ContextConsumer=tz;Os.ContextProvider=ez;Os.Element=lde;Os.ForwardRef=nz;Os.Fragment=XW;Os.Lazy=sz;Os.Memo=oz;Os.Portal=cde;Os.Profiler=JW;Os.StrictMode=ZW;Os.Suspense=iz;Os.SuspenseList=rz;Os.isAsyncMode=function(){return!1};Os.isConcurrentMode=function(){return!1};Os.isContextConsumer=function(n){return Qp(n)===tz};Os.isContextProvider=function(n){return Qp(n)===ez};Os.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===lde};Os.isForwardRef=function(n){return Qp(n)===nz};Os.isFragment=function(n){return Qp(n)===XW};Os.isLazy=function(n){return Qp(n)===sz};Os.isMemo=function(n){return Qp(n)===oz};Os.isPortal=function(n){return Qp(n)===cde};Os.isProfiler=function(n){return Qp(n)===JW};Os.isStrictMode=function(n){return Qp(n)===ZW};Os.isSuspense=function(n){return Qp(n)===iz};Os.isSuspenseList=function(n){return Qp(n)===rz};Os.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===XW||n===JW||n===ZW||n===iz||n===rz||n===ect||typeof n=="object"&&n!==null&&(n.$$typeof===sz||n.$$typeof===oz||n.$$typeof===ez||n.$$typeof===tz||n.$$typeof===nz||n.$$typeof===FMe||n.getModuleId!==void 0)};Os.typeOf=Qp;MMe.exports=Os;var tct=MMe.exports;const nct=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function ict(n,e,t,i,{areStatesEqual:r,areOwnPropsEqual:o,areStatePropsEqual:s}){let a=!1,l,c,u,d,h;function g(b,y){return l=b,c=y,u=n(l,c),d=e(i,c),h=t(u,d,c),a=!0,h}function p(){return u=n(l,c),e.dependsOnOwnProps&&(d=e(i,c)),h=t(u,d,c),h}function m(){return n.dependsOnOwnProps&&(u=n(l,c)),e.dependsOnOwnProps&&(d=e(i,c)),h=t(u,d,c),h}function _(){const b=n(l,c),y=!s(b,u);return u=b,y&&(h=t(u,d,c)),h}function v(b,y){const C=!o(y,c),x=!r(b,l,y,c);return l=b,c=y,C&&x?p():C?m():x?_():h}return function(y,C){return a?v(y,C):g(y,C)}}function rct(n,e){let{initMapStateToProps:t,initMapDispatchToProps:i,initMergeProps:r}=e,o=nde(e,nct);const s=t(n,o),a=i(n,o),l=r(n,o);return ict(s,a,l,n,o)}function oct(n,e){const t={};for(const i in n){const r=n[i];typeof r=="function"&&(t[i]=(...o)=>e(r(...o)))}return t}function Vee(n){return function(t){const i=n(t);function r(){return i}return r.dependsOnOwnProps=!1,r}}function F1e(n){return n.dependsOnOwnProps?!!n.dependsOnOwnProps:n.length!==1}function BMe(n,e){return function(i,{displayName:r}){const o=function(a,l){return o.dependsOnOwnProps?o.mapToProps(a,l):o.mapToProps(a,void 0)};return o.dependsOnOwnProps=!0,o.mapToProps=function(a,l){o.mapToProps=n,o.dependsOnOwnProps=F1e(n);let c=o(a,l);return typeof c=="function"&&(o.mapToProps=c,o.dependsOnOwnProps=F1e(c),c=o(a,l)),c},o}}function ude(n,e){return(t,i)=>{throw new Error(`Invalid value of type ${typeof n} for ${e} argument when connecting component ${i.wrappedComponentName}.`)}}function sct(n){return n&&typeof n=="object"?Vee(e=>oct(n,e)):n?typeof n=="function"?BMe(n):ude(n,"mapDispatchToProps"):Vee(e=>({dispatch:e}))}function act(n){return n?typeof n=="function"?BMe(n):ude(n,"mapStateToProps"):Vee(()=>({}))}function lct(n,e,t){return rt({},t,n,e)}function cct(n){return function(t,{displayName:i,areMergedPropsEqual:r}){let o=!1,s;return function(l,c,u){const d=n(l,c,u);return o?r(d,s)||(s=d):(o=!0,s=d),s}}}function uct(n){return n?typeof n=="function"?cct(n):ude(n,"mergeProps"):()=>lct}function dct(){const n=Olt();let e=null,t=null;return{clear(){e=null,t=null},notify(){n(()=>{let i=e;for(;i;)i.callback(),i=i.next})},get(){let i=[],r=e;for(;r;)i.push(r),r=r.next;return i},subscribe(i){let r=!0,o=t={callback:i,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!r||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}const B1e={notify(){},get:()=>[]};function $Me(n,e){let t,i=B1e,r=0,o=!1;function s(m){u();const _=i.subscribe(m);let v=!1;return()=>{v||(v=!0,_(),d())}}function a(){i.notify()}function l(){p.onStateChange&&p.onStateChange()}function c(){return o}function u(){r++,t||(t=e?e.addNestedSub(l):n.subscribe(l),i=dct())}function d(){r--,t&&r===0&&(t(),t=void 0,i.clear(),i=B1e)}function h(){o||(o=!0,u())}function g(){o&&(o=!1,d())}const p={addNestedSub:s,notifyNestedSubs:a,handleChangeWrapper:l,isSubscribed:c,trySubscribe:h,tryUnsubscribe:g,getListeners:()=>i};return p}const hct=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",R9=hct?w.useLayoutEffect:w.useEffect;function $1e(n,e){return n===e?n!==0||e!==0||1/n===1/e:n!==n&&e!==e}function _Y(n,e){if($1e(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;const t=Object.keys(n),i=Object.keys(e);if(t.length!==i.length)return!1;for(let r=0;r<t.length;r++)if(!Object.prototype.hasOwnProperty.call(e,t[r])||!$1e(n[t[r]],e[t[r]]))return!1;return!0}const fct=["reactReduxForwardedRef"];let VMe=DMe;const gct=n=>{VMe=n},pct=[null,null];function mct(n,e,t){R9(()=>n(...e),t)}function _ct(n,e,t,i,r,o){n.current=i,t.current=!1,r.current&&(r.current=null,o())}function vct(n,e,t,i,r,o,s,a,l,c,u){if(!n)return()=>{};let d=!1,h=null;const g=()=>{if(d||!a.current)return;const m=e.getState();let _,v;try{_=i(m,r.current)}catch(b){v=b,h=b}v||(h=null),_===o.current?s.current||c():(o.current=_,l.current=_,s.current=!0,u())};return t.onStateChange=g,t.trySubscribe(),g(),()=>{if(d=!0,t.tryUnsubscribe(),t.onStateChange=null,h)throw h}}function bct(n,e){return n===e}function HMe(n,e,t,{pure:i,areStatesEqual:r=bct,areOwnPropsEqual:o=_Y,areStatePropsEqual:s=_Y,areMergedPropsEqual:a=_Y,forwardRef:l=!1,context:c=l0}={}){const u=c,d=act(n),h=sct(e),g=uct(t),p=!!n;return _=>{const v=_.displayName||_.name||"Component",b=`Connect(${v})`,y={shouldHandleStateChanges:p,displayName:b,wrappedComponentName:v,WrappedComponent:_,initMapStateToProps:d,initMapDispatchToProps:h,initMergeProps:g,areStatesEqual:r,areStatePropsEqual:s,areOwnPropsEqual:o,areMergedPropsEqual:a};function C(I){const[L,D,R]=w.useMemo(()=>{const{reactReduxForwardedRef:kt}=I,Vt=nde(I,fct);return[I.context,kt,Vt]},[I]),P=w.useMemo(()=>L&&L.Consumer&&tct.isContextConsumer(w.createElement(L.Consumer,null))?L:u,[L,u]),M=w.useContext(P),O=!!I.store&&!!I.store.getState&&!!I.store.dispatch,B=!!M&&!!M.store,F=O?I.store:M.store,H=B?M.getServerState:F.getState,V=w.useMemo(()=>rct(F.dispatch,y),[F]),[$,j]=w.useMemo(()=>{if(!p)return pct;const kt=$Me(F,O?void 0:M.subscription),Vt=kt.notifyNestedSubs.bind(kt);return[kt,Vt]},[F,O,M]),Y=w.useMemo(()=>O?M:rt({},M,{subscription:$}),[O,M,$]),ne=w.useRef(),se=w.useRef(R),he=w.useRef(),xe=w.useRef(!1);w.useRef(!1);const _e=w.useRef(!1),Ie=w.useRef();R9(()=>(_e.current=!0,()=>{_e.current=!1}),[]);const Re=w.useMemo(()=>()=>he.current&&R===se.current?he.current:V(F.getState(),R),[F,R]),Ye=w.useMemo(()=>Vt=>$?vct(p,F,$,V,se,ne,xe,_e,he,j,Vt):()=>{},[$]);mct(_ct,[se,ne,xe,R,he,j]);let Ze;try{Ze=VMe(Ye,Re,H?()=>V(H(),R):Re)}catch(kt){throw Ie.current&&(kt.message+=`
The error may be correlated with this previous error:
${Ie.current.stack}
`),kt}R9(()=>{Ie.current=void 0,he.current=void 0,ne.current=Ze});const tt=w.useMemo(()=>w.createElement(_,rt({},Ze,{ref:D})),[D,_,Ze]);return w.useMemo(()=>p?w.createElement(P.Provider,{value:Y},tt):tt,[P,tt,Y])}const k=w.memo(C);if(k.WrappedComponent=_,k.displayName=C.displayName=b,l){const L=w.forwardRef(function(R,P){return w.createElement(k,rt({},R,{reactReduxForwardedRef:P}))});return L.displayName=b,L.WrappedComponent=_,M1e(L,_)}return M1e(k,_)}}function WMe({store:n,context:e,children:t,serverState:i,stabilityCheck:r="once",noopCheck:o="once"}){const s=w.useMemo(()=>{const c=$Me(n);return{store:n,subscription:c,getServerState:i?()=>i:void 0,stabilityCheck:r,noopCheck:o}},[n,i,r,o]),a=w.useMemo(()=>n.getState(),[n]);R9(()=>{const{subscription:c}=s;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),a!==n.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[s,a]);const l=e||l0;return w.createElement(l.Provider,{value:s},t)}function zMe(n=l0){const e=n===l0?LMe:tde(n);return function(){const{store:i}=e();return i}}const jMe=zMe();function yct(n=l0){const e=n===l0?jMe:zMe(n);return function(){return e().dispatch}}const Ci=yct();Mlt(Tst.useSyncExternalStoreWithSelector);gct(wOe.useSyncExternalStore);Nlt(Yp.unstable_batchedUpdates);/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Ti(){return Tl(n=>n.companyUsers.changes.company)}var N9={exports:{}};/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/N9.exports;(function(n,e){(function(){var t,i="4.17.21",r=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",d=1,h=2,g=4,p=1,m=2,_=1,v=2,b=4,y=8,C=16,x=32,k=64,I=128,L=256,D=512,R=30,P="...",M=800,O=16,B=1,F=2,H=3,V=1/0,$=9007199254740991,j=17976931348623157e292,Y=0/0,ne=4294967295,se=ne-1,he=ne>>>1,xe=[["ary",I],["bind",_],["bindKey",v],["curry",y],["curryRight",C],["flip",D],["partial",x],["partialRight",k],["rearg",L]],_e="[object Arguments]",Ie="[object Array]",Re="[object AsyncFunction]",Ye="[object Boolean]",Ze="[object Date]",tt="[object DOMException]",Be="[object Error]",kt="[object Function]",Vt="[object GeneratorFunction]",xt="[object Map]",Kt="[object Number]",cn="[object Null]",wn="[object Object]",on="[object Promise]",Zt="[object Proxy]",pe="[object RegExp]",me="[object Set]",Z="[object String]",G="[object Symbol]",K="[object Undefined]",oe="[object WeakMap]",le="[object WeakSet]",we="[object ArrayBuffer]",Me="[object DataView]",ft="[object Float32Array]",Nt="[object Float64Array]",Yt="[object Int8Array]",He="[object Int16Array]",Dt="[object Int32Array]",ae="[object Uint8Array]",Se="[object Uint8ClampedArray]",Xe="[object Uint16Array]",wt="[object Uint32Array]",Tt=/\b__p \+= '';/g,zt=/\b(__p \+=) '' \+/g,Mt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,On=/&(?:amp|lt|gt|quot|#39);/g,Ni=/[&<>"']/g,xn=RegExp(On.source),un=RegExp(Ni.source),ei=/<%-([\s\S]+?)%>/g,li=/<%([\s\S]+?)%>/g,xi=/<%=([\s\S]+?)%>/g,br=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Wr=/^\w*$/,ko=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oo=/[\\^$.*+?()[\]{}|]/g,ea=RegExp(oo.source),xr=/^\s+/,Hi=/\s/,Ht=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Qn=/\{\n\/\* \[wrapped with (.+)\] \*/,Fr=/,? & /,Oe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,It=/\\(\\)?/g,tn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Je=/\w*$/,ve=/^[-+]0x[0-9a-f]+$/i,je=/^0b[01]+$/i,Le=/^\[object .+?Constructor\]$/,fe=/^0o[0-7]+$/i,Fe=/^(?:0|[1-9]\d*)$/,ot=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ue=/($^)/,Qt=/['\n\r\u2028\u2029\\]/g,gn="\\ud800-\\udfff",Pn="\\u0300-\\u036f",Zn="\\ufe20-\\ufe2f",wi="\\u20d0-\\u20ff",Sn=Pn+Zn+wi,Xt="\\u2700-\\u27bf",ti="a-z\\xdf-\\xf6\\xf8-\\xff",or="\\xac\\xb1\\xd7\\xf7",Dr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",xa="\\u2000-\\u206f",pa=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ba="A-Z\\xc0-\\xd6\\xd8-\\xde",Uo="\\ufe0e\\ufe0f",Xo=or+Dr+xa+pa,qo="[']",Ll="["+gn+"]",yc="["+Xo+"]",ci="["+Sn+"]",lo="\\d+",To="["+Xt+"]",Bs="["+ti+"]",ns="[^"+gn+Xo+lo+Xt+ti+Ba+"]",$s="\\ud83c[\\udffb-\\udfff]",_o="(?:"+ci+"|"+$s+")",Ar="[^"+gn+"]",Gr="(?:\\ud83c[\\udde6-\\uddff]){2}",hr="[\\ud800-\\udbff][\\udc00-\\udfff]",yr="["+Ba+"]",zr="\\u200d",Fi="(?:"+Bs+"|"+ns+")",Hn="(?:"+yr+"|"+ns+")",ni="(?:"+qo+"(?:d|ll|m|re|s|t|ve))?",Ln="(?:"+qo+"(?:D|LL|M|RE|S|T|VE))?",Wn=_o+"?",ii="["+Uo+"]?",Oi="(?:"+zr+"(?:"+[Ar,Gr,hr].join("|")+")"+ii+Wn+")*",sn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",an="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Dn=ii+Wn+Oi,it="(?:"+[To,Gr,hr].join("|")+")"+Dn,vt="(?:"+[Ar+ci+"?",ci,Gr,hr,Ll].join("|")+")",Jt=RegExp(qo,"g"),Nn=RegExp(ci,"g"),En=RegExp($s+"(?="+$s+")|"+vt+Dn,"g"),Kn=RegExp([yr+"?"+Bs+"+"+ni+"(?="+[yc,yr,"$"].join("|")+")",Hn+"+"+Ln+"(?="+[yc,yr+Fi,"$"].join("|")+")",yr+"?"+Fi+"+"+ni,yr+"+"+Ln,an,sn,lo,it].join("|"),"g"),Cr=RegExp("["+zr+gn+Sn+Uo+"]"),Yr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Br=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$a=-1,fr={};fr[ft]=fr[Nt]=fr[Yt]=fr[He]=fr[Dt]=fr[ae]=fr[Se]=fr[Xe]=fr[wt]=!0,fr[_e]=fr[Ie]=fr[we]=fr[Ye]=fr[Me]=fr[Ze]=fr[Be]=fr[kt]=fr[xt]=fr[Kt]=fr[wn]=fr[pe]=fr[me]=fr[Z]=fr[oe]=!1;var qi={};qi[_e]=qi[Ie]=qi[we]=qi[Me]=qi[Ye]=qi[Ze]=qi[ft]=qi[Nt]=qi[Yt]=qi[He]=qi[Dt]=qi[xt]=qi[Kt]=qi[wn]=qi[pe]=qi[me]=qi[Z]=qi[G]=qi[ae]=qi[Se]=qi[Xe]=qi[wt]=!0,qi[Be]=qi[kt]=qi[oe]=!1;var Vs={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},zc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},_u={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Zo={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Cc=parseFloat,tc=parseInt,F_=typeof Co=="object"&&Co&&Co.Object===Object&&Co,uS=typeof self=="object"&&self&&self.Object===Object&&self,cl=F_||uS||Function("return this")(),Db=e&&!e.nodeType&&e,_h=Db&&!0&&n&&!n.nodeType&&n,B_=_h&&_h.exports===Db,nd=B_&&F_.process,jc=function(){try{var ze=_h&&_h.require&&_h.require("util").types;return ze||nd&&nd.binding&&nd.binding("util")}catch{}}(),dS=jc&&jc.isArrayBuffer,$_=jc&&jc.isDate,Ab=jc&&jc.isMap,Vg=jc&&jc.isRegExp,eF=jc&&jc.isSet,tF=jc&&jc.isTypedArray;function Md(ze,At,mt){switch(mt.length){case 0:return ze.call(At);case 1:return ze.call(At,mt[0]);case 2:return ze.call(At,mt[0],mt[1]);case 3:return ze.call(At,mt[0],mt[1],mt[2])}return ze.apply(At,mt)}function jK(ze,At,mt,oi){for(var Nr=-1,rs=ze==null?0:ze.length;++Nr<rs;){var wc=ze[Nr];At(oi,wc,mt(wc),ze)}return oi}function id(ze,At){for(var mt=-1,oi=ze==null?0:ze.length;++mt<oi&&At(ze[mt],mt,ze)!==!1;);return ze}function UK(ze,At){for(var mt=ze==null?0:ze.length;mt--&&At(ze[mt],mt,ze)!==!1;);return ze}function nF(ze,At){for(var mt=-1,oi=ze==null?0:ze.length;++mt<oi;)if(!At(ze[mt],mt,ze))return!1;return!0}function Hg(ze,At){for(var mt=-1,oi=ze==null?0:ze.length,Nr=0,rs=[];++mt<oi;){var wc=ze[mt];At(wc,mt,ze)&&(rs[Nr++]=wc)}return rs}function xf(ze,At){var mt=ze==null?0:ze.length;return!!mt&&Rb(ze,At,0)>-1}function Yk(ze,At,mt){for(var oi=-1,Nr=ze==null?0:ze.length;++oi<Nr;)if(mt(At,ze[oi]))return!0;return!1}function ma(ze,At){for(var mt=-1,oi=ze==null?0:ze.length,Nr=Array(oi);++mt<oi;)Nr[mt]=At(ze[mt],mt,ze);return Nr}function cm(ze,At){for(var mt=-1,oi=At.length,Nr=ze.length;++mt<oi;)ze[Nr+mt]=At[mt];return ze}function Qk(ze,At,mt,oi){var Nr=-1,rs=ze==null?0:ze.length;for(oi&&rs&&(mt=ze[++Nr]);++Nr<rs;)mt=At(mt,ze[Nr],Nr,ze);return mt}function qK(ze,At,mt,oi){var Nr=ze==null?0:ze.length;for(oi&&Nr&&(mt=ze[--Nr]);Nr--;)mt=At(mt,ze[Nr],Nr,ze);return mt}function HA(ze,At){for(var mt=-1,oi=ze==null?0:ze.length;++mt<oi;)if(At(ze[mt],mt,ze))return!0;return!1}var KK=zA("length");function iF(ze){return ze.split("")}function GK(ze){return ze.match(Oe)||[]}function rF(ze,At,mt){var oi;return mt(ze,function(Nr,rs,wc){if(At(Nr,rs,wc))return oi=rs,!1}),oi}function Xk(ze,At,mt,oi){for(var Nr=ze.length,rs=mt+(oi?1:-1);oi?rs--:++rs<Nr;)if(At(ze[rs],rs,ze))return rs;return-1}function Rb(ze,At,mt){return At===At?FZe(ze,At,mt):Xk(ze,Zk,mt)}function WA(ze,At,mt,oi){for(var Nr=mt-1,rs=ze.length;++Nr<rs;)if(oi(ze[Nr],At))return Nr;return-1}function Zk(ze){return ze!==ze}function oF(ze,At){var mt=ze==null?0:ze.length;return mt?kr(ze,At)/mt:Y}function zA(ze){return function(At){return At==null?t:At[ze]}}function jr(ze){return function(At){return ze==null?t:ze[At]}}function jn(ze,At,mt,oi,Nr){return Nr(ze,function(rs,wc,ta){mt=oi?(oi=!1,rs):At(mt,rs,wc,ta)}),mt}function Rr(ze,At){var mt=ze.length;for(ze.sort(At);mt--;)ze[mt]=ze[mt].value;return ze}function kr(ze,At){for(var mt,oi=-1,Nr=ze.length;++oi<Nr;){var rs=At(ze[oi]);rs!==t&&(mt=mt===t?rs:mt+rs)}return mt}function is(ze,At){for(var mt=-1,oi=Array(ze);++mt<ze;)oi[mt]=At(mt);return oi}function Uc(ze,At){return ma(At,function(mt){return[mt,ze[mt]]})}function vh(ze){return ze&&ze.slice(0,Nbe(ze)+1).replace(xr,"")}function Ka(ze){return function(At){return ze(At)}}function Wg(ze,At){return ma(At,function(mt){return ze[mt]})}function um(ze,At){return ze.has(At)}function V_(ze,At){for(var mt=-1,oi=ze.length;++mt<oi&&Rb(At,ze[mt],0)>-1;);return mt}function rd(ze,At){for(var mt=ze.length;mt--&&Rb(At,ze[mt],0)>-1;);return mt}function LZe(ze,At){for(var mt=ze.length,oi=0;mt--;)ze[mt]===At&&++oi;return oi}var DZe=jr(Vs),AZe=jr(zc);function RZe(ze){return"\\"+Zo[ze]}function NZe(ze,At){return ze==null?t:ze[At]}function Jk(ze){return Cr.test(ze)}function OZe(ze){return Yr.test(ze)}function PZe(ze){for(var At,mt=[];!(At=ze.next()).done;)mt.push(At.value);return mt}function YK(ze){var At=-1,mt=Array(ze.size);return ze.forEach(function(oi,Nr){mt[++At]=[Nr,oi]}),mt}function Rbe(ze,At){return function(mt){return ze(At(mt))}}function $0(ze,At){for(var mt=-1,oi=ze.length,Nr=0,rs=[];++mt<oi;){var wc=ze[mt];(wc===At||wc===u)&&(ze[mt]=u,rs[Nr++]=mt)}return rs}function sF(ze){var At=-1,mt=Array(ze.size);return ze.forEach(function(oi){mt[++At]=oi}),mt}function MZe(ze){var At=-1,mt=Array(ze.size);return ze.forEach(function(oi){mt[++At]=[oi,oi]}),mt}function FZe(ze,At,mt){for(var oi=mt-1,Nr=ze.length;++oi<Nr;)if(ze[oi]===At)return oi;return-1}function BZe(ze,At,mt){for(var oi=mt+1;oi--;)if(ze[oi]===At)return oi;return oi}function eT(ze){return Jk(ze)?VZe(ze):KK(ze)}function dm(ze){return Jk(ze)?HZe(ze):iF(ze)}function Nbe(ze){for(var At=ze.length;At--&&Hi.test(ze.charAt(At)););return At}var $Ze=jr(_u);function VZe(ze){for(var At=En.lastIndex=0;En.test(ze);)++At;return At}function HZe(ze){return ze.match(En)||[]}function WZe(ze){return ze.match(Kn)||[]}var zZe=function ze(At){At=At==null?cl:tT.defaults(cl.Object(),At,tT.pick(cl,Br));var mt=At.Array,oi=At.Date,Nr=At.Error,rs=At.Function,wc=At.Math,ta=At.Object,QK=At.RegExp,jZe=At.String,zg=At.TypeError,aF=mt.prototype,UZe=rs.prototype,nT=ta.prototype,lF=At["__core-js_shared__"],cF=UZe.toString,Es=nT.hasOwnProperty,qZe=0,Obe=function(){var S=/[^.]+$/.exec(lF&&lF.keys&&lF.keys.IE_PROTO||"");return S?"Symbol(src)_1."+S:""}(),uF=nT.toString,KZe=cF.call(ta),GZe=cl._,YZe=QK("^"+cF.call(Es).replace(oo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),dF=B_?At.Buffer:t,V0=At.Symbol,hF=At.Uint8Array,Pbe=dF?dF.allocUnsafe:t,fF=Rbe(ta.getPrototypeOf,ta),Mbe=ta.create,Fbe=nT.propertyIsEnumerable,gF=aF.splice,Bbe=V0?V0.isConcatSpreadable:t,jA=V0?V0.iterator:t,hS=V0?V0.toStringTag:t,pF=function(){try{var S=_S(ta,"defineProperty");return S({},"",{}),S}catch{}}(),QZe=At.clearTimeout!==cl.clearTimeout&&At.clearTimeout,XZe=oi&&oi.now!==cl.Date.now&&oi.now,ZZe=At.setTimeout!==cl.setTimeout&&At.setTimeout,mF=wc.ceil,_F=wc.floor,XK=ta.getOwnPropertySymbols,JZe=dF?dF.isBuffer:t,$be=At.isFinite,eJe=aF.join,tJe=Rbe(ta.keys,ta),Sc=wc.max,od=wc.min,nJe=oi.now,iJe=At.parseInt,Vbe=wc.random,rJe=aF.reverse,ZK=_S(At,"DataView"),UA=_S(At,"Map"),JK=_S(At,"Promise"),iT=_S(At,"Set"),qA=_S(At,"WeakMap"),KA=_S(ta,"create"),vF=qA&&new qA,rT={},oJe=vS(ZK),sJe=vS(UA),aJe=vS(JK),lJe=vS(iT),cJe=vS(qA),bF=V0?V0.prototype:t,GA=bF?bF.valueOf:t,Hbe=bF?bF.toString:t;function ce(S){if(ul(S)&&!Pr(S)&&!(S instanceof vo)){if(S instanceof jg)return S;if(Es.call(S,"__wrapped__"))return Wye(S)}return new jg(S)}var oT=function(){function S(){}return function(T){if(!Ga(T))return{};if(Mbe)return Mbe(T);S.prototype=T;var A=new S;return S.prototype=t,A}}();function yF(){}function jg(S,T){this.__wrapped__=S,this.__actions__=[],this.__chain__=!!T,this.__index__=0,this.__values__=t}ce.templateSettings={escape:ei,evaluate:li,interpolate:xi,variable:"",imports:{_:ce}},ce.prototype=yF.prototype,ce.prototype.constructor=ce,jg.prototype=oT(yF.prototype),jg.prototype.constructor=jg;function vo(S){this.__wrapped__=S,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ne,this.__views__=[]}function uJe(){var S=new vo(this.__wrapped__);return S.__actions__=bh(this.__actions__),S.__dir__=this.__dir__,S.__filtered__=this.__filtered__,S.__iteratees__=bh(this.__iteratees__),S.__takeCount__=this.__takeCount__,S.__views__=bh(this.__views__),S}function dJe(){if(this.__filtered__){var S=new vo(this);S.__dir__=-1,S.__filtered__=!0}else S=this.clone(),S.__dir__*=-1;return S}function hJe(){var S=this.__wrapped__.value(),T=this.__dir__,A=Pr(S),W=T<0,Q=A?S.length:0,de=ket(0,Q,this.__views__),Ee=de.start,Ne=de.end,qe=Ne-Ee,Wt=W?Ne:Ee-1,jt=this.__iteratees__,rn=jt.length,zn=0,bi=od(qe,this.__takeCount__);if(!A||!W&&Q==qe&&bi==qe)return dye(S,this.__actions__);var sr=[];e:for(;qe--&&zn<bi;){Wt+=T;for(var Qr=-1,ar=S[Wt];++Qr<rn;){var co=jt[Qr],Io=co.iteratee,If=co.type,$d=Io(ar);if(If==F)ar=$d;else if(!$d){if(If==B)continue e;break e}}sr[zn++]=ar}return sr}vo.prototype=oT(yF.prototype),vo.prototype.constructor=vo;function fS(S){var T=-1,A=S==null?0:S.length;for(this.clear();++T<A;){var W=S[T];this.set(W[0],W[1])}}function fJe(){this.__data__=KA?KA(null):{},this.size=0}function gJe(S){var T=this.has(S)&&delete this.__data__[S];return this.size-=T?1:0,T}function pJe(S){var T=this.__data__;if(KA){var A=T[S];return A===l?t:A}return Es.call(T,S)?T[S]:t}function mJe(S){var T=this.__data__;return KA?T[S]!==t:Es.call(T,S)}function _Je(S,T){var A=this.__data__;return this.size+=this.has(S)?0:1,A[S]=KA&&T===t?l:T,this}fS.prototype.clear=fJe,fS.prototype.delete=gJe,fS.prototype.get=pJe,fS.prototype.has=mJe,fS.prototype.set=_Je;function Nb(S){var T=-1,A=S==null?0:S.length;for(this.clear();++T<A;){var W=S[T];this.set(W[0],W[1])}}function vJe(){this.__data__=[],this.size=0}function bJe(S){var T=this.__data__,A=CF(T,S);if(A<0)return!1;var W=T.length-1;return A==W?T.pop():gF.call(T,A,1),--this.size,!0}function yJe(S){var T=this.__data__,A=CF(T,S);return A<0?t:T[A][1]}function CJe(S){return CF(this.__data__,S)>-1}function wJe(S,T){var A=this.__data__,W=CF(A,S);return W<0?(++this.size,A.push([S,T])):A[W][1]=T,this}Nb.prototype.clear=vJe,Nb.prototype.delete=bJe,Nb.prototype.get=yJe,Nb.prototype.has=CJe,Nb.prototype.set=wJe;function Ob(S){var T=-1,A=S==null?0:S.length;for(this.clear();++T<A;){var W=S[T];this.set(W[0],W[1])}}function SJe(){this.size=0,this.__data__={hash:new fS,map:new(UA||Nb),string:new fS}}function EJe(S){var T=NF(this,S).delete(S);return this.size-=T?1:0,T}function xJe(S){return NF(this,S).get(S)}function kJe(S){return NF(this,S).has(S)}function TJe(S,T){var A=NF(this,S),W=A.size;return A.set(S,T),this.size+=A.size==W?0:1,this}Ob.prototype.clear=SJe,Ob.prototype.delete=EJe,Ob.prototype.get=xJe,Ob.prototype.has=kJe,Ob.prototype.set=TJe;function gS(S){var T=-1,A=S==null?0:S.length;for(this.__data__=new Ob;++T<A;)this.add(S[T])}function IJe(S){return this.__data__.set(S,l),this}function LJe(S){return this.__data__.has(S)}gS.prototype.add=gS.prototype.push=IJe,gS.prototype.has=LJe;function hm(S){var T=this.__data__=new Nb(S);this.size=T.size}function DJe(){this.__data__=new Nb,this.size=0}function AJe(S){var T=this.__data__,A=T.delete(S);return this.size=T.size,A}function RJe(S){return this.__data__.get(S)}function NJe(S){return this.__data__.has(S)}function OJe(S,T){var A=this.__data__;if(A instanceof Nb){var W=A.__data__;if(!UA||W.length<r-1)return W.push([S,T]),this.size=++A.size,this;A=this.__data__=new Ob(W)}return A.set(S,T),this.size=A.size,this}hm.prototype.clear=DJe,hm.prototype.delete=AJe,hm.prototype.get=RJe,hm.prototype.has=NJe,hm.prototype.set=OJe;function Wbe(S,T){var A=Pr(S),W=!A&&bS(S),Q=!A&&!W&&U0(S),de=!A&&!W&&!Q&&cT(S),Ee=A||W||Q||de,Ne=Ee?is(S.length,jZe):[],qe=Ne.length;for(var Wt in S)(T||Es.call(S,Wt))&&!(Ee&&(Wt=="length"||Q&&(Wt=="offset"||Wt=="parent")||de&&(Wt=="buffer"||Wt=="byteLength"||Wt=="byteOffset")||Bb(Wt,qe)))&&Ne.push(Wt);return Ne}function zbe(S){var T=S.length;return T?S[uG(0,T-1)]:t}function PJe(S,T){return OF(bh(S),pS(T,0,S.length))}function MJe(S){return OF(bh(S))}function eG(S,T,A){(A!==t&&!fm(S[T],A)||A===t&&!(T in S))&&Pb(S,T,A)}function YA(S,T,A){var W=S[T];(!(Es.call(S,T)&&fm(W,A))||A===t&&!(T in S))&&Pb(S,T,A)}function CF(S,T){for(var A=S.length;A--;)if(fm(S[A][0],T))return A;return-1}function FJe(S,T,A,W){return H0(S,function(Q,de,Ee){T(W,Q,A(Q),Ee)}),W}function jbe(S,T){return S&&W_(T,qc(T),S)}function BJe(S,T){return S&&W_(T,Ch(T),S)}function Pb(S,T,A){T=="__proto__"&&pF?pF(S,T,{configurable:!0,enumerable:!0,value:A,writable:!0}):S[T]=A}function tG(S,T){for(var A=-1,W=T.length,Q=mt(W),de=S==null;++A<W;)Q[A]=de?t:PG(S,T[A]);return Q}function pS(S,T,A){return S===S&&(A!==t&&(S=S<=A?S:A),T!==t&&(S=S>=T?S:T)),S}function Ug(S,T,A,W,Q,de){var Ee,Ne=T&d,qe=T&h,Wt=T&g;if(A&&(Ee=Q?A(S,W,Q,de):A(S)),Ee!==t)return Ee;if(!Ga(S))return S;var jt=Pr(S);if(jt){if(Ee=Iet(S),!Ne)return bh(S,Ee)}else{var rn=sd(S),zn=rn==kt||rn==Vt;if(U0(S))return gye(S,Ne);if(rn==wn||rn==_e||zn&&!Q){if(Ee=qe||zn?{}:Nye(S),!Ne)return qe?met(S,BJe(Ee,S)):pet(S,jbe(Ee,S))}else{if(!qi[rn])return Q?S:{};Ee=Let(S,rn,Ne)}}de||(de=new hm);var bi=de.get(S);if(bi)return bi;de.set(S,Ee),l0e(S)?S.forEach(function(ar){Ee.add(Ug(ar,T,A,ar,S,de))}):s0e(S)&&S.forEach(function(ar,co){Ee.set(co,Ug(ar,T,A,co,S,de))});var sr=Wt?qe?CG:yG:qe?Ch:qc,Qr=jt?t:sr(S);return id(Qr||S,function(ar,co){Qr&&(co=ar,ar=S[co]),YA(Ee,co,Ug(ar,T,A,co,S,de))}),Ee}function $Je(S){var T=qc(S);return function(A){return Ube(A,S,T)}}function Ube(S,T,A){var W=A.length;if(S==null)return!W;for(S=ta(S);W--;){var Q=A[W],de=T[Q],Ee=S[Q];if(Ee===t&&!(Q in S)||!de(Ee))return!1}return!0}function qbe(S,T,A){if(typeof S!="function")throw new zg(s);return nR(function(){S.apply(t,A)},T)}function QA(S,T,A,W){var Q=-1,de=xf,Ee=!0,Ne=S.length,qe=[],Wt=T.length;if(!Ne)return qe;A&&(T=ma(T,Ka(A))),W?(de=Yk,Ee=!1):T.length>=r&&(de=um,Ee=!1,T=new gS(T));e:for(;++Q<Ne;){var jt=S[Q],rn=A==null?jt:A(jt);if(jt=W||jt!==0?jt:0,Ee&&rn===rn){for(var zn=Wt;zn--;)if(T[zn]===rn)continue e;qe.push(jt)}else de(T,rn,W)||qe.push(jt)}return qe}var H0=bye(H_),Kbe=bye(iG,!0);function VJe(S,T){var A=!0;return H0(S,function(W,Q,de){return A=!!T(W,Q,de),A}),A}function wF(S,T,A){for(var W=-1,Q=S.length;++W<Q;){var de=S[W],Ee=T(de);if(Ee!=null&&(Ne===t?Ee===Ee&&!Tf(Ee):A(Ee,Ne)))var Ne=Ee,qe=de}return qe}function HJe(S,T,A,W){var Q=S.length;for(A=Ur(A),A<0&&(A=-A>Q?0:Q+A),W=W===t||W>Q?Q:Ur(W),W<0&&(W+=Q),W=A>W?0:u0e(W);A<W;)S[A++]=T;return S}function Gbe(S,T){var A=[];return H0(S,function(W,Q,de){T(W,Q,de)&&A.push(W)}),A}function vu(S,T,A,W,Q){var de=-1,Ee=S.length;for(A||(A=Aet),Q||(Q=[]);++de<Ee;){var Ne=S[de];T>0&&A(Ne)?T>1?vu(Ne,T-1,A,W,Q):cm(Q,Ne):W||(Q[Q.length]=Ne)}return Q}var nG=yye(),Ybe=yye(!0);function H_(S,T){return S&&nG(S,T,qc)}function iG(S,T){return S&&Ybe(S,T,qc)}function SF(S,T){return Hg(T,function(A){return $b(S[A])})}function mS(S,T){T=z0(T,S);for(var A=0,W=T.length;S!=null&&A<W;)S=S[z_(T[A++])];return A&&A==W?S:t}function Qbe(S,T,A){var W=T(S);return Pr(S)?W:cm(W,A(S))}function Fd(S){return S==null?S===t?K:cn:hS&&hS in ta(S)?xet(S):Bet(S)}function rG(S,T){return S>T}function WJe(S,T){return S!=null&&Es.call(S,T)}function zJe(S,T){return S!=null&&T in ta(S)}function jJe(S,T,A){return S>=od(T,A)&&S<Sc(T,A)}function oG(S,T,A){for(var W=A?Yk:xf,Q=S[0].length,de=S.length,Ee=de,Ne=mt(de),qe=1/0,Wt=[];Ee--;){var jt=S[Ee];Ee&&T&&(jt=ma(jt,Ka(T))),qe=od(jt.length,qe),Ne[Ee]=!A&&(T||Q>=120&&jt.length>=120)?new gS(Ee&&jt):t}jt=S[0];var rn=-1,zn=Ne[0];e:for(;++rn<Q&&Wt.length<qe;){var bi=jt[rn],sr=T?T(bi):bi;if(bi=A||bi!==0?bi:0,!(zn?um(zn,sr):W(Wt,sr,A))){for(Ee=de;--Ee;){var Qr=Ne[Ee];if(!(Qr?um(Qr,sr):W(S[Ee],sr,A)))continue e}zn&&zn.push(sr),Wt.push(bi)}}return Wt}function UJe(S,T,A,W){return H_(S,function(Q,de,Ee){T(W,A(Q),de,Ee)}),W}function XA(S,T,A){T=z0(T,S),S=Fye(S,T);var W=S==null?S:S[z_(Kg(T))];return W==null?t:Md(W,S,A)}function Xbe(S){return ul(S)&&Fd(S)==_e}function qJe(S){return ul(S)&&Fd(S)==we}function KJe(S){return ul(S)&&Fd(S)==Ze}function ZA(S,T,A,W,Q){return S===T?!0:S==null||T==null||!ul(S)&&!ul(T)?S!==S&&T!==T:GJe(S,T,A,W,ZA,Q)}function GJe(S,T,A,W,Q,de){var Ee=Pr(S),Ne=Pr(T),qe=Ee?Ie:sd(S),Wt=Ne?Ie:sd(T);qe=qe==_e?wn:qe,Wt=Wt==_e?wn:Wt;var jt=qe==wn,rn=Wt==wn,zn=qe==Wt;if(zn&&U0(S)){if(!U0(T))return!1;Ee=!0,jt=!1}if(zn&&!jt)return de||(de=new hm),Ee||cT(S)?Dye(S,T,A,W,Q,de):wet(S,T,qe,A,W,Q,de);if(!(A&p)){var bi=jt&&Es.call(S,"__wrapped__"),sr=rn&&Es.call(T,"__wrapped__");if(bi||sr){var Qr=bi?S.value():S,ar=sr?T.value():T;return de||(de=new hm),Q(Qr,ar,A,W,de)}}return zn?(de||(de=new hm),Eet(S,T,A,W,Q,de)):!1}function YJe(S){return ul(S)&&sd(S)==xt}function sG(S,T,A,W){var Q=A.length,de=Q,Ee=!W;if(S==null)return!de;for(S=ta(S);Q--;){var Ne=A[Q];if(Ee&&Ne[2]?Ne[1]!==S[Ne[0]]:!(Ne[0]in S))return!1}for(;++Q<de;){Ne=A[Q];var qe=Ne[0],Wt=S[qe],jt=Ne[1];if(Ee&&Ne[2]){if(Wt===t&&!(qe in S))return!1}else{var rn=new hm;if(W)var zn=W(Wt,jt,qe,S,T,rn);if(!(zn===t?ZA(jt,Wt,p|m,W,rn):zn))return!1}}return!0}function Zbe(S){if(!Ga(S)||Net(S))return!1;var T=$b(S)?YZe:Le;return T.test(vS(S))}function QJe(S){return ul(S)&&Fd(S)==pe}function XJe(S){return ul(S)&&sd(S)==me}function ZJe(S){return ul(S)&&VF(S.length)&&!!fr[Fd(S)]}function Jbe(S){return typeof S=="function"?S:S==null?wh:typeof S=="object"?Pr(S)?nye(S[0],S[1]):tye(S):C0e(S)}function aG(S){if(!tR(S))return tJe(S);var T=[];for(var A in ta(S))Es.call(S,A)&&A!="constructor"&&T.push(A);return T}function JJe(S){if(!Ga(S))return Fet(S);var T=tR(S),A=[];for(var W in S)W=="constructor"&&(T||!Es.call(S,W))||A.push(W);return A}function lG(S,T){return S<T}function eye(S,T){var A=-1,W=yh(S)?mt(S.length):[];return H0(S,function(Q,de,Ee){W[++A]=T(Q,de,Ee)}),W}function tye(S){var T=SG(S);return T.length==1&&T[0][2]?Pye(T[0][0],T[0][1]):function(A){return A===S||sG(A,S,T)}}function nye(S,T){return xG(S)&&Oye(T)?Pye(z_(S),T):function(A){var W=PG(A,S);return W===t&&W===T?MG(A,S):ZA(T,W,p|m)}}function EF(S,T,A,W,Q){S!==T&&nG(T,function(de,Ee){if(Q||(Q=new hm),Ga(de))eet(S,T,Ee,A,EF,W,Q);else{var Ne=W?W(TG(S,Ee),de,Ee+"",S,T,Q):t;Ne===t&&(Ne=de),eG(S,Ee,Ne)}},Ch)}function eet(S,T,A,W,Q,de,Ee){var Ne=TG(S,A),qe=TG(T,A),Wt=Ee.get(qe);if(Wt){eG(S,A,Wt);return}var jt=de?de(Ne,qe,A+"",S,T,Ee):t,rn=jt===t;if(rn){var zn=Pr(qe),bi=!zn&&U0(qe),sr=!zn&&!bi&&cT(qe);jt=qe,zn||bi||sr?Pr(Ne)?jt=Ne:Dl(Ne)?jt=bh(Ne):bi?(rn=!1,jt=gye(qe,!0)):sr?(rn=!1,jt=pye(qe,!0)):jt=[]:iR(qe)||bS(qe)?(jt=Ne,bS(Ne)?jt=d0e(Ne):(!Ga(Ne)||$b(Ne))&&(jt=Nye(qe))):rn=!1}rn&&(Ee.set(qe,jt),Q(jt,qe,W,de,Ee),Ee.delete(qe)),eG(S,A,jt)}function iye(S,T){var A=S.length;if(A)return T+=T<0?A:0,Bb(T,A)?S[T]:t}function rye(S,T,A){T.length?T=ma(T,function(de){return Pr(de)?function(Ee){return mS(Ee,de.length===1?de[0]:de)}:de}):T=[wh];var W=-1;T=ma(T,Ka(Ji()));var Q=eye(S,function(de,Ee,Ne){var qe=ma(T,function(Wt){return Wt(de)});return{criteria:qe,index:++W,value:de}});return Rr(Q,function(de,Ee){return get(de,Ee,A)})}function tet(S,T){return oye(S,T,function(A,W){return MG(S,W)})}function oye(S,T,A){for(var W=-1,Q=T.length,de={};++W<Q;){var Ee=T[W],Ne=mS(S,Ee);A(Ne,Ee)&&JA(de,z0(Ee,S),Ne)}return de}function net(S){return function(T){return mS(T,S)}}function cG(S,T,A,W){var Q=W?WA:Rb,de=-1,Ee=T.length,Ne=S;for(S===T&&(T=bh(T)),A&&(Ne=ma(S,Ka(A)));++de<Ee;)for(var qe=0,Wt=T[de],jt=A?A(Wt):Wt;(qe=Q(Ne,jt,qe,W))>-1;)Ne!==S&&gF.call(Ne,qe,1),gF.call(S,qe,1);return S}function sye(S,T){for(var A=S?T.length:0,W=A-1;A--;){var Q=T[A];if(A==W||Q!==de){var de=Q;Bb(Q)?gF.call(S,Q,1):fG(S,Q)}}return S}function uG(S,T){return S+_F(Vbe()*(T-S+1))}function iet(S,T,A,W){for(var Q=-1,de=Sc(mF((T-S)/(A||1)),0),Ee=mt(de);de--;)Ee[W?de:++Q]=S,S+=A;return Ee}function dG(S,T){var A="";if(!S||T<1||T>$)return A;do T%2&&(A+=S),T=_F(T/2),T&&(S+=S);while(T);return A}function no(S,T){return IG(Mye(S,T,wh),S+"")}function ret(S){return zbe(uT(S))}function oet(S,T){var A=uT(S);return OF(A,pS(T,0,A.length))}function JA(S,T,A,W){if(!Ga(S))return S;T=z0(T,S);for(var Q=-1,de=T.length,Ee=de-1,Ne=S;Ne!=null&&++Q<de;){var qe=z_(T[Q]),Wt=A;if(qe==="__proto__"||qe==="constructor"||qe==="prototype")return S;if(Q!=Ee){var jt=Ne[qe];Wt=W?W(jt,qe,Ne):t,Wt===t&&(Wt=Ga(jt)?jt:Bb(T[Q+1])?[]:{})}YA(Ne,qe,Wt),Ne=Ne[qe]}return S}var aye=vF?function(S,T){return vF.set(S,T),S}:wh,set=pF?function(S,T){return pF(S,"toString",{configurable:!0,enumerable:!1,value:BG(T),writable:!0})}:wh;function aet(S){return OF(uT(S))}function qg(S,T,A){var W=-1,Q=S.length;T<0&&(T=-T>Q?0:Q+T),A=A>Q?Q:A,A<0&&(A+=Q),Q=T>A?0:A-T>>>0,T>>>=0;for(var de=mt(Q);++W<Q;)de[W]=S[W+T];return de}function cet(S,T){var A;return H0(S,function(W,Q,de){return A=T(W,Q,de),!A}),!!A}function xF(S,T,A){var W=0,Q=S==null?W:S.length;if(typeof T=="number"&&T===T&&Q<=he){for(;W<Q;){var de=W+Q>>>1,Ee=S[de];Ee!==null&&!Tf(Ee)&&(A?Ee<=T:Ee<T)?W=de+1:Q=de}return Q}return hG(S,T,wh,A)}function hG(S,T,A,W){var Q=0,de=S==null?0:S.length;if(de===0)return 0;T=A(T);for(var Ee=T!==T,Ne=T===null,qe=Tf(T),Wt=T===t;Q<de;){var jt=_F((Q+de)/2),rn=A(S[jt]),zn=rn!==t,bi=rn===null,sr=rn===rn,Qr=Tf(rn);if(Ee)var ar=W||sr;else Wt?ar=sr&&(W||zn):Ne?ar=sr&&zn&&(W||!bi):qe?ar=sr&&zn&&!bi&&(W||!Qr):bi||Qr?ar=!1:ar=W?rn<=T:rn<T;ar?Q=jt+1:de=jt}return od(de,se)}function lye(S,T){for(var A=-1,W=S.length,Q=0,de=[];++A<W;){var Ee=S[A],Ne=T?T(Ee):Ee;if(!A||!fm(Ne,qe)){var qe=Ne;de[Q++]=Ee===0?0:Ee}}return de}function cye(S){return typeof S=="number"?S:Tf(S)?Y:+S}function kf(S){if(typeof S=="string")return S;if(Pr(S))return ma(S,kf)+"";if(Tf(S))return Hbe?Hbe.call(S):"";var T=S+"";return T=="0"&&1/S==-V?"-0":T}function W0(S,T,A){var W=-1,Q=xf,de=S.length,Ee=!0,Ne=[],qe=Ne;if(A)Ee=!1,Q=Yk;else if(de>=r){var Wt=T?null:yet(S);if(Wt)return sF(Wt);Ee=!1,Q=um,qe=new gS}else qe=T?[]:Ne;e:for(;++W<de;){var jt=S[W],rn=T?T(jt):jt;if(jt=A||jt!==0?jt:0,Ee&&rn===rn){for(var zn=qe.length;zn--;)if(qe[zn]===rn)continue e;T&&qe.push(rn),Ne.push(jt)}else Q(qe,rn,A)||(qe!==Ne&&qe.push(rn),Ne.push(jt))}return Ne}function fG(S,T){return T=z0(T,S),S=Fye(S,T),S==null||delete S[z_(Kg(T))]}function uye(S,T,A,W){return JA(S,T,A(mS(S,T)),W)}function kF(S,T,A,W){for(var Q=S.length,de=W?Q:-1;(W?de--:++de<Q)&&T(S[de],de,S););return A?qg(S,W?0:de,W?de+1:Q):qg(S,W?de+1:0,W?Q:de)}function dye(S,T){var A=S;return A instanceof vo&&(A=A.value()),Qk(T,function(W,Q){return Q.func.apply(Q.thisArg,cm([W],Q.args))},A)}function gG(S,T,A){var W=S.length;if(W<2)return W?W0(S[0]):[];for(var Q=-1,de=mt(W);++Q<W;)for(var Ee=S[Q],Ne=-1;++Ne<W;)Ne!=Q&&(de[Q]=QA(de[Q]||Ee,S[Ne],T,A));return W0(vu(de,1),T,A)}function hye(S,T,A){for(var W=-1,Q=S.length,de=T.length,Ee={};++W<Q;){var Ne=W<de?T[W]:t;A(Ee,S[W],Ne)}return Ee}function pG(S){return Dl(S)?S:[]}function mG(S){return typeof S=="function"?S:wh}function z0(S,T){return Pr(S)?S:xG(S,T)?[S]:Hye(hs(S))}var uet=no;function j0(S,T,A){var W=S.length;return A=A===t?W:A,!T&&A>=W?S:qg(S,T,A)}var fye=QZe||function(S){return cl.clearTimeout(S)};function gye(S,T){if(T)return S.slice();var A=S.length,W=Pbe?Pbe(A):new S.constructor(A);return S.copy(W),W}function _G(S){var T=new S.constructor(S.byteLength);return new hF(T).set(new hF(S)),T}function det(S,T){var A=T?_G(S.buffer):S.buffer;return new S.constructor(A,S.byteOffset,S.byteLength)}function het(S){var T=new S.constructor(S.source,Je.exec(S));return T.lastIndex=S.lastIndex,T}function fet(S){return GA?ta(GA.call(S)):{}}function pye(S,T){var A=T?_G(S.buffer):S.buffer;return new S.constructor(A,S.byteOffset,S.length)}function mye(S,T){if(S!==T){var A=S!==t,W=S===null,Q=S===S,de=Tf(S),Ee=T!==t,Ne=T===null,qe=T===T,Wt=Tf(T);if(!Ne&&!Wt&&!de&&S>T||de&&Ee&&qe&&!Ne&&!Wt||W&&Ee&&qe||!A&&qe||!Q)return 1;if(!W&&!de&&!Wt&&S<T||Wt&&A&&Q&&!W&&!de||Ne&&A&&Q||!Ee&&Q||!qe)return-1}return 0}function get(S,T,A){for(var W=-1,Q=S.criteria,de=T.criteria,Ee=Q.length,Ne=A.length;++W<Ee;){var qe=mye(Q[W],de[W]);if(qe){if(W>=Ne)return qe;var Wt=A[W];return qe*(Wt=="desc"?-1:1)}}return S.index-T.index}function _ye(S,T,A,W){for(var Q=-1,de=S.length,Ee=A.length,Ne=-1,qe=T.length,Wt=Sc(de-Ee,0),jt=mt(qe+Wt),rn=!W;++Ne<qe;)jt[Ne]=T[Ne];for(;++Q<Ee;)(rn||Q<de)&&(jt[A[Q]]=S[Q]);for(;Wt--;)jt[Ne++]=S[Q++];return jt}function vye(S,T,A,W){for(var Q=-1,de=S.length,Ee=-1,Ne=A.length,qe=-1,Wt=T.length,jt=Sc(de-Ne,0),rn=mt(jt+Wt),zn=!W;++Q<jt;)rn[Q]=S[Q];for(var bi=Q;++qe<Wt;)rn[bi+qe]=T[qe];for(;++Ee<Ne;)(zn||Q<de)&&(rn[bi+A[Ee]]=S[Q++]);return rn}function bh(S,T){var A=-1,W=S.length;for(T||(T=mt(W));++A<W;)T[A]=S[A];return T}function W_(S,T,A,W){var Q=!A;A||(A={});for(var de=-1,Ee=T.length;++de<Ee;){var Ne=T[de],qe=W?W(A[Ne],S[Ne],Ne,A,S):t;qe===t&&(qe=S[Ne]),Q?Pb(A,Ne,qe):YA(A,Ne,qe)}return A}function pet(S,T){return W_(S,EG(S),T)}function met(S,T){return W_(S,Aye(S),T)}function TF(S,T){return function(A,W){var Q=Pr(A)?jK:FJe,de=T?T():{};return Q(A,S,Ji(W,2),de)}}function sT(S){return no(function(T,A){var W=-1,Q=A.length,de=Q>1?A[Q-1]:t,Ee=Q>2?A[2]:t;for(de=S.length>3&&typeof de=="function"?(Q--,de):t,Ee&&Bd(A[0],A[1],Ee)&&(de=Q<3?t:de,Q=1),T=ta(T);++W<Q;){var Ne=A[W];Ne&&S(T,Ne,W,de)}return T})}function bye(S,T){return function(A,W){if(A==null)return A;if(!yh(A))return S(A,W);for(var Q=A.length,de=T?Q:-1,Ee=ta(A);(T?de--:++de<Q)&&W(Ee[de],de,Ee)!==!1;);return A}}function yye(S){return function(T,A,W){for(var Q=-1,de=ta(T),Ee=W(T),Ne=Ee.length;Ne--;){var qe=Ee[S?Ne:++Q];if(A(de[qe],qe,de)===!1)break}return T}}function _et(S,T,A){var W=T&_,Q=eR(S);function de(){var Ee=this&&this!==cl&&this instanceof de?Q:S;return Ee.apply(W?A:this,arguments)}return de}function Cye(S){return function(T){T=hs(T);var A=Jk(T)?dm(T):t,W=A?A[0]:T.charAt(0),Q=A?j0(A,1).join(""):T.slice(1);return W[S]()+Q}}function aT(S){return function(T){return Qk(b0e(v0e(T).replace(Jt,"")),S,"")}}function eR(S){return function(){var T=arguments;switch(T.length){case 0:return new S;case 1:return new S(T[0]);case 2:return new S(T[0],T[1]);case 3:return new S(T[0],T[1],T[2]);case 4:return new S(T[0],T[1],T[2],T[3]);case 5:return new S(T[0],T[1],T[2],T[3],T[4]);case 6:return new S(T[0],T[1],T[2],T[3],T[4],T[5]);case 7:return new S(T[0],T[1],T[2],T[3],T[4],T[5],T[6])}var A=oT(S.prototype),W=S.apply(A,T);return Ga(W)?W:A}}function vet(S,T,A){var W=eR(S);function Q(){for(var de=arguments.length,Ee=mt(de),Ne=de,qe=lT(Q);Ne--;)Ee[Ne]=arguments[Ne];var Wt=de<3&&Ee[0]!==qe&&Ee[de-1]!==qe?[]:$0(Ee,qe);if(de-=Wt.length,de<A)return kye(S,T,IF,Q.placeholder,t,Ee,Wt,t,t,A-de);var jt=this&&this!==cl&&this instanceof Q?W:S;return Md(jt,this,Ee)}return Q}function wye(S){return function(T,A,W){var Q=ta(T);if(!yh(T)){var de=Ji(A,3);T=qc(T),A=function(Ne){return de(Q[Ne],Ne,Q)}}var Ee=S(T,A,W);return Ee>-1?Q[de?T[Ee]:Ee]:t}}function Sye(S){return Fb(function(T){var A=T.length,W=A,Q=jg.prototype.thru;for(S&&T.reverse();W--;){var de=T[W];if(typeof de!="function")throw new zg(s);if(Q&&!Ee&&RF(de)=="wrapper")var Ee=new jg([],!0)}for(W=Ee?W:A;++W<A;){de=T[W];var Ne=RF(de),qe=Ne=="wrapper"?wG(de):t;qe&&kG(qe[0])&&qe[1]==(I|y|x|L)&&!qe[4].length&&qe[9]==1?Ee=Ee[RF(qe[0])].apply(Ee,qe[3]):Ee=de.length==1&&kG(de)?Ee[Ne]():Ee.thru(de)}return function(){var Wt=arguments,jt=Wt[0];if(Ee&&Wt.length==1&&Pr(jt))return Ee.plant(jt).value();for(var rn=0,zn=A?T[rn].apply(this,Wt):jt;++rn<A;)zn=T[rn].call(this,zn);return zn}})}function IF(S,T,A,W,Q,de,Ee,Ne,qe,Wt){var jt=T&I,rn=T&_,zn=T&v,bi=T&(y|C),sr=T&D,Qr=zn?t:eR(S);function ar(){for(var co=arguments.length,Io=mt(co),If=co;If--;)Io[If]=arguments[If];if(bi)var $d=lT(ar),Lf=LZe(Io,$d);if(W&&(Io=_ye(Io,W,Q,bi)),de&&(Io=vye(Io,de,Ee,bi)),co-=Lf,bi&&co<Wt){var Al=$0(Io,$d);return kye(S,T,IF,ar.placeholder,A,Io,Al,Ne,qe,Wt-co)}var gm=rn?A:this,Hb=zn?gm[S]:S;return co=Io.length,Ne?Io=$et(Io,Ne):sr&&co>1&&Io.reverse(),jt&&qe<co&&(Io.length=qe),this&&this!==cl&&this instanceof ar&&(Hb=Qr||eR(Hb)),Hb.apply(gm,Io)}return ar}function Eye(S,T){return function(A,W){return UJe(A,S,T(W),{})}}function LF(S,T){return function(A,W){var Q;if(A===t&&W===t)return T;if(A!==t&&(Q=A),W!==t){if(Q===t)return W;typeof A=="string"||typeof W=="string"?(A=kf(A),W=kf(W)):(A=cye(A),W=cye(W)),Q=S(A,W)}return Q}}function vG(S){return Fb(function(T){return T=ma(T,Ka(Ji())),no(function(A){var W=this;return S(T,function(Q){return Md(Q,W,A)})})})}function DF(S,T){T=T===t?" ":kf(T);var A=T.length;if(A<2)return A?dG(T,S):T;var W=dG(T,mF(S/eT(T)));return Jk(T)?j0(dm(W),0,S).join(""):W.slice(0,S)}function bet(S,T,A,W){var Q=T&_,de=eR(S);function Ee(){for(var Ne=-1,qe=arguments.length,Wt=-1,jt=W.length,rn=mt(jt+qe),zn=this&&this!==cl&&this instanceof Ee?de:S;++Wt<jt;)rn[Wt]=W[Wt];for(;qe--;)rn[Wt++]=arguments[++Ne];return Md(zn,Q?A:this,rn)}return Ee}function xye(S){return function(T,A,W){return W&&typeof W!="number"&&Bd(T,A,W)&&(A=W=t),T=Vb(T),A===t?(A=T,T=0):A=Vb(A),W=W===t?T<A?1:-1:Vb(W),iet(T,A,W,S)}}function AF(S){return function(T,A){return typeof T=="string"&&typeof A=="string"||(T=Gg(T),A=Gg(A)),S(T,A)}}function kye(S,T,A,W,Q,de,Ee,Ne,qe,Wt){var jt=T&y,rn=jt?Ee:t,zn=jt?t:Ee,bi=jt?de:t,sr=jt?t:de;T|=jt?x:k,T&=~(jt?k:x),T&b||(T&=~(_|v));var Qr=[S,T,Q,bi,rn,sr,zn,Ne,qe,Wt],ar=A.apply(t,Qr);return kG(S)&&Bye(ar,Qr),ar.placeholder=W,$ye(ar,S,T)}function bG(S){var T=wc[S];return function(A,W){if(A=Gg(A),W=W==null?0:od(Ur(W),292),W&&$be(A)){var Q=(hs(A)+"e").split("e"),de=T(Q[0]+"e"+(+Q[1]+W));return Q=(hs(de)+"e").split("e"),+(Q[0]+"e"+(+Q[1]-W))}return T(A)}}var yet=iT&&1/sF(new iT([,-0]))[1]==V?function(S){return new iT(S)}:HG;function Tye(S){return function(T){var A=sd(T);return A==xt?YK(T):A==me?MZe(T):Uc(T,S(T))}}function Mb(S,T,A,W,Q,de,Ee,Ne){var qe=T&v;if(!qe&&typeof S!="function")throw new zg(s);var Wt=W?W.length:0;if(Wt||(T&=~(x|k),W=Q=t),Ee=Ee===t?Ee:Sc(Ur(Ee),0),Ne=Ne===t?Ne:Ur(Ne),Wt-=Q?Q.length:0,T&k){var jt=W,rn=Q;W=Q=t}var zn=qe?t:wG(S),bi=[S,T,A,W,Q,jt,rn,de,Ee,Ne];if(zn&&Met(bi,zn),S=bi[0],T=bi[1],A=bi[2],W=bi[3],Q=bi[4],Ne=bi[9]=bi[9]===t?qe?0:S.length:Sc(bi[9]-Wt,0),!Ne&&T&(y|C)&&(T&=~(y|C)),!T||T==_)var sr=_et(S,T,A);else T==y||T==C?sr=vet(S,T,Ne):(T==x||T==(_|x))&&!Q.length?sr=bet(S,T,A,W):sr=IF.apply(t,bi);var Qr=zn?aye:Bye;return $ye(Qr(sr,bi),S,T)}function Iye(S,T,A,W){return S===t||fm(S,nT[A])&&!Es.call(W,A)?T:S}function Lye(S,T,A,W,Q,de){return Ga(S)&&Ga(T)&&(de.set(T,S),EF(S,T,t,Lye,de),de.delete(T)),S}function Cet(S){return iR(S)?t:S}function Dye(S,T,A,W,Q,de){var Ee=A&p,Ne=S.length,qe=T.length;if(Ne!=qe&&!(Ee&&qe>Ne))return!1;var Wt=de.get(S),jt=de.get(T);if(Wt&&jt)return Wt==T&&jt==S;var rn=-1,zn=!0,bi=A&m?new gS:t;for(de.set(S,T),de.set(T,S);++rn<Ne;){var sr=S[rn],Qr=T[rn];if(W)var ar=Ee?W(Qr,sr,rn,T,S,de):W(sr,Qr,rn,S,T,de);if(ar!==t){if(ar)continue;zn=!1;break}if(bi){if(!HA(T,function(co,Io){if(!um(bi,Io)&&(sr===co||Q(sr,co,A,W,de)))return bi.push(Io)})){zn=!1;break}}else if(!(sr===Qr||Q(sr,Qr,A,W,de))){zn=!1;break}}return de.delete(S),de.delete(T),zn}function wet(S,T,A,W,Q,de,Ee){switch(A){case Me:if(S.byteLength!=T.byteLength||S.byteOffset!=T.byteOffset)return!1;S=S.buffer,T=T.buffer;case we:return!(S.byteLength!=T.byteLength||!de(new hF(S),new hF(T)));case Ye:case Ze:case Kt:return fm(+S,+T);case Be:return S.name==T.name&&S.message==T.message;case pe:case Z:return S==T+"";case xt:var Ne=YK;case me:var qe=W&p;if(Ne||(Ne=sF),S.size!=T.size&&!qe)return!1;var Wt=Ee.get(S);if(Wt)return Wt==T;W|=m,Ee.set(S,T);var jt=Dye(Ne(S),Ne(T),W,Q,de,Ee);return Ee.delete(S),jt;case G:if(GA)return GA.call(S)==GA.call(T)}return!1}function Eet(S,T,A,W,Q,de){var Ee=A&p,Ne=yG(S),qe=Ne.length,Wt=yG(T),jt=Wt.length;if(qe!=jt&&!Ee)return!1;for(var rn=qe;rn--;){var zn=Ne[rn];if(!(Ee?zn in T:Es.call(T,zn)))return!1}var bi=de.get(S),sr=de.get(T);if(bi&&sr)return bi==T&&sr==S;var Qr=!0;de.set(S,T),de.set(T,S);for(var ar=Ee;++rn<qe;){zn=Ne[rn];var co=S[zn],Io=T[zn];if(W)var If=Ee?W(Io,co,zn,T,S,de):W(co,Io,zn,S,T,de);if(!(If===t?co===Io||Q(co,Io,A,W,de):If)){Qr=!1;break}ar||(ar=zn=="constructor")}if(Qr&&!ar){var $d=S.constructor,Lf=T.constructor;$d!=Lf&&"constructor"in S&&"constructor"in T&&!(typeof $d=="function"&&$d instanceof $d&&typeof Lf=="function"&&Lf instanceof Lf)&&(Qr=!1)}return de.delete(S),de.delete(T),Qr}function Fb(S){return IG(Mye(S,t,Uye),S+"")}function yG(S){return Qbe(S,qc,EG)}function CG(S){return Qbe(S,Ch,Aye)}var wG=vF?function(S){return vF.get(S)}:HG;function RF(S){for(var T=S.name+"",A=rT[T],W=Es.call(rT,T)?A.length:0;W--;){var Q=A[W],de=Q.func;if(de==null||de==S)return Q.name}return T}function lT(S){var T=Es.call(ce,"placeholder")?ce:S;return T.placeholder}function Ji(){var S=ce.iteratee||$G;return S=S===$G?Jbe:S,arguments.length?S(arguments[0],arguments[1]):S}function NF(S,T){var A=S.__data__;return Ret(T)?A[typeof T=="string"?"string":"hash"]:A.map}function SG(S){for(var T=qc(S),A=T.length;A--;){var W=T[A],Q=S[W];T[A]=[W,Q,Oye(Q)]}return T}function _S(S,T){var A=NZe(S,T);return Zbe(A)?A:t}function xet(S){var T=Es.call(S,hS),A=S[hS];try{S[hS]=t;var W=!0}catch{}var Q=uF.call(S);return W&&(T?S[hS]=A:delete S[hS]),Q}var EG=XK?function(S){return S==null?[]:(S=ta(S),Hg(XK(S),function(T){return Fbe.call(S,T)}))}:WG,Aye=XK?function(S){for(var T=[];S;)cm(T,EG(S)),S=fF(S);return T}:WG,sd=Fd;(ZK&&sd(new ZK(new ArrayBuffer(1)))!=Me||UA&&sd(new UA)!=xt||JK&&sd(JK.resolve())!=on||iT&&sd(new iT)!=me||qA&&sd(new qA)!=oe)&&(sd=function(S){var T=Fd(S),A=T==wn?S.constructor:t,W=A?vS(A):"";if(W)switch(W){case oJe:return Me;case sJe:return xt;case aJe:return on;case lJe:return me;case cJe:return oe}return T});function ket(S,T,A){for(var W=-1,Q=A.length;++W<Q;){var de=A[W],Ee=de.size;switch(de.type){case"drop":S+=Ee;break;case"dropRight":T-=Ee;break;case"take":T=od(T,S+Ee);break;case"takeRight":S=Sc(S,T-Ee);break}}return{start:S,end:T}}function Tet(S){var T=S.match(Qn);return T?T[1].split(Fr):[]}function Rye(S,T,A){T=z0(T,S);for(var W=-1,Q=T.length,de=!1;++W<Q;){var Ee=z_(T[W]);if(!(de=S!=null&&A(S,Ee)))break;S=S[Ee]}return de||++W!=Q?de:(Q=S==null?0:S.length,!!Q&&VF(Q)&&Bb(Ee,Q)&&(Pr(S)||bS(S)))}function Iet(S){var T=S.length,A=new S.constructor(T);return T&&typeof S[0]=="string"&&Es.call(S,"index")&&(A.index=S.index,A.input=S.input),A}function Nye(S){return typeof S.constructor=="function"&&!tR(S)?oT(fF(S)):{}}function Let(S,T,A){var W=S.constructor;switch(T){case we:return _G(S);case Ye:case Ze:return new W(+S);case Me:return det(S,A);case ft:case Nt:case Yt:case He:case Dt:case ae:case Se:case Xe:case wt:return pye(S,A);case xt:return new W;case Kt:case Z:return new W(S);case pe:return het(S);case me:return new W;case G:return fet(S)}}function Det(S,T){var A=T.length;if(!A)return S;var W=A-1;return T[W]=(A>1?"& ":"")+T[W],T=T.join(A>2?", ":" "),S.replace(Ht,`{
/* [wrapped with `+T+`] */
`)}function Aet(S){return Pr(S)||bS(S)||!!(Bbe&&S&&S[Bbe])}function Bb(S,T){var A=typeof S;return T=T??$,!!T&&(A=="number"||A!="symbol"&&Fe.test(S))&&S>-1&&S%1==0&&S<T}function Bd(S,T,A){if(!Ga(A))return!1;var W=typeof T;return(W=="number"?yh(A)&&Bb(T,A.length):W=="string"&&T in A)?fm(A[T],S):!1}function xG(S,T){if(Pr(S))return!1;var A=typeof S;return A=="number"||A=="symbol"||A=="boolean"||S==null||Tf(S)?!0:Wr.test(S)||!br.test(S)||T!=null&&S in ta(T)}function Ret(S){var T=typeof S;return T=="string"||T=="number"||T=="symbol"||T=="boolean"?S!=="__proto__":S===null}function kG(S){var T=RF(S),A=ce[T];if(typeof A!="function"||!(T in vo.prototype))return!1;if(S===A)return!0;var W=wG(A);return!!W&&S===W[0]}function Net(S){return!!Obe&&Obe in S}var Oet=lF?$b:zG;function tR(S){var T=S&&S.constructor,A=typeof T=="function"&&T.prototype||nT;return S===A}function Oye(S){return S===S&&!Ga(S)}function Pye(S,T){return function(A){return A==null?!1:A[S]===T&&(T!==t||S in ta(A))}}function Pet(S){var T=BF(S,function(W){return A.size===c&&A.clear(),W}),A=T.cache;return T}function Met(S,T){var A=S[1],W=T[1],Q=A|W,de=Q<(_|v|I),Ee=W==I&&A==y||W==I&&A==L&&S[7].length<=T[8]||W==(I|L)&&T[7].length<=T[8]&&A==y;if(!(de||Ee))return S;W&_&&(S[2]=T[2],Q|=A&_?0:b);var Ne=T[3];if(Ne){var qe=S[3];S[3]=qe?_ye(qe,Ne,T[4]):Ne,S[4]=qe?$0(S[3],u):T[4]}return Ne=T[5],Ne&&(qe=S[5],S[5]=qe?vye(qe,Ne,T[6]):Ne,S[6]=qe?$0(S[5],u):T[6]),Ne=T[7],Ne&&(S[7]=Ne),W&I&&(S[8]=S[8]==null?T[8]:od(S[8],T[8])),S[9]==null&&(S[9]=T[9]),S[0]=T[0],S[1]=Q,S}function Fet(S){var T=[];if(S!=null)for(var A in ta(S))T.push(A);return T}function Bet(S){return uF.call(S)}function Mye(S,T,A){return T=Sc(T===t?S.length-1:T,0),function(){for(var W=arguments,Q=-1,de=Sc(W.length-T,0),Ee=mt(de);++Q<de;)Ee[Q]=W[T+Q];Q=-1;for(var Ne=mt(T+1);++Q<T;)Ne[Q]=W[Q];return Ne[T]=A(Ee),Md(S,this,Ne)}}function Fye(S,T){return T.length<2?S:mS(S,qg(T,0,-1))}function $et(S,T){for(var A=S.length,W=od(T.length,A),Q=bh(S);W--;){var de=T[W];S[W]=Bb(de,A)?Q[de]:t}return S}function TG(S,T){if(!(T==="constructor"&&typeof S[T]=="function")&&T!="__proto__")return S[T]}var Bye=Vye(aye),nR=ZZe||function(S,T){return cl.setTimeout(S,T)},IG=Vye(set);function $ye(S,T,A){var W=T+"";return IG(S,Det(W,Vet(Tet(W),A)))}function Vye(S){var T=0,A=0;return function(){var W=nJe(),Q=O-(W-A);if(A=W,Q>0){if(++T>=M)return arguments[0]}else T=0;return S.apply(t,arguments)}}function OF(S,T){var A=-1,W=S.length,Q=W-1;for(T=T===t?W:T;++A<T;){var de=uG(A,Q),Ee=S[de];S[de]=S[A],S[A]=Ee}return S.length=T,S}var Hye=Pet(function(S){var T=[];return S.charCodeAt(0)===46&&T.push(""),S.replace(ko,function(A,W,Q,de){T.push(Q?de.replace(It,"$1"):W||A)}),T});function z_(S){if(typeof S=="string"||Tf(S))return S;var T=S+"";return T=="0"&&1/S==-V?"-0":T}function vS(S){if(S!=null){try{return cF.call(S)}catch{}try{return S+""}catch{}}return""}function Vet(S,T){return id(xe,function(A){var W="_."+A[0];T&A[1]&&!xf(S,W)&&S.push(W)}),S.sort()}function Wye(S){if(S instanceof vo)return S.clone();var T=new jg(S.__wrapped__,S.__chain__);return T.__actions__=bh(S.__actions__),T.__index__=S.__index__,T.__values__=S.__values__,T}function Het(S,T,A){(A?Bd(S,T,A):T===t)?T=1:T=Sc(Ur(T),0);var W=S==null?0:S.length;if(!W||T<1)return[];for(var Q=0,de=0,Ee=mt(mF(W/T));Q<W;)Ee[de++]=qg(S,Q,Q+=T);return Ee}function Wet(S){for(var T=-1,A=S==null?0:S.length,W=0,Q=[];++T<A;){var de=S[T];de&&(Q[W++]=de)}return Q}function zet(){var S=arguments.length;if(!S)return[];for(var T=mt(S-1),A=arguments[0],W=S;W--;)T[W-1]=arguments[W];return cm(Pr(A)?bh(A):[A],vu(T,1))}var jet=no(function(S,T){return Dl(S)?QA(S,vu(T,1,Dl,!0)):[]}),Uet=no(function(S,T){var A=Kg(T);return Dl(A)&&(A=t),Dl(S)?QA(S,vu(T,1,Dl,!0),Ji(A,2)):[]}),qet=no(function(S,T){var A=Kg(T);return Dl(A)&&(A=t),Dl(S)?QA(S,vu(T,1,Dl,!0),t,A):[]});function Ket(S,T,A){var W=S==null?0:S.length;return W?(T=A||T===t?1:Ur(T),qg(S,T<0?0:T,W)):[]}function Get(S,T,A){var W=S==null?0:S.length;return W?(T=A||T===t?1:Ur(T),T=W-T,qg(S,0,T<0?0:T)):[]}function Yet(S,T){return S&&S.length?kF(S,Ji(T,3),!0,!0):[]}function Qet(S,T){return S&&S.length?kF(S,Ji(T,3),!0):[]}function Xet(S,T,A,W){var Q=S==null?0:S.length;return Q?(A&&typeof A!="number"&&Bd(S,T,A)&&(A=0,W=Q),HJe(S,T,A,W)):[]}function zye(S,T,A){var W=S==null?0:S.length;if(!W)return-1;var Q=A==null?0:Ur(A);return Q<0&&(Q=Sc(W+Q,0)),Xk(S,Ji(T,3),Q)}function jye(S,T,A){var W=S==null?0:S.length;if(!W)return-1;var Q=W-1;return A!==t&&(Q=Ur(A),Q=A<0?Sc(W+Q,0):od(Q,W-1)),Xk(S,Ji(T,3),Q,!0)}function Uye(S){var T=S==null?0:S.length;return T?vu(S,1):[]}function Zet(S){var T=S==null?0:S.length;return T?vu(S,V):[]}function Jet(S,T){var A=S==null?0:S.length;return A?(T=T===t?1:Ur(T),vu(S,T)):[]}function ett(S){for(var T=-1,A=S==null?0:S.length,W={};++T<A;){var Q=S[T];W[Q[0]]=Q[1]}return W}function qye(S){return S&&S.length?S[0]:t}function ttt(S,T,A){var W=S==null?0:S.length;if(!W)return-1;var Q=A==null?0:Ur(A);return Q<0&&(Q=Sc(W+Q,0)),Rb(S,T,Q)}function ntt(S){var T=S==null?0:S.length;return T?qg(S,0,-1):[]}var itt=no(function(S){var T=ma(S,pG);return T.length&&T[0]===S[0]?oG(T):[]}),rtt=no(function(S){var T=Kg(S),A=ma(S,pG);return T===Kg(A)?T=t:A.pop(),A.length&&A[0]===S[0]?oG(A,Ji(T,2)):[]}),ott=no(function(S){var T=Kg(S),A=ma(S,pG);return T=typeof T=="function"?T:t,T&&A.pop(),A.length&&A[0]===S[0]?oG(A,t,T):[]});function stt(S,T){return S==null?"":eJe.call(S,T)}function Kg(S){var T=S==null?0:S.length;return T?S[T-1]:t}function att(S,T,A){var W=S==null?0:S.length;if(!W)return-1;var Q=W;return A!==t&&(Q=Ur(A),Q=Q<0?Sc(W+Q,0):od(Q,W-1)),T===T?BZe(S,T,Q):Xk(S,Zk,Q,!0)}function ltt(S,T){return S&&S.length?iye(S,Ur(T)):t}var ctt=no(Kye);function Kye(S,T){return S&&S.length&&T&&T.length?cG(S,T):S}function utt(S,T,A){return S&&S.length&&T&&T.length?cG(S,T,Ji(A,2)):S}function dtt(S,T,A){return S&&S.length&&T&&T.length?cG(S,T,t,A):S}var htt=Fb(function(S,T){var A=S==null?0:S.length,W=tG(S,T);return sye(S,ma(T,function(Q){return Bb(Q,A)?+Q:Q}).sort(mye)),W});function ftt(S,T){var A=[];if(!(S&&S.length))return A;var W=-1,Q=[],de=S.length;for(T=Ji(T,3);++W<de;){var Ee=S[W];T(Ee,W,S)&&(A.push(Ee),Q.push(W))}return sye(S,Q),A}function LG(S){return S==null?S:rJe.call(S)}function gtt(S,T,A){var W=S==null?0:S.length;return W?(A&&typeof A!="number"&&Bd(S,T,A)?(T=0,A=W):(T=T==null?0:Ur(T),A=A===t?W:Ur(A)),qg(S,T,A)):[]}function ptt(S,T){return xF(S,T)}function mtt(S,T,A){return hG(S,T,Ji(A,2))}function _tt(S,T){var A=S==null?0:S.length;if(A){var W=xF(S,T);if(W<A&&fm(S[W],T))return W}return-1}function vtt(S,T){return xF(S,T,!0)}function btt(S,T,A){return hG(S,T,Ji(A,2),!0)}function ytt(S,T){var A=S==null?0:S.length;if(A){var W=xF(S,T,!0)-1;if(fm(S[W],T))return W}return-1}function Ctt(S){return S&&S.length?lye(S):[]}function wtt(S,T){return S&&S.length?lye(S,Ji(T,2)):[]}function Stt(S){var T=S==null?0:S.length;return T?qg(S,1,T):[]}function Ett(S,T,A){return S&&S.length?(T=A||T===t?1:Ur(T),qg(S,0,T<0?0:T)):[]}function xtt(S,T,A){var W=S==null?0:S.length;return W?(T=A||T===t?1:Ur(T),T=W-T,qg(S,T<0?0:T,W)):[]}function ktt(S,T){return S&&S.length?kF(S,Ji(T,3),!1,!0):[]}function Ttt(S,T){return S&&S.length?kF(S,Ji(T,3)):[]}var Itt=no(function(S){return W0(vu(S,1,Dl,!0))}),Ltt=no(function(S){var T=Kg(S);return Dl(T)&&(T=t),W0(vu(S,1,Dl,!0),Ji(T,2))}),Dtt=no(function(S){var T=Kg(S);return T=typeof T=="function"?T:t,W0(vu(S,1,Dl,!0),t,T)});function Att(S){return S&&S.length?W0(S):[]}function Rtt(S,T){return S&&S.length?W0(S,Ji(T,2)):[]}function Ntt(S,T){return T=typeof T=="function"?T:t,S&&S.length?W0(S,t,T):[]}function DG(S){if(!(S&&S.length))return[];var T=0;return S=Hg(S,function(A){if(Dl(A))return T=Sc(A.length,T),!0}),is(T,function(A){return ma(S,zA(A))})}function Gye(S,T){if(!(S&&S.length))return[];var A=DG(S);return T==null?A:ma(A,function(W){return Md(T,t,W)})}var Ott=no(function(S,T){return Dl(S)?QA(S,T):[]}),Ptt=no(function(S){return gG(Hg(S,Dl))}),Mtt=no(function(S){var T=Kg(S);return Dl(T)&&(T=t),gG(Hg(S,Dl),Ji(T,2))}),Ftt=no(function(S){var T=Kg(S);return T=typeof T=="function"?T:t,gG(Hg(S,Dl),t,T)}),Btt=no(DG);function $tt(S,T){return hye(S||[],T||[],YA)}function Vtt(S,T){return hye(S||[],T||[],JA)}var Htt=no(function(S){var T=S.length,A=T>1?S[T-1]:t;return A=typeof A=="function"?(S.pop(),A):t,Gye(S,A)});function Yye(S){var T=ce(S);return T.__chain__=!0,T}function Wtt(S,T){return T(S),S}function PF(S,T){return T(S)}var ztt=Fb(function(S){var T=S.length,A=T?S[0]:0,W=this.__wrapped__,Q=function(de){return tG(de,S)};return T>1||this.__actions__.length||!(W instanceof vo)||!Bb(A)?this.thru(Q):(W=W.slice(A,+A+(T?1:0)),W.__actions__.push({func:PF,args:[Q],thisArg:t}),new jg(W,this.__chain__).thru(function(de){return T&&!de.length&&de.push(t),de}))});function jtt(){return Yye(this)}function Utt(){return new jg(this.value(),this.__chain__)}function qtt(){this.__values__===t&&(this.__values__=c0e(this.value()));var S=this.__index__>=this.__values__.length,T=S?t:this.__values__[this.__index__++];return{done:S,value:T}}function Ktt(){return this}function Gtt(S){for(var T,A=this;A instanceof yF;){var W=Wye(A);W.__index__=0,W.__values__=t,T?Q.__wrapped__=W:T=W;var Q=W;A=A.__wrapped__}return Q.__wrapped__=S,T}function Ytt(){var S=this.__wrapped__;if(S instanceof vo){var T=S;return this.__actions__.length&&(T=new vo(this)),T=T.reverse(),T.__actions__.push({func:PF,args:[LG],thisArg:t}),new jg(T,this.__chain__)}return this.thru(LG)}function Qtt(){return dye(this.__wrapped__,this.__actions__)}var Xtt=TF(function(S,T,A){Es.call(S,A)?++S[A]:Pb(S,A,1)});function Ztt(S,T,A){var W=Pr(S)?nF:VJe;return A&&Bd(S,T,A)&&(T=t),W(S,Ji(T,3))}function Jtt(S,T){var A=Pr(S)?Hg:Gbe;return A(S,Ji(T,3))}var ent=wye(zye),tnt=wye(jye);function nnt(S,T){return vu(MF(S,T),1)}function int(S,T){return vu(MF(S,T),V)}function rnt(S,T,A){return A=A===t?1:Ur(A),vu(MF(S,T),A)}function Qye(S,T){var A=Pr(S)?id:H0;return A(S,Ji(T,3))}function Xye(S,T){var A=Pr(S)?UK:Kbe;return A(S,Ji(T,3))}var ont=TF(function(S,T,A){Es.call(S,A)?S[A].push(T):Pb(S,A,[T])});function snt(S,T,A,W){S=yh(S)?S:uT(S),A=A&&!W?Ur(A):0;var Q=S.length;return A<0&&(A=Sc(Q+A,0)),HF(S)?A<=Q&&S.indexOf(T,A)>-1:!!Q&&Rb(S,T,A)>-1}var ant=no(function(S,T,A){var W=-1,Q=typeof T=="function",de=yh(S)?mt(S.length):[];return H0(S,function(Ee){de[++W]=Q?Md(T,Ee,A):XA(Ee,T,A)}),de}),lnt=TF(function(S,T,A){Pb(S,A,T)});function MF(S,T){var A=Pr(S)?ma:eye;return A(S,Ji(T,3))}function cnt(S,T,A,W){return S==null?[]:(Pr(T)||(T=T==null?[]:[T]),A=W?t:A,Pr(A)||(A=A==null?[]:[A]),rye(S,T,A))}var unt=TF(function(S,T,A){S[A?0:1].push(T)},function(){return[[],[]]});function dnt(S,T,A){var W=Pr(S)?Qk:jn,Q=arguments.length<3;return W(S,Ji(T,4),A,Q,H0)}function hnt(S,T,A){var W=Pr(S)?qK:jn,Q=arguments.length<3;return W(S,Ji(T,4),A,Q,Kbe)}function fnt(S,T){var A=Pr(S)?Hg:Gbe;return A(S,$F(Ji(T,3)))}function gnt(S){var T=Pr(S)?zbe:ret;return T(S)}function pnt(S,T,A){(A?Bd(S,T,A):T===t)?T=1:T=Ur(T);var W=Pr(S)?PJe:oet;return W(S,T)}function mnt(S){var T=Pr(S)?MJe:aet;return T(S)}function _nt(S){if(S==null)return 0;if(yh(S))return HF(S)?eT(S):S.length;var T=sd(S);return T==xt||T==me?S.size:aG(S).length}function vnt(S,T,A){var W=Pr(S)?HA:cet;return A&&Bd(S,T,A)&&(T=t),W(S,Ji(T,3))}var bnt=no(function(S,T){if(S==null)return[];var A=T.length;return A>1&&Bd(S,T[0],T[1])?T=[]:A>2&&Bd(T[0],T[1],T[2])&&(T=[T[0]]),rye(S,vu(T,1),[])}),FF=XZe||function(){return cl.Date.now()};function ynt(S,T){if(typeof T!="function")throw new zg(s);return S=Ur(S),function(){if(--S<1)return T.apply(this,arguments)}}function Zye(S,T,A){return T=A?t:T,T=S&&T==null?S.length:T,Mb(S,I,t,t,t,t,T)}function Jye(S,T){var A;if(typeof T!="function")throw new zg(s);return S=Ur(S),function(){return--S>0&&(A=T.apply(this,arguments)),S<=1&&(T=t),A}}var AG=no(function(S,T,A){var W=_;if(A.length){var Q=$0(A,lT(AG));W|=x}return Mb(S,W,T,A,Q)}),e0e=no(function(S,T,A){var W=_|v;if(A.length){var Q=$0(A,lT(e0e));W|=x}return Mb(T,W,S,A,Q)});function t0e(S,T,A){T=A?t:T;var W=Mb(S,y,t,t,t,t,t,T);return W.placeholder=t0e.placeholder,W}function n0e(S,T,A){T=A?t:T;var W=Mb(S,C,t,t,t,t,t,T);return W.placeholder=n0e.placeholder,W}function i0e(S,T,A){var W,Q,de,Ee,Ne,qe,Wt=0,jt=!1,rn=!1,zn=!0;if(typeof S!="function")throw new zg(s);T=Gg(T)||0,Ga(A)&&(jt=!!A.leading,rn="maxWait"in A,de=rn?Sc(Gg(A.maxWait)||0,T):de,zn="trailing"in A?!!A.trailing:zn);function bi(Al){var gm=W,Hb=Q;return W=Q=t,Wt=Al,Ee=S.apply(Hb,gm),Ee}function sr(Al){return Wt=Al,Ne=nR(co,T),jt?bi(Al):Ee}function Qr(Al){var gm=Al-qe,Hb=Al-Wt,w0e=T-gm;return rn?od(w0e,de-Hb):w0e}function ar(Al){var gm=Al-qe,Hb=Al-Wt;return qe===t||gm>=T||gm<0||rn&&Hb>=de}function co(){var Al=FF();if(ar(Al))return Io(Al);Ne=nR(co,Qr(Al))}function Io(Al){return Ne=t,zn&&W?bi(Al):(W=Q=t,Ee)}function If(){Ne!==t&&fye(Ne),Wt=0,W=qe=Q=Ne=t}function $d(){return Ne===t?Ee:Io(FF())}function Lf(){var Al=FF(),gm=ar(Al);if(W=arguments,Q=this,qe=Al,gm){if(Ne===t)return sr(qe);if(rn)return fye(Ne),Ne=nR(co,T),bi(qe)}return Ne===t&&(Ne=nR(co,T)),Ee}return Lf.cancel=If,Lf.flush=$d,Lf}var Cnt=no(function(S,T){return qbe(S,1,T)}),wnt=no(function(S,T,A){return qbe(S,Gg(T)||0,A)});function Snt(S){return Mb(S,D)}function BF(S,T){if(typeof S!="function"||T!=null&&typeof T!="function")throw new zg(s);var A=function(){var W=arguments,Q=T?T.apply(this,W):W[0],de=A.cache;if(de.has(Q))return de.get(Q);var Ee=S.apply(this,W);return A.cache=de.set(Q,Ee)||de,Ee};return A.cache=new(BF.Cache||Ob),A}BF.Cache=Ob;function $F(S){if(typeof S!="function")throw new zg(s);return function(){var T=arguments;switch(T.length){case 0:return!S.call(this);case 1:return!S.call(this,T[0]);case 2:return!S.call(this,T[0],T[1]);case 3:return!S.call(this,T[0],T[1],T[2])}return!S.apply(this,T)}}function Ent(S){return Jye(2,S)}var xnt=uet(function(S,T){T=T.length==1&&Pr(T[0])?ma(T[0],Ka(Ji())):ma(vu(T,1),Ka(Ji()));var A=T.length;return no(function(W){for(var Q=-1,de=od(W.length,A);++Q<de;)W[Q]=T[Q].call(this,W[Q]);return Md(S,this,W)})}),RG=no(function(S,T){var A=$0(T,lT(RG));return Mb(S,x,t,T,A)}),r0e=no(function(S,T){var A=$0(T,lT(r0e));return Mb(S,k,t,T,A)}),knt=Fb(function(S,T){return Mb(S,L,t,t,t,T)});function Tnt(S,T){if(typeof S!="function")throw new zg(s);return T=T===t?T:Ur(T),no(S,T)}function Int(S,T){if(typeof S!="function")throw new zg(s);return T=T==null?0:Sc(Ur(T),0),no(function(A){var W=A[T],Q=j0(A,0,T);return W&&cm(Q,W),Md(S,this,Q)})}function Lnt(S,T,A){var W=!0,Q=!0;if(typeof S!="function")throw new zg(s);return Ga(A)&&(W="leading"in A?!!A.leading:W,Q="trailing"in A?!!A.trailing:Q),i0e(S,T,{leading:W,maxWait:T,trailing:Q})}function Dnt(S){return Zye(S,1)}function Ant(S,T){return RG(mG(T),S)}function Rnt(){if(!arguments.length)return[];var S=arguments[0];return Pr(S)?S:[S]}function Nnt(S){return Ug(S,g)}function Ont(S,T){return T=typeof T=="function"?T:t,Ug(S,g,T)}function Pnt(S){return Ug(S,d|g)}function Mnt(S,T){return T=typeof T=="function"?T:t,Ug(S,d|g,T)}function Fnt(S,T){return T==null||Ube(S,T,qc(T))}function fm(S,T){return S===T||S!==S&&T!==T}var Bnt=AF(rG),$nt=AF(function(S,T){return S>=T}),bS=Xbe(function(){return arguments}())?Xbe:function(S){return ul(S)&&Es.call(S,"callee")&&!Fbe.call(S,"callee")},Pr=mt.isArray,Vnt=dS?Ka(dS):qJe;function yh(S){return S!=null&&VF(S.length)&&!$b(S)}function Dl(S){return ul(S)&&yh(S)}function Hnt(S){return S===!0||S===!1||ul(S)&&Fd(S)==Ye}var U0=JZe||zG,Wnt=$_?Ka($_):KJe;function znt(S){return ul(S)&&S.nodeType===1&&!iR(S)}function jnt(S){if(S==null)return!0;if(yh(S)&&(Pr(S)||typeof S=="string"||typeof S.splice=="function"||U0(S)||cT(S)||bS(S)))return!S.length;var T=sd(S);if(T==xt||T==me)return!S.size;if(tR(S))return!aG(S).length;for(var A in S)if(Es.call(S,A))return!1;return!0}function Unt(S,T){return ZA(S,T)}function qnt(S,T,A){A=typeof A=="function"?A:t;var W=A?A(S,T):t;return W===t?ZA(S,T,t,A):!!W}function NG(S){if(!ul(S))return!1;var T=Fd(S);return T==Be||T==tt||typeof S.message=="string"&&typeof S.name=="string"&&!iR(S)}function Knt(S){return typeof S=="number"&&$be(S)}function $b(S){if(!Ga(S))return!1;var T=Fd(S);return T==kt||T==Vt||T==Re||T==Zt}function o0e(S){return typeof S=="number"&&S==Ur(S)}function VF(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=$}function Ga(S){var T=typeof S;return S!=null&&(T=="object"||T=="function")}function ul(S){return S!=null&&typeof S=="object"}var s0e=Ab?Ka(Ab):YJe;function Gnt(S,T){return S===T||sG(S,T,SG(T))}function Ynt(S,T,A){return A=typeof A=="function"?A:t,sG(S,T,SG(T),A)}function Qnt(S){return a0e(S)&&S!=+S}function Xnt(S){if(Oet(S))throw new Nr(o);return Zbe(S)}function Znt(S){return S===null}function Jnt(S){return S==null}function a0e(S){return typeof S=="number"||ul(S)&&Fd(S)==Kt}function iR(S){if(!ul(S)||Fd(S)!=wn)return!1;var T=fF(S);if(T===null)return!0;var A=Es.call(T,"constructor")&&T.constructor;return typeof A=="function"&&A instanceof A&&cF.call(A)==KZe}var OG=Vg?Ka(Vg):QJe;function eit(S){return o0e(S)&&S>=-$&&S<=$}var l0e=eF?Ka(eF):XJe;function HF(S){return typeof S=="string"||!Pr(S)&&ul(S)&&Fd(S)==Z}function Tf(S){return typeof S=="symbol"||ul(S)&&Fd(S)==G}var cT=tF?Ka(tF):ZJe;function tit(S){return S===t}function nit(S){return ul(S)&&sd(S)==oe}function iit(S){return ul(S)&&Fd(S)==le}var rit=AF(lG),oit=AF(function(S,T){return S<=T});function c0e(S){if(!S)return[];if(yh(S))return HF(S)?dm(S):bh(S);if(jA&&S[jA])return PZe(S[jA]());var T=sd(S),A=T==xt?YK:T==me?sF:uT;return A(S)}function Vb(S){if(!S)return S===0?S:0;if(S=Gg(S),S===V||S===-V){var T=S<0?-1:1;return T*j}return S===S?S:0}function Ur(S){var T=Vb(S),A=T%1;return T===T?A?T-A:T:0}function u0e(S){return S?pS(Ur(S),0,ne):0}function Gg(S){if(typeof S=="number")return S;if(Tf(S))return Y;if(Ga(S)){var T=typeof S.valueOf=="function"?S.valueOf():S;S=Ga(T)?T+"":T}if(typeof S!="string")return S===0?S:+S;S=vh(S);var A=je.test(S);return A||fe.test(S)?tc(S.slice(2),A?2:8):ve.test(S)?Y:+S}function d0e(S){return W_(S,Ch(S))}function sit(S){return S?pS(Ur(S),-$,$):S===0?S:0}function hs(S){return S==null?"":kf(S)}var ait=sT(function(S,T){if(tR(T)||yh(T)){W_(T,qc(T),S);return}for(var A in T)Es.call(T,A)&&YA(S,A,T[A])}),h0e=sT(function(S,T){W_(T,Ch(T),S)}),WF=sT(function(S,T,A,W){W_(T,Ch(T),S,W)}),lit=sT(function(S,T,A,W){W_(T,qc(T),S,W)}),cit=Fb(tG);function uit(S,T){var A=oT(S);return T==null?A:jbe(A,T)}var dit=no(function(S,T){S=ta(S);var A=-1,W=T.length,Q=W>2?T[2]:t;for(Q&&Bd(T[0],T[1],Q)&&(W=1);++A<W;)for(var de=T[A],Ee=Ch(de),Ne=-1,qe=Ee.length;++Ne<qe;){var Wt=Ee[Ne],jt=S[Wt];(jt===t||fm(jt,nT[Wt])&&!Es.call(S,Wt))&&(S[Wt]=de[Wt])}return S}),hit=no(function(S){return S.push(t,Lye),Md(f0e,t,S)});function fit(S,T){return rF(S,Ji(T,3),H_)}function git(S,T){return rF(S,Ji(T,3),iG)}function pit(S,T){return S==null?S:nG(S,Ji(T,3),Ch)}function mit(S,T){return S==null?S:Ybe(S,Ji(T,3),Ch)}function _it(S,T){return S&&H_(S,Ji(T,3))}function vit(S,T){return S&&iG(S,Ji(T,3))}function bit(S){return S==null?[]:SF(S,qc(S))}function yit(S){return S==null?[]:SF(S,Ch(S))}function PG(S,T,A){var W=S==null?t:mS(S,T);return W===t?A:W}function Cit(S,T){return S!=null&&Rye(S,T,WJe)}function MG(S,T){return S!=null&&Rye(S,T,zJe)}var wit=Eye(function(S,T,A){T!=null&&typeof T.toString!="function"&&(T=uF.call(T)),S[T]=A},BG(wh)),Sit=Eye(function(S,T,A){T!=null&&typeof T.toString!="function"&&(T=uF.call(T)),Es.call(S,T)?S[T].push(A):S[T]=[A]},Ji),Eit=no(XA);function qc(S){return yh(S)?Wbe(S):aG(S)}function Ch(S){return yh(S)?Wbe(S,!0):JJe(S)}function xit(S,T){var A={};return T=Ji(T,3),H_(S,function(W,Q,de){Pb(A,T(W,Q,de),W)}),A}function kit(S,T){var A={};return T=Ji(T,3),H_(S,function(W,Q,de){Pb(A,Q,T(W,Q,de))}),A}var Tit=sT(function(S,T,A){EF(S,T,A)}),f0e=sT(function(S,T,A,W){EF(S,T,A,W)}),Iit=Fb(function(S,T){var A={};if(S==null)return A;var W=!1;T=ma(T,function(de){return de=z0(de,S),W||(W=de.length>1),de}),W_(S,CG(S),A),W&&(A=Ug(A,d|h|g,Cet));for(var Q=T.length;Q--;)fG(A,T[Q]);return A});function Lit(S,T){return g0e(S,$F(Ji(T)))}var Dit=Fb(function(S,T){return S==null?{}:tet(S,T)});function g0e(S,T){if(S==null)return{};var A=ma(CG(S),function(W){return[W]});return T=Ji(T),oye(S,A,function(W,Q){return T(W,Q[0])})}function Ait(S,T,A){T=z0(T,S);var W=-1,Q=T.length;for(Q||(Q=1,S=t);++W<Q;){var de=S==null?t:S[z_(T[W])];de===t&&(W=Q,de=A),S=$b(de)?de.call(S):de}return S}function Rit(S,T,A){return S==null?S:JA(S,T,A)}function Nit(S,T,A,W){return W=typeof W=="function"?W:t,S==null?S:JA(S,T,A,W)}var p0e=Tye(qc),m0e=Tye(Ch);function Oit(S,T,A){var W=Pr(S),Q=W||U0(S)||cT(S);if(T=Ji(T,4),A==null){var de=S&&S.constructor;Q?A=W?new de:[]:Ga(S)?A=$b(de)?oT(fF(S)):{}:A={}}return(Q?id:H_)(S,function(Ee,Ne,qe){return T(A,Ee,Ne,qe)}),A}function Pit(S,T){return S==null?!0:fG(S,T)}function Mit(S,T,A){return S==null?S:uye(S,T,mG(A))}function Fit(S,T,A,W){return W=typeof W=="function"?W:t,S==null?S:uye(S,T,mG(A),W)}function uT(S){return S==null?[]:Wg(S,qc(S))}function Bit(S){return S==null?[]:Wg(S,Ch(S))}function $it(S,T,A){return A===t&&(A=T,T=t),A!==t&&(A=Gg(A),A=A===A?A:0),T!==t&&(T=Gg(T),T=T===T?T:0),pS(Gg(S),T,A)}function Vit(S,T,A){return T=Vb(T),A===t?(A=T,T=0):A=Vb(A),S=Gg(S),jJe(S,T,A)}function Hit(S,T,A){if(A&&typeof A!="boolean"&&Bd(S,T,A)&&(T=A=t),A===t&&(typeof T=="boolean"?(A=T,T=t):typeof S=="boolean"&&(A=S,S=t)),S===t&&T===t?(S=0,T=1):(S=Vb(S),T===t?(T=S,S=0):T=Vb(T)),S>T){var W=S;S=T,T=W}if(A||S%1||T%1){var Q=Vbe();return od(S+Q*(T-S+Cc("1e-"+((Q+"").length-1))),T)}return uG(S,T)}var Wit=aT(function(S,T,A){return T=T.toLowerCase(),S+(A?_0e(T):T)});function _0e(S){return FG(hs(S).toLowerCase())}function v0e(S){return S=hs(S),S&&S.replace(ot,DZe).replace(Nn,"")}function zit(S,T,A){S=hs(S),T=kf(T);var W=S.length;A=A===t?W:pS(Ur(A),0,W);var Q=A;return A-=T.length,A>=0&&S.slice(A,Q)==T}function jit(S){return S=hs(S),S&&un.test(S)?S.replace(Ni,AZe):S}function Uit(S){return S=hs(S),S&&ea.test(S)?S.replace(oo,"\\$&"):S}var qit=aT(function(S,T,A){return S+(A?"-":"")+T.toLowerCase()}),Kit=aT(function(S,T,A){return S+(A?" ":"")+T.toLowerCase()}),Git=Cye("toLowerCase");function Yit(S,T,A){S=hs(S),T=Ur(T);var W=T?eT(S):0;if(!T||W>=T)return S;var Q=(T-W)/2;return DF(_F(Q),A)+S+DF(mF(Q),A)}function Qit(S,T,A){S=hs(S),T=Ur(T);var W=T?eT(S):0;return T&&W<T?S+DF(T-W,A):S}function Xit(S,T,A){S=hs(S),T=Ur(T);var W=T?eT(S):0;return T&&W<T?DF(T-W,A)+S:S}function Zit(S,T,A){return A||T==null?T=0:T&&(T=+T),iJe(hs(S).replace(xr,""),T||0)}function Jit(S,T,A){return(A?Bd(S,T,A):T===t)?T=1:T=Ur(T),dG(hs(S),T)}function ert(){var S=arguments,T=hs(S[0]);return S.length<3?T:T.replace(S[1],S[2])}var trt=aT(function(S,T,A){return S+(A?"_":"")+T.toLowerCase()});function nrt(S,T,A){return A&&typeof A!="number"&&Bd(S,T,A)&&(T=A=t),A=A===t?ne:A>>>0,A?(S=hs(S),S&&(typeof T=="string"||T!=null&&!OG(T))&&(T=kf(T),!T&&Jk(S))?j0(dm(S),0,A):S.split(T,A)):[]}var irt=aT(function(S,T,A){return S+(A?" ":"")+FG(T)});function rrt(S,T,A){return S=hs(S),A=A==null?0:pS(Ur(A),0,S.length),T=kf(T),S.slice(A,A+T.length)==T}function ort(S,T,A){var W=ce.templateSettings;A&&Bd(S,T,A)&&(T=t),S=hs(S),T=WF({},T,W,Iye);var Q=WF({},T.imports,W.imports,Iye),de=qc(Q),Ee=Wg(Q,de),Ne,qe,Wt=0,jt=T.interpolate||Ue,rn="__p += '",zn=QK((T.escape||Ue).source+"|"+jt.source+"|"+(jt===xi?tn:Ue).source+"|"+(T.evaluate||Ue).source+"|$","g"),bi="//# sourceURL="+(Es.call(T,"sourceURL")?(T.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$a+"]")+`
`;S.replace(zn,function(ar,co,Io,If,$d,Lf){return Io||(Io=If),rn+=S.slice(Wt,Lf).replace(Qt,RZe),co&&(Ne=!0,rn+=`' +
__e(`+co+`) +
'`),$d&&(qe=!0,rn+=`';
`+$d+`;
__p += '`),Io&&(rn+=`' +
((__t = (`+Io+`)) == null ? '' : __t) +
'`),Wt=Lf+ar.length,ar}),rn+=`';
`;var sr=Es.call(T,"variable")&&T.variable;if(!sr)rn=`with (obj) {
`+rn+`
}
`;else if(lt.test(sr))throw new Nr(a);rn=(qe?rn.replace(Tt,""):rn).replace(zt,"$1").replace(Mt,"$1;"),rn="function("+(sr||"obj")+`) {
`+(sr?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(Ne?", __e = _.escape":"")+(qe?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+rn+`return __p
}`;var Qr=y0e(function(){return rs(de,bi+"return "+rn).apply(t,Ee)});if(Qr.source=rn,NG(Qr))throw Qr;return Qr}function srt(S){return hs(S).toLowerCase()}function art(S){return hs(S).toUpperCase()}function lrt(S,T,A){if(S=hs(S),S&&(A||T===t))return vh(S);if(!S||!(T=kf(T)))return S;var W=dm(S),Q=dm(T),de=V_(W,Q),Ee=rd(W,Q)+1;return j0(W,de,Ee).join("")}function crt(S,T,A){if(S=hs(S),S&&(A||T===t))return S.slice(0,Nbe(S)+1);if(!S||!(T=kf(T)))return S;var W=dm(S),Q=rd(W,dm(T))+1;return j0(W,0,Q).join("")}function urt(S,T,A){if(S=hs(S),S&&(A||T===t))return S.replace(xr,"");if(!S||!(T=kf(T)))return S;var W=dm(S),Q=V_(W,dm(T));return j0(W,Q).join("")}function drt(S,T){var A=R,W=P;if(Ga(T)){var Q="separator"in T?T.separator:Q;A="length"in T?Ur(T.length):A,W="omission"in T?kf(T.omission):W}S=hs(S);var de=S.length;if(Jk(S)){var Ee=dm(S);de=Ee.length}if(A>=de)return S;var Ne=A-eT(W);if(Ne<1)return W;var qe=Ee?j0(Ee,0,Ne).join(""):S.slice(0,Ne);if(Q===t)return qe+W;if(Ee&&(Ne+=qe.length-Ne),OG(Q)){if(S.slice(Ne).search(Q)){var Wt,jt=qe;for(Q.global||(Q=QK(Q.source,hs(Je.exec(Q))+"g")),Q.lastIndex=0;Wt=Q.exec(jt);)var rn=Wt.index;qe=qe.slice(0,rn===t?Ne:rn)}}else if(S.indexOf(kf(Q),Ne)!=Ne){var zn=qe.lastIndexOf(Q);zn>-1&&(qe=qe.slice(0,zn))}return qe+W}function hrt(S){return S=hs(S),S&&xn.test(S)?S.replace(On,$Ze):S}var frt=aT(function(S,T,A){return S+(A?" ":"")+T.toUpperCase()}),FG=Cye("toUpperCase");function b0e(S,T,A){return S=hs(S),T=A?t:T,T===t?OZe(S)?WZe(S):GK(S):S.match(T)||[]}var y0e=no(function(S,T){try{return Md(S,t,T)}catch(A){return NG(A)?A:new Nr(A)}}),grt=Fb(function(S,T){return id(T,function(A){A=z_(A),Pb(S,A,AG(S[A],S))}),S});function prt(S){var T=S==null?0:S.length,A=Ji();return S=T?ma(S,function(W){if(typeof W[1]!="function")throw new zg(s);return[A(W[0]),W[1]]}):[],no(function(W){for(var Q=-1;++Q<T;){var de=S[Q];if(Md(de[0],this,W))return Md(de[1],this,W)}})}function mrt(S){return $Je(Ug(S,d))}function BG(S){return function(){return S}}function _rt(S,T){return S==null||S!==S?T:S}var vrt=Sye(),brt=Sye(!0);function wh(S){return S}function $G(S){return Jbe(typeof S=="function"?S:Ug(S,d))}function yrt(S){return tye(Ug(S,d))}function Crt(S,T){return nye(S,Ug(T,d))}var wrt=no(function(S,T){return function(A){return XA(A,S,T)}}),Srt=no(function(S,T){return function(A){return XA(S,A,T)}});function VG(S,T,A){var W=qc(T),Q=SF(T,W);A==null&&!(Ga(T)&&(Q.length||!W.length))&&(A=T,T=S,S=this,Q=SF(T,qc(T)));var de=!(Ga(A)&&"chain"in A)||!!A.chain,Ee=$b(S);return id(Q,function(Ne){var qe=T[Ne];S[Ne]=qe,Ee&&(S.prototype[Ne]=function(){var Wt=this.__chain__;if(de||Wt){var jt=S(this.__wrapped__),rn=jt.__actions__=bh(this.__actions__);return rn.push({func:qe,args:arguments,thisArg:S}),jt.__chain__=Wt,jt}return qe.apply(S,cm([this.value()],arguments))})}),S}function Ert(){return cl._===this&&(cl._=GZe),this}function HG(){}function xrt(S){return S=Ur(S),no(function(T){return iye(T,S)})}var krt=vG(ma),Trt=vG(nF),Irt=vG(HA);function C0e(S){return xG(S)?zA(z_(S)):net(S)}function Lrt(S){return function(T){return S==null?t:mS(S,T)}}var Drt=xye(),Art=xye(!0);function WG(){return[]}function zG(){return!1}function Rrt(){return{}}function Nrt(){return""}function Ort(){return!0}function Prt(S,T){if(S=Ur(S),S<1||S>$)return[];var A=ne,W=od(S,ne);T=Ji(T),S-=ne;for(var Q=is(W,T);++A<S;)T(A);return Q}function Mrt(S){return Pr(S)?ma(S,z_):Tf(S)?[S]:bh(Hye(hs(S)))}function Frt(S){var T=++qZe;return hs(S)+T}var Brt=LF(function(S,T){return S+T},0),$rt=bG("ceil"),Vrt=LF(function(S,T){return S/T},1),Hrt=bG("floor");function Wrt(S){return S&&S.length?wF(S,wh,rG):t}function zrt(S,T){return S&&S.length?wF(S,Ji(T,2),rG):t}function jrt(S){return oF(S,wh)}function Urt(S,T){return oF(S,Ji(T,2))}function qrt(S){return S&&S.length?wF(S,wh,lG):t}function Krt(S,T){return S&&S.length?wF(S,Ji(T,2),lG):t}var Grt=LF(function(S,T){return S*T},1),Yrt=bG("round"),Qrt=LF(function(S,T){return S-T},0);function Xrt(S){return S&&S.length?kr(S,wh):0}function Zrt(S,T){return S&&S.length?kr(S,Ji(T,2)):0}return ce.after=ynt,ce.ary=Zye,ce.assign=ait,ce.assignIn=h0e,ce.assignInWith=WF,ce.assignWith=lit,ce.at=cit,ce.before=Jye,ce.bind=AG,ce.bindAll=grt,ce.bindKey=e0e,ce.castArray=Rnt,ce.chain=Yye,ce.chunk=Het,ce.compact=Wet,ce.concat=zet,ce.cond=prt,ce.conforms=mrt,ce.constant=BG,ce.countBy=Xtt,ce.create=uit,ce.curry=t0e,ce.curryRight=n0e,ce.debounce=i0e,ce.defaults=dit,ce.defaultsDeep=hit,ce.defer=Cnt,ce.delay=wnt,ce.difference=jet,ce.differenceBy=Uet,ce.differenceWith=qet,ce.drop=Ket,ce.dropRight=Get,ce.dropRightWhile=Yet,ce.dropWhile=Qet,ce.fill=Xet,ce.filter=Jtt,ce.flatMap=nnt,ce.flatMapDeep=int,ce.flatMapDepth=rnt,ce.flatten=Uye,ce.flattenDeep=Zet,ce.flattenDepth=Jet,ce.flip=Snt,ce.flow=vrt,ce.flowRight=brt,ce.fromPairs=ett,ce.functions=bit,ce.functionsIn=yit,ce.groupBy=ont,ce.initial=ntt,ce.intersection=itt,ce.intersectionBy=rtt,ce.intersectionWith=ott,ce.invert=wit,ce.invertBy=Sit,ce.invokeMap=ant,ce.iteratee=$G,ce.keyBy=lnt,ce.keys=qc,ce.keysIn=Ch,ce.map=MF,ce.mapKeys=xit,ce.mapValues=kit,ce.matches=yrt,ce.matchesProperty=Crt,ce.memoize=BF,ce.merge=Tit,ce.mergeWith=f0e,ce.method=wrt,ce.methodOf=Srt,ce.mixin=VG,ce.negate=$F,ce.nthArg=xrt,ce.omit=Iit,ce.omitBy=Lit,ce.once=Ent,ce.orderBy=cnt,ce.over=krt,ce.overArgs=xnt,ce.overEvery=Trt,ce.overSome=Irt,ce.partial=RG,ce.partialRight=r0e,ce.partition=unt,ce.pick=Dit,ce.pickBy=g0e,ce.property=C0e,ce.propertyOf=Lrt,ce.pull=ctt,ce.pullAll=Kye,ce.pullAllBy=utt,ce.pullAllWith=dtt,ce.pullAt=htt,ce.range=Drt,ce.rangeRight=Art,ce.rearg=knt,ce.reject=fnt,ce.remove=ftt,ce.rest=Tnt,ce.reverse=LG,ce.sampleSize=pnt,ce.set=Rit,ce.setWith=Nit,ce.shuffle=mnt,ce.slice=gtt,ce.sortBy=bnt,ce.sortedUniq=Ctt,ce.sortedUniqBy=wtt,ce.split=nrt,ce.spread=Int,ce.tail=Stt,ce.take=Ett,ce.takeRight=xtt,ce.takeRightWhile=ktt,ce.takeWhile=Ttt,ce.tap=Wtt,ce.throttle=Lnt,ce.thru=PF,ce.toArray=c0e,ce.toPairs=p0e,ce.toPairsIn=m0e,ce.toPath=Mrt,ce.toPlainObject=d0e,ce.transform=Oit,ce.unary=Dnt,ce.union=Itt,ce.unionBy=Ltt,ce.unionWith=Dtt,ce.uniq=Att,ce.uniqBy=Rtt,ce.uniqWith=Ntt,ce.unset=Pit,ce.unzip=DG,ce.unzipWith=Gye,ce.update=Mit,ce.updateWith=Fit,ce.values=uT,ce.valuesIn=Bit,ce.without=Ott,ce.words=b0e,ce.wrap=Ant,ce.xor=Ptt,ce.xorBy=Mtt,ce.xorWith=Ftt,ce.zip=Btt,ce.zipObject=$tt,ce.zipObjectDeep=Vtt,ce.zipWith=Htt,ce.entries=p0e,ce.entriesIn=m0e,ce.extend=h0e,ce.extendWith=WF,VG(ce,ce),ce.add=Brt,ce.attempt=y0e,ce.camelCase=Wit,ce.capitalize=_0e,ce.ceil=$rt,ce.clamp=$it,ce.clone=Nnt,ce.cloneDeep=Pnt,ce.cloneDeepWith=Mnt,ce.cloneWith=Ont,ce.conformsTo=Fnt,ce.deburr=v0e,ce.defaultTo=_rt,ce.divide=Vrt,ce.endsWith=zit,ce.eq=fm,ce.escape=jit,ce.escapeRegExp=Uit,ce.every=Ztt,ce.find=ent,ce.findIndex=zye,ce.findKey=fit,ce.findLast=tnt,ce.findLastIndex=jye,ce.findLastKey=git,ce.floor=Hrt,ce.forEach=Qye,ce.forEachRight=Xye,ce.forIn=pit,ce.forInRight=mit,ce.forOwn=_it,ce.forOwnRight=vit,ce.get=PG,ce.gt=Bnt,ce.gte=$nt,ce.has=Cit,ce.hasIn=MG,ce.head=qye,ce.identity=wh,ce.includes=snt,ce.indexOf=ttt,ce.inRange=Vit,ce.invoke=Eit,ce.isArguments=bS,ce.isArray=Pr,ce.isArrayBuffer=Vnt,ce.isArrayLike=yh,ce.isArrayLikeObject=Dl,ce.isBoolean=Hnt,ce.isBuffer=U0,ce.isDate=Wnt,ce.isElement=znt,ce.isEmpty=jnt,ce.isEqual=Unt,ce.isEqualWith=qnt,ce.isError=NG,ce.isFinite=Knt,ce.isFunction=$b,ce.isInteger=o0e,ce.isLength=VF,ce.isMap=s0e,ce.isMatch=Gnt,ce.isMatchWith=Ynt,ce.isNaN=Qnt,ce.isNative=Xnt,ce.isNil=Jnt,ce.isNull=Znt,ce.isNumber=a0e,ce.isObject=Ga,ce.isObjectLike=ul,ce.isPlainObject=iR,ce.isRegExp=OG,ce.isSafeInteger=eit,ce.isSet=l0e,ce.isString=HF,ce.isSymbol=Tf,ce.isTypedArray=cT,ce.isUndefined=tit,ce.isWeakMap=nit,ce.isWeakSet=iit,ce.join=stt,ce.kebabCase=qit,ce.last=Kg,ce.lastIndexOf=att,ce.lowerCase=Kit,ce.lowerFirst=Git,ce.lt=rit,ce.lte=oit,ce.max=Wrt,ce.maxBy=zrt,ce.mean=jrt,ce.meanBy=Urt,ce.min=qrt,ce.minBy=Krt,ce.stubArray=WG,ce.stubFalse=zG,ce.stubObject=Rrt,ce.stubString=Nrt,ce.stubTrue=Ort,ce.multiply=Grt,ce.nth=ltt,ce.noConflict=Ert,ce.noop=HG,ce.now=FF,ce.pad=Yit,ce.padEnd=Qit,ce.padStart=Xit,ce.parseInt=Zit,ce.random=Hit,ce.reduce=dnt,ce.reduceRight=hnt,ce.repeat=Jit,ce.replace=ert,ce.result=Ait,ce.round=Yrt,ce.runInContext=ze,ce.sample=gnt,ce.size=_nt,ce.snakeCase=trt,ce.some=vnt,ce.sortedIndex=ptt,ce.sortedIndexBy=mtt,ce.sortedIndexOf=_tt,ce.sortedLastIndex=vtt,ce.sortedLastIndexBy=btt,ce.sortedLastIndexOf=ytt,ce.startCase=irt,ce.startsWith=rrt,ce.subtract=Qrt,ce.sum=Xrt,ce.sumBy=Zrt,ce.template=ort,ce.times=Prt,ce.toFinite=Vb,ce.toInteger=Ur,ce.toLength=u0e,ce.toLower=srt,ce.toNumber=Gg,ce.toSafeInteger=sit,ce.toString=hs,ce.toUpper=art,ce.trim=lrt,ce.trimEnd=crt,ce.trimStart=urt,ce.truncate=drt,ce.unescape=hrt,ce.uniqueId=Frt,ce.upperCase=frt,ce.upperFirst=FG,ce.each=Qye,ce.eachRight=Xye,ce.first=qye,VG(ce,function(){var S={};return H_(ce,function(T,A){Es.call(ce.prototype,A)||(S[A]=T)}),S}(),{chain:!1}),ce.VERSION=i,id(["bind","bindKey","curry","curryRight","partial","partialRight"],function(S){ce[S].placeholder=ce}),id(["drop","take"],function(S,T){vo.prototype[S]=function(A){A=A===t?1:Sc(Ur(A),0);var W=this.__filtered__&&!T?new vo(this):this.clone();return W.__filtered__?W.__takeCount__=od(A,W.__takeCount__):W.__views__.push({size:od(A,ne),type:S+(W.__dir__<0?"Right":"")}),W},vo.prototype[S+"Right"]=function(A){return this.reverse()[S](A).reverse()}}),id(["filter","map","takeWhile"],function(S,T){var A=T+1,W=A==B||A==H;vo.prototype[S]=function(Q){var de=this.clone();return de.__iteratees__.push({iteratee:Ji(Q,3),type:A}),de.__filtered__=de.__filtered__||W,de}}),id(["head","last"],function(S,T){var A="take"+(T?"Right":"");vo.prototype[S]=function(){return this[A](1).value()[0]}}),id(["initial","tail"],function(S,T){var A="drop"+(T?"":"Right");vo.prototype[S]=function(){return this.__filtered__?new vo(this):this[A](1)}}),vo.prototype.compact=function(){return this.filter(wh)},vo.prototype.find=function(S){return this.filter(S).head()},vo.prototype.findLast=function(S){return this.reverse().find(S)},vo.prototype.invokeMap=no(function(S,T){return typeof S=="function"?new vo(this):this.map(function(A){return XA(A,S,T)})}),vo.prototype.reject=function(S){return this.filter($F(Ji(S)))},vo.prototype.slice=function(S,T){S=Ur(S);var A=this;return A.__filtered__&&(S>0||T<0)?new vo(A):(S<0?A=A.takeRight(-S):S&&(A=A.drop(S)),T!==t&&(T=Ur(T),A=T<0?A.dropRight(-T):A.take(T-S)),A)},vo.prototype.takeRightWhile=function(S){return this.reverse().takeWhile(S).reverse()},vo.prototype.toArray=function(){return this.take(ne)},H_(vo.prototype,function(S,T){var A=/^(?:filter|find|map|reject)|While$/.test(T),W=/^(?:head|last)$/.test(T),Q=ce[W?"take"+(T=="last"?"Right":""):T],de=W||/^find/.test(T);Q&&(ce.prototype[T]=function(){var Ee=this.__wrapped__,Ne=W?[1]:arguments,qe=Ee instanceof vo,Wt=Ne[0],jt=qe||Pr(Ee),rn=function(co){var Io=Q.apply(ce,cm([co],Ne));return W&&zn?Io[0]:Io};jt&&A&&typeof Wt=="function"&&Wt.length!=1&&(qe=jt=!1);var zn=this.__chain__,bi=!!this.__actions__.length,sr=de&&!zn,Qr=qe&&!bi;if(!de&&jt){Ee=Qr?Ee:new vo(this);var ar=S.apply(Ee,Ne);return ar.__actions__.push({func:PF,args:[rn],thisArg:t}),new jg(ar,zn)}return sr&&Qr?S.apply(this,Ne):(ar=this.thru(rn),sr?W?ar.value()[0]:ar.value():ar)})}),id(["pop","push","shift","sort","splice","unshift"],function(S){var T=aF[S],A=/^(?:push|sort|unshift)$/.test(S)?"tap":"thru",W=/^(?:pop|shift)$/.test(S);ce.prototype[S]=function(){var Q=arguments;if(W&&!this.__chain__){var de=this.value();return T.apply(Pr(de)?de:[],Q)}return this[A](function(Ee){return T.apply(Pr(Ee)?Ee:[],Q)})}}),H_(vo.prototype,function(S,T){var A=ce[T];if(A){var W=A.name+"";Es.call(rT,W)||(rT[W]=[]),rT[W].push({name:T,func:A})}}),rT[IF(t,v).name]=[{name:"wrapper",func:t}],vo.prototype.clone=uJe,vo.prototype.reverse=dJe,vo.prototype.value=hJe,ce.prototype.at=ztt,ce.prototype.chain=jtt,ce.prototype.commit=Utt,ce.prototype.next=qtt,ce.prototype.plant=Gtt,ce.prototype.reverse=Ytt,ce.prototype.toJSON=ce.prototype.valueOf=ce.prototype.value=Qtt,ce.prototype.first=ce.prototype.head,jA&&(ce.prototype[jA]=Ktt),ce},tT=zZe();_h?((_h.exports=tT)._=tT,Db._=tT):cl._=tT}).call(Co)})(N9,N9.exports);var Bn=N9.exports;/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function vi(){var e;const n=Tl(t=>t.companyUsers);return(e=n.api[n.currentIndex])==null?void 0:e.company}function Cct(){const n=vi(),e=Ti();return()=>typeof e>"u"?!1:!Bn.isEqual(n,e)}var UMe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Co,function(){var t=1e3,i=6e4,r=36e5,o="millisecond",s="second",a="minute",l="hour",c="day",u="week",d="month",h="quarter",g="year",p="date",m="Invalid Date",_=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(B){var F=["th","st","nd","rd"],H=B%100;return"["+B+(F[(H-20)%10]||F[H]||F[0])+"]"}},y=function(B,F,H){var V=String(B);return!V||V.length>=F?B:""+Array(F+1-V.length).join(H)+B},C={s:y,z:function(B){var F=-B.utcOffset(),H=Math.abs(F),V=Math.floor(H/60),$=H%60;return(F<=0?"+":"-")+y(V,2,"0")+":"+y($,2,"0")},m:function B(F,H){if(F.date()<H.date())return-B(H,F);var V=12*(H.year()-F.year())+(H.month()-F.month()),$=F.clone().add(V,d),j=H-$<0,Y=F.clone().add(V+(j?-1:1),d);return+(-(V+(H-$)/(j?$-Y:Y-$))||0)},a:function(B){return B<0?Math.ceil(B)||0:Math.floor(B)},p:function(B){return{M:d,y:g,w:u,d:c,D:p,h:l,m:a,s,ms:o,Q:h}[B]||String(B||"").toLowerCase().replace(/s$/,"")},u:function(B){return B===void 0}},x="en",k={};k[x]=b;var I="$isDayjsObject",L=function(B){return B instanceof M||!(!B||!B[I])},D=function B(F,H,V){var $;if(!F)return x;if(typeof F=="string"){var j=F.toLowerCase();k[j]&&($=j),H&&(k[j]=H,$=j);var Y=F.split("-");if(!$&&Y.length>1)return B(Y[0])}else{var ne=F.name;k[ne]=F,$=ne}return!V&&$&&(x=$),$||!V&&x},R=function(B,F){if(L(B))return B.clone();var H=typeof F=="object"?F:{};return H.date=B,H.args=arguments,new M(H)},P=C;P.l=D,P.i=L,P.w=function(B,F){return R(B,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var M=function(){function B(H){this.$L=D(H.locale,null,!0),this.parse(H),this.$x=this.$x||H.x||{},this[I]=!0}var F=B.prototype;return F.parse=function(H){this.$d=function(V){var $=V.date,j=V.utc;if($===null)return new Date(NaN);if(P.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var Y=$.match(_);if(Y){var ne=Y[2]-1||0,se=(Y[7]||"0").substring(0,3);return j?new Date(Date.UTC(Y[1],ne,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,se)):new Date(Y[1],ne,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,se)}}return new Date($)}(H),this.init()},F.init=function(){var H=this.$d;this.$y=H.getFullYear(),this.$M=H.getMonth(),this.$D=H.getDate(),this.$W=H.getDay(),this.$H=H.getHours(),this.$m=H.getMinutes(),this.$s=H.getSeconds(),this.$ms=H.getMilliseconds()},F.$utils=function(){return P},F.isValid=function(){return this.$d.toString()!==m},F.isSame=function(H,V){var $=R(H);return this.startOf(V)<=$&&$<=this.endOf(V)},F.isAfter=function(H,V){return R(H)<this.startOf(V)},F.isBefore=function(H,V){return this.endOf(V)<R(H)},F.$g=function(H,V,$){return P.u(H)?this[V]:this.set($,H)},F.unix=function(){return Math.floor(this.valueOf()/1e3)},F.valueOf=function(){return this.$d.getTime()},F.startOf=function(H,V){var $=this,j=!!P.u(V)||V,Y=P.p(H),ne=function(Ze,tt){var Be=P.w($.$u?Date.UTC($.$y,tt,Ze):new Date($.$y,tt,Ze),$);return j?Be:Be.endOf(c)},se=function(Ze,tt){return P.w($.toDate()[Ze].apply($.toDate("s"),(j?[0,0,0,0]:[23,59,59,999]).slice(tt)),$)},he=this.$W,xe=this.$M,_e=this.$D,Ie="set"+(this.$u?"UTC":"");switch(Y){case g:return j?ne(1,0):ne(31,11);case d:return j?ne(1,xe):ne(0,xe+1);case u:var Re=this.$locale().weekStart||0,Ye=(he<Re?he+7:he)-Re;return ne(j?_e-Ye:_e+(6-Ye),xe);case c:case p:return se(Ie+"Hours",0);case l:return se(Ie+"Minutes",1);case a:return se(Ie+"Seconds",2);case s:return se(Ie+"Milliseconds",3);default:return this.clone()}},F.endOf=function(H){return this.startOf(H,!1)},F.$set=function(H,V){var $,j=P.p(H),Y="set"+(this.$u?"UTC":""),ne=($={},$[c]=Y+"Date",$[p]=Y+"Date",$[d]=Y+"Month",$[g]=Y+"FullYear",$[l]=Y+"Hours",$[a]=Y+"Minutes",$[s]=Y+"Seconds",$[o]=Y+"Milliseconds",$)[j],se=j===c?this.$D+(V-this.$W):V;if(j===d||j===g){var he=this.clone().set(p,1);he.$d[ne](se),he.init(),this.$d=he.set(p,Math.min(this.$D,he.daysInMonth())).$d}else ne&&this.$d[ne](se);return this.init(),this},F.set=function(H,V){return this.clone().$set(H,V)},F.get=function(H){return this[P.p(H)]()},F.add=function(H,V){var $,j=this;H=Number(H);var Y=P.p(V),ne=function(xe){var _e=R(j);return P.w(_e.date(_e.date()+Math.round(xe*H)),j)};if(Y===d)return this.set(d,this.$M+H);if(Y===g)return this.set(g,this.$y+H);if(Y===c)return ne(1);if(Y===u)return ne(7);var se=($={},$[a]=i,$[l]=r,$[s]=t,$)[Y]||1,he=this.$d.getTime()+H*se;return P.w(he,this)},F.subtract=function(H,V){return this.add(-1*H,V)},F.format=function(H){var V=this,$=this.$locale();if(!this.isValid())return $.invalidDate||m;var j=H||"YYYY-MM-DDTHH:mm:ssZ",Y=P.z(this),ne=this.$H,se=this.$m,he=this.$M,xe=$.weekdays,_e=$.months,Ie=$.meridiem,Re=function(tt,Be,kt,Vt){return tt&&(tt[Be]||tt(V,j))||kt[Be].slice(0,Vt)},Ye=function(tt){return P.s(ne%12||12,tt,"0")},Ze=Ie||function(tt,Be,kt){var Vt=tt<12?"AM":"PM";return kt?Vt.toLowerCase():Vt};return j.replace(v,function(tt,Be){return Be||function(kt){switch(kt){case"YY":return String(V.$y).slice(-2);case"YYYY":return P.s(V.$y,4,"0");case"M":return he+1;case"MM":return P.s(he+1,2,"0");case"MMM":return Re($.monthsShort,he,_e,3);case"MMMM":return Re(_e,he);case"D":return V.$D;case"DD":return P.s(V.$D,2,"0");case"d":return String(V.$W);case"dd":return Re($.weekdaysMin,V.$W,xe,2);case"ddd":return Re($.weekdaysShort,V.$W,xe,3);case"dddd":return xe[V.$W];case"H":return String(ne);case"HH":return P.s(ne,2,"0");case"h":return Ye(1);case"hh":return Ye(2);case"a":return Ze(ne,se,!0);case"A":return Ze(ne,se,!1);case"m":return String(se);case"mm":return P.s(se,2,"0");case"s":return String(V.$s);case"ss":return P.s(V.$s,2,"0");case"SSS":return P.s(V.$ms,3,"0");case"Z":return Y}return null}(tt)||Y.replace(":","")})},F.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},F.diff=function(H,V,$){var j,Y=this,ne=P.p(V),se=R(H),he=(se.utcOffset()-this.utcOffset())*i,xe=this-se,_e=function(){return P.m(Y,se)};switch(ne){case g:j=_e()/12;break;case d:j=_e();break;case h:j=_e()/3;break;case u:j=(xe-he)/6048e5;break;case c:j=(xe-he)/864e5;break;case l:j=xe/r;break;case a:j=xe/i;break;case s:j=xe/t;break;default:j=xe}return $?j:P.a(j)},F.daysInMonth=function(){return this.endOf(d).$D},F.$locale=function(){return k[this.$L]},F.locale=function(H,V){if(!H)return this.$L;var $=this.clone(),j=D(H,V,!0);return j&&($.$L=j),$},F.clone=function(){return P.w(this.$d,this)},F.toDate=function(){return new Date(this.valueOf())},F.toJSON=function(){return this.isValid()?this.toISOString():null},F.toISOString=function(){return this.$d.toISOString()},F.toString=function(){return this.$d.toUTCString()},B}(),O=M.prototype;return R.prototype=O,[["$ms",o],["$s",s],["$m",a],["$H",l],["$W",c],["$M",d],["$y",g],["$D",p]].forEach(function(B){O[B[1]]=function(F){return this.$g(F,B[0],B[1])}}),R.extend=function(B,F){return B.$i||(B(F,M,R),B.$i=!0),R},R.locale=D,R.isDayjs=L,R.unix=function(B){return R(1e3*B)},R.en=k[x],R.Ls=k,R.p={},R})})(UMe);var wct=UMe.exports;const Cn=ja(wct);function Er(n){"@babel/helpers - typeof";return Er=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Er(n)}function Ua(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Sct(n,e){if(Er(n)!=="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(Er(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function qMe(n){var e=Sct(n,"string");return Er(e)==="symbol"?e:String(e)}function V1e(n,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,qMe(i.key),i)}}function qa(n,e,t){return e&&V1e(n.prototype,e),t&&V1e(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function Sr(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function O9(n,e){return O9=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},O9(n,e)}function I_(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&O9(n,e)}function M2(n,e){if(e&&(Er(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sr(n)}function Pp(n){return Pp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Pp(n)}function $e(n,e,t){return e=qMe(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function KMe(n){if(Array.isArray(n))return n}function GMe(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function Hee(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function dde(n,e){if(n){if(typeof n=="string")return Hee(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Hee(n,e)}}function YMe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QMe(n){return KMe(n)||GMe(n)||dde(n)||YMe()}function H1e(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function W1e(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?H1e(Object(t),!0).forEach(function(i){$e(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):H1e(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}var Ect={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},xct=function(){function n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ua(this,n),this.init(e,t)}return qa(n,[{key:"init",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=i.prefix||"i18next:",this.logger=t||Ect,this.options=i,this.debug=i.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return this.forward(i,"log","",!0)}},{key:"warn",value:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return this.forward(i,"warn","",!0)}},{key:"error",value:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return this.forward(i,"error","")}},{key:"deprecate",value:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return this.forward(i,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(t,i,r,o){return o&&!this.debug?null:(typeof t[0]=="string"&&(t[0]="".concat(r).concat(this.prefix," ").concat(t[0])),this.logger[i](t))}},{key:"create",value:function(t){return new n(this.logger,W1e(W1e({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new n(this.logger,t)}}]),n}(),Iv=new xct,KC=function(){function n(){Ua(this,n),this.observers={}}return qa(n,[{key:"on",value:function(t,i){var r=this;return t.split(" ").forEach(function(o){r.observers[o]=r.observers[o]||[],r.observers[o].push(i)}),this}},{key:"off",value:function(t,i){if(this.observers[t]){if(!i){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(function(r){return r!==i})}}},{key:"emit",value:function(t){for(var i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];if(this.observers[t]){var s=[].concat(this.observers[t]);s.forEach(function(l){l.apply(void 0,r)})}if(this.observers["*"]){var a=[].concat(this.observers["*"]);a.forEach(function(l){l.apply(l,[t].concat(r))})}}}]),n}();function hR(){var n,e,t=new Promise(function(i,r){n=i,e=r});return t.resolve=n,t.reject=e,t}function z1e(n){return n==null?"":""+n}function kct(n,e,t){n.forEach(function(i){e[i]&&(t[i]=e[i])})}function hde(n,e,t){function i(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function r(){return!n||typeof n=="string"}for(var o=typeof e!="string"?[].concat(e):e.split(".");o.length>1;){if(r())return{};var s=i(o.shift());!n[s]&&t&&(n[s]=new t),Object.prototype.hasOwnProperty.call(n,s)?n=n[s]:n={}}return r()?{}:{obj:n,k:i(o.shift())}}function j1e(n,e,t){var i=hde(n,e,Object),r=i.obj,o=i.k;r[o]=t}function Tct(n,e,t,i){var r=hde(n,e,Object),o=r.obj,s=r.k;o[s]=o[s]||[],i&&(o[s]=o[s].concat(t)),i||o[s].push(t)}function P9(n,e){var t=hde(n,e),i=t.obj,r=t.k;if(i)return i[r]}function Ict(n,e,t){var i=P9(n,t);return i!==void 0?i:P9(e,t)}function XMe(n,e,t){for(var i in e)i!=="__proto__"&&i!=="constructor"&&(i in n?typeof n[i]=="string"||n[i]instanceof String||typeof e[i]=="string"||e[i]instanceof String?t&&(n[i]=e[i]):XMe(n[i],e[i],t):n[i]=e[i]);return n}function hT(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Lct={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function Dct(n){return typeof n=="string"?n.replace(/[&<>"'\/]/g,function(e){return Lct[e]}):n}var az=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Act=[" ",",","?","!",";"];function Rct(n,e,t){e=e||"",t=t||"";var i=Act.filter(function(a){return e.indexOf(a)<0&&t.indexOf(a)<0});if(i.length===0)return!0;var r=new RegExp("(".concat(i.map(function(a){return a==="?"?"\\?":a}).join("|"),")")),o=!r.test(n);if(!o){var s=n.indexOf(t);s>0&&!r.test(n.substring(0,s))&&(o=!0)}return o}function M9(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(n){if(n[e])return n[e];for(var i=e.split(t),r=n,o=0;o<i.length;++o){if(!r||typeof r[i[o]]=="string"&&o+1<i.length)return;if(r[i[o]]===void 0){for(var s=2,a=i.slice(o,o+s).join(t),l=r[a];l===void 0&&i.length>o+s;)s++,a=i.slice(o,o+s).join(t),l=r[a];if(l===void 0)return;if(l===null)return null;if(e.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}var c=i.slice(o+s).join(t);return c?M9(l,c,t):void 0}r=r[i[o]]}return r}}function U1e(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function s6(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?U1e(Object(t),!0).forEach(function(i){$e(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):U1e(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Nct(n){var e=Oct();return function(){var i=Pp(n),r;if(e){var o=Pp(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return M2(this,r)}}function Oct(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Pct=function(n){I_(t,n);var e=Nct(t);function t(i){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Ua(this,t),r=e.call(this),az&&KC.call(Sr(r)),r.data=i||{},r.options=o,r.options.keySeparator===void 0&&(r.options.keySeparator="."),r.options.ignoreJSONStructure===void 0&&(r.options.ignoreJSONStructure=!0),r}return qa(t,[{key:"addNamespaces",value:function(r){this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}},{key:"removeNamespaces",value:function(r){var o=this.options.ns.indexOf(r);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(r,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,c=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,u=[r,o];s&&typeof s!="string"&&(u=u.concat(s)),s&&typeof s=="string"&&(u=u.concat(l?s.split(l):s)),r.indexOf(".")>-1&&(u=r.split("."));var d=P9(this.data,u);return d||!c||typeof s!="string"?d:M9(this.data&&this.data[r]&&this.data[r][o],s,l)}},{key:"addResource",value:function(r,o,s,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},c=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,u=[r,o];s&&(u=u.concat(c?s.split(c):s)),r.indexOf(".")>-1&&(u=r.split("."),a=o,o=u[1]),this.addNamespaces(o),j1e(this.data,u,a),l.silent||this.emit("added",r,o,s,a)}},{key:"addResources",value:function(r,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in s)(typeof s[l]=="string"||Object.prototype.toString.apply(s[l])==="[object Array]")&&this.addResource(r,o,l,s[l],{silent:!0});a.silent||this.emit("added",r,o,s)}},{key:"addResourceBundle",value:function(r,o,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},u=[r,o];r.indexOf(".")>-1&&(u=r.split("."),a=s,s=o,o=u[1]),this.addNamespaces(o);var d=P9(this.data,u)||{};a?XMe(d,s,l):d=s6(s6({},d),s),j1e(this.data,u,d),c.silent||this.emit("added",r,o,s)}},{key:"removeResourceBundle",value:function(r,o){this.hasResourceBundle(r,o)&&delete this.data[r][o],this.removeNamespaces(o),this.emit("removed",r,o)}},{key:"hasResourceBundle",value:function(r,o){return this.getResource(r,o)!==void 0}},{key:"getResourceBundle",value:function(r,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?s6(s6({},{}),this.getResource(r,o)):this.getResource(r,o)}},{key:"getDataByLanguage",value:function(r){return this.data[r]}},{key:"hasLanguageSomeTranslations",value:function(r){var o=this.getDataByLanguage(r),s=o&&Object.keys(o)||[];return!!s.find(function(a){return o[a]&&Object.keys(o[a]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),t}(KC),ZMe={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,i,r,o){var s=this;return e.forEach(function(a){s.processors[a]&&(t=s.processors[a].process(t,i,r,o))}),t}};function q1e(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function cd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?q1e(Object(t),!0).forEach(function(i){$e(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):q1e(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Mct(n){var e=Fct();return function(){var i=Pp(n),r;if(e){var o=Pp(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return M2(this,r)}}function Fct(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var K1e={},G1e=function(n){I_(t,n);var e=Mct(t);function t(i){var r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ua(this,t),r=e.call(this),az&&KC.call(Sr(r)),kct(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i,Sr(r)),r.options=o,r.options.keySeparator===void 0&&(r.options.keySeparator="."),r.logger=Iv.create("translator"),r}return qa(t,[{key:"changeLanguage",value:function(r){r&&(this.language=r)}},{key:"exists",value:function(r){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(r==null)return!1;var s=this.resolve(r,o);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(r,o){var s=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],c=s&&r.indexOf(s)>-1,u=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!Rct(r,s,a);if(c&&!u){var d=r.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:r,namespaces:l};var h=r.split(s);(s!==a||s===a&&this.options.ns.indexOf(h[0])>-1)&&(l=h.shift()),r=h.join(a)}return typeof l=="string"&&(l=[l]),{key:r,namespaces:l}}},{key:"translate",value:function(r,o,s){var a=this;if(Er(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),Er(o)==="object"&&(o=cd({},o)),o||(o={}),r==null)return"";Array.isArray(r)||(r=[String(r)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,c=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=this.extractFromKey(r[r.length-1],o),d=u.key,h=u.namespaces,g=h[h.length-1],p=o.lng||this.language,m=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&p.toLowerCase()==="cimode"){if(m){var _=o.nsSeparator||this.options.nsSeparator;return l?{res:"".concat(g).concat(_).concat(d),usedKey:d,exactUsedKey:d,usedLng:p,usedNS:g}:"".concat(g).concat(_).concat(d)}return l?{res:d,usedKey:d,exactUsedKey:d,usedLng:p,usedNS:g}:d}var v=this.resolve(r,o),b=v&&v.res,y=v&&v.usedKey||d,C=v&&v.exactUsedKey||d,x=Object.prototype.toString.apply(b),k=["[object Number]","[object Function]","[object RegExp]"],I=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,L=!this.i18nFormat||this.i18nFormat.handleAsObject,D=typeof b!="string"&&typeof b!="boolean"&&typeof b!="number";if(L&&b&&D&&k.indexOf(x)<0&&!(typeof I=="string"&&x==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var R=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,b,cd(cd({},o),{},{ns:h})):"key '".concat(d," (").concat(this.language,")' returned an object instead of string.");return l?(v.res=R,v):R}if(c){var P=x==="[object Array]",M=P?[]:{},O=P?C:y;for(var B in b)if(Object.prototype.hasOwnProperty.call(b,B)){var F="".concat(O).concat(c).concat(B);M[B]=this.translate(F,cd(cd({},o),{joinArrays:!1,ns:h})),M[B]===F&&(M[B]=b[B])}b=M}}else if(L&&typeof I=="string"&&x==="[object Array]")b=b.join(I),b&&(b=this.extendTranslation(b,r,o,s));else{var H=!1,V=!1,$=o.count!==void 0&&typeof o.count!="string",j=t.hasDefaultValue(o),Y=$?this.pluralResolver.getSuffix(p,o.count,o):"",ne=o["defaultValue".concat(Y)]||o.defaultValue;!this.isValidLookup(b)&&j&&(H=!0,b=ne),this.isValidLookup(b)||(V=!0,b=d);var se=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,he=se&&V?void 0:b,xe=j&&ne!==b&&this.options.updateMissing;if(V||H||xe){if(this.logger.log(xe?"updateKey":"missingKey",p,g,d,xe?ne:b),c){var _e=this.resolve(d,cd(cd({},o),{},{keySeparator:!1}));_e&&_e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var Ie=[],Re=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Re&&Re[0])for(var Ye=0;Ye<Re.length;Ye++)Ie.push(Re[Ye]);else this.options.saveMissingTo==="all"?Ie=this.languageUtils.toResolveHierarchy(o.lng||this.language):Ie.push(o.lng||this.language);var Ze=function(Be,kt,Vt){var xt=j&&Vt!==b?Vt:he;a.options.missingKeyHandler?a.options.missingKeyHandler(Be,g,kt,xt,xe,o):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(Be,g,kt,xt,xe,o),a.emit("missingKey",Be,g,kt,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&$?Ie.forEach(function(tt){a.pluralResolver.getSuffixes(tt,o).forEach(function(Be){Ze([tt],d+Be,o["defaultValue".concat(Be)]||ne)})}):Ze(Ie,d,ne))}b=this.extendTranslation(b,r,o,v,s),V&&b===d&&this.options.appendNamespaceToMissingKey&&(b="".concat(g,":").concat(d)),(V||H)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?b=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(g,":").concat(d):d,H?b:void 0):b=this.options.parseMissingKeyHandler(b))}return l?(v.res=b,v):b}},{key:"extendTranslation",value:function(r,o,s,a,l){var c=this;if(this.i18nFormat&&this.i18nFormat.parse)r=this.i18nFormat.parse(r,cd(cd({},this.options.interpolation.defaultVariables),s),a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init(cd(cd({},s),{interpolation:cd(cd({},this.options.interpolation),s.interpolation)}));var u=typeof r=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),d;if(u){var h=r.match(this.interpolator.nestingRegexp);d=h&&h.length}var g=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(g=cd(cd({},this.options.interpolation.defaultVariables),g)),r=this.interpolator.interpolate(r,g,s.lng||this.language,s),u){var p=r.match(this.interpolator.nestingRegexp),m=p&&p.length;d<m&&(s.nest=!1)}!s.lng&&this.options.compatibilityAPI!=="v1"&&a&&a.res&&(s.lng=a.usedLng),s.nest!==!1&&(r=this.interpolator.nest(r,function(){for(var b=arguments.length,y=new Array(b),C=0;C<b;C++)y[C]=arguments[C];return l&&l[0]===y[0]&&!s.context?(c.logger.warn("It seems you are nesting recursively key: ".concat(y[0]," in key: ").concat(o[0])),null):c.translate.apply(c,y.concat([o]))},s)),s.interpolation&&this.interpolator.reset()}var _=s.postProcess||this.options.postProcess,v=typeof _=="string"?[_]:_;return r!=null&&v&&v.length&&s.applyPostProcessor!==!1&&(r=ZMe.handle(v,r,o,this.options&&this.options.postProcessPassResolved?cd({i18nResolved:a},s):s,this)),r}},{key:"resolve",value:function(r){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,l,c,u,d;return typeof r=="string"&&(r=[r]),r.forEach(function(h){if(!o.isValidLookup(a)){var g=o.extractFromKey(h,s),p=g.key;l=p;var m=g.namespaces;o.options.fallbackNS&&(m=m.concat(o.options.fallbackNS));var _=s.count!==void 0&&typeof s.count!="string",v=_&&!s.ordinal&&s.count===0&&o.pluralResolver.shouldUseIntlApi(),b=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",y=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);m.forEach(function(C){o.isValidLookup(a)||(d=C,!K1e["".concat(y[0],"-").concat(C)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(d)&&(K1e["".concat(y[0],"-").concat(C)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(y.join(", "),`" won't get resolved as namespace "`).concat(d,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(function(x){if(!o.isValidLookup(a)){u=x;var k=[p];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(k,p,x,C,s);else{var I;_&&(I=o.pluralResolver.getSuffix(x,s.count,s));var L="".concat(o.options.pluralSeparator,"zero");if(_&&(k.push(p+I),v&&k.push(p+L)),b){var D="".concat(p).concat(o.options.contextSeparator).concat(s.context);k.push(D),_&&(k.push(D+I),v&&k.push(D+L))}}for(var R;R=k.pop();)o.isValidLookup(a)||(c=R,a=o.getResource(x,C,R,s))}}))})}}),{res:a,usedKey:l,exactUsedKey:c,usedLng:u,usedNS:d}}},{key:"isValidLookup",value:function(r){return r!==void 0&&!(!this.options.returnNull&&r===null)&&!(!this.options.returnEmptyString&&r==="")}},{key:"getResource",value:function(r,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(r,o,s,a):this.resourceStore.getResource(r,o,s,a)}}],[{key:"hasDefaultValue",value:function(r){var o="defaultValue";for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s)&&o===s.substring(0,o.length)&&r[s]!==void 0)return!0;return!1}}]),t}(KC);function vY(n){return n.charAt(0).toUpperCase()+n.slice(1)}var Y1e=function(){function n(e){Ua(this,n),this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Iv.create("languageUtils")}return qa(n,[{key:"getScriptPartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return null;var i=t.split("-");return i.length===2||(i.pop(),i[i.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(i.join("-"))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return t;var i=t.split("-");return this.formatLanguageCode(i[0])}},{key:"formatLanguageCode",value:function(t){if(typeof t=="string"&&t.indexOf("-")>-1){var i=["hans","hant","latn","cyrl","cans","mong","arab"],r=t.split("-");return this.options.lowerCaseLng?r=r.map(function(o){return o.toLowerCase()}):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),i.indexOf(r[1].toLowerCase())>-1&&(r[1]=vY(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),i.indexOf(r[1].toLowerCase())>-1&&(r[1]=vY(r[1].toLowerCase())),i.indexOf(r[2].toLowerCase())>-1&&(r[2]=vY(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isSupportedCode",value:function(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var i=this;if(!t)return null;var r;return t.forEach(function(o){if(!r){var s=i.formatLanguageCode(o);(!i.options.supportedLngs||i.isSupportedCode(s))&&(r=s)}}),!r&&this.options.supportedLngs&&t.forEach(function(o){if(!r){var s=i.getLanguagePartFromCode(o);if(i.isSupportedCode(s))return r=s;r=i.options.supportedLngs.find(function(a){if(a===s)return a;if(!(a.indexOf("-")<0&&s.indexOf("-")<0)&&a.indexOf(s)===0)return a})}}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}},{key:"getFallbackCodes",value:function(t,i){if(!t)return[];if(typeof t=="function"&&(t=t(i)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!i)return t.default||[];var r=t[i];return r||(r=t[this.getScriptPartFromCode(i)]),r||(r=t[this.formatLanguageCode(i)]),r||(r=t[this.getLanguagePartFromCode(i)]),r||(r=t.default),r||[]}},{key:"toResolveHierarchy",value:function(t,i){var r=this,o=this.getFallbackCodes(i||this.options.fallbackLng||[],t),s=[],a=function(c){c&&(r.isSupportedCode(c)?s.push(c):r.logger.warn("rejecting language code not found in supportedLngs: ".concat(c)))};return typeof t=="string"&&t.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(t))):typeof t=="string"&&a(this.formatLanguageCode(t)),o.forEach(function(l){s.indexOf(l)<0&&a(r.formatLanguageCode(l))}),s}}]),n}(),Bct=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],$ct={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}},Vct=["v1","v2","v3"],Q1e={zero:0,one:1,two:2,few:3,many:4,other:5};function Hct(){var n={};return Bct.forEach(function(e){e.lngs.forEach(function(t){n[t]={numbers:e.nr,plurals:$ct[e.fc]}})}),n}var Wct=function(){function n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ua(this,n),this.languageUtils=e,this.options=t,this.logger=Iv.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Hct()}return qa(n,[{key:"addRule",value:function(t,i){this.rules[t]=i}},{key:"getRule",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(t,{type:i.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRule(t,i);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(function(o){return"".concat(i).concat(o)})}},{key:"getSuffixes",value:function(t){var i=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(t,r);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(s,a){return Q1e[s]-Q1e[a]}).map(function(s){return"".concat(i.options.prepend).concat(s)}):o.numbers.map(function(s){return i.getSuffix(t,s,r)}):[]}},{key:"getSuffix",value:function(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(t,r);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(i)):this.getSuffixRetroCompatible(o,i):(this.logger.warn("no plural rule found for: ".concat(t)),"")}},{key:"getSuffixRetroCompatible",value:function(t,i){var r=this,o=t.noAbs?t.plurals(i):t.plurals(Math.abs(i)),s=t.numbers[o];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var a=function(){return r.options.prepend&&s.toString()?r.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!Vct.includes(this.options.compatibilityJSON)}}]),n}();function X1e(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function mm(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?X1e(Object(t),!0).forEach(function(i){$e(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):X1e(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Z1e(n,e,t){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=Ict(n,e,t);return!o&&r&&typeof t=="string"&&(o=M9(n,t,i),o===void 0&&(o=M9(e,t,i))),o}var zct=function(){function n(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ua(this,n),this.logger=Iv.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(t){return t},this.init(e)}return qa(n,[{key:"init",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var i=t.interpolation;this.escape=i.escape!==void 0?i.escape:Dct,this.escapeValue=i.escapeValue!==void 0?i.escapeValue:!0,this.useRawValueToEscape=i.useRawValueToEscape!==void 0?i.useRawValueToEscape:!1,this.prefix=i.prefix?hT(i.prefix):i.prefixEscaped||"{{",this.suffix=i.suffix?hT(i.suffix):i.suffixEscaped||"}}",this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||",",this.unescapePrefix=i.unescapeSuffix?"":i.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":i.unescapeSuffix||"",this.nestingPrefix=i.nestingPrefix?hT(i.nestingPrefix):i.nestingPrefixEscaped||hT("$t("),this.nestingSuffix=i.nestingSuffix?hT(i.nestingSuffix):i.nestingSuffixEscaped||hT(")"),this.nestingOptionsSeparator=i.nestingOptionsSeparator?i.nestingOptionsSeparator:i.nestingOptionsSeparator||",",this.maxReplaces=i.maxReplaces?i.maxReplaces:1e3,this.alwaysFormat=i.alwaysFormat!==void 0?i.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var i="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(i,"g");var r="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(r,"g")}},{key:"interpolate",value:function(t,i,r,o){var s=this,a,l,c,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function d(_){return _.replace(/\$/g,"$$$$")}var h=function(v){if(v.indexOf(s.formatSeparator)<0){var b=Z1e(i,u,v,s.options.keySeparator,s.options.ignoreJSONStructure);return s.alwaysFormat?s.format(b,void 0,r,mm(mm(mm({},o),i),{},{interpolationkey:v})):b}var y=v.split(s.formatSeparator),C=y.shift().trim(),x=y.join(s.formatSeparator).trim();return s.format(Z1e(i,u,C,s.options.keySeparator,s.options.ignoreJSONStructure),x,r,mm(mm(mm({},o),i),{},{interpolationkey:C}))};this.resetRegExp();var g=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,p=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,m=[{regex:this.regexpUnescape,safeValue:function(v){return d(v)}},{regex:this.regexp,safeValue:function(v){return s.escapeValue?d(s.escape(v)):d(v)}}];return m.forEach(function(_){for(c=0;a=_.regex.exec(t);){var v=a[1].trim();if(l=h(v),l===void 0)if(typeof g=="function"){var b=g(t,a,o);l=typeof b=="string"?b:""}else if(o&&Object.prototype.hasOwnProperty.call(o,v))l="";else if(p){l=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(v," for interpolating ").concat(t)),l="";else typeof l!="string"&&!s.useRawValueToEscape&&(l=z1e(l));var y=_.safeValue(l);if(t=t.replace(a[0],y),p?(_.regex.lastIndex+=l.length,_.regex.lastIndex-=a[0].length):_.regex.lastIndex=0,c++,c>=s.maxReplaces)break}}),t}},{key:"nest",value:function(t,i){var r=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,a,l;function c(g,p){var m=this.nestingOptionsSeparator;if(g.indexOf(m)<0)return g;var _=g.split(new RegExp("".concat(m,"[ ]*{"))),v="{".concat(_[1]);g=_[0],v=this.interpolate(v,l);var b=v.match(/'/g),y=v.match(/"/g);(b&&b.length%2===0&&!y||y.length%2!==0)&&(v=v.replace(/'/g,'"'));try{l=JSON.parse(v),p&&(l=mm(mm({},p),l))}catch(C){return this.logger.warn("failed parsing options string in nesting for key ".concat(g),C),"".concat(g).concat(m).concat(v)}return delete l.defaultValue,g}for(;s=this.nestingRegexp.exec(t);){var u=[];l=mm({},o),l=l.replace&&typeof l.replace!="string"?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;var d=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var h=s[1].split(this.formatSeparator).map(function(g){return g.trim()});s[1]=h.shift(),u=h,d=!0}if(a=i(c.call(this,s[1].trim(),l),l),a&&s[0]===t&&typeof a!="string")return a;typeof a!="string"&&(a=z1e(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(t)),a=""),d&&(a=u.reduce(function(g,p){return r.format(g,p,o.lng,mm(mm({},o),{},{interpolationkey:s[1].trim()}))},a.trim())),t=t.replace(s[0],a),this.regexp.lastIndex=0}return t}}]),n}();function J1e(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Wb(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?J1e(Object(t),!0).forEach(function(i){$e(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):J1e(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function jct(n){var e=n.toLowerCase().trim(),t={};if(n.indexOf("(")>-1){var i=n.split("(");e=i[0].toLowerCase().trim();var r=i[1].substring(0,i[1].length-1);if(e==="currency"&&r.indexOf(":")<0)t.currency||(t.currency=r.trim());else if(e==="relativetime"&&r.indexOf(":")<0)t.range||(t.range=r.trim());else{var o=r.split(";");o.forEach(function(s){if(s){var a=s.split(":"),l=QMe(a),c=l[0],u=l.slice(1),d=u.join(":").trim().replace(/^'+|'+$/g,"");t[c.trim()]||(t[c.trim()]=d),d==="false"&&(t[c.trim()]=!1),d==="true"&&(t[c.trim()]=!0),isNaN(d)||(t[c.trim()]=parseInt(d,10))}})}}return{formatName:e,formatOptions:t}}function fT(n){var e={};return function(i,r,o){var s=r+JSON.stringify(o),a=e[s];return a||(a=n(r,o),e[s]=a),a(i)}}var Uct=function(){function n(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ua(this,n),this.logger=Iv.create("formatter"),this.options=e,this.formats={number:fT(function(t,i){var r=new Intl.NumberFormat(t,Wb({},i));return function(o){return r.format(o)}}),currency:fT(function(t,i){var r=new Intl.NumberFormat(t,Wb(Wb({},i),{},{style:"currency"}));return function(o){return r.format(o)}}),datetime:fT(function(t,i){var r=new Intl.DateTimeFormat(t,Wb({},i));return function(o){return r.format(o)}}),relativetime:fT(function(t,i){var r=new Intl.RelativeTimeFormat(t,Wb({},i));return function(o){return r.format(o,i.range||"day")}}),list:fT(function(t,i){var r=new Intl.ListFormat(t,Wb({},i));return function(o){return r.format(o)}})},this.init(e)}return qa(n,[{key:"init",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},r=i.interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}},{key:"add",value:function(t,i){this.formats[t.toLowerCase().trim()]=i}},{key:"addCached",value:function(t,i){this.formats[t.toLowerCase().trim()]=fT(i)}},{key:"format",value:function(t,i,r){var o=this,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=i.split(this.formatSeparator),l=a.reduce(function(c,u){var d=jct(u),h=d.formatName,g=d.formatOptions;if(o.formats[h]){var p=c;try{var m=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},_=m.locale||m.lng||s.locale||s.lng||r;p=o.formats[h](c,_,Wb(Wb(Wb({},g),s),m))}catch(v){o.logger.warn(v)}return p}else o.logger.warn("there was no format function for ".concat(h));return c},t);return l}}]),n}();function eCe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function tCe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?eCe(Object(t),!0).forEach(function(i){$e(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):eCe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function qct(n){var e=Kct();return function(){var i=Pp(n),r;if(e){var o=Pp(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return M2(this,r)}}function Kct(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Gct(n,e){n.pending[e]!==void 0&&(delete n.pending[e],n.pendingCount--)}var Yct=function(n){I_(t,n);var e=qct(t);function t(i,r,o){var s,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return Ua(this,t),s=e.call(this),az&&KC.call(Sr(s)),s.backend=i,s.store=r,s.services=o,s.languageUtils=o.languageUtils,s.options=a,s.logger=Iv.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=a.maxParallelReads||10,s.readingCalls=0,s.maxRetries=a.maxRetries>=0?a.maxRetries:5,s.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(o,a.backend,a),s}return qa(t,[{key:"queueLoad",value:function(r,o,s,a){var l=this,c={},u={},d={},h={};return r.forEach(function(g){var p=!0;o.forEach(function(m){var _="".concat(g,"|").concat(m);!s.reload&&l.store.hasResourceBundle(g,m)?l.state[_]=2:l.state[_]<0||(l.state[_]===1?u[_]===void 0&&(u[_]=!0):(l.state[_]=1,p=!1,u[_]===void 0&&(u[_]=!0),c[_]===void 0&&(c[_]=!0),h[m]===void 0&&(h[m]=!0)))}),p||(d[g]=!0)}),(Object.keys(c).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(c),pending:Object.keys(u),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(h)}}},{key:"loaded",value:function(r,o,s){var a=r.split("|"),l=a[0],c=a[1];o&&this.emit("failedLoading",l,c,o),s&&this.store.addResourceBundle(l,c,s),this.state[r]=o?-1:2;var u={};this.queue.forEach(function(d){Tct(d.loaded,[l],c),Gct(d,r),o&&d.errors.push(o),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(function(h){u[h]||(u[h]={});var g=d.loaded[h];g.length&&g.forEach(function(p){u[h][p]===void 0&&(u[h][p]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(function(d){return!d.done})}},{key:"read",value:function(r,o,s){var a=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,u=arguments.length>5?arguments[5]:void 0;if(!r.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:r,ns:o,fcName:s,tried:l,wait:c,callback:u});return}this.readingCalls++;var d=function(m,_){if(a.readingCalls--,a.waitingReads.length>0){var v=a.waitingReads.shift();a.read(v.lng,v.ns,v.fcName,v.tried,v.wait,v.callback)}if(m&&_&&l<a.maxRetries){setTimeout(function(){a.read.call(a,r,o,s,l+1,c*2,u)},c);return}u(m,_)},h=this.backend[s].bind(this.backend);if(h.length===2){try{var g=h(r,o);g&&typeof g.then=="function"?g.then(function(p){return d(null,p)}).catch(d):d(null,g)}catch(p){d(p)}return}return h(r,o,d)}},{key:"prepareLoading",value:function(r,o){var s=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof r=="string"&&(r=this.languageUtils.toResolveHierarchy(r)),typeof o=="string"&&(o=[o]);var c=this.queueLoad(r,o,a,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(function(u){s.loadOne(u)})}},{key:"load",value:function(r,o,s){this.prepareLoading(r,o,{},s)}},{key:"reload",value:function(r,o,s){this.prepareLoading(r,o,{reload:!0},s)}},{key:"loadOne",value:function(r){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=r.split("|"),l=a[0],c=a[1];this.read(l,c,"read",void 0,void 0,function(u,d){u&&o.logger.warn("".concat(s,"loading namespace ").concat(c," for language ").concat(l," failed"),u),!u&&d&&o.logger.log("".concat(s,"loaded namespace ").concat(c," for language ").concat(l),d),o.loaded(r,u,d)})}},{key:"saveMissing",value:function(r,o,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend&&this.backend.create){var d=tCe(tCe({},c),{},{isUpdate:l}),h=this.backend.create.bind(this.backend);if(h.length<6)try{var g;h.length===5?g=h(r,o,s,a,d):g=h(r,o,s,a),g&&typeof g.then=="function"?g.then(function(p){return u(null,p)}).catch(u):u(null,g)}catch(p){u(p)}else h(r,o,s,a,u,d)}!r||!r[0]||this.store.addResource(r[0],o,s,a)}}}]),t}(KC);function nCe(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if(Er(e[1])==="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),Er(e[2])==="object"||Er(e[3])==="object"){var i=e[3]||e[2];Object.keys(i).forEach(function(r){t[r]=i[r]})}return t},interpolation:{escapeValue:!0,format:function(e,t,i,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function iCe(n){return typeof n.ns=="string"&&(n.ns=[n.ns]),typeof n.fallbackLng=="string"&&(n.fallbackLng=[n.fallbackLng]),typeof n.fallbackNS=="string"&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs&&n.supportedLngs.indexOf("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),n}function rCe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function U_(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?rCe(Object(t),!0).forEach(function(i){$e(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):rCe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Qct(n){var e=Xct();return function(){var i=Pp(n),r;if(e){var o=Pp(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return M2(this,r)}}function Xct(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function a6(){}function Zct(n){var e=Object.getOwnPropertyNames(Object.getPrototypeOf(n));e.forEach(function(t){typeof n[t]=="function"&&(n[t]=n[t].bind(n))})}var F9=function(n){I_(t,n);var e=Qct(t);function t(){var i,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(Ua(this,t),i=e.call(this),az&&KC.call(Sr(i)),i.options=iCe(r),i.services={},i.logger=Iv,i.modules={external:[]},Zct(Sr(i)),o&&!i.isInitialized&&!r.isClone){if(!i.options.initImmediate)return i.init(r,o),M2(i,Sr(i));setTimeout(function(){i.init(r,o)},0)}return i}return qa(t,[{key:"init",value:function(){var r=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(s=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var a=nCe();this.options=U_(U_(U_({},a),this.options),iCe(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=U_(U_({},a.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(v){return v?typeof v=="function"?new v:v:null}if(!this.options.isClone){this.modules.logger?Iv.init(l(this.modules.logger),this.options):Iv.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=Uct);var u=new Y1e(this.options);this.store=new Pct(this.options.resources,this.options);var d=this.services;d.logger=Iv,d.resourceStore=this.store,d.languageUtils=u,d.pluralResolver=new Wct(u,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(d.formatter=l(c),d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new zct(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new Yct(l(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function(v){for(var b=arguments.length,y=new Array(b>1?b-1:0),C=1;C<b;C++)y[C-1]=arguments[C];r.emit.apply(r,[v].concat(y))}),this.modules.languageDetector&&(d.languageDetector=l(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=l(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new G1e(this.services,this.options),this.translator.on("*",function(v){for(var b=arguments.length,y=new Array(b>1?b-1:0),C=1;C<b;C++)y[C-1]=arguments[C];r.emit.apply(r,[v].concat(y))}),this.modules.external.forEach(function(v){v.init&&v.init(r)})}if(this.format=this.options.interpolation.format,s||(s=a6),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var g=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];g.forEach(function(v){r[v]=function(){var b;return(b=r.store)[v].apply(b,arguments)}});var p=["addResource","addResources","addResourceBundle","removeResourceBundle"];p.forEach(function(v){r[v]=function(){var b;return(b=r.store)[v].apply(b,arguments),r}});var m=hR(),_=function(){var b=function(C,x){r.isInitialized&&!r.initializedStoreOnce&&r.logger.warn("init: i18next is already initialized. You should call init just once!"),r.isInitialized=!0,r.options.isClone||r.logger.log("initialized",r.options),r.emit("initialized",r.options),m.resolve(x),s(C,x)};if(r.languages&&r.options.compatibilityAPI!=="v1"&&!r.isInitialized)return b(null,r.t.bind(r));r.changeLanguage(r.options.lng,b)};return this.options.resources||!this.options.initImmediate?_():setTimeout(_,0),m}},{key:"loadResources",value:function(r){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:a6,a=s,l=typeof r=="string"?r:this.language;if(typeof r=="function"&&(a=r),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var c=[],u=function(g){if(g){var p=o.services.languageUtils.toResolveHierarchy(g);p.forEach(function(m){c.indexOf(m)<0&&c.push(m)})}};if(l)u(l);else{var d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.forEach(function(h){return u(h)})}this.options.preload&&this.options.preload.forEach(function(h){return u(h)}),this.services.backendConnector.load(c,this.options.ns,function(h){!h&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),a(h)})}else a(null)}},{key:"reloadResources",value:function(r,o,s){var a=hR();return r||(r=this.languages),o||(o=this.options.ns),s||(s=a6),this.services.backendConnector.reload(r,o,function(l){a.resolve(),s(l)}),a}},{key:"use",value:function(r){if(!r)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!r.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return r.type==="backend"&&(this.modules.backend=r),(r.type==="logger"||r.log&&r.warn&&r.error)&&(this.modules.logger=r),r.type==="languageDetector"&&(this.modules.languageDetector=r),r.type==="i18nFormat"&&(this.modules.i18nFormat=r),r.type==="postProcessor"&&ZMe.addPostProcessor(r),r.type==="formatter"&&(this.modules.formatter=r),r.type==="3rdParty"&&this.modules.external.push(r),this}},{key:"setResolvedLanguage",value:function(r){if(!(!r||!this.languages)&&!(["cimode","dev"].indexOf(r)>-1))for(var o=0;o<this.languages.length;o++){var s=this.languages[o];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(r,o){var s=this;this.isLanguageChangingTo=r;var a=hR();this.emit("languageChanging",r);var l=function(h){s.language=h,s.languages=s.services.languageUtils.toResolveHierarchy(h),s.resolvedLanguage=void 0,s.setResolvedLanguage(h)},c=function(h,g){g?(l(g),s.translator.changeLanguage(g),s.isLanguageChangingTo=void 0,s.emit("languageChanged",g),s.logger.log("languageChanged",g)):s.isLanguageChangingTo=void 0,a.resolve(function(){return s.t.apply(s,arguments)}),o&&o(h,function(){return s.t.apply(s,arguments)})},u=function(h){!r&&!h&&s.services.languageDetector&&(h=[]);var g=typeof h=="string"?h:s.services.languageUtils.getBestMatchFromCodes(h);g&&(s.language||l(g),s.translator.language||s.translator.changeLanguage(g),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage&&s.services.languageDetector.cacheUserLanguage(g)),s.loadResources(g,function(p){c(p,g)})};return!r&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!r&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(u):this.services.languageDetector.detect(u):u(r),a}},{key:"getFixedT",value:function(r,o,s){var a=this,l=function c(u,d){var h;if(Er(d)!=="object"){for(var g=arguments.length,p=new Array(g>2?g-2:0),m=2;m<g;m++)p[m-2]=arguments[m];h=a.options.overloadTranslationOptionHandler([u,d].concat(p))}else h=U_({},d);h.lng=h.lng||c.lng,h.lngs=h.lngs||c.lngs,h.ns=h.ns||c.ns,h.keyPrefix=h.keyPrefix||s||c.keyPrefix;var _=a.options.keySeparator||".",v;return h.keyPrefix&&Array.isArray(u)?v=u.map(function(b){return"".concat(h.keyPrefix).concat(_).concat(b)}):v=h.keyPrefix?"".concat(h.keyPrefix).concat(_).concat(u):u,a.t(v,h)};return typeof r=="string"?l.lng=r:l.lngs=r,l.ns=o,l.keyPrefix=s,l}},{key:"t",value:function(){var r;return this.translator&&(r=this.translator).translate.apply(r,arguments)}},{key:"exists",value:function(){var r;return this.translator&&(r=this.translator).exists.apply(r,arguments)}},{key:"setDefaultNamespace",value:function(r){this.options.defaultNS=r}},{key:"hasLoadedNamespace",value:function(r){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=s.lng||this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var u=function(g,p){var m=o.services.backendConnector.state["".concat(g,"|").concat(p)];return m===-1||m===2};if(s.precheck){var d=s.precheck(this,u);if(d!==void 0)return d}return!!(this.hasResourceBundle(a,r)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(a,r)&&(!l||u(c,r)))}},{key:"loadNamespaces",value:function(r,o){var s=this,a=hR();return this.options.ns?(typeof r=="string"&&(r=[r]),r.forEach(function(l){s.options.ns.indexOf(l)<0&&s.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),o&&o(l)}),a):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(r,o){var s=hR();typeof r=="string"&&(r=[r]);var a=this.options.preload||[],l=r.filter(function(c){return a.indexOf(c)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(c){s.resolve(),o&&o(c)}),s):(o&&o(),Promise.resolve())}},{key:"dir",value:function(r){if(r||(r=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!r)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=this.services&&this.services.languageUtils||new Y1e(nCe());return o.indexOf(s.getLanguagePartFromCode(r))>-1||r.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var r=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:a6,a=U_(U_(U_({},this.options),o),{isClone:!0}),l=new t(a);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var c=["store","services","language"];return c.forEach(function(u){l[u]=r[u]}),l.services=U_({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new G1e(l.services,l.options),l.translator.on("*",function(u){for(var d=arguments.length,h=new Array(d>1?d-1:0),g=1;g<d;g++)h[g-1]=arguments[g];l.emit.apply(l,[u].concat(h))}),l.init(a,s),l.translator.options=l.options,l.translator.backendConnector.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),t}(KC);$e(F9,"createInstance",function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new F9(n,e)});var Rd=F9.createInstance();Rd.createInstance=F9.createInstance;Rd.createInstance;Rd.dir;Rd.init;Rd.loadResources;Rd.reloadResources;Rd.use;Rd.changeLanguage;Rd.getFixedT;var Wee=Rd.t;Rd.exists;Rd.setDefaultNamespace;Rd.hasLoadedNamespace;Rd.loadNamespaces;Rd.loadLanguages;/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function dt(n,e={}){let t=n;for(const i in e)t=t.replace(`:${i}`,e[i]);return t}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/var Di=(n=>(n.Active="active",n.Archived="archived",n.Deleted="deleted",n))(Di||{});/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const bY={[Di.Active]:"active",[Di.Archived]:"archived",[Di.Deleted]:"deleted"};var fde={exports:{}},JMe=function(e,t){return function(){for(var r=new Array(arguments.length),o=0;o<r.length;o++)r[o]=arguments[o];return e.apply(t,r)}},Jct=JMe,gde=Object.prototype.toString,pde=function(n){return function(e){var t=gde.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())}}(Object.create(null));function hk(n){return n=n.toLowerCase(),function(t){return pde(t)===n}}function mde(n){return Array.isArray(n)}function B9(n){return typeof n>"u"}function eut(n){return n!==null&&!B9(n)&&n.constructor!==null&&!B9(n.constructor)&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}var e4e=hk("ArrayBuffer");function tut(n){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&e4e(n.buffer),e}function nut(n){return typeof n=="string"}function iut(n){return typeof n=="number"}function t4e(n){return n!==null&&typeof n=="object"}function U$(n){if(pde(n)!=="object")return!1;var e=Object.getPrototypeOf(n);return e===null||e===Object.prototype}var rut=hk("Date"),out=hk("File"),sut=hk("Blob"),aut=hk("FileList");function _de(n){return gde.call(n)==="[object Function]"}function lut(n){return t4e(n)&&_de(n.pipe)}function cut(n){var e="[object FormData]";return n&&(typeof FormData=="function"&&n instanceof FormData||gde.call(n)===e||_de(n.toString)&&n.toString()===e)}var uut=hk("URLSearchParams");function dut(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function hut(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function vde(n,e){if(!(n===null||typeof n>"u"))if(typeof n!="object"&&(n=[n]),mde(n))for(var t=0,i=n.length;t<i;t++)e.call(null,n[t],t,n);else for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.call(null,n[r],r,n)}function zee(){var n={};function e(r,o){U$(n[o])&&U$(r)?n[o]=zee(n[o],r):U$(r)?n[o]=zee({},r):mde(r)?n[o]=r.slice():n[o]=r}for(var t=0,i=arguments.length;t<i;t++)vde(arguments[t],e);return n}function fut(n,e,t){return vde(e,function(r,o){t&&typeof r=="function"?n[o]=Jct(r,t):n[o]=r}),n}function gut(n){return n.charCodeAt(0)===65279&&(n=n.slice(1)),n}function put(n,e,t,i){n.prototype=Object.create(e.prototype,i),n.prototype.constructor=n,t&&Object.assign(n.prototype,t)}function mut(n,e,t){var i,r,o,s={};e=e||{};do{for(i=Object.getOwnPropertyNames(n),r=i.length;r-- >0;)o=i[r],s[o]||(e[o]=n[o],s[o]=!0);n=Object.getPrototypeOf(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e}function _ut(n,e,t){n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;var i=n.indexOf(e,t);return i!==-1&&i===t}function vut(n){if(!n)return null;var e=n.length;if(B9(e))return null;for(var t=new Array(e);e-- >0;)t[e]=n[e];return t}var but=function(n){return function(e){return n&&e instanceof n}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array)),Zu={isArray:mde,isArrayBuffer:e4e,isBuffer:eut,isFormData:cut,isArrayBufferView:tut,isString:nut,isNumber:iut,isObject:t4e,isPlainObject:U$,isUndefined:B9,isDate:rut,isFile:out,isBlob:sut,isFunction:_de,isStream:lut,isURLSearchParams:uut,isStandardBrowserEnv:hut,forEach:vde,merge:zee,extend:fut,trim:dut,stripBOM:gut,inherits:put,toFlatObject:mut,kindOf:pde,kindOfTest:hk,endsWith:_ut,toArray:vut,isTypedArray:but,isFileList:aut},gT=Zu;function oCe(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var n4e=function(e,t,i){if(!t)return e;var r;if(i)r=i(t);else if(gT.isURLSearchParams(t))r=t.toString();else{var o=[];gT.forEach(t,function(l,c){l===null||typeof l>"u"||(gT.isArray(l)?c=c+"[]":l=[l],gT.forEach(l,function(d){gT.isDate(d)?d=d.toISOString():gT.isObject(d)&&(d=JSON.stringify(d)),o.push(oCe(c)+"="+oCe(d))}))}),r=o.join("&")}if(r){var s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+r}return e},yut=Zu;function lz(){this.handlers=[]}lz.prototype.use=function(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1};lz.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};lz.prototype.forEach=function(e){yut.forEach(this.handlers,function(i){i!==null&&e(i)})};var Cut=lz,wut=Zu,Sut=function(e,t){wut.forEach(e,function(r,o){o!==t&&o.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[o])})},i4e=Zu;function oD(n,e,t,i,r){Error.call(this),this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),i&&(this.request=i),r&&(this.response=r)}i4e.inherits(oD,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 r4e=oD.prototype,o4e={};["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(n){o4e[n]={value:n}});Object.defineProperties(oD,o4e);Object.defineProperty(r4e,"isAxiosError",{value:!0});oD.from=function(n,e,t,i,r,o){var s=Object.create(r4e);return i4e.toFlatObject(n,s,function(l){return l!==Error.prototype}),oD.call(s,n.message,e,t,i,r),s.name=n.name,o&&Object.assign(s,o),s};var F2=oD,s4e={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_m=Zu;function Eut(n,e){e=e||new FormData;var t=[];function i(o){return o===null?"":_m.isDate(o)?o.toISOString():_m.isArrayBuffer(o)||_m.isTypedArray(o)?typeof Blob=="function"?new Blob([o]):Buffer.from(o):o}function r(o,s){if(_m.isPlainObject(o)||_m.isArray(o)){if(t.indexOf(o)!==-1)throw Error("Circular reference detected in "+s);t.push(o),_m.forEach(o,function(l,c){if(!_m.isUndefined(l)){var u=s?s+"."+c:c,d;if(l&&!s&&typeof l=="object"){if(_m.endsWith(c,"{}"))l=JSON.stringify(l);else if(_m.endsWith(c,"[]")&&(d=_m.toArray(l))){d.forEach(function(h){!_m.isUndefined(h)&&e.append(u,i(h))});return}}r(l,u)}}),t.pop()}else e.append(s,i(o))}return r(n),e}var a4e=Eut,yY,sCe;function xut(){if(sCe)return yY;sCe=1;var n=F2;return yY=function(t,i,r){var o=r.config.validateStatus;!r.status||!o||o(r.status)?t(r):i(new n("Request failed with status code "+r.status,[n.ERR_BAD_REQUEST,n.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))},yY}var CY,aCe;function kut(){if(aCe)return CY;aCe=1;var n=Zu;return CY=n.isStandardBrowserEnv()?function(){return{write:function(i,r,o,s,a,l){var c=[];c.push(i+"="+encodeURIComponent(r)),n.isNumber(o)&&c.push("expires="+new Date(o).toGMTString()),n.isString(s)&&c.push("path="+s),n.isString(a)&&c.push("domain="+a),l===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(i){var r=document.cookie.match(new RegExp("(^|;\\s*)("+i+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(i){this.write(i,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),CY}var Tut=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},Iut=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},Lut=Tut,Dut=Iut,l4e=function(e,t){return e&&!Lut(t)?Dut(e,t):t},wY,lCe;function Aut(){if(lCe)return wY;lCe=1;var n=Zu,e=["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"];return wY=function(i){var r={},o,s,a;return i&&n.forEach(i.split(`
`),function(c){if(a=c.indexOf(":"),o=n.trim(c.substr(0,a)).toLowerCase(),s=n.trim(c.substr(a+1)),o){if(r[o]&&e.indexOf(o)>=0)return;o==="set-cookie"?r[o]=(r[o]?r[o]:[]).concat([s]):r[o]=r[o]?r[o]+", "+s:s}}),r},wY}var SY,cCe;function Rut(){if(cCe)return SY;cCe=1;var n=Zu;return SY=n.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a"),r;function o(s){var a=s;return t&&(i.setAttribute("href",a),a=i.href),i.setAttribute("href",a),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return r=o(window.location.href),function(a){var l=n.isString(a)?o(a):a;return l.protocol===r.protocol&&l.host===r.host}}():function(){return function(){return!0}}(),SY}var EY,uCe;function cz(){if(uCe)return EY;uCe=1;var n=F2,e=Zu;function t(i){n.call(this,i??"canceled",n.ERR_CANCELED),this.name="CanceledError"}return e.inherits(t,n,{__CANCEL__:!0}),EY=t,EY}var xY,dCe;function Nut(){return dCe||(dCe=1,xY=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}),xY}var kY,hCe;function fCe(){if(hCe)return kY;hCe=1;var n=Zu,e=xut(),t=kut(),i=n4e,r=l4e,o=Aut(),s=Rut(),a=s4e,l=F2,c=cz(),u=Nut();return kY=function(h){return new Promise(function(p,m){var _=h.data,v=h.headers,b=h.responseType,y;function C(){h.cancelToken&&h.cancelToken.unsubscribe(y),h.signal&&h.signal.removeEventListener("abort",y)}n.isFormData(_)&&n.isStandardBrowserEnv()&&delete v["Content-Type"];var x=new XMLHttpRequest;if(h.auth){var k=h.auth.username||"",I=h.auth.password?unescape(encodeURIComponent(h.auth.password)):"";v.Authorization="Basic "+btoa(k+":"+I)}var L=r(h.baseURL,h.url);x.open(h.method.toUpperCase(),i(L,h.params,h.paramsSerializer),!0),x.timeout=h.timeout;function D(){if(x){var M="getAllResponseHeaders"in x?o(x.getAllResponseHeaders()):null,O=!b||b==="text"||b==="json"?x.responseText:x.response,B={data:O,status:x.status,statusText:x.statusText,headers:M,config:h,request:x};e(function(H){p(H),C()},function(H){m(H),C()},B),x=null}}if("onloadend"in x?x.onloadend=D:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(D)},x.onabort=function(){x&&(m(new l("Request aborted",l.ECONNABORTED,h,x)),x=null)},x.onerror=function(){m(new l("Network Error",l.ERR_NETWORK,h,x,x)),x=null},x.ontimeout=function(){var O=h.timeout?"timeout of "+h.timeout+"ms exceeded":"timeout exceeded",B=h.transitional||a;h.timeoutErrorMessage&&(O=h.timeoutErrorMessage),m(new l(O,B.clarifyTimeoutError?l.ETIMEDOUT:l.ECONNABORTED,h,x)),x=null},n.isStandardBrowserEnv()){var R=(h.withCredentials||s(L))&&h.xsrfCookieName?t.read(h.xsrfCookieName):void 0;R&&(v[h.xsrfHeaderName]=R)}"setRequestHeader"in x&&n.forEach(v,function(O,B){typeof _>"u"&&B.toLowerCase()==="content-type"?delete v[B]:x.setRequestHeader(B,O)}),n.isUndefined(h.withCredentials)||(x.withCredentials=!!h.withCredentials),b&&b!=="json"&&(x.responseType=h.responseType),typeof h.onDownloadProgress=="function"&&x.addEventListener("progress",h.onDownloadProgress),typeof h.onUploadProgress=="function"&&x.upload&&x.upload.addEventListener("progress",h.onUploadProgress),(h.cancelToken||h.signal)&&(y=function(M){x&&(m(!M||M&&M.type?new c:M),x.abort(),x=null)},h.cancelToken&&h.cancelToken.subscribe(y),h.signal&&(h.signal.aborted?y():h.signal.addEventListener("abort",y))),_||(_=null);var P=u(L);if(P&&["http","https","file"].indexOf(P)===-1){m(new l("Unsupported protocol "+P+":",l.ERR_BAD_REQUEST,h));return}x.send(_)})},kY}var TY,gCe;function Out(){return gCe||(gCe=1,TY=null),TY}var Zc=Zu,pCe=Sut,mCe=F2,Put=s4e,Mut=a4e,Fut={"Content-Type":"application/x-www-form-urlencoded"};function _Ce(n,e){!Zc.isUndefined(n)&&Zc.isUndefined(n["Content-Type"])&&(n["Content-Type"]=e)}function But(){var n;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(n=fCe()),n}function $ut(n,e,t){if(Zc.isString(n))try{return(e||JSON.parse)(n),Zc.trim(n)}catch(i){if(i.name!=="SyntaxError")throw i}return(t||JSON.stringify)(n)}var uz={transitional:Put,adapter:But(),transformRequest:[function(e,t){if(pCe(t,"Accept"),pCe(t,"Content-Type"),Zc.isFormData(e)||Zc.isArrayBuffer(e)||Zc.isBuffer(e)||Zc.isStream(e)||Zc.isFile(e)||Zc.isBlob(e))return e;if(Zc.isArrayBufferView(e))return e.buffer;if(Zc.isURLSearchParams(e))return _Ce(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var i=Zc.isObject(e),r=t&&t["Content-Type"],o;if((o=Zc.isFileList(e))||i&&r==="multipart/form-data"){var s=this.env&&this.env.FormData;return Mut(o?{"files[]":e}:e,s&&new s)}else if(i||r==="application/json")return _Ce(t,"application/json"),$ut(e);return e}],transformResponse:[function(e){var t=this.transitional||uz.transitional,i=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,o=!i&&this.responseType==="json";if(o||r&&Zc.isString(e)&&e.length)try{return JSON.parse(e)}catch(s){if(o)throw s.name==="SyntaxError"?mCe.from(s,mCe.ERR_BAD_RESPONSE,this,null,this.response):s}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Out()},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Zc.forEach(["delete","get","head"],function(e){uz.headers[e]={}});Zc.forEach(["post","put","patch"],function(e){uz.headers[e]=Zc.merge(Fut)});var bde=uz,Vut=Zu,Hut=bde,Wut=function(e,t,i){var r=this||Hut;return Vut.forEach(i,function(s){e=s.call(r,e,t)}),e},IY,vCe;function c4e(){return vCe||(vCe=1,IY=function(e){return!!(e&&e.__CANCEL__)}),IY}var bCe=Zu,LY=Wut,zut=c4e(),jut=bde,Uut=cz();function DY(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Uut}var qut=function(e){DY(e),e.headers=e.headers||{},e.data=LY.call(e,e.data,e.headers,e.transformRequest),e.headers=bCe.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),bCe.forEach(["delete","get","head","post","put","patch","common"],function(r){delete e.headers[r]});var t=e.adapter||jut.adapter;return t(e).then(function(r){return DY(e),r.data=LY.call(e,r.data,r.headers,e.transformResponse),r},function(r){return zut(r)||(DY(e),r&&r.response&&(r.response.data=LY.call(e,r.response.data,r.response.headers,e.transformResponse))),Promise.reject(r)})},Df=Zu,u4e=function(e,t){t=t||{};var i={};function r(u,d){return Df.isPlainObject(u)&&Df.isPlainObject(d)?Df.merge(u,d):Df.isPlainObject(d)?Df.merge({},d):Df.isArray(d)?d.slice():d}function o(u){if(Df.isUndefined(t[u])){if(!Df.isUndefined(e[u]))return r(void 0,e[u])}else return r(e[u],t[u])}function s(u){if(!Df.isUndefined(t[u]))return r(void 0,t[u])}function a(u){if(Df.isUndefined(t[u])){if(!Df.isUndefined(e[u]))return r(void 0,e[u])}else return r(void 0,t[u])}function l(u){if(u in t)return r(e[u],t[u]);if(u in e)return r(void 0,e[u])}var c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l};return Df.forEach(Object.keys(e).concat(Object.keys(t)),function(d){var h=c[d]||o,g=h(d);Df.isUndefined(g)&&h!==l||(i[d]=g)}),i},AY,yCe;function d4e(){return yCe||(yCe=1,AY={version:"0.27.2"}),AY}var Kut=d4e().version,v1=F2,yde={};["object","boolean","number","function","string","symbol"].forEach(function(n,e){yde[n]=function(i){return typeof i===n||"a"+(e<1?"n ":" ")+n}});var CCe={};yde.transitional=function(e,t,i){function r(o,s){return"[Axios v"+Kut+"] Transitional option '"+o+"'"+s+(i?". "+i:"")}return function(o,s,a){if(e===!1)throw new v1(r(s," has been removed"+(t?" in "+t:"")),v1.ERR_DEPRECATED);return t&&!CCe[s]&&(CCe[s]=!0,console.warn(r(s," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(o,s,a):!0}};function Gut(n,e,t){if(typeof n!="object")throw new v1("options must be an object",v1.ERR_BAD_OPTION_VALUE);for(var i=Object.keys(n),r=i.length;r-- >0;){var o=i[r],s=e[o];if(s){var a=n[o],l=a===void 0||s(a,o,n);if(l!==!0)throw new v1("option "+o+" must be "+l,v1.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new v1("Unknown option "+o,v1.ERR_BAD_OPTION)}}var Yut={assertOptions:Gut,validators:yde},h4e=Zu,Qut=n4e,wCe=Cut,SCe=qut,dz=u4e,Xut=l4e,f4e=Yut,pT=f4e.validators;function sD(n){this.defaults=n,this.interceptors={request:new wCe,response:new wCe}}sD.prototype.request=function(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=dz(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var i=t.transitional;i!==void 0&&f4e.assertOptions(i,{silentJSONParsing:pT.transitional(pT.boolean),forcedJSONParsing:pT.transitional(pT.boolean),clarifyTimeoutError:pT.transitional(pT.boolean)},!1);var r=[],o=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(t)===!1||(o=o&&g.synchronous,r.unshift(g.fulfilled,g.rejected))});var s=[];this.interceptors.response.forEach(function(g){s.push(g.fulfilled,g.rejected)});var a;if(!o){var l=[SCe,void 0];for(Array.prototype.unshift.apply(l,r),l=l.concat(s),a=Promise.resolve(t);l.length;)a=a.then(l.shift(),l.shift());return a}for(var c=t;r.length;){var u=r.shift(),d=r.shift();try{c=u(c)}catch(h){d(h);break}}try{a=SCe(c)}catch(h){return Promise.reject(h)}for(;s.length;)a=a.then(s.shift(),s.shift());return a};sD.prototype.getUri=function(e){e=dz(this.defaults,e);var t=Xut(e.baseURL,e.url);return Qut(t,e.params,e.paramsSerializer)};h4e.forEach(["delete","get","head","options"],function(e){sD.prototype[e]=function(t,i){return this.request(dz(i||{},{method:e,url:t,data:(i||{}).data}))}});h4e.forEach(["post","put","patch"],function(e){function t(i){return function(o,s,a){return this.request(dz(a||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}sD.prototype[e]=t(),sD.prototype[e+"Form"]=t(!0)});var Zut=sD,RY,ECe;function Jut(){if(ECe)return RY;ECe=1;var n=cz();function e(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var i;this.promise=new Promise(function(s){i=s});var r=this;this.promise.then(function(o){if(r._listeners){var s,a=r._listeners.length;for(s=0;s<a;s++)r._listeners[s](o);r._listeners=null}}),this.promise.then=function(o){var s,a=new Promise(function(l){r.subscribe(l),s=l}).then(o);return a.cancel=function(){r.unsubscribe(s)},a},t(function(s){r.reason||(r.reason=new n(s),i(r.reason))})}return e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},e.prototype.subscribe=function(i){if(this.reason){i(this.reason);return}this._listeners?this._listeners.push(i):this._listeners=[i]},e.prototype.unsubscribe=function(i){if(this._listeners){var r=this._listeners.indexOf(i);r!==-1&&this._listeners.splice(r,1)}},e.source=function(){var i,r=new e(function(s){i=s});return{token:r,cancel:i}},RY=e,RY}var NY,xCe;function edt(){return xCe||(xCe=1,NY=function(e){return function(i){return e.apply(null,i)}}),NY}var OY,kCe;function tdt(){if(kCe)return OY;kCe=1;var n=Zu;return OY=function(t){return n.isObject(t)&&t.isAxiosError===!0},OY}var TCe=Zu,ndt=JMe,q$=Zut,idt=u4e,rdt=bde;function g4e(n){var e=new q$(n),t=ndt(q$.prototype.request,e);return TCe.extend(t,q$.prototype,e),TCe.extend(t,e),t.create=function(r){return g4e(idt(n,r))},t}var rf=g4e(rdt);rf.Axios=q$;rf.CanceledError=cz();rf.CancelToken=Jut();rf.isCancel=c4e();rf.VERSION=d4e().version;rf.toFormData=a4e;rf.AxiosError=F2;rf.Cancel=rf.CanceledError;rf.all=function(e){return Promise.all(e)};rf.spread=edt();rf.isAxiosError=tdt();fde.exports=rf;fde.exports.default=rf;var odt=fde.exports,sdt=odt;const p4e=ja(sdt);/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function fx(){return{"X-Api-Token":localStorage.getItem("X-NINJA-TOKEN"),"X-Requested-With":"XMLHttpRequest","X-React":"true"}}let adt={data:""},ldt=n=>typeof window=="object"?((n?n.querySelector("#_goober"):window._goober)||Object.assign((n||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:n||adt,cdt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,udt=/\/\*[^]*?\*\/| +/g,ICe=/\n+/g,I1=(n,e)=>{let t="",i="",r="";for(let o in n){let s=n[o];o[0]=="@"?o[1]=="i"?t=o+" "+s+";":i+=o[1]=="f"?I1(s,o):o+"{"+I1(s,o[1]=="k"?"":e)+"}":typeof s=="object"?i+=I1(s,e?e.replace(/([^,])+/g,a=>o.replace(/(^:.*)|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):o):s!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),r+=I1.p?I1.p(o,s):o+":"+s+";")}return t+(e&&r?e+"{"+r+"}":r)+i},zb={},m4e=n=>{if(typeof n=="object"){let e="";for(let t in n)e+=t+m4e(n[t]);return e}return n},ddt=(n,e,t,i,r)=>{let o=m4e(n),s=zb[o]||(zb[o]=(l=>{let c=0,u=11;for(;c<l.length;)u=101*u+l.charCodeAt(c++)>>>0;return"go"+u})(o));if(!zb[s]){let l=o!==n?n:(c=>{let u,d,h=[{}];for(;u=cdt.exec(c.replace(udt,""));)u[4]?h.shift():u[3]?(d=u[3].replace(ICe," ").trim(),h.unshift(h[0][d]=h[0][d]||{})):h[0][u[1]]=u[2].replace(ICe," ").trim();return h[0]})(n);zb[s]=I1(r?{["@keyframes "+s]:l}:l,t?"":"."+s)}let a=t&&zb.g?zb.g:null;return t&&(zb.g=zb[s]),((l,c,u,d)=>{d?c.data=c.data.replace(d,l):c.data.indexOf(l)===-1&&(c.data=u?l+c.data:c.data+l)})(zb[s],e,i,a),s},hdt=(n,e,t)=>n.reduce((i,r,o)=>{let s=e[o];if(s&&s.call){let a=s(t),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;s=l?"."+l:a&&typeof a=="object"?a.props?"":I1(a,""):a===!1?"":a}return i+r+(s??"")},"");function hz(n){let e=this||{},t=n.call?n(e.p):n;return ddt(t.unshift?t.raw?hdt(t,[].slice.call(arguments,1),e.p):t.reduce((i,r)=>Object.assign(i,r&&r.call?r(e.p):r),{}):t,ldt(e.target),e.g,e.o,e.k)}let _4e,jee,Uee;hz.bind({g:1});let c0=hz.bind({k:1});function fdt(n,e,t,i){I1.p=e,_4e=n,jee=t,Uee=i}function Ow(n,e){let t=this||{};return function(){let i=arguments;function r(o,s){let a=Object.assign({},o),l=a.className||r.className;t.p=Object.assign({theme:jee&&jee()},a),t.o=/ *go\d+/.test(l),a.className=hz.apply(t,i)+(l?" "+l:""),e&&(a.ref=s);let c=n;return n[0]&&(c=a.as||n,delete a.as),Uee&&c[0]&&Uee(a),_4e(c,a)}return e?e(r):r}}var gdt=n=>typeof n=="function",$9=(n,e)=>gdt(n)?n(e):n,pdt=(()=>{let n=0;return()=>(++n).toString()})(),v4e=(()=>{let n;return()=>{if(n===void 0&&typeof window<"u"){let e=matchMedia("(prefers-reduced-motion: reduce)");n=!e||e.matches}return n}})(),mdt=20,K$=new Map,_dt=1e3,LCe=n=>{if(K$.has(n))return;let e=setTimeout(()=>{K$.delete(n),fk({type:4,toastId:n})},_dt);K$.set(n,e)},vdt=n=>{let e=K$.get(n);e&&clearTimeout(e)},qee=(n,e)=>{switch(e.type){case 0:return{...n,toasts:[e.toast,...n.toasts].slice(0,mdt)};case 1:return e.toast.id&&vdt(e.toast.id),{...n,toasts:n.toasts.map(o=>o.id===e.toast.id?{...o,...e.toast}:o)};case 2:let{toast:t}=e;return n.toasts.find(o=>o.id===t.id)?qee(n,{type:1,toast:t}):qee(n,{type:0,toast:t});case 3:let{toastId:i}=e;return i?LCe(i):n.toasts.forEach(o=>{LCe(o.id)}),{...n,toasts:n.toasts.map(o=>o.id===i||i===void 0?{...o,visible:!1}:o)};case 4:return e.toastId===void 0?{...n,toasts:[]}:{...n,toasts:n.toasts.filter(o=>o.id!==e.toastId)};case 5:return{...n,pausedAt:e.time};case 6:let r=e.time-(n.pausedAt||0);return{...n,pausedAt:void 0,toasts:n.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+r}))}}},G$=[],Y$={toasts:[],pausedAt:void 0},fk=n=>{Y$=qee(Y$,n),G$.forEach(e=>{e(Y$)})},bdt={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},ydt=(n={})=>{let[e,t]=w.useState(Y$);w.useEffect(()=>(G$.push(t),()=>{let r=G$.indexOf(t);r>-1&&G$.splice(r,1)}),[e]);let i=e.toasts.map(r=>{var o,s;return{...n,...n[r.type],...r,duration:r.duration||((o=n[r.type])==null?void 0:o.duration)||(n==null?void 0:n.duration)||bdt[r.type],style:{...n.style,...(s=n[r.type])==null?void 0:s.style,...r.style}}});return{...e,toasts:i}},Cdt=(n,e="blank",t)=>({createdAt:Date.now(),visible:!0,type:e,ariaProps:{role:"status","aria-live":"polite"},message:n,pauseDuration:0,...t,id:(t==null?void 0:t.id)||pdt()}),Z4=n=>(e,t)=>{let i=Cdt(e,n,t);return fk({type:2,toast:i}),i.id},Pu=(n,e)=>Z4("blank")(n,e);Pu.error=Z4("error");Pu.success=Z4("success");Pu.loading=Z4("loading");Pu.custom=Z4("custom");Pu.dismiss=n=>{fk({type:3,toastId:n})};Pu.remove=n=>fk({type:4,toastId:n});Pu.promise=(n,e,t)=>{let i=Pu.loading(e.loading,{...t,...t==null?void 0:t.loading});return n.then(r=>(Pu.success($9(e.success,r),{id:i,...t,...t==null?void 0:t.success}),r)).catch(r=>{Pu.error($9(e.error,r),{id:i,...t,...t==null?void 0:t.error})}),n};var wdt=(n,e)=>{fk({type:1,toast:{id:n,height:e}})},Sdt=()=>{fk({type:5,time:Date.now()})},Edt=n=>{let{toasts:e,pausedAt:t}=ydt(n);w.useEffect(()=>{if(t)return;let o=Date.now(),s=e.map(a=>{if(a.duration===1/0)return;let l=(a.duration||0)+a.pauseDuration-(o-a.createdAt);if(l<0){a.visible&&Pu.dismiss(a.id);return}return setTimeout(()=>Pu.dismiss(a.id),l)});return()=>{s.forEach(a=>a&&clearTimeout(a))}},[e,t]);let i=w.useCallback(()=>{t&&fk({type:6,time:Date.now()})},[t]),r=w.useCallback((o,s)=>{let{reverseOrder:a=!1,gutter:l=8,defaultPosition:c}=s||{},u=e.filter(g=>(g.position||c)===(o.position||c)&&g.height),d=u.findIndex(g=>g.id===o.id),h=u.filter((g,p)=>p<d&&g.visible).length;return u.filter(g=>g.visible).slice(...a?[h+1]:[0,h]).reduce((g,p)=>g+(p.height||0)+l,0)},[e]);return{toasts:e,handlers:{updateHeight:wdt,startPause:Sdt,endPause:i,calculateOffset:r}}},xdt=c0`
from {
transform: scale(0) rotate(45deg);
opacity: 0;
}
to {
transform: scale(1) rotate(45deg);
opacity: 1;
}`,kdt=c0`
from {
transform: scale(0);
opacity: 0;
}
to {
transform: scale(1);
opacity: 1;
}`,Tdt=c0`
from {
transform: scale(0) rotate(90deg);
opacity: 0;
}
to {
transform: scale(1) rotate(90deg);
opacity: 1;
}`,Idt=Ow("div")`
width: 20px;
opacity: 0;
height: 20px;
border-radius: 10px;
background: ${n=>n.primary||"#ff4b4b"};
position: relative;
transform: rotate(45deg);
animation: ${xdt} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
animation-delay: 100ms;
&:after,
&:before {
content: '';
animation: ${kdt} 0.15s ease-out forwards;
animation-delay: 150ms;
position: absolute;
border-radius: 3px;
opacity: 0;
background: ${n=>n.secondary||"#fff"};
bottom: 9px;
left: 4px;
height: 2px;
width: 12px;
}
&:before {
animation: ${Tdt} 0.15s ease-out forwards;
animation-delay: 180ms;
transform: rotate(90deg);
}
`,Ldt=c0`
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
`,Ddt=Ow("div")`
width: 12px;
height: 12px;
box-sizing: border-box;
border: 2px solid;
border-radius: 100%;
border-color: ${n=>n.secondary||"#e0e0e0"};
border-right-color: ${n=>n.primary||"#616161"};
animation: ${Ldt} 1s linear infinite;
`,Adt=c0`
from {
transform: scale(0) rotate(45deg);
opacity: 0;
}
to {
transform: scale(1) rotate(45deg);
opacity: 1;
}`,Rdt=c0`
0% {
height: 0;
width: 0;
opacity: 0;
}
40% {
height: 0;
width: 6px;
opacity: 1;
}
100% {
opacity: 1;
height: 10px;
}`,Ndt=Ow("div")`
width: 20px;
opacity: 0;
height: 20px;
border-radius: 10px;
background: ${n=>n.primary||"#61d345"};
position: relative;
transform: rotate(45deg);
animation: ${Adt} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
animation-delay: 100ms;
&:after {
content: '';
box-sizing: border-box;
animation: ${Rdt} 0.2s ease-out forwards;
opacity: 0;
animation-delay: 200ms;
position: absolute;
border-right: 2px solid;
border-bottom: 2px solid;
border-color: ${n=>n.secondary||"#fff"};
bottom: 6px;
left: 6px;
height: 10px;
width: 6px;
}
`,Odt=Ow("div")`
position: absolute;
`,Pdt=Ow("div")`
position: relative;
display: flex;
justify-content: center;
align-items: center;
min-width: 20px;
min-height: 20px;
`,Mdt=c0`
from {
transform: scale(0.6);
opacity: 0.4;
}
to {
transform: scale(1);
opacity: 1;
}`,Fdt=Ow("div")`
position: relative;
transform: scale(0.6);
opacity: 0.4;
min-width: 20px;
animation: ${Mdt} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
forwards;
`,Bdt=({toast:n})=>{let{icon:e,type:t,iconTheme:i}=n;return e!==void 0?typeof e=="string"?w.createElement(Fdt,null,e):e:t==="blank"?null:w.createElement(Pdt,null,w.createElement(Ddt,{...i}),t!=="loading"&&w.createElement(Odt,null,t==="error"?w.createElement(Idt,{...i}):w.createElement(Ndt,{...i})))},$dt=n=>`
0% {transform: translate3d(0,${n*-200}%,0) scale(.6); opacity:.5;}
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
`,Vdt=n=>`
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
100% {transform: translate3d(0,${n*-150}%,-1px) scale(.6); opacity:0;}
`,Hdt="0%{opacity:0;} 100%{opacity:1;}",Wdt="0%{opacity:1;} 100%{opacity:0;}",zdt=Ow("div")`
display: flex;
align-items: center;
background: #fff;
color: #363636;
line-height: 1.3;
will-change: transform;
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
max-width: 350px;
pointer-events: auto;
padding: 8px 10px;
border-radius: 8px;
`,jdt=Ow("div")`
display: flex;
justify-content: center;
margin: 4px 10px;
color: inherit;
flex: 1 1 auto;
white-space: pre-line;
`,Udt=(n,e)=>{let t=n.includes("top")?1:-1,[i,r]=v4e()?[Hdt,Wdt]:[$dt(t),Vdt(t)];return{animation:e?`${c0(i)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${c0(r)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},qdt=w.memo(({toast:n,position:e,style:t,children:i})=>{let r=n.height?Udt(n.position||e||"top-center",n.visible):{opacity:0},o=w.createElement(Bdt,{toast:n}),s=w.createElement(jdt,{...n.ariaProps},$9(n.message,n));return w.createElement(zdt,{className:n.className,style:{...r,...t,...n.style}},typeof i=="function"?i({icon:o,message:s}):w.createElement(w.Fragment,null,o,s))});fdt(w.createElement);var Kdt=({id:n,className:e,style:t,onHeightUpdate:i,children:r})=>{let o=w.useCallback(s=>{if(s){let a=()=>{let l=s.getBoundingClientRect().height;i(n,l)};a(),new MutationObserver(a).observe(s,{subtree:!0,childList:!0,characterData:!0})}},[n,i]);return w.createElement("div",{ref:o,className:e,style:t},r)},Gdt=(n,e)=>{let t=n.includes("top"),i=t?{top:0}:{bottom:0},r=n.includes("center")?{justifyContent:"center"}:n.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:v4e()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${e*(t?1:-1)}px)`,...i,...r}},Ydt=hz`
z-index: 9999;
> * {
pointer-events: auto;
}
`,l6=16,Qdt=({reverseOrder:n,position:e="top-center",toastOptions:t,gutter:i,children:r,containerStyle:o,containerClassName:s})=>{let{toasts:a,handlers:l}=Edt(t);return w.createElement("div",{style:{position:"fixed",zIndex:9999,top:l6,left:l6,right:l6,bottom:l6,pointerEvents:"none",...o},className:s,onMouseEnter:l.startPause,onMouseLeave:l.endPause},a.map(c=>{let u=c.position||e,d=l.calculateOffset(c,{reverseOrder:n,gutter:i,defaultPosition:e}),h=Gdt(u,d);return w.createElement(Kdt,{id:c.id,key:c.id,onHeightUpdate:l.updateHeight,className:c.visible?Ydt:"",style:h},c.type==="custom"?$9(c.message,c):r?r(c):w.createElement(qdt,{toast:c,position:u}))}))},Xdt=Pu;/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/class Zdt{processing(){return this.currentId=Pu.loading(Wee("processing",{}),{id:this.currentId}),this}success(e="success",t={}){return this.currentId=Pu.success(Ds(e,t),{id:this.currentId}),this}error(e="error_title"){return this.currentId=Pu.error(Wee(e),{id:this.currentId}),this}dismiss(){return Pu.dismiss(this.currentId),this}}const ie=new Zdt;function J4(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,O9(n,e)}var e3=function(){function n(){this.listeners=[]}var e=n.prototype;return e.subscribe=function(i){var r=this,o=i||function(){};return this.listeners.push(o),this.onSubscribe(),function(){r.listeners=r.listeners.filter(function(s){return s!==o}),r.onUnsubscribe()}},e.hasListeners=function(){return this.listeners.length>0},e.onSubscribe=function(){},e.onUnsubscribe=function(){},n}(),V9=typeof window>"u";function pd(){}function Jdt(n,e){return typeof n=="function"?n(e):n}function Kee(n){return typeof n=="number"&&n>=0&&n!==1/0}function H9(n){return Array.isArray(n)?n:[n]}function b4e(n,e){return Math.max(n+(e||0)-Date.now(),0)}function Q$(n,e,t){return fz(n)?typeof e=="function"?rt({},t,{queryKey:n,queryFn:e}):rt({},e,{queryKey:n}):n}function b1(n,e,t){return fz(n)?[rt({},e,{queryKey:n}),t]:[n||{},e]}function eht(n,e){if(n===!0&&e===!0||n==null&&e==null)return"all";if(n===!1&&e===!1)return"none";var t=n??!e;return t?"active":"inactive"}function DCe(n,e){var t=n.active,i=n.exact,r=n.fetching,o=n.inactive,s=n.predicate,a=n.queryKey,l=n.stale;if(fz(a)){if(i){if(e.queryHash!==Cde(a,e.options))return!1}else if(!W9(e.queryKey,a))return!1}var c=eht(t,o);if(c==="none")return!1;if(c!=="all"){var u=e.isActive();if(c==="active"&&!u||c==="inactive"&&u)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||typeof r=="boolean"&&e.isFetching()!==r||s&&!s(e))}function ACe(n,e){var t=n.exact,i=n.fetching,r=n.predicate,o=n.mutationKey;if(fz(o)){if(!e.options.mutationKey)return!1;if(t){if(vE(e.options.mutationKey)!==vE(o))return!1}else if(!W9(e.options.mutationKey,o))return!1}return!(typeof i=="boolean"&&e.state.status==="loading"!==i||r&&!r(e))}function Cde(n,e){var t=(e==null?void 0:e.queryKeyHashFn)||vE;return t(n)}function vE(n){var e=H9(n);return tht(e)}function tht(n){return JSON.stringify(n,function(e,t){return Gee(t)?Object.keys(t).sort().reduce(function(i,r){return i[r]=t[r],i},{}):t})}function W9(n,e){return y4e(H9(n),H9(e))}function y4e(n,e){return n===e?!0:typeof n!=typeof e?!1:n&&e&&typeof n=="object"&&typeof e=="object"?!Object.keys(e).some(function(t){return!y4e(n[t],e[t])}):!1}function z9(n,e){if(n===e)return n;var t=Array.isArray(n)&&Array.isArray(e);if(t||Gee(n)&&Gee(e)){for(var i=t?n.length:Object.keys(n).length,r=t?e:Object.keys(e),o=r.length,s=t?[]:{},a=0,l=0;l<o;l++){var c=t?l:r[l];s[c]=z9(n[c],e[c]),s[c]===n[c]&&a++}return i===o&&a===i?n:s}return e}function nht(n,e){if(n&&!e||e&&!n)return!1;for(var t in n)if(n[t]!==e[t])return!1;return!0}function Gee(n){if(!RCe(n))return!1;var e=n.constructor;if(typeof e>"u")return!0;var t=e.prototype;return!(!RCe(t)||!t.hasOwnProperty("isPrototypeOf"))}function RCe(n){return Object.prototype.toString.call(n)==="[object Object]"}function fz(n){return typeof n=="string"||Array.isArray(n)}function iht(n){return new Promise(function(e){setTimeout(e,n)})}function NCe(n){Promise.resolve().then(n).catch(function(e){return setTimeout(function(){throw e})})}function C4e(){if(typeof AbortController=="function")return new AbortController}var rht=function(n){J4(e,n);function e(){var i;return i=n.call(this)||this,i.setup=function(r){var o;if(!V9&&((o=window)!=null&&o.addEventListener)){var s=function(){return r()};return window.addEventListener("visibilitychange",s,!1),window.addEventListener("focus",s,!1),function(){window.removeEventListener("visibilitychange",s),window.removeEventListener("focus",s)}}},i}var t=e.prototype;return t.onSubscribe=function(){this.cleanup||this.setEventListener(this.setup)},t.onUnsubscribe=function(){if(!this.hasListeners()){var r;(r=this.cleanup)==null||r.call(this),this.cleanup=void 0}},t.setEventListener=function(r){var o,s=this;this.setup=r,(o=this.cleanup)==null||o.call(this),this.cleanup=r(function(a){typeof a=="boolean"?s.setFocused(a):s.onFocus()})},t.setFocused=function(r){this.focused=r,r&&this.onFocus()},t.onFocus=function(){this.listeners.forEach(function(r){r()})},t.isFocused=function(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)},e}(e3),nO=new rht,oht=function(n){J4(e,n);function e(){var i;return i=n.call(this)||this,i.setup=function(r){var o;if(!V9&&((o=window)!=null&&o.addEventListener)){var s=function(){return r()};return window.addEventListener("online",s,!1),window.addEventListener("offline",s,!1),function(){window.removeEventListener("online",s),window.removeEventListener("offline",s)}}},i}var t=e.prototype;return t.onSubscribe=function(){this.cleanup||this.setEventListener(this.setup)},t.onUnsubscribe=function(){if(!this.hasListeners()){var r;(r=this.cleanup)==null||r.call(this),this.cleanup=void 0}},t.setEventListener=function(r){var o,s=this;this.setup=r,(o=this.cleanup)==null||o.call(this),this.cleanup=r(function(a){typeof a=="boolean"?s.setOnline(a):s.onOnline()})},t.setOnline=function(r){this.online=r,r&&this.onOnline()},t.onOnline=function(){this.listeners.forEach(function(r){r()})},t.isOnline=function(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine},e}(e3),X$=new oht;function sht(n){return Math.min(1e3*Math.pow(2,n),3e4)}function j9(n){return typeof(n==null?void 0:n.cancel)=="function"}var w4e=function(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent};function Z$(n){return n instanceof w4e}var S4e=function(e){var t=this,i=!1,r,o,s,a;this.abort=e.abort,this.cancel=function(h){return r==null?void 0:r(h)},this.cancelRetry=function(){i=!0},this.continueRetry=function(){i=!1},this.continue=function(){return o==null?void 0:o()},this.failureCount=0,this.isPaused=!1,this.isResolved=!1,this.isTransportCancelable=!1,this.promise=new Promise(function(h,g){s=h,a=g});var l=function(g){t.isResolved||(t.isResolved=!0,e.onSuccess==null||e.onSuccess(g),o==null||o(),s(g))},c=function(g){t.isResolved||(t.isResolved=!0,e.onError==null||e.onError(g),o==null||o(),a(g))},u=function(){return new Promise(function(g){o=g,t.isPaused=!0,e.onPause==null||e.onPause()}).then(function(){o=void 0,t.isPaused=!1,e.onContinue==null||e.onContinue()})},d=function h(){if(!t.isResolved){var g;try{g=e.fn()}catch(p){g=Promise.reject(p)}r=function(m){if(!t.isResolved&&(c(new w4e(m)),t.abort==null||t.abort(),j9(g)))try{g.cancel()}catch{}},t.isTransportCancelable=j9(g),Promise.resolve(g).then(l).catch(function(p){var m,_;if(!t.isResolved){var v=(m=e.retry)!=null?m:3,b=(_=e.retryDelay)!=null?_:sht,y=typeof b=="function"?b(t.failureCount,p):b,C=v===!0||typeof v=="number"&&t.failureCount<v||typeof v=="function"&&v(t.failureCount,p);if(i||!C){c(p);return}t.failureCount++,e.onFail==null||e.onFail(t.failureCount,p),iht(y).then(function(){if(!nO.isFocused()||!X$.isOnline())return u()}).then(function(){i?c(p):h()})}})}};d()},aht=function(){function n(){this.queue=[],this.transactions=0,this.notifyFn=function(t){t()},this.batchNotifyFn=function(t){t()}}var e=n.prototype;return e.batch=function(i){var r;this.transactions++;try{r=i()}finally{this.transactions--,this.transactions||this.flush()}return r},e.schedule=function(i){var r=this;this.transactions?this.queue.push(i):NCe(function(){r.notifyFn(i)})},e.batchCalls=function(i){var r=this;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];r.schedule(function(){i.apply(void 0,s)})}},e.flush=function(){var i=this,r=this.queue;this.queue=[],r.length&&NCe(function(){i.batchNotifyFn(function(){r.forEach(function(o){i.notifyFn(o)})})})},e.setNotifyFunction=function(i){this.notifyFn=i},e.setBatchNotifyFunction=function(i){this.batchNotifyFn=i},n}(),vl=new aht,E4e=console;function U9(){return E4e}function lht(n){E4e=n}var cht=function(){function n(t){this.abortSignalConsumed=!1,this.hadObservers=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||this.getDefaultState(this.options),this.state=this.initialState,this.meta=t.meta,this.scheduleGc()}var e=n.prototype;return e.setOptions=function(i){var r;this.options=rt({},this.defaultOptions,i),this.meta=i==null?void 0:i.meta,this.cacheTime=Math.max(this.cacheTime||0,(r=this.options.cacheTime)!=null?r:5*60*1e3)},e.setDefaultOptions=function(i){this.defaultOptions=i},e.scheduleGc=function(){var i=this;this.clearGcTimeout(),Kee(this.cacheTime)&&(this.gcTimeout=setTimeout(function(){i.optionalRemove()},this.cacheTime))},e.clearGcTimeout=function(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)},e.optionalRemove=function(){this.observers.length||(this.state.isFetching?this.hadObservers&&this.scheduleGc():this.cache.remove(this))},e.setData=function(i,r){var o,s,a=this.state.data,l=Jdt(i,a);return(o=(s=this.options).isDataEqual)!=null&&o.call(s,a,l)?l=a:this.options.structuralSharing!==!1&&(l=z9(a,l)),this.dispatch({data:l,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt}),l},e.setState=function(i,r){this.dispatch({type:"setState",state:i,setStateOptions:r})},e.cancel=function(i){var r,o=this.promise;return(r=this.retryer)==null||r.cancel(i),o?o.then(pd).catch(pd):Promise.resolve()},e.destroy=function(){this.clearGcTimeout(),this.cancel({silent:!0})},e.reset=function(){this.destroy(),this.setState(this.initialState)},e.isActive=function(){return this.observers.some(function(i){return i.options.enabled!==!1})},e.isFetching=function(){return this.state.isFetching},e.isStale=function(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(function(i){return i.getCurrentResult().isStale})},e.isStaleByTime=function(i){return i===void 0&&(i=0),this.state.isInvalidated||!this.state.dataUpdatedAt||!b4e(this.state.dataUpdatedAt,i)},e.onFocus=function(){var i,r=this.observers.find(function(o){return o.shouldFetchOnWindowFocus()});r&&r.refetch(),(i=this.retryer)==null||i.continue()},e.onOnline=function(){var i,r=this.observers.find(function(o){return o.shouldFetchOnReconnect()});r&&r.refetch(),(i=this.retryer)==null||i.continue()},e.addObserver=function(i){this.observers.indexOf(i)===-1&&(this.observers.push(i),this.hadObservers=!0,this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:i}))},e.removeObserver=function(i){this.observers.indexOf(i)!==-1&&(this.observers=this.observers.filter(function(r){return r!==i}),this.observers.length||(this.retryer&&(this.retryer.isTransportCancelable||this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.cacheTime?this.scheduleGc():this.cache.remove(this)),this.cache.notify({type:"observerRemoved",query:this,observer:i}))},e.getObserversCount=function(){return this.observers.length},e.invalidate=function(){this.state.isInvalidated||this.dispatch({type:"invalidate"})},e.fetch=function(i,r){var o=this,s,a,l;if(this.state.isFetching){if(this.state.dataUpdatedAt&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(this.promise){var c;return(c=this.retryer)==null||c.continueRetry(),this.promise}}if(i&&this.setOptions(i),!this.options.queryFn){var u=this.observers.find(function(b){return b.options.queryFn});u&&this.setOptions(u.options)}var d=H9(this.queryKey),h=C4e(),g={queryKey:d,pageParam:void 0,meta:this.meta};Object.defineProperty(g,"signal",{enumerable:!0,get:function(){if(h)return o.abortSignalConsumed=!0,h.signal}});var p=function(){return o.options.queryFn?(o.abortSignalConsumed=!1,o.options.queryFn(g)):Promise.reject("Missing queryFn")},m={fetchOptions:r,options:this.options,queryKey:d,state:this.state,fetchFn:p,meta:this.meta};if((s=this.options.behavior)!=null&&s.onFetch){var _;(_=this.options.behavior)==null||_.onFetch(m)}if(this.revertState=this.state,!this.state.isFetching||this.state.fetchMeta!==((a=m.fetchOptions)==null?void 0:a.meta)){var v;this.dispatch({type:"fetch",meta:(v=m.fetchOptions)==null?void 0:v.meta})}return this.retryer=new S4e({fn:m.fetchFn,abort:h==null||(l=h.abort)==null?void 0:l.bind(h),onSuccess:function(y){o.setData(y),o.cache.config.onSuccess==null||o.cache.config.onSuccess(y,o),o.cacheTime===0&&o.optionalRemove()},onError:function(y){Z$(y)&&y.silent||o.dispatch({type:"error",error:y}),Z$(y)||(o.cache.config.onError==null||o.cache.config.onError(y,o),U9().error(y)),o.cacheTime===0&&o.optionalRemove()},onFail:function(){o.dispatch({type:"failed"})},onPause:function(){o.dispatch({type:"pause"})},onContinue:function(){o.dispatch({type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay}),this.promise=this.retryer.promise,this.promise},e.dispatch=function(i){var r=this;this.state=this.reducer(this.state,i),vl.batch(function(){r.observers.forEach(function(o){o.onQueryUpdate(i)}),r.cache.notify({query:r,type:"queryUpdated",action:i})})},e.getDefaultState=function(i){var r=typeof i.initialData=="function"?i.initialData():i.initialData,o=typeof i.initialData<"u",s=o?typeof i.initialDataUpdatedAt=="function"?i.initialDataUpdatedAt():i.initialDataUpdatedAt:0,a=typeof r<"u";return{data:r,dataUpdateCount:0,dataUpdatedAt:a?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchMeta:null,isFetching:!1,isInvalidated:!1,isPaused:!1,status:a?"success":"idle"}},e.reducer=function(i,r){var o,s;switch(r.type){case"failed":return rt({},i,{fetchFailureCount:i.fetchFailureCount+1});case"pause":return rt({},i,{isPaused:!0});case"continue":return rt({},i,{isPaused:!1});case"fetch":return rt({},i,{fetchFailureCount:0,fetchMeta:(o=r.meta)!=null?o:null,isFetching:!0,isPaused:!1},!i.dataUpdatedAt&&{error:null,status:"loading"});case"success":return rt({},i,{data:r.data,dataUpdateCount:i.dataUpdateCount+1,dataUpdatedAt:(s=r.dataUpdatedAt)!=null?s:Date.now(),error:null,fetchFailureCount:0,isFetching:!1,isInvalidated:!1,isPaused:!1,status:"success"});case"error":var a=r.error;return Z$(a)&&a.revert&&this.revertState?rt({},this.revertState):rt({},i,{error:a,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,isFetching:!1,isPaused:!1,status:"error"});case"invalidate":return rt({},i,{isInvalidated:!0});case"setState":return rt({},i,r.state);default:return i}},n}(),uht=function(n){J4(e,n);function e(i){var r;return r=n.call(this)||this,r.config=i||{},r.queries=[],r.queriesMap={},r}var t=e.prototype;return t.build=function(r,o,s){var a,l=o.queryKey,c=(a=o.queryHash)!=null?a:Cde(l,o),u=this.get(c);return u||(u=new cht({cache:this,queryKey:l,queryHash:c,options:r.defaultQueryOptions(o),state:s,defaultOptions:r.getQueryDefaults(l),meta:o.meta}),this.add(u)),u},t.add=function(r){this.queriesMap[r.queryHash]||(this.queriesMap[r.queryHash]=r,this.queries.push(r),this.notify({type:"queryAdded",query:r}))},t.remove=function(r){var o=this.queriesMap[r.queryHash];o&&(r.destroy(),this.queries=this.queries.filter(function(s){return s!==r}),o===r&&delete this.queriesMap[r.queryHash],this.notify({type:"queryRemoved",query:r}))},t.clear=function(){var r=this;vl.batch(function(){r.queries.forEach(function(o){r.remove(o)})})},t.get=function(r){return this.queriesMap[r]},t.getAll=function(){return this.queries},t.find=function(r,o){var s=b1(r,o),a=s[0];return typeof a.exact>"u"&&(a.exact=!0),this.queries.find(function(l){return DCe(a,l)})},t.findAll=function(r,o){var s=b1(r,o),a=s[0];return Object.keys(a).length>0?this.queries.filter(function(l){return DCe(a,l)}):this.queries},t.notify=function(r){var o=this;vl.batch(function(){o.listeners.forEach(function(s){s(r)})})},t.onFocus=function(){var r=this;vl.batch(function(){r.queries.forEach(function(o){o.onFocus()})})},t.onOnline=function(){var r=this;vl.batch(function(){r.queries.forEach(function(o){o.onOnline()})})},e}(e3),dht=function(){function n(t){this.options=rt({},t.defaultOptions,t.options),this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.observers=[],this.state=t.state||hht(),this.meta=t.meta}var e=n.prototype;return e.setState=function(i){this.dispatch({type:"setState",state:i})},e.addObserver=function(i){this.observers.indexOf(i)===-1&&this.observers.push(i)},e.removeObserver=function(i){this.observers=this.observers.filter(function(r){return r!==i})},e.cancel=function(){return this.retryer?(this.retryer.cancel(),this.retryer.promise.then(pd).catch(pd)):Promise.resolve()},e.continue=function(){return this.retryer?(this.retryer.continue(),this.retryer.promise):this.execute()},e.execute=function(){var i=this,r,o=this.state.status==="loading",s=Promise.resolve();return o||(this.dispatch({type:"loading",variables:this.options.variables}),s=s.then(function(){i.mutationCache.config.onMutate==null||i.mutationCache.config.onMutate(i.state.variables,i)}).then(function(){return i.options.onMutate==null?void 0:i.options.onMutate(i.state.variables)}).then(function(a){a!==i.state.context&&i.dispatch({type:"loading",context:a,variables:i.state.variables})})),s.then(function(){return i.executeMutation()}).then(function(a){r=a,i.mutationCache.config.onSuccess==null||i.mutationCache.config.onSuccess(r,i.state.variables,i.state.context,i)}).then(function(){return i.options.onSuccess==null?void 0:i.options.onSuccess(r,i.state.variables,i.state.context)}).then(function(){return i.options.onSettled==null?void 0:i.options.onSettled(r,null,i.state.variables,i.state.context)}).then(function(){return i.dispatch({type:"success",data:r}),r}).catch(function(a){return i.mutationCache.config.onError==null||i.mutationCache.config.onError(a,i.state.variables,i.state.context,i),U9().error(a),Promise.resolve().then(function(){return i.options.onError==null?void 0:i.options.onError(a,i.state.variables,i.state.context)}).then(function(){return i.options.onSettled==null?void 0:i.options.onSettled(void 0,a,i.state.variables,i.state.context)}).then(function(){throw i.dispatch({type:"error",error:a}),a})})},e.executeMutation=function(){var i=this,r;return this.retryer=new S4e({fn:function(){return i.options.mutationFn?i.options.mutationFn(i.state.variables):Promise.reject("No mutationFn found")},onFail:function(){i.dispatch({type:"failed"})},onPause:function(){i.dispatch({type:"pause"})},onContinue:function(){i.dispatch({type:"continue"})},retry:(r=this.options.retry)!=null?r:0,retryDelay:this.options.retryDelay}),this.retryer.promise},e.dispatch=function(i){var r=this;this.state=fht(this.state,i),vl.batch(function(){r.observers.forEach(function(o){o.onMutationUpdate(i)}),r.mutationCache.notify(r)})},n}();function hht(){return{context:void 0,data:void 0,error:null,failureCount:0,isPaused:!1,status:"idle",variables:void 0}}function fht(n,e){switch(e.type){case"failed":return rt({},n,{failureCount:n.failureCount+1});case"pause":return rt({},n,{isPaused:!0});case"continue":return rt({},n,{isPaused:!1});case"loading":return rt({},n,{context:e.context,data:void 0,error:null,isPaused:!1,status:"loading",variables:e.variables});case"success":return rt({},n,{data:e.data,error:null,status:"success",isPaused:!1});case"error":return rt({},n,{data:void 0,error:e.error,failureCount:n.failureCount+1,isPaused:!1,status:"error"});case"setState":return rt({},n,e.state);default:return n}}var ght=function(n){J4(e,n);function e(i){var r;return r=n.call(this)||this,r.config=i||{},r.mutations=[],r.mutationId=0,r}var t=e.prototype;return t.build=function(r,o,s){var a=new dht({mutationCache:this,mutationId:++this.mutationId,options:r.defaultMutationOptions(o),state:s,defaultOptions:o.mutationKey?r.getMutationDefaults(o.mutationKey):void 0,meta:o.meta});return this.add(a),a},t.add=function(r){this.mutations.push(r),this.notify(r)},t.remove=function(r){this.mutations=this.mutations.filter(function(o){return o!==r}),r.cancel(),this.notify(r)},t.clear=function(){var r=this;vl.batch(function(){r.mutations.forEach(function(o){r.remove(o)})})},t.getAll=function(){return this.mutations},t.find=function(r){return typeof r.exact>"u"&&(r.exact=!0),this.mutations.find(function(o){return ACe(r,o)})},t.findAll=function(r){return this.mutations.filter(function(o){return ACe(r,o)})},t.notify=function(r){var o=this;vl.batch(function(){o.listeners.forEach(function(s){s(r)})})},t.onFocus=function(){this.resumePausedMutations()},t.onOnline=function(){this.resumePausedMutations()},t.resumePausedMutations=function(){var r=this.mutations.filter(function(o){return o.state.isPaused});return vl.batch(function(){return r.reduce(function(o,s){return o.then(function(){return s.continue().catch(pd)})},Promise.resolve())})},e}(e3);function pht(){return{onFetch:function(e){e.fetchFn=function(){var t,i,r,o,s,a,l=(t=e.fetchOptions)==null||(i=t.meta)==null?void 0:i.refetchPage,c=(r=e.fetchOptions)==null||(o=r.meta)==null?void 0:o.fetchMore,u=c==null?void 0:c.pageParam,d=(c==null?void 0:c.direction)==="forward",h=(c==null?void 0:c.direction)==="backward",g=((s=e.state.data)==null?void 0:s.pages)||[],p=((a=e.state.data)==null?void 0:a.pageParams)||[],m=C4e(),_=m==null?void 0:m.signal,v=p,b=!1,y=e.options.queryFn||function(){return Promise.reject("Missing queryFn")},C=function(B,F,H,V){return v=V?[F].concat(v):[].concat(v,[F]),V?[H].concat(B):[].concat(B,[H])},x=function(B,F,H,V){if(b)return Promise.reject("Cancelled");if(typeof H>"u"&&!F&&B.length)return Promise.resolve(B);var $={queryKey:e.queryKey,signal:_,pageParam:H,meta:e.meta},j=y($),Y=Promise.resolve(j).then(function(se){return C(B,H,se,V)});if(j9(j)){var ne=Y;ne.cancel=j.cancel}return Y},k;if(!g.length)k=x([]);else if(d){var I=typeof u<"u",L=I?u:OCe(e.options,g);k=x(g,I,L)}else if(h){var D=typeof u<"u",R=D?u:mht(e.options,g);k=x(g,D,R,!0)}else(function(){v=[];var O=typeof e.options.getNextPageParam>"u",B=l&&g[0]?l(g[0],0,g):!0;k=B?x([],O,p[0]):Promise.resolve(C([],p[0],g[0]));for(var F=function($){k=k.then(function(j){var Y=l&&g[$]?l(g[$],$,g):!0;if(Y){var ne=O?p[$]:OCe(e.options,j);return x(j,O,ne)}return Promise.resolve(C(j,p[$],g[$]))})},H=1;H<g.length;H++)F(H)})();var P=k.then(function(O){return{pages:O,pageParams:v}}),M=P;return M.cancel=function(){b=!0,m==null||m.abort(),j9(k)&&k.cancel()},P}}}}function OCe(n,e){return n.getNextPageParam==null?void 0:n.getNextPageParam(e[e.length-1],e)}function mht(n,e){return n.getPreviousPageParam==null?void 0:n.getPreviousPageParam(e[0],e)}var _ht=function(){function n(t){t===void 0&&(t={}),this.queryCache=t.queryCache||new uht,this.mutationCache=t.mutationCache||new ght,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[]}var e=n.prototype;return e.mount=function(){var i=this;this.unsubscribeFocus=nO.subscribe(function(){nO.isFocused()&&X$.isOnline()&&(i.mutationCache.onFocus(),i.queryCache.onFocus())}),this.unsubscribeOnline=X$.subscribe(function(){nO.isFocused()&&X$.isOnline()&&(i.mutationCache.onOnline(),i.queryCache.onOnline())})},e.unmount=function(){var i,r;(i=this.unsubscribeFocus)==null||i.call(this),(r=this.unsubscribeOnline)==null||r.call(this)},e.isFetching=function(i,r){var o=b1(i,r),s=o[0];return s.fetching=!0,this.queryCache.findAll(s).length},e.isMutating=function(i){return this.mutationCache.findAll(rt({},i,{fetching:!0})).length},e.getQueryData=function(i,r){var o;return(o=this.queryCache.find(i,r))==null?void 0:o.state.data},e.getQueriesData=function(i){return this.getQueryCache().findAll(i).map(function(r){var o=r.queryKey,s=r.state,a=s.data;return[o,a]})},e.setQueryData=function(i,r,o){var s=Q$(i),a=this.defaultQueryOptions(s);return this.queryCache.build(this,a).setData(r,o)},e.setQueriesData=function(i,r,o){var s=this;return vl.batch(function(){return s.getQueryCache().findAll(i).map(function(a){var l=a.queryKey;return[l,s.setQueryData(l,r,o)]})})},e.getQueryState=function(i,r){var o;return(o=this.queryCache.find(i,r))==null?void 0:o.state},e.removeQueries=function(i,r){var o=b1(i,r),s=o[0],a=this.queryCache;vl.batch(function(){a.findAll(s).forEach(function(l){a.remove(l)})})},e.resetQueries=function(i,r,o){var s=this,a=b1(i,r,o),l=a[0],c=a[1],u=this.queryCache,d=rt({},l,{active:!0});return vl.batch(function(){return u.findAll(l).forEach(function(h){h.reset()}),s.refetchQueries(d,c)})},e.cancelQueries=function(i,r,o){var s=this,a=b1(i,r,o),l=a[0],c=a[1],u=c===void 0?{}:c;typeof u.revert>"u"&&(u.revert=!0);var d=vl.batch(function(){return s.queryCache.findAll(l).map(function(h){return h.cancel(u)})});return Promise.all(d).then(pd).catch(pd)},e.invalidateQueries=function(i,r,o){var s,a,l,c=this,u=b1(i,r,o),d=u[0],h=u[1],g=rt({},d,{active:(s=(a=d.refetchActive)!=null?a:d.active)!=null?s:!0,inactive:(l=d.refetchInactive)!=null?l:!1});return vl.batch(function(){return c.queryCache.findAll(d).forEach(function(p){p.invalidate()}),c.refetchQueries(g,h)})},e.refetchQueries=function(i,r,o){var s=this,a=b1(i,r,o),l=a[0],c=a[1],u=vl.batch(function(){return s.queryCache.findAll(l).map(function(h){return h.fetch(void 0,rt({},c,{meta:{refetchPage:l==null?void 0:l.refetchPage}}))})}),d=Promise.all(u).then(pd);return c!=null&&c.throwOnError||(d=d.catch(pd)),d},e.fetchQuery=function(i,r,o){var s=Q$(i,r,o),a=this.defaultQueryOptions(s);typeof a.retry>"u"&&(a.retry=!1);var l=this.queryCache.build(this,a);return l.isStaleByTime(a.staleTime)?l.fetch(a):Promise.resolve(l.state.data)},e.prefetchQuery=function(i,r,o){return this.fetchQuery(i,r,o).then(pd).catch(pd)},e.fetchInfiniteQuery=function(i,r,o){var s=Q$(i,r,o);return s.behavior=pht(),this.fetchQuery(s)},e.prefetchInfiniteQuery=function(i,r,o){return this.fetchInfiniteQuery(i,r,o).then(pd).catch(pd)},e.cancelMutations=function(){var i=this,r=vl.batch(function(){return i.mutationCache.getAll().map(function(o){return o.cancel()})});return Promise.all(r).then(pd).catch(pd)},e.resumePausedMutations=function(){return this.getMutationCache().resumePausedMutations()},e.executeMutation=function(i){return this.mutationCache.build(this,i).execute()},e.getQueryCache=function(){return this.queryCache},e.getMutationCache=function(){return this.mutationCache},e.getDefaultOptions=function(){return this.defaultOptions},e.setDefaultOptions=function(i){this.defaultOptions=i},e.setQueryDefaults=function(i,r){var o=this.queryDefaults.find(function(s){return vE(i)===vE(s.queryKey)});o?o.defaultOptions=r:this.queryDefaults.push({queryKey:i,defaultOptions:r})},e.getQueryDefaults=function(i){var r;return i?(r=this.queryDefaults.find(function(o){return W9(i,o.queryKey)}))==null?void 0:r.defaultOptions:void 0},e.setMutationDefaults=function(i,r){var o=this.mutationDefaults.find(function(s){return vE(i)===vE(s.mutationKey)});o?o.defaultOptions=r:this.mutationDefaults.push({mutationKey:i,defaultOptions:r})},e.getMutationDefaults=function(i){var r;return i?(r=this.mutationDefaults.find(function(o){return W9(i,o.mutationKey)}))==null?void 0:r.defaultOptions:void 0},e.defaultQueryOptions=function(i){if(i!=null&&i._defaulted)return i;var r=rt({},this.defaultOptions.queries,this.getQueryDefaults(i==null?void 0:i.queryKey),i,{_defaulted:!0});return!r.queryHash&&r.queryKey&&(r.queryHash=Cde(r.queryKey,r)),r},e.defaultQueryObserverOptions=function(i){return this.defaultQueryOptions(i)},e.defaultMutationOptions=function(i){return i!=null&&i._defaulted?i:rt({},this.defaultOptions.mutations,this.getMutationDefaults(i==null?void 0:i.mutationKey),i,{_defaulted:!0})},e.clear=function(){this.queryCache.clear(),this.mutationCache.clear()},n}(),vht=function(n){J4(e,n);function e(i,r){var o;return o=n.call(this)||this,o.client=i,o.options=r,o.trackedProps=[],o.selectError=null,o.bindMethods(),o.setOptions(r),o}var t=e.prototype;return t.bindMethods=function(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)},t.onSubscribe=function(){this.listeners.length===1&&(this.currentQuery.addObserver(this),PCe(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())},t.onUnsubscribe=function(){this.listeners.length||this.destroy()},t.shouldFetchOnReconnect=function(){return Yee(this.currentQuery,this.options,this.options.refetchOnReconnect)},t.shouldFetchOnWindowFocus=function(){return Yee(this.currentQuery,this.options,this.options.refetchOnWindowFocus)},t.destroy=function(){this.listeners=[],this.clearTimers(),this.currentQuery.removeObserver(this)},t.setOptions=function(r,o){var s=this.options,a=this.currentQuery;if(this.options=this.client.defaultQueryObserverOptions(r),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=s.queryKey),this.updateQuery();var l=this.hasListeners();l&&MCe(this.currentQuery,a,this.options,s)&&this.executeFetch(),this.updateResult(o),l&&(this.currentQuery!==a||this.options.enabled!==s.enabled||this.options.staleTime!==s.staleTime)&&this.updateStaleTimeout();var c=this.computeRefetchInterval();l&&(this.currentQuery!==a||this.options.enabled!==s.enabled||c!==this.currentRefetchInterval)&&this.updateRefetchInterval(c)},t.getOptimisticResult=function(r){var o=this.client.defaultQueryObserverOptions(r),s=this.client.getQueryCache().build(this.client,o);return this.createResult(s,o)},t.getCurrentResult=function(){return this.currentResult},t.trackResult=function(r,o){var s=this,a={},l=function(u){s.trackedProps.includes(u)||s.trackedProps.push(u)};return Object.keys(r).forEach(function(c){Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:function(){return l(c),r[c]}})}),(o.useErrorBoundary||o.suspense)&&l("error"),a},t.getNextResult=function(r){var o=this;return new Promise(function(s,a){var l=o.subscribe(function(c){c.isFetching||(l(),c.isError&&(r!=null&&r.throwOnError)?a(c.error):s(c))})})},t.getCurrentQuery=function(){return this.currentQuery},t.remove=function(){this.client.getQueryCache().remove(this.currentQuery)},t.refetch=function(r){return this.fetch(rt({},r,{meta:{refetchPage:r==null?void 0:r.refetchPage}}))},t.fetchOptimistic=function(r){var o=this,s=this.client.defaultQueryObserverOptions(r),a=this.client.getQueryCache().build(this.client,s);return a.fetch().then(function(){return o.createResult(a,s)})},t.fetch=function(r){var o=this;return this.executeFetch(r).then(function(){return o.updateResult(),o.currentResult})},t.executeFetch=function(r){this.updateQuery();var o=this.currentQuery.fetch(this.options,r);return r!=null&&r.throwOnError||(o=o.catch(pd)),o},t.updateStaleTimeout=function(){var r=this;if(this.clearStaleTimeout(),!(V9||this.currentResult.isStale||!Kee(this.options.staleTime))){var o=b4e(this.currentResult.dataUpdatedAt,this.options.staleTime),s=o+1;this.staleTimeoutId=setTimeout(function(){r.currentResult.isStale||r.updateResult()},s)}},t.computeRefetchInterval=function(){var r;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(r=this.options.refetchInterval)!=null?r:!1},t.updateRefetchInterval=function(r){var o=this;this.clearRefetchInterval(),this.currentRefetchInterval=r,!(V9||this.options.enabled===!1||!Kee(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(function(){(o.options.refetchIntervalInBackground||nO.isFocused())&&o.executeFetch()},this.currentRefetchInterval))},t.updateTimers=function(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())},t.clearTimers=function(){this.clearStaleTimeout(),this.clearRefetchInterval()},t.clearStaleTimeout=function(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)},t.clearRefetchInterval=function(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)},t.createResult=function(r,o){var s=this.currentQuery,a=this.options,l=this.currentResult,c=this.currentResultState,u=this.currentResultOptions,d=r!==s,h=d?r.state:this.currentQueryInitialState,g=d?this.currentResult:this.previousQueryResult,p=r.state,m=p.dataUpdatedAt,_=p.error,v=p.errorUpdatedAt,b=p.isFetching,y=p.status,C=!1,x=!1,k;if(o.optimisticResults){var I=this.hasListeners(),L=!I&&PCe(r,o),D=I&&MCe(r,s,o,a);(L||D)&&(b=!0,m||(y="loading"))}if(o.keepPreviousData&&!p.dataUpdateCount&&(g!=null&&g.isSuccess)&&y!=="error")k=g.data,m=g.dataUpdatedAt,y=g.status,C=!0;else if(o.select&&typeof p.data<"u")if(l&&p.data===(c==null?void 0:c.data)&&o.select===this.selectFn)k=this.selectResult;else try{this.selectFn=o.select,k=o.select(p.data),o.structuralSharing!==!1&&(k=z9(l==null?void 0:l.data,k)),this.selectResult=k,this.selectError=null}catch(M){U9().error(M),this.selectError=M}else k=p.data;if(typeof o.placeholderData<"u"&&typeof k>"u"&&(y==="loading"||y==="idle")){var R;if(l!=null&&l.isPlaceholderData&&o.placeholderData===(u==null?void 0:u.placeholderData))R=l.data;else if(R=typeof o.placeholderData=="function"?o.placeholderData():o.placeholderData,o.select&&typeof R<"u")try{R=o.select(R),o.structuralSharing!==!1&&(R=z9(l==null?void 0:l.data,R)),this.selectError=null}catch(M){U9().error(M),this.selectError=M}typeof R<"u"&&(y="success",k=R,x=!0)}this.selectError&&(_=this.selectError,k=this.selectResult,v=Date.now(),y="error");var P={status:y,isLoading:y==="loading",isSuccess:y==="success",isError:y==="error",isIdle:y==="idle",data:k,dataUpdatedAt:m,error:_,errorUpdatedAt:v,failureCount:p.fetchFailureCount,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>h.dataUpdateCount||p.errorUpdateCount>h.errorUpdateCount,isFetching:b,isRefetching:b&&y!=="loading",isLoadingError:y==="error"&&p.dataUpdatedAt===0,isPlaceholderData:x,isPreviousData:C,isRefetchError:y==="error"&&p.dataUpdatedAt!==0,isStale:wde(r,o),refetch:this.refetch,remove:this.remove};return P},t.shouldNotifyListeners=function(r,o){if(!o)return!0;var s=this.options,a=s.notifyOnChangeProps,l=s.notifyOnChangePropsExclusions;if(!a&&!l||a==="tracked"&&!this.trackedProps.length)return!0;var c=a==="tracked"?this.trackedProps:a;return Object.keys(r).some(function(u){var d=u,h=r[d]!==o[d],g=c==null?void 0:c.some(function(m){return m===u}),p=l==null?void 0:l.some(function(m){return m===u});return h&&!p&&(!c||g)})},t.updateResult=function(r){var o=this.currentResult;if(this.currentResult=this.createResult(this.currentQuery,this.options),this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,!nht(this.currentResult,o)){var s={cache:!0};(r==null?void 0:r.listeners)!==!1&&this.shouldNotifyListeners(this.currentResult,o)&&(s.listeners=!0),this.notify(rt({},s,r))}},t.updateQuery=function(){var r=this.client.getQueryCache().build(this.client,this.options);if(r!==this.currentQuery){var o=this.currentQuery;this.currentQuery=r,this.currentQueryInitialState=r.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(o==null||o.removeObserver(this),r.addObserver(this))}},t.onQueryUpdate=function(r){var o={};r.type==="success"?o.onSuccess=!0:r.type==="error"&&!Z$(r.error)&&(o.onError=!0),this.updateResult(o),this.hasListeners()&&this.updateTimers()},t.notify=function(r){var o=this;vl.batch(function(){r.onSuccess?(o.options.onSuccess==null||o.options.onSuccess(o.currentResult.data),o.options.onSettled==null||o.options.onSettled(o.currentResult.data,null)):r.onError&&(o.options.onError==null||o.options.onError(o.currentResult.error),o.options.onSettled==null||o.options.onSettled(void 0,o.currentResult.error)),r.listeners&&o.listeners.forEach(function(s){s(o.currentResult)}),r.cache&&o.client.getQueryCache().notify({query:o.currentQuery,type:"observerResultsUpdated"})})},e}(e3);function bht(n,e){return e.enabled!==!1&&!n.state.dataUpdatedAt&&!(n.state.status==="error"&&e.retryOnMount===!1)}function PCe(n,e){return bht(n,e)||n.state.dataUpdatedAt>0&&Yee(n,e,e.refetchOnMount)}function Yee(n,e,t){if(e.enabled!==!1){var i=typeof t=="function"?t(n):t;return i==="always"||i!==!1&&wde(n,e)}return!1}function MCe(n,e,t,i){return t.enabled!==!1&&(n!==e||i.enabled===!1)&&(!t.suspense||n.state.status!=="error")&&wde(n,t)}function wde(n,e){return n.isStaleByTime(e.staleTime)}var yht=VW.unstable_batchedUpdates;vl.setBatchNotifyFunction(yht);var Cht=console;lht(Cht);var FCe=te.createContext(void 0),x4e=te.createContext(!1);function k4e(n){return n&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=FCe),window.ReactQueryClientContext):FCe}var Kr=function(){var e=te.useContext(k4e(te.useContext(x4e)));if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},wht=function(e){var t=e.client,i=e.contextSharing,r=i===void 0?!1:i,o=e.children;te.useEffect(function(){return t.mount(),function(){t.unmount()}},[t]);var s=k4e(r);return te.createElement(x4e.Provider,{value:r},te.createElement(s.Provider,{value:t},o))};function Sht(){var n=!1;return{clearReset:function(){n=!1},reset:function(){n=!0},isReset:function(){return n}}}var Eht=te.createContext(Sht()),xht=function(){return te.useContext(Eht)};function kht(n,e,t){return typeof e=="function"?e.apply(void 0,t):typeof e=="boolean"?e:!!n}function Tht(n,e){var t=te.useRef(!1),i=te.useState(0),r=i[1],o=Kr(),s=xht(),a=o.defaultQueryObserverOptions(n);a.optimisticResults=!0,a.onError&&(a.onError=vl.batchCalls(a.onError)),a.onSuccess&&(a.onSuccess=vl.batchCalls(a.onSuccess)),a.onSettled&&(a.onSettled=vl.batchCalls(a.onSettled)),a.suspense&&(typeof a.staleTime!="number"&&(a.staleTime=1e3),a.cacheTime===0&&(a.cacheTime=1)),(a.suspense||a.useErrorBoundary)&&(s.isReset()||(a.retryOnMount=!1));var l=te.useState(function(){return new e(o,a)}),c=l[0],u=c.getOptimisticResult(a);if(te.useEffect(function(){t.current=!0,s.clearReset();var d=c.subscribe(vl.batchCalls(function(){t.current&&r(function(h){return h+1})}));return c.updateResult(),function(){t.current=!1,d()}},[s,c]),te.useEffect(function(){c.setOptions(a,{listeners:!1})},[a,c]),a.suspense&&u.isLoading)throw c.fetchOptimistic(a).then(function(d){var h=d.data;a.onSuccess==null||a.onSuccess(h),a.onSettled==null||a.onSettled(h,null)}).catch(function(d){s.clearReset(),a.onError==null||a.onError(d),a.onSettled==null||a.onSettled(void 0,d)});if(u.isError&&!s.isReset()&&!u.isFetching&&kht(a.suspense,a.useErrorBoundary,[u.error,c.getCurrentQuery()]))throw u.error;return a.notifyOnChangeProps==="tracked"&&(u=c.trackResult(u,a)),u}function ai(n,e,t){var i=Q$(n,e,t);return Tht(i,vht)}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const dL={invoices:{path:"/api/v1/invoices",dependencies:["/api/v1/clients","/api/v1/charts/totals_v2","/api/v1/charts/chart_summary_v2","/api/v1/activities/entity","/api/v1/activities","/api/v1/documents"]},designs:{path:"/api/v1/designs",dependencies:["/api/v1/invoices","/api/v1/quotes","/api/v1/credits","/api/v1/recurring_invoices","/api/v1/purchase_orders"]},tokens:{path:"/api/v1/tokens",dependencies:[]},webhooks:{path:"/api/v1/webhooks",dependencies:[]},company_gateways:{path:"/api/v1/company_gateways",dependencies:[]},credits:{path:"/api/v1/credits",dependencies:["/api/v1/clients","/api/v1/documents"]},expense_categories:{path:"/api/v1/expense_categories",dependencies:["/api/v1/expenses","/api/v1/recurring_expenses","/api/v1/bank_transaction_rules","/api/v1/vendors","/api/v1/bank_transactions"]},expenses:{path:"/api/v1/expenses",dependencies:["/api/v1/charts/totals_v2","/api/v1/charts/chart_summary_v2","/api/v1/documents"]},group_settings:{path:"/api/v1/group_settings",dependencies:["/api/v1/clients"]},payments:{path:"/api/v1/payments",dependencies:["/api/v1/expenses","/api/v1/invoices","/api/v1/clients","/api/v1/charts/totals_v2","/api/v1/charts/chart_summary_v2","/api/v1/activities","/api/v1/documents"]},purchase_orders:{path:"/api/v1/purchase_orders",dependencies:["/api/v1/vendors"]},recurring_expenses:{path:"/api/v1/recurring_expenses",dependencies:["/api/v1/vendors","/api/v1/documents"]},task_statuses:{path:"/api/v1/task_statuses",dependencies:["/api/v1/tasks"]},tasks:{path:"/api/v1/tasks",dependencies:["/api/v1/projects","/api/v1/documents"]},tax_rates:{path:"/api/v1/tax_rates",dependencies:["/api/v1/invoices","/api/v1/quotes","/api/v1/credits","/api/v1/recurring_invoices","/api/v1/purchase_orders"]},bank_transactions:{path:"/api/v1/bank_transactions",dependencies:["/api/v1/payments","/api/v1/invoices","/api/v1/vendors","/api/v1/expenses","/api/v1/expense_categories"]},bank_transaction_rules:{path:"/api/v1/bank_transaction_rules",dependencies:["/api/v1/bank_transactions"]},vendors:{path:"/api/v1/vendors",dependencies:["/api/v1/expenses","/api/v1/recurring_expenses","/api/v1/purchase_orders"]},users:{path:"/api/v1/users",dependencies:["/api/v1/tasks","/api/v1/invoices","/api/v1/quotes","/api/v1/credits","/api/v1/recurring_invoices","/api/v1/projects","/api/v1/payments","/api/v1/expenses","/api/v1/tasks"]},company_users:{path:"/api/v1/company_users",dependencies:[]},clients:{path:"/api/v1/clients",dependencies:["/api/v1/tasks","/api/v1/invoices","/api/v1/quotes","/api/v1/credits","/api/v1/recurring_invoices","/api/v1/projects","/api/v1/payments","/api/v1/expenses","/api/v1/recurring_expenses","/api/v1/tasks","/api/v1/charts/totals_v2","/api/v1/charts/chart_summary_v2","/api/v1/documents"]},products:{path:"/api/v1/products",dependencies:["/api/v1/subscriptions","/api/v1/invoices"]},projects:{path:"/api/v1/projects",dependencies:["/api/v1/tasks","/api/v1/documents"]},quotes:{path:"/api/v1/quotes",dependencies:["/api/v1/clients","/api/v1/activities","/api/v1/documents"]},recurring_invoices:{path:"/api/v1/recurring_invoices",dependencies:["/api/v1/clients","/api/v1/activities/entity","/api/v1/documents"]},bank_integrations:{path:"/api/v1/bank_integrations",dependencies:["/api/v1/bank_transactions"]},documents:{path:"/api/v1/documents",dependencies:[]},payment_terms:{path:"/api/v1/payment_terms",dependencies:[]},statics:{path:"/api/v1/statics",dependencies:[]},task_schedulers:{path:"/api/v1/task_schedulers",dependencies:[]},subscriptions:{path:"/api/v1/subscriptions",dependencies:[]},activities:{path:"/api/v1/activities",dependencies:["/api/v1/activities/entity"]}};function T4e(){const n=Kr();return e=>{e.map(t=>{dL[t]&&(n.invalidateQueries(dL[t].path),dL[t].dependencies.map(i=>{n.invalidateQueries(i)}))})}}function hn(n){window.dispatchEvent(new CustomEvent("refetch",{detail:{property:n}}))}function Iht(n){return Object.keys(dL).find(t=>dL[t].path.startsWith(n)||n.startsWith(dL[t].path))}function Lht(n){n.map(e=>{const t=Iht(e);t&&hn([t])})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function I4e(){const n=localStorage.getItem("displayChromeExtensionBanner");localStorage.clear(),n&&localStorage.setItem("displayChromeExtensionBanner",n)}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const L4e=p4e.create();L4e.interceptors.response.use(n=>{const e=Dht(n.config.data),t=n.config.method;return(t==="put"||t==="post"&&(e==null?void 0:e.action)==="delete"||t==="delete")&&hn(["activities"]),n},n=>{var e,t,i,r,o,s,a,l;return(((e=n.response)==null?void 0:e.status)===429||((t=n.response)==null?void 0:t.status)===403)&&(window.location.reload(),I4e()),((i=n.response)==null?void 0:i.status)===404&&window.dispatchEvent(new CustomEvent("navigate.invalid.page")),(r=n.response)!=null&&r.status&&n.response.status!==412&&n.response.status!==422&&n.response.status>399&&n.response.status<500&&ie.error(((o=n.response)==null?void 0:o.data.message)||"error_title"),(s=n.response)!=null&&s.status&&n.response.status===500&&ie.error("error_title"),((a=n.response)==null?void 0:a.status)===409&&ie.processing(),((l=n.response)==null?void 0:l.status)===422&&window.dispatchEvent(new CustomEvent("display.error.toaster",{detail:{error:n}})),console.error(n),Promise.reject(n)});function Te(n,e,t,i){return L4e({method:n,url:e,data:t,...i,headers:{...fx(),...i==null?void 0:i.headers},signal:i==null?void 0:i.signal})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Il(){const n=vi(),{data:e}=Nd(),[t,i]=w.useState("0"),[r,o]=w.useState("DD/MMM/YYYY");return w.useEffect(()=>{if(e!=null&&e.date_formats){const s=e.date_formats.find(a=>{var l;return a.id===((l=n==null?void 0:n.settings)==null?void 0:l.date_format_id)});s&&(o(s.format_moment),i(s.id))}},[n,e]),{dateFormatId:t,dateFormat:r}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Yo(){return!1}function t3(){return!Yo()}function n3(){return window.location.origin||"https://invoicing.co"}function ye(n,e={}){return n3()+dt(n,e)}function PY(...n){return n.filter(Boolean).join(" ")}function Jr(n,e){return n===0||n===""||n===void 0?"":typeof n=="number"?Cn.unix(n).format(e):Cn(n).format(e)}function $dr(){const{dateFormat:n}=Il(),e=["DD. MMM. YYYY","ddd MMM D, YYYY"];return t=>Cn(t,e.includes(n)?void 0:n)}function nr(n){if(!n.is_deleted&&!n.archived_at)return bY.active;if(n.archived_at&&!n.is_deleted)return bY.archived;if(n.is_deleted)return bY.deleted}function Ds(n,e){let t=Wee(n);for(const i in e)t=t.replace(`:${i}`,e[i]);return t}function Vdr(n,e={}){return n3()+dt(n,e)}function u0(){return"https://demo.invoiceninja.com"===n3()}function Dht(n){try{return n&&JSON.parse(n)}catch{return!1}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Nd(){return ai(["/api/v1/statics"],()=>Te("GET",ye("/api/v1/statics")).then(n=>n.data),{enabled:!!localStorage.getItem("X-NINJA-TOKEN"),staleTime:1/0})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function gz(){const{data:n}=Nd(),[e,t]=w.useState([]);return w.useEffect(()=>{n!=null&&n.languages&&t(n.languages)},[n]),e}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function D4e(){const n=gz();return e=>n.find(t=>t.id.toString()===e.toString())}function uu(n,e){if(n==null)return{};var t=nde(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Aht(){if(console&&console.warn){for(var n,e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];typeof t[0]=="string"&&(t[0]="react-i18next:: ".concat(t[0])),(n=console).warn.apply(n,t)}}var BCe={};function Qee(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];typeof e[0]=="string"&&BCe[e[0]]||(typeof e[0]=="string"&&(BCe[e[0]]=new Date),Aht.apply(void 0,e))}var A4e=function(e,t){return function(){if(e.isInitialized)t();else{var i=function r(){setTimeout(function(){e.off("initialized",r)},0),t()};e.on("initialized",i)}}};function $Ce(n,e,t){n.loadNamespaces(e,A4e(n,t))}function VCe(n,e,t,i){typeof t=="string"&&(t=[t]),t.forEach(function(r){n.options.ns.indexOf(r)<0&&n.options.ns.push(r)}),n.loadLanguages(e,A4e(n,i))}function Rht(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=e.languages[0],r=e.options?e.options.fallbackLng:!1,o=e.languages[e.languages.length-1];if(i.toLowerCase()==="cimode")return!0;var s=function(l,c){var u=e.services.backendConnector.state["".concat(l,"|").concat(c)];return u===-1||u===2};return t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!s(e.isLanguageChangingTo,n)?!1:!!(e.hasResourceBundle(i,n)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||s(i,n)&&(!r||s(o,n)))}function Nht(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e.languages||!e.languages.length)return Qee("i18n.languages were undefined or empty",e.languages),!0;var i=e.options.ignoreJSONStructure!==void 0;return i?e.hasLoadedNamespace(n,{lng:t.lng,precheck:function(o,s){if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!s(o.isLanguageChangingTo,n))return!1}}):Rht(n,e,t)}var Oht=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Pht={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Mht=function(e){return Pht[e]},Fht=function(e){return e.replace(Oht,Mht)};function HCe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function WCe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?HCe(Object(t),!0).forEach(function(i){$e(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):HCe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}var Xee={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Fht};function Bht(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Xee=WCe(WCe({},Xee),n)}function $ht(){return Xee}var R4e;function Vht(n){R4e=n}function Hht(){return R4e}var Wht={type:"3rdParty",init:function(e){Bht(e.options.react),Vht(e)}},zht=w.createContext(),jht=function(){function n(){Ua(this,n),this.usedNamespaces={}}return qa(n,[{key:"addUsedNamespaces",value:function(t){var i=this;t.forEach(function(r){i.usedNamespaces[r]||(i.usedNamespaces[r]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),n}();function Uht(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i,r,o,s,a=[],l=!0,c=!1;try{if(o=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(i=o.call(t)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(u){c=!0,r=u}finally{try{if(!l&&t.return!=null&&(s=t.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}function $t(n,e){return KMe(n)||Uht(n,e)||dde(n,e)||YMe()}function zCe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function MY(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zCe(Object(t),!0).forEach(function(i){$e(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):zCe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}var qht=function(e,t){var i=w.useRef();return w.useEffect(function(){i.current=t?i.current:e},[e,t]),i.current};function ue(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.i18n,i=w.useContext(zht)||{},r=i.i18n,o=i.defaultNS,s=t||r||Hht();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new jht),!s){Qee("You will need to pass in an i18next instance by using initReactI18next");var a=function(D,R){return typeof R=="string"?R:R&&Er(R)==="object"&&typeof R.defaultValue=="string"?R.defaultValue:Array.isArray(D)?D[D.length-1]:D},l=[a,{},!1];return l.t=a,l.i18n={},l.ready=!1,l}s.options.react&&s.options.react.wait!==void 0&&Qee("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=MY(MY(MY({},$ht()),s.options.react),e),u=c.useSuspense,d=c.keyPrefix,h=n||o||s.options&&s.options.defaultNS;h=typeof h=="string"?[h]:h||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(h);var g=(s.isInitialized||s.initializedStoreOnce)&&h.every(function(L){return Nht(L,s,c)});function p(){return s.getFixedT(e.lng||null,c.nsMode==="fallback"?h:h[0],d)}var m=w.useState(p),_=$t(m,2),v=_[0],b=_[1],y=h.join();e.lng&&(y="".concat(e.lng).concat(y));var C=qht(y),x=w.useRef(!0);w.useEffect(function(){var L=c.bindI18n,D=c.bindI18nStore;x.current=!0,!g&&!u&&(e.lng?VCe(s,e.lng,h,function(){x.current&&b(p)}):$Ce(s,h,function(){x.current&&b(p)})),g&&C&&C!==y&&x.current&&b(p);function R(){x.current&&b(p)}return L&&s&&s.on(L,R),D&&s&&s.store.on(D,R),function(){x.current=!1,L&&s&&L.split(" ").forEach(function(P){return s.off(P,R)}),D&&s&&D.split(" ").forEach(function(P){return s.store.off(P,R)})}},[s,y]);var k=w.useRef(!0);w.useEffect(function(){x.current&&!k.current&&b(p),k.current=!1},[s,d]);var I=[v,s,g];if(I.t=v,I.i18n=s,I.ready=g,g||!g&&!u)return I;throw new Promise(function(L){e.lng?VCe(s,e.lng,h,function(){return L()}):$Ce(s,h,function(){return L()})})}const Kht="modulepreload",Ght=function(n){return"/"+n},jCe={},X=function(e,t,i){if(!t||t.length===0)return e();const r=document.getElementsByTagName("link");return Promise.all(t.map(o=>{if(o=Ght(o),o in jCe)return;jCe[o]=!0;const s=o.endsWith(".css"),a=s?'[rel="stylesheet"]':"";if(!!i)for(let u=r.length-1;u>=0;u--){const d=r[u];if(d.href===o&&(!s||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${a}`))return;const c=document.createElement("link");if(c.rel=s?"stylesheet":Kht,s||(c.as="script",c.crossOrigin=""),c.href=o,document.head.appendChild(c),s)return new Promise((u,d)=>{c.addEventListener("load",u),c.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>e()).catch(o=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o})};/**
* @remix-run/router v1.10.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function TP(){return TP=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},TP.apply(this,arguments)}var $1;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})($1||($1={}));const UCe="popstate";function Yht(n){n===void 0&&(n={});function e(i,r){let{pathname:o,search:s,hash:a}=i.location;return Zee("",{pathname:o,search:s,hash:a},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function t(i,r){return typeof r=="string"?r:q9(r)}return Xht(e,t,null,n)}function Cl(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function pz(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Qht(){return Math.random().toString(36).substr(2,8)}function qCe(n,e){return{usr:n.state,key:n.key,idx:e}}function Zee(n,e,t,i){return t===void 0&&(t=null),TP({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?B2(e):e,{state:t,key:e&&e.key||i||Qht()})}function q9(n){let{pathname:e="/",search:t="",hash:i=""}=n;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function B2(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substr(t),n=n.substr(0,t));let i=n.indexOf("?");i>=0&&(e.search=n.substr(i),n=n.substr(0,i)),n&&(e.pathname=n)}return e}function Xht(n,e,t,i){i===void 0&&(i={});let{window:r=document.defaultView,v5Compat:o=!1}=i,s=r.history,a=$1.Pop,l=null,c=u();c==null&&(c=0,s.replaceState(TP({},s.state,{idx:c}),""));function u(){return(s.state||{idx:null}).idx}function d(){a=$1.Pop;let _=u(),v=_==null?null:_-c;c=_,l&&l({action:a,location:m.location,delta:v})}function h(_,v){a=$1.Push;let b=Zee(m.location,_,v);t&&t(b,_),c=u()+1;let y=qCe(b,c),C=m.createHref(b);try{s.pushState(y,"",C)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;r.location.assign(C)}o&&l&&l({action:a,location:m.location,delta:1})}function g(_,v){a=$1.Replace;let b=Zee(m.location,_,v);t&&t(b,_),c=u();let y=qCe(b,c),C=m.createHref(b);s.replaceState(y,"",C),o&&l&&l({action:a,location:m.location,delta:0})}function p(_){let v=r.location.origin!=="null"?r.location.origin:r.location.href,b=typeof _=="string"?_:q9(_);return Cl(v,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,v)}let m={get action(){return a},get location(){return n(r,s)},listen(_){if(l)throw new Error("A history only accepts one active listener");return r.addEventListener(UCe,d),l=_,()=>{r.removeEventListener(UCe,d),l=null}},createHref(_){return e(r,_)},createURL:p,encodeLocation(_){let v=p(_);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:g,go(_){return s.go(_)}};return m}var KCe;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(KCe||(KCe={}));function Zht(n,e,t){t===void 0&&(t="/");let i=typeof e=="string"?B2(e):e,r=Sde(i.pathname||"/",t);if(r==null)return null;let o=N4e(n);Jht(o);let s=null;for(let a=0;s==null&&a<o.length;++a)s=lft(o[a],dft(r));return s}function N4e(n,e,t,i){e===void 0&&(e=[]),t===void 0&&(t=[]),i===void 0&&(i="");let r=(o,s,a)=>{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};l.relativePath.startsWith("/")&&(Cl(l.relativePath.startsWith(i),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(i.length));let c=mC([i,l.relativePath]),u=t.concat(l);o.children&&o.children.length>0&&(Cl(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),N4e(o.children,e,u,c)),!(o.path==null&&!o.index)&&e.push({path:c,score:sft(c,o.index),routesMeta:u})};return n.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))r(o,s);else for(let l of O4e(o.path))r(o,s,l)}),e}function O4e(n){let e=n.split("/");if(e.length===0)return[];let[t,...i]=e,r=t.endsWith("?"),o=t.replace(/\?$/,"");if(i.length===0)return r?[o,""]:[o];let s=O4e(i.join("/")),a=[];return a.push(...s.map(l=>l===""?o:[o,l].join("/"))),r&&a.push(...s),a.map(l=>n.startsWith("/")&&l===""?"/":l)}function Jht(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:aft(e.routesMeta.map(i=>i.childrenIndex),t.routesMeta.map(i=>i.childrenIndex)))}const eft=/^:\w+$/,tft=3,nft=2,ift=1,rft=10,oft=-2,GCe=n=>n==="*";function sft(n,e){let t=n.split("/"),i=t.length;return t.some(GCe)&&(i+=oft),e&&(i+=nft),t.filter(r=>!GCe(r)).reduce((r,o)=>r+(eft.test(o)?tft:o===""?ift:rft),i)}function aft(n,e){return n.length===e.length&&n.slice(0,-1).every((i,r)=>i===e[r])?n[n.length-1]-e[e.length-1]:0}function lft(n,e){let{routesMeta:t}=n,i={},r="/",o=[];for(let s=0;s<t.length;++s){let a=t[s],l=s===t.length-1,c=r==="/"?e:e.slice(r.length)||"/",u=cft({path:a.relativePath,caseSensitive:a.caseSensitive,end:l},c);if(!u)return null;Object.assign(i,u.params);let d=a.route;o.push({params:i,pathname:mC([r,u.pathname]),pathnameBase:pft(mC([r,u.pathnameBase])),route:d}),u.pathnameBase!=="/"&&(r=mC([r,u.pathnameBase]))}return o}function Hdr(n,e){e===void 0&&(e={});let t=n;t.endsWith("*")&&t!=="*"&&!t.endsWith("/*")&&(pz(!1,'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".')),t=t.replace(/\*$/,"/*"));const i=t.startsWith("/")?"/":"",r=s=>s==null?"":typeof s=="string"?s:String(s),o=t.split(/\/+/).map((s,a,l)=>{if(a===l.length-1&&s==="*")return r(e["*"]);const u=s.match(/^:(\w+)(\??)$/);if(u){const[,d,h]=u;let g=e[d];return Cl(h==="?"||g!=null,'Missing ":'+d+'" param'),r(g)}return s.replace(/\?$/g,"")}).filter(s=>!!s);return i+o.join("/")}function cft(n,e){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[t,i]=uft(n.path,n.caseSensitive,n.end),r=e.match(t);if(!r)return null;let o=r[0],s=o.replace(/(.)\/+$/,"$1"),a=r.slice(1);return{params:i.reduce((c,u,d)=>{if(u==="*"){let h=a[d]||"";s=o.slice(0,o.length-h.length).replace(/(.)\/+$/,"$1")}return c[u]=hft(a[d]||"",u),c},{}),pathname:o,pathnameBase:s,pattern:n}}function uft(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),pz(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let i=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(s,a)=>(i.push(a),"/([^\\/]+)"));return n.endsWith("*")?(i.push("*"),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function dft(n){try{return decodeURI(n)}catch(e){return pz(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),n}}function hft(n,e){try{return decodeURIComponent(n)}catch(t){return pz(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+n+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+t+").")),n}}function Sde(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,i=n.charAt(t);return i&&i!=="/"?null:n.slice(t)||"/"}function fft(n,e){e===void 0&&(e="/");let{pathname:t,search:i="",hash:r=""}=typeof n=="string"?B2(n):n;return{pathname:t?t.startsWith("/")?t:gft(t,e):e,search:mft(i),hash:_ft(r)}}function gft(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function FY(n,e,t,i){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function Ede(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function xde(n,e,t,i){i===void 0&&(i=!1);let r;typeof n=="string"?r=B2(n):(r=TP({},n),Cl(!r.pathname||!r.pathname.includes("?"),FY("?","pathname","search",r)),Cl(!r.pathname||!r.pathname.includes("#"),FY("#","pathname","hash",r)),Cl(!r.search||!r.search.includes("#"),FY("#","search","hash",r)));let o=n===""||r.pathname==="",s=o?"/":r.pathname,a;if(i||s==null)a=t;else{let d=e.length-1;if(s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),d-=1;r.pathname=h.join("/")}a=d>=0?e[d]:"/"}let l=fft(r,a),c=s&&s!=="/"&&s.endsWith("/"),u=(o||s===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const mC=n=>n.join("/").replace(/\/\/+/g,"/"),pft=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),mft=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,_ft=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function vft(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const P4e=["post","put","patch","delete"];new Set(P4e);const bft=["get",...P4e];new Set(bft);/**
* React Router v6.17.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function K9(){return K9=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},K9.apply(this,arguments)}const kde=w.createContext(null),yft=w.createContext(null),$2=w.createContext(null),mz=w.createContext(null),bb=w.createContext({outlet:null,matches:[],isDataRoute:!1}),M4e=w.createContext(null);function Cft(n,e){let{relative:t}=e===void 0?{}:e;V2()||Cl(!1);let{basename:i,navigator:r}=w.useContext($2),{hash:o,pathname:s,search:a}=V4e(n,{relative:t}),l=s;return i!=="/"&&(l=s==="/"?i:mC([i,s])),r.createHref({pathname:l,search:a,hash:o})}function V2(){return w.useContext(mz)!=null}function ol(){return V2()||Cl(!1),w.useContext(mz).location}function F4e(n){w.useContext($2).static||w.useLayoutEffect(n)}function ri(){let{isDataRoute:n}=w.useContext(bb);return n?Pft():wft()}function wft(){V2()||Cl(!1);let n=w.useContext(kde),{basename:e,navigator:t}=w.useContext($2),{matches:i}=w.useContext(bb),{pathname:r}=ol(),o=JSON.stringify(Ede(i).map(l=>l.pathnameBase)),s=w.useRef(!1);return F4e(()=>{s.current=!0}),w.useCallback(function(l,c){if(c===void 0&&(c={}),!s.current)return;if(typeof l=="number"){t.go(l);return}let u=xde(l,JSON.parse(o),r,c.relative==="path");n==null&&e!=="/"&&(u.pathname=u.pathname==="/"?e:mC([e,u.pathname])),(c.replace?t.replace:t.push)(u,c.state,c)},[e,t,o,r,n])}const B4e=w.createContext(null);function $4e(){return w.useContext(B4e)}function Sft(n){let e=w.useContext(bb).outlet;return e&&w.createElement(B4e.Provider,{value:n},e)}function Fa(){let{matches:n}=w.useContext(bb),e=n[n.length-1];return e?e.params:{}}function V4e(n,e){let{relative:t}=e===void 0?{}:e,{matches:i}=w.useContext(bb),{pathname:r}=ol(),o=JSON.stringify(Ede(i).map(s=>s.pathnameBase));return w.useMemo(()=>xde(n,JSON.parse(o),r,t==="path"),[n,o,r,t])}function Eft(n,e){return xft(n,e)}function xft(n,e,t){V2()||Cl(!1);let{navigator:i}=w.useContext($2),{matches:r}=w.useContext(bb),o=r[r.length-1],s=o?o.params:{};o&&o.pathname;let a=o?o.pathnameBase:"/";o&&o.route;let l=ol(),c;if(e){var u;let m=typeof e=="string"?B2(e):e;a==="/"||(u=m.pathname)!=null&&u.startsWith(a)||Cl(!1),c=m}else c=l;let d=c.pathname||"/",h=a==="/"?d:d.slice(a.length)||"/",g=Zht(n,{pathname:h}),p=Dft(g&&g.map(m=>Object.assign({},m,{params:Object.assign({},s,m.params),pathname:mC([a,i.encodeLocation?i.encodeLocation(m.pathname).pathname:m.pathname]),pathnameBase:m.pathnameBase==="/"?a:mC([a,i.encodeLocation?i.encodeLocation(m.pathnameBase).pathname:m.pathnameBase])})),r,t);return e&&p?w.createElement(mz.Provider,{value:{location:K9({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:$1.Pop}},p):p}function kft(){let n=Oft(),e=vft(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},e),t?w.createElement("pre",{style:r},t):null,o)}const Tft=w.createElement(kft,null);class Ift extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?w.createElement(bb.Provider,{value:this.props.routeContext},w.createElement(M4e.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Lft(n){let{routeContext:e,match:t,children:i}=n,r=w.useContext(kde);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(bb.Provider,{value:e},i)}function Dft(n,e,t){var i;if(e===void 0&&(e=[]),t===void 0&&(t=null),n==null){var r;if((r=t)!=null&&r.errors)n=t.matches;else return null}let o=n,s=(i=t)==null?void 0:i.errors;if(s!=null){let a=o.findIndex(l=>l.route.id&&(s==null?void 0:s[l.route.id]));a>=0||Cl(!1),o=o.slice(0,Math.min(o.length,a+1))}return o.reduceRight((a,l,c)=>{let u=l.route.id?s==null?void 0:s[l.route.id]:null,d=null;t&&(d=l.route.errorElement||Tft);let h=e.concat(o.slice(0,c+1)),g=()=>{let p;return u?p=d:l.route.Component?p=w.createElement(l.route.Component,null):l.route.element?p=l.route.element:p=a,w.createElement(Lft,{match:l,routeContext:{outlet:a,matches:h,isDataRoute:t!=null},children:p})};return t&&(l.route.ErrorBoundary||l.route.errorElement||c===0)?w.createElement(Ift,{location:t.location,revalidation:t.revalidation,component:d,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):g()},null)}var H4e=function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n}(H4e||{}),G9=function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n}(G9||{});function Aft(n){let e=w.useContext(kde);return e||Cl(!1),e}function Rft(n){let e=w.useContext(yft);return e||Cl(!1),e}function Nft(n){let e=w.useContext(bb);return e||Cl(!1),e}function W4e(n){let e=Nft(),t=e.matches[e.matches.length-1];return t.route.id||Cl(!1),t.route.id}function Oft(){var n;let e=w.useContext(M4e),t=Rft(G9.UseRouteError),i=W4e(G9.UseRouteError);return e||((n=t.errors)==null?void 0:n[i])}function Pft(){let{router:n}=Aft(H4e.UseNavigateStable),e=W4e(G9.UseNavigateStable),t=w.useRef(!1);return F4e(()=>{t.current=!0}),w.useCallback(function(r,o){o===void 0&&(o={}),t.current&&(typeof r=="number"?n.navigate(r):n.navigate(r,K9({fromRouteId:e},o)))},[n,e])}function aD(n){let{to:e,replace:t,state:i,relative:r}=n;V2()||Cl(!1);let{matches:o}=w.useContext(bb),{pathname:s}=ol(),a=ri(),l=xde(e,Ede(o).map(u=>u.pathnameBase),s,r==="path"),c=JSON.stringify(l);return w.useEffect(()=>a(JSON.parse(c),{replace:t,state:i,relative:r}),[a,c,r,t,i]),null}function ah(n){return Sft(n.context)}function ge(n){Cl(!1)}function Mft(n){let{basename:e="/",children:t=null,location:i,navigationType:r=$1.Pop,navigator:o,static:s=!1}=n;V2()&&Cl(!1);let a=e.replace(/^\/*/,"/"),l=w.useMemo(()=>({basename:a,navigator:o,static:s}),[a,o,s]);typeof i=="string"&&(i=B2(i));let{pathname:c="/",search:u="",hash:d="",state:h=null,key:g="default"}=i,p=w.useMemo(()=>{let m=Sde(c,a);return m==null?null:{location:{pathname:m,search:u,hash:d,state:h,key:g},navigationType:r}},[a,c,u,d,h,g,r]);return p==null?null:w.createElement($2.Provider,{value:l},w.createElement(mz.Provider,{children:t,value:p}))}function Fft(n){let{children:e,location:t}=n;return Eft(Jee(e),t)}new Promise(()=>{});function Jee(n,e){e===void 0&&(e=[]);let t=[];return w.Children.forEach(n,(i,r)=>{if(!w.isValidElement(i))return;let o=[...e,r];if(i.type===w.Fragment){t.push.apply(t,Jee(i.props.children,o));return}i.type!==ge&&Cl(!1),!i.props.index||!i.props.children||Cl(!1);let s={id:i.props.id||o.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(s.children=Jee(i.props.children,o)),t.push(s)}),t}/**
* React Router DOM v6.17.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function ete(){return ete=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},ete.apply(this,arguments)}function Bft(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}function $ft(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function Vft(n,e){return n.button===0&&(!e||e==="_self")&&!$ft(n)}function tte(n){return n===void 0&&(n=""),new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((e,t)=>{let i=n[t];return e.concat(Array.isArray(i)?i.map(r=>[t,r]):[[t,i]])},[]))}function Hft(n,e){let t=tte(n);return e&&e.forEach((i,r)=>{t.has(r)||e.getAll(r).forEach(o=>{t.append(r,o)})}),t}const Wft=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],zft="startTransition",YCe=Rp[zft];function jft(n){let{basename:e,children:t,future:i,window:r}=n,o=w.useRef();o.current==null&&(o.current=Yht({window:r,v5Compat:!0}));let s=o.current,[a,l]=w.useState({action:s.action,location:s.location}),{v7_startTransition:c}=i||{},u=w.useCallback(d=>{c&&YCe?YCe(()=>l(d)):l(d)},[l,c]);return w.useLayoutEffect(()=>s.listen(u),[s,u]),w.createElement(Mft,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:s})}const Uft=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",qft=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,E0=w.forwardRef(function(e,t){let{onClick:i,relative:r,reloadDocument:o,replace:s,state:a,target:l,to:c,preventScrollReset:u,unstable_viewTransition:d}=e,h=Bft(e,Wft),{basename:g}=w.useContext($2),p,m=!1;if(typeof c=="string"&&qft.test(c)&&(p=c,Uft))try{let y=new URL(window.location.href),C=c.startsWith("//")?new URL(y.protocol+c):new URL(c),x=Sde(C.pathname,g);C.origin===y.origin&&x!=null?c=x+C.search+C.hash:m=!0}catch{}let _=Cft(c,{relative:r}),v=Kft(c,{replace:s,state:a,target:l,preventScrollReset:u,relative:r,unstable_viewTransition:d});function b(y){i&&i(y),y.defaultPrevented||v(y)}return w.createElement("a",ete({},h,{href:p||_,onClick:m||o?i:b,ref:t,target:l}))});var QCe;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(QCe||(QCe={}));var XCe;(function(n){n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(XCe||(XCe={}));function Kft(n,e){let{target:t,replace:i,state:r,preventScrollReset:o,relative:s,unstable_viewTransition:a}=e===void 0?{}:e,l=ri(),c=ol(),u=V4e(n,{relative:s});return w.useCallback(d=>{if(Vft(d,t)){d.preventDefault();let h=i!==void 0?i:q9(c)===q9(u);l(n,{replace:h,state:r,preventScrollReset:o,relative:s,unstable_viewTransition:a})}},[c,l,u,i,r,t,n,o,s,a])}function i3(n){let e=w.useRef(tte(n)),t=w.useRef(!1),i=ol(),r=w.useMemo(()=>Hft(i.search,t.current?null:e.current),[i.search]),o=ri(),s=w.useCallback((a,l)=>{const c=tte(typeof a=="function"?a(r):a);t.current=!0,o("?"+c,l)},[o,r]);return[r,s]}function su(n){for(var e=arguments.length,t=Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map(function(r){return"'"+r+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function of(n){return!!n&&!!n[$r]}function vg(n){var e;return!!n&&(function(t){if(!t||typeof t!="object")return!1;var i=Object.getPrototypeOf(t);if(i===null)return!0;var r=Object.hasOwnProperty.call(i,"constructor")&&i.constructor;return r===Object||typeof r=="function"&&Function.toString.call(r)===tgt}(n)||Array.isArray(n)||!!n[hL]||!!(!((e=n.constructor)===null||e===void 0)&&e[hL])||_z(n)||vz(n))}function z4e(n){return of(n)||su(23,n),n[$r].t}function d0(n,e,t){t===void 0&&(t=!1),GC(n)===0?(t?Object.keys:fL)(n).forEach(function(i){t&&typeof i=="symbol"||e(i,n[i],n)}):n.forEach(function(i,r){return e(r,i,n)})}function GC(n){var e=n[$r];return e?e.i>3?e.i-4:e.i:Array.isArray(n)?1:_z(n)?2:vz(n)?3:0}function _C(n,e){return GC(n)===2?n.has(e):Object.prototype.hasOwnProperty.call(n,e)}function J$(n,e){return GC(n)===2?n.get(e):n[e]}function j4e(n,e,t){var i=GC(n);i===2?n.set(e,t):i===3?n.add(t):n[e]=t}function U4e(n,e){return n===e?n!==0||1/n==1/e:n!=n&&e!=e}function _z(n){return Jft&&n instanceof Map}function vz(n){return egt&&n instanceof Set}function Jc(n){return n.o||n.t}function Tde(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var e=G4e(n);delete e[$r];for(var t=fL(e),i=0;i<t.length;i++){var r=t[i],o=e[r];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(e[r]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[r]})}return Object.create(Object.getPrototypeOf(n),e)}function r3(n,e){return e===void 0&&(e=!1),Ide(n)||of(n)||!vg(n)||(GC(n)>1&&(n.set=n.add=n.clear=n.delete=Gft),Object.freeze(n),e&&d0(n,function(t,i){return r3(i,!0)},!0)),n}function Gft(){su(2)}function Ide(n){return n==null||typeof n!="object"||Object.isFrozen(n)}function jv(n){var e=ite[n];return e||su(18,n),e}function Lde(n,e){ite[n]||(ite[n]=e)}function IP(){return DP}function BY(n,e){e&&(jv("Patches"),n.u=[],n.s=[],n.v=e)}function Y9(n){nte(n),n.p.forEach(Yft),n.p=null}function nte(n){n===DP&&(DP=n.l)}function ZCe(n){return DP={p:[],l:DP,h:n,m:!0,_:0}}function Yft(n){var e=n[$r];e.i===0||e.i===1?e.j():e.g=!0}function $Y(n,e){e._=e.p.length;var t=e.p[0],i=n!==void 0&&n!==t;return e.h.O||jv("ES5").S(e,n,i),i?(t[$r].P&&(Y9(e),su(4)),vg(n)&&(n=Q9(e,n),e.l||X9(e,n)),e.u&&jv("Patches").M(t[$r].t,n,e.u,e.s)):n=Q9(e,t,[]),Y9(e),e.u&&e.v(e.u,e.s),n!==yz?n:void 0}function Q9(n,e,t){if(Ide(e))return e;var i=e[$r];if(!i)return d0(e,function(a,l){return JCe(n,i,e,a,l,t)},!0),e;if(i.A!==n)return e;if(!i.P)return X9(n,i.t,!0),i.t;if(!i.I){i.I=!0,i.A._--;var r=i.i===4||i.i===5?i.o=Tde(i.k):i.o,o=r,s=!1;i.i===3&&(o=new Set(r),r.clear(),s=!0),d0(o,function(a,l){return JCe(n,i,r,a,l,t,s)}),X9(n,r,!1),t&&n.u&&jv("Patches").N(i,t,n.u,n.s)}return i.o}function JCe(n,e,t,i,r,o,s){if(of(r)){var a=Q9(n,r,o&&e&&e.i!==3&&!_C(e.R,i)?o.concat(i):void 0);if(j4e(t,i,a),!of(a))return;n.m=!1}else s&&t.add(r);if(vg(r)&&!Ide(r)){if(!n.h.D&&n._<1)return;Q9(n,r),e&&e.A.l||X9(n,r)}}function X9(n,e,t){t===void 0&&(t=!1),!n.l&&n.h.D&&n.m&&r3(e,t)}function VY(n,e){var t=n[$r];return(t?Jc(t):n)[e]}function ewe(n,e){if(e in n)for(var t=Object.getPrototypeOf(n);t;){var i=Object.getOwnPropertyDescriptor(t,e);if(i)return i;t=Object.getPrototypeOf(t)}}function Rh(n){n.P||(n.P=!0,n.l&&Rh(n.l))}function HY(n){n.o||(n.o=Tde(n.t))}function LP(n,e,t){var i=_z(e)?jv("MapSet").F(e,t):vz(e)?jv("MapSet").T(e,t):n.O?function(r,o){var s=Array.isArray(r),a={i:s?1:0,A:o?o.A:IP(),P:!1,I:!1,R:{},l:o,t:r,k:null,o:null,j:null,C:!1},l=a,c=AP;s&&(l=[a],c=pN);var u=Proxy.revocable(l,c),d=u.revoke,h=u.proxy;return a.k=h,a.j=d,h}(e,t):jv("ES5").J(e,t);return(t?t.A:IP()).p.push(i),i}function bz(n){return of(n)||su(22,n),function e(t){if(!vg(t))return t;var i,r=t[$r],o=GC(t);if(r){if(!r.P&&(r.i<4||!jv("ES5").K(r)))return r.t;r.I=!0,i=twe(t,o),r.I=!1}else i=twe(t,o);return d0(i,function(s,a){r&&J$(r.t,s)===a||j4e(i,s,e(a))}),o===3?new Set(i):i}(n)}function twe(n,e){switch(e){case 2:return new Map(n);case 3:return Array.from(n)}return Tde(n)}function Dde(){function n(o,s){var a=r[o];return a?a.enumerable=s:r[o]=a={configurable:!0,enumerable:s,get:function(){var l=this[$r];return AP.get(l,o)},set:function(l){var c=this[$r];AP.set(c,o,l)}},a}function e(o){for(var s=o.length-1;s>=0;s--){var a=o[s][$r];if(!a.P)switch(a.i){case 5:i(a)&&Rh(a);break;case 4:t(a)&&Rh(a)}}}function t(o){for(var s=o.t,a=o.k,l=fL(a),c=l.length-1;c>=0;c--){var u=l[c];if(u!==$r){var d=s[u];if(d===void 0&&!_C(s,u))return!0;var h=a[u],g=h&&h[$r];if(g?g.t!==d:!U4e(h,d))return!0}}var p=!!s[$r];return l.length!==fL(s).length+(p?0:1)}function i(o){var s=o.k;if(s.length!==o.t.length)return!0;var a=Object.getOwnPropertyDescriptor(s,s.length-1);if(a&&!a.get)return!0;for(var l=0;l<s.length;l++)if(!s.hasOwnProperty(l))return!0;return!1}var r={};Lde("ES5",{J:function(o,s){var a=Array.isArray(o),l=function(u,d){if(u){for(var h=Array(d.length),g=0;g<d.length;g++)Object.defineProperty(h,""+g,n(g,!0));return h}var p=G4e(d);delete p[$r];for(var m=fL(p),_=0;_<m.length;_++){var v=m[_];p[v]=n(v,u||!!p[v].enumerable)}return Object.create(Object.getPrototypeOf(d),p)}(a,o),c={i:a?5:4,A:s?s.A:IP(),P:!1,I:!1,R:{},l:s,t:o,k:l,o:null,g:!1,C:!1};return Object.defineProperty(l,$r,{value:c,writable:!0}),l},S:function(o,s,a){a?of(s)&&s[$r].A===o&&e(o.p):(o.u&&function l(c){if(c&&typeof c=="object"){var u=c[$r];if(u){var d=u.t,h=u.k,g=u.R,p=u.i;if(p===4)d0(h,function(y){y!==$r&&(d[y]!==void 0||_C(d,y)?g[y]||l(h[y]):(g[y]=!0,Rh(u)))}),d0(d,function(y){h[y]!==void 0||_C(h,y)||(g[y]=!1,Rh(u))});else if(p===5){if(i(u)&&(Rh(u),g.length=!0),h.length<d.length)for(var m=h.length;m<d.length;m++)g[m]=!1;else for(var _=d.length;_<h.length;_++)g[_]=!0;for(var v=Math.min(h.length,d.length),b=0;b<v;b++)h.hasOwnProperty(b)||(g[b]=!0),g[b]===void 0&&l(h[b])}}}}(o.p[0]),e(o.p))},K:function(o){return o.i===4?t(o):i(o)}})}function q4e(){function n(i){if(!vg(i))return i;if(Array.isArray(i))return i.map(n);if(_z(i))return new Map(Array.from(i.entries()).map(function(s){return[s[0],n(s[1])]}));if(vz(i))return new Set(Array.from(i).map(n));var r=Object.create(Object.getPrototypeOf(i));for(var o in i)r[o]=n(i[o]);return _C(i,hL)&&(r[hL]=i[hL]),r}function e(i){return of(i)?n(i):i}var t="add";Lde("Patches",{$:function(i,r){return r.forEach(function(o){for(var s=o.path,a=o.op,l=i,c=0;c<s.length-1;c++){var u=GC(l),d=s[c];typeof d!="string"&&typeof d!="number"&&(d=""+d),u!==0&&u!==1||d!=="__proto__"&&d!=="constructor"||su(24),typeof l=="function"&&d==="prototype"&&su(24),typeof(l=J$(l,d))!="object"&&su(15,s.join("/"))}var h=GC(l),g=n(o.value),p=s[s.length-1];switch(a){case"replace":switch(h){case 2:return l.set(p,g);case 3:su(16);default:return l[p]=g}case t:switch(h){case 1:return p==="-"?l.push(g):l.splice(p,0,g);case 2:return l.set(p,g);case 3:return l.add(g);default:return l[p]=g}case"remove":switch(h){case 1:return l.splice(p,1);case 2:return l.delete(p);case 3:return l.delete(o.value);default:return delete l[p]}default:su(17,a)}}),i},N:function(i,r,o,s){switch(i.i){case 0:case 4:case 2:return function(a,l,c,u){var d=a.t,h=a.o;d0(a.R,function(g,p){var m=J$(d,g),_=J$(h,g),v=p?_C(d,g)?"replace":t:"remove";if(m!==_||v!=="replace"){var b=l.concat(g);c.push(v==="remove"?{op:v,path:b}:{op:v,path:b,value:_}),u.push(v===t?{op:"remove",path:b}:v==="remove"?{op:t,path:b,value:e(m)}:{op:"replace",path:b,value:e(m)})}})}(i,r,o,s);case 5:case 1:return function(a,l,c,u){var d=a.t,h=a.R,g=a.o;if(g.length<d.length){var p=[g,d];d=p[0],g=p[1];var m=[u,c];c=m[0],u=m[1]}for(var _=0;_<d.length;_++)if(h[_]&&g[_]!==d[_]){var v=l.concat([_]);c.push({op:"replace",path:v,value:e(g[_])}),u.push({op:"replace",path:v,value:e(d[_])})}for(var b=d.length;b<g.length;b++){var y=l.concat([b]);c.push({op:t,path:y,value:e(g[b])})}d.length<g.length&&u.push({op:"replace",path:l.concat(["length"]),value:d.length})}(i,r,o,s);case 3:return function(a,l,c,u){var d=a.t,h=a.o,g=0;d.forEach(function(p){if(!h.has(p)){var m=l.concat([g]);c.push({op:"remove",path:m,value:p}),u.unshift({op:t,path:m,value:p})}g++}),g=0,h.forEach(function(p){if(!d.has(p)){var m=l.concat([g]);c.push({op:t,path:m,value:p}),u.unshift({op:"remove",path:m,value:p})}g++})}(i,r,o,s)}},M:function(i,r,o,s){o.push({op:"replace",path:[],value:r===yz?void 0:r}),s.push({op:"replace",path:[],value:i})}})}function K4e(){function n(a,l){function c(){this.constructor=a}r(a,l),a.prototype=(c.prototype=l.prototype,new c)}function e(a){a.o||(a.R=new Map,a.o=new Map(a.t))}function t(a){a.o||(a.o=new Set,a.t.forEach(function(l){if(vg(l)){var c=LP(a.A.h,l,a);a.p.set(l,c),a.o.add(c)}else a.o.add(l)}))}function i(a){a.g&&su(3,JSON.stringify(Jc(a)))}var r=function(a,l){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,u){c.__proto__=u}||function(c,u){for(var d in u)u.hasOwnProperty(d)&&(c[d]=u[d])})(a,l)},o=function(){function a(c,u){return this[$r]={i:2,l:u,A:u?u.A:IP(),P:!1,I:!1,o:void 0,R:void 0,t:c,k:this,C:!1,g:!1},this}n(a,Map);var l=a.prototype;return Object.defineProperty(l,"size",{get:function(){return Jc(this[$r]).size}}),l.has=function(c){return Jc(this[$r]).has(c)},l.set=function(c,u){var d=this[$r];return i(d),Jc(d).has(c)&&Jc(d).get(c)===u||(e(d),Rh(d),d.R.set(c,!0),d.o.set(c,u),d.R.set(c,!0)),this},l.delete=function(c){if(!this.has(c))return!1;var u=this[$r];return i(u),e(u),Rh(u),u.t.has(c)?u.R.set(c,!1):u.R.delete(c),u.o.delete(c),!0},l.clear=function(){var c=this[$r];i(c),Jc(c).size&&(e(c),Rh(c),c.R=new Map,d0(c.t,function(u){c.R.set(u,!1)}),c.o.clear())},l.forEach=function(c,u){var d=this;Jc(this[$r]).forEach(function(h,g){c.call(u,d.get(g),g,d)})},l.get=function(c){var u=this[$r];i(u);var d=Jc(u).get(c);if(u.I||!vg(d)||d!==u.t.get(c))return d;var h=LP(u.A.h,d,u);return e(u),u.o.set(c,h),h},l.keys=function(){return Jc(this[$r]).keys()},l.values=function(){var c,u=this,d=this.keys();return(c={})[c6]=function(){return u.values()},c.next=function(){var h=d.next();return h.done?h:{done:!1,value:u.get(h.value)}},c},l.entries=function(){var c,u=this,d=this.keys();return(c={})[c6]=function(){return u.entries()},c.next=function(){var h=d.next();if(h.done)return h;var g=u.get(h.value);return{done:!1,value:[h.value,g]}},c},l[c6]=function(){return this.entries()},a}(),s=function(){function a(c,u){return this[$r]={i:3,l:u,A:u?u.A:IP(),P:!1,I:!1,o:void 0,t:c,k:this,p:new Map,g:!1,C:!1},this}n(a,Set);var l=a.prototype;return Object.defineProperty(l,"size",{get:function(){return Jc(this[$r]).size}}),l.has=function(c){var u=this[$r];return i(u),u.o?!!u.o.has(c)||!(!u.p.has(c)||!u.o.has(u.p.get(c))):u.t.has(c)},l.add=function(c){var u=this[$r];return i(u),this.has(c)||(t(u),Rh(u),u.o.add(c)),this},l.delete=function(c){if(!this.has(c))return!1;var u=this[$r];return i(u),t(u),Rh(u),u.o.delete(c)||!!u.p.has(c)&&u.o.delete(u.p.get(c))},l.clear=function(){var c=this[$r];i(c),Jc(c).size&&(t(c),Rh(c),c.o.clear())},l.values=function(){var c=this[$r];return i(c),t(c),c.o.values()},l.entries=function(){var c=this[$r];return i(c),t(c),c.o.entries()},l.keys=function(){return this.values()},l[c6]=function(){return this.values()},l.forEach=function(c,u){for(var d=this.values(),h=d.next();!h.done;)c.call(u,h.value,h.value,this),h=d.next()},a}();Lde("MapSet",{F:function(a,l){return new o(a,l)},T:function(a,l){return new s(a,l)}})}function Qft(){Dde(),K4e(),q4e()}function Xft(n){return n}function Zft(n){return n}var nwe,DP,Ade=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Jft=typeof Map<"u",egt=typeof Set<"u",iwe=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",yz=Ade?Symbol.for("immer-nothing"):((nwe={})["immer-nothing"]=!0,nwe),hL=Ade?Symbol.for("immer-draftable"):"__$immer_draftable",$r=Ade?Symbol.for("immer-state"):"__$immer_state",c6=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",tgt=""+Object.prototype.constructor,fL=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,G4e=Object.getOwnPropertyDescriptors||function(n){var e={};return fL(n).forEach(function(t){e[t]=Object.getOwnPropertyDescriptor(n,t)}),e},ite={},AP={get:function(n,e){if(e===$r)return n;var t=Jc(n);if(!_C(t,e))return function(r,o,s){var a,l=ewe(o,s);return l?"value"in l?l.value:(a=l.get)===null||a===void 0?void 0:a.call(r.k):void 0}(n,t,e);var i=t[e];return n.I||!vg(i)?i:i===VY(n.t,e)?(HY(n),n.o[e]=LP(n.A.h,i,n)):i},has:function(n,e){return e in Jc(n)},ownKeys:function(n){return Reflect.ownKeys(Jc(n))},set:function(n,e,t){var i=ewe(Jc(n),e);if(i!=null&&i.set)return i.set.call(n.k,t),!0;if(!n.P){var r=VY(Jc(n),e),o=r==null?void 0:r[$r];if(o&&o.t===t)return n.o[e]=t,n.R[e]=!1,!0;if(U4e(t,r)&&(t!==void 0||_C(n.t,e)))return!0;HY(n),Rh(n)}return n.o[e]===t&&(t!==void 0||e in n.o)||Number.isNaN(t)&&Number.isNaN(n.o[e])||(n.o[e]=t,n.R[e]=!0),!0},deleteProperty:function(n,e){return VY(n.t,e)!==void 0||e in n.t?(n.R[e]=!1,HY(n),Rh(n)):delete n.R[e],n.o&&delete n.o[e],!0},getOwnPropertyDescriptor:function(n,e){var t=Jc(n),i=Reflect.getOwnPropertyDescriptor(t,e);return i&&{writable:!0,configurable:n.i!==1||e!=="length",enumerable:i.enumerable,value:t[e]}},defineProperty:function(){su(11)},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){su(12)}},pN={};d0(AP,function(n,e){pN[n]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),pN.deleteProperty=function(n,e){return pN.set.call(this,n,e,void 0)},pN.set=function(n,e,t){return AP.set.call(this,n[0],e,t,n[0])};var Y4e=function(){function n(t){var i=this;this.O=iwe,this.D=!0,this.produce=function(r,o,s){if(typeof r=="function"&&typeof o!="function"){var a=o;o=r;var l=i;return function(m){var _=this;m===void 0&&(m=a);for(var v=arguments.length,b=Array(v>1?v-1:0),y=1;y<v;y++)b[y-1]=arguments[y];return l.produce(m,function(C){var x;return(x=o).call.apply(x,[_,C].concat(b))})}}var c;if(typeof o!="function"&&su(6),s!==void 0&&typeof s!="function"&&su(7),vg(r)){var u=ZCe(i),d=LP(i,r,void 0),h=!0;try{c=o(d),h=!1}finally{h?Y9(u):nte(u)}return typeof Promise<"u"&&c instanceof Promise?c.then(function(m){return BY(u,s),$Y(m,u)},function(m){throw Y9(u),m}):(BY(u,s),$Y(c,u))}if(!r||typeof r!="object"){if((c=o(r))===void 0&&(c=r),c===yz&&(c=void 0),i.D&&r3(c,!0),s){var g=[],p=[];jv("Patches").M(r,c,g,p),s(g,p)}return c}su(21,r)},this.produceWithPatches=function(r,o){if(typeof r=="function")return function(c){for(var u=arguments.length,d=Array(u>1?u-1:0),h=1;h<u;h++)d[h-1]=arguments[h];return i.produceWithPatches(c,function(g){return r.apply(void 0,[g].concat(d))})};var s,a,l=i.produce(r,o,function(c,u){s=c,a=u});return typeof Promise<"u"&&l instanceof Promise?l.then(function(c){return[c,s,a]}):[l,s,a]},typeof(t==null?void 0:t.useProxies)=="boolean"&&this.setUseProxies(t.useProxies),typeof(t==null?void 0:t.autoFreeze)=="boolean"&&this.setAutoFreeze(t.autoFreeze)}var e=n.prototype;return e.createDraft=function(t){vg(t)||su(8),of(t)&&(t=bz(t));var i=ZCe(this),r=LP(this,t,void 0);return r[$r].C=!0,nte(i),r},e.finishDraft=function(t,i){var r=t&&t[$r],o=r.A;return BY(o,i),$Y(void 0,o)},e.setAutoFreeze=function(t){this.D=t},e.setUseProxies=function(t){t&&!iwe&&su(20),this.O=t},e.applyPatches=function(t,i){var r;for(r=i.length-1;r>=0;r--){var o=i[r];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}r>-1&&(i=i.slice(r+1));var s=jv("Patches").$;return of(t)?s(t,i):this.produce(t,function(a){return s(a,i)})},n}(),bg=new Y4e,lD=bg.produce,ngt=bg.produceWithPatches.bind(bg),igt=bg.setAutoFreeze.bind(bg),rgt=bg.setUseProxies.bind(bg),ogt=bg.applyPatches.bind(bg),sgt=bg.createDraft.bind(bg),agt=bg.finishDraft.bind(bg);const lgt=Object.freeze(Object.defineProperty({__proto__:null,Immer:Y4e,applyPatches:ogt,castDraft:Xft,castImmutable:Zft,createDraft:sgt,current:bz,default:lD,enableAllPlugins:Qft,enableES5:Dde,enableMapSet:K4e,enablePatches:q4e,finishDraft:agt,freeze:r3,immerable:hL,isDraft:of,isDraftable:vg,nothing:yz,original:z4e,produce:lD,produceWithPatches:ngt,setAutoFreeze:igt,setUseProxies:rgt},Symbol.toStringTag,{value:"Module"}));function rwe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Qe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?rwe(Object(t),!0).forEach(function(i){$e(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):rwe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Eu(n){return"Minified Redux error #"+n+"; visit https://redux.js.org/Errors?code="+n+" for the full message or use the non-minified dev environment for full errors. "}var owe=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),WY=function(){return Math.random().toString(36).substring(7).split("").join(".")},RP={INIT:"@@redux/INIT"+WY(),REPLACE:"@@redux/REPLACE"+WY(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+WY()}};function cgt(n){if(typeof n!="object"||n===null)return!1;for(var e=n;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(n)===e}function o3(n,e,t){var i;if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(Eu(0));if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(Eu(1));return t(o3)(n,e)}if(typeof n!="function")throw new Error(Eu(2));var r=n,o=e,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(Eu(3));return o}function d(m){if(typeof m!="function")throw new Error(Eu(4));if(l)throw new Error(Eu(5));var _=!0;return c(),a.push(m),function(){if(_){if(l)throw new Error(Eu(6));_=!1,c();var b=a.indexOf(m);a.splice(b,1),s=null}}}function h(m){if(!cgt(m))throw new Error(Eu(7));if(typeof m.type>"u")throw new Error(Eu(8));if(l)throw new Error(Eu(9));try{l=!0,o=r(o,m)}finally{l=!1}for(var _=s=a,v=0;v<_.length;v++){var b=_[v];b()}return m}function g(m){if(typeof m!="function")throw new Error(Eu(10));r=m,h({type:RP.REPLACE})}function p(){var m,_=d;return m={subscribe:function(b){if(typeof b!="object"||b===null)throw new Error(Eu(11));function y(){b.next&&b.next(u())}y();var C=_(y);return{unsubscribe:C}}},m[owe]=function(){return this},m}return h({type:RP.INIT}),i={dispatch:h,subscribe:d,getState:u,replaceReducer:g},i[owe]=p,i}var ugt=o3;function dgt(n){Object.keys(n).forEach(function(e){var t=n[e],i=t(void 0,{type:RP.INIT});if(typeof i>"u")throw new Error(Eu(12));if(typeof t(void 0,{type:RP.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Eu(13))})}function Q4e(n){for(var e=Object.keys(n),t={},i=0;i<e.length;i++){var r=e[i];typeof n[r]=="function"&&(t[r]=n[r])}var o=Object.keys(t),s;try{dgt(t)}catch(a){s=a}return function(l,c){if(l===void 0&&(l={}),s)throw s;for(var u=!1,d={},h=0;h<o.length;h++){var g=o[h],p=t[g],m=l[g],_=p(m,c);if(typeof _>"u")throw c&&c.type,new Error(Eu(14));d[g]=_,u=u||_!==m}return u=u||o.length!==Object.keys(l).length,u?d:l}}function swe(n,e){return function(){return e(n.apply(this,arguments))}}function rte(n,e){if(typeof n=="function")return swe(n,e);if(typeof n!="object"||n===null)throw new Error(Eu(16));var t={};for(var i in n){var r=n[i];typeof r=="function"&&(t[i]=swe(r,e))}return t}function cD(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.length===0?function(i){return i}:e.length===1?e[0]:e.reduce(function(i,r){return function(){return i(r.apply(void 0,arguments))}})}function Rde(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return function(i){return function(){var r=i.apply(void 0,arguments),o=function(){throw new Error(Eu(15))},s={getState:r.getState,dispatch:function(){return o.apply(void 0,arguments)}},a=e.map(function(l){return l(s)});return o=cD.apply(void 0,a)(r.dispatch),Qe(Qe({},r),{},{dispatch:o})}}}var Z9="NOT_FOUND";function hgt(n){var e;return{get:function(i){return e&&n(e.key,i)?e.value:Z9},put:function(i,r){e={key:i,value:r}},getEntries:function(){return e?[e]:[]},clear:function(){e=void 0}}}function fgt(n,e){var t=[];function i(a){var l=t.findIndex(function(u){return e(a,u.key)});if(l>-1){var c=t[l];return l>0&&(t.splice(l,1),t.unshift(c)),c.value}return Z9}function r(a,l){i(a)===Z9&&(t.unshift({key:a,value:l}),t.length>n&&t.pop())}function o(){return t}function s(){t=[]}return{get:i,put:r,getEntries:o,clear:s}}var X4e=function(e,t){return e===t};function ggt(n){return function(t,i){if(t===null||i===null||t.length!==i.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!n(t[o],i[o]))return!1;return!0}}function Z4e(n,e){var t=typeof e=="object"?e:{equalityCheck:e},i=t.equalityCheck,r=i===void 0?X4e:i,o=t.maxSize,s=o===void 0?1:o,a=t.resultEqualityCheck,l=ggt(r),c=s===1?hgt(l):fgt(s,l);function u(){var d=c.get(arguments);if(d===Z9){if(d=n.apply(null,arguments),a){var h=c.getEntries(),g=h.find(function(p){return a(p.value,d)});g&&(d=g.value)}c.put(arguments,d)}return d}return u.clearCache=function(){return c.clear()},u}function pgt(n){var e=Array.isArray(n[0])?n[0]:n;if(!e.every(function(i){return typeof i=="function"})){var t=e.map(function(i){return typeof i=="function"?"function "+(i.name||"unnamed")+"()":typeof i}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+t+"]")}return e}function J4e(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];var r=function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];var c=0,u,d={memoizeOptions:void 0},h=a.pop();if(typeof h=="object"&&(d=h,h=a.pop()),typeof h!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof h+"]");var g=d,p=g.memoizeOptions,m=p===void 0?t:p,_=Array.isArray(m)?m:[m],v=pgt(a),b=n.apply(void 0,[function(){return c++,h.apply(null,arguments)}].concat(_)),y=n(function(){for(var x=[],k=v.length,I=0;I<k;I++)x.push(v[I].apply(null,arguments));return u=b.apply(null,x),u});return Object.assign(y,{resultFunc:h,memoizedResultFunc:b,dependencies:v,lastResult:function(){return u},recomputations:function(){return c},resetRecomputations:function(){return c=0}}),y};return r}var Cz=J4e(Z4e),mgt=function(e,t){if(t===void 0&&(t=Cz),typeof e!="object")throw new Error("createStructuredSelector expects first argument to be an object "+("where each property is a selector, instead received a "+typeof e));var i=Object.keys(e),r=t(i.map(function(o){return e[o]}),function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return s.reduce(function(l,c,u){return l[i[u]]=c,l},{})});return r};const _gt=Object.freeze(Object.defineProperty({__proto__:null,createSelector:Cz,createSelectorCreator:J4e,createStructuredSelector:mgt,defaultEqualityCheck:X4e,defaultMemoize:Z4e},Symbol.toStringTag,{value:"Module"}));function e3e(n){var e=function(i){var r=i.dispatch,o=i.getState;return function(s){return function(a){return typeof a=="function"?a(r,o,n):s(a)}}};return e}var t3e=e3e();t3e.withExtraArgument=e3e;const awe=t3e;var n3e=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),s3=globalThis&&globalThis.__generator||function(n,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,r&&(o=c[0]&2?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,r=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){t.label=c[1];break}if(c[0]===6&&t.label<o[1]){t.label=o[1],o=c;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(c);break}o[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(u){c=[6,u],r=0}finally{i=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},YC=globalThis&&globalThis.__spreadArray||function(n,e){for(var t=0,i=e.length,r=n.length;t<i;t++,r++)n[r]=e[t];return n},vgt=Object.defineProperty,bgt=Object.defineProperties,ygt=Object.getOwnPropertyDescriptors,lwe=Object.getOwnPropertySymbols,Cgt=Object.prototype.hasOwnProperty,wgt=Object.prototype.propertyIsEnumerable,cwe=function(n,e,t){return e in n?vgt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t},Wh=function(n,e){for(var t in e||(e={}))Cgt.call(e,t)&&cwe(n,t,e[t]);if(lwe)for(var i=0,r=lwe(e);i<r.length;i++){var t=r[i];wgt.call(e,t)&&cwe(n,t,e[t])}return n},zY=function(n,e){return bgt(n,ygt(e))},a3=function(n,e,t){return new Promise(function(i,r){var o=function(l){try{a(t.next(l))}catch(c){r(c)}},s=function(l){try{a(t.throw(l))}catch(c){r(c)}},a=function(l){return l.done?i(l.value):Promise.resolve(l.value).then(o,s)};a((t=t.apply(n,e)).next())})},ry=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=Cz.apply(void 0,n),i=function(r){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];return t.apply(void 0,YC([of(r)?bz(r):r],o))};return i},Sgt=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?cD:cD.apply(null,arguments)};function wz(n){if(typeof n!="object"||n===null)return!1;var e=Object.getPrototypeOf(n);if(e===null)return!0;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return e===t}var i3e=function(n){return n&&typeof n.match=="function"};function Uv(n,e){function t(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];if(e){var o=e.apply(void 0,i);if(!o)throw new Error("prepareAction did not return an object");return Wh(Wh({type:n,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:n,payload:i[0]}}return t.toString=function(){return""+n},t.type=n,t.match=function(i){return i.type===n},t}function Nde(n){return wz(n)&&"type"in n}function Egt(n){return typeof n=="function"&&"type"in n&&i3e(n)}function r3e(n){return Nde(n)&&typeof n.type=="string"&&Object.keys(n).every(xgt)}function xgt(n){return["type","payload","error","meta"].indexOf(n)>-1}function kgt(n){return""+n}function Tgt(n){return function(){return function(e){return function(t){return e(t)}}}}var o3e=function(n){n3e(e,n);function e(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var r=n.apply(this,t)||this;return Object.setPrototypeOf(r,e.prototype),r}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return n.prototype.concat.apply(this,t)},e.prototype.prepend=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return t.length===1&&Array.isArray(t[0])?new(e.bind.apply(e,YC([void 0],t[0].concat(this)))):new(e.bind.apply(e,YC([void 0],t.concat(this))))},e}(Array),s3e=function(n){n3e(e,n);function e(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var r=n.apply(this,t)||this;return Object.setPrototypeOf(r,e.prototype),r}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return n.prototype.concat.apply(this,t)},e.prototype.prepend=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return t.length===1&&Array.isArray(t[0])?new(e.bind.apply(e,YC([void 0],t[0].concat(this)))):new(e.bind.apply(e,YC([void 0],t.concat(this))))},e}(Array);function ote(n){return vg(n)?lD(n,function(){}):n}function Igt(n){return typeof n!="object"||n==null||Object.isFrozen(n)}function Lgt(n){return function(){return function(e){return function(t){return e(t)}}}}function a3e(n){var e=typeof n;return n==null||e==="string"||e==="boolean"||e==="number"||Array.isArray(n)||wz(n)}function l3e(n,e,t,i,r,o){e===void 0&&(e=""),t===void 0&&(t=a3e),r===void 0&&(r=[]);var s;if(!t(n))return{keyPath:e||"<root>",value:n};if(typeof n!="object"||n===null||o!=null&&o.has(n))return!1;for(var a=i!=null?i(n):Object.entries(n),l=r.length>0,c=function(_,v){var b=e?e+"."+_:_;if(l){var y=r.some(function(C){return C instanceof RegExp?C.test(b):b===C});if(y)return"continue"}if(!t(v))return{value:{keyPath:b,value:v}};if(typeof v=="object"&&(s=l3e(v,b,t,i,r,o),s))return{value:s}},u=0,d=a;u<d.length;u++){var h=d[u],g=h[0],p=h[1],m=c(g,p);if(typeof m=="object")return m.value}return o&&c3e(n)&&o.add(n),!1}function c3e(n){if(!Object.isFrozen(n))return!1;for(var e=0,t=Object.values(n);e<t.length;e++){var i=t[e];if(!(typeof i!="object"||i===null)&&!c3e(i))return!1}return!0}function Dgt(n){return function(){return function(e){return function(t){return e(t)}}}}function Agt(n){return typeof n=="boolean"}function Rgt(){return function(e){return u3e(e)}}function u3e(n){n===void 0&&(n={});var e=n.thunk,t=e===void 0?!0:e;n.immutableCheck,n.serializableCheck,n.actionCreatorCheck;var i=new o3e;return t&&(Agt(t)?i.push(awe):i.push(awe.withExtraArgument(t.extraArgument))),i}var Ngt=!0;function d3e(n){var e=Rgt(),t=n||{},i=t.reducer,r=i===void 0?void 0:i,o=t.middleware,s=o===void 0?e():o,a=t.devTools,l=a===void 0?!0:a,c=t.preloadedState,u=c===void 0?void 0:c,d=t.enhancers,h=d===void 0?void 0:d,g;if(typeof r=="function")g=r;else if(wz(r))g=Q4e(r);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var p=s;typeof p=="function"&&(p=p(e));var m=Rde.apply(void 0,p),_=cD;l&&(_=Sgt(Wh({trace:!Ngt},typeof l=="object"&&l)));var v=new s3e(m),b=v;Array.isArray(h)?b=YC([m],h):typeof h=="function"&&(b=h(v));var y=_.apply(void 0,b);return o3(g,u,y)}function h3e(n){var e={},t=[],i,r={addCase:function(o,s){var a=typeof o=="string"?o:o.type;if(!a)throw new Error("`builder.addCase` cannot be called with an empty action type");if(a in e)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return e[a]=s,r},addMatcher:function(o,s){return t.push({matcher:o,reducer:s}),r},addDefaultCase:function(o){return i=o,r}};return n(r),[e,t,i]}function Ogt(n){return typeof n=="function"}function f3e(n,e,t,i){t===void 0&&(t=[]);var r=typeof e=="function"?h3e(e):[e,t,i],o=r[0],s=r[1],a=r[2],l;if(Ogt(n))l=function(){return ote(n())};else{var c=ote(n);l=function(){return c}}function u(d,h){d===void 0&&(d=l());var g=YC([o[h.type]],s.filter(function(p){var m=p.matcher;return m(h)}).map(function(p){var m=p.reducer;return m}));return g.filter(function(p){return!!p}).length===0&&(g=[a]),g.reduce(function(p,m){if(m)if(of(p)){var _=p,v=m(_,h);return v===void 0?p:v}else{if(vg(p))return lD(p,function(b){return m(b,h)});var v=m(p,h);if(v===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}return p},d)}return u.getInitialState=l,u}function Pgt(n,e){return n+"/"+e}function H2(n){var e=n.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var t=typeof n.initialState=="function"?n.initialState:ote(n.initialState),i=n.reducers||{},r=Object.keys(i),o={},s={},a={};r.forEach(function(u){var d=i[u],h=Pgt(e,u),g,p;"reducer"in d?(g=d.reducer,p=d.prepare):g=d,o[u]=g,s[h]=g,a[u]=p?Uv(h,p):Uv(h)});function l(){var u=typeof n.extraReducers=="function"?h3e(n.extraReducers):[n.extraReducers],d=u[0],h=d===void 0?{}:d,g=u[1],p=g===void 0?[]:g,m=u[2],_=m===void 0?void 0:m,v=Wh(Wh({},h),s);return f3e(t,function(b){for(var y in v)b.addCase(y,v[y]);for(var C=0,x=p;C<x.length;C++){var k=x[C];b.addMatcher(k.matcher,k.reducer)}_&&b.addDefaultCase(_)})}var c;return{name:e,reducer:function(u,d){return c||(c=l()),c(u,d)},actions:a,caseReducers:o,getInitialState:function(){return c||(c=l()),c.getInitialState()}}}function Mgt(){return{ids:[],entities:{}}}function Fgt(){function n(e){return e===void 0&&(e={}),Object.assign(Mgt(),e)}return{getInitialState:n}}function Bgt(){function n(e){var t=function(c){return c.ids},i=function(c){return c.entities},r=ry(t,i,function(c,u){return c.map(function(d){return u[d]})}),o=function(c,u){return u},s=function(c,u){return c[u]},a=ry(t,function(c){return c.length});if(!e)return{selectIds:t,selectEntities:i,selectAll:r,selectTotal:a,selectById:ry(i,o,s)};var l=ry(e,i);return{selectIds:ry(e,t),selectEntities:l,selectAll:ry(e,r),selectTotal:ry(e,a),selectById:ry(l,o,s)}}return{getSelectors:n}}function $gt(n){var e=Pl(function(t,i){return n(i)});return function(i){return e(i,void 0)}}function Pl(n){return function(t,i){function r(s){return r3e(s)}var o=function(s){r(i)?n(i.payload,s):n(i,s)};return of(t)?(o(t),t):lD(t,o)}}function iO(n,e){var t=e(n);return t}function BE(n){return Array.isArray(n)||(n=Object.values(n)),n}function g3e(n,e,t){n=BE(n);for(var i=[],r=[],o=0,s=n;o<s.length;o++){var a=s[o],l=iO(a,e);l in t.entities?r.push({id:l,changes:a}):i.push(a)}return[i,r]}function p3e(n){function e(p,m){var _=iO(p,n);_ in m.entities||(m.ids.push(_),m.entities[_]=p)}function t(p,m){p=BE(p);for(var _=0,v=p;_<v.length;_++){var b=v[_];e(b,m)}}function i(p,m){var _=iO(p,n);_ in m.entities||m.ids.push(_),m.entities[_]=p}function r(p,m){p=BE(p);for(var _=0,v=p;_<v.length;_++){var b=v[_];i(b,m)}}function o(p,m){p=BE(p),m.ids=[],m.entities={},t(p,m)}function s(p,m){return a([p],m)}function a(p,m){var _=!1;p.forEach(function(v){v in m.entities&&(delete m.entities[v],_=!0)}),_&&(m.ids=m.ids.filter(function(v){return v in m.entities}))}function l(p){Object.assign(p,{ids:[],entities:{}})}function c(p,m,_){var v=_.entities[m.id],b=Object.assign({},v,m.changes),y=iO(b,n),C=y!==m.id;return C&&(p[m.id]=y,delete _.entities[m.id]),_.entities[y]=b,C}function u(p,m){return d([p],m)}function d(p,m){var _={},v={};p.forEach(function(C){C.id in m.entities&&(v[C.id]={id:C.id,changes:Wh(Wh({},v[C.id]?v[C.id].changes:null),C.changes)})}),p=Object.values(v);var b=p.length>0;if(b){var y=p.filter(function(C){return c(_,C,m)}).length>0;y&&(m.ids=Object.keys(m.entities))}}function h(p,m){return g([p],m)}function g(p,m){var _=g3e(p,n,m),v=_[0],b=_[1];d(b,m),t(v,m)}return{removeAll:$gt(l),addOne:Pl(e),addMany:Pl(t),setOne:Pl(i),setMany:Pl(r),setAll:Pl(o),updateOne:Pl(u),updateMany:Pl(d),upsertOne:Pl(h),upsertMany:Pl(g),removeOne:Pl(s),removeMany:Pl(a)}}function Vgt(n,e){var t=p3e(n),i=t.removeOne,r=t.removeMany,o=t.removeAll;function s(b,y){return a([b],y)}function a(b,y){b=BE(b);var C=b.filter(function(x){return!(iO(x,n)in y.entities)});C.length!==0&&_(C,y)}function l(b,y){return c([b],y)}function c(b,y){b=BE(b),b.length!==0&&_(b,y)}function u(b,y){b=BE(b),y.entities={},y.ids=[],a(b,y)}function d(b,y){return h([b],y)}function h(b,y){for(var C=!1,x=0,k=b;x<k.length;x++){var I=k[x],L=y.entities[I.id];if(L){C=!0,Object.assign(L,I.changes);var D=n(L);I.id!==D&&(delete y.entities[I.id],y.entities[D]=L)}}C&&v(y)}function g(b,y){return p([b],y)}function p(b,y){var C=g3e(b,n,y),x=C[0],k=C[1];h(k,y),a(x,y)}function m(b,y){if(b.length!==y.length)return!1;for(var C=0;C<b.length&&C<y.length;C++)if(b[C]!==y[C])return!1;return!0}function _(b,y){b.forEach(function(C){y.entities[n(C)]=C}),v(y)}function v(b){var y=Object.values(b.entities);y.sort(e);var C=y.map(n),x=b.ids;m(x,C)||(b.ids=C)}return{removeOne:i,removeMany:r,removeAll:o,addOne:Pl(s),updateOne:Pl(d),upsertOne:Pl(g),setOne:Pl(l),setMany:Pl(c),setAll:Pl(u),addMany:Pl(a),updateMany:Pl(h),upsertMany:Pl(p)}}function Hgt(n){n===void 0&&(n={});var e=Wh({sortComparer:!1,selectId:function(a){return a.id}},n),t=e.selectId,i=e.sortComparer,r=Fgt(),o=Bgt(),s=i?Vgt(t,i):p3e(t);return Wh(Wh(Wh({selectId:t,sortComparer:i},r),o),s)}var Wgt="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ode=function(n){n===void 0&&(n=21);for(var e="",t=n;t--;)e+=Wgt[Math.random()*64|0];return e},zgt=["name","message","stack","code"],jY=function(){function n(e,t){this.payload=e,this.meta=t}return n}(),uwe=function(){function n(e,t){this.payload=e,this.meta=t}return n}(),m3e=function(n){if(typeof n=="object"&&n!==null){for(var e={},t=0,i=zgt;t<i.length;t++){var r=i[t];typeof n[r]=="string"&&(e[r]=n[r])}return e}return{message:String(n)}},jgt=function(){function n(e,t,i){var r=Uv(e+"/fulfilled",function(c,u,d,h){return{payload:c,meta:zY(Wh({},h||{}),{arg:d,requestId:u,requestStatus:"fulfilled"})}}),o=Uv(e+"/pending",function(c,u,d){return{payload:void 0,meta:zY(Wh({},d||{}),{arg:u,requestId:c,requestStatus:"pending"})}}),s=Uv(e+"/rejected",function(c,u,d,h,g){return{payload:h,error:(i&&i.serializeError||m3e)(c||"Rejected"),meta:zY(Wh({},g||{}),{arg:d,requestId:u,rejectedWithValue:!!h,requestStatus:"rejected",aborted:(c==null?void 0:c.name)==="AbortError",condition:(c==null?void 0:c.name)==="ConditionError"})}}),a=typeof AbortController<"u"?AbortController:function(){function c(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return c.prototype.abort=function(){},c}();function l(c){return function(u,d,h){var g=i!=null&&i.idGenerator?i.idGenerator(c):Ode(),p=new a,m;function _(b){m=b,p.abort()}var v=function(){return a3(this,null,function(){var b,y,C,x,k,I,L;return s3(this,function(D){switch(D.label){case 0:return D.trys.push([0,4,,5]),x=(b=i==null?void 0:i.condition)==null?void 0:b.call(i,c,{getState:d,extra:h}),Ugt(x)?[4,x]:[3,2];case 1:x=D.sent(),D.label=2;case 2:if(x===!1||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return k=new Promise(function(R,P){return p.signal.addEventListener("abort",function(){return P({name:"AbortError",message:m||"Aborted"})})}),u(o(g,c,(y=i==null?void 0:i.getPendingMeta)==null?void 0:y.call(i,{requestId:g,arg:c},{getState:d,extra:h}))),[4,Promise.race([k,Promise.resolve(t(c,{dispatch:u,getState:d,extra:h,requestId:g,signal:p.signal,abort:_,rejectWithValue:function(R,P){return new jY(R,P)},fulfillWithValue:function(R,P){return new uwe(R,P)}})).then(function(R){if(R instanceof jY)throw R;return R instanceof uwe?r(R.payload,g,c,R.meta):r(R,g,c)})])];case 3:return C=D.sent(),[3,5];case 4:return I=D.sent(),C=I instanceof jY?s(null,g,c,I.payload,I.meta):s(I,g,c),[3,5];case 5:return L=i&&!i.dispatchConditionRejection&&s.match(C)&&C.meta.condition,L||u(C),[2,C]}})})}();return Object.assign(v,{abort:_,requestId:g,arg:c,unwrap:function(){return v.then(_3e)}})}}return Object.assign(l,{pending:o,rejected:s,fulfilled:r,typePrefix:e})}return n.withTypes=function(){return n},n}();function _3e(n){if(n.meta&&n.meta.rejectedWithValue)throw n.payload;if(n.error)throw n.error;return n.payload}function Ugt(n){return n!==null&&typeof n=="object"&&typeof n.then=="function"}var v3e=function(n,e){return i3e(n)?n.match(e):n(e)};function l3(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return function(t){return n.some(function(i){return v3e(i,t)})}}function ste(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return function(t){return n.every(function(i){return v3e(i,t)})}}function Sz(n,e){if(!n||!n.meta)return!1;var t=typeof n.meta.requestId=="string",i=e.indexOf(n.meta.requestStatus)>-1;return t&&i}function c3(n){return typeof n[0]=="function"&&"pending"in n[0]&&"fulfilled"in n[0]&&"rejected"in n[0]}function b3e(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.length===0?function(t){return Sz(t,["pending"])}:c3(n)?function(t){var i=n.map(function(o){return o.pending}),r=l3.apply(void 0,i);return r(t)}:b3e()(n[0])}function J9(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.length===0?function(t){return Sz(t,["rejected"])}:c3(n)?function(t){var i=n.map(function(o){return o.rejected}),r=l3.apply(void 0,i);return r(t)}:J9()(n[0])}function y3e(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=function(i){return i&&i.meta&&i.meta.rejectedWithValue};return n.length===0?function(i){var r=ste(J9.apply(void 0,n),t);return r(i)}:c3(n)?function(i){var r=ste(J9.apply(void 0,n),t);return r(i)}:y3e()(n[0])}function C3e(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.length===0?function(t){return Sz(t,["fulfilled"])}:c3(n)?function(t){var i=n.map(function(o){return o.fulfilled}),r=l3.apply(void 0,i);return r(t)}:C3e()(n[0])}function w3e(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.length===0?function(t){return Sz(t,["pending","fulfilled","rejected"])}:c3(n)?function(t){for(var i=[],r=0,o=n;r<o.length;r++){var s=o[r];i.push(s.pending,s.rejected,s.fulfilled)}var a=l3.apply(void 0,i);return a(t)}:w3e()(n[0])}var Pde=function(n,e){if(typeof n!="function")throw new TypeError(e+" is not a function")},ate=function(){},S3e=function(n,e){return e===void 0&&(e=ate),n.catch(e),n},E3e=function(n,e){return n.addEventListener("abort",e,{once:!0}),function(){return n.removeEventListener("abort",e)}},gL=function(n,e){var t=n.signal;t.aborted||("reason"in t||Object.defineProperty(t,"reason",{enumerable:!0,value:e,configurable:!0,writable:!0}),n.abort(e))},qgt="task",x3e="listener",k3e="completed",Mde="cancelled",Kgt="task-"+Mde,Ggt="task-"+k3e,T3e=x3e+"-"+Mde,Ygt=x3e+"-"+k3e,u3=function(){function n(e){this.code=e,this.name="TaskAbortError",this.message=qgt+" "+Mde+" (reason: "+e+")"}return n}(),pL=function(n){if(n.aborted)throw new u3(n.reason)};function I3e(n,e){var t=ate;return new Promise(function(i,r){var o=function(){return r(new u3(n.reason))};if(n.aborted){o();return}t=E3e(n,o),e.finally(function(){return t()}).then(i,r)}).finally(function(){t=ate})}var Qgt=function(n,e){return a3(void 0,null,function(){var t,i;return s3(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,4,5]),[4,Promise.resolve()];case 1:return r.sent(),[4,n()];case 2:return t=r.sent(),[2,{status:"ok",value:t}];case 3:return i=r.sent(),[2,{status:i instanceof u3?"cancelled":"rejected",error:i}];case 4:return e==null||e(),[7];case 5:return[2]}})})},e7=function(n){return function(e){return S3e(I3e(n,e).then(function(t){return pL(n),t}))}},L3e=function(n){var e=e7(n);return function(t){return e(new Promise(function(i){return setTimeout(i,t)}))}},Xgt=Object.assign,dwe={},d3="listenerMiddleware",Zgt=function(n,e){var t=function(i){return E3e(n,function(){return gL(i,n.reason)})};return function(i,r){Pde(i,"taskExecutor");var o=new AbortController;t(o);var s=Qgt(function(){return a3(void 0,null,function(){var a;return s3(this,function(l){switch(l.label){case 0:return pL(n),pL(o.signal),[4,i({pause:e7(o.signal),delay:L3e(o.signal),signal:o.signal})];case 1:return a=l.sent(),pL(o.signal),[2,a]}})})},function(){return gL(o,Ggt)});return r!=null&&r.autoJoin&&e.push(s),{result:e7(n)(s),cancel:function(){gL(o,Kgt)}}}},Jgt=function(n,e){var t=function(i,r){return a3(void 0,null,function(){var o,s,a,l;return s3(this,function(c){switch(c.label){case 0:pL(e),o=function(){},s=new Promise(function(u,d){var h=n({predicate:i,effect:function(g,p){p.unsubscribe(),u([g,p.getState(),p.getOriginalState()])}});o=function(){h(),d()}}),a=[s],r!=null&&a.push(new Promise(function(u){return setTimeout(u,r,null)})),c.label=1;case 1:return c.trys.push([1,,3,4]),[4,I3e(e,Promise.race(a))];case 2:return l=c.sent(),pL(e),[2,l];case 3:return o(),[7];case 4:return[2]}})})};return function(i,r){return S3e(t(i,r))}},D3e=function(n){var e=n.type,t=n.actionCreator,i=n.matcher,r=n.predicate,o=n.effect;if(e)r=Uv(e).match;else if(t)e=t.type,r=t.match;else if(i)r=i;else if(!r)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return Pde(o,"options.listener"),{predicate:r,type:e,effect:o}},ept=function(n){var e=D3e(n),t=e.type,i=e.predicate,r=e.effect,o=Ode(),s={id:o,effect:r,type:t,predicate:i,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}};return s},lte=function(n){n.pending.forEach(function(e){gL(e,T3e)})},tpt=function(n){return function(){n.forEach(lte),n.clear()}},hwe=function(n,e,t){try{n(e,t)}catch(i){setTimeout(function(){throw i},0)}},A3e=Uv(d3+"/add"),R3e=Uv(d3+"/removeAll"),N3e=Uv(d3+"/remove"),npt=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];console.error.apply(console,YC([d3+"/error"],n))};function ipt(n){var e=this;n===void 0&&(n={});var t=new Map,i=n.extra,r=n.onError,o=r===void 0?npt:r;Pde(o,"onError");var s=function(g){return g.unsubscribe=function(){return t.delete(g.id)},t.set(g.id,g),function(p){g.unsubscribe(),p!=null&&p.cancelActive&&lte(g)}},a=function(g){for(var p=0,m=Array.from(t.values());p<m.length;p++){var _=m[p];if(g(_))return _}},l=function(g){var p=a(function(m){return m.effect===g.effect});return p||(p=ept(g)),s(p)},c=function(g){var p=D3e(g),m=p.type,_=p.effect,v=p.predicate,b=a(function(y){var C=typeof m=="string"?y.type===m:y.predicate===v;return C&&y.effect===_});return b&&(b.unsubscribe(),g.cancelActive&&lte(b)),!!b},u=function(g,p,m,_){return a3(e,null,function(){var v,b,y,C;return s3(this,function(x){switch(x.label){case 0:v=new AbortController,b=Jgt(l,v.signal),y=[],x.label=1;case 1:return x.trys.push([1,3,4,6]),g.pending.add(v),[4,Promise.resolve(g.effect(p,Xgt({},m,{getOriginalState:_,condition:function(k,I){return b(k,I).then(Boolean)},take:b,delay:L3e(v.signal),pause:e7(v.signal),extra:i,signal:v.signal,fork:Zgt(v.signal,y),unsubscribe:g.unsubscribe,subscribe:function(){t.set(g.id,g)},cancelActiveListeners:function(){g.pending.forEach(function(k,I,L){k!==v&&(gL(k,T3e),L.delete(k))})}})))];case 2:return x.sent(),[3,6];case 3:return C=x.sent(),C instanceof u3||hwe(o,C,{raisedBy:"effect"}),[3,6];case 4:return[4,Promise.allSettled(y)];case 5:return x.sent(),gL(v,Ygt),g.pending.delete(v),[7];case 6:return[2]}})})},d=tpt(t),h=function(g){return function(p){return function(m){if(!Nde(m))return p(m);if(A3e.match(m))return l(m.payload);if(R3e.match(m)){d();return}if(N3e.match(m))return c(m.payload);var _=g.getState(),v=function(){if(_===dwe)throw new Error(d3+": getOriginalState can only be called synchronously");return _},b;try{if(b=p(m),t.size>0)for(var y=g.getState(),C=Array.from(t.values()),x=0,k=C;x<k.length;x++){var I=k[x],L=!1;try{L=I.predicate(m,y,_)}catch(D){L=!1,hwe(o,D,{raisedBy:"predicate"})}L&&u(I,m,g,v)}}finally{_=dwe}return b}}};return{middleware:h,startListening:l,stopListening:c,clearListeners:d}}var Fde="RTK_autoBatch",rpt=function(){return function(n){var e;return{payload:n,meta:(e={},e[Fde]=!0,e)}}},fwe,opt=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(n){return(fwe||(fwe=Promise.resolve())).then(n).catch(function(e){return setTimeout(function(){throw e},0)})},O3e=function(n){return function(e){setTimeout(e,n)}},spt=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:O3e(10),apt=function(n){return n===void 0&&(n={type:"raf"}),function(e){return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var r=e.apply(void 0,t),o=!0,s=!1,a=!1,l=new Set,c=n.type==="tick"?opt:n.type==="raf"?spt:n.type==="callback"?n.queueNotification:O3e(n.timeout),u=function(){a=!1,s&&(s=!1,l.forEach(function(d){return d()}))};return Object.assign({},r,{subscribe:function(d){var h=function(){return o&&d()},g=r.subscribe(h);return l.add(d),function(){g(),l.delete(d)}},dispatch:function(d){var h;try{return o=!((h=d==null?void 0:d.meta)!=null&&h[Fde]),s=!o,s&&(a||(a=!0,c(u))),r.dispatch(d)}finally{o=!0}}})}}};Dde();const lpt=Object.freeze(Object.defineProperty({__proto__:null,EnhancerArray:s3e,MiddlewareArray:o3e,SHOULD_AUTOBATCH:Fde,TaskAbortError:u3,__DO_NOT_USE__ActionTypes:RP,addListener:A3e,applyMiddleware:Rde,autoBatchEnhancer:apt,bindActionCreators:rte,clearAllListeners:R3e,combineReducers:Q4e,compose:cD,configureStore:d3e,createAction:Uv,createActionCreatorInvariantMiddleware:Tgt,createAsyncThunk:jgt,createDraftSafeSelector:ry,createEntityAdapter:Hgt,createImmutableStateInvariantMiddleware:Lgt,createListenerMiddleware:ipt,createNextState:lD,createReducer:f3e,createSelector:Cz,createSerializableStateInvariantMiddleware:Dgt,createSlice:H2,createStore:o3,current:bz,findNonSerializableValue:l3e,freeze:r3,getDefaultMiddleware:u3e,getType:kgt,isAction:Nde,isActionCreator:Egt,isAllOf:ste,isAnyOf:l3,isAsyncThunkAction:w3e,isDraft:of,isFluxStandardAction:r3e,isFulfilled:C3e,isImmutableDefault:Igt,isPending:b3e,isPlain:a3e,isPlainObject:wz,isRejected:J9,isRejectedWithValue:y3e,legacy_createStore:ugt,miniSerializeError:m3e,nanoid:Ode,original:z4e,prepareAutoBatched:rpt,removeListener:N3e,unwrapResult:_3e},Symbol.toStringTag,{value:"Module"}));/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const cpt={currentIndex:localStorage.getItem("X-CURRENT-INDEX")?parseInt(localStorage.getItem("X-CURRENT-INDEX")):0,api:{},changes:{company:void 0}},P3e=H2({name:"companyUser",initialState:cpt,reducers:{changeCurrentIndex:(n,e)=>{n.currentIndex=e.payload},updateCompanyUsers:(n,e)=>{n.api=e.payload},injectInChanges:(n,e)=>{n.changes[e.payload.object]=e.payload.data},updateChanges:(n,e)=>{n.changes[e.payload.object]=Bn.set(n.changes[e.payload.object],e.payload.property,e.payload.value)},resetChanges:(n,e)=>{n.changes[e.payload]=n.api[n.currentIndex][e.payload]},updateRecord:(n,e)=>{n.api[n.currentIndex][e.payload.object]=e.payload.data}}}),{changeCurrentIndex:Ez,updateCompanyUsers:yb,injectInChanges:gx,resetChanges:Bde,updateChanges:Vr,updateRecord:Pw}=P3e.actions;/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/var W2=(n=>(n.TOKEN="invoiceninja_token",n.GOOGLE_SSO="google_sso",n))(W2||{});/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const upt={authenticated:!1,user:{},changes:{}},M3e=H2({name:"user",initialState:upt,reducers:{updateUser:(n,e)=>{n.user=e.payload},injectInChanges:n=>{n.changes=n.user},injectInChangesWithData:(n,e)=>{n.changes=e.payload},resetChanges:n=>{n.changes=n.user},authenticate:(n,e)=>{n.authenticated=!0,n.user=e.payload.user,localStorage.setItem("X-NINJA-TOKEN",e.payload.token)},register:(n,e)=>{n.authenticated=!0,n.user=e.payload.user,localStorage.setItem("X-NINJA-TOKEN",e.payload.token)},updateChanges:(n,e)=>{Bn.set(n.changes,e.payload.property,e.payload.value)},deletePassword:n=>{delete n.changes.password,delete n.user.password}}}),{updateUser:Uy,injectInChanges:$de,injectInChangesWithData:UY,resetChanges:dpt,authenticate:h3,register:hpt,updateChanges:gk,deletePassword:fpt}=M3e.actions;/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Vde(){const n=Tl(o=>o.user),e=localStorage.getItem("X-NINJA-TOKEN"),t=ri(),i=Ci(),r=Kr();return e===null?!1:(n.authenticated||r.fetchQuery("/api/v1/refresh",()=>Te("POST",ye("/api/v1/refresh")).then(o=>{let s=0;if(localStorage.getItem("X-CURRENT-INDEX"))s=parseInt(localStorage.getItem("X-CURRENT-INDEX")||"0");else{const a=o.data.data,l=a[0].account.default_company_id;s=a.findIndex(c=>c.company.id===l)||0}i(h3({type:W2.TOKEN,user:o.data.data[s].user,token:localStorage.getItem("X-NINJA-TOKEN")})),i(yb(o.data.data)),i(Ez(s))}).catch(()=>{localStorage.removeItem("X-NINJA-TOKEN"),t("/login")})),!0)}let gpt=0;function po(n,e){const t=`atom${++gpt}`,i={toString:()=>t};return typeof n=="function"?i.read=n:(i.init=n,i.read=function(r){return r(this)},i.write=function(r,o,s){return o(this,typeof s=="function"?s(r(this)):s)}),e&&(i.write=e),i}const gwe=n=>"init"in n,pwe=n=>!!n.write,t7=new WeakMap,ppt=(n,e)=>{t7.set(n,e),n.catch(()=>{}).finally(()=>t7.delete(n))},mwe=(n,e)=>{const t=t7.get(n);t&&(t7.delete(n),t(e))},_we=(n,e)=>{n.status="fulfilled",n.value=e},vwe=(n,e)=>{n.status="rejected",n.reason=e},mpt=n=>typeof(n==null?void 0:n.then)=="function",fR=(n,e)=>!!n&&"v"in n&&"v"in e&&Object.is(n.v,e.v),bwe=(n,e)=>!!n&&"e"in n&&"e"in e&&Object.is(n.e,e.e),mT=n=>!!n&&"v"in n&&n.v instanceof Promise,_pt=(n,e)=>"v"in n&&"v"in e&&n.v.orig&&n.v.orig===e.v.orig,u6=n=>{if("e"in n)throw n.e;return n.v},vpt=()=>{const n=new WeakMap,e=new WeakMap,t=new Map;let i,r;const o=L=>n.get(L),s=(L,D)=>{const R=n.get(L);if(n.set(L,D),t.has(L)||t.set(L,R),mT(R)){const P="v"in D?D.v instanceof Promise?D.v:Promise.resolve(D.v):Promise.reject(D.e);R.v!==P&&mwe(R.v,P)}},a=(L,D,R)=>{const P=new Map;let M=!1;R.forEach((O,B)=>{!O&&B===L&&(O=D),O&&(P.set(B,O),D.d.get(B)!==O&&(M=!0))}),(M||D.d.size!==P.size)&&(D.d=P)},l=(L,D,R)=>{const P=o(L),M={d:(P==null?void 0:P.d)||new Map,v:D};if(R&&a(L,M,R),fR(P,M)&&P.d===M.d)return P;if(mT(P)&&mT(M)&&_pt(P,M)){if(P.d===M.d)return P;M.v=P.v}return s(L,M),M},c=(L,D,R,P)=>{if(mpt(D)){let M;const O=()=>{const F=o(L);if(!mT(F)||F.v!==B)return;const H=l(L,B,R);e.has(L)&&F.d!==H.d&&x(L,H,F.d)},B=new Promise((F,H)=>{let V=!1;D.then($=>{V||(V=!0,_we(B,$),F($),O())},$=>{V||(V=!0,vwe(B,$),H($),O())}),M=$=>{V||(V=!0,$.then(j=>_we(B,j),j=>vwe(B,j)),F($))}});return B.orig=D,B.status="pending",ppt(B,F=>{F&&M(F),P==null||P()}),l(L,B,R)}return l(L,D,R)},u=(L,D,R)=>{const P=o(L),M={d:(P==null?void 0:P.d)||new Map,e:D};return R&&a(L,M,R),bwe(P,M)&&P.d===M.d?P:(s(L,M),M)},d=(L,D)=>{const R=o(L);if(!D&&R&&(e.has(L)||Array.from(R.d).every(([V,$])=>{if(V===L)return!0;const j=d(V);return j===$||fR(j,$)})))return R;const P=new Map;let M=!0;const O=V=>{if(V===L){const j=o(V);if(j)return P.set(V,j),u6(j);if(gwe(V))return P.set(V,void 0),V.init;throw new Error("no atom init")}const $=d(V);return P.set(V,$),u6($)};let B,F;const H={get signal(){return B||(B=new AbortController),B.signal},get setSelf(){return!F&&pwe(L)&&(F=(...V)=>{if(!M)return b(L,...V)}),F}};try{const V=L.read(O,H);return c(L,V,P,()=>B==null?void 0:B.abort())}catch(V){return u(L,V,P)}finally{M=!1}},h=L=>u6(d(L)),g=L=>{let D=e.get(L);return D||(D=y(L)),D},p=(L,D)=>!D.l.size&&(!D.t.size||D.t.size===1&&D.t.has(L)),m=L=>{const D=e.get(L);D&&p(L,D)&&C(L)},_=L=>{const D=new Map,R=new WeakMap,P=B=>{var F;const H=new Set((F=e.get(B))==null?void 0:F.t);return t.forEach((V,$)=>{var j;(j=o($))!=null&&j.d.has(B)&&H.add($)}),H},M=B=>{P(B).forEach(F=>{F!==B&&(D.set(F,(D.get(F)||new Set).add(B)),R.set(F,(R.get(F)||0)+1),M(F))})};M(L);const O=B=>{P(B).forEach(F=>{var H;if(F!==B){let V=R.get(F);if(V&&R.set(F,--V),!V){let $=!!((H=D.get(F))!=null&&H.size);if($){const j=o(F),Y=d(F,!0);$=!fR(j,Y)}$||D.forEach(j=>j.delete(F))}O(F)}})};O(L)},v=(L,...D)=>{let R=!0;const P=B=>u6(d(B)),M=(B,...F)=>{let H;if(B===L){if(!gwe(B))throw new Error("atom not writable");const V=o(B),$=c(B,F[0]);fR(V,$)||_(B)}else H=v(B,...F);if(!R){const V=k()}return H},O=L.write(P,M,...D);return R=!1,O},b=(L,...D)=>{const R=v(L,...D),P=k();return R},y=(L,D,R)=>{var P;const M=R||[];(P=o(L))==null||P.d.forEach((B,F)=>{const H=e.get(F);H?H.t.add(L):F!==L&&y(F,L,M)}),d(L);const O={t:new Set(D&&[D]),l:new Set};if(e.set(L,O),pwe(L)&&L.onMount){const{onMount:B}=L;M.push(()=>{const F=B((...H)=>b(L,...H));F&&(O.u=F)})}return R||M.forEach(B=>B()),O},C=L=>{var D;const R=(D=e.get(L))==null?void 0:D.u;R&&R(),e.delete(L);const P=o(L);P&&(mT(P)&&mwe(P.v),P.d.forEach((M,O)=>{if(O!==L){const B=e.get(O);B&&(B.t.delete(L),p(O,B)&&C(O))}}))},x=(L,D,R)=>{const P=new Set(D.d.keys());R==null||R.forEach((M,O)=>{if(P.has(O)){P.delete(O);return}const B=e.get(O);B&&(B.t.delete(L),p(O,B)&&C(O))}),P.forEach(M=>{const O=e.get(M);O?O.t.add(L):e.has(L)&&y(M,L)})},k=()=>{let L;for(;t.size;){const D=Array.from(t);t.clear(),D.forEach(([R,P])=>{const M=o(R);if(M){const O=e.get(R);O&&M.d!==(P==null?void 0:P.d)&&x(R,M,P==null?void 0:P.d),O&&!(!mT(P)&&(fR(P,M)||bwe(P,M)))&&O.l.forEach(B=>B())}})}};return{get:h,set:b,sub:(L,D)=>{const R=g(L),P=k(),M=R.l;return M.add(D),()=>{M.delete(D),m(L)}}}};let qY;const bpt=()=>(qY||(qY=vpt()),qY),ypt=w.createContext(void 0),F3e=n=>{const e=w.useContext(ypt);return(n==null?void 0:n.store)||e||bpt()},Cpt=n=>typeof(n==null?void 0:n.then)=="function",wpt=te.use||(n=>{if(n.status==="pending")throw n;if(n.status==="fulfilled")return n.value;throw n.status==="rejected"?n.reason:(n.status="pending",n.then(e=>{n.status="fulfilled",n.value=e},e=>{n.status="rejected",n.reason=e}),n)});function ki(n,e){const t=F3e(e),[[i,r,o],s]=w.useReducer(c=>{const u=t.get(n);return Object.is(c[0],u)&&c[1]===t&&c[2]===n?c:[u,t,n]},void 0,()=>[t.get(n),t,n]);let a=i;(r!==t||o!==n)&&(s(),a=t.get(n));const l=e==null?void 0:e.delay;return w.useEffect(()=>{const c=t.sub(n,()=>{if(typeof l=="number"){setTimeout(s,l);return}s()});return s(),c},[t,n,l]),w.useDebugValue(a),Cpt(a)?wpt(a):a}function Ri(n,e){const t=F3e(e);return w.useCallback((...r)=>t.set(n,...r),[t,n])}function Mo(n,e){return[ki(n,e),Ri(n,e)]}const Spt=Symbol(),Ept=n=>typeof(n==null?void 0:n.then)=="function";function B3e(n){let e,t;const i={getItem:(r,o)=>{var s,a;const l=u=>{if(u=u||"",e!==u){try{t=JSON.parse(u)}catch{return o}e=u}return t},c=(a=(s=n())==null?void 0:s.getItem(r))!=null?a:null;return Ept(c)?c.then(l):l(c)},setItem:(r,o)=>{var s;return(s=n())==null?void 0:s.setItem(r,JSON.stringify(o))},removeItem:r=>{var o;return(o=n())==null?void 0:o.removeItem(r)}};return typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(i.subscribe=(r,o,s)=>{if(!(n()instanceof window.Storage))return()=>{};const a=l=>{if(l.storageArea===n()&&l.key===r){let c;try{c=JSON.parse(l.newValue||"")}catch{c=s}o(c)}};return window.addEventListener("storage",a),()=>{window.removeEventListener("storage",a)}}),i}const xpt=B3e(()=>typeof window<"u"?window.localStorage:void 0);function Hde(n,e,t=xpt,i){const r=i==null?void 0:i.unstable_getOnInit,o=po(r?t.getItem(n,e):e);return o.onMount=a=>{r||a(t.getItem(n,e));let l;return t.subscribe&&(l=t.subscribe(n,a,e)),l},po(a=>a(o),(a,l,c)=>{const u=typeof c=="function"?c(a(o)):c;return u===Spt?(l(o,e),t.removeItem(n)):u instanceof Promise?u.then(d=>(l(o,d),t.setItem(n,d))):(l(o,u),t.setItem(n,u))})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function ha(){return Tl(n=>n.user.user)}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function f3(){return Tl(n=>n.user.changes)}function x0(n){const e=ha(),t=Ci(),i=f3();return w.useEffect(()=>{i&&(n==null?void 0:n.overwrite)===!1||t($de())},[e]),i}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const n7={dashboard_charts:{default_view:"month",currency:1,range:"this_month"},datatables:{clients:{sort:"id|desc"}},reports:{columns:{}},auto_expand_product_table_notes:!1};function sl(n){var o,s;const e=x0({overwrite:n==null?void 0:n.overwrite}),t=Tl(a=>{var l,c;return(c=(l=a.user.changes)==null?void 0:l.company_user)==null?void 0:c.react_settings})||{},r={show_pdf_preview:!0,react_notification_link:!0,react_table_columns:{...(s=(o=e==null?void 0:e.company_user)==null?void 0:o.settings)==null?void 0:s.react_table_columns,...t.react_table_columns},preferences:Bn.cloneDeep(n7)};return Bn.merge({...r},{...t})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const kpt={name:"invoiceninja.dark",$0:"dark",$1:"#121212",$2:"#121212",$3:"rgba(255, 255, 255, 0.87)",$4:"#1f2e41",$5:"#1f2e41",$6:"#121212",$7:"#151f2c",$8:"#1f2e41",$9:"#ffffff",$10:.87,$11:.6,$12:.38,$13:"#E5E7EB"},$3e={name:"invoiceninja.light",$0:"light",$1:"#ffffff",$2:"#f7f7f7",$3:"#2a303d",$4:"#f7f7f7",$5:"#d1d5db",$6:"#242930",$7:"#f7f7f7",$8:"#363D47",$9:"#ffffff",$10:1,$11:.8,$12:.5,$13:"#E5E7EB"},V3e=Hde("colorScheme",$3e);function Vn(){const n=sl({overwrite:!1}),[e,t]=Mo(V3e);return w.useEffect(()=>{n&&(n.dark_mode?t(kpt):t($3e))},[n==null?void 0:n.dark_mode]),e}function Vo(n){const e=Vn();return N("svg",{style:{color:e.$3},className:`animate-spin h-5 w-5 ${n.variant??"text-black"}`,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[f("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),f("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}function Tpt(){return f("div",{className:"flex items-center justify-center h-screen",children:f(Vo,{variant:"dark"})})}var H3e={exports:{}},Ipt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Lpt=Ipt,Dpt=Lpt;function W3e(){}function z3e(){}z3e.resetWarningCache=W3e;var Apt=function(){function n(i,r,o,s,a,l){if(l!==Dpt){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}n.isRequired=n;function e(){return n}var t={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:z3e,resetWarningCache:W3e};return t.PropTypes=t,t};H3e.exports=Apt();var qt=H3e.exports;const Pe=ja(qt);function cte(){return cte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},cte.apply(this,arguments)}function Rpt(n,e){if(n==null)return{};var t=Npt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Npt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Wde=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=Rpt(n,["color","size"]);return te.createElement("svg",cte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"}))});Wde.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};Wde.displayName="Activity";const Opt=Wde;function ute(){return ute=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},ute.apply(this,arguments)}function Ppt(n,e){if(n==null)return{};var t=Mpt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Mpt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var zde=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=Ppt(n,["color","size"]);return te.createElement("svg",ute({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("circle",{cx:"12",cy:"12",r:"10"}),te.createElement("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),te.createElement("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"}))});zde.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};zde.displayName="AlertCircle";const Fpt=zde;function dte(){return dte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},dte.apply(this,arguments)}function Bpt(n,e){if(n==null)return{};var t=$pt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function $pt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var jde=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=Bpt(n,["color","size"]);return te.createElement("svg",dte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),te.createElement("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),te.createElement("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"}))});jde.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};jde.displayName="AlertTriangle";const j3e=jde;function hte(){return hte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},hte.apply(this,arguments)}function Vpt(n,e){if(n==null)return{};var t=Hpt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Hpt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Ude=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=Vpt(n,["color","size"]);return te.createElement("svg",hte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("line",{x1:"21",y1:"10",x2:"3",y2:"10"}),te.createElement("line",{x1:"21",y1:"6",x2:"3",y2:"6"}),te.createElement("line",{x1:"21",y1:"14",x2:"3",y2:"14"}),te.createElement("line",{x1:"21",y1:"18",x2:"3",y2:"18"}))});Ude.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};Ude.displayName="AlignJustify";const Wpt=Ude;function fte(){return fte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},fte.apply(this,arguments)}function zpt(n,e){if(n==null)return{};var t=jpt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function jpt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var qde=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=zpt(n,["color","size"]);return te.createElement("svg",fte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("path",{d:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20"}),te.createElement("path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"}))});qde.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};qde.displayName="Book";const Upt=qde;function gte(){return gte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},gte.apply(this,arguments)}function qpt(n,e){if(n==null)return{};var t=Kpt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Kpt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Kde=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=qpt(n,["color","size"]);return te.createElement("svg",gte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"}),te.createElement("polyline",{points:"3.27 6.96 12 12.01 20.73 6.96"}),te.createElement("line",{x1:"12",y1:"22.08",x2:"12",y2:"12"}))});Kde.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};Kde.displayName="Box";const Gpt=Kde;function pte(){return pte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},pte.apply(this,arguments)}function Ypt(n,e){if(n==null)return{};var t=Qpt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Qpt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Gde=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=Ypt(n,["color","size"]);return te.createElement("svg",pte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("rect",{x:"2",y:"7",width:"20",height:"14",rx:"2",ry:"2"}),te.createElement("path",{d:"M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"}))});Gde.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};Gde.displayName="Briefcase";const Xpt=Gde;function mte(){return mte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},mte.apply(this,arguments)}function Zpt(n,e){if(n==null)return{};var t=Jpt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Jpt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Yde=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=Zpt(n,["color","size"]);return te.createElement("svg",mte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),te.createElement("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),te.createElement("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),te.createElement("line",{x1:"3",y1:"10",x2:"21",y2:"10"}))});Yde.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};Yde.displayName="Calendar";const U3e=Yde;function _te(){return _te=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},_te.apply(this,arguments)}function emt(n,e){if(n==null)return{};var t=tmt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function tmt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Qde=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=emt(n,["color","size"]);return te.createElement("svg",_te({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),te.createElement("polyline",{points:"22 4 12 14.01 9 11.01"}))});Qde.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};Qde.displayName="CheckCircle";const KY=Qde;function vte(){return vte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},vte.apply(this,arguments)}function nmt(n,e){if(n==null)return{};var t=imt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function imt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Xde=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=nmt(n,["color","size"]);return te.createElement("svg",vte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("polyline",{points:"20 6 9 17 4 12"}))});Xde.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};Xde.displayName="Check";const Zde=Xde;function bte(){return bte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},bte.apply(this,arguments)}function rmt(n,e){if(n==null)return{};var t=omt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function omt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Jde=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=rmt(n,["color","size"]);return te.createElement("svg",bte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("polyline",{points:"6 9 12 15 18 9"}))});Jde.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};Jde.displayName="ChevronDown";const z2=Jde;function yte(){return yte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},yte.apply(this,arguments)}function smt(n,e){if(n==null)return{};var t=amt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function amt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var ehe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=smt(n,["color","size"]);return te.createElement("svg",yte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("polyline",{points:"15 18 9 12 15 6"}))});ehe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};ehe.displayName="ChevronLeft";const q3e=ehe;function Cte(){return Cte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Cte.apply(this,arguments)}function lmt(n,e){if(n==null)return{};var t=cmt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function cmt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var the=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=lmt(n,["color","size"]);return te.createElement("svg",Cte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("polyline",{points:"9 18 15 12 9 6"}))});the.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};the.displayName="ChevronRight";const nhe=the;function wte(){return wte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},wte.apply(this,arguments)}function umt(n,e){if(n==null)return{};var t=dmt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function dmt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var ihe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=umt(n,["color","size"]);return te.createElement("svg",wte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("polyline",{points:"18 15 12 9 6 15"}))});ihe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};ihe.displayName="ChevronUp";const K3e=ihe;function Ste(){return Ste=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Ste.apply(this,arguments)}function hmt(n,e){if(n==null)return{};var t=fmt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function fmt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var rhe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=hmt(n,["color","size"]);return te.createElement("svg",Ste({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("polyline",{points:"11 17 6 12 11 7"}),te.createElement("polyline",{points:"18 17 13 12 18 7"}))});rhe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};rhe.displayName="ChevronsLeft";const gmt=rhe;function Ete(){return Ete=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Ete.apply(this,arguments)}function pmt(n,e){if(n==null)return{};var t=mmt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function mmt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var ohe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=pmt(n,["color","size"]);return te.createElement("svg",Ete({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("polyline",{points:"13 17 18 12 13 7"}),te.createElement("polyline",{points:"6 17 11 12 6 7"}))});ohe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};ohe.displayName="ChevronsRight";const op=ohe;function xte(){return xte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},xte.apply(this,arguments)}function _mt(n,e){if(n==null)return{};var t=vmt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function vmt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var she=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=_mt(n,["color","size"]);return te.createElement("svg",xte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("circle",{cx:"12",cy:"12",r:"10"}),te.createElement("polyline",{points:"12 6 12 12 16 14"}))});she.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};she.displayName="Clock";const bmt=she;function kte(){return kte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},kte.apply(this,arguments)}function ymt(n,e){if(n==null)return{};var t=Cmt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Cmt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var ahe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=ymt(n,["color","size"]);return te.createElement("svg",kte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("rect",{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2"}),te.createElement("line",{x1:"1",y1:"10",x2:"23",y2:"10"}))});ahe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};ahe.displayName="CreditCard";const wmt=ahe;function Tte(){return Tte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Tte.apply(this,arguments)}function Smt(n,e){if(n==null)return{};var t=Emt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Emt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var lhe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=Smt(n,["color","size"]);return te.createElement("svg",Tte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("polyline",{points:"8 17 12 21 16 17"}),te.createElement("line",{x1:"12",y1:"12",x2:"12",y2:"21"}),te.createElement("path",{d:"M20.88 18.09A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.29"}))});lhe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};lhe.displayName="DownloadCloud";const xmt=lhe;function Ite(){return Ite=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Ite.apply(this,arguments)}function kmt(n,e){if(n==null)return{};var t=Tmt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Tmt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var che=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=kmt(n,["color","size"]);return te.createElement("svg",Ite({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),te.createElement("polyline",{points:"15 3 21 3 21 9"}),te.createElement("line",{x1:"10",y1:"14",x2:"21",y2:"3"}))});che.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};che.displayName="ExternalLink";const Imt=che;function Lte(){return Lte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Lte.apply(this,arguments)}function Lmt(n,e){if(n==null)return{};var t=Dmt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Dmt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var uhe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=Lmt(n,["color","size"]);return te.createElement("svg",Lte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"}))});uhe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};uhe.displayName="Facebook";const Amt=uhe;function Dte(){return Dte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Dte.apply(this,arguments)}function Rmt(n,e){if(n==null)return{};var t=Nmt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Nmt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var dhe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=Rmt(n,["color","size"]);return te.createElement("svg",Dte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),te.createElement("polyline",{points:"14 2 14 8 20 8"}),te.createElement("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),te.createElement("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),te.createElement("polyline",{points:"10 9 9 9 8 9"}))});dhe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};dhe.displayName="FileText";const QC=dhe;function Ate(){return Ate=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Ate.apply(this,arguments)}function Omt(n,e){if(n==null)return{};var t=Pmt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Pmt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var hhe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=Omt(n,["color","size"]);return te.createElement("svg",Ate({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("path",{d:"M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"}),te.createElement("polyline",{points:"13 2 13 9 20 9"}))});hhe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};hhe.displayName="File";const fhe=hhe;function Rte(){return Rte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Rte.apply(this,arguments)}function Mmt(n,e){if(n==null)return{};var t=Fmt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Fmt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var ghe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=Mmt(n,["color","size"]);return te.createElement("svg",Rte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("path",{d:"M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"}))});ghe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};ghe.displayName="GitHub";const Bmt=ghe;function Nte(){return Nte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Nte.apply(this,arguments)}function $mt(n,e){if(n==null)return{};var t=Vmt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Vmt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var phe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=$mt(n,["color","size"]);return te.createElement("svg",Nte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("circle",{cx:"12",cy:"12",r:"10"}),te.createElement("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),te.createElement("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"}))});phe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};phe.displayName="HelpCircle";const Hmt=phe;function Ote(){return Ote=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Ote.apply(this,arguments)}function Wmt(n,e){if(n==null)return{};var t=zmt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function zmt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var mhe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=Wmt(n,["color","size"]);return te.createElement("svg",Ote({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),te.createElement("polyline",{points:"9 22 9 12 15 12 15 22"}))});mhe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};mhe.displayName="Home";const G3e=mhe;function Pte(){return Pte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Pte.apply(this,arguments)}function jmt(n,e){if(n==null)return{};var t=Umt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Umt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var _he=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=jmt(n,["color","size"]);return te.createElement("svg",Pte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),te.createElement("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),te.createElement("polyline",{points:"21 15 16 10 5 21"}))});_he.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};_he.displayName="Image";const px=_he;function Mte(){return Mte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Mte.apply(this,arguments)}function qmt(n,e){if(n==null)return{};var t=Kmt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Kmt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var vhe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=qmt(n,["color","size"]);return te.createElement("svg",Mte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("circle",{cx:"12",cy:"12",r:"10"}),te.createElement("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),te.createElement("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"}))});vhe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};vhe.displayName="Info";const Gmt=vhe;function Fte(){return Fte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Fte.apply(this,arguments)}function Ymt(n,e){if(n==null)return{};var t=Qmt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Qmt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var bhe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=Ymt(n,["color","size"]);return te.createElement("svg",Fte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),te.createElement("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}))});bhe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};bhe.displayName="Lock";const Xmt=bhe;function Bte(){return Bte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Bte.apply(this,arguments)}function Zmt(n,e){if(n==null)return{};var t=Jmt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function Jmt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var yhe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=Zmt(n,["color","size"]);return te.createElement("svg",Bte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("path",{d:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"}),te.createElement("polyline",{points:"22,6 12,13 2,6"}))});yhe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};yhe.displayName="Mail";const e_t=yhe;function $te(){return $te=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},$te.apply(this,arguments)}function t_t(n,e){if(n==null)return{};var t=n_t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function n_t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Che=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=t_t(n,["color","size"]);return te.createElement("svg",$te({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),te.createElement("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),te.createElement("line",{x1:"3",y1:"18",x2:"21",y2:"18"}))});Che.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};Che.displayName="Menu";const i_t=Che;function Vte(){return Vte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Vte.apply(this,arguments)}function r_t(n,e){if(n==null)return{};var t=o_t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function o_t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var whe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=r_t(n,["color","size"]);return te.createElement("svg",Vte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"}))});whe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};whe.displayName="MessageSquare";const s_t=whe;function Hte(){return Hte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Hte.apply(this,arguments)}function a_t(n,e){if(n==null)return{};var t=l_t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function l_t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var She=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=a_t(n,["color","size"]);return te.createElement("svg",Hte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83"}),te.createElement("path",{d:"M22 12A10 10 0 0 0 12 2v10z"}))});She.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};She.displayName="PieChart";const c_t=She;function Wte(){return Wte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Wte.apply(this,arguments)}function u_t(n,e){if(n==null)return{};var t=d_t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function d_t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Ehe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=u_t(n,["color","size"]);return te.createElement("svg",Wte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("circle",{cx:"12",cy:"12",r:"10"}),te.createElement("line",{x1:"12",y1:"8",x2:"12",y2:"16"}),te.createElement("line",{x1:"8",y1:"12",x2:"16",y2:"12"}))});Ehe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};Ehe.displayName="PlusCircle";const dd=Ehe;function zte(){return zte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},zte.apply(this,arguments)}function h_t(n,e){if(n==null)return{};var t=f_t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function f_t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var xhe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=h_t(n,["color","size"]);return te.createElement("svg",zte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),te.createElement("line",{x1:"5",y1:"12",x2:"19",y2:"12"}))});xhe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};xhe.displayName="Plus";const g_t=xhe;function jte(){return jte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},jte.apply(this,arguments)}function p_t(n,e){if(n==null)return{};var t=m_t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function m_t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var khe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=p_t(n,["color","size"]);return te.createElement("svg",jte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("polyline",{points:"17 1 21 5 17 9"}),te.createElement("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),te.createElement("polyline",{points:"7 23 3 19 7 15"}),te.createElement("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"}))});khe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};khe.displayName="Repeat";const i7=khe;function Ute(){return Ute=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Ute.apply(this,arguments)}function __t(n,e){if(n==null)return{};var t=v_t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function v_t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var The=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=__t(n,["color","size"]);return te.createElement("svg",Ute({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("circle",{cx:"12",cy:"12",r:"3"}),te.createElement("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"}))});The.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};The.displayName="Settings";const Ihe=The;function qte(){return qte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},qte.apply(this,arguments)}function b_t(n,e){if(n==null)return{};var t=y_t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function y_t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Lhe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=b_t(n,["color","size"]);return te.createElement("svg",qte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("path",{d:"M14.5 10c-.83 0-1.5-.67-1.5-1.5v-5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5v5c0 .83-.67 1.5-1.5 1.5z"}),te.createElement("path",{d:"M20.5 10H19V8.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"}),te.createElement("path",{d:"M9.5 14c.83 0 1.5.67 1.5 1.5v5c0 .83-.67 1.5-1.5 1.5S8 21.33 8 20.5v-5c0-.83.67-1.5 1.5-1.5z"}),te.createElement("path",{d:"M3.5 14H5v1.5c0 .83-.67 1.5-1.5 1.5S2 16.33 2 15.5 2.67 14 3.5 14z"}),te.createElement("path",{d:"M14 14.5c0-.83.67-1.5 1.5-1.5h5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-5c-.83 0-1.5-.67-1.5-1.5z"}),te.createElement("path",{d:"M15.5 19H14v1.5c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5-.67-1.5-1.5-1.5z"}),te.createElement("path",{d:"M10 9.5C10 8.67 9.33 8 8.5 8h-5C2.67 8 2 8.67 2 9.5S2.67 11 3.5 11h5c.83 0 1.5-.67 1.5-1.5z"}),te.createElement("path",{d:"M8.5 5H10V3.5C10 2.67 9.33 2 8.5 2S7 2.67 7 3.5 7.67 5 8.5 5z"}))});Lhe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};Lhe.displayName="Slack";const C_t=Lhe;function Kte(){return Kte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Kte.apply(this,arguments)}function w_t(n,e){if(n==null)return{};var t=S_t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function S_t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Dhe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=w_t(n,["color","size"]);return te.createElement("svg",Kte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),te.createElement("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"}))});Dhe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};Dhe.displayName="Smartphone";const E_t=Dhe;function Gte(){return Gte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Gte.apply(this,arguments)}function x_t(n,e){if(n==null)return{};var t=k_t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function k_t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Ahe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=x_t(n,["color","size"]);return te.createElement("svg",Gte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("polyline",{points:"3 6 5 6 21 6"}),te.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),te.createElement("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),te.createElement("line",{x1:"14",y1:"11",x2:"14",y2:"17"}))});Ahe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};Ahe.displayName="Trash2";const T_t=Ahe;function Yte(){return Yte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Yte.apply(this,arguments)}function I_t(n,e){if(n==null)return{};var t=L_t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function L_t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Rhe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=I_t(n,["color","size"]);return te.createElement("svg",Yte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("path",{d:"M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z"}))});Rhe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};Rhe.displayName="Twitter";const D_t=Rhe;function Qte(){return Qte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Qte.apply(this,arguments)}function A_t(n,e){if(n==null)return{};var t=R_t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function R_t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Nhe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=A_t(n,["color","size"]);return te.createElement("svg",Qte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),te.createElement("circle",{cx:"9",cy:"7",r:"4"}),te.createElement("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),te.createElement("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}))});Nhe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};Nhe.displayName="Users";const N_t=Nhe;function Xte(){return Xte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Xte.apply(this,arguments)}function O_t(n,e){if(n==null)return{};var t=P_t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function P_t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Ohe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=O_t(n,["color","size"]);return te.createElement("svg",Xte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),te.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))});Ohe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};Ohe.displayName="X";const L_=Ohe;function Zte(){return Zte=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Zte.apply(this,arguments)}function M_t(n,e){if(n==null)return{};var t=F_t(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function F_t(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Phe=w.forwardRef(function(n,e){var t=n.color,i=t===void 0?"currentColor":t,r=n.size,o=r===void 0?24:r,s=M_t(n,["color","size"]);return te.createElement("svg",Zte({ref:e,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),te.createElement("path",{d:"M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.25 29 29 0 0 0-.46-5.33z"}),te.createElement("polygon",{points:"9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02"}))});Phe.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number])};Phe.displayName="Youtube";const B_t=Phe;var Y3e={exports:{}};/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/(function(n){(function(){var e={}.hasOwnProperty;function t(){for(var i=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var s=typeof o;if(s==="string"||s==="number")i.push(o);else if(Array.isArray(o)){if(o.length){var a=t.apply(null,o);a&&i.push(a)}}else if(s==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){i.push(o.toString());continue}for(var l in o)e.call(o,l)&&o[l]&&i.push(l)}}}return i.join(" ")}n.exports?(t.default=t,n.exports=t):window.classNames=t})()})(Y3e);var $_t=Y3e.exports;const St=ja($_t);/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const Q3e={accent:"#117DC0",primary:"#2F7DC3",secondary:"#7081e0"};/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function ys(){var t,i,r,o,s;const n=ha();return((r=(i=(t=Tl(a=>a.user).changes)==null?void 0:t.company_user)==null?void 0:i.settings)==null?void 0:r.accent_color)||((s=(o=n==null?void 0:n.company_user)==null?void 0:o.settings)==null?void 0:s.accent_color)||Q3e.accent}var zh=function(){return zh=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++){t=arguments[i];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},zh.apply(this,arguments)};function j2(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function U2(n,e){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(t=0)),t;)try{if(i=1,r&&(o=c[0]&2?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,r=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(o=t.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){t.label=c[1];break}if(c[0]===6&&t.label<o[1]){t.label=o[1],o=c;break}if(o&&t.label<o[2]){t.label=o[2],t.ops.push(c);break}o[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(u){c=[6,u],r=0}finally{i=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ywe(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var i=t.call(n),r,o=[],s;try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(a){s={error:a}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(s)throw s.error}}return o}function uD(n,e,t){if(t||arguments.length===2)for(var i=0,r=e.length,o;i<r;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return n.concat(o||Array.prototype.slice.call(e))}function V_t(n){var e=Object.create(null);return function(t){return e[t]===void 0&&(e[t]=n(t)),e[t]}}var Ta="-ms-",rO="-moz-",gs="-webkit-",X3e="comm",xz="rule",Mhe="decl",H_t="@import",Z3e="@keyframes",W_t="@layer",z_t=Math.abs,Fhe=String.fromCharCode,Jte=Object.assign;function j_t(n,e){return iu(n,0)^45?(((e<<2^iu(n,0))<<2^iu(n,1))<<2^iu(n,2))<<2^iu(n,3):0}function J3e(n){return n.trim()}function ay(n,e){return(n=e.exec(n))?n[0]:n}function Zr(n,e,t){return n.replace(e,t)}function e8(n,e){return n.indexOf(e)}function iu(n,e){return n.charCodeAt(e)|0}function dD(n,e,t){return n.slice(e,t)}function ov(n){return n.length}function e5e(n){return n.length}function mN(n,e){return e.push(n),n}function U_t(n,e){return n.map(e).join("")}function Cwe(n,e){return n.filter(function(t){return!ay(t,e)})}var kz=1,hD=1,t5e=0,Mp=0,ac=0,q2="";function Tz(n,e,t,i,r,o,s,a){return{value:n,root:e,parent:t,type:i,props:r,children:o,line:kz,column:hD,length:s,return:"",siblings:a}}function a1(n,e){return Jte(Tz("",null,null,"",null,null,0,n.siblings),n,{length:-n.length},e)}function _T(n){for(;n.root;)n=a1(n.root,{children:[n]});mN(n,n.siblings)}function q_t(){return ac}function K_t(){return ac=Mp>0?iu(q2,--Mp):0,hD--,ac===10&&(hD=1,kz--),ac}function l_(){return ac=Mp<t5e?iu(q2,Mp++):0,hD++,ac===10&&(hD=1,kz++),ac}function $E(){return iu(q2,Mp)}function t8(){return Mp}function Iz(n,e){return dD(q2,n,e)}function ene(n){switch(n){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function G_t(n){return kz=hD=1,t5e=ov(q2=n),Mp=0,[]}function Y_t(n){return q2="",n}function GY(n){return J3e(Iz(Mp-1,tne(n===91?n+2:n===40?n+1:n)))}function Q_t(n){for(;(ac=$E())&&ac<33;)l_();return ene(n)>2||ene(ac)>3?"":" "}function X_t(n,e){for(;--e&&l_()&&!(ac<48||ac>102||ac>57&&ac<65||ac>70&&ac<97););return Iz(n,t8()+(e<6&&$E()==32&&l_()==32))}function tne(n){for(;l_();)switch(ac){case n:return Mp;case 34:case 39:n!==34&&n!==39&&tne(ac);break;case 40:n===41&&tne(n);break;case 92:l_();break}return Mp}function Z_t(n,e){for(;l_()&&n+ac!==47+10;)if(n+ac===42+42&&$E()===47)break;return"/*"+Iz(e,Mp-1)+"*"+Fhe(n===47?n:l_())}function J_t(n){for(;!ene($E());)l_();return Iz(n,Mp)}function evt(n){return Y_t(n8("",null,null,null,[""],n=G_t(n),0,[0],n))}function n8(n,e,t,i,r,o,s,a,l){for(var c=0,u=0,d=s,h=0,g=0,p=0,m=1,_=1,v=1,b=0,y="",C=r,x=o,k=i,I=y;_;)switch(p=b,b=l_()){case 40:if(p!=108&&iu(I,d-1)==58){e8(I+=Zr(GY(b),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:I+=GY(b);break;case 9:case 10:case 13:case 32:I+=Q_t(p);break;case 92:I+=X_t(t8()-1,7);continue;case 47:switch($E()){case 42:case 47:mN(tvt(Z_t(l_(),t8()),e,t,l),l);break;default:I+="/"}break;case 123*m:a[c++]=ov(I)*v;case 125*m:case 59:case 0:switch(b){case 0:case 125:_=0;case 59+u:v==-1&&(I=Zr(I,/\f/g,"")),g>0&&ov(I)-d&&mN(g>32?Swe(I+";",i,t,d-1,l):Swe(Zr(I," ","")+";",i,t,d-2,l),l);break;case 59:I+=";";default:if(mN(k=wwe(I,e,t,c,u,r,a,y,C=[],x=[],d,o),o),b===123)if(u===0)n8(I,e,k,k,C,o,d,a,x);else switch(h===99&&iu(I,3)===110?100:h){case 100:case 108:case 109:case 115:n8(n,k,k,i&&mN(wwe(n,k,k,0,0,r,a,y,r,C=[],d,x),x),r,x,d,a,i?C:x);break;default:n8(I,k,k,k,[""],x,0,a,x)}}c=u=g=0,m=v=1,y=I="",d=s;break;case 58:d=1+ov(I),g=p;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&K_t()==125)continue}switch(I+=Fhe(b),b*m){case 38:v=u>0?1:(I+="\f",-1);break;case 44:a[c++]=(ov(I)-1)*v,v=1;break;case 64:$E()===45&&(I+=GY(l_())),h=$E(),u=d=ov(y=I+=J_t(t8())),b++;break;case 45:p===45&&ov(I)==2&&(m=0)}}return o}function wwe(n,e,t,i,r,o,s,a,l,c,u,d){for(var h=r-1,g=r===0?o:[""],p=e5e(g),m=0,_=0,v=0;m<i;++m)for(var b=0,y=dD(n,h+1,h=z_t(_=s[m])),C=n;b<p;++b)(C=J3e(_>0?g[b]+" "+y:Zr(y,/&\f/g,g[b])))&&(l[v++]=C);return Tz(n,e,t,r===0?xz:a,l,c,u,d)}function tvt(n,e,t,i){return Tz(n,e,t,X3e,Fhe(q_t()),dD(n,2,-2),0,i)}function Swe(n,e,t,i,r){return Tz(n,e,t,Mhe,dD(n,0,i),dD(n,i+1,-1),i,r)}function n5e(n,e,t){switch(j_t(n,e)){case 5103:return gs+"print-"+n+n;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return gs+n+n;case 4789:return rO+n+n;case 5349:case 4246:case 4810:case 6968:case 2756:return gs+n+rO+n+Ta+n+n;case 5936:switch(iu(n,e+11)){case 114:return gs+n+Ta+Zr(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return gs+n+Ta+Zr(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return gs+n+Ta+Zr(n,/[svh]\w+-[tblr]{2}/,"lr")+n}case 6828:case 4268:case 2903:return gs+n+Ta+n+n;case 6165:return gs+n+Ta+"flex-"+n+n;case 5187:return gs+n+Zr(n,/(\w+).+(:[^]+)/,gs+"box-$1$2"+Ta+"flex-$1$2")+n;case 5443:return gs+n+Ta+"flex-item-"+Zr(n,/flex-|-self/g,"")+(ay(n,/flex-|baseline/)?"":Ta+"grid-row-"+Zr(n,/flex-|-self/g,""))+n;case 4675:return gs+n+Ta+"flex-line-pack"+Zr(n,/align-content|flex-|-self/g,"")+n;case 5548:return gs+n+Ta+Zr(n,"shrink","negative")+n;case 5292:return gs+n+Ta+Zr(n,"basis","preferred-size")+n;case 6060:return gs+"box-"+Zr(n,"-grow","")+gs+n+Ta+Zr(n,"grow","positive")+n;case 4554:return gs+Zr(n,/([^-])(transform)/g,"$1"+gs+"$2")+n;case 6187:return Zr(Zr(Zr(n,/(zoom-|grab)/,gs+"$1"),/(image-set)/,gs+"$1"),n,"")+n;case 5495:case 3959:return Zr(n,/(image-set\([^]*)/,gs+"$1$`$1");case 4968:return Zr(Zr(n,/(.+:)(flex-)?(.*)/,gs+"box-pack:$3"+Ta+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+gs+n+n;case 4200:if(!ay(n,/flex-|baseline/))return Ta+"grid-column-align"+dD(n,e)+n;break;case 2592:case 3360:return Ta+Zr(n,"template-","")+n;case 4384:case 3616:return t&&t.some(function(i,r){return e=r,ay(i.props,/grid-\w+-end/)})?~e8(n+(t=t[e].value),"span")?n:Ta+Zr(n,"-start","")+n+Ta+"grid-row-span:"+(~e8(t,"span")?ay(t,/\d+/):+ay(t,/\d+/)-+ay(n,/\d+/))+";":Ta+Zr(n,"-start","")+n;case 4896:case 4128:return t&&t.some(function(i){return ay(i.props,/grid-\w+-start/)})?n:Ta+Zr(Zr(n,"-end","-span"),"span ","")+n;case 4095:case 3583:case 4068:case 2532:return Zr(n,/(.+)-inline(.+)/,gs+"$1$2")+n;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ov(n)-1-e>6)switch(iu(n,e+1)){case 109:if(iu(n,e+4)!==45)break;case 102:return Zr(n,/(.+:)(.+)-([^]+)/,"$1"+gs+"$2-$3$1"+rO+(iu(n,e+3)==108?"$3":"$2-$3"))+n;case 115:return~e8(n,"stretch")?n5e(Zr(n,"stretch","fill-available"),e,t)+n:n}break;case 5152:case 5920:return Zr(n,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(i,r,o,s,a,l,c){return Ta+r+":"+o+c+(s?Ta+r+"-span:"+(a?l:+l-+o)+c:"")+n});case 4949:if(iu(n,e+6)===121)return Zr(n,":",":"+gs)+n;break;case 6444:switch(iu(n,iu(n,14)===45?18:11)){case 120:return Zr(n,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+gs+(iu(n,14)===45?"inline-":"")+"box$3$1"+gs+"$2$3$1"+Ta+"$2box$3")+n;case 100:return Zr(n,":",":"+Ta)+n}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Zr(n,"scroll-","scroll-snap-")+n}return n}function r7(n,e){for(var t="",i=0;i<n.length;i++)t+=e(n[i],i,n,e)||"";return t}function nvt(n,e,t,i){switch(n.type){case W_t:if(n.children.length)break;case H_t:case Mhe:return n.return=n.return||n.value;case X3e:return"";case Z3e:return n.return=n.value+"{"+r7(n.children,i)+"}";case xz:if(!ov(n.value=n.props.join(",")))return""}return ov(t=r7(n.children,i))?n.return=n.value+"{"+t+"}":""}function ivt(n){var e=e5e(n);return function(t,i,r,o){for(var s="",a=0;a<e;a++)s+=n[a](t,i,r,o)||"";return s}}function rvt(n){return function(e){e.root||(e=e.return)&&n(e)}}function ovt(n,e,t,i){if(n.length>-1&&!n.return)switch(n.type){case Mhe:n.return=n5e(n.value,n.length,t);return;case Z3e:return r7([a1(n,{value:Zr(n.value,"@","@"+gs)})],i);case xz:if(n.length)return U_t(t=n.props,function(r){switch(ay(r,i=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":_T(a1(n,{props:[Zr(r,/:(read-\w+)/,":"+rO+"$1")]})),_T(a1(n,{props:[r]})),Jte(n,{props:Cwe(t,i)});break;case"::placeholder":_T(a1(n,{props:[Zr(r,/:(plac\w+)/,":"+gs+"input-$1")]})),_T(a1(n,{props:[Zr(r,/:(plac\w+)/,":"+rO+"$1")]})),_T(a1(n,{props:[Zr(r,/:(plac\w+)/,Ta+"input-$1")]})),_T(a1(n,{props:[r]})),Jte(n,{props:Cwe(t,i)});break}return""})}}var i5e={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},fD=typeof process<"u"&&process.env!==void 0&&({}.REACT_APP_SC_ATTR||{}.SC_ATTR)||"data-styled",Bhe=typeof window<"u"&&"HTMLElement"in window,svt=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&{}.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&{}.REACT_APP_SC_DISABLE_SPEEDY!==""?{}.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&{}.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&{}.SC_DISABLE_SPEEDY!==void 0&&{}.SC_DISABLE_SPEEDY!==""&&{}.SC_DISABLE_SPEEDY!=="false"&&{}.SC_DISABLE_SPEEDY),Lz=Object.freeze([]),gD=Object.freeze({});function avt(n,e,t){return t===void 0&&(t=gD),n.theme!==t.theme&&n.theme||e||t.theme}var r5e=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),lvt=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,cvt=/(^-|-$)/g;function Ewe(n){return n.replace(lvt,"-").replace(cvt,"")}var uvt=/(a)(d)/gi,xwe=function(n){return String.fromCharCode(n+(n>25?39:97))};function nne(n){var e,t="";for(e=Math.abs(n);e>52;e=e/52|0)t=xwe(e%52)+t;return(xwe(e%52)+t).replace(uvt,"$1-$2")}var YY,CI=function(n,e){for(var t=e.length;t;)n=33*n^e.charCodeAt(--t);return n},o5e=function(n){return CI(5381,n)};function dvt(n){return nne(o5e(n)>>>0)}function hvt(n){return n.displayName||n.name||"Component"}function QY(n){return typeof n=="string"&&!0}var s5e=typeof Symbol=="function"&&Symbol.for,a5e=s5e?Symbol.for("react.memo"):60115,fvt=s5e?Symbol.for("react.forward_ref"):60112,gvt={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},pvt={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},l5e={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},mvt=((YY={})[fvt]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},YY[a5e]=l5e,YY);function kwe(n){return("type"in(e=n)&&e.type.$$typeof)===a5e?l5e:"$$typeof"in n?mvt[n.$$typeof]:gvt;var e}var _vt=Object.defineProperty,vvt=Object.getOwnPropertyNames,Twe=Object.getOwnPropertySymbols,bvt=Object.getOwnPropertyDescriptor,yvt=Object.getPrototypeOf,Iwe=Object.prototype;function c5e(n,e,t){if(typeof e!="string"){if(Iwe){var i=yvt(e);i&&i!==Iwe&&c5e(n,i,t)}var r=vvt(e);Twe&&(r=r.concat(Twe(e)));for(var o=kwe(n),s=kwe(e),a=0;a<r.length;++a){var l=r[a];if(!(l in pvt||t&&t[l]||s&&l in s||o&&l in o)){var c=bvt(e,l);try{_vt(n,l,c)}catch{}}}}return n}function pD(n){return typeof n=="function"}function $he(n){return typeof n=="object"&&"styledComponentId"in n}function bE(n,e){return n&&e?"".concat(n," ").concat(e):n||e||""}function Lwe(n,e){if(n.length===0)return"";for(var t=n[0],i=1;i<n.length;i++)t+=e?e+n[i]:n[i];return t}function NP(n){return n!==null&&typeof n=="object"&&n.constructor.name===Object.name&&!("props"in n&&n.$$typeof)}function ine(n,e,t){if(t===void 0&&(t=!1),!t&&!NP(n)&&!Array.isArray(n))return e;if(Array.isArray(e))for(var i=0;i<e.length;i++)n[i]=ine(n[i],e[i]);else if(NP(e))for(var i in e)n[i]=ine(n[i],e[i]);return n}function Vhe(n,e){Object.defineProperty(n,"toString",{value:e})}function g3(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(n," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):""))}var Cvt=function(){function n(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return n.prototype.indexOfGroup=function(e){for(var t=0,i=0;i<e;i++)t+=this.groupSizes[i];return t},n.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var i=this.groupSizes,r=i.length,o=r;e>=o;)if((o<<=1)<0)throw g3(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(i),this.length=o;for(var s=r;s<o;s++)this.groupSizes[s]=0}for(var a=this.indexOfGroup(e+1),l=(s=0,t.length);s<l;s++)this.tag.insertRule(a,t[s])&&(this.groupSizes[e]++,a++)},n.prototype.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],i=this.indexOfGroup(e),r=i+t;this.groupSizes[e]=0;for(var o=i;o<r;o++)this.tag.deleteRule(i)}},n.prototype.getGroup=function(e){var t="";if(e>=this.length||this.groupSizes[e]===0)return t;for(var i=this.groupSizes[e],r=this.indexOfGroup(e),o=r+i,s=r;s<o;s++)t+="".concat(this.tag.getRule(s)).concat(`/*!sc*/
`);return t},n}(),i8=new Map,o7=new Map,XY=1,d6=function(n){if(i8.has(n))return i8.get(n);for(;o7.has(XY);)XY++;var e=XY++;return i8.set(n,e),o7.set(e,n),e},wvt=function(n,e){i8.set(n,e),o7.set(e,n)},Svt="style[".concat(fD,"][").concat("data-styled-version",'="').concat("6.1.0",'"]'),Evt=new RegExp("^".concat(fD,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),xvt=function(n,e,t){for(var i,r=t.split(","),o=0,s=r.length;o<s;o++)(i=r[o])&&n.registerName(e,i)},kvt=function(n,e){for(var t,i=((t=e.textContent)!==null&&t!==void 0?t:"").split(`/*!sc*/
`),r=[],o=0,s=i.length;o<s;o++){var a=i[o].trim();if(a){var l=a.match(Evt);if(l){var c=0|parseInt(l[1],10),u=l[2];c!==0&&(wvt(u,c),xvt(n,u,l[3]),n.getTag().insertRules(c,r)),r.length=0}else r.push(a)}}};function Tvt(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null}var u5e=function(n){var e=document.head,t=n||e,i=document.createElement("style"),r=function(a){var l=Array.from(a.querySelectorAll("style[".concat(fD,"]")));return l[l.length-1]}(t),o=r!==void 0?r.nextSibling:null;i.setAttribute(fD,"active"),i.setAttribute("data-styled-version","6.1.0");var s=Tvt();return s&&i.setAttribute("nonce",s),t.insertBefore(i,o),i},Ivt=function(){function n(e){this.element=u5e(e),this.element.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var i=document.styleSheets,r=0,o=i.length;r<o;r++){var s=i[r];if(s.ownerNode===t)return s}throw g3(17)}(this.element),this.length=0}return n.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch{return!1}},n.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},n.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},n}(),Lvt=function(){function n(e){this.element=u5e(e),this.nodes=this.element.childNodes,this.length=0}return n.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var i=document.createTextNode(t);return this.element.insertBefore(i,this.nodes[e]||null),this.length++,!0}return!1},n.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},n.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},n}(),Dvt=function(){function n(e){this.rules=[],this.length=0}return n.prototype.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},n.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},n.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},n}(),Dwe=Bhe,Avt={isServer:!Bhe,useCSSOMInjection:!svt},d5e=function(){function n(e,t,i){e===void 0&&(e=gD),t===void 0&&(t={});var r=this;this.options=zh(zh({},Avt),e),this.gs=t,this.names=new Map(i),this.server=!!e.isServer,!this.server&&Bhe&&Dwe&&(Dwe=!1,function(o){for(var s=document.querySelectorAll(Svt),a=0,l=s.length;a<l;a++){var c=s[a];c&&c.getAttribute(fD)!=="active"&&(kvt(o,c),c.parentNode&&c.parentNode.removeChild(c))}}(this)),Vhe(this,function(){return function(o){for(var s=o.getTag(),a=s.length,l="",c=function(d){var h=function(v){return o7.get(v)}(d);if(h===void 0)return"continue";var g=o.names.get(h),p=s.getGroup(d);if(g===void 0||p.length===0)return"continue";var m="".concat(fD,".g").concat(d,'[id="').concat(h,'"]'),_="";g!==void 0&&g.forEach(function(v){v.length>0&&(_+="".concat(v,","))}),l+="".concat(p).concat(m,'{content:"').concat(_,'"}').concat(`/*!sc*/
`)},u=0;u<a;u++)c(u);return l}(r)})}return n.registerId=function(e){return d6(e)},n.prototype.reconstructWithOptions=function(e,t){return t===void 0&&(t=!0),new n(zh(zh({},this.options),e),this.gs,t&&this.names||void 0)},n.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},n.prototype.getTag=function(){return this.tag||(this.tag=(e=function(t){var i=t.useCSSOMInjection,r=t.target;return t.isServer?new Dvt(r):i?new Ivt(r):new Lvt(r)}(this.options),new Cvt(e)));var e},n.prototype.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},n.prototype.registerName=function(e,t){if(d6(e),this.names.has(e))this.names.get(e).add(t);else{var i=new Set;i.add(t),this.names.set(e,i)}},n.prototype.insertRules=function(e,t,i){this.registerName(e,t),this.getTag().insertRules(d6(e),i)},n.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},n.prototype.clearRules=function(e){this.getTag().clearGroup(d6(e)),this.clearNames(e)},n.prototype.clearTag=function(){this.tag=void 0},n}(),Rvt=/&/g,Nvt=/^\s*\/\/.*$/gm;function h5e(n,e){return n.map(function(t){return t.type==="rule"&&(t.value="".concat(e," ").concat(t.value),t.value=t.value.replaceAll(",",",".concat(e," ")),t.props=t.props.map(function(i){return"".concat(e," ").concat(i)})),Array.isArray(t.children)&&t.type!=="@keyframes"&&(t.children=h5e(t.children,e)),t})}function Ovt(n){var e,t,i,r=n===void 0?gD:n,o=r.options,s=o===void 0?gD:o,a=r.plugins,l=a===void 0?Lz:a,c=function(h,g,p){return p===t||p.startsWith(t)&&p.endsWith(t)&&p.replaceAll(t,"").length>0?".".concat(e):h},u=l.slice();u.push(function(h){h.type===xz&&h.value.includes("&")&&(h.props[0]=h.props[0].replace(Rvt,t).replace(i,c))}),s.prefix&&u.push(ovt),u.push(nvt);var d=function(h,g,p,m){g===void 0&&(g=""),p===void 0&&(p=""),m===void 0&&(m="&"),e=m,t=g,i=new RegExp("\\".concat(t,"\\b"),"g");var _=h.replace(Nvt,""),v=evt(p||g?"".concat(p," ").concat(g," { ").concat(_," }"):_);s.namespace&&(v=h5e(v,s.namespace));var b=[];return r7(v,ivt(u.concat(rvt(function(y){return b.push(y)})))),b};return d.hash=l.length?l.reduce(function(h,g){return g.name||g3(15),CI(h,g.name)},5381).toString():"",d}var Pvt=new d5e,rne=Ovt(),f5e=te.createContext({shouldForwardProp:void 0,styleSheet:Pvt,stylis:rne});f5e.Consumer;te.createContext(void 0);function Awe(){return w.useContext(f5e)}var Mvt=function(){function n(e,t){var i=this;this.inject=function(r,o){o===void 0&&(o=rne);var s=i.name+o.hash;r.hasNameForId(i.id,s)||r.insertRules(i.id,s,o(i.rules,s,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=t,Vhe(this,function(){throw g3(12,String(i.name))})}return n.prototype.getName=function(e){return e===void 0&&(e=rne),this.name+e.hash},n}(),Fvt=function(n){return n>="A"&&n<="Z"};function Rwe(n){for(var e="",t=0;t<n.length;t++){var i=n[t];if(t===1&&i==="-"&&n[0]==="-")return n;Fvt(i)?e+="-"+i.toLowerCase():e+=i}return e.startsWith("ms-")?"-"+e:e}var g5e=function(n){return n==null||n===!1||n===""},p5e=function(n){var e,t,i=[];for(var r in n){var o=n[r];n.hasOwnProperty(r)&&!g5e(o)&&(Array.isArray(o)&&o.isCss||pD(o)?i.push("".concat(Rwe(r),":"),o,";"):NP(o)?i.push.apply(i,uD(uD(["".concat(r," {")],p5e(o),!1),["}"],!1)):i.push("".concat(Rwe(r),": ").concat((e=r,(t=o)==null||typeof t=="boolean"||t===""?"":typeof t!="number"||t===0||e in i5e||e.startsWith("--")?String(t).trim():"".concat(t,"px")),";")))}return i};function VE(n,e,t,i){if(g5e(n))return[];if($he(n))return[".".concat(n.styledComponentId)];if(pD(n)){if(!pD(o=n)||o.prototype&&o.prototype.isReactComponent||!e)return[n];var r=n(e);return VE(r,e,t,i)}var o;return n instanceof Mvt?t?(n.inject(t,i),[n.getName(i)]):[n]:NP(n)?p5e(n):Array.isArray(n)?Array.prototype.concat.apply(Lz,n.map(function(s){return VE(s,e,t,i)})):[n.toString()]}function Bvt(n){for(var e=0;e<n.length;e+=1){var t=n[e];if(pD(t)&&!$he(t))return!1}return!0}var $vt=o5e("6.1.0"),Vvt=function(){function n(e,t,i){this.rules=e,this.staticRulesId="",this.isStatic=(i===void 0||i.isStatic)&&Bvt(e),this.componentId=t,this.baseHash=CI($vt,t),this.baseStyle=i,d5e.registerId(t)}return n.prototype.generateAndInjectStyles=function(e,t,i){var r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,i):"";if(this.isStatic&&!i.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))r=bE(r,this.staticRulesId);else{var o=Lwe(VE(this.rules,e,t,i)),s=nne(CI(this.baseHash,o)>>>0);if(!t.hasNameForId(this.componentId,s)){var a=i(o,".".concat(s),void 0,this.componentId);t.insertRules(this.componentId,s,a)}r=bE(r,s),this.staticRulesId=s}else{for(var l=CI(this.baseHash,i.hash),c="",u=0;u<this.rules.length;u++){var d=this.rules[u];if(typeof d=="string")c+=d;else if(d){var h=Lwe(VE(d,e,t,i));l=CI(l,h+u),c+=h}}if(c){var g=nne(l>>>0);t.hasNameForId(this.componentId,g)||t.insertRules(this.componentId,g,i(c,".".concat(g),void 0,this.componentId)),r=bE(r,g)}}return r},n}(),m5e=te.createContext(void 0);m5e.Consumer;var ZY={};function Hvt(n,e,t){var i=$he(n),r=n,o=!QY(n),s=e.attrs,a=s===void 0?Lz:s,l=e.componentId,c=l===void 0?function(y,C){var x=typeof y!="string"?"sc":Ewe(y);ZY[x]=(ZY[x]||0)+1;var k="".concat(x,"-").concat(dvt("6.1.0"+x+ZY[x]));return C?"".concat(C,"-").concat(k):k}(e.displayName,e.parentComponentId):l,u=e.displayName;u===void 0&&function(y){return QY(y)?"styled.".concat(y):"Styled(".concat(hvt(y),")")}(n);var d=e.displayName&&e.componentId?"".concat(Ewe(e.displayName),"-").concat(e.componentId):e.componentId||c,h=i&&r.attrs?r.attrs.concat(a).filter(Boolean):a,g=e.shouldForwardProp;if(i&&r.shouldForwardProp){var p=r.shouldForwardProp;if(e.shouldForwardProp){var m=e.shouldForwardProp;g=function(y,C){return p(y,C)&&m(y,C)}}else g=p}var _=new Vvt(t,d,i?r.componentStyle:void 0);function v(y,C){return function(x,k,I){var L=x.attrs,D=x.componentStyle,R=x.defaultProps,P=x.foldedComponentIds,M=x.styledComponentId,O=x.target,B=te.useContext(m5e),F=Awe(),H=x.shouldForwardProp||F.shouldForwardProp,V=function(he,xe,_e){for(var Ie,Re=zh(zh({},xe),{className:void 0,theme:_e}),Ye=0;Ye<he.length;Ye+=1){var Ze=pD(Ie=he[Ye])?Ie(Re):Ie;for(var tt in Ze)Re[tt]=tt==="className"?bE(Re[tt],Ze[tt]):tt==="style"?zh(zh({},Re[tt]),Ze[tt]):Ze[tt]}return xe.className&&(Re.className=bE(Re.className,xe.className)),Re}(L,k,avt(k,B,R)||gD),$=V.as||O,j={};for(var Y in V)V[Y]===void 0||Y[0]==="$"||Y==="as"||Y==="theme"||(Y==="forwardedAs"?j.as=V.forwardedAs:H&&!H(Y,$)||(j[Y]=V[Y]));var ne=function(he,xe){var _e=Awe(),Ie=he.generateAndInjectStyles(xe,_e.styleSheet,_e.stylis);return Ie}(D,V),se=bE(P,M);return ne&&(se+=" "+ne),V.className&&(se+=" "+V.className),j[QY($)&&!r5e.has($)?"class":"className"]=se,j.ref=I,w.createElement($,j)}(b,y,C)}var b=te.forwardRef(v);return b.attrs=h,b.componentStyle=_,b.shouldForwardProp=g,b.foldedComponentIds=i?bE(r.foldedComponentIds,r.styledComponentId):"",b.styledComponentId=d,b.target=i?r.target:n,Object.defineProperty(b,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(y){this._foldedDefaultProps=i?function(C){for(var x=[],k=1;k<arguments.length;k++)x[k-1]=arguments[k];for(var I=0,L=x;I<L.length;I++)ine(C,L[I],!0);return C}({},r.defaultProps,y):y}}),Vhe(b,function(){return".".concat(b.styledComponentId)}),o&&c5e(b,n,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),b}function Nwe(n,e){for(var t=[n[0]],i=0,r=e.length;i<r;i+=1)t.push(e[i],n[i+1]);return t}var Owe=function(n){return Object.assign(n,{isCss:!0})};function Wvt(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(pD(n)||NP(n)){var i=n;return Owe(VE(Nwe(Lz,uD([i],e,!0))))}var r=n;return e.length===0&&r.length===1&&typeof r[0]=="string"?VE(r):Owe(VE(Nwe(r,e)))}function one(n,e,t){if(t===void 0&&(t=gD),!e)throw g3(1,e);var i=function(r){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];return n(e,t,Wvt.apply(void 0,uD([r],o,!1)))};return i.attrs=function(r){return one(n,e,zh(zh({},t),{attrs:Array.prototype.concat(t.attrs,r).filter(Boolean)}))},i.withConfig=function(r){return one(n,e,zh(zh({},t),r))},i}var _5e=function(n){return one(Hvt,n)},Ea=_5e;r5e.forEach(function(n){Ea[n]=_5e(n)});const zvt={type:"primary",behavior:"submit"},jvt=Ea(E0)`
color: ${n=>n.theme.color} !important;
background-color: ${n=>n.theme.backgroundColor} !important;
border-color: ${n=>n.theme.borderColor} !important;
`,Uvt=Ea.button`
color: ${n=>n.theme.color} !important;
background-color: ${n=>n.theme.backgroundColor} !important;
border-color: ${n=>n.theme.borderColor} !important;
`;function Ut(n){n={...zvt,...n};const e=Vn(),t=ys(),i={backgroundColor:n.type==="primary"?t:n.noBackgroundColor?"transparent":"white",color:n.type!=="primary"&&n.type!=="secondary"?t:""};return n.to?f(jvt,{to:n.to,theme:{backgroundColor:n.type==="primary"?t:e.$1,color:n.type==="primary"?e.$9:e.$3,borderColor:n.type==="primary"?"transparent":e.$5},className:St(`border inline-flex items-center space-x-2 px-4 justify-center rounded text-sm ${n.className} disabled:cursor-not-allowed disabled:opacity-75`,{"py-2 px-4":n.type!=="minimal","w-full":n.variant==="block","p-0 m-0":n.type==="minimal"}),style:i,children:n.disabled?f(Vo,{variant:"light"}):n.children}):f(Uvt,{type:n.behavior,disabled:n.disabled,theme:{backgroundColor:n.type==="primary"?t:e.$1,color:n.type==="primary"?e.$9:e.$3,borderColor:n.type==="primary"?"transparent":e.$5},className:St(`border inline-flex items-center space-x-2 px-4 justify-center rounded text-sm ${n.className} disabled:cursor-not-allowed disabled:opacity-75`,{"py-2 px-4":n.type!=="minimal","w-full":n.variant==="block","p-0 m-0":n.type==="minimal"}),style:i,onClick:n.onClick,children:n.disabled&&!n.disableWithoutIcon?f(Vo,{variant:"light"}):n.children})}const qvt=Ea.input`
background-color: ${n=>n.theme.backgroundColor};
`;function Nh(n){const e=Vn();return N("div",{className:"relative flex items-start",children:[f("div",{className:"flex items-center h-5",children:f(qvt,{theme:{backgroundColor:e.$2},ref:n.innerRef,value:n.value,id:n.id,"aria-describedby":"comments-description",type:"checkbox",className:St("h-4 w-4 rounded cursor-pointer disabled:opacity-50",n.className),style:{borderColor:e.$5},onChange:t=>{n.onChange&&n.onChange(t),n.onValueChange&&n.onValueChange(t.target.value,t.target.checked)},checked:n.checked,disabled:n.disabled,"data-cy":n.cypressRef})}),f("div",{className:"ml-3 text-sm",children:f("label",{htmlFor:n.id,className:"font-medium cursor-pointer",style:{color:e.$3},children:n.label})})]})}function Kvt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function pk(n){var e=Kvt();return function(){var i=Pp(n),r;if(e){var o=Pp(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return M2(this,r)}}var Jh="top",Fp="bottom",Bp="right",ef="left",Hhe="auto",p3=[Jh,Fp,Bp,ef],mD="start",OP="end",Gvt="clippingParents",v5e="viewport",gR="popper",Yvt="reference",Pwe=p3.reduce(function(n,e){return n.concat([e+"-"+mD,e+"-"+OP])},[]),b5e=[].concat(p3,[Hhe]).reduce(function(n,e){return n.concat([e,e+"-"+mD,e+"-"+OP])},[]),Qvt="beforeRead",Xvt="read",Zvt="afterRead",Jvt="beforeMain",ebt="main",tbt="afterMain",nbt="beforeWrite",ibt="write",rbt="afterWrite",obt=[Qvt,Xvt,Zvt,Jvt,ebt,tbt,nbt,ibt,rbt];function eb(n){return n?(n.nodeName||"").toLowerCase():null}function yg(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function mx(n){var e=yg(n).Element;return n instanceof e||n instanceof Element}function Ep(n){var e=yg(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Whe(n){if(typeof ShadowRoot>"u")return!1;var e=yg(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function sbt(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},r=e.attributes[t]||{},o=e.elements[t];!Ep(o)||!eb(o)||(Object.assign(o.style,i),Object.keys(r).forEach(function(s){var a=r[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function abt(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var r=e.elements[i],o=e.attributes[i]||{},s=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=s.reduce(function(l,c){return l[c]="",l},{});!Ep(r)||!eb(r)||(Object.assign(r.style,a),Object.keys(o).forEach(function(l){r.removeAttribute(l)}))})}}const zhe={name:"applyStyles",enabled:!0,phase:"write",fn:sbt,effect:abt,requires:["computeStyles"]};function qv(n){return n.split("-")[0]}var HE=Math.max,s7=Math.min,_D=Math.round;function sne(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function y5e(){return!/^((?!chrome|android).)*safari/i.test(sne())}function vD(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=n.getBoundingClientRect(),r=1,o=1;e&&Ep(n)&&(r=n.offsetWidth>0&&_D(i.width)/n.offsetWidth||1,o=n.offsetHeight>0&&_D(i.height)/n.offsetHeight||1);var s=mx(n)?yg(n):window,a=s.visualViewport,l=!y5e()&&t,c=(i.left+(l&&a?a.offsetLeft:0))/r,u=(i.top+(l&&a?a.offsetTop:0))/o,d=i.width/r,h=i.height/o;return{width:d,height:h,top:u,right:c+d,bottom:u+h,left:c,x:c,y:u}}function jhe(n){var e=vD(n),t=n.offsetWidth,i=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:i}}function C5e(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Whe(t)){var i=e;do{if(i&&n.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function h0(n){return yg(n).getComputedStyle(n)}function lbt(n){return["table","td","th"].indexOf(eb(n))>=0}function Mw(n){return((mx(n)?n.ownerDocument:n.document)||window.document).documentElement}function Dz(n){return eb(n)==="html"?n:n.assignedSlot||n.parentNode||(Whe(n)?n.host:null)||Mw(n)}function Mwe(n){return!Ep(n)||h0(n).position==="fixed"?null:n.offsetParent}function cbt(n){var e=/firefox/i.test(sne()),t=/Trident/i.test(sne());if(t&&Ep(n)){var i=h0(n);if(i.position==="fixed")return null}var r=Dz(n);for(Whe(r)&&(r=r.host);Ep(r)&&["html","body"].indexOf(eb(r))<0;){var o=h0(r);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return r;r=r.parentNode}return null}function m3(n){for(var e=yg(n),t=Mwe(n);t&&lbt(t)&&h0(t).position==="static";)t=Mwe(t);return t&&(eb(t)==="html"||eb(t)==="body"&&h0(t).position==="static")?e:t||cbt(n)||e}function Uhe(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function oO(n,e,t){return HE(n,s7(e,t))}function ubt(n,e,t){var i=oO(n,e,t);return i>t?t:i}function w5e(){return{top:0,right:0,bottom:0,left:0}}function S5e(n){return Object.assign({},w5e(),n)}function E5e(n,e){return e.reduce(function(t,i){return t[i]=n,t},{})}var dbt=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,S5e(typeof e!="number"?e:E5e(e,p3))};function hbt(n){var e,t=n.state,i=n.name,r=n.options,o=t.elements.arrow,s=t.modifiersData.popperOffsets,a=qv(t.placement),l=Uhe(a),c=[ef,Bp].indexOf(a)>=0,u=c?"height":"width";if(!(!o||!s)){var d=dbt(r.padding,t),h=jhe(o),g=l==="y"?Jh:ef,p=l==="y"?Fp:Bp,m=t.rects.reference[u]+t.rects.reference[l]-s[l]-t.rects.popper[u],_=s[l]-t.rects.reference[l],v=m3(o),b=v?l==="y"?v.clientHeight||0:v.clientWidth||0:0,y=m/2-_/2,C=d[g],x=b-h[u]-d[p],k=b/2-h[u]/2+y,I=oO(C,k,x),L=l;t.modifiersData[i]=(e={},e[L]=I,e.centerOffset=I-k,e)}}function fbt(n){var e=n.state,t=n.options,i=t.element,r=i===void 0?"[data-popper-arrow]":i;r!=null&&(typeof r=="string"&&(r=e.elements.popper.querySelector(r),!r)||C5e(e.elements.popper,r)&&(e.elements.arrow=r))}const gbt={name:"arrow",enabled:!0,phase:"main",fn:hbt,effect:fbt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function bD(n){return n.split("-")[1]}var pbt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function mbt(n,e){var t=n.x,i=n.y,r=e.devicePixelRatio||1;return{x:_D(t*r)/r||0,y:_D(i*r)/r||0}}function Fwe(n){var e,t=n.popper,i=n.popperRect,r=n.placement,o=n.variation,s=n.offsets,a=n.position,l=n.gpuAcceleration,c=n.adaptive,u=n.roundOffsets,d=n.isFixed,h=s.x,g=h===void 0?0:h,p=s.y,m=p===void 0?0:p,_=typeof u=="function"?u({x:g,y:m}):{x:g,y:m};g=_.x,m=_.y;var v=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),y=ef,C=Jh,x=window;if(c){var k=m3(t),I="clientHeight",L="clientWidth";if(k===yg(t)&&(k=Mw(t),h0(k).position!=="static"&&a==="absolute"&&(I="scrollHeight",L="scrollWidth")),k=k,r===Jh||(r===ef||r===Bp)&&o===OP){C=Fp;var D=d&&k===x&&x.visualViewport?x.visualViewport.height:k[I];m-=D-i.height,m*=l?1:-1}if(r===ef||(r===Jh||r===Fp)&&o===OP){y=Bp;var R=d&&k===x&&x.visualViewport?x.visualViewport.width:k[L];g-=R-i.width,g*=l?1:-1}}var P=Object.assign({position:a},c&&pbt),M=u===!0?mbt({x:g,y:m},yg(t)):{x:g,y:m};if(g=M.x,m=M.y,l){var O;return Object.assign({},P,(O={},O[C]=b?"0":"",O[y]=v?"0":"",O.transform=(x.devicePixelRatio||1)<=1?"translate("+g+"px, "+m+"px)":"translate3d("+g+"px, "+m+"px, 0)",O))}return Object.assign({},P,(e={},e[C]=b?m+"px":"",e[y]=v?g+"px":"",e.transform="",e))}function _bt(n){var e=n.state,t=n.options,i=t.gpuAcceleration,r=i===void 0?!0:i,o=t.adaptive,s=o===void 0?!0:o,a=t.roundOffsets,l=a===void 0?!0:a,c={placement:qv(e.placement),variation:bD(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Fwe(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Fwe(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const vbt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:_bt,data:{}};var h6={passive:!0};function bbt(n){var e=n.state,t=n.instance,i=n.options,r=i.scroll,o=r===void 0?!0:r,s=i.resize,a=s===void 0?!0:s,l=yg(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",t.update,h6)}),a&&l.addEventListener("resize",t.update,h6),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",t.update,h6)}),a&&l.removeEventListener("resize",t.update,h6)}}const ybt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:bbt,data:{}};var Cbt={left:"right",right:"left",bottom:"top",top:"bottom"};function r8(n){return n.replace(/left|right|bottom|top/g,function(e){return Cbt[e]})}var wbt={start:"end",end:"start"};function Bwe(n){return n.replace(/start|end/g,function(e){return wbt[e]})}function qhe(n){var e=yg(n),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function Khe(n){return vD(Mw(n)).left+qhe(n).scrollLeft}function Sbt(n,e){var t=yg(n),i=Mw(n),r=t.visualViewport,o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var c=y5e();(c||!c&&e==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+Khe(n),y:l}}function Ebt(n){var e,t=Mw(n),i=qhe(n),r=(e=n.ownerDocument)==null?void 0:e.body,o=HE(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=HE(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+Khe(n),l=-i.scrollTop;return h0(r||t).direction==="rtl"&&(a+=HE(t.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function Ghe(n){var e=h0(n),t=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+i)}function x5e(n){return["html","body","#document"].indexOf(eb(n))>=0?n.ownerDocument.body:Ep(n)&&Ghe(n)?n:x5e(Dz(n))}function sO(n,e){var t;e===void 0&&(e=[]);var i=x5e(n),r=i===((t=n.ownerDocument)==null?void 0:t.body),o=yg(i),s=r?[o].concat(o.visualViewport||[],Ghe(i)?i:[]):i,a=e.concat(s);return r?a:a.concat(sO(Dz(s)))}function ane(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function xbt(n,e){var t=vD(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function $we(n,e,t){return e===v5e?ane(Sbt(n,t)):mx(e)?xbt(e,t):ane(Ebt(Mw(n)))}function kbt(n){var e=sO(Dz(n)),t=["absolute","fixed"].indexOf(h0(n).position)>=0,i=t&&Ep(n)?m3(n):n;return mx(i)?e.filter(function(r){return mx(r)&&C5e(r,i)&&eb(r)!=="body"}):[]}function Tbt(n,e,t,i){var r=e==="clippingParents"?kbt(n):[].concat(e),o=[].concat(r,[t]),s=o[0],a=o.reduce(function(l,c){var u=$we(n,c,i);return l.top=HE(u.top,l.top),l.right=s7(u.right,l.right),l.bottom=s7(u.bottom,l.bottom),l.left=HE(u.left,l.left),l},$we(n,s,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function k5e(n){var e=n.reference,t=n.element,i=n.placement,r=i?qv(i):null,o=i?bD(i):null,s=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(r){case Jh:l={x:s,y:e.y-t.height};break;case Fp:l={x:s,y:e.y+e.height};break;case Bp:l={x:e.x+e.width,y:a};break;case ef:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var c=r?Uhe(r):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case mD:l[c]=l[c]-(e[u]/2-t[u]/2);break;case OP:l[c]=l[c]+(e[u]/2-t[u]/2);break}}return l}function PP(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=i===void 0?n.placement:i,o=t.strategy,s=o===void 0?n.strategy:o,a=t.boundary,l=a===void 0?Gvt:a,c=t.rootBoundary,u=c===void 0?v5e:c,d=t.elementContext,h=d===void 0?gR:d,g=t.altBoundary,p=g===void 0?!1:g,m=t.padding,_=m===void 0?0:m,v=S5e(typeof _!="number"?_:E5e(_,p3)),b=h===gR?Yvt:gR,y=n.rects.popper,C=n.elements[p?b:h],x=Tbt(mx(C)?C:C.contextElement||Mw(n.elements.popper),l,u,s),k=vD(n.elements.reference),I=k5e({reference:k,element:y,strategy:"absolute",placement:r}),L=ane(Object.assign({},y,I)),D=h===gR?L:k,R={top:x.top-D.top+v.top,bottom:D.bottom-x.bottom+v.bottom,left:x.left-D.left+v.left,right:D.right-x.right+v.right},P=n.modifiersData.offset;if(h===gR&&P){var M=P[r];Object.keys(R).forEach(function(O){var B=[Bp,Fp].indexOf(O)>=0?1:-1,F=[Jh,Fp].indexOf(O)>=0?"y":"x";R[O]+=M[F]*B})}return R}function Ibt(n,e){e===void 0&&(e={});var t=e,i=t.placement,r=t.boundary,o=t.rootBoundary,s=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,c=l===void 0?b5e:l,u=bD(i),d=u?a?Pwe:Pwe.filter(function(p){return bD(p)===u}):p3,h=d.filter(function(p){return c.indexOf(p)>=0});h.length===0&&(h=d);var g=h.reduce(function(p,m){return p[m]=PP(n,{placement:m,boundary:r,rootBoundary:o,padding:s})[qv(m)],p},{});return Object.keys(g).sort(function(p,m){return g[p]-g[m]})}function Lbt(n){if(qv(n)===Hhe)return[];var e=r8(n);return[Bwe(n),e,Bwe(e)]}function Dbt(n){var e=n.state,t=n.options,i=n.name;if(!e.modifiersData[i]._skip){for(var r=t.mainAxis,o=r===void 0?!0:r,s=t.altAxis,a=s===void 0?!0:s,l=t.fallbackPlacements,c=t.padding,u=t.boundary,d=t.rootBoundary,h=t.altBoundary,g=t.flipVariations,p=g===void 0?!0:g,m=t.allowedAutoPlacements,_=e.options.placement,v=qv(_),b=v===_,y=l||(b||!p?[r8(_)]:Lbt(_)),C=[_].concat(y).reduce(function(xe,_e){return xe.concat(qv(_e)===Hhe?Ibt(e,{placement:_e,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):_e)},[]),x=e.rects.reference,k=e.rects.popper,I=new Map,L=!0,D=C[0],R=0;R<C.length;R++){var P=C[R],M=qv(P),O=bD(P)===mD,B=[Jh,Fp].indexOf(M)>=0,F=B?"width":"height",H=PP(e,{placement:P,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),V=B?O?Bp:ef:O?Fp:Jh;x[F]>k[F]&&(V=r8(V));var $=r8(V),j=[];if(o&&j.push(H[M]<=0),a&&j.push(H[V]<=0,H[$]<=0),j.every(function(xe){return xe})){D=P,L=!1;break}I.set(P,j)}if(L)for(var Y=p?3:1,ne=function(_e){var Ie=C.find(function(Re){var Ye=I.get(Re);if(Ye)return Ye.slice(0,_e).every(function(Ze){return Ze})});if(Ie)return D=Ie,"break"},se=Y;se>0;se--){var he=ne(se);if(he==="break")break}e.placement!==D&&(e.modifiersData[i]._skip=!0,e.placement=D,e.reset=!0)}}const Abt={name:"flip",enabled:!0,phase:"main",fn:Dbt,requiresIfExists:["offset"],data:{_skip:!1}};function Vwe(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function Hwe(n){return[Jh,Bp,Fp,ef].some(function(e){return n[e]>=0})}function Rbt(n){var e=n.state,t=n.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=PP(e,{elementContext:"reference"}),a=PP(e,{altBoundary:!0}),l=Vwe(s,i),c=Vwe(a,r,o),u=Hwe(l),d=Hwe(c);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const Nbt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Rbt};function Obt(n,e,t){var i=qv(n),r=[ef,Jh].indexOf(i)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,[ef,Bp].indexOf(i)>=0?{x:a,y:s}:{x:s,y:a}}function Pbt(n){var e=n.state,t=n.options,i=n.name,r=t.offset,o=r===void 0?[0,0]:r,s=b5e.reduce(function(u,d){return u[d]=Obt(d,e.rects,o),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[i]=s}const Mbt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Pbt};function Fbt(n){var e=n.state,t=n.name;e.modifiersData[t]=k5e({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Bbt={name:"popperOffsets",enabled:!0,phase:"read",fn:Fbt,data:{}};function $bt(n){return n==="x"?"y":"x"}function Vbt(n){var e=n.state,t=n.options,i=n.name,r=t.mainAxis,o=r===void 0?!0:r,s=t.altAxis,a=s===void 0?!1:s,l=t.boundary,c=t.rootBoundary,u=t.altBoundary,d=t.padding,h=t.tether,g=h===void 0?!0:h,p=t.tetherOffset,m=p===void 0?0:p,_=PP(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=qv(e.placement),b=bD(e.placement),y=!b,C=Uhe(v),x=$bt(C),k=e.modifiersData.popperOffsets,I=e.rects.reference,L=e.rects.popper,D=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,R=typeof D=="number"?{mainAxis:D,altAxis:D}:Object.assign({mainAxis:0,altAxis:0},D),P=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,M={x:0,y:0};if(k){if(o){var O,B=C==="y"?Jh:ef,F=C==="y"?Fp:Bp,H=C==="y"?"height":"width",V=k[C],$=V+_[B],j=V-_[F],Y=g?-L[H]/2:0,ne=b===mD?I[H]:L[H],se=b===mD?-L[H]:-I[H],he=e.elements.arrow,xe=g&&he?jhe(he):{width:0,height:0},_e=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:w5e(),Ie=_e[B],Re=_e[F],Ye=oO(0,I[H],xe[H]),Ze=y?I[H]/2-Y-Ye-Ie-R.mainAxis:ne-Ye-Ie-R.mainAxis,tt=y?-I[H]/2+Y+Ye+Re+R.mainAxis:se+Ye+Re+R.mainAxis,Be=e.elements.arrow&&m3(e.elements.arrow),kt=Be?C==="y"?Be.clientTop||0:Be.clientLeft||0:0,Vt=(O=P==null?void 0:P[C])!=null?O:0,xt=V+Ze-Vt-kt,Kt=V+tt-Vt,cn=oO(g?s7($,xt):$,V,g?HE(j,Kt):j);k[C]=cn,M[C]=cn-V}if(a){var wn,on=C==="x"?Jh:ef,Zt=C==="x"?Fp:Bp,pe=k[x],me=x==="y"?"height":"width",Z=pe+_[on],G=pe-_[Zt],K=[Jh,ef].indexOf(v)!==-1,oe=(wn=P==null?void 0:P[x])!=null?wn:0,le=K?Z:pe-I[me]-L[me]-oe+R.altAxis,we=K?pe+I[me]+L[me]-oe-R.altAxis:G,Me=g&&K?ubt(le,pe,we):oO(g?le:Z,pe,g?we:G);k[x]=Me,M[x]=Me-pe}e.modifiersData[i]=M}}const Hbt={name:"preventOverflow",enabled:!0,phase:"main",fn:Vbt,requiresIfExists:["offset"]};function Wbt(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function zbt(n){return n===yg(n)||!Ep(n)?qhe(n):Wbt(n)}function jbt(n){var e=n.getBoundingClientRect(),t=_D(e.width)/n.offsetWidth||1,i=_D(e.height)/n.offsetHeight||1;return t!==1||i!==1}function Ubt(n,e,t){t===void 0&&(t=!1);var i=Ep(e),r=Ep(e)&&jbt(e),o=Mw(e),s=vD(n,r,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!t)&&((eb(e)!=="body"||Ghe(o))&&(a=zbt(e)),Ep(e)?(l=vD(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=Khe(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function qbt(n){var e=new Map,t=new Set,i=[];n.forEach(function(o){e.set(o.name,o)});function r(o){t.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&r(l)}}),i.push(o)}return n.forEach(function(o){t.has(o.name)||r(o)}),i}function Kbt(n){var e=qbt(n);return obt.reduce(function(t,i){return t.concat(e.filter(function(r){return r.phase===i}))},[])}function Gbt(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function Ybt(n){var e=n.reduce(function(t,i){var r=t[i.name];return t[i.name]=r?Object.assign({},r,i,{options:Object.assign({},r.options,i.options),data:Object.assign({},r.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var Wwe={placement:"bottom",modifiers:[],strategy:"absolute"};function zwe(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function Qbt(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,i=t===void 0?[]:t,r=e.defaultOptions,o=r===void 0?Wwe:r;return function(a,l,c){c===void 0&&(c=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Wwe,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},d=[],h=!1,g={state:u,setOptions:function(v){var b=typeof v=="function"?v(u.options):v;m(),u.options=Object.assign({},o,u.options,b),u.scrollParents={reference:mx(a)?sO(a):a.contextElement?sO(a.contextElement):[],popper:sO(l)};var y=Kbt(Ybt([].concat(i,u.options.modifiers)));return u.orderedModifiers=y.filter(function(C){return C.enabled}),p(),g.update()},forceUpdate:function(){if(!h){var v=u.elements,b=v.reference,y=v.popper;if(zwe(b,y)){u.rects={reference:Ubt(b,m3(y),u.options.strategy==="fixed"),popper:jhe(y)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(R){return u.modifiersData[R.name]=Object.assign({},R.data)});for(var C=0;C<u.orderedModifiers.length;C++){if(u.reset===!0){u.reset=!1,C=-1;continue}var x=u.orderedModifiers[C],k=x.fn,I=x.options,L=I===void 0?{}:I,D=x.name;typeof k=="function"&&(u=k({state:u,options:L,name:D,instance:g})||u)}}}},update:Gbt(function(){return new Promise(function(_){g.forceUpdate(),_(u)})}),destroy:function(){m(),h=!0}};if(!zwe(a,l))return g;g.setOptions(c).then(function(_){!h&&c.onFirstUpdate&&c.onFirstUpdate(_)});function p(){u.orderedModifiers.forEach(function(_){var v=_.name,b=_.options,y=b===void 0?{}:b,C=_.effect;if(typeof C=="function"){var x=C({state:u,name:v,instance:g,options:y}),k=function(){};d.push(x||k)}})}function m(){d.forEach(function(_){return _()}),d=[]}return g}}var Xbt=[ybt,Bbt,vbt,zhe,Mbt,Abt,Hbt,gbt,Nbt],T5e=Qbt({defaultModifiers:Xbt});function Ve(n){const e=ys(),t=w.createElement(n.element);return w.isValidElement(t)?w.cloneElement(t,{fontSize:n.size||18,color:n.color||e,className:n.className,onClick:n.onClick,style:n.style}):f(_t,{})}var I5e={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},jwe=te.createContext&&te.createContext(I5e),vC=globalThis&&globalThis.__assign||function(){return vC=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},vC.apply(this,arguments)},Zbt=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};function L5e(n){return n&&n.map(function(e,t){return te.createElement(e.tag,vC({key:t},e.attr),L5e(e.child))})}function bn(n){return function(e){return te.createElement(Jbt,vC({attr:vC({},n.attr)},e),L5e(n.child))}}function Jbt(n){var e=function(t){var i=n.attr,r=n.size,o=n.title,s=Zbt(n,["attr","size","title"]),a=r||t.size||"1em",l;return t.className&&(l=t.className),n.className&&(l=(l?l+" ":"")+n.className),te.createElement("svg",vC({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,s,{className:l,style:vC(vC({color:n.color||t.color},t.style),n.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),o&&te.createElement("title",null,o),n.children)};return jwe!==void 0?te.createElement(jwe.Consumer,null,function(t){return e(t)}):e(I5e)}function eyt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 8l-4 4h3c0 3.31-2.69 6-6 6a5.87 5.87 0 01-2.8-.7l-1.46 1.46A7.93 7.93 0 0012 20c4.42 0 8-3.58 8-8h3l-4-4zM6 12c0-3.31 2.69-6 6-6 1.01 0 1.97.25 2.8.7l1.46-1.46A7.93 7.93 0 0012 4c-4.42 0-8 3.58-8 8H1l4 4 4-4H6z"}}]})(n)}function Wdr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-2 8c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm4 8H8v-.57c0-.81.48-1.53 1.22-1.85a6.95 6.95 0 015.56 0A2.01 2.01 0 0116 17.43V18z"}}]})(n)}function zdr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"}}]})(n)}function tyt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}}]})(n)}function Pa(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}}]})(n)}function Yhe(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}}]})(n)}function jdr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24m0 24H0"}},{tag:"path",attr:{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39A.998.998 0 0018.95 4H5.04c-.83 0-1.3.95-.79 1.61z"}},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}}]})(n)}function yD(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M11 7h2v2h-2V7zm0 4h2v6h-2v-6zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}}]})(n)}function Uwe(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}}]})(n)}function Udr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 19H5V5h7V3H5a2 2 0 00-2 2v14a2 2 0 002 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}}]})(n)}function a7(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM8.9 6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1v2H8.9V6zM18 20H6V10h12v10z"}}]})(n)}function nyt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"}}]})(n)}function iyt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"circle",attr:{cx:"10",cy:"8",r:"4"}},{tag:"path",attr:{d:"M10.67 13.02c-.22-.01-.44-.02-.67-.02-2.42 0-4.68.67-6.61 1.82-.88.52-1.39 1.5-1.39 2.53V20h9.26a6.963 6.963 0 01-.59-6.98zM20.75 16c0-.22-.03-.42-.06-.63l1.14-1.01-1-1.73-1.45.49c-.32-.27-.68-.48-1.08-.63L18 11h-2l-.3 1.49c-.4.15-.76.36-1.08.63l-1.45-.49-1 1.73 1.14 1.01c-.03.21-.06.41-.06.63s.03.42.06.63l-1.14 1.01 1 1.73 1.45-.49c.32.27.68.48 1.08.63L16 21h2l.3-1.49c.4-.15.76-.36 1.08-.63l1.45.49 1-1.73-1.14-1.01c.03-.21.06-.41.06-.63zM17 18c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"}}]})(n)}function Qhe(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 14H9V8h2v8zm1 0V8l5 4-5 4z"}}]})(n)}function Xhe(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11.5 9a2.5 2.5 0 000 5 2.5 2.5 0 000-5zM20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-3.21 14.21l-2.91-2.91c-.69.44-1.51.7-2.39.7C9.01 16 7 13.99 7 11.5S9.01 7 11.5 7 16 9.01 16 11.5c0 .88-.26 1.69-.7 2.39l2.91 2.9-1.42 1.42z"}}]})(n)}function qdr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm.88 15.76V19h-1.75v-1.29c-.74-.18-2.39-.77-3.02-2.96l1.65-.67c.06.22.58 2.09 2.4 2.09.93 0 1.98-.48 1.98-1.61 0-.96-.7-1.46-2.28-2.03-1.1-.39-3.35-1.03-3.35-3.31 0-.1.01-2.4 2.62-2.96V5h1.75v1.24c1.84.32 2.51 1.79 2.66 2.23l-1.58.67c-.11-.35-.59-1.34-1.9-1.34-.7 0-1.81.37-1.81 1.39 0 .95.86 1.31 2.64 1.9 2.4.83 3.01 2.05 3.01 3.45 0 2.63-2.5 3.13-3.02 3.22z"}}]})(n)}function Kdr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"}}]})(n)}function Gdr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 3H5a2 2 0 00-2 2v14a2 2 0 002 2h14c1.1 0 2-.9 2-2V5a2 2 0 00-2-2zm0 16H5V7h14v12zm-5.5-6c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5.67-1.5 1.5-1.5 1.5.67 1.5 1.5zM12 9c-2.73 0-5.06 1.66-6 4 .94 2.34 3.27 4 6 4s5.06-1.66 6-4c-.94-2.34-3.27-4-6-4zm0 6.5a2.5 2.5 0 010-5 2.5 2.5 0 010 5z"}}]})(n)}function D5e(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"}}]})(n)}function Ql(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 3a9 9 0 00-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42A8.954 8.954 0 0013 21a9 9 0 000-18zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"}}]})(n)}function Zhe(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}},{tag:"path",attr:{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"}}]})(n)}function Ydr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M14 12c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2zm-2-9a9 9 0 00-9 9H0l4 4 4-4H5c0-3.87 3.13-7 7-7s7 3.13 7 7a6.995 6.995 0 01-11.06 5.7l-1.42 1.44A9 9 0 1012 3z"}}]})(n)}function ryt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}}]})(n)}function V1(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}}]})(n)}function oyt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M8 5v14l11-7z"}}]})(n)}function Jhe(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4 14H8V8h8v8z"}}]})(n)}function Az(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4-.01-18zM18 14H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"}}]})(n)}function A5e(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 19a6.995 6.995 0 0110-6.32V6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h8.08c-.05-.33-.08-.66-.08-1zM4 6l8 5 8-5v2l-8 5-8-5V6zm13.34 16l-3.54-3.54 1.41-1.41 2.12 2.12 4.24-4.24L23 16.34 17.34 22z"}}]})(n)}function syt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}}]})(n)}function Qdr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 11h-4v4h-2v-4H7v-2h4V7h2v4h4v2z"}}]})(n)}function ayt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}}]})(n)}function Xl(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM12 17.5L6.5 12H10v-2h4v2h3.5L12 17.5zM5.12 5l.81-1h12l.94 1H5.12z"}}]})(n)}function Xdr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"}}]})(n)}function lyt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M20 2H4c-1 0-2 .9-2 2v3.01c0 .72.43 1.34 1 1.69V20c0 1.1 1.1 2 2 2h14c.9 0 2-.9 2-2V8.7c.57-.35 1-.97 1-1.69V4c0-1.1-1-2-2-2zm-5 12H9v-2h6v2zm5-7H4V4l16-.02V7z"}}]})(n)}function Zdr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M17 7h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.43-.98 2.63-2.31 2.98l1.46 1.46C20.88 15.61 22 13.95 22 12c0-2.76-2.24-5-5-5zm-1 4h-2.19l2 2H16zM2 4.27l3.11 3.11A4.991 4.991 0 002 12c0 2.76 2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1 0-1.59 1.21-2.9 2.76-3.07L8.73 11H8v2h2.73L13 15.27V17h1.73l4.01 4L20 19.74 3.27 3 2 4.27z"}},{tag:"path",attr:{fill:"none",d:"M0 24V0"}}]})(n)}function cyt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"}}]})(n)}function uyt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 13H5v-2h14v2z"}}]})(n)}function efe(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"}}]})(n)}function Jdr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h5v-2H4v-6h18V6c0-1.11-.89-2-2-2zm0 4H4V6h16v2zm-5.07 11.17l-2.83-2.83-1.41 1.41L14.93 22 22 14.93l-1.41-1.41-5.66 5.65z"}}]})(n)}function dyt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 13v7h18v-1.5l-9-7L8 17l-5-4zm0-6l4 3 5-7 5 4h4v8.97l-9.4-7.31-3.98 5.48L3 10.44V7z"}}]})(n)}function R5e(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 9H4v2h16V9zM4 15h16v-2H4v2z"}}]})(n)}function tfe(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4.5 14H8c-1.66 0-3-1.34-3-3s1.34-3 3-3l.14.01A3.98 3.98 0 0112 7c2.21 0 4 1.79 4 4h.5a2.5 2.5 0 010 5z"}}]})(n)}function XC(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"}}]})(n)}function hyt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"}}]})(n)}function fyt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM7.83 16L5 13.17l1.41-1.41 1.41 1.41 3.54-3.54 1.41 1.41L7.83 16zm9.58-3L19 14.59 17.59 16 16 14.41 14.41 16 13 14.59 14.59 13 13 11.41 14.41 10 16 11.59 17.59 10 19 11.41 17.41 13z"}}]})(n)}function mk(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20.41 8.41l-4.83-4.83c-.37-.37-.88-.58-1.41-.58H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.42zM7 7h7v2H7V7zm10 10H7v-2h10v2zm0-4H7v-2h10v2z"}}]})(n)}function tb(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 8h-2v3h-3v2h3v3h2v-3h3v-2h-3zM2 12c0-2.79 1.64-5.2 4.01-6.32V3.52C2.52 4.76 0 8.09 0 12s2.52 7.24 6.01 8.48v-2.16A6.99 6.99 0 012 12zm13-9c-4.96 0-9 4.04-9 9s4.04 9 9 9 9-4.04 9-9-4.04-9-9-9zm0 16c-3.86 0-7-3.14-7-7s3.14-7 7-7 7 3.14 7 7-3.14 7-7 7z"}}]})(n)}function _3(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a.996.996 0 000-1.41l-2.34-2.34a.996.996 0 00-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}}]})(n)}function ehr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"}}]})(n)}function thr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}}]})(n)}function Rz(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z"}}]})(n)}function nhr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2l-5.5 9h11z"}},{tag:"circle",attr:{cx:"17.5",cy:"17.5",r:"4.5"}},{tag:"path",attr:{d:"M3 13.5h8v8H3z"}}]})(n)}function K2(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16.24 11.51l1.57-1.57-3.75-3.75-1.57 1.57-4.14-4.13c-.78-.78-2.05-.78-2.83 0l-1.9 1.9c-.78.78-.78 2.05 0 2.83l4.13 4.13L3 17.25V21h3.75l4.76-4.76 4.13 4.13c.95.95 2.23.6 2.83 0l1.9-1.9c.78-.78.78-2.05 0-2.83l-4.13-4.13zm-7.06-.44L5.04 6.94l1.89-1.9L8.2 6.31 7.02 7.5l1.41 1.41 1.19-1.19 1.45 1.45-1.89 1.9zm7.88 7.89l-4.13-4.13 1.9-1.9 1.45 1.45-1.19 1.19 1.41 1.41 1.19-1.19 1.27 1.27-1.9 1.9zM20.71 7.04a.996.996 0 000-1.41l-2.34-2.34c-.47-.47-1.12-.29-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"}}]})(n)}function gyt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M7 10l5 5 5-5z"}}]})(n)}function ihr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}}]})(n)}function rhr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}}]})(n)}function f0(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}}]})(n)}function ohr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}},{tag:"path",attr:{fill:"none",d:"M24 24H0V0h24v24z"}}]})(n)}function shr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}}]})(n)}function ahr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M17.65 6.35A7.958 7.958 0 0012 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0112 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}}]})(n)}function nfe(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M24 24H0V0h24z"}},{tag:"path",attr:{d:"M15.5 15.38V8.62L18.88 12l-3.38 3.38M14 19l7-7-7-7v14zm-4 0V5l-7 7 7 7z"}}]})(n)}function pyt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46A7.93 7.93 0 0020 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74A7.93 7.93 0 004 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"}}]})(n)}function N5e(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"}}]})(n)}function myt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M22.61 18.99l-9.08-9.08c.93-2.34.45-5.1-1.44-7C9.79.61 6.21.4 3.66 2.26L7.5 6.11 6.08 7.52 2.25 3.69C.39 6.23.6 9.82 2.9 12.11c1.86 1.86 4.57 2.35 6.89 1.48l9.11 9.11c.39.39 1.02.39 1.41 0l2.3-2.3c.4-.38.4-1.01 0-1.41zm-3 1.6l-9.46-9.46c-.61.45-1.29.72-2 .82-1.36.2-2.79-.21-3.83-1.25C3.37 9.76 2.93 8.5 3 7.26l3.09 3.09 4.24-4.24-3.09-3.09c1.24-.07 2.49.37 3.44 1.31a4.469 4.469 0 011.24 3.96 4.35 4.35 0 01-.88 1.96l9.45 9.45-.88.89z"}}]})(n)}function l7(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h2c0-1.66 1.34-3 3-3s3 1.34 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}}]})(n)}function _yt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M19 3H5a2 2 0 00-2 2v14a2 2 0 002 2h14c1.1 0 2-.9 2-2V5a2 2 0 00-2-2zm0 16H5V7h14v12zm-7-8.5c1.84 0 3.48.96 4.34 2.5-.86 1.54-2.5 2.5-4.34 2.5s-3.48-.96-4.34-2.5c.86-1.54 2.5-2.5 4.34-2.5M12 9c-2.73 0-5.06 1.66-6 4 .94 2.34 3.27 4 6 4s5.06-1.66 6-4c-.94-2.34-3.27-4-6-4zm0 5.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"}}]})(n)}function vyt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M18 6h-2c0-2.21-1.79-4-4-4S8 3.79 8 6H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-6-2c1.1 0 2 .9 2 2h-4c0-1.1.9-2 2-2zm6 16H6V8h2v2c0 .55.45 1 1 1s1-.45 1-1V8h4v2c0 .55.45 1 1 1s1-.45 1-1V8h2v12z"}}]})(n)}function O5e(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"}}]})(n)}function lhr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M15 22H6c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h8l6 6v6h-2V9h-5V4H6v16h9v2zm4-.34v-2.24l2.95 2.95 1.41-1.41L20.41 18h2.24v-2H17v5.66h2z"}}]})(n)}function bs(n){const[e,t]=w.useState(!0),i=Vn();return f("div",{style:{color:i.$3,colorScheme:i.$0,backgroundColor:i.$1},className:St(`border-l-4 py-2 ${n.className}`,{"bg-red-50 border-red-500":n.type==="danger","bg-yellow-50 border-yellow-500":n.type==="warning","bg-green-50 border-green-500":n.type==="success",block:e,hidden:!e}),children:f("div",{className:"mx-4",children:f("div",{style:{color:i.$3,colorScheme:i.$0,backgroundColor:i.$1,borderColor:i.$4},className:St("text-sm",{"text-red-700":n.type==="danger","text-yellow-700":n.type==="warning","text-green-700":n.type==="success"}),children:N("div",{className:"flex items-center justify-between space-x-2",style:{backgroundColor:i.$1,borderColor:i.$4},children:[f("div",{className:"w-full break-all",style:{backgroundColor:i.$1,borderColor:i.$4},children:n.children}),!n.disableClosing&&f("button",{type:"button",children:f(L_,{onClick:()=>t(!1)})})]})})})})}var byt=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function yyt(n){var e=n.defaultInputValue,t=e===void 0?"":e,i=n.defaultMenuIsOpen,r=i===void 0?!1:i,o=n.defaultValue,s=o===void 0?null:o,a=n.inputValue,l=n.menuIsOpen,c=n.onChange,u=n.onInputChange,d=n.onMenuClose,h=n.onMenuOpen,g=n.value,p=uu(n,byt),m=w.useState(a!==void 0?a:t),_=$t(m,2),v=_[0],b=_[1],y=w.useState(l!==void 0?l:r),C=$t(y,2),x=C[0],k=C[1],I=w.useState(g!==void 0?g:s),L=$t(I,2),D=L[0],R=L[1],P=w.useCallback(function($,j){typeof c=="function"&&c($,j),R($)},[c]),M=w.useCallback(function($,j){var Y;typeof u=="function"&&(Y=u($,j)),b(Y!==void 0?Y:$)},[u]),O=w.useCallback(function(){typeof h=="function"&&h(),k(!0)},[h]),B=w.useCallback(function(){typeof d=="function"&&d(),k(!1)},[d]),F=a!==void 0?a:v,H=l!==void 0?l:x,V=g!==void 0?g:D;return Qe(Qe({},p),{},{inputValue:F,menuIsOpen:H,onChange:P,onInputChange:M,onMenuClose:B,onMenuOpen:O,value:V})}function Cyt(n){if(Array.isArray(n))return Hee(n)}function wyt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ir(n){return Cyt(n)||GMe(n)||dde(n)||wyt()}function Syt(n){if(n.sheet)return n.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===n)return document.styleSheets[e]}function Eyt(n){var e=document.createElement("style");return e.setAttribute("data-emotion",n.key),n.nonce!==void 0&&e.setAttribute("nonce",n.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var xyt=function(){function n(t){var i=this;this._insertTag=function(r){var o;i.tags.length===0?i.insertionPoint?o=i.insertionPoint.nextSibling:i.prepend?o=i.container.firstChild:o=i.before:o=i.tags[i.tags.length-1].nextSibling,i.container.insertBefore(r,o),i.tags.push(r)},this.isSpeedy=t.speedy===void 0?!0:t.speedy,this.tags=[],this.ctr=0,this.nonce=t.nonce,this.key=t.key,this.container=t.container,this.prepend=t.prepend,this.insertionPoint=t.insertionPoint,this.before=null}var e=n.prototype;return e.hydrate=function(i){i.forEach(this._insertTag)},e.insert=function(i){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Eyt(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var o=Syt(r);try{o.insertRule(i,o.cssRules.length)}catch{}}else r.appendChild(document.createTextNode(i));this.ctr++},e.flush=function(){this.tags.forEach(function(i){return i.parentNode&&i.parentNode.removeChild(i)}),this.tags=[],this.ctr=0},n}(),ud="-ms-",c7="-moz-",os="-webkit-",P5e="comm",ife="rule",rfe="decl",kyt="@import",M5e="@keyframes",Tyt="@layer",Iyt=Math.abs,Nz=String.fromCharCode,Lyt=Object.assign;function Dyt(n,e){return Tu(n,0)^45?(((e<<2^Tu(n,0))<<2^Tu(n,1))<<2^Tu(n,2))<<2^Tu(n,3):0}function F5e(n){return n.trim()}function Ayt(n,e){return(n=e.exec(n))?n[0]:n}function ss(n,e,t){return n.replace(e,t)}function lne(n,e){return n.indexOf(e)}function Tu(n,e){return n.charCodeAt(e)|0}function MP(n,e,t){return n.slice(e,t)}function sv(n){return n.length}function ofe(n){return n.length}function f6(n,e){return e.push(n),n}function Ryt(n,e){return n.map(e).join("")}var Oz=1,CD=1,B5e=0,sf=0,lc=0,G2="";function Pz(n,e,t,i,r,o,s){return{value:n,root:e,parent:t,type:i,props:r,children:o,line:Oz,column:CD,length:s,return:""}}function pR(n,e){return Lyt(Pz("",null,null,"",null,null,0),n,{length:-n.length},e)}function Nyt(){return lc}function Oyt(){return lc=sf>0?Tu(G2,--sf):0,CD--,lc===10&&(CD=1,Oz--),lc}function cg(){return lc=sf<B5e?Tu(G2,sf++):0,CD++,lc===10&&(CD=1,Oz++),lc}function Kv(){return Tu(G2,sf)}function o8(){return sf}function v3(n,e){return MP(G2,n,e)}function FP(n){switch(n){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function $5e(n){return Oz=CD=1,B5e=sv(G2=n),sf=0,[]}function V5e(n){return G2="",n}function s8(n){return F5e(v3(sf-1,cne(n===91?n+2:n===40?n+1:n)))}function Pyt(n){for(;(lc=Kv())&&lc<33;)cg();return FP(n)>2||FP(lc)>3?"":" "}function Myt(n,e){for(;--e&&cg()&&!(lc<48||lc>102||lc>57&&lc<65||lc>70&&lc<97););return v3(n,o8()+(e<6&&Kv()==32&&cg()==32))}function cne(n){for(;cg();)switch(lc){case n:return sf;case 34:case 39:n!==34&&n!==39&&cne(lc);break;case 40:n===41&&cne(n);break;case 92:cg();break}return sf}function Fyt(n,e){for(;cg()&&n+lc!==47+10;)if(n+lc===42+42&&Kv()===47)break;return"/*"+v3(e,sf-1)+"*"+Nz(n===47?n:cg())}function Byt(n){for(;!FP(Kv());)cg();return v3(n,sf)}function H5e(n){return V5e(a8("",null,null,null,[""],n=$5e(n),0,[0],n))}function a8(n,e,t,i,r,o,s,a,l){for(var c=0,u=0,d=s,h=0,g=0,p=0,m=1,_=1,v=1,b=0,y="",C=r,x=o,k=i,I=y;_;)switch(p=b,b=cg()){case 40:if(p!=108&&Tu(I,d-1)==58){lne(I+=ss(s8(b),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:I+=s8(b);break;case 9:case 10:case 13:case 32:I+=Pyt(p);break;case 92:I+=Myt(o8()-1,7);continue;case 47:switch(Kv()){case 42:case 47:f6($yt(Fyt(cg(),o8()),e,t),l);break;default:I+="/"}break;case 123*m:a[c++]=sv(I)*v;case 125*m:case 59:case 0:switch(b){case 0:case 125:_=0;case 59+u:v==-1&&(I=ss(I,/\f/g,"")),g>0&&sv(I)-d&&f6(g>32?Kwe(I+";",i,t,d-1):Kwe(ss(I," ","")+";",i,t,d-2),l);break;case 59:I+=";";default:if(f6(k=qwe(I,e,t,c,u,r,a,y,C=[],x=[],d),o),b===123)if(u===0)a8(I,e,k,k,C,o,d,a,x);else switch(h===99&&Tu(I,3)===110?100:h){case 100:case 108:case 109:case 115:a8(n,k,k,i&&f6(qwe(n,k,k,0,0,r,a,y,r,C=[],d),x),r,x,d,a,i?C:x);break;default:a8(I,k,k,k,[""],x,0,a,x)}}c=u=g=0,m=v=1,y=I="",d=s;break;case 58:d=1+sv(I),g=p;default:if(m<1){if(b==123)--m;else if(b==125&&m++==0&&Oyt()==125)continue}switch(I+=Nz(b),b*m){case 38:v=u>0?1:(I+="\f",-1);break;case 44:a[c++]=(sv(I)-1)*v,v=1;break;case 64:Kv()===45&&(I+=s8(cg())),h=Kv(),u=d=sv(y=I+=Byt(o8())),b++;break;case 45:p===45&&sv(I)==2&&(m=0)}}return o}function qwe(n,e,t,i,r,o,s,a,l,c,u){for(var d=r-1,h=r===0?o:[""],g=ofe(h),p=0,m=0,_=0;p<i;++p)for(var v=0,b=MP(n,d+1,d=Iyt(m=s[p])),y=n;v<g;++v)(y=F5e(m>0?h[v]+" "+b:ss(b,/&\f/g,h[v])))&&(l[_++]=y);return Pz(n,e,t,r===0?ife:a,l,c,u)}function $yt(n,e,t){return Pz(n,e,t,P5e,Nz(Nyt()),MP(n,2,-2),0)}function Kwe(n,e,t,i){return Pz(n,e,t,rfe,MP(n,0,i),MP(n,i+1,-1),i)}function WE(n,e){for(var t="",i=ofe(n),r=0;r<i;r++)t+=e(n[r],r,n,e)||"";return t}function W5e(n,e,t,i){switch(n.type){case Tyt:if(n.children.length)break;case kyt:case rfe:return n.return=n.return||n.value;case P5e:return"";case M5e:return n.return=n.value+"{"+WE(n.children,i)+"}";case ife:n.value=n.props.join(",")}return sv(t=WE(n.children,i))?n.return=n.value+"{"+t+"}":""}function Vyt(n){var e=ofe(n);return function(t,i,r,o){for(var s="",a=0;a<e;a++)s+=n[a](t,i,r,o)||"";return s}}function Hyt(n){return function(e){e.root||(e=e.return)&&n(e)}}var Wyt=function(e,t,i){for(var r=0,o=0;r=o,o=Kv(),r===38&&o===12&&(t[i]=1),!FP(o);)cg();return v3(e,sf)},zyt=function(e,t){var i=-1,r=44;do switch(FP(r)){case 0:r===38&&Kv()===12&&(t[i]=1),e[i]+=Wyt(sf-1,t,i);break;case 2:e[i]+=s8(r);break;case 4:if(r===44){e[++i]=Kv()===58?"&\f":"",t[i]=e[i].length;break}default:e[i]+=Nz(r)}while(r=cg());return e},jyt=function(e,t){return V5e(zyt($5e(e),t))},Gwe=new WeakMap,Uyt=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,i=e.parent,r=e.column===i.column&&e.line===i.line;i.type!=="rule";)if(i=i.parent,!i)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!Gwe.get(i))&&!r){Gwe.set(e,!0);for(var o=[],s=jyt(t,o),a=i.props,l=0,c=0;l<s.length;l++)for(var u=0;u<a.length;u++,c++)e.props[c]=o[l]?s[l].replace(/&\f/g,a[u]):a[u]+" "+s[l]}}},qyt=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function z5e(n,e){switch(Dyt(n,e)){case 5103:return os+"print-"+n+n;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return os+n+n;case 5349:case 4246:case 4810:case 6968:case 2756:return os+n+c7+n+ud+n+n;case 6828:case 4268:return os+n+ud+n+n;case 6165:return os+n+ud+"flex-"+n+n;case 5187:return os+n+ss(n,/(\w+).+(:[^]+)/,os+"box-$1$2"+ud+"flex-$1$2")+n;case 5443:return os+n+ud+"flex-item-"+ss(n,/flex-|-self/,"")+n;case 4675:return os+n+ud+"flex-line-pack"+ss(n,/align-content|flex-|-self/,"")+n;case 5548:return os+n+ud+ss(n,"shrink","negative")+n;case 5292:return os+n+ud+ss(n,"basis","preferred-size")+n;case 6060:return os+"box-"+ss(n,"-grow","")+os+n+ud+ss(n,"grow","positive")+n;case 4554:return os+ss(n,/([^-])(transform)/g,"$1"+os+"$2")+n;case 6187:return ss(ss(ss(n,/(zoom-|grab)/,os+"$1"),/(image-set)/,os+"$1"),n,"")+n;case 5495:case 3959:return ss(n,/(image-set\([^]*)/,os+"$1$`$1");case 4968:return ss(ss(n,/(.+:)(flex-)?(.*)/,os+"box-pack:$3"+ud+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+os+n+n;case 4095:case 3583:case 4068:case 2532:return ss(n,/(.+)-inline(.+)/,os+"$1$2")+n;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(sv(n)-1-e>6)switch(Tu(n,e+1)){case 109:if(Tu(n,e+4)!==45)break;case 102:return ss(n,/(.+:)(.+)-([^]+)/,"$1"+os+"$2-$3$1"+c7+(Tu(n,e+3)==108?"$3":"$2-$3"))+n;case 115:return~lne(n,"stretch")?z5e(ss(n,"stretch","fill-available"),e)+n:n}break;case 4949:if(Tu(n,e+1)!==115)break;case 6444:switch(Tu(n,sv(n)-3-(~lne(n,"!important")&&10))){case 107:return ss(n,":",":"+os)+n;case 101:return ss(n,/(.+:)([^;!]+)(;|!.+)?/,"$1"+os+(Tu(n,14)===45?"inline-":"")+"box$3$1"+os+"$2$3$1"+ud+"$2box$3")+n}break;case 5936:switch(Tu(n,e+11)){case 114:return os+n+ud+ss(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return os+n+ud+ss(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return os+n+ud+ss(n,/[svh]\w+-[tblr]{2}/,"lr")+n}return os+n+ud+n+n}return n}var Kyt=function(e,t,i,r){if(e.length>-1&&!e.return)switch(e.type){case rfe:e.return=z5e(e.value,e.length);break;case M5e:return WE([pR(e,{value:ss(e.value,"@","@"+os)})],r);case ife:if(e.length)return Ryt(e.props,function(o){switch(Ayt(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return WE([pR(e,{props:[ss(o,/:(read-\w+)/,":"+c7+"$1")]})],r);case"::placeholder":return WE([pR(e,{props:[ss(o,/:(plac\w+)/,":"+os+"input-$1")]}),pR(e,{props:[ss(o,/:(plac\w+)/,":"+c7+"$1")]}),pR(e,{props:[ss(o,/:(plac\w+)/,ud+"input-$1")]})],r)}return""})}},Gyt=[Kyt],Yyt=function(e){var t=e.key;if(t==="css"){var i=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(i,function(m){var _=m.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var r=e.stylisPlugins||Gyt,o={},s,a=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(m){for(var _=m.getAttribute("data-emotion").split(" "),v=1;v<_.length;v++)o[_[v]]=!0;a.push(m)});var l,c=[Uyt,qyt];{var u,d=[W5e,Hyt(function(m){u.insert(m)})],h=Vyt(c.concat(r,d)),g=function(_){return WE(H5e(_),h)};l=function(_,v,b,y){u=b,g(_?_+"{"+v.styles+"}":v.styles),y&&(p.inserted[v.name]=!0)}}var p={key:t,sheet:new xyt({key:t,container:s,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:l};return p.sheet.hydrate(a),p},Qyt=!0;function Xyt(n,e,t){var i="";return t.split(" ").forEach(function(r){n[r]!==void 0?e.push(n[r]+";"):i+=r+" "}),i}var j5e=function(e,t,i){var r=e.key+"-"+t.name;(i===!1||Qyt===!1)&&e.registered[r]===void 0&&(e.registered[r]=t.styles)},Zyt=function(e,t,i){j5e(e,t,i);var r=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var o=t;do e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};function Jyt(n){for(var e=0,t,i=0,r=n.length;r>=4;++i,r-=4)t=n.charCodeAt(i)&255|(n.charCodeAt(++i)&255)<<8|(n.charCodeAt(++i)&255)<<16|(n.charCodeAt(++i)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(r){case 3:e^=(n.charCodeAt(i+2)&255)<<16;case 2:e^=(n.charCodeAt(i+1)&255)<<8;case 1:e^=n.charCodeAt(i)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var e0t=/[A-Z]|^ms/g,t0t=/_EMO_([^_]+?)_([^]*?)_EMO_/g,U5e=function(e){return e.charCodeAt(1)===45},Ywe=function(e){return e!=null&&typeof e!="boolean"},JY=V_t(function(n){return U5e(n)?n:n.replace(e0t,"-$&").toLowerCase()}),Qwe=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(t0t,function(i,r,o){return av={name:r,styles:o,next:av},r})}return i5e[e]!==1&&!U5e(e)&&typeof t=="number"&&t!==0?t+"px":t};function BP(n,e,t){if(t==null)return"";if(t.__emotion_styles!==void 0)return t;switch(typeof t){case"boolean":return"";case"object":{if(t.anim===1)return av={name:t.name,styles:t.styles,next:av},t.name;if(t.styles!==void 0){var i=t.next;if(i!==void 0)for(;i!==void 0;)av={name:i.name,styles:i.styles,next:av},i=i.next;var r=t.styles+";";return r}return n0t(n,e,t)}case"function":{if(n!==void 0){var o=av,s=t(n);return av=o,BP(n,e,s)}break}}if(e==null)return t;var a=e[t];return a!==void 0?a:t}function n0t(n,e,t){var i="";if(Array.isArray(t))for(var r=0;r<t.length;r++)i+=BP(n,e,t[r])+";";else for(var o in t){var s=t[o];if(typeof s!="object")e!=null&&e[s]!==void 0?i+=o+"{"+e[s]+"}":Ywe(s)&&(i+=JY(o)+":"+Qwe(o,s)+";");else if(Array.isArray(s)&&typeof s[0]=="string"&&(e==null||e[s[0]]===void 0))for(var a=0;a<s.length;a++)Ywe(s[a])&&(i+=JY(o)+":"+Qwe(o,s[a])+";");else{var l=BP(n,e,s);switch(o){case"animation":case"animationName":{i+=JY(o)+":"+l+";";break}default:i+=o+"{"+l+"}"}}}return i}var Xwe=/label:\s*([^\s;\n{]+)\s*(;|$)/g,av,q5e=function(e,t,i){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,o="";av=void 0;var s=e[0];s==null||s.raw===void 0?(r=!1,o+=BP(i,t,s)):o+=s[0];for(var a=1;a<e.length;a++)o+=BP(i,t,e[a]),r&&(o+=s[a]);Xwe.lastIndex=0;for(var l="",c;(c=Xwe.exec(o))!==null;)l+="-"+c[1];var u=Jyt(o)+l;return{name:u,styles:o,next:av}},i0t=function(e){return e()},r0t=Rp["useInsertionEffect"]?Rp["useInsertionEffect"]:!1,o0t=r0t||i0t,sfe={}.hasOwnProperty,K5e=w.createContext(typeof HTMLElement<"u"?Yyt({key:"css"}):null);K5e.Provider;var s0t=function(e){return w.forwardRef(function(t,i){var r=w.useContext(K5e);return e(t,r,i)})},a0t=w.createContext({}),une="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",l0t=function(e,t){var i={};for(var r in t)sfe.call(t,r)&&(i[r]=t[r]);return i[une]=e,i},c0t=function(e){var t=e.cache,i=e.serialized,r=e.isStringTag;return j5e(t,i,r),o0t(function(){return Zyt(t,i,r)}),null},u0t=s0t(function(n,e,t){var i=n.css;typeof i=="string"&&e.registered[i]!==void 0&&(i=e.registered[i]);var r=n[une],o=[i],s="";typeof n.className=="string"?s=Xyt(e.registered,o,n.className):n.className!=null&&(s=n.className+" ");var a=q5e(o,void 0,w.useContext(a0t));s+=e.key+"-"+a.name;var l={};for(var c in n)sfe.call(n,c)&&c!=="css"&&c!==une&&(l[c]=n[c]);return l.ref=t,l.className=s,w.createElement(w.Fragment,null,w.createElement(c0t,{cache:e,serialized:a,isStringTag:typeof r=="string"}),w.createElement(r,l))}),d0t=u0t,ir=function(e,t){var i=arguments;if(t==null||!sfe.call(t,"css"))return w.createElement.apply(void 0,i);var r=i.length,o=new Array(r);o[0]=d0t,o[1]=l0t(e,t);for(var s=2;s<r;s++)o[s]=i[s];return w.createElement.apply(null,o)};function afe(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return q5e(e)}var h0t=function(){var e=afe.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}};function f0t(n,e){return e||(e=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(e)}}))}const g0t=Math.min,p0t=Math.max,u7=Math.round,g6=Math.floor,d7=n=>({x:n,y:n});function m0t(n){return{...n,top:n.y,left:n.x,right:n.x+n.width,bottom:n.y+n.height}}function G5e(n){return Q5e(n)?(n.nodeName||"").toLowerCase():"#document"}function c_(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function Y5e(n){var e;return(e=(Q5e(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function Q5e(n){return n instanceof Node||n instanceof c_(n).Node}function dne(n){return n instanceof Element||n instanceof c_(n).Element}function lfe(n){return n instanceof HTMLElement||n instanceof c_(n).HTMLElement}function Zwe(n){return typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof c_(n).ShadowRoot}function X5e(n){const{overflow:e,overflowX:t,overflowY:i,display:r}=cfe(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!["inline","contents"].includes(r)}function _0t(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function v0t(n){return["html","body","#document"].includes(G5e(n))}function cfe(n){return c_(n).getComputedStyle(n)}function b0t(n){if(G5e(n)==="html")return n;const e=n.assignedSlot||n.parentNode||Zwe(n)&&n.host||Y5e(n);return Zwe(e)?e.host:e}function Z5e(n){const e=b0t(n);return v0t(e)?n.ownerDocument?n.ownerDocument.body:n.body:lfe(e)&&X5e(e)?e:Z5e(e)}function h7(n,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const r=Z5e(n),o=r===((i=n.ownerDocument)==null?void 0:i.body),s=c_(r);return o?e.concat(s,s.visualViewport||[],X5e(r)?r:[],s.frameElement&&t?h7(s.frameElement):[]):e.concat(r,h7(r,[],t))}function y0t(n){const e=cfe(n);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=lfe(n),o=r?n.offsetWidth:t,s=r?n.offsetHeight:i,a=u7(t)!==o||u7(i)!==s;return a&&(t=o,i=s),{width:t,height:i,$:a}}function ufe(n){return dne(n)?n:n.contextElement}function eQ(n){const e=ufe(n);if(!lfe(e))return d7(1);const t=e.getBoundingClientRect(),{width:i,height:r,$:o}=y0t(e);let s=(o?u7(t.width):t.width)/i,a=(o?u7(t.height):t.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const C0t=d7(0);function w0t(n){const e=c_(n);return!_0t()||!e.visualViewport?C0t:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function S0t(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==c_(n)?!1:e}function Jwe(n,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const r=n.getBoundingClientRect(),o=ufe(n);let s=d7(1);e&&(i?dne(i)&&(s=eQ(i)):s=eQ(n));const a=S0t(o,t,i)?w0t(o):d7(0);let l=(r.left+a.x)/s.x,c=(r.top+a.y)/s.y,u=r.width/s.x,d=r.height/s.y;if(o){const h=c_(o),g=i&&dne(i)?c_(i):i;let p=h.frameElement;for(;p&&i&&g!==h;){const m=eQ(p),_=p.getBoundingClientRect(),v=cfe(p),b=_.left+(p.clientLeft+parseFloat(v.paddingLeft))*m.x,y=_.top+(p.clientTop+parseFloat(v.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=b,c+=y,p=c_(p).frameElement}}return m0t({width:u,height:d,x:l,y:c})}function E0t(n,e){let t=null,i;const r=Y5e(n);function o(){clearTimeout(i),t&&t.disconnect(),t=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:u,width:d,height:h}=n.getBoundingClientRect();if(a||e(),!d||!h)return;const g=g6(u),p=g6(r.clientWidth-(c+d)),m=g6(r.clientHeight-(u+h)),_=g6(c),b={rootMargin:-g+"px "+-p+"px "+-m+"px "+-_+"px",threshold:p0t(0,g0t(1,l))||1};let y=!0;function C(x){const k=x[0].intersectionRatio;if(k!==l){if(!y)return s();k?s(!1,k):i=setTimeout(()=>{s(!1,1e-7)},100)}y=!1}try{t=new IntersectionObserver(C,{...b,root:r.ownerDocument})}catch{t=new IntersectionObserver(C,b)}t.observe(n)}return s(!0),o}function x0t(n,e,t,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,c=ufe(n),u=r||o?[...c?h7(c):[],...h7(e)]:[];u.forEach(v=>{r&&v.addEventListener("scroll",t,{passive:!0}),o&&v.addEventListener("resize",t)});const d=c&&a?E0t(c,t):null;let h=-1,g=null;s&&(g=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{g&&g.observe(e)})),t()}),c&&!l&&g.observe(c),g.observe(e));let p,m=l?Jwe(n):null;l&&_();function _(){const v=Jwe(n);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&t(),m=v,p=requestAnimationFrame(_)}return t(),()=>{u.forEach(v=>{r&&v.removeEventListener("scroll",t),o&&v.removeEventListener("resize",t)}),d&&d(),g&&g.disconnect(),g=null,l&&cancelAnimationFrame(p)}}var hne=w.useLayoutEffect,k0t=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],f7=function(){};function T0t(n,e){return e?e[0]==="-"?n+e:n+"__"+e:n}function I0t(n,e){for(var t=arguments.length,i=new Array(t>2?t-2:0),r=2;r<t;r++)i[r-2]=arguments[r];var o=[].concat(i);if(e&&n)for(var s in e)e.hasOwnProperty(s)&&e[s]&&o.push("".concat(T0t(n,s)));return o.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var eSe=function(e){return F0t(e)?e.filter(Boolean):Er(e)==="object"&&e!==null?[e]:[]},J5e=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var t=uu(e,k0t);return Qe({},t)},wl=function(e,t,i){var r=e.cx,o=e.getStyles,s=e.getClassNames,a=e.className;return{css:o(t,e),className:r(i??{},s(t,e),a)}};function Mz(n){return[document.documentElement,document.body,window].indexOf(n)>-1}function L0t(n){return Mz(n)?window.innerHeight:n.clientHeight}function eFe(n){return Mz(n)?window.pageYOffset:n.scrollTop}function g7(n,e){if(Mz(n)){window.scrollTo(0,e);return}n.scrollTop=e}function D0t(n){var e=getComputedStyle(n),t=e.position==="absolute",i=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var r=n;r=r.parentElement;)if(e=getComputedStyle(r),!(t&&e.position==="static")&&i.test(e.overflow+e.overflowY+e.overflowX))return r;return document.documentElement}function A0t(n,e,t,i){return t*((n=n/i-1)*n*n+1)+e}function p6(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:f7,r=eFe(n),o=e-r,s=10,a=0;function l(){a+=s;var c=A0t(a,r,o,t);g7(n,c),a<t?window.requestAnimationFrame(l):i(n)}l()}function tSe(n,e){var t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),r=e.offsetHeight/3;i.bottom+r>t.bottom?g7(n,Math.min(e.offsetTop+e.clientHeight-n.offsetHeight+r,n.scrollHeight)):i.top-r<t.top&&g7(n,Math.max(e.offsetTop-r,0))}function R0t(n){var e=n.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}function nSe(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function N0t(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var tFe=!1,O0t={get passive(){return tFe=!0}},m6=typeof window<"u"?window:{};m6.addEventListener&&m6.removeEventListener&&(m6.addEventListener("p",f7,O0t),m6.removeEventListener("p",f7,!1));var P0t=tFe;function M0t(n){return n!=null}function F0t(n){return Array.isArray(n)}function _6(n,e,t){return n?e:t}var B0t=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];var o=Object.entries(e).filter(function(s){var a=$t(s,1),l=a[0];return!i.includes(l)});return o.reduce(function(s,a){var l=$t(a,2),c=l[0],u=l[1];return s[c]=u,s},{})},$0t=["children","innerProps"],V0t=["children","innerProps"];function H0t(n){var e=n.maxHeight,t=n.menuEl,i=n.minHeight,r=n.placement,o=n.shouldScroll,s=n.isFixedPosition,a=n.controlHeight,l=D0t(t),c={placement:"bottom",maxHeight:e};if(!t||!t.offsetParent)return c;var u=l.getBoundingClientRect(),d=u.height,h=t.getBoundingClientRect(),g=h.bottom,p=h.height,m=h.top,_=t.offsetParent.getBoundingClientRect(),v=_.top,b=s?window.innerHeight:L0t(l),y=eFe(l),C=parseInt(getComputedStyle(t).marginBottom,10),x=parseInt(getComputedStyle(t).marginTop,10),k=v-x,I=b-m,L=k+y,D=d-y-m,R=g-b+y+C,P=y+m-x,M=160;switch(r){case"auto":case"bottom":if(I>=p)return{placement:"bottom",maxHeight:e};if(D>=p&&!s)return o&&p6(l,R,M),{placement:"bottom",maxHeight:e};if(!s&&D>=i||s&&I>=i){o&&p6(l,R,M);var O=s?I-C:D-C;return{placement:"bottom",maxHeight:O}}if(r==="auto"||s){var B=e,F=s?k:L;return F>=i&&(B=Math.min(F-C-a,e)),{placement:"top",maxHeight:B}}if(r==="bottom")return o&&g7(l,R),{placement:"bottom",maxHeight:e};break;case"top":if(k>=p)return{placement:"top",maxHeight:e};if(L>=p&&!s)return o&&p6(l,P,M),{placement:"top",maxHeight:e};if(!s&&L>=i||s&&k>=i){var H=e;return(!s&&L>=i||s&&k>=i)&&(H=s?k-x:L-x),o&&p6(l,P,M),{placement:"top",maxHeight:H}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}function W0t(n){var e={bottom:"top",top:"bottom"};return n?e[n]:"bottom"}var nFe=function(e){return e==="auto"?"bottom":e},z0t=function(e,t){var i,r=e.placement,o=e.theme,s=o.borderRadius,a=o.spacing,l=o.colors;return Qe((i={label:"menu"},$e(i,W0t(r),"100%"),$e(i,"position","absolute"),$e(i,"width","100%"),$e(i,"zIndex",1),i),t?{}:{backgroundColor:l.neutral0,borderRadius:s,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},iFe=w.createContext(null),j0t=function(e){var t=e.children,i=e.minMenuHeight,r=e.maxMenuHeight,o=e.menuPlacement,s=e.menuPosition,a=e.menuShouldScrollIntoView,l=e.theme,c=w.useContext(iFe)||{},u=c.setPortalPlacement,d=w.useRef(null),h=w.useState(r),g=$t(h,2),p=g[0],m=g[1],_=w.useState(null),v=$t(_,2),b=v[0],y=v[1],C=l.spacing.controlHeight;return hne(function(){var x=d.current;if(x){var k=s==="fixed",I=a&&!k,L=H0t({maxHeight:r,menuEl:x,minHeight:i,placement:o,shouldScroll:I,isFixedPosition:k,controlHeight:C});m(L.maxHeight),y(L.placement),u==null||u(L.placement)}},[r,o,s,a,i,u,C]),t({ref:d,placerProps:Qe(Qe({},e),{},{placement:b||nFe(o),maxHeight:p})})},U0t=function(e){var t=e.children,i=e.innerRef,r=e.innerProps;return ir("div",rt({},wl(e,"menu",{menu:!0}),{ref:i},r),t)},q0t=U0t,K0t=function(e,t){var i=e.maxHeight,r=e.theme.spacing.baseUnit;return Qe({maxHeight:i,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:r,paddingTop:r})},G0t=function(e){var t=e.children,i=e.innerProps,r=e.innerRef,o=e.isMulti;return ir("div",rt({},wl(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},i),t)},rFe=function(e,t){var i=e.theme,r=i.spacing.baseUnit,o=i.colors;return Qe({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},Y0t=rFe,Q0t=rFe,X0t=function(e){var t=e.children,i=t===void 0?"No options":t,r=e.innerProps,o=uu(e,$0t);return ir("div",rt({},wl(Qe(Qe({},o),{},{children:i,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),i)},Z0t=function(e){var t=e.children,i=t===void 0?"Loading...":t,r=e.innerProps,o=uu(e,V0t);return ir("div",rt({},wl(Qe(Qe({},o),{},{children:i,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),i)},J0t=function(e){var t=e.rect,i=e.offset,r=e.position;return{left:t.left,position:r,top:i,width:t.width,zIndex:1}},e1t=function(e){var t=e.appendTo,i=e.children,r=e.controlElement,o=e.innerProps,s=e.menuPlacement,a=e.menuPosition,l=w.useRef(null),c=w.useRef(null),u=w.useState(nFe(s)),d=$t(u,2),h=d[0],g=d[1],p=w.useMemo(function(){return{setPortalPlacement:g}},[]),m=w.useState(null),_=$t(m,2),v=_[0],b=_[1],y=w.useCallback(function(){if(r){var I=R0t(r),L=a==="fixed"?0:window.pageYOffset,D=I[h]+L;(D!==(v==null?void 0:v.offset)||I.left!==(v==null?void 0:v.rect.left)||I.width!==(v==null?void 0:v.rect.width))&&b({offset:D,rect:I})}},[r,a,h,v==null?void 0:v.offset,v==null?void 0:v.rect.left,v==null?void 0:v.rect.width]);hne(function(){y()},[y]);var C=w.useCallback(function(){typeof c.current=="function"&&(c.current(),c.current=null),r&&l.current&&(c.current=x0t(r,l.current,y,{elementResize:"ResizeObserver"in window}))},[r,y]);hne(function(){C()},[C]);var x=w.useCallback(function(I){l.current=I,C()},[C]);if(!t&&a!=="fixed"||!v)return null;var k=ir("div",rt({ref:x},wl(Qe(Qe({},e),{},{offset:v.offset,position:a,rect:v.rect}),"menuPortal",{"menu-portal":!0}),o),i);return ir(iFe.Provider,{value:p},t?Yp.createPortal(k,t):k)},t1t=function(e){var t=e.isDisabled,i=e.isRtl;return{label:"container",direction:i?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},n1t=function(e){var t=e.children,i=e.innerProps,r=e.isDisabled,o=e.isRtl;return ir("div",rt({},wl(e,"container",{"--is-disabled":r,"--is-rtl":o}),i),t)},i1t=function(e,t){var i=e.theme.spacing,r=e.isMulti,o=e.hasValue,s=e.selectProps.controlShouldRenderValue;return Qe({alignItems:"center",display:r&&o&&s?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(i.baseUnit/2,"px ").concat(i.baseUnit*2,"px")})},r1t=function(e){var t=e.children,i=e.innerProps,r=e.isMulti,o=e.hasValue;return ir("div",rt({},wl(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),i),t)},o1t=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},s1t=function(e){var t=e.children,i=e.innerProps;return ir("div",rt({},wl(e,"indicatorsContainer",{indicators:!0}),i),t)},iSe,a1t=["size"],l1t=["innerProps","isRtl","size"],c1t={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},oFe=function(e){var t=e.size,i=uu(e,a1t);return ir("svg",rt({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:c1t},i))},dfe=function(e){return ir(oFe,rt({size:20},e),ir("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},sFe=function(e){return ir(oFe,rt({size:20},e),ir("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},aFe=function(e,t){var i=e.isFocused,r=e.theme,o=r.spacing.baseUnit,s=r.colors;return Qe({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:i?s.neutral60:s.neutral20,padding:o*2,":hover":{color:i?s.neutral80:s.neutral40}})},u1t=aFe,d1t=function(e){var t=e.children,i=e.innerProps;return ir("div",rt({},wl(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),t||ir(sFe,null))},h1t=aFe,f1t=function(e){var t=e.children,i=e.innerProps;return ir("div",rt({},wl(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),t||ir(dfe,null))},g1t=function(e,t){var i=e.isDisabled,r=e.theme,o=r.spacing.baseUnit,s=r.colors;return Qe({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:i?s.neutral10:s.neutral20,marginBottom:o*2,marginTop:o*2})},p1t=function(e){var t=e.innerProps;return ir("span",rt({},t,wl(e,"indicatorSeparator",{"indicator-separator":!0})))},m1t=h0t(iSe||(iSe=f0t([`
0%, 80%, 100% { opacity: 0; }
40% { opacity: 1; }
`]))),_1t=function(e,t){var i=e.isFocused,r=e.size,o=e.theme,s=o.colors,a=o.spacing.baseUnit;return Qe({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:i?s.neutral60:s.neutral20,padding:a*2})},tQ=function(e){var t=e.delay,i=e.offset;return ir("span",{css:afe({animation:"".concat(m1t," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:i?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},v1t=function(e){var t=e.innerProps,i=e.isRtl,r=e.size,o=r===void 0?4:r,s=uu(e,l1t);return ir("div",rt({},wl(Qe(Qe({},s),{},{innerProps:t,isRtl:i,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),ir(tQ,{delay:0,offset:i}),ir(tQ,{delay:160,offset:!0}),ir(tQ,{delay:320,offset:!i}))},b1t=function(e,t){var i=e.isDisabled,r=e.isFocused,o=e.theme,s=o.colors,a=o.borderRadius,l=o.spacing;return Qe({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:i?s.neutral5:s.neutral0,borderColor:i?s.neutral10:r?s.primary:s.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:r?s.primary:s.neutral30}})},y1t=function(e){var t=e.children,i=e.isDisabled,r=e.isFocused,o=e.innerRef,s=e.innerProps,a=e.menuIsOpen;return ir("div",rt({ref:o},wl(e,"control",{control:!0,"control--is-disabled":i,"control--is-focused":r,"control--menu-is-open":a}),s,{"aria-disabled":i||void 0}),t)},C1t=y1t,w1t=["data"],S1t=function(e,t){var i=e.theme.spacing;return t?{}:{paddingBottom:i.baseUnit*2,paddingTop:i.baseUnit*2}},E1t=function(e){var t=e.children,i=e.cx,r=e.getStyles,o=e.getClassNames,s=e.Heading,a=e.headingProps,l=e.innerProps,c=e.label,u=e.theme,d=e.selectProps;return ir("div",rt({},wl(e,"group",{group:!0}),l),ir(s,rt({},a,{selectProps:d,theme:u,getStyles:r,getClassNames:o,cx:i}),c),ir("div",null,t))},x1t=function(e,t){var i=e.theme,r=i.colors,o=i.spacing;return Qe({label:"group",cursor:"default",display:"block"},t?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},k1t=function(e){var t=J5e(e);t.data;var i=uu(t,w1t);return ir("div",rt({},wl(e,"groupHeading",{"group-heading":!0}),i))},T1t=E1t,I1t=["innerRef","isDisabled","isHidden","inputClassName"],L1t=function(e,t){var i=e.isDisabled,r=e.value,o=e.theme,s=o.spacing,a=o.colors;return Qe(Qe({visibility:i?"hidden":"visible",transform:r?"translateZ(0)":""},D1t),t?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:a.neutral80})},lFe={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},D1t={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Qe({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},lFe)},A1t=function(e){return Qe({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},lFe)},R1t=function(e){var t=e.cx,i=e.value,r=J5e(e),o=r.innerRef,s=r.isDisabled,a=r.isHidden,l=r.inputClassName,c=uu(r,I1t);return ir("div",rt({},wl(e,"input",{"input-container":!0}),{"data-value":i||""}),ir("input",rt({className:t({input:!0},l),ref:o,style:A1t(a),disabled:s},c)))},N1t=R1t,O1t=function(e,t){var i=e.theme,r=i.spacing,o=i.borderRadius,s=i.colors;return Qe({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:s.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},P1t=function(e,t){var i=e.theme,r=i.borderRadius,o=i.colors,s=e.cropWithEllipsis;return Qe({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},M1t=function(e,t){var i=e.theme,r=i.spacing,o=i.borderRadius,s=i.colors,a=e.isFocused;return Qe({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:a?s.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},cFe=function(e){var t=e.children,i=e.innerProps;return ir("div",i,t)},F1t=cFe,B1t=cFe;function $1t(n){var e=n.children,t=n.innerProps;return ir("div",rt({role:"button"},t),e||ir(dfe,{size:14}))}var V1t=function(e){var t=e.children,i=e.components,r=e.data,o=e.innerProps,s=e.isDisabled,a=e.removeProps,l=e.selectProps,c=i.Container,u=i.Label,d=i.Remove;return ir(c,{data:r,innerProps:Qe(Qe({},wl(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),o),selectProps:l},ir(u,{data:r,innerProps:Qe({},wl(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},t),ir(d,{data:r,innerProps:Qe(Qe({},wl(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:l}))},H1t=V1t,W1t=function(e,t){var i=e.isDisabled,r=e.isFocused,o=e.isSelected,s=e.theme,a=s.spacing,l=s.colors;return Qe({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?l.primary:r?l.primary25:"transparent",color:i?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:i?void 0:o?l.primary:l.primary50}})},z1t=function(e){var t=e.children,i=e.isDisabled,r=e.isFocused,o=e.isSelected,s=e.innerRef,a=e.innerProps;return ir("div",rt({},wl(e,"option",{option:!0,"option--is-disabled":i,"option--is-focused":r,"option--is-selected":o}),{ref:s,"aria-disabled":i},a),t)},j1t=z1t,U1t=function(e,t){var i=e.theme,r=i.spacing,o=i.colors;return Qe({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},q1t=function(e){var t=e.children,i=e.innerProps;return ir("div",rt({},wl(e,"placeholder",{placeholder:!0}),i),t)},K1t=q1t,G1t=function(e,t){var i=e.isDisabled,r=e.theme,o=r.spacing,s=r.colors;return Qe({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:i?s.neutral40:s.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Y1t=function(e){var t=e.children,i=e.isDisabled,r=e.innerProps;return ir("div",rt({},wl(e,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),r),t)},Q1t=Y1t,X1t={ClearIndicator:f1t,Control:C1t,DropdownIndicator:d1t,DownChevron:sFe,CrossIcon:dfe,Group:T1t,GroupHeading:k1t,IndicatorsContainer:s1t,IndicatorSeparator:p1t,Input:N1t,LoadingIndicator:v1t,Menu:q0t,MenuList:G0t,MenuPortal:e1t,LoadingMessage:Z0t,NoOptionsMessage:X0t,MultiValue:H1t,MultiValueContainer:F1t,MultiValueLabel:B1t,MultiValueRemove:$1t,Option:j1t,Placeholder:K1t,SelectContainer:n1t,SingleValue:Q1t,ValueContainer:r1t},Z1t=function(e){return Qe(Qe({},X1t),e.components)},rSe=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function J1t(n,e){return!!(n===e||rSe(n)&&rSe(e))}function eCt(n,e){if(n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(!J1t(n[t],e[t]))return!1;return!0}function Mc(n,e){e===void 0&&(e=eCt);var t=null;function i(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(t&&t.lastThis===this&&e(r,t.lastArgs))return t.lastResult;var s=n.apply(this,r);return t={lastResult:s,lastArgs:r,lastThis:this},s}return i.clear=function(){t=null},i}var tCt={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},nCt=function(e){return ir("span",rt({css:tCt},e))},oSe=nCt,iCt={guidance:function(e){var t=e.isSearchable,i=e.isMulti,r=e.isDisabled,o=e.tabSelectsValue,s=e.context;switch(s){case"menu":return"Use Up and Down to choose options".concat(r?"":", press Enter to select the currently focused option",", press Escape to exit the menu").concat(o?", press Tab to select the option and exit the menu":"",".");case"input":return"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(i?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,i=e.label,r=i===void 0?"":i,o=e.labels,s=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return s?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(e){var t=e.context,i=e.focused,r=e.options,o=e.label,s=o===void 0?"":o,a=e.selectValue,l=e.isDisabled,c=e.isSelected,u=function(p,m){return p&&p.length?"".concat(p.indexOf(m)+1," of ").concat(p.length):""};if(t==="value"&&a)return"value ".concat(s," focused, ").concat(u(a,i),".");if(t==="menu"){var d=l?" disabled":"",h="".concat(c?"selected":"focused").concat(d);return"option ".concat(s," ").concat(h,", ").concat(u(r,i),".")}return""},onFilter:function(e){var t=e.inputValue,i=e.resultsMessage;return"".concat(i).concat(t?" for search term "+t:"",".")}},rCt=function(e){var t=e.ariaSelection,i=e.focusedOption,r=e.focusedValue,o=e.focusableOptions,s=e.isFocused,a=e.selectValue,l=e.selectProps,c=e.id,u=l.ariaLiveMessages,d=l.getOptionLabel,h=l.inputValue,g=l.isMulti,p=l.isOptionDisabled,m=l.isSearchable,_=l.menuIsOpen,v=l.options,b=l.screenReaderStatus,y=l.tabSelectsValue,C=l["aria-label"],x=l["aria-live"],k=w.useMemo(function(){return Qe(Qe({},iCt),u||{})},[u]),I=w.useMemo(function(){var B="";if(t&&k.onChange){var F=t.option,H=t.options,V=t.removedValue,$=t.removedValues,j=t.value,Y=function(Re){return Array.isArray(Re)?null:Re},ne=V||F||Y(j),se=ne?d(ne):"",he=H||$||void 0,xe=he?he.map(d):[],_e=Qe({isDisabled:ne&&p(ne,a),label:se,labels:xe},t);B=k.onChange(_e)}return B},[t,k,p,a,d]),L=w.useMemo(function(){var B="",F=i||r,H=!!(i&&a&&a.includes(i));if(F&&k.onFocus){var V={focused:F,label:d(F),isDisabled:p(F,a),isSelected:H,options:o,context:F===i?"menu":"value",selectValue:a};B=k.onFocus(V)}return B},[i,r,d,p,k,o,a]),D=w.useMemo(function(){var B="";if(_&&v.length&&k.onFilter){var F=b({count:o.length});B=k.onFilter({inputValue:h,resultsMessage:F})}return B},[o,h,_,k,v,b]),R=w.useMemo(function(){var B="";if(k.guidance){var F=r?"value":_?"menu":"input";B=k.guidance({"aria-label":C,context:F,isDisabled:i&&p(i,a),isMulti:g,isSearchable:m,tabSelectsValue:y})}return B},[C,i,r,g,p,m,_,k,a,y]),P="".concat(L," ").concat(D," ").concat(R),M=ir(w.Fragment,null,ir("span",{id:"aria-selection"},I),ir("span",{id:"aria-context"},P)),O=(t==null?void 0:t.action)==="initial-input-focus";return ir(w.Fragment,null,ir(oSe,{id:c},O&&M),ir(oSe,{"aria-live":x,"aria-atomic":"false","aria-relevant":"additions text"},s&&!O&&M))},oCt=rCt,fne=[{base:"A",letters:"AⒶÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷḂḄḆɃƂƁ"},{base:"C",letters:"CⒸĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻḞƑꝻ"},{base:"G",letters:"GⒼǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿĴɈ"},{base:"K",letters:"KⓀḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂḾṀṂⱮƜ"},{base:"N",letters:"NⓃǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆꝖꝘɊ"},{base:"R",letters:"RⓇŔṘŘȐȒṚṜŖṞɌⱤꞦꞂ"},{base:"S",letters:"SⓈẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍẊẌ"},{base:"Y",letters:"YⓎỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑḃḅḇƀƃɓ"},{base:"c",letters:"cⓒćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕḟƒꝼ"},{base:"g",letters:"gⓖǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙĵǰɉ"},{base:"k",letters:"kⓚḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜḿṁṃɱɯ"},{base:"n",letters:"nⓝǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠɋꝗꝙ"},{base:"r",letters:"rⓡŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧẋẍ"},{base:"y",letters:"yⓨỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩźẑżžẓẕƶȥɀⱬꝣ"}],sCt=new RegExp("["+fne.map(function(n){return n.letters}).join("")+"]","g"),uFe={};for(var nQ=0;nQ<fne.length;nQ++)for(var iQ=fne[nQ],rQ=0;rQ<iQ.letters.length;rQ++)uFe[iQ.letters[rQ]]=iQ.base;var dFe=function(e){return e.replace(sCt,function(t){return uFe[t]})},aCt=Mc(dFe),sSe=function(e){return e.replace(/^\s+|\s+$/g,"")},lCt=function(e){return"".concat(e.label," ").concat(e.value)},cCt=function(e){return function(t,i){if(t.data.__isNew__)return!0;var r=Qe({ignoreCase:!0,ignoreAccents:!0,stringify:lCt,trim:!0,matchFrom:"any"},e),o=r.ignoreCase,s=r.ignoreAccents,a=r.stringify,l=r.trim,c=r.matchFrom,u=l?sSe(i):i,d=l?sSe(a(t)):a(t);return o&&(u=u.toLowerCase(),d=d.toLowerCase()),s&&(u=aCt(u),d=dFe(d)),c==="start"?d.substr(0,u.length)===u:d.indexOf(u)>-1}},uCt=["innerRef"];function dCt(n){var e=n.innerRef,t=uu(n,uCt),i=B0t(t,"onExited","in","enter","exit","appear");return ir("input",rt({ref:e},i,{css:afe({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var hCt=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function fCt(n){var e=n.isEnabled,t=n.onBottomArrive,i=n.onBottomLeave,r=n.onTopArrive,o=n.onTopLeave,s=w.useRef(!1),a=w.useRef(!1),l=w.useRef(0),c=w.useRef(null),u=w.useCallback(function(_,v){if(c.current!==null){var b=c.current,y=b.scrollTop,C=b.scrollHeight,x=b.clientHeight,k=c.current,I=v>0,L=C-x-y,D=!1;L>v&&s.current&&(i&&i(_),s.current=!1),I&&a.current&&(o&&o(_),a.current=!1),I&&v>L?(t&&!s.current&&t(_),k.scrollTop=C,D=!0,s.current=!0):!I&&-v>y&&(r&&!a.current&&r(_),k.scrollTop=0,D=!0,a.current=!0),D&&hCt(_)}},[t,i,r,o]),d=w.useCallback(function(_){u(_,_.deltaY)},[u]),h=w.useCallback(function(_){l.current=_.changedTouches[0].clientY},[]),g=w.useCallback(function(_){var v=l.current-_.changedTouches[0].clientY;u(_,v)},[u]),p=w.useCallback(function(_){if(_){var v=P0t?{passive:!1}:!1;_.addEventListener("wheel",d,v),_.addEventListener("touchstart",h,v),_.addEventListener("touchmove",g,v)}},[g,h,d]),m=w.useCallback(function(_){_&&(_.removeEventListener("wheel",d,!1),_.removeEventListener("touchstart",h,!1),_.removeEventListener("touchmove",g,!1))},[g,h,d]);return w.useEffect(function(){if(e){var _=c.current;return p(_),function(){m(_)}}},[e,p,m]),function(_){c.current=_}}var aSe=["boxSizing","height","overflow","paddingRight","position"],lSe={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function cSe(n){n.preventDefault()}function uSe(n){n.stopPropagation()}function dSe(){var n=this.scrollTop,e=this.scrollHeight,t=n+this.offsetHeight;n===0?this.scrollTop=1:t===e&&(this.scrollTop=n-1)}function hSe(){return"ontouchstart"in window||navigator.maxTouchPoints}var fSe=!!(typeof window<"u"&&window.document&&window.document.createElement),mR=0,vT={capture:!1,passive:!1};function gCt(n){var e=n.isEnabled,t=n.accountForScrollbars,i=t===void 0?!0:t,r=w.useRef({}),o=w.useRef(null),s=w.useCallback(function(l){if(fSe){var c=document.body,u=c&&c.style;if(i&&aSe.forEach(function(p){var m=u&&u[p];r.current[p]=m}),i&&mR<1){var d=parseInt(r.current.paddingRight,10)||0,h=document.body?document.body.clientWidth:0,g=window.innerWidth-h+d||0;Object.keys(lSe).forEach(function(p){var m=lSe[p];u&&(u[p]=m)}),u&&(u.paddingRight="".concat(g,"px"))}c&&hSe()&&(c.addEventListener("touchmove",cSe,vT),l&&(l.addEventListener("touchstart",dSe,vT),l.addEventListener("touchmove",uSe,vT))),mR+=1}},[i]),a=w.useCallback(function(l){if(fSe){var c=document.body,u=c&&c.style;mR=Math.max(mR-1,0),i&&mR<1&&aSe.forEach(function(d){var h=r.current[d];u&&(u[d]=h)}),c&&hSe()&&(c.removeEventListener("touchmove",cSe,vT),l&&(l.removeEventListener("touchstart",dSe,vT),l.removeEventListener("touchmove",uSe,vT)))}},[i]);return w.useEffect(function(){if(e){var l=o.current;return s(l),function(){a(l)}}},[e,s,a]),function(l){o.current=l}}var pCt=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},mCt={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function _Ct(n){var e=n.children,t=n.lockEnabled,i=n.captureEnabled,r=i===void 0?!0:i,o=n.onBottomArrive,s=n.onBottomLeave,a=n.onTopArrive,l=n.onTopLeave,c=fCt({isEnabled:r,onBottomArrive:o,onBottomLeave:s,onTopArrive:a,onTopLeave:l}),u=gCt({isEnabled:t}),d=function(g){c(g),u(g)};return ir(w.Fragment,null,t&&ir("div",{onClick:pCt,css:mCt}),e(d))}var vCt={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},bCt=function(e){var t=e.name,i=e.onFocus;return ir("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:i,css:vCt,value:"",onChange:function(){}})},yCt=bCt,CCt=function(e){return e.label},wCt=function(e){return e.label},SCt=function(e){return e.value},ECt=function(e){return!!e.isDisabled},xCt={clearIndicator:h1t,container:t1t,control:b1t,dropdownIndicator:u1t,group:S1t,groupHeading:x1t,indicatorsContainer:o1t,indicatorSeparator:g1t,input:L1t,loadingIndicator:_1t,loadingMessage:Q0t,menu:z0t,menuList:K0t,menuPortal:J0t,multiValue:O1t,multiValueLabel:P1t,multiValueRemove:M1t,noOptionsMessage:Y0t,option:W1t,placeholder:U1t,singleValue:G1t,valueContainer:i1t},kCt={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},TCt=4,hFe=4,ICt=38,LCt=hFe*2,DCt={baseUnit:hFe,controlHeight:ICt,menuGutter:LCt},oQ={borderRadius:TCt,colors:kCt,spacing:DCt},ACt={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:nSe(),captureMenuScroll:!nSe(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:cCt(),formatGroupLabel:CCt,getOptionLabel:wCt,getOptionValue:SCt,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:ECt,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!N0t(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(t!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function gSe(n,e,t,i){var r=mFe(n,e,t),o=_Fe(n,e,t),s=pFe(n,e),a=p7(n,e);return{type:"option",data:e,isDisabled:r,isSelected:o,label:s,value:a,index:i}}function fFe(n,e){return n.options.map(function(t,i){if("options"in t){var r=t.options.map(function(s,a){return gSe(n,s,e,a)}).filter(function(s){return pSe(n,s)});return r.length>0?{type:"group",data:t,options:r,index:i}:void 0}var o=gSe(n,t,e,i);return pSe(n,o)?o:void 0}).filter(M0t)}function gFe(n){return n.reduce(function(e,t){return t.type==="group"?e.push.apply(e,Ir(t.options.map(function(i){return i.data}))):e.push(t.data),e},[])}function RCt(n,e){return gFe(fFe(n,e))}function pSe(n,e){var t=n.inputValue,i=t===void 0?"":t,r=e.data,o=e.isSelected,s=e.label,a=e.value;return(!bFe(n)||!o)&&vFe(n,{label:s,value:a,data:r},i)}function NCt(n,e){var t=n.focusedValue,i=n.selectValue,r=i.indexOf(t);if(r>-1){var o=e.indexOf(t);if(o>-1)return t;if(r<e.length)return e[r]}return null}function OCt(n,e){var t=n.focusedOption;return t&&e.indexOf(t)>-1?t:e[0]}var pFe=function(e,t){return e.getOptionLabel(t)},p7=function(e,t){return e.getOptionValue(t)};function mFe(n,e,t){return typeof n.isOptionDisabled=="function"?n.isOptionDisabled(e,t):!1}function _Fe(n,e,t){if(t.indexOf(e)>-1)return!0;if(typeof n.isOptionSelected=="function")return n.isOptionSelected(e,t);var i=p7(n,e);return t.some(function(r){return p7(n,r)===i})}function vFe(n,e,t){return n.filterOption?n.filterOption(e,t):!0}var bFe=function(e){var t=e.hideSelectedOptions,i=e.isMulti;return t===void 0?i:t},PCt=1,yFe=function(n){I_(t,n);var e=pk(t);function t(i){var r;if(Ua(this,t),r=e.call(this,i),r.state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.instancePrefix="",r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(a){r.controlRef=a},r.focusedOptionRef=null,r.getFocusedOptionRef=function(a){r.focusedOptionRef=a},r.menuListRef=null,r.getMenuListRef=function(a){r.menuListRef=a},r.inputRef=null,r.getInputRef=function(a){r.inputRef=a},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(a,l){var c=r.props,u=c.onChange,d=c.name;l.name=d,r.ariaOnChange(a,l),u(a,l)},r.setValue=function(a,l,c){var u=r.props,d=u.closeMenuOnSelect,h=u.isMulti,g=u.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:g}),d&&(r.setState({inputIsHiddenAfterUpdate:!h}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(a,{action:l,option:c})},r.selectOption=function(a){var l=r.props,c=l.blurInputOnSelect,u=l.isMulti,d=l.name,h=r.state.selectValue,g=u&&r.isOptionSelected(a,h),p=r.isOptionDisabled(a,h);if(g){var m=r.getOptionValue(a);r.setValue(h.filter(function(_){return r.getOptionValue(_)!==m}),"deselect-option",a)}else if(!p)u?r.setValue([].concat(Ir(h),[a]),"select-option",a):r.setValue(a,"select-option");else{r.ariaOnChange(a,{action:"select-option",option:a,name:d});return}c&&r.blurInput()},r.removeValue=function(a){var l=r.props.isMulti,c=r.state.selectValue,u=r.getOptionValue(a),d=c.filter(function(g){return r.getOptionValue(g)!==u}),h=_6(l,d,d[0]||null);r.onChange(h,{action:"remove-value",removedValue:a}),r.focusInput()},r.clearValue=function(){var a=r.state.selectValue;r.onChange(_6(r.props.isMulti,[],null),{action:"clear",removedValues:a})},r.popValue=function(){var a=r.props.isMulti,l=r.state.selectValue,c=l[l.length-1],u=l.slice(0,l.length-1),d=_6(a,u,u[0]||null);r.onChange(d,{action:"pop-value",removedValue:c})},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return I0t.apply(void 0,[r.props.classNamePrefix].concat(l))},r.getOptionLabel=function(a){return pFe(r.props,a)},r.getOptionValue=function(a){return p7(r.props,a)},r.getStyles=function(a,l){var c=r.props.unstyled,u=xCt[a](l,c);u.boxSizing="border-box";var d=r.props.styles[a];return d?d(u,l):u},r.getClassNames=function(a,l){var c,u;return(c=(u=r.props.classNames)[a])===null||c===void 0?void 0:c.call(u,l)},r.getElementId=function(a){return"".concat(r.instancePrefix,"-").concat(a)},r.getComponents=function(){return Z1t(r.props)},r.buildCategorizedOptions=function(){return fFe(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return gFe(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(a,l){r.setState({ariaSelection:Qe({value:a},l)})},r.onMenuMouseDown=function(a){a.button===0&&(a.stopPropagation(),a.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(a){r.blockOptionHover=!1},r.onControlMouseDown=function(a){if(!a.defaultPrevented){var l=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&r.onMenuClose():l&&r.openMenu("first"):(l&&(r.openAfterFocus=!0),r.focusInput()),a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.preventDefault()}},r.onDropdownIndicatorMouseDown=function(a){if(!(a&&a.type==="mousedown"&&a.button!==0)&&!r.props.isDisabled){var l=r.props,c=l.isMulti,u=l.menuIsOpen;r.focusInput(),u?(r.setState({inputIsHiddenAfterUpdate:!c}),r.onMenuClose()):r.openMenu("first"),a.preventDefault()}},r.onClearIndicatorMouseDown=function(a){a&&a.type==="mousedown"&&a.button!==0||(r.clearValue(),a.preventDefault(),r.openAfterFocus=!1,a.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(a){typeof r.props.closeMenuOnScroll=="boolean"?a.target instanceof HTMLElement&&Mz(a.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(a)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(a){var l=a.touches,c=l&&l.item(0);c&&(r.initialTouchX=c.clientX,r.initialTouchY=c.clientY,r.userIsDragging=!1)},r.onTouchMove=function(a){var l=a.touches,c=l&&l.item(0);if(c){var u=Math.abs(c.clientX-r.initialTouchX),d=Math.abs(c.clientY-r.initialTouchY),h=5;r.userIsDragging=u>h||d>h}},r.onTouchEnd=function(a){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(a.target)&&r.menuListRef&&!r.menuListRef.contains(a.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(a){r.userIsDragging||r.onControlMouseDown(a)},r.onClearIndicatorTouchEnd=function(a){r.userIsDragging||r.onClearIndicatorMouseDown(a)},r.onDropdownIndicatorTouchEnd=function(a){r.userIsDragging||r.onDropdownIndicatorMouseDown(a)},r.handleInputChange=function(a){var l=r.props.inputValue,c=a.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(c,{action:"input-change",prevInputValue:l}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(a){r.props.onFocus&&r.props.onFocus(a),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(a){var l=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(a),r.onInputChange("",{action:"input-blur",prevInputValue:l}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(a){r.blockOptionHover||r.state.focusedOption===a||r.setState({focusedOption:a})},r.shouldHideSelectedOptions=function(){return bFe(r.props)},r.onValueInputFocus=function(a){a.preventDefault(),a.stopPropagation(),r.focus()},r.onKeyDown=function(a){var l=r.props,c=l.isMulti,u=l.backspaceRemovesValue,d=l.escapeClearsValue,h=l.inputValue,g=l.isClearable,p=l.isDisabled,m=l.menuIsOpen,_=l.onKeyDown,v=l.tabSelectsValue,b=l.openMenuOnFocus,y=r.state,C=y.focusedOption,x=y.focusedValue,k=y.selectValue;if(!p&&!(typeof _=="function"&&(_(a),a.defaultPrevented))){switch(r.blockOptionHover=!0,a.key){case"ArrowLeft":if(!c||h)return;r.focusValue("previous");break;case"ArrowRight":if(!c||h)return;r.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(x)r.removeValue(x);else{if(!u)return;c?r.popValue():g&&r.clearValue()}break;case"Tab":if(r.isComposing||a.shiftKey||!m||!v||!C||b&&r.isOptionSelected(C,k))return;r.selectOption(C);break;case"Enter":if(a.keyCode===229)break;if(m){if(!C||r.isComposing)return;r.selectOption(C);break}return;case"Escape":m?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:h}),r.onMenuClose()):g&&d&&r.clearValue();break;case" ":if(h)return;if(!m){r.openMenu("first");break}if(!C)return;r.selectOption(C);break;case"ArrowUp":m?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":m?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!m)return;r.focusOption("pageup");break;case"PageDown":if(!m)return;r.focusOption("pagedown");break;case"Home":if(!m)return;r.focusOption("first");break;case"End":if(!m)return;r.focusOption("last");break;default:return}a.preventDefault()}},r.instancePrefix="react-select-"+(r.props.instanceId||++PCt),r.state.selectValue=eSe(i.value),i.menuIsOpen&&r.state.selectValue.length){var o=r.buildFocusableOptions(),s=o.indexOf(r.state.selectValue[0]);r.state.focusedOption=o[s]}return r}return qa(t,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&tSe(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(r){var o=this.props,s=o.isDisabled,a=o.menuIsOpen,l=this.state.isFocused;(l&&!s&&r.isDisabled||l&&a&&!r.menuIsOpen)&&this.focusInput(),l&&s&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!s&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(tSe(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,o){this.props.onInputChange(r,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var o=this,s=this.state,a=s.selectValue,l=s.isFocused,c=this.buildFocusableOptions(),u=r==="first"?0:c.length-1;if(!this.props.isMulti){var d=c.indexOf(a[0]);d>-1&&(u=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:c[u]},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(r){var o=this.state,s=o.selectValue,a=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=s.indexOf(a);a||(l=-1);var c=s.length-1,u=-1;if(s.length){switch(r){case"previous":l===0?u=0:l===-1?u=c:u=l-1;break;case"next":l>-1&&l<c&&(u=l+1);break}this.setState({inputIsHidden:u!==-1,focusedValue:s[u]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,s=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,c=a.indexOf(s);s||(c=-1),r==="up"?l=c>0?c-1:a.length-1:r==="down"?l=(c+1)%a.length:r==="pageup"?(l=c-o,l<0&&(l=0)):r==="pagedown"?(l=c+o,l>a.length-1&&(l=a.length-1)):r==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(oQ):Qe(Qe({},oQ),this.props.theme):oQ}},{key:"getCommonProps",value:function(){var r=this.clearValue,o=this.cx,s=this.getStyles,a=this.getClassNames,l=this.getValue,c=this.selectOption,u=this.setValue,d=this.props,h=d.isMulti,g=d.isRtl,p=d.options,m=this.hasValue();return{clearValue:r,cx:o,getStyles:s,getClassNames:a,getValue:l,hasValue:m,isMulti:h,isRtl:g,options:p,selectOption:c,selectProps:d,setValue:u,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,o=r.isClearable,s=r.isMulti;return o===void 0?s:o}},{key:"isOptionDisabled",value:function(r,o){return mFe(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return _Fe(this.props,r,o)}},{key:"filterOption",value:function(r,o){return vFe(this.props,r,o)}},{key:"formatOptionLabel",value:function(r,o){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(r,{context:o,inputValue:s,selectValue:a})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var r=this.props,o=r.isDisabled,s=r.isSearchable,a=r.inputId,l=r.inputValue,c=r.tabIndex,u=r.form,d=r.menuIsOpen,h=r.required,g=this.getComponents(),p=g.Input,m=this.state,_=m.inputIsHidden,v=m.ariaSelection,b=this.commonProps,y=a||this.getElementId("input"),C=Qe(Qe(Qe({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":h,role:"combobox"},d&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?(v==null?void 0:v.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?w.createElement(p,rt({},b,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:y,innerRef:this.getInputRef,isDisabled:o,isHidden:_,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:c,form:u,type:"text",value:l},C)):w.createElement(dCt,rt({id:y,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:f7,onFocus:this.onInputFocus,disabled:o,tabIndex:c,inputMode:"none",form:u,value:""},C))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,o=this.getComponents(),s=o.MultiValue,a=o.MultiValueContainer,l=o.MultiValueLabel,c=o.MultiValueRemove,u=o.SingleValue,d=o.Placeholder,h=this.commonProps,g=this.props,p=g.controlShouldRenderValue,m=g.isDisabled,_=g.isMulti,v=g.inputValue,b=g.placeholder,y=this.state,C=y.selectValue,x=y.focusedValue,k=y.isFocused;if(!this.hasValue()||!p)return v?null:w.createElement(d,rt({},h,{key:"placeholder",isDisabled:m,isFocused:k,innerProps:{id:this.getElementId("placeholder")}}),b);if(_)return C.map(function(L,D){var R=L===x,P="".concat(r.getOptionLabel(L),"-").concat(r.getOptionValue(L));return w.createElement(s,rt({},h,{components:{Container:a,Label:l,Remove:c},isFocused:R,isDisabled:m,key:P,index:D,removeProps:{onClick:function(){return r.removeValue(L)},onTouchEnd:function(){return r.removeValue(L)},onMouseDown:function(O){O.preventDefault()}},data:L}),r.formatOptionLabel(L,"value"))});if(v)return null;var I=C[0];return w.createElement(u,rt({},h,{data:I,isDisabled:m}),this.formatOptionLabel(I,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),o=r.ClearIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,u=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||c)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return w.createElement(o,rt({},s,{innerProps:d,isFocused:u}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),o=r.LoadingIndicator,s=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,u=this.state.isFocused;if(!o||!c)return null;var d={"aria-hidden":"true"};return w.createElement(o,rt({},s,{innerProps:d,isDisabled:l,isFocused:u}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator,s=r.IndicatorSeparator;if(!o||!s)return null;var a=this.commonProps,l=this.props.isDisabled,c=this.state.isFocused;return w.createElement(s,rt({},a,{isDisabled:l,isFocused:c}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator;if(!o)return null;var s=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,c={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return w.createElement(o,rt({},s,{innerProps:c,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,o=this.getComponents(),s=o.Group,a=o.GroupHeading,l=o.Menu,c=o.MenuList,u=o.MenuPortal,d=o.LoadingMessage,h=o.NoOptionsMessage,g=o.Option,p=this.commonProps,m=this.state.focusedOption,_=this.props,v=_.captureMenuScroll,b=_.inputValue,y=_.isLoading,C=_.loadingMessage,x=_.minMenuHeight,k=_.maxMenuHeight,I=_.menuIsOpen,L=_.menuPlacement,D=_.menuPosition,R=_.menuPortalTarget,P=_.menuShouldBlockScroll,M=_.menuShouldScrollIntoView,O=_.noOptionsMessage,B=_.onMenuScrollToTop,F=_.onMenuScrollToBottom;if(!I)return null;var H=function(he,xe){var _e=he.type,Ie=he.data,Re=he.isDisabled,Ye=he.isSelected,Ze=he.label,tt=he.value,Be=m===Ie,kt=Re?void 0:function(){return r.onOptionHover(Ie)},Vt=Re?void 0:function(){return r.selectOption(Ie)},xt="".concat(r.getElementId("option"),"-").concat(xe),Kt={id:xt,onClick:Vt,onMouseMove:kt,onMouseOver:kt,tabIndex:-1};return w.createElement(g,rt({},p,{innerProps:Kt,data:Ie,isDisabled:Re,isSelected:Ye,key:xt,label:Ze,type:_e,value:tt,isFocused:Be,innerRef:Be?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(he.data,"menu"))},V;if(this.hasOptions())V=this.getCategorizedOptions().map(function(se){if(se.type==="group"){var he=se.data,xe=se.options,_e=se.index,Ie="".concat(r.getElementId("group"),"-").concat(_e),Re="".concat(Ie,"-heading");return w.createElement(s,rt({},p,{key:Ie,data:he,options:xe,Heading:a,headingProps:{id:Re,data:se.data},label:r.formatGroupLabel(se.data)}),se.options.map(function(Ye){return H(Ye,"".concat(_e,"-").concat(Ye.index))}))}else if(se.type==="option")return H(se,"".concat(se.index))});else if(y){var $=C({inputValue:b});if($===null)return null;V=w.createElement(d,p,$)}else{var j=O({inputValue:b});if(j===null)return null;V=w.createElement(h,p,j)}var Y={minMenuHeight:x,maxMenuHeight:k,menuPlacement:L,menuPosition:D,menuShouldScrollIntoView:M},ne=w.createElement(j0t,rt({},p,Y),function(se){var he=se.ref,xe=se.placerProps,_e=xe.placement,Ie=xe.maxHeight;return w.createElement(l,rt({},p,Y,{innerRef:he,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove,id:r.getElementId("listbox")},isLoading:y,placement:_e}),w.createElement(_Ct,{captureEnabled:v,onTopArrive:B,onBottomArrive:F,lockEnabled:P},function(Re){return w.createElement(c,rt({},p,{innerRef:function(Ze){r.getMenuListRef(Ze),Re(Ze)},isLoading:y,maxHeight:Ie,focusedOption:m}),V)}))});return R||D==="fixed"?w.createElement(u,rt({},p,{appendTo:R,controlElement:this.controlRef,menuPlacement:L,menuPosition:D}),ne):ne}},{key:"renderFormField",value:function(){var r=this,o=this.props,s=o.delimiter,a=o.isDisabled,l=o.isMulti,c=o.name,u=o.required,d=this.state.selectValue;if(u&&!this.hasValue()&&!a)return w.createElement(yCt,{name:c,onFocus:this.onValueInputFocus});if(!(!c||a))if(l)if(s){var h=d.map(function(m){return r.getOptionValue(m)}).join(s);return w.createElement("input",{name:c,type:"hidden",value:h})}else{var g=d.length>0?d.map(function(m,_){return w.createElement("input",{key:"i-".concat(_),name:c,type:"hidden",value:r.getOptionValue(m)})}):w.createElement("input",{name:c,type:"hidden",value:""});return w.createElement("div",null,g)}else{var p=d[0]?this.getOptionValue(d[0]):"";return w.createElement("input",{name:c,type:"hidden",value:p})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,o=this.state,s=o.ariaSelection,a=o.focusedOption,l=o.focusedValue,c=o.isFocused,u=o.selectValue,d=this.getFocusableOptions();return w.createElement(oCt,rt({},r,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:a,focusedValue:l,isFocused:c,selectValue:u,focusableOptions:d}))}},{key:"render",value:function(){var r=this.getComponents(),o=r.Control,s=r.IndicatorsContainer,a=r.SelectContainer,l=r.ValueContainer,c=this.props,u=c.className,d=c.id,h=c.isDisabled,g=c.menuIsOpen,p=this.state.isFocused,m=this.commonProps=this.getCommonProps();return w.createElement(a,rt({},m,{className:u,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:h,isFocused:p}),this.renderLiveRegion(),w.createElement(o,rt({},m,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:h,isFocused:p,menuIsOpen:g}),w.createElement(l,rt({},m,{isDisabled:h}),this.renderPlaceholderOrValue(),this.renderInput()),w.createElement(s,rt({},m,{isDisabled:h}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,o){var s=o.prevProps,a=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,c=o.ariaSelection,u=o.isFocused,d=o.prevWasFocused,h=r.options,g=r.value,p=r.menuIsOpen,m=r.inputValue,_=r.isMulti,v=eSe(g),b={};if(s&&(g!==s.value||h!==s.options||p!==s.menuIsOpen||m!==s.inputValue)){var y=p?RCt(r,v):[],C=a?NCt(o,v):null,x=OCt(o,y);b={selectValue:v,focusedOption:x,focusedValue:C,clearFocusValueOnUpdate:!1}}var k=l!=null&&r!==s?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},I=c,L=u&&d;return u&&!L&&(I={value:_6(_,v,v[0]||null),options:v,action:"initial-input-focus"},L=!d),(c==null?void 0:c.action)==="initial-input-focus"&&(I=null),Qe(Qe(Qe({},b),k),{},{prevProps:r,ariaSelection:I,prevWasFocused:L})}}]),t}(w.Component);yFe.defaultProps=ACt;var MCt=w.forwardRef(function(n,e){var t=yyt(n);return w.createElement(yFe,rt({ref:e},t))}),b_=MCt;function nn(n){const e=Vn(),{blankOptionValue:t,withBlank:i,children:r,value:o,defaultValue:s,customSelector:a,onValueChange:l,className:c,disabled:u,cypressRef:d}=n,h=f("option",{value:t??""}),g=te.Children.map([i?h:[],r],v=>w.isValidElement(v)&&{label:Array.isArray(v.props.children)?v.props.children.join(""):v.props.children,value:v.props.value}),p=g==null?void 0:g.find(v=>v.value===o),m=g==null?void 0:g.find(v=>v.value===s),_={input:v=>({...v,color:e.$3}),singleValue:v=>({...v,color:e.$3}),menu:v=>({...v,width:"max-content",minWidth:"100%",backgroundColor:e.$4,borderColor:e.$4}),control:(v,{isDisabled:b})=>({...v,borderRadius:"3px",backgroundColor:e.$1,color:e.$3,borderColor:e.$5,cursor:b?"not-allowed":"pointer",pointerEvents:b?"auto":"unset"}),option:(v,{isSelected:b,isFocused:y})=>({...v,display:"flex",alignItems:"center",color:e.$3,backgroundColor:b||y?e.$7:e.$1,":hover":{backgroundColor:e.$7},minHeight:"1.875rem"})};return N("div",{className:St({"space-y-2":!!a}),children:[n.label&&N($p,{className:"mb-2",for:n.id,children:[n.label,n.required&&f("span",{className:"ml-1 text-red-600",children:"*"})]}),a?f(b_,{className:c,options:g,defaultValue:m,value:p,onChange:v=>v===null?l==null?void 0:l(t??""):l==null?void 0:l(v.value),isDisabled:u,styles:_,isSearchable:!1,isClearable:!0,"data-cy":d}):N("select",{onChange:v=>{n.onValueChange&&n.onValueChange(v.target.value),n.onChange&&n.onChange(v)},id:n.id,className:St(`w-full py-2 rounded text-sm border disabled:cursor-not-allowed ${n.className}`),defaultValue:n.defaultValue,value:n.value,ref:n.innerRef,disabled:n.disabled,style:{backgroundColor:e.$1,borderColor:e.$5,color:e.$3,...n.style},"data-cy":n.cypressRef,children:[n.withBlank&&f("option",{value:n.blankOptionValue??""}),n.children]}),n.errorMessage&&f(bs,{className:"mt-2",type:"danger",children:n.errorMessage})]})}const FCt=po(null);var Fz={},BCt="Expected a function",mSe=0/0,$Ct="[object Symbol]",VCt=/^\s+|\s+$/g,HCt=/^[-+]0x[0-9a-f]+$/i,WCt=/^0b[01]+$/i,zCt=/^0o[0-7]+$/i,jCt=parseInt,UCt=typeof Co=="object"&&Co&&Co.Object===Object&&Co,qCt=typeof self=="object"&&self&&self.Object===Object&&self,KCt=UCt||qCt||Function("return this")(),GCt=Object.prototype,YCt=GCt.toString,QCt=Math.max,XCt=Math.min,sQ=function(){return KCt.Date.now()};function ZCt(n,e,t){var i,r,o,s,a,l,c=0,u=!1,d=!1,h=!0;if(typeof n!="function")throw new TypeError(BCt);e=_Se(e)||0,gne(t)&&(u=!!t.leading,d="maxWait"in t,o=d?QCt(_Se(t.maxWait)||0,e):o,h="trailing"in t?!!t.trailing:h);function g(k){var I=i,L=r;return i=r=void 0,c=k,s=n.apply(L,I),s}function p(k){return c=k,a=setTimeout(v,e),u?g(k):s}function m(k){var I=k-l,L=k-c,D=e-I;return d?XCt(D,o-L):D}function _(k){var I=k-l,L=k-c;return l===void 0||I>=e||I<0||d&&L>=o}function v(){var k=sQ();if(_(k))return b(k);a=setTimeout(v,m(k))}function b(k){return a=void 0,h&&i?g(k):(i=r=void 0,s)}function y(){a!==void 0&&clearTimeout(a),c=0,i=l=r=a=void 0}function C(){return a===void 0?s:b(sQ())}function x(){var k=sQ(),I=_(k);if(i=arguments,r=this,l=k,I){if(a===void 0)return p(l);if(d)return a=setTimeout(v,e),g(l)}return a===void 0&&(a=setTimeout(v,e)),s}return x.cancel=y,x.flush=C,x}function gne(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function JCt(n){return!!n&&typeof n=="object"}function ewt(n){return typeof n=="symbol"||JCt(n)&&YCt.call(n)==$Ct}function _Se(n){if(typeof n=="number")return n;if(ewt(n))return mSe;if(gne(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=gne(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=n.replace(VCt,"");var t=WCt.test(n);return t||zCt.test(n)?jCt(n.slice(2),t?2:8):HCt.test(n)?mSe:+n}var twt=ZCt;function pne(n){"@babel/helpers - typeof";return pne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pne(n)}Object.defineProperty(Fz,"__esModule",{value:!0});Fz.DebounceInput=void 0;var vSe=CFe(w),nwt=CFe(twt),iwt=["element","onChange","value","minLength","debounceTimeout","forceNotifyByEnter","forceNotifyOnBlur","onKeyDown","onBlur","inputRef"];function CFe(n){return n&&n.__esModule?n:{default:n}}function rwt(n,e){if(n==null)return{};var t=owt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function owt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}function bSe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Yg(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?bSe(Object(t),!0).forEach(function(i){y1(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):bSe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function swt(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function ySe(n,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}function awt(n,e,t){return e&&ySe(n.prototype,e),t&&ySe(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function lwt(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&mne(n,e)}function mne(n,e){return mne=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},mne(n,e)}function cwt(n){var e=dwt();return function(){var i=m7(n),r;if(e){var o=m7(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return uwt(this,r)}}function uwt(n,e){if(e&&(pne(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return PS(n)}function PS(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function dwt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function m7(n){return m7=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},m7(n)}function y1(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var wFe=function(n){lwt(t,n);var e=cwt(t);function t(i){var r;swt(this,t),r=e.call(this,i),y1(PS(r),"onChange",function(s){s.persist();var a=r.state.value,l=r.props.minLength;r.setState({value:s.target.value},function(){var c=r.state.value;if(c.length>=l){r.notify(s);return}a.length>c.length&&r.notify(Yg(Yg({},s),{},{target:Yg(Yg({},s.target),{},{value:""})}))})}),y1(PS(r),"onKeyDown",function(s){s.key==="Enter"&&r.forceNotify(s);var a=r.props.onKeyDown;a&&(s.persist(),a(s))}),y1(PS(r),"onBlur",function(s){r.forceNotify(s);var a=r.props.onBlur;a&&(s.persist(),a(s))}),y1(PS(r),"createNotifier",function(s){if(s<0)r.notify=function(){return null};else if(s===0)r.notify=r.doNotify;else{var a=(0,nwt.default)(function(l){r.isDebouncing=!1,r.doNotify(l)},s);r.notify=function(l){r.isDebouncing=!0,a(l)},r.flush=function(){return a.flush()},r.cancel=function(){r.isDebouncing=!1,a.cancel()}}}),y1(PS(r),"doNotify",function(){var s=r.props.onChange;s.apply(void 0,arguments)}),y1(PS(r),"forceNotify",function(s){var a=r.props.debounceTimeout;if(!(!r.isDebouncing&&a>0)){r.cancel&&r.cancel();var l=r.state.value,c=r.props.minLength;l.length>=c?r.doNotify(s):r.doNotify(Yg(Yg({},s),{},{target:Yg(Yg({},s.target),{},{value:l})}))}}),r.isDebouncing=!1,r.state={value:typeof i.value>"u"||i.value===null?"":i.value};var o=r.props.debounceTimeout;return r.createNotifier(o),r}return awt(t,[{key:"componentDidUpdate",value:function(r){if(!this.isDebouncing){var o=this.props,s=o.value,a=o.debounceTimeout,l=r.debounceTimeout,c=r.value,u=this.state.value;typeof s<"u"&&c!==s&&u!==s&&this.setState({value:s}),a!==l&&this.createNotifier(a)}}},{key:"componentWillUnmount",value:function(){this.flush&&this.flush()}},{key:"render",value:function(){var r=this.props,o=r.element;r.onChange,r.value,r.minLength,r.debounceTimeout;var s=r.forceNotifyByEnter,a=r.forceNotifyOnBlur,l=r.onKeyDown,c=r.onBlur,u=r.inputRef,d=rwt(r,iwt),h=this.state.value,g;s?g={onKeyDown:this.onKeyDown}:l?g={onKeyDown:l}:g={};var p;a?p={onBlur:this.onBlur}:c?p={onBlur:c}:p={};var m=u?{ref:u}:{};return vSe.default.createElement(o,Yg(Yg(Yg(Yg({},d),{},{onChange:this.onChange,value:h},g),p),m))}}]),t}(vSe.default.PureComponent);Fz.DebounceInput=wFe;y1(wFe,"defaultProps",{element:"input",type:"text",onKeyDown:void 0,onBlur:void 0,value:void 0,minLength:0,debounceTimeout:100,forceNotifyByEnter:!0,forceNotifyOnBlur:!0,inputRef:void 0});var hwt=Fz,_ne=hwt.DebounceInput;_ne.DebounceInput=_ne;var SFe=_ne;function fwt(n){return bn({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"defs",attr:{},child:[{tag:"clipPath",attr:{},child:[{tag:"path",attr:{fill:"none",d:"M124-288l388-672 388 672H124z",clipRule:"evenodd"}}]}]},{tag:"path",attr:{d:"M508 624a112 112 0 0 0 112-112c0-3.28-.15-6.53-.43-9.74L498.26 623.57c3.21.28 6.45.43 9.74.43zm370.72-458.44L836 122.88a8 8 0 0 0-11.31 0L715.37 232.23Q624.91 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 0 0 0 51.5q56.7 119.43 136.55 191.45L112.56 835a8 8 0 0 0 0 11.31L155.25 889a8 8 0 0 0 11.31 0l712.16-712.12a8 8 0 0 0 0-11.32zM332 512a176 176 0 0 1 258.88-155.28l-48.62 48.62a112.08 112.08 0 0 0-140.92 140.92l-48.62 48.62A175.09 175.09 0 0 1 332 512z"}},{tag:"path",attr:{d:"M942.2 486.2Q889.4 375 816.51 304.85L672.37 449A176.08 176.08 0 0 1 445 676.37L322.74 798.63Q407.82 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 0 0 0-51.5z"}}]})(n)}function gwt(n){return bn({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M396 512a112 112 0 1 0 224 0 112 112 0 1 0-224 0zm546.2-25.8C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 0 0 0 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.5zM508 688c-97.2 0-176-78.8-176-176s78.8-176 176-176 176 78.8 176 176-78.8 176-176 176z"}}]})(n)}function pwt(n){return bn({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M894 462c30.9 0 43.8-39.7 18.7-58L530.8 126.2a31.81 31.81 0 0 0-37.6 0L111.3 404c-25.1 18.2-12.2 58 18.8 58H192v374h-72c-4.4 0-8 3.6-8 8v52c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-52c0-4.4-3.6-8-8-8h-72V462h62zM512 196.7l271.1 197.2H240.9L512 196.7zM264 462h117v374H264V462zm189 0h117v374H453V462zm307 374H642V462h118v374z"}}]})(n)}function $p(n){const e=Vn();return f("label",{className:`text-sm font-medium block ${n.className}`,htmlFor:n.for,style:{color:e.$3},children:n.children})}function ke(n){const e=n.type==="password",[t,i]=w.useState(!0),r=w.useMemo(()=>n.type==="password"&&t?"password":n.type==="password"&&!t?"text":n.type,[n.type,t]),o=Vn(),s=sl({overwrite:!1});return N("section",{style:{width:n.width},children:[n.label&&N($p,{className:St("mb-2",{"whitespace-nowrap":n.withoutLabelWrapping}),for:n.id,children:[n.label,n.required&&f("span",{className:"ml-1 text-red-600",children:"*"})]}),N("div",{className:"relative",children:[f(SFe.DebounceInput,{style:{backgroundColor:o.$1,borderColor:o.$5,color:o.$3,...n.style},min:n.min,max:n.type==="date"?"9999-12-31":void 0,maxLength:n.maxLength,autoComplete:n.autoComplete||"new-password",disabled:n.disabled,element:n.element||"input",inputRef:n.innerRef,debounceTimeout:n.debounceTimeout??300,required:n.required,id:n.id,type:r,className:St(`w-full py-2 px-3 rounded text-sm disabled:opacity-75 disabled:cursor-not-allowed ${n.className}`,{"border border-gray-300":n.border!==!1}),placeholder:n.placeholder||"",onBlur:a=>{a.target.value=a.target.value===""&&n.type==="number"?"0":a.target.value,n.onValueChange&&n.onValueChange(a.target.value),n.onChange&&n.onChange(a)},onChange:a=>{if(n.element==="textarea"&&s.preferences.auto_expand_product_table_notes){const l=a.target.scrollHeight+2;l<200&&(a.target.style.height=l+"px")}n.changeOverride&&n.changeOverride===!0&&(n.onValueChange&&n.onValueChange(a.target.value),n.onChange&&n.onChange(a))},onClick:a=>{if(n.element==="textarea"&&s.preferences.auto_expand_product_table_notes){const l=a.target.scrollHeight+2;l<200&&(a.target.style.height=l+"px"),l>200&&(a.target.style.height="200px")}},onBlurCapture:a=>{n.element==="textarea"&&a.target.style.removeProperty("height")},value:n.value,list:n.list,rows:n.textareaRows||5,step:n.step,"data-cy":n.cypressRef,name:n.name,readOnly:n.readOnly}),e&&f("span",{className:"absolute top-1/4 right-3 cursor-pointer",children:t?f(gwt,{className:"text-gray-400",fontSize:19,onClick:()=>i(!1)}):f(fwt,{className:"text-gray-400",fontSize:19,onClick:()=>i(!0)})})]}),n.errorMessage&&f(bs,{className:"mt-2",type:"danger",children:n.errorMessage})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const b3=po({prevent:!1,actionKey:void 0}),EFe=po({lastLocation:"",nonPreventedLocations:[]});function mwt(){const n=ol(),e=Ri(hfe),[t,i]=Mo(b3),[r,o]=Mo(EFe);w.useEffect(()=>{const s=c=>{if(t.prevent&&t.actionKey!=="switchCompany")return c.preventDefault(),!0},a=r.lastLocation!==window.location.href;a&&t.prevent&&(o(c=>({...c,lastLocation:window.location.href})),history.pushState(null,document.title,window.location.href));const l=()=>{t.prevent&&(a&&history.pushState(null,document.title,window.location.href),i(c=>c&&{...c,actionKey:"browserBack"}),e(!0))};return window.addEventListener("popstate",l),window.addEventListener("beforeunload",s),()=>{window.removeEventListener("popstate",l),window.removeEventListener("beforeunload",s)}},[t]),w.useEffect(()=>{!t.prevent&&o(s=>({...s,nonPreventedLocations:[...s.nonPreventedLocations,n.pathname]}))},[n])}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const hfe=po(!1),xFe=po(void 0);function Y2(n){const{disablePrevention:e}=n||{},t=ri(),[i,r]=Mo(b3),o=Ri(hfe),s=Ri(xFe);return({url:a,externalLink:l=!1,fn:c,actionKey:u})=>(i.prevent&&!e?(s({url:a,externalLink:l,fn:c}),r(d=>d&&{...d,actionKey:u}),o(!0)):(a&&(l?window.open(a,"_blank"):t(a)),c==null||c()),i.prevent)}function Ii(n){const e=ys(),{prevent:t}=ki(b3),i=Y2(),{withoutDefaultStyling:r,setBaseFont:o}=n,s={color:e};return n.external?f("a",{target:"_blank",href:n.to,className:St(`text-center ${n.className}`,{"text-sm":!o,"text-base":o,"hover:underline":!r}),style:r?void 0:s,rel:"noreferrer",onClick:a=>{t&&(a.preventDefault(),i({url:n.to,externalLink:!0}))},children:n.children}):f(E0,{className:St(`${n.className}`,{"text-sm":!o,"text-base":o,"hover:underline":!r}),style:r?void 0:s,to:n.to,onClick:a=>{t&&(a.preventDefault(),i({url:n.to}))},children:n.children})}function kFe(n){const e=ys();return N("fieldset",{children:[f("legend",{className:"sr-only",children:"Notification method"}),f("div",{className:"space-y-4 sm:flex sm:items-center sm:space-y-0 sm:space-x-10",children:n.options.map(t=>N("div",{className:"flex items-center",onChange:i=>{var r;return(r=n.onValueChange)==null?void 0:r.call(n,i.target.value)},children:[f("input",{value:t.value,onClick:n.onClick,onChange:()=>{},disabled:n.disabled,id:t.id,name:n.name,type:"radio",checked:t.value===n.defaultSelected,className:"focus:ring-gray-500 h-4 w-4 border-gray-300 disabled:opacity-75 disabled:cursor-not-allowed",style:{color:e}}),f("label",{htmlFor:t.id,className:St("ml-3 block text-sm font-medium",{"opacity-75 cursor-not-allowed":n.disabled,"cursor-pointer":typeof n.disabled>"u"||!n.disabled}),children:t.title})]},t.id))})]})}var _wt=Object.defineProperty,vwt=(n,e,t)=>e in n?_wt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,aQ=(n,e,t)=>(vwt(n,typeof e!="symbol"?e+"":e,t),t);let bwt=class{constructor(){aQ(this,"current",this.detect()),aQ(this,"handoffState","pending"),aQ(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},qy=new bwt,Gs=(n,e)=>{qy.isServer?w.useEffect(n,e):w.useLayoutEffect(n,e)};function ug(n){let e=w.useRef(n);return Gs(()=>{e.current=n},[n]),e}function ffe(n,e){let[t,i]=w.useState(n),r=ug(n);return Gs(()=>i(r.current),[r,i,...e]),t}function Bz(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(e=>setTimeout(()=>{throw e}))}function Cg(){let n=[],e={addEventListener(t,i,r,o){return t.addEventListener(i,r,o),e.add(()=>t.removeEventListener(i,r,o))},requestAnimationFrame(...t){let i=requestAnimationFrame(...t);return e.add(()=>cancelAnimationFrame(i))},nextFrame(...t){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...t))},setTimeout(...t){let i=setTimeout(...t);return e.add(()=>clearTimeout(i))},microTask(...t){let i={current:!0};return Bz(()=>{i.current&&t[0]()}),e.add(()=>{i.current=!1})},style(t,i,r){let o=t.style.getPropertyValue(i);return Object.assign(t.style,{[i]:r}),this.add(()=>{Object.assign(t.style,{[i]:o})})},group(t){let i=Cg();return t(i),this.add(()=>i.dispose())},add(t){return n.push(t),()=>{let i=n.indexOf(t);if(i>=0)for(let r of n.splice(i,1))r()}},dispose(){for(let t of n.splice(0))t()}};return e}function k0(){let[n]=w.useState(Cg);return w.useEffect(()=>()=>n.dispose(),[n]),n}let An=function(n){let e=ug(n);return te.useCallback((...t)=>e.current(...t),[e])};function ywt(){let n=typeof document>"u";return"useSyncExternalStore"in Rp?(e=>e.useSyncExternalStore)(Rp)(()=>()=>{},()=>!1,()=>!n):!1}function Q2(){let n=ywt(),[e,t]=w.useState(qy.isHandoffComplete);return e&&qy.isHandoffComplete===!1&&t(!1),w.useEffect(()=>{e!==!0&&t(!0)},[e]),w.useEffect(()=>qy.handoff(),[]),n?!1:e}var CSe;let Sl=(CSe=te.useId)!=null?CSe:function(){let n=Q2(),[e,t]=te.useState(n?()=>qy.nextId():null);return Gs(()=>{e===null&&t(qy.nextId())},[e]),e!=null?""+e:void 0};function cs(n,e,...t){if(n in e){let r=e[n];return typeof r=="function"?r(...t):r}let i=new Error(`Tried to handle "${n}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(r=>`"${r}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,cs),i}function y3(n){return qy.isServer?null:n instanceof Node?n.ownerDocument:n!=null&&n.hasOwnProperty("current")&&n.current instanceof Node?n.current.ownerDocument:document}let vne=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(n=>`${n}:not([tabindex='-1'])`).join(",");var Ou=(n=>(n[n.First=1]="First",n[n.Previous=2]="Previous",n[n.Next=4]="Next",n[n.Last=8]="Last",n[n.WrapAround=16]="WrapAround",n[n.NoScroll=32]="NoScroll",n))(Ou||{}),$P=(n=>(n[n.Error=0]="Error",n[n.Overflow=1]="Overflow",n[n.Success=2]="Success",n[n.Underflow=3]="Underflow",n))($P||{}),Cwt=(n=>(n[n.Previous=-1]="Previous",n[n.Next=1]="Next",n))(Cwt||{});function C3(n=document.body){return n==null?[]:Array.from(n.querySelectorAll(vne)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var $z=(n=>(n[n.Strict=0]="Strict",n[n.Loose=1]="Loose",n))($z||{});function Vz(n,e=0){var t;return n===((t=y3(n))==null?void 0:t.body)?!1:cs(e,{0(){return n.matches(vne)},1(){let i=n;for(;i!==null;){if(i.matches(vne))return!0;i=i.parentElement}return!1}})}function TFe(n){let e=y3(n);Cg().nextFrame(()=>{e&&!Vz(e.activeElement,0)&&bC(n)})}var wwt=(n=>(n[n.Keyboard=0]="Keyboard",n[n.Mouse=1]="Mouse",n))(wwt||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",n=>{n.metaKey||n.altKey||n.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",n=>{n.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:n.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function bC(n){n==null||n.focus({preventScroll:!0})}let Swt=["textarea","input"].join(",");function Ewt(n){var e,t;return(t=(e=n==null?void 0:n.matches)==null?void 0:e.call(n,Swt))!=null?t:!1}function gfe(n,e=t=>t){return n.slice().sort((t,i)=>{let r=e(t),o=e(i);if(r===null||o===null)return 0;let s=r.compareDocumentPosition(o);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function xwt(n,e){return pp(C3(),e,{relativeTo:n})}function pp(n,e,{sorted:t=!0,relativeTo:i=null,skipElements:r=[]}={}){let o=Array.isArray(n)?n.length>0?n[0].ownerDocument:document:n.ownerDocument,s=Array.isArray(n)?t?gfe(n):n:C3(n);r.length>0&&s.length>1&&(s=s.filter(g=>!r.includes(g))),i=i??o.activeElement;let a=(()=>{if(e&5)return 1;if(e&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(e&1)return 0;if(e&2)return Math.max(0,s.indexOf(i))-1;if(e&4)return Math.max(0,s.indexOf(i))+1;if(e&8)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=e&32?{preventScroll:!0}:{},u=0,d=s.length,h;do{if(u>=d||u+d<=0)return 0;let g=l+u;if(e&16)g=(g+d)%d;else{if(g<0)return 3;if(g>=d)return 1}h=s[g],h==null||h.focus(c),u+=a}while(h!==o.activeElement);return e&6&&Ewt(h)&&h.select(),2}function v6(n,e,t){let i=ug(e);w.useEffect(()=>{function r(o){i.current(o)}return document.addEventListener(n,r,t),()=>document.removeEventListener(n,r,t)},[n,t])}function IFe(n,e,t){let i=ug(e);w.useEffect(()=>{function r(o){i.current(o)}return window.addEventListener(n,r,t),()=>window.removeEventListener(n,r,t)},[n,t])}function Hz(n,e,t=!0){let i=w.useRef(!1);w.useEffect(()=>{requestAnimationFrame(()=>{i.current=t})},[t]);function r(s,a){if(!i.current||s.defaultPrevented)return;let l=a(s);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let c=function u(d){return typeof d=="function"?u(d()):Array.isArray(d)||d instanceof Set?d:[d]}(n);for(let u of c){if(u===null)continue;let d=u instanceof HTMLElement?u:u.current;if(d!=null&&d.contains(l)||s.composed&&s.composedPath().includes(d))return}return!Vz(l,$z.Loose)&&l.tabIndex!==-1&&s.preventDefault(),e(s,l)}let o=w.useRef(null);v6("pointerdown",s=>{var a,l;i.current&&(o.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),v6("mousedown",s=>{var a,l;i.current&&(o.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),v6("click",s=>{o.current&&(r(s,()=>o.current),o.current=null)},!0),v6("touchend",s=>r(s,()=>s.target instanceof HTMLElement?s.target:null),!0),IFe("blur",s=>r(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function wSe(n){var e;if(n.type)return n.type;let t=(e=n.as)!=null?e:"button";if(typeof t=="string"&&t.toLowerCase()==="button")return"button"}function Wz(n,e){let[t,i]=w.useState(()=>wSe(n));return Gs(()=>{i(wSe(n))},[n.type,n.as]),Gs(()=>{t||e.current&&e.current instanceof HTMLButtonElement&&!e.current.hasAttribute("type")&&i("button")},[t,e]),t}let LFe=Symbol();function DFe(n,e=!0){return Object.assign(n,{[LFe]:e})}function Xs(...n){let e=w.useRef(n);w.useEffect(()=>{e.current=n},[n]);let t=An(i=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(i):r.current=i)});return n.every(i=>i==null||(i==null?void 0:i[LFe]))?void 0:t}function AFe({container:n,accept:e,walk:t,enabled:i=!0}){let r=w.useRef(e),o=w.useRef(t);w.useEffect(()=>{r.current=e,o.current=t},[e,t]),Gs(()=>{if(!n||!i)return;let s=y3(n);if(!s)return;let a=r.current,l=o.current,c=Object.assign(d=>a(d),{acceptNode:a}),u=s.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,c,!1);for(;u.nextNode();)l(u.currentNode)},[n,i,r,o])}function kwt(n){throw new Error("Unexpected object: "+n)}var ra=(n=>(n[n.First=0]="First",n[n.Previous=1]="Previous",n[n.Next=2]="Next",n[n.Last=3]="Last",n[n.Specific=4]="Specific",n[n.Nothing=5]="Nothing",n))(ra||{});function RFe(n,e){let t=e.resolveItems();if(t.length<=0)return null;let i=e.resolveActiveIndex(),r=i??-1,o=(()=>{switch(n.focus){case 0:return t.findIndex(s=>!e.resolveDisabled(s));case 1:{let s=t.slice().reverse().findIndex((a,l,c)=>r!==-1&&c.length-l-1>=r?!1:!e.resolveDisabled(a));return s===-1?s:t.length-1-s}case 2:return t.findIndex((s,a)=>a<=r?!1:!e.resolveDisabled(s));case 3:{let s=t.slice().reverse().findIndex(a=>!e.resolveDisabled(a));return s===-1?s:t.length-1-s}case 4:return t.findIndex(s=>e.resolveId(s)===n.id);case 5:return null;default:kwt(n)}})();return o===-1?i:o}function _7(...n){return Array.from(new Set(n.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}var Vp=(n=>(n[n.None=0]="None",n[n.RenderStrategy=1]="RenderStrategy",n[n.Static=2]="Static",n))(Vp||{}),H1=(n=>(n[n.Unmount=0]="Unmount",n[n.Hidden=1]="Hidden",n))(H1||{});function Cs({ourProps:n,theirProps:e,slot:t,defaultTag:i,features:r,visible:o=!0,name:s}){let a=NFe(e,n);if(o)return b6(a,t,i,s);let l=r??0;if(l&2){let{static:c=!1,...u}=a;if(c)return b6(u,t,i,s)}if(l&1){let{unmount:c=!0,...u}=a;return cs(c?0:1,{0(){return null},1(){return b6({...u,hidden:!0,style:{display:"none"}},t,i,s)}})}return b6(a,t,i,s)}function b6(n,e={},t,i){let{as:r=t,children:o,refName:s="ref",...a}=lQ(n,["unmount","static"]),l=n.ref!==void 0?{[s]:n.ref}:{},c=typeof o=="function"?o(e):o;"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(e));let u={};if(e){let d=!1,h=[];for(let[g,p]of Object.entries(e))typeof p=="boolean"&&(d=!0),p===!0&&h.push(g);d&&(u["data-headlessui-state"]=h.join(" "))}if(r===w.Fragment&&Object.keys(v7(a)).length>0){if(!w.isValidElement(c)||Array.isArray(c)&&c.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${i} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(a).map(p=>` - ${p}`).join(`
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(p=>` - ${p}`).join(`
`)].join(`
`));let d=c.props,h=typeof(d==null?void 0:d.className)=="function"?(...p)=>_7(d==null?void 0:d.className(...p),a.className):_7(d==null?void 0:d.className,a.className),g=h?{className:h}:{};return w.cloneElement(c,Object.assign({},NFe(c.props,v7(lQ(a,["ref"]))),u,l,Twt(c.ref,l.ref),g))}return w.createElement(r,Object.assign({},lQ(a,["ref"]),r!==w.Fragment&&l,r!==w.Fragment&&u),c)}function Twt(...n){return{ref:n.every(e=>e==null)?void 0:e=>{for(let t of n)t!=null&&(typeof t=="function"?t(e):t.current=e)}}}function NFe(...n){if(n.length===0)return{};if(n.length===1)return n[0];let e={},t={};for(let i of n)for(let r in i)r.startsWith("on")&&typeof i[r]=="function"?(t[r]!=null||(t[r]=[]),t[r].push(i[r])):e[r]=i[r];if(e.disabled||e["aria-disabled"])return Object.assign(e,Object.fromEntries(Object.keys(t).map(i=>[i,void 0])));for(let i in t)Object.assign(e,{[i](r,...o){let s=t[i];for(let a of s){if((r instanceof Event||(r==null?void 0:r.nativeEvent)instanceof Event)&&r.defaultPrevented)return;a(r,...o)}}});return e}function ws(n){var e;return Object.assign(w.forwardRef(n),{displayName:(e=n.displayName)!=null?e:n.name})}function v7(n){let e=Object.assign({},n);for(let t in e)e[t]===void 0&&delete e[t];return e}function lQ(n,e=[]){let t=Object.assign({},n);for(let i of e)i in t&&delete t[i];return t}function X2(n){let e=n.parentElement,t=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(t=e),e=e.parentElement;let i=(e==null?void 0:e.getAttribute("disabled"))==="";return i&&Iwt(t)?!1:i}function Iwt(n){if(!n)return!1;let e=n.previousElementSibling;for(;e!==null;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}function OFe(n={},e=null,t=[]){for(let[i,r]of Object.entries(n))MFe(t,PFe(e,i),r);return t}function PFe(n,e){return n?n+"["+e+"]":e}function MFe(n,e,t){if(Array.isArray(t))for(let[i,r]of t.entries())MFe(n,PFe(e,i.toString()),r);else t instanceof Date?n.push([e,t.toISOString()]):typeof t=="boolean"?n.push([e,t?"1":"0"]):typeof t=="string"?n.push([e,t]):typeof t=="number"?n.push([e,`${t}`]):t==null?n.push([e,""]):OFe(t,e,n)}function Lwt(n){var e,t;let i=(e=n==null?void 0:n.form)!=null?e:n.closest("form");if(i){for(let r of i.elements)if(r!==n&&(r.tagName==="INPUT"&&r.type==="submit"||r.tagName==="BUTTON"&&r.type==="submit"||r.nodeName==="INPUT"&&r.type==="image")){r.click();return}(t=i.requestSubmit)==null||t.call(i)}}let Dwt="div";var nb=(n=>(n[n.None=1]="None",n[n.Focusable=2]="Focusable",n[n.Hidden=4]="Hidden",n))(nb||{});function Awt(n,e){let{features:t=1,...i}=n,r={ref:e,"aria-hidden":(t&2)===2?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(t&4)===4&&(t&2)!==2&&{display:"none"}}};return Cs({ourProps:r,theirProps:i,slot:{},defaultTag:Dwt,name:"Hidden"})}let g0=ws(Awt),pfe=w.createContext(null);pfe.displayName="OpenClosedContext";var sa=(n=>(n[n.Open=1]="Open",n[n.Closed=2]="Closed",n[n.Closing=4]="Closing",n[n.Opening=8]="Opening",n))(sa||{});function _k(){return w.useContext(pfe)}function zz({value:n,children:e}){return te.createElement(pfe.Provider,{value:n},e)}var ro=(n=>(n.Space=" ",n.Enter="Enter",n.Escape="Escape",n.Backspace="Backspace",n.Delete="Delete",n.ArrowLeft="ArrowLeft",n.ArrowUp="ArrowUp",n.ArrowRight="ArrowRight",n.ArrowDown="ArrowDown",n.Home="Home",n.End="End",n.PageUp="PageUp",n.PageDown="PageDown",n.Tab="Tab",n))(ro||{});function FFe(n,e,t){let[i,r]=w.useState(t),o=n!==void 0,s=w.useRef(o),a=w.useRef(!1),l=w.useRef(!1);return o&&!s.current&&!a.current?(a.current=!0,s.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!o&&s.current&&!l.current&&(l.current=!0,s.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[o?n:i,An(c=>(o||r(c),e==null?void 0:e(c)))]}function VP(n,e){let t=w.useRef([]),i=An(n);w.useEffect(()=>{let r=[...t.current];for(let[o,s]of e.entries())if(t.current[o]!==s){let a=i(e,r);return t.current=e,a}},[i,...e])}function SSe(n){return[n.screenX,n.screenY]}function BFe(){let n=w.useRef([-1,-1]);return{wasMoved(e){let t=SSe(e);return n.current[0]===t[0]&&n.current[1]===t[1]?!1:(n.current=t,!0)},update(e){n.current=SSe(e)}}}function $Fe(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Rwt(){return/Android/gi.test(window.navigator.userAgent)}function Nwt(){return $Fe()||Rwt()}function Cb(...n){return w.useMemo(()=>y3(...n),[...n])}var Owt=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(Owt||{}),Pwt=(n=>(n[n.Single=0]="Single",n[n.Multi=1]="Multi",n))(Pwt||{}),Mwt=(n=>(n[n.Pointer=0]="Pointer",n[n.Other=1]="Other",n))(Mwt||{}),Fwt=(n=>(n[n.OpenCombobox=0]="OpenCombobox",n[n.CloseCombobox=1]="CloseCombobox",n[n.GoToOption=2]="GoToOption",n[n.RegisterOption=3]="RegisterOption",n[n.UnregisterOption=4]="UnregisterOption",n[n.RegisterLabel=5]="RegisterLabel",n))(Fwt||{});function cQ(n,e=t=>t){let t=n.activeOptionIndex!==null?n.options[n.activeOptionIndex]:null,i=gfe(e(n.options.slice()),o=>o.dataRef.current.domRef.current),r=t?i.indexOf(t):null;return r===-1&&(r=null),{options:i,activeOptionIndex:r}}let Bwt={1(n){var e;return(e=n.dataRef.current)!=null&&e.disabled||n.comboboxState===1?n:{...n,activeOptionIndex:null,comboboxState:1}},0(n){var e;if((e=n.dataRef.current)!=null&&e.disabled||n.comboboxState===0)return n;let t=n.activeOptionIndex;if(n.dataRef.current){let{isSelected:i}=n.dataRef.current,r=n.options.findIndex(o=>i(o.dataRef.current.value));r!==-1&&(t=r)}return{...n,comboboxState:0,activeOptionIndex:t}},2(n,e){var t,i,r,o;if((t=n.dataRef.current)!=null&&t.disabled||(i=n.dataRef.current)!=null&&i.optionsRef.current&&!((r=n.dataRef.current)!=null&&r.optionsPropsRef.current.static)&&n.comboboxState===1)return n;let s=cQ(n);if(s.activeOptionIndex===null){let l=s.options.findIndex(c=>!c.dataRef.current.disabled);l!==-1&&(s.activeOptionIndex=l)}let a=RFe(e,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:l=>l.id,resolveDisabled:l=>l.dataRef.current.disabled});return{...n,...s,activeOptionIndex:a,activationTrigger:(o=e.trigger)!=null?o:1}},3:(n,e)=>{var t,i;let r={id:e.id,dataRef:e.dataRef},o=cQ(n,a=>[...a,r]);n.activeOptionIndex===null&&(t=n.dataRef.current)!=null&&t.isSelected(e.dataRef.current.value)&&(o.activeOptionIndex=o.options.indexOf(r));let s={...n,...o,activationTrigger:1};return(i=n.dataRef.current)!=null&&i.__demoMode&&n.dataRef.current.value===void 0&&(s.activeOptionIndex=0),s},4:(n,e)=>{let t=cQ(n,i=>{let r=i.findIndex(o=>o.id===e.id);return r!==-1&&i.splice(r,1),i});return{...n,...t,activationTrigger:1}},5:(n,e)=>({...n,labelId:e.id})},mfe=w.createContext(null);mfe.displayName="ComboboxActionsContext";function w3(n){let e=w.useContext(mfe);if(e===null){let t=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,w3),t}return e}let _fe=w.createContext(null);_fe.displayName="ComboboxDataContext";function Z2(n){let e=w.useContext(_fe);if(e===null){let t=new Error(`<${n} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Z2),t}return e}function $wt(n,e){return cs(e.type,Bwt,n,e)}let Vwt=w.Fragment;function Hwt(n,e){let{value:t,defaultValue:i,onChange:r,form:o,name:s,by:a=(xe,_e)=>xe===_e,disabled:l=!1,__demoMode:c=!1,nullable:u=!1,multiple:d=!1,...h}=n,[g=d?[]:void 0,p]=FFe(t,r,i),[m,_]=w.useReducer($wt,{dataRef:w.createRef(),comboboxState:c?0:1,options:[],activeOptionIndex:null,activationTrigger:1,labelId:null}),v=w.useRef(!1),b=w.useRef({static:!1,hold:!1}),y=w.useRef(null),C=w.useRef(null),x=w.useRef(null),k=w.useRef(null),I=An(typeof a=="string"?(xe,_e)=>{let Ie=a;return(xe==null?void 0:xe[Ie])===(_e==null?void 0:_e[Ie])}:a),L=w.useCallback(xe=>cs(D.mode,{1:()=>g.some(_e=>I(_e,xe)),0:()=>I(g,xe)}),[g]),D=w.useMemo(()=>({...m,optionsPropsRef:b,labelRef:y,inputRef:C,buttonRef:x,optionsRef:k,value:g,defaultValue:i,disabled:l,mode:d?1:0,get activeOptionIndex(){if(v.current&&m.activeOptionIndex===null&&m.options.length>0){let xe=m.options.findIndex(_e=>!_e.dataRef.current.disabled);if(xe!==-1)return xe}return m.activeOptionIndex},compare:I,isSelected:L,nullable:u,__demoMode:c}),[g,i,l,d,u,c,m]),R=w.useRef(D.activeOptionIndex!==null?D.options[D.activeOptionIndex]:null);w.useEffect(()=>{let xe=D.activeOptionIndex!==null?D.options[D.activeOptionIndex]:null;R.current!==xe&&(R.current=xe)}),Gs(()=>{m.dataRef.current=D},[D]),Hz([D.buttonRef,D.inputRef,D.optionsRef],()=>Y.closeCombobox(),D.comboboxState===0);let P=w.useMemo(()=>({open:D.comboboxState===0,disabled:l,activeIndex:D.activeOptionIndex,activeOption:D.activeOptionIndex===null?null:D.options[D.activeOptionIndex].dataRef.current.value,value:g}),[D,l,g]),M=An(xe=>{let _e=D.options.find(Ie=>Ie.id===xe);_e&&j(_e.dataRef.current.value)}),O=An(()=>{if(D.activeOptionIndex!==null){let{dataRef:xe,id:_e}=D.options[D.activeOptionIndex];j(xe.current.value),Y.goToOption(ra.Specific,_e)}}),B=An(()=>{_({type:0}),v.current=!0}),F=An(()=>{_({type:1}),v.current=!1}),H=An((xe,_e,Ie)=>(v.current=!1,xe===ra.Specific?_({type:2,focus:ra.Specific,id:_e,trigger:Ie}):_({type:2,focus:xe,trigger:Ie}))),V=An((xe,_e)=>(_({type:3,id:xe,dataRef:_e}),()=>{var Ie;((Ie=R.current)==null?void 0:Ie.id)===xe&&(v.current=!0),_({type:4,id:xe})})),$=An(xe=>(_({type:5,id:xe}),()=>_({type:5,id:null}))),j=An(xe=>cs(D.mode,{0(){return p==null?void 0:p(xe)},1(){let _e=D.value.slice(),Ie=_e.findIndex(Re=>I(Re,xe));return Ie===-1?_e.push(xe):_e.splice(Ie,1),p==null?void 0:p(_e)}})),Y=w.useMemo(()=>({onChange:j,registerOption:V,registerLabel:$,goToOption:H,closeCombobox:F,openCombobox:B,selectActiveOption:O,selectOption:M}),[]),ne=e===null?{}:{ref:e},se=w.useRef(null),he=k0();return w.useEffect(()=>{se.current&&i!==void 0&&he.addEventListener(se.current,"reset",()=>{p==null||p(i)})},[se,p]),te.createElement(mfe.Provider,{value:Y},te.createElement(_fe.Provider,{value:D},te.createElement(zz,{value:cs(D.comboboxState,{0:sa.Open,1:sa.Closed})},s!=null&&g!=null&&OFe({[s]:g}).map(([xe,_e],Ie)=>te.createElement(g0,{features:nb.Hidden,ref:Ie===0?Re=>{var Ye;se.current=(Ye=Re==null?void 0:Re.closest("form"))!=null?Ye:null}:void 0,...v7({key:xe,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:o,name:xe,value:_e})})),Cs({ourProps:ne,theirProps:h,slot:P,defaultTag:Vwt,name:"Combobox"}))))}let Wwt="input";function zwt(n,e){var t,i,r,o;let s=Sl(),{id:a=`headlessui-combobox-input-${s}`,onChange:l,displayValue:c,type:u="text",...d}=n,h=Z2("Combobox.Input"),g=w3("Combobox.Input"),p=Xs(h.inputRef,e),m=Cb(h.inputRef),_=w.useRef(!1),v=k0(),b=An(()=>{g.onChange(null),h.optionsRef.current&&(h.optionsRef.current.scrollTop=0),g.goToOption(ra.Nothing)}),y=function(){var O;return typeof c=="function"&&h.value!==void 0?(O=c(h.value))!=null?O:"":typeof h.value=="string"?h.value:""}();VP(([O,B],[F,H])=>{if(_.current)return;let V=h.inputRef.current;V&&((H===0&&B===1||O!==F)&&(V.value=O),requestAnimationFrame(()=>{if(_.current||!V||(m==null?void 0:m.activeElement)!==V)return;let{selectionStart:$,selectionEnd:j}=V;Math.abs((j??0)-($??0))===0&&$===0&&V.setSelectionRange(V.value.length,V.value.length)}))},[y,h.comboboxState,m]),VP(([O],[B])=>{if(O===0&&B===1){if(_.current)return;let F=h.inputRef.current;if(!F)return;let H=F.value,{selectionStart:V,selectionEnd:$,selectionDirection:j}=F;F.value="",F.value=H,j!==null?F.setSelectionRange(V,$,j):F.setSelectionRange(V,$)}},[h.comboboxState]);let C=w.useRef(!1),x=An(()=>{C.current=!0}),k=An(()=>{v.nextFrame(()=>{C.current=!1})}),I=An(O=>{switch(_.current=!0,O.key){case ro.Enter:if(_.current=!1,h.comboboxState!==0||C.current)return;if(O.preventDefault(),O.stopPropagation(),h.activeOptionIndex===null){g.closeCombobox();return}g.selectActiveOption(),h.mode===0&&g.closeCombobox();break;case ro.ArrowDown:return _.current=!1,O.preventDefault(),O.stopPropagation(),cs(h.comboboxState,{0:()=>{g.goToOption(ra.Next)},1:()=>{g.openCombobox()}});case ro.ArrowUp:return _.current=!1,O.preventDefault(),O.stopPropagation(),cs(h.comboboxState,{0:()=>{g.goToOption(ra.Previous)},1:()=>{g.openCombobox(),v.nextFrame(()=>{h.value||g.goToOption(ra.Last)})}});case ro.Home:if(O.shiftKey)break;return _.current=!1,O.preventDefault(),O.stopPropagation(),g.goToOption(ra.First);case ro.PageUp:return _.current=!1,O.preventDefault(),O.stopPropagation(),g.goToOption(ra.First);case ro.End:if(O.shiftKey)break;return _.current=!1,O.preventDefault(),O.stopPropagation(),g.goToOption(ra.Last);case ro.PageDown:return _.current=!1,O.preventDefault(),O.stopPropagation(),g.goToOption(ra.Last);case ro.Escape:return _.current=!1,h.comboboxState!==0?void 0:(O.preventDefault(),h.optionsRef.current&&!h.optionsPropsRef.current.static&&O.stopPropagation(),h.nullable&&h.mode===0&&h.value===null&&b(),g.closeCombobox());case ro.Tab:if(_.current=!1,h.comboboxState!==0)return;h.mode===0&&g.selectActiveOption(),g.closeCombobox();break}}),L=An(O=>{l==null||l(O),h.nullable&&h.mode===0&&O.target.value===""&&b(),g.openCombobox()}),D=An(()=>{_.current=!1}),R=ffe(()=>{if(h.labelId)return[h.labelId].join(" ")},[h.labelId]),P=w.useMemo(()=>({open:h.comboboxState===0,disabled:h.disabled}),[h]),M={ref:p,id:a,role:"combobox",type:u,"aria-controls":(t=h.optionsRef.current)==null?void 0:t.id,"aria-expanded":h.comboboxState===0,"aria-activedescendant":h.activeOptionIndex===null||(i=h.options[h.activeOptionIndex])==null?void 0:i.id,"aria-labelledby":R,"aria-autocomplete":"list",defaultValue:(o=(r=n.defaultValue)!=null?r:h.defaultValue!==void 0?c==null?void 0:c(h.defaultValue):null)!=null?o:h.defaultValue,disabled:h.disabled,onCompositionStart:x,onCompositionEnd:k,onKeyDown:I,onChange:L,onBlur:D};return Cs({ourProps:M,theirProps:d,slot:P,defaultTag:Wwt,name:"Combobox.Input"})}let jwt="button";function Uwt(n,e){var t;let i=Z2("Combobox.Button"),r=w3("Combobox.Button"),o=Xs(i.buttonRef,e),s=Sl(),{id:a=`headlessui-combobox-button-${s}`,...l}=n,c=k0(),u=An(m=>{switch(m.key){case ro.ArrowDown:return m.preventDefault(),m.stopPropagation(),i.comboboxState===1&&r.openCombobox(),c.nextFrame(()=>{var _;return(_=i.inputRef.current)==null?void 0:_.focus({preventScroll:!0})});case ro.ArrowUp:return m.preventDefault(),m.stopPropagation(),i.comboboxState===1&&(r.openCombobox(),c.nextFrame(()=>{i.value||r.goToOption(ra.Last)})),c.nextFrame(()=>{var _;return(_=i.inputRef.current)==null?void 0:_.focus({preventScroll:!0})});case ro.Escape:return i.comboboxState!==0?void 0:(m.preventDefault(),i.optionsRef.current&&!i.optionsPropsRef.current.static&&m.stopPropagation(),r.closeCombobox(),c.nextFrame(()=>{var _;return(_=i.inputRef.current)==null?void 0:_.focus({preventScroll:!0})}));default:return}}),d=An(m=>{if(X2(m.currentTarget))return m.preventDefault();i.comboboxState===0?r.closeCombobox():(m.preventDefault(),r.openCombobox()),c.nextFrame(()=>{var _;return(_=i.inputRef.current)==null?void 0:_.focus({preventScroll:!0})})}),h=ffe(()=>{if(i.labelId)return[i.labelId,a].join(" ")},[i.labelId,a]),g=w.useMemo(()=>({open:i.comboboxState===0,disabled:i.disabled,value:i.value}),[i]),p={ref:o,id:a,type:Wz(n,i.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(t=i.optionsRef.current)==null?void 0:t.id,"aria-expanded":i.comboboxState===0,"aria-labelledby":h,disabled:i.disabled,onClick:d,onKeyDown:u};return Cs({ourProps:p,theirProps:l,slot:g,defaultTag:jwt,name:"Combobox.Button"})}let qwt="label";function Kwt(n,e){let t=Sl(),{id:i=`headlessui-combobox-label-${t}`,...r}=n,o=Z2("Combobox.Label"),s=w3("Combobox.Label"),a=Xs(o.labelRef,e);Gs(()=>s.registerLabel(i),[i]);let l=An(()=>{var u;return(u=o.inputRef.current)==null?void 0:u.focus({preventScroll:!0})}),c=w.useMemo(()=>({open:o.comboboxState===0,disabled:o.disabled}),[o]);return Cs({ourProps:{ref:a,id:i,onClick:l},theirProps:r,slot:c,defaultTag:qwt,name:"Combobox.Label"})}let Gwt="ul",Ywt=Vp.RenderStrategy|Vp.Static;function Qwt(n,e){let t=Sl(),{id:i=`headlessui-combobox-options-${t}`,hold:r=!1,...o}=n,s=Z2("Combobox.Options"),a=Xs(s.optionsRef,e),l=_k(),c=(()=>l!==null?(l&sa.Open)===sa.Open:s.comboboxState===0)();Gs(()=>{var g;s.optionsPropsRef.current.static=(g=n.static)!=null?g:!1},[s.optionsPropsRef,n.static]),Gs(()=>{s.optionsPropsRef.current.hold=r},[s.optionsPropsRef,r]),AFe({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(g){return g.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:g.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(g){g.setAttribute("role","none")}});let u=ffe(()=>{var g,p;return(p=s.labelId)!=null?p:(g=s.buttonRef.current)==null?void 0:g.id},[s.labelId,s.buttonRef.current]),d=w.useMemo(()=>({open:s.comboboxState===0}),[s]),h={"aria-labelledby":u,role:"listbox","aria-multiselectable":s.mode===1?!0:void 0,id:i,ref:a};return Cs({ourProps:h,theirProps:o,slot:d,defaultTag:Gwt,features:Ywt,visible:c,name:"Combobox.Options"})}let Xwt="li";function Zwt(n,e){var t,i;let r=Sl(),{id:o=`headlessui-combobox-option-${r}`,disabled:s=!1,value:a,...l}=n,c=Z2("Combobox.Option"),u=w3("Combobox.Option"),d=c.activeOptionIndex!==null?c.options[c.activeOptionIndex].id===o:!1,h=c.isSelected(a),g=w.useRef(null),p=ug({disabled:s,value:a,domRef:g,textValue:(i=(t=g.current)==null?void 0:t.textContent)==null?void 0:i.toLowerCase()}),m=Xs(e,g),_=An(()=>u.selectOption(o));Gs(()=>u.registerOption(o,p),[p,o]);let v=w.useRef(!c.__demoMode);Gs(()=>{if(!c.__demoMode)return;let D=Cg();return D.requestAnimationFrame(()=>{v.current=!0}),D.dispose},[]),Gs(()=>{if(c.comboboxState!==0||!d||!v.current||c.activationTrigger===0)return;let D=Cg();return D.requestAnimationFrame(()=>{var R,P;(P=(R=g.current)==null?void 0:R.scrollIntoView)==null||P.call(R,{block:"nearest"})}),D.dispose},[g,d,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let b=An(D=>{if(s)return D.preventDefault();_(),c.mode===0&&u.closeCombobox(),Nwt()||requestAnimationFrame(()=>{var R;return(R=c.inputRef.current)==null?void 0:R.focus()})}),y=An(()=>{if(s)return u.goToOption(ra.Nothing);u.goToOption(ra.Specific,o)}),C=BFe(),x=An(D=>C.update(D)),k=An(D=>{C.wasMoved(D)&&(s||d||u.goToOption(ra.Specific,o,0))}),I=An(D=>{C.wasMoved(D)&&(s||d&&(c.optionsPropsRef.current.hold||u.goToOption(ra.Nothing)))}),L=w.useMemo(()=>({active:d,selected:h,disabled:s}),[d,h,s]);return Cs({ourProps:{id:o,ref:m,role:"option",tabIndex:s===!0?void 0:-1,"aria-disabled":s===!0?!0:void 0,"aria-selected":h,disabled:void 0,onClick:b,onFocus:y,onPointerEnter:x,onMouseEnter:x,onPointerMove:k,onMouseMove:k,onPointerLeave:I,onMouseLeave:I},theirProps:l,slot:L,defaultTag:Xwt,name:"Combobox.Option"})}let Jwt=ws(Hwt),eSt=ws(Uwt),tSt=ws(zwt),nSt=ws(Kwt),iSt=ws(Qwt),rSt=ws(Zwt),Hm=Object.assign(Jwt,{Input:tSt,Button:eSt,Label:nSt,Options:iSt,Option:rSt});var Jf=(n=>(n[n.Forwards=0]="Forwards",n[n.Backwards=1]="Backwards",n))(Jf||{});function vfe(){let n=w.useRef(0);return IFe("keydown",e=>{e.key==="Tab"&&(n.current=e.shiftKey?1:0)},!0),n}function S3(){let n=w.useRef(!1);return Gs(()=>(n.current=!0,()=>{n.current=!1}),[]),n}function bfe(n,e,t,i){let r=ug(t);w.useEffect(()=>{n=n??window;function o(s){r.current(s)}return n.addEventListener(e,o,i),()=>n.removeEventListener(e,o,i)},[n,e,i])}function oSt(n){function e(){document.readyState!=="loading"&&(n(),document.removeEventListener("DOMContentLoaded",e))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}function VFe(n){let e=An(n),t=w.useRef(!1);w.useEffect(()=>(t.current=!1,()=>{t.current=!0,Bz(()=>{t.current&&e()})}),[e])}function HFe(n){if(!n)return new Set;if(typeof n=="function")return new Set(n());let e=new Set;for(let t of n.current)t.current instanceof HTMLElement&&e.add(t.current);return e}let sSt="div";var WFe=(n=>(n[n.None=1]="None",n[n.InitialFocus=2]="InitialFocus",n[n.TabLock=4]="TabLock",n[n.FocusLock=8]="FocusLock",n[n.RestoreFocus=16]="RestoreFocus",n[n.All=30]="All",n))(WFe||{});function aSt(n,e){let t=w.useRef(null),i=Xs(t,e),{initialFocus:r,containers:o,features:s=30,...a}=n;Q2()||(s=1);let l=Cb(t);uSt({ownerDocument:l},!!(s&16));let c=dSt({ownerDocument:l,container:t,initialFocus:r},!!(s&2));hSt({ownerDocument:l,container:t,containers:o,previousActiveElement:c},!!(s&8));let u=vfe(),d=An(m=>{let _=t.current;_&&(v=>v())(()=>{cs(u.current,{[Jf.Forwards]:()=>{pp(_,Ou.First,{skipElements:[m.relatedTarget]})},[Jf.Backwards]:()=>{pp(_,Ou.Last,{skipElements:[m.relatedTarget]})}})})}),h=k0(),g=w.useRef(!1),p={ref:i,onKeyDown(m){m.key=="Tab"&&(g.current=!0,h.requestAnimationFrame(()=>{g.current=!1}))},onBlur(m){let _=HFe(o);t.current instanceof HTMLElement&&_.add(t.current);let v=m.relatedTarget;v instanceof HTMLElement&&v.dataset.headlessuiFocusGuard!=="true"&&(zFe(_,v)||(g.current?pp(t.current,cs(u.current,{[Jf.Forwards]:()=>Ou.Next,[Jf.Backwards]:()=>Ou.Previous})|Ou.WrapAround,{relativeTo:m.target}):m.target instanceof HTMLElement&&bC(m.target)))}};return te.createElement(te.Fragment,null,!!(s&4)&&te.createElement(g0,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:d,features:nb.Focusable}),Cs({ourProps:p,theirProps:a,defaultTag:sSt,name:"FocusTrap"}),!!(s&4)&&te.createElement(g0,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:d,features:nb.Focusable}))}let lSt=ws(aSt),_R=Object.assign(lSt,{features:WFe}),L1=[];oSt(()=>{function n(e){e.target instanceof HTMLElement&&e.target!==document.body&&L1[0]!==e.target&&(L1.unshift(e.target),L1=L1.filter(t=>t!=null&&t.isConnected),L1.splice(10))}window.addEventListener("click",n,{capture:!0}),window.addEventListener("mousedown",n,{capture:!0}),window.addEventListener("focus",n,{capture:!0}),document.body.addEventListener("click",n,{capture:!0}),document.body.addEventListener("mousedown",n,{capture:!0}),document.body.addEventListener("focus",n,{capture:!0})});function cSt(n=!0){let e=w.useRef(L1.slice());return VP(([t],[i])=>{i===!0&&t===!1&&Bz(()=>{e.current.splice(0)}),i===!1&&t===!0&&(e.current=L1.slice())},[n,L1,e]),An(()=>{var t;return(t=e.current.find(i=>i!=null&&i.isConnected))!=null?t:null})}function uSt({ownerDocument:n},e){let t=cSt(e);VP(()=>{e||(n==null?void 0:n.activeElement)===(n==null?void 0:n.body)&&bC(t())},[e]),VFe(()=>{e&&bC(t())})}function dSt({ownerDocument:n,container:e,initialFocus:t},i){let r=w.useRef(null),o=S3();return VP(()=>{if(!i)return;let s=e.current;s&&Bz(()=>{if(!o.current)return;let a=n==null?void 0:n.activeElement;if(t!=null&&t.current){if((t==null?void 0:t.current)===a){r.current=a;return}}else if(s.contains(a)){r.current=a;return}t!=null&&t.current?bC(t.current):pp(s,Ou.First)===$P.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),r.current=n==null?void 0:n.activeElement})},[i]),r}function hSt({ownerDocument:n,container:e,containers:t,previousActiveElement:i},r){let o=S3();bfe(n==null?void 0:n.defaultView,"focus",s=>{if(!r||!o.current)return;let a=HFe(t);e.current instanceof HTMLElement&&a.add(e.current);let l=i.current;if(!l)return;let c=s.target;c&&c instanceof HTMLElement?zFe(a,c)?(i.current=c,bC(c)):(s.preventDefault(),s.stopPropagation(),bC(l)):bC(i.current)},!0)}function zFe(n,e){for(let t of n)if(t.contains(e))return!0;return!1}let jFe=w.createContext(!1);function fSt(){return w.useContext(jFe)}function bne(n){return te.createElement(jFe.Provider,{value:n.force},n.children)}function gSt(n){let e=fSt(),t=w.useContext(UFe),i=Cb(n),[r,o]=w.useState(()=>{if(!e&&t!==null||qy.isServer)return null;let s=i==null?void 0:i.getElementById("headlessui-portal-root");if(s)return s;if(i===null)return null;let a=i.createElement("div");return a.setAttribute("id","headlessui-portal-root"),i.body.appendChild(a)});return w.useEffect(()=>{r!==null&&(i!=null&&i.body.contains(r)||i==null||i.body.appendChild(r))},[r,i]),w.useEffect(()=>{e||t!==null&&o(t.current)},[t,o,e]),r}let pSt=w.Fragment;function mSt(n,e){let t=n,i=w.useRef(null),r=Xs(DFe(u=>{i.current=u}),e),o=Cb(i),s=gSt(i),[a]=w.useState(()=>{var u;return qy.isServer?null:(u=o==null?void 0:o.createElement("div"))!=null?u:null}),l=w.useContext(yne),c=Q2();return Gs(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),Gs(()=>{if(a&&l)return l.register(a)},[l,a]),VFe(()=>{var u;!s||!a||(a instanceof Node&&s.contains(a)&&s.removeChild(a),s.childNodes.length<=0&&((u=s.parentElement)==null||u.removeChild(s)))}),c?!s||!a?null:Yp.createPortal(Cs({ourProps:{ref:r},theirProps:t,defaultTag:pSt,name:"Portal"}),a):null}let _St=w.Fragment,UFe=w.createContext(null);function vSt(n,e){let{target:t,...i}=n,r={ref:Xs(e)};return te.createElement(UFe.Provider,{value:t},Cs({ourProps:r,theirProps:i,defaultTag:_St,name:"Popover.Group"}))}let yne=w.createContext(null);function qFe(){let n=w.useContext(yne),e=w.useRef([]),t=An(o=>(e.current.push(o),n&&n.register(o),()=>i(o))),i=An(o=>{let s=e.current.indexOf(o);s!==-1&&e.current.splice(s,1),n&&n.unregister(o)}),r=w.useMemo(()=>({register:t,unregister:i,portals:e}),[t,i,e]);return[e,w.useMemo(()=>function({children:o}){return te.createElement(yne.Provider,{value:r},o)},[r])]}let bSt=ws(mSt),ySt=ws(vSt),Cne=Object.assign(bSt,{Group:ySt}),KFe=w.createContext(null);function GFe(){let n=w.useContext(KFe);if(n===null){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,GFe),e}return n}function YFe(){let[n,e]=w.useState([]);return[n.length>0?n.join(" "):void 0,w.useMemo(()=>function(t){let i=An(o=>(e(s=>[...s,o]),()=>e(s=>{let a=s.slice(),l=a.indexOf(o);return l!==-1&&a.splice(l,1),a}))),r=w.useMemo(()=>({register:i,slot:t.slot,name:t.name,props:t.props}),[i,t.slot,t.name,t.props]);return te.createElement(KFe.Provider,{value:r},t.children)},[e])]}let CSt="p";function wSt(n,e){let t=Sl(),{id:i=`headlessui-description-${t}`,...r}=n,o=GFe(),s=Xs(e);Gs(()=>o.register(i),[i,o.register]);let a={ref:s,...o.props,id:i};return Cs({ourProps:a,theirProps:r,slot:o.slot||{},defaultTag:CSt,name:o.name||"Description"})}let SSt=ws(wSt),QFe=Object.assign(SSt,{}),yfe=w.createContext(()=>{});yfe.displayName="StackContext";var wne=(n=>(n[n.Add=0]="Add",n[n.Remove=1]="Remove",n))(wne||{});function ESt(){return w.useContext(yfe)}function xSt({children:n,onUpdate:e,type:t,element:i,enabled:r}){let o=ESt(),s=An((...a)=>{e==null||e(...a),o(...a)});return Gs(()=>{let a=r===void 0||r===!0;return a&&s(0,t,i),()=>{a&&s(1,t,i)}},[s,t,i,r]),te.createElement(yfe.Provider,{value:s},n)}function kSt(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}const TSt=typeof Object.is=="function"?Object.is:kSt,{useState:ISt,useEffect:LSt,useLayoutEffect:DSt,useDebugValue:ASt}=Rp;function RSt(n,e,t){const i=e(),[{inst:r},o]=ISt({inst:{value:i,getSnapshot:e}});return DSt(()=>{r.value=i,r.getSnapshot=e,uQ(r)&&o({inst:r})},[n,i,e]),LSt(()=>(uQ(r)&&o({inst:r}),n(()=>{uQ(r)&&o({inst:r})})),[n]),ASt(i),i}function uQ(n){const e=n.getSnapshot,t=n.value;try{const i=e();return!TSt(t,i)}catch{return!0}}function NSt(n,e,t){return e()}const OSt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",PSt=!OSt,MSt=PSt?NSt:RSt,FSt="useSyncExternalStore"in Rp?(n=>n.useSyncExternalStore)(Rp):MSt;function BSt(n){return FSt(n.subscribe,n.getSnapshot,n.getSnapshot)}function $St(n,e){let t=n(),i=new Set;return{getSnapshot(){return t},subscribe(r){return i.add(r),()=>i.delete(r)},dispatch(r,...o){let s=e[r].call(t,...o);s&&(t=s,i.forEach(a=>a()))}}}function VSt(){let n;return{before({doc:e}){var t;let i=e.documentElement;n=((t=e.defaultView)!=null?t:window).innerWidth-i.clientWidth},after({doc:e,d:t}){let i=e.documentElement,r=i.clientWidth-i.offsetWidth,o=n-r;t.style(i,"paddingRight",`${o}px`)}}}function HSt(){if(!$Fe())return{};let n;return{before(){n=window.pageYOffset},after({doc:e,d:t,meta:i}){function r(o){return i.containers.flatMap(s=>s()).some(s=>s.contains(o))}t.microTask(()=>{if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let s=Cg();s.style(e.documentElement,"scroll-behavior","auto"),t.add(()=>t.microTask(()=>s.dispose()))}t.style(e.body,"marginTop",`-${n}px`),window.scrollTo(0,0);let o=null;t.addEventListener(e,"click",s=>{if(s.target instanceof HTMLElement)try{let a=s.target.closest("a");if(!a)return;let{hash:l}=new URL(a.href),c=e.querySelector(l);c&&!r(c)&&(o=c)}catch{}},!0),t.addEventListener(e,"touchmove",s=>{s.target instanceof HTMLElement&&!r(s.target)&&s.preventDefault()},{passive:!1}),t.add(()=>{window.scrollTo(0,window.pageYOffset+n),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}}function WSt(){return{before({doc:n,d:e}){e.style(n.documentElement,"overflow","hidden")}}}function zSt(n){let e={};for(let t of n)Object.assign(e,t(e));return e}let yE=$St(()=>new Map,{PUSH(n,e){var t;let i=(t=this.get(n))!=null?t:{doc:n,count:0,d:Cg(),meta:new Set};return i.count++,i.meta.add(e),this.set(n,i),this},POP(n,e){let t=this.get(n);return t&&(t.count--,t.meta.delete(e)),this},SCROLL_PREVENT({doc:n,d:e,meta:t}){let i={doc:n,d:e,meta:zSt(t)},r=[HSt(),VSt(),WSt()];r.forEach(({before:o})=>o==null?void 0:o(i)),r.forEach(({after:o})=>o==null?void 0:o(i))},SCROLL_ALLOW({d:n}){n.dispose()},TEARDOWN({doc:n}){this.delete(n)}});yE.subscribe(()=>{let n=yE.getSnapshot(),e=new Map;for(let[t]of n)e.set(t,t.documentElement.style.overflow);for(let t of n.values()){let i=e.get(t.doc)==="hidden",r=t.count!==0;(r&&!i||!r&&i)&&yE.dispatch(t.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",t),t.count===0&&yE.dispatch("TEARDOWN",t)}});function jSt(n,e,t){let i=BSt(yE),r=n?i.get(n):void 0,o=r?r.count>0:!1;return Gs(()=>{if(!(!n||!e))return yE.dispatch("PUSH",n,t),()=>yE.dispatch("POP",n,t)},[e,n]),o}let dQ=new Map,vR=new Map;function ESe(n,e=!0){Gs(()=>{var t;if(!e)return;let i=typeof n=="function"?n():n.current;if(!i)return;function r(){var s;if(!i)return;let a=(s=vR.get(i))!=null?s:1;if(a===1?vR.delete(i):vR.set(i,a-1),a!==1)return;let l=dQ.get(i);l&&(l["aria-hidden"]===null?i.removeAttribute("aria-hidden"):i.setAttribute("aria-hidden",l["aria-hidden"]),i.inert=l.inert,dQ.delete(i))}let o=(t=vR.get(i))!=null?t:0;return vR.set(i,o+1),o!==0||(dQ.set(i,{"aria-hidden":i.getAttribute("aria-hidden"),inert:i.inert}),i.setAttribute("aria-hidden","true"),i.inert=!0),r},[n,e])}function XFe({defaultContainers:n=[],portals:e,mainTreeNodeRef:t}={}){var i;let r=w.useRef((i=t==null?void 0:t.current)!=null?i:null),o=Cb(r),s=An(()=>{var a;let l=[];for(let c of n)c!==null&&(c instanceof HTMLElement?l.push(c):"current"in c&&c.current instanceof HTMLElement&&l.push(c.current));if(e!=null&&e.current)for(let c of e.current)l.push(c);for(let c of(a=o==null?void 0:o.querySelectorAll("html > *, body > *"))!=null?a:[])c!==document.body&&c!==document.head&&c instanceof HTMLElement&&c.id!=="headlessui-portal-root"&&(c.contains(r.current)||l.some(u=>c.contains(u))||l.push(c));return l});return{resolveContainers:s,contains:An(a=>s().some(l=>l.contains(a))),mainTreeNodeRef:r,MainTreeNode:w.useMemo(()=>function(){return t!=null?null:te.createElement(g0,{features:nb.Hidden,ref:r})},[r,t])}}function USt(){let n=w.useRef(null);return{mainTreeNodeRef:n,MainTreeNode:w.useMemo(()=>function(){return te.createElement(g0,{features:nb.Hidden,ref:n})},[n])}}var qSt=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(qSt||{}),KSt=(n=>(n[n.SetTitleId=0]="SetTitleId",n))(KSt||{});let GSt={0(n,e){return n.titleId===e.id?n:{...n,titleId:e.id}}},b7=w.createContext(null);b7.displayName="DialogContext";function E3(n){let e=w.useContext(b7);if(e===null){let t=new Error(`<${n} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,E3),t}return e}function YSt(n,e,t=()=>[document.body]){jSt(n,e,i=>{var r;return{containers:[...(r=i.containers)!=null?r:[],t]}})}function QSt(n,e){return cs(e.type,GSt,n,e)}let XSt="div",ZSt=Vp.RenderStrategy|Vp.Static;function JSt(n,e){var t;let i=Sl(),{id:r=`headlessui-dialog-${i}`,open:o,onClose:s,initialFocus:a,__demoMode:l=!1,...c}=n,[u,d]=w.useState(0),h=_k();o===void 0&&h!==null&&(o=(h&sa.Open)===sa.Open);let g=w.useRef(null),p=Xs(g,e),m=Cb(g),_=n.hasOwnProperty("open")||h!==null,v=n.hasOwnProperty("onClose");if(!_&&!v)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!_)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!v)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof o!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${o}`);if(typeof s!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${s}`);let b=o?0:1,[y,C]=w.useReducer(QSt,{titleId:null,descriptionId:null,panelRef:w.createRef()}),x=An(()=>s(!1)),k=An(Ze=>C({type:0,id:Ze})),I=Q2()?l?!1:b===0:!1,L=u>1,D=w.useContext(b7)!==null,[R,P]=qFe(),{resolveContainers:M,mainTreeNodeRef:O,MainTreeNode:B}=XFe({portals:R,defaultContainers:[(t=y.panelRef.current)!=null?t:g.current]}),F=L?"parent":"leaf",H=h!==null?(h&sa.Closing)===sa.Closing:!1,V=(()=>D||H?!1:I)(),$=w.useCallback(()=>{var Ze,tt;return(tt=Array.from((Ze=m==null?void 0:m.querySelectorAll("body > *"))!=null?Ze:[]).find(Be=>Be.id==="headlessui-portal-root"?!1:Be.contains(O.current)&&Be instanceof HTMLElement))!=null?tt:null},[O]);ESe($,V);let j=(()=>L?!0:I)(),Y=w.useCallback(()=>{var Ze,tt;return(tt=Array.from((Ze=m==null?void 0:m.querySelectorAll("[data-headlessui-portal]"))!=null?Ze:[]).find(Be=>Be.contains(O.current)&&Be instanceof HTMLElement))!=null?tt:null},[O]);ESe(Y,j);let ne=(()=>!(!I||L))();Hz(M,x,ne);let se=(()=>!(L||b!==0))();bfe(m==null?void 0:m.defaultView,"keydown",Ze=>{se&&(Ze.defaultPrevented||Ze.key===ro.Escape&&(Ze.preventDefault(),Ze.stopPropagation(),x()))});let he=(()=>!(H||b!==0||D))();YSt(m,he,M),w.useEffect(()=>{if(b!==0||!g.current)return;let Ze=new ResizeObserver(tt=>{for(let Be of tt){let kt=Be.target.getBoundingClientRect();kt.x===0&&kt.y===0&&kt.width===0&&kt.height===0&&x()}});return Ze.observe(g.current),()=>Ze.disconnect()},[b,g,x]);let[xe,_e]=YFe(),Ie=w.useMemo(()=>[{dialogState:b,close:x,setTitleId:k},y],[b,y,x,k]),Re=w.useMemo(()=>({open:b===0}),[b]),Ye={ref:p,id:r,role:"dialog","aria-modal":b===0?!0:void 0,"aria-labelledby":y.titleId,"aria-describedby":xe};return te.createElement(xSt,{type:"Dialog",enabled:b===0,element:g,onUpdate:An((Ze,tt)=>{tt==="Dialog"&&cs(Ze,{[wne.Add]:()=>d(Be=>Be+1),[wne.Remove]:()=>d(Be=>Be-1)})})},te.createElement(bne,{force:!0},te.createElement(Cne,null,te.createElement(b7.Provider,{value:Ie},te.createElement(Cne.Group,{target:g},te.createElement(bne,{force:!1},te.createElement(_e,{slot:Re,name:"Dialog.Description"},te.createElement(_R,{initialFocus:a,containers:M,features:I?cs(F,{parent:_R.features.RestoreFocus,leaf:_R.features.All&~_R.features.FocusLock}):_R.features.None},te.createElement(P,null,Cs({ourProps:Ye,theirProps:c,slot:Re,defaultTag:XSt,features:ZSt,visible:b===0,name:"Dialog"}))))))))),te.createElement(B,null))}let eEt="div";function tEt(n,e){let t=Sl(),{id:i=`headlessui-dialog-overlay-${t}`,...r}=n,[{dialogState:o,close:s}]=E3("Dialog.Overlay"),a=Xs(e),l=An(u=>{if(u.target===u.currentTarget){if(X2(u.currentTarget))return u.preventDefault();u.preventDefault(),u.stopPropagation(),s()}}),c=w.useMemo(()=>({open:o===0}),[o]);return Cs({ourProps:{ref:a,id:i,"aria-hidden":!0,onClick:l},theirProps:r,slot:c,defaultTag:eEt,name:"Dialog.Overlay"})}let nEt="div";function iEt(n,e){let t=Sl(),{id:i=`headlessui-dialog-backdrop-${t}`,...r}=n,[{dialogState:o},s]=E3("Dialog.Backdrop"),a=Xs(e);w.useEffect(()=>{if(s.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[s.panelRef]);let l=w.useMemo(()=>({open:o===0}),[o]);return te.createElement(bne,{force:!0},te.createElement(Cne,null,Cs({ourProps:{ref:a,id:i,"aria-hidden":!0},theirProps:r,slot:l,defaultTag:nEt,name:"Dialog.Backdrop"})))}let rEt="div";function oEt(n,e){let t=Sl(),{id:i=`headlessui-dialog-panel-${t}`,...r}=n,[{dialogState:o},s]=E3("Dialog.Panel"),a=Xs(e,s.panelRef),l=w.useMemo(()=>({open:o===0}),[o]),c=An(u=>{u.stopPropagation()});return Cs({ourProps:{ref:a,id:i,onClick:c},theirProps:r,slot:l,defaultTag:rEt,name:"Dialog.Panel"})}let sEt="h2";function aEt(n,e){let t=Sl(),{id:i=`headlessui-dialog-title-${t}`,...r}=n,[{dialogState:o,setTitleId:s}]=E3("Dialog.Title"),a=Xs(e);w.useEffect(()=>(s(i),()=>s(null)),[i,s]);let l=w.useMemo(()=>({open:o===0}),[o]);return Cs({ourProps:{ref:a,id:i},theirProps:r,slot:l,defaultTag:sEt,name:"Dialog.Title"})}let lEt=ws(JSt),cEt=ws(iEt),uEt=ws(oEt),dEt=ws(tEt),hEt=ws(aEt),aO=Object.assign(lEt,{Backdrop:cEt,Panel:uEt,Overlay:dEt,Title:hEt,Description:QFe}),xSe=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function kSe(n){var e,t;let i=(e=n.innerText)!=null?e:"",r=n.cloneNode(!0);if(!(r instanceof HTMLElement))return i;let o=!1;for(let a of r.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))a.remove(),o=!0;let s=o?(t=r.innerText)!=null?t:"":i;return xSe.test(s)&&(s=s.replace(xSe,"")),s}function fEt(n){let e=n.getAttribute("aria-label");if(typeof e=="string")return e.trim();let t=n.getAttribute("aria-labelledby");if(t){let i=t.split(" ").map(r=>{let o=document.getElementById(r);if(o){let s=o.getAttribute("aria-label");return typeof s=="string"?s.trim():kSe(o).trim()}return null}).filter(Boolean);if(i.length>0)return i.join(", ")}return kSe(n).trim()}function gEt(n){let e=w.useRef(""),t=w.useRef("");return An(()=>{let i=n.current;if(!i)return"";let r=i.innerText;if(e.current===r)return t.current;let o=fEt(i).trim().toLowerCase();return e.current=r,t.current=o,o})}var pEt=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(pEt||{}),mEt=(n=>(n[n.Pointer=0]="Pointer",n[n.Other=1]="Other",n))(mEt||{}),_Et=(n=>(n[n.OpenMenu=0]="OpenMenu",n[n.CloseMenu=1]="CloseMenu",n[n.GoToItem=2]="GoToItem",n[n.Search=3]="Search",n[n.ClearSearch=4]="ClearSearch",n[n.RegisterItem=5]="RegisterItem",n[n.UnregisterItem=6]="UnregisterItem",n))(_Et||{});function hQ(n,e=t=>t){let t=n.activeItemIndex!==null?n.items[n.activeItemIndex]:null,i=gfe(e(n.items.slice()),o=>o.dataRef.current.domRef.current),r=t?i.indexOf(t):null;return r===-1&&(r=null),{items:i,activeItemIndex:r}}let vEt={1(n){return n.menuState===1?n:{...n,activeItemIndex:null,menuState:1}},0(n){return n.menuState===0?n:{...n,__demoMode:!1,menuState:0}},2:(n,e)=>{var t;let i=hQ(n),r=RFe(e,{resolveItems:()=>i.items,resolveActiveIndex:()=>i.activeItemIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled});return{...n,...i,searchQuery:"",activeItemIndex:r,activationTrigger:(t=e.trigger)!=null?t:1}},3:(n,e)=>{let t=n.searchQuery!==""?0:1,i=n.searchQuery+e.value.toLowerCase(),r=(n.activeItemIndex!==null?n.items.slice(n.activeItemIndex+t).concat(n.items.slice(0,n.activeItemIndex+t)):n.items).find(s=>{var a;return((a=s.dataRef.current.textValue)==null?void 0:a.startsWith(i))&&!s.dataRef.current.disabled}),o=r?n.items.indexOf(r):-1;return o===-1||o===n.activeItemIndex?{...n,searchQuery:i}:{...n,searchQuery:i,activeItemIndex:o,activationTrigger:1}},4(n){return n.searchQuery===""?n:{...n,searchQuery:"",searchActiveItemIndex:null}},5:(n,e)=>{let t=hQ(n,i=>[...i,{id:e.id,dataRef:e.dataRef}]);return{...n,...t}},6:(n,e)=>{let t=hQ(n,i=>{let r=i.findIndex(o=>o.id===e.id);return r!==-1&&i.splice(r,1),i});return{...n,...t,activationTrigger:1}}},Cfe=w.createContext(null);Cfe.displayName="MenuContext";function jz(n){let e=w.useContext(Cfe);if(e===null){let t=new Error(`<${n} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,jz),t}return e}function bEt(n,e){return cs(e.type,vEt,n,e)}let yEt=w.Fragment;function CEt(n,e){let{__demoMode:t=!1,...i}=n,r=w.useReducer(bEt,{__demoMode:t,menuState:t?0:1,buttonRef:w.createRef(),itemsRef:w.createRef(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:o,itemsRef:s,buttonRef:a},l]=r,c=Xs(e);Hz([a,s],(g,p)=>{var m;l({type:1}),Vz(p,$z.Loose)||(g.preventDefault(),(m=a.current)==null||m.focus())},o===0);let u=An(()=>{l({type:1})}),d=w.useMemo(()=>({open:o===0,close:u}),[o,u]),h={ref:c};return te.createElement(Cfe.Provider,{value:r},te.createElement(zz,{value:cs(o,{0:sa.Open,1:sa.Closed})},Cs({ourProps:h,theirProps:i,slot:d,defaultTag:yEt,name:"Menu"})))}let wEt="button";function SEt(n,e){var t;let i=Sl(),{id:r=`headlessui-menu-button-${i}`,...o}=n,[s,a]=jz("Menu.Button"),l=Xs(s.buttonRef,e),c=k0(),u=An(m=>{switch(m.key){case ro.Space:case ro.Enter:case ro.ArrowDown:m.preventDefault(),m.stopPropagation(),a({type:0}),c.nextFrame(()=>a({type:2,focus:ra.First}));break;case ro.ArrowUp:m.preventDefault(),m.stopPropagation(),a({type:0}),c.nextFrame(()=>a({type:2,focus:ra.Last}));break}}),d=An(m=>{switch(m.key){case ro.Space:m.preventDefault();break}}),h=An(m=>{if(X2(m.currentTarget))return m.preventDefault();n.disabled||(s.menuState===0?(a({type:1}),c.nextFrame(()=>{var _;return(_=s.buttonRef.current)==null?void 0:_.focus({preventScroll:!0})})):(m.preventDefault(),a({type:0})))}),g=w.useMemo(()=>({open:s.menuState===0}),[s]),p={ref:l,id:r,type:Wz(n,s.buttonRef),"aria-haspopup":"menu","aria-controls":(t=s.itemsRef.current)==null?void 0:t.id,"aria-expanded":s.menuState===0,onKeyDown:u,onKeyUp:d,onClick:h};return Cs({ourProps:p,theirProps:o,slot:g,defaultTag:wEt,name:"Menu.Button"})}let EEt="div",xEt=Vp.RenderStrategy|Vp.Static;function kEt(n,e){var t,i;let r=Sl(),{id:o=`headlessui-menu-items-${r}`,...s}=n,[a,l]=jz("Menu.Items"),c=Xs(a.itemsRef,e),u=Cb(a.itemsRef),d=k0(),h=_k(),g=(()=>h!==null?(h&sa.Open)===sa.Open:a.menuState===0)();w.useEffect(()=>{let b=a.itemsRef.current;b&&a.menuState===0&&b!==(u==null?void 0:u.activeElement)&&b.focus({preventScroll:!0})},[a.menuState,a.itemsRef,u]),AFe({container:a.itemsRef.current,enabled:a.menuState===0,accept(b){return b.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:b.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(b){b.setAttribute("role","none")}});let p=An(b=>{var y,C;switch(d.dispose(),b.key){case ro.Space:if(a.searchQuery!=="")return b.preventDefault(),b.stopPropagation(),l({type:3,value:b.key});case ro.Enter:if(b.preventDefault(),b.stopPropagation(),l({type:1}),a.activeItemIndex!==null){let{dataRef:x}=a.items[a.activeItemIndex];(C=(y=x.current)==null?void 0:y.domRef.current)==null||C.click()}TFe(a.buttonRef.current);break;case ro.ArrowDown:return b.preventDefault(),b.stopPropagation(),l({type:2,focus:ra.Next});case ro.ArrowUp:return b.preventDefault(),b.stopPropagation(),l({type:2,focus:ra.Previous});case ro.Home:case ro.PageUp:return b.preventDefault(),b.stopPropagation(),l({type:2,focus:ra.First});case ro.End:case ro.PageDown:return b.preventDefault(),b.stopPropagation(),l({type:2,focus:ra.Last});case ro.Escape:b.preventDefault(),b.stopPropagation(),l({type:1}),Cg().nextFrame(()=>{var x;return(x=a.buttonRef.current)==null?void 0:x.focus({preventScroll:!0})});break;case ro.Tab:b.preventDefault(),b.stopPropagation(),l({type:1}),Cg().nextFrame(()=>{xwt(a.buttonRef.current,b.shiftKey?Ou.Previous:Ou.Next)});break;default:b.key.length===1&&(l({type:3,value:b.key}),d.setTimeout(()=>l({type:4}),350));break}}),m=An(b=>{switch(b.key){case ro.Space:b.preventDefault();break}}),_=w.useMemo(()=>({open:a.menuState===0}),[a]),v={"aria-activedescendant":a.activeItemIndex===null||(t=a.items[a.activeItemIndex])==null?void 0:t.id,"aria-labelledby":(i=a.buttonRef.current)==null?void 0:i.id,id:o,onKeyDown:p,onKeyUp:m,role:"menu",tabIndex:0,ref:c};return Cs({ourProps:v,theirProps:s,slot:_,defaultTag:EEt,features:xEt,visible:g,name:"Menu.Items"})}let TEt=w.Fragment;function IEt(n,e){let t=Sl(),{id:i=`headlessui-menu-item-${t}`,disabled:r=!1,...o}=n,[s,a]=jz("Menu.Item"),l=s.activeItemIndex!==null?s.items[s.activeItemIndex].id===i:!1,c=w.useRef(null),u=Xs(e,c);Gs(()=>{if(s.__demoMode||s.menuState!==0||!l||s.activationTrigger===0)return;let x=Cg();return x.requestAnimationFrame(()=>{var k,I;(I=(k=c.current)==null?void 0:k.scrollIntoView)==null||I.call(k,{block:"nearest"})}),x.dispose},[s.__demoMode,c,l,s.menuState,s.activationTrigger,s.activeItemIndex]);let d=gEt(c),h=w.useRef({disabled:r,domRef:c,get textValue(){return d()}});Gs(()=>{h.current.disabled=r},[h,r]),Gs(()=>(a({type:5,id:i,dataRef:h}),()=>a({type:6,id:i})),[h,i]);let g=An(()=>{a({type:1})}),p=An(x=>{if(r)return x.preventDefault();a({type:1}),TFe(s.buttonRef.current)}),m=An(()=>{if(r)return a({type:2,focus:ra.Nothing});a({type:2,focus:ra.Specific,id:i})}),_=BFe(),v=An(x=>_.update(x)),b=An(x=>{_.wasMoved(x)&&(r||l||a({type:2,focus:ra.Specific,id:i,trigger:0}))}),y=An(x=>{_.wasMoved(x)&&(r||l&&a({type:2,focus:ra.Nothing}))}),C=w.useMemo(()=>({active:l,disabled:r,close:g}),[l,r,g]);return Cs({ourProps:{id:i,ref:u,role:"menuitem",tabIndex:r===!0?void 0:-1,"aria-disabled":r===!0?!0:void 0,disabled:void 0,onClick:p,onFocus:m,onPointerEnter:v,onMouseEnter:v,onPointerMove:b,onMouseMove:b,onPointerLeave:y,onMouseLeave:y},theirProps:o,slot:C,defaultTag:TEt,name:"Menu.Item"})}let LEt=ws(CEt),DEt=ws(SEt),AEt=ws(kEt),REt=ws(IEt),K0=Object.assign(LEt,{Button:DEt,Items:AEt,Item:REt});var NEt=(n=>(n[n.Open=0]="Open",n[n.Closed=1]="Closed",n))(NEt||{}),OEt=(n=>(n[n.TogglePopover=0]="TogglePopover",n[n.ClosePopover=1]="ClosePopover",n[n.SetButton=2]="SetButton",n[n.SetButtonId=3]="SetButtonId",n[n.SetPanel=4]="SetPanel",n[n.SetPanelId=5]="SetPanelId",n))(OEt||{});let PEt={0:n=>{let e={...n,popoverState:cs(n.popoverState,{0:1,1:0})};return e.popoverState===0&&(e.__demoMode=!1),e},1(n){return n.popoverState===1?n:{...n,popoverState:1}},2(n,e){return n.button===e.button?n:{...n,button:e.button}},3(n,e){return n.buttonId===e.buttonId?n:{...n,buttonId:e.buttonId}},4(n,e){return n.panel===e.panel?n:{...n,panel:e.panel}},5(n,e){return n.panelId===e.panelId?n:{...n,panelId:e.panelId}}},wfe=w.createContext(null);wfe.displayName="PopoverContext";function Uz(n){let e=w.useContext(wfe);if(e===null){let t=new Error(`<${n} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Uz),t}return e}let Sfe=w.createContext(null);Sfe.displayName="PopoverAPIContext";function Efe(n){let e=w.useContext(Sfe);if(e===null){let t=new Error(`<${n} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Efe),t}return e}let xfe=w.createContext(null);xfe.displayName="PopoverGroupContext";function ZFe(){return w.useContext(xfe)}let qz=w.createContext(null);qz.displayName="PopoverPanelContext";function MEt(){return w.useContext(qz)}function FEt(n,e){return cs(e.type,PEt,n,e)}let BEt="div";function $Et(n,e){var t;let{__demoMode:i=!1,...r}=n,o=w.useRef(null),s=Xs(e,DFe(H=>{o.current=H})),a=w.useRef([]),l=w.useReducer(FEt,{__demoMode:i,popoverState:i?0:1,buttons:a,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:w.createRef(),afterPanelSentinel:w.createRef()}),[{popoverState:c,button:u,buttonId:d,panel:h,panelId:g,beforePanelSentinel:p,afterPanelSentinel:m},_]=l,v=Cb((t=o.current)!=null?t:u),b=w.useMemo(()=>{if(!u||!h)return!1;for(let se of document.querySelectorAll("body > *"))if(Number(se==null?void 0:se.contains(u))^Number(se==null?void 0:se.contains(h)))return!0;let H=C3(),V=H.indexOf(u),$=(V+H.length-1)%H.length,j=(V+1)%H.length,Y=H[$],ne=H[j];return!h.contains(Y)&&!h.contains(ne)},[u,h]),y=ug(d),C=ug(g),x=w.useMemo(()=>({buttonId:y,panelId:C,close:()=>_({type:1})}),[y,C,_]),k=ZFe(),I=k==null?void 0:k.registerPopover,L=An(()=>{var H;return(H=k==null?void 0:k.isFocusWithinPopoverGroup())!=null?H:(v==null?void 0:v.activeElement)&&((u==null?void 0:u.contains(v.activeElement))||(h==null?void 0:h.contains(v.activeElement)))});w.useEffect(()=>I==null?void 0:I(x),[I,x]);let[D,R]=qFe(),P=XFe({mainTreeNodeRef:k==null?void 0:k.mainTreeNodeRef,portals:D,defaultContainers:[u,h]});bfe(v==null?void 0:v.defaultView,"focus",H=>{var V,$,j,Y;H.target!==window&&H.target instanceof HTMLElement&&c===0&&(L()||u&&h&&(P.contains(H.target)||($=(V=p.current)==null?void 0:V.contains)!=null&&$.call(V,H.target)||(Y=(j=m.current)==null?void 0:j.contains)!=null&&Y.call(j,H.target)||_({type:1})))},!0),Hz(P.resolveContainers,(H,V)=>{_({type:1}),Vz(V,$z.Loose)||(H.preventDefault(),u==null||u.focus())},c===0);let M=An(H=>{_({type:1});let V=(()=>H?H instanceof HTMLElement?H:"current"in H&&H.current instanceof HTMLElement?H.current:u:u)();V==null||V.focus()}),O=w.useMemo(()=>({close:M,isPortalled:b}),[M,b]),B=w.useMemo(()=>({open:c===0,close:M}),[c,M]),F={ref:s};return te.createElement(qz.Provider,{value:null},te.createElement(wfe.Provider,{value:l},te.createElement(Sfe.Provider,{value:O},te.createElement(zz,{value:cs(c,{0:sa.Open,1:sa.Closed})},te.createElement(R,null,Cs({ourProps:F,theirProps:r,slot:B,defaultTag:BEt,name:"Popover"}),te.createElement(P.MainTreeNode,null))))))}let VEt="button";function HEt(n,e){let t=Sl(),{id:i=`headlessui-popover-button-${t}`,...r}=n,[o,s]=Uz("Popover.Button"),{isPortalled:a}=Efe("Popover.Button"),l=w.useRef(null),c=`headlessui-focus-sentinel-${Sl()}`,u=ZFe(),d=u==null?void 0:u.closeOthers,h=MEt()!==null;w.useEffect(()=>{if(!h)return s({type:3,buttonId:i}),()=>{s({type:3,buttonId:null})}},[h,i,s]);let[g]=w.useState(()=>Symbol()),p=Xs(l,e,h?null:P=>{if(P)o.buttons.current.push(g);else{let M=o.buttons.current.indexOf(g);M!==-1&&o.buttons.current.splice(M,1)}o.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),P&&s({type:2,button:P})}),m=Xs(l,e),_=Cb(l),v=An(P=>{var M,O,B;if(h){if(o.popoverState===1)return;switch(P.key){case ro.Space:case ro.Enter:P.preventDefault(),(O=(M=P.target).click)==null||O.call(M),s({type:1}),(B=o.button)==null||B.focus();break}}else switch(P.key){case ro.Space:case ro.Enter:P.preventDefault(),P.stopPropagation(),o.popoverState===1&&(d==null||d(o.buttonId)),s({type:0});break;case ro.Escape:if(o.popoverState!==0)return d==null?void 0:d(o.buttonId);if(!l.current||_!=null&&_.activeElement&&!l.current.contains(_.activeElement))return;P.preventDefault(),P.stopPropagation(),s({type:1});break}}),b=An(P=>{h||P.key===ro.Space&&P.preventDefault()}),y=An(P=>{var M,O;X2(P.currentTarget)||n.disabled||(h?(s({type:1}),(M=o.button)==null||M.focus()):(P.preventDefault(),P.stopPropagation(),o.popoverState===1&&(d==null||d(o.buttonId)),s({type:0}),(O=o.button)==null||O.focus()))}),C=An(P=>{P.preventDefault(),P.stopPropagation()}),x=o.popoverState===0,k=w.useMemo(()=>({open:x}),[x]),I=Wz(n,l),L=h?{ref:m,type:I,onKeyDown:v,onClick:y}:{ref:p,id:o.buttonId,type:I,"aria-expanded":o.popoverState===0,"aria-controls":o.panel?o.panelId:void 0,onKeyDown:v,onKeyUp:b,onClick:y,onMouseDown:C},D=vfe(),R=An(()=>{let P=o.panel;if(!P)return;function M(){cs(D.current,{[Jf.Forwards]:()=>pp(P,Ou.First),[Jf.Backwards]:()=>pp(P,Ou.Last)})===$P.Error&&pp(C3().filter(O=>O.dataset.headlessuiFocusGuard!=="true"),cs(D.current,{[Jf.Forwards]:Ou.Next,[Jf.Backwards]:Ou.Previous}),{relativeTo:o.button})}M()});return te.createElement(te.Fragment,null,Cs({ourProps:L,theirProps:r,slot:k,defaultTag:VEt,name:"Popover.Button"}),x&&!h&&a&&te.createElement(g0,{id:c,features:nb.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:R}))}let WEt="div",zEt=Vp.RenderStrategy|Vp.Static;function jEt(n,e){let t=Sl(),{id:i=`headlessui-popover-overlay-${t}`,...r}=n,[{popoverState:o},s]=Uz("Popover.Overlay"),a=Xs(e),l=_k(),c=(()=>l!==null?(l&sa.Open)===sa.Open:o===0)(),u=An(h=>{if(X2(h.currentTarget))return h.preventDefault();s({type:1})}),d=w.useMemo(()=>({open:o===0}),[o]);return Cs({ourProps:{ref:a,id:i,"aria-hidden":!0,onClick:u},theirProps:r,slot:d,defaultTag:WEt,features:zEt,visible:c,name:"Popover.Overlay"})}let UEt="div",qEt=Vp.RenderStrategy|Vp.Static;function KEt(n,e){let t=Sl(),{id:i=`headlessui-popover-panel-${t}`,focus:r=!1,...o}=n,[s,a]=Uz("Popover.Panel"),{close:l,isPortalled:c}=Efe("Popover.Panel"),u=`headlessui-focus-sentinel-before-${Sl()}`,d=`headlessui-focus-sentinel-after-${Sl()}`,h=w.useRef(null),g=Xs(h,e,I=>{a({type:4,panel:I})}),p=Cb(h);Gs(()=>(a({type:5,panelId:i}),()=>{a({type:5,panelId:null})}),[i,a]);let m=_k(),_=(()=>m!==null?(m&sa.Open)===sa.Open:s.popoverState===0)(),v=An(I=>{var L;switch(I.key){case ro.Escape:if(s.popoverState!==0||!h.current||p!=null&&p.activeElement&&!h.current.contains(p.activeElement))return;I.preventDefault(),I.stopPropagation(),a({type:1}),(L=s.button)==null||L.focus();break}});w.useEffect(()=>{var I;n.static||s.popoverState===1&&((I=n.unmount)==null||I)&&a({type:4,panel:null})},[s.popoverState,n.unmount,n.static,a]),w.useEffect(()=>{if(s.__demoMode||!r||s.popoverState!==0||!h.current)return;let I=p==null?void 0:p.activeElement;h.current.contains(I)||pp(h.current,Ou.First)},[s.__demoMode,r,h,s.popoverState]);let b=w.useMemo(()=>({open:s.popoverState===0,close:l}),[s,l]),y={ref:g,id:i,onKeyDown:v,onBlur:r&&s.popoverState===0?I=>{var L,D,R,P,M;let O=I.relatedTarget;O&&h.current&&((L=h.current)!=null&&L.contains(O)||(a({type:1}),((R=(D=s.beforePanelSentinel.current)==null?void 0:D.contains)!=null&&R.call(D,O)||(M=(P=s.afterPanelSentinel.current)==null?void 0:P.contains)!=null&&M.call(P,O))&&O.focus({preventScroll:!0})))}:void 0,tabIndex:-1},C=vfe(),x=An(()=>{let I=h.current;if(!I)return;function L(){cs(C.current,{[Jf.Forwards]:()=>{var D;pp(I,Ou.First)===$P.Error&&((D=s.afterPanelSentinel.current)==null||D.focus())},[Jf.Backwards]:()=>{var D;(D=s.button)==null||D.focus({preventScroll:!0})}})}L()}),k=An(()=>{let I=h.current;if(!I)return;function L(){cs(C.current,{[Jf.Forwards]:()=>{var D;if(!s.button)return;let R=C3(),P=R.indexOf(s.button),M=R.slice(0,P+1),O=[...R.slice(P+1),...M];for(let B of O.slice())if(B.dataset.headlessuiFocusGuard==="true"||(D=s.panel)!=null&&D.contains(B)){let F=O.indexOf(B);F!==-1&&O.splice(F,1)}pp(O,Ou.First,{sorted:!1})},[Jf.Backwards]:()=>{var D;pp(I,Ou.Previous)===$P.Error&&((D=s.button)==null||D.focus())}})}L()});return te.createElement(qz.Provider,{value:i},_&&c&&te.createElement(g0,{id:u,ref:s.beforePanelSentinel,features:nb.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:x}),Cs({ourProps:y,theirProps:o,slot:b,defaultTag:UEt,features:qEt,visible:_,name:"Popover.Panel"}),_&&c&&te.createElement(g0,{id:d,ref:s.afterPanelSentinel,features:nb.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:k}))}let GEt="div";function YEt(n,e){let t=w.useRef(null),i=Xs(t,e),[r,o]=w.useState([]),s=USt(),a=An(m=>{o(_=>{let v=_.indexOf(m);if(v!==-1){let b=_.slice();return b.splice(v,1),b}return _})}),l=An(m=>(o(_=>[..._,m]),()=>a(m))),c=An(()=>{var m;let _=y3(t);if(!_)return!1;let v=_.activeElement;return(m=t.current)!=null&&m.contains(v)?!0:r.some(b=>{var y,C;return((y=_.getElementById(b.buttonId.current))==null?void 0:y.contains(v))||((C=_.getElementById(b.panelId.current))==null?void 0:C.contains(v))})}),u=An(m=>{for(let _ of r)_.buttonId.current!==m&&_.close()}),d=w.useMemo(()=>({registerPopover:l,unregisterPopover:a,isFocusWithinPopoverGroup:c,closeOthers:u,mainTreeNodeRef:s.mainTreeNodeRef}),[l,a,c,u,s.mainTreeNodeRef]),h=w.useMemo(()=>({}),[]),g=n,p={ref:i};return te.createElement(xfe.Provider,{value:d},Cs({ourProps:p,theirProps:g,slot:h,defaultTag:GEt,name:"Popover.Group"}),te.createElement(s.MainTreeNode,null))}let QEt=ws($Et),XEt=ws(HEt),ZEt=ws(jEt),JEt=ws(KEt),ext=ws(YEt),fQ=Object.assign(QEt,{Button:XEt,Overlay:ZEt,Panel:JEt,Group:ext});function txt(n=0){let[e,t]=w.useState(n),i=S3(),r=w.useCallback(l=>{i.current&&t(c=>c|l)},[e,i]),o=w.useCallback(l=>!!(e&l),[e]),s=w.useCallback(l=>{i.current&&t(c=>c&~l)},[t,i]),a=w.useCallback(l=>{i.current&&t(c=>c^l)},[t]);return{flags:e,addFlag:r,hasFlag:o,removeFlag:s,toggleFlag:a}}let JFe=w.createContext(null);function e6e(){let n=w.useContext(JFe);if(n===null){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,e6e),e}return n}function nxt(){let[n,e]=w.useState([]);return[n.length>0?n.join(" "):void 0,w.useMemo(()=>function(t){let i=An(o=>(e(s=>[...s,o]),()=>e(s=>{let a=s.slice(),l=a.indexOf(o);return l!==-1&&a.splice(l,1),a}))),r=w.useMemo(()=>({register:i,slot:t.slot,name:t.name,props:t.props}),[i,t.slot,t.name,t.props]);return te.createElement(JFe.Provider,{value:r},t.children)},[e])]}let ixt="label";function rxt(n,e){let t=Sl(),{id:i=`headlessui-label-${t}`,passive:r=!1,...o}=n,s=e6e(),a=Xs(e);Gs(()=>s.register(i),[i,s.register]);let l={ref:a,...s.props,id:i};return r&&("onClick"in l&&(delete l.htmlFor,delete l.onClick),"onClick"in o&&delete o.onClick),Cs({ourProps:l,theirProps:o,slot:s.slot||{},defaultTag:ixt,name:s.name||"Label"})}let oxt=ws(rxt),sxt=Object.assign(oxt,{}),kfe=w.createContext(null);kfe.displayName="GroupContext";let axt=w.Fragment;function lxt(n){var e;let[t,i]=w.useState(null),[r,o]=nxt(),[s,a]=YFe(),l=w.useMemo(()=>({switch:t,setSwitch:i,labelledby:r,describedby:s}),[t,i,r,s]),c={},u=n;return te.createElement(a,{name:"Switch.Description"},te.createElement(o,{name:"Switch.Label",props:{htmlFor:(e=l.switch)==null?void 0:e.id,onClick(d){t&&(d.currentTarget.tagName==="LABEL"&&d.preventDefault(),t.click(),t.focus({preventScroll:!0}))}}},te.createElement(kfe.Provider,{value:l},Cs({ourProps:c,theirProps:u,defaultTag:axt,name:"Switch.Group"}))))}let cxt="button";function uxt(n,e){let t=Sl(),{id:i=`headlessui-switch-${t}`,checked:r,defaultChecked:o=!1,onChange:s,name:a,value:l,form:c,...u}=n,d=w.useContext(kfe),h=w.useRef(null),g=Xs(h,e,d===null?null:d.setSwitch),[p,m]=FFe(r,s,o),_=An(()=>m==null?void 0:m(!p)),v=An(I=>{if(X2(I.currentTarget))return I.preventDefault();I.preventDefault(),_()}),b=An(I=>{I.key===ro.Space?(I.preventDefault(),_()):I.key===ro.Enter&&Lwt(I.currentTarget)}),y=An(I=>I.preventDefault()),C=w.useMemo(()=>({checked:p}),[p]),x={id:i,ref:g,role:"switch",type:Wz(n,h),tabIndex:0,"aria-checked":p,"aria-labelledby":d==null?void 0:d.labelledby,"aria-describedby":d==null?void 0:d.describedby,onClick:v,onKeyUp:b,onKeyPress:y},k=k0();return w.useEffect(()=>{var I;let L=(I=h.current)==null?void 0:I.closest("form");L&&o!==void 0&&k.addEventListener(L,"reset",()=>{m(o)})},[h,m]),te.createElement(te.Fragment,null,a!=null&&p&&te.createElement(g0,{features:nb.Hidden,...v7({as:"input",type:"checkbox",hidden:!0,readOnly:!0,form:c,checked:p,name:a,value:l})}),Cs({ourProps:x,theirProps:u,slot:C,defaultTag:cxt,name:"Switch"}))}let dxt=ws(uxt),hxt=lxt,Sne=Object.assign(dxt,{Group:hxt,Label:sxt,Description:QFe});function fxt(n){let e={called:!1};return(...t)=>{if(!e.called)return e.called=!0,n(...t)}}function gQ(n,...e){n&&e.length>0&&n.classList.add(...e)}function pQ(n,...e){n&&e.length>0&&n.classList.remove(...e)}function gxt(n,e){let t=Cg();if(!n)return t.dispose;let{transitionDuration:i,transitionDelay:r}=getComputedStyle(n),[o,s]=[i,r].map(l=>{let[c=0]=l.split(",").filter(Boolean).map(u=>u.includes("ms")?parseFloat(u):parseFloat(u)*1e3).sort((u,d)=>d-u);return c}),a=o+s;if(a!==0){t.group(c=>{c.setTimeout(()=>{e(),c.dispose()},a),c.addEventListener(n,"transitionrun",u=>{u.target===u.currentTarget&&c.dispose()})});let l=t.addEventListener(n,"transitionend",c=>{c.target===c.currentTarget&&(e(),l())})}else e();return t.add(()=>e()),t.dispose}function pxt(n,e,t,i){let r=t?"enter":"leave",o=Cg(),s=i!==void 0?fxt(i):()=>{};r==="enter"&&(n.removeAttribute("hidden"),n.style.display="");let a=cs(r,{enter:()=>e.enter,leave:()=>e.leave}),l=cs(r,{enter:()=>e.enterTo,leave:()=>e.leaveTo}),c=cs(r,{enter:()=>e.enterFrom,leave:()=>e.leaveFrom});return pQ(n,...e.base,...e.enter,...e.enterTo,...e.enterFrom,...e.leave,...e.leaveFrom,...e.leaveTo,...e.entered),gQ(n,...e.base,...a,...c),o.nextFrame(()=>{pQ(n,...e.base,...a,...c),gQ(n,...e.base,...a,...l),gxt(n,()=>(pQ(n,...e.base,...a),gQ(n,...e.base,...e.entered),s()))}),o.dispose}function mxt({immediate:n,container:e,direction:t,classes:i,onStart:r,onStop:o}){let s=S3(),a=k0(),l=ug(t);Gs(()=>{n&&(l.current="enter")},[n]),Gs(()=>{let c=Cg();a.add(c.dispose);let u=e.current;if(u&&l.current!=="idle"&&s.current)return c.dispose(),r.current(l.current),c.add(pxt(u,i.current,l.current==="enter",()=>{c.dispose(),o.current(l.current)})),c.dispose},[t])}function G0(n=""){return n.split(" ").filter(e=>e.trim().length>1)}let Kz=w.createContext(null);Kz.displayName="TransitionContext";var _xt=(n=>(n.Visible="visible",n.Hidden="hidden",n))(_xt||{});function vxt(){let n=w.useContext(Kz);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}function bxt(){let n=w.useContext(Gz);if(n===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return n}let Gz=w.createContext(null);Gz.displayName="NestingContext";function Yz(n){return"children"in n?Yz(n.children):n.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function t6e(n,e){let t=ug(n),i=w.useRef([]),r=S3(),o=k0(),s=An((g,p=H1.Hidden)=>{let m=i.current.findIndex(({el:_})=>_===g);m!==-1&&(cs(p,{[H1.Unmount](){i.current.splice(m,1)},[H1.Hidden](){i.current[m].state="hidden"}}),o.microTask(()=>{var _;!Yz(i)&&r.current&&((_=t.current)==null||_.call(t))}))}),a=An(g=>{let p=i.current.find(({el:m})=>m===g);return p?p.state!=="visible"&&(p.state="visible"):i.current.push({el:g,state:"visible"}),()=>s(g,H1.Unmount)}),l=w.useRef([]),c=w.useRef(Promise.resolve()),u=w.useRef({enter:[],leave:[],idle:[]}),d=An((g,p,m)=>{l.current.splice(0),e&&(e.chains.current[p]=e.chains.current[p].filter(([_])=>_!==g)),e==null||e.chains.current[p].push([g,new Promise(_=>{l.current.push(_)})]),e==null||e.chains.current[p].push([g,new Promise(_=>{Promise.all(u.current[p].map(([v,b])=>b)).then(()=>_())})]),p==="enter"?c.current=c.current.then(()=>e==null?void 0:e.wait.current).then(()=>m(p)):m(p)}),h=An((g,p,m)=>{Promise.all(u.current[p].splice(0).map(([_,v])=>v)).then(()=>{var _;(_=l.current.shift())==null||_()}).then(()=>m(p))});return w.useMemo(()=>({children:i,register:a,unregister:s,onStart:d,onStop:h,wait:c,chains:u}),[a,s,i,d,h,u,c])}function yxt(){}let Cxt=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function TSe(n){var e;let t={};for(let i of Cxt)t[i]=(e=n[i])!=null?e:yxt;return t}function wxt(n){let e=w.useRef(TSe(n));return w.useEffect(()=>{e.current=TSe(n)},[n]),e}let Sxt="div",n6e=Vp.RenderStrategy;function Ext(n,e){var t,i;let{beforeEnter:r,afterEnter:o,beforeLeave:s,afterLeave:a,enter:l,enterFrom:c,enterTo:u,entered:d,leave:h,leaveFrom:g,leaveTo:p,...m}=n,_=w.useRef(null),v=Xs(_,e),b=(t=m.unmount)==null||t?H1.Unmount:H1.Hidden,{show:y,appear:C,initial:x}=vxt(),[k,I]=w.useState(y?"visible":"hidden"),L=bxt(),{register:D,unregister:R}=L;w.useEffect(()=>D(_),[D,_]),w.useEffect(()=>{if(b===H1.Hidden&&_.current){if(y&&k!=="visible"){I("visible");return}return cs(k,{hidden:()=>R(_),visible:()=>D(_)})}},[k,_,D,R,y,b]);let P=ug({base:G0(m.className),enter:G0(l),enterFrom:G0(c),enterTo:G0(u),entered:G0(d),leave:G0(h),leaveFrom:G0(g),leaveTo:G0(p)}),M=wxt({beforeEnter:r,afterEnter:o,beforeLeave:s,afterLeave:a}),O=Q2();w.useEffect(()=>{if(O&&k==="visible"&&_.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[_,k,O]);let B=x&&!C,F=C&&y&&x,H=(()=>!O||B?"idle":y?"enter":"leave")(),V=txt(0),$=An(he=>cs(he,{enter:()=>{V.addFlag(sa.Opening),M.current.beforeEnter()},leave:()=>{V.addFlag(sa.Closing),M.current.beforeLeave()},idle:()=>{}})),j=An(he=>cs(he,{enter:()=>{V.removeFlag(sa.Opening),M.current.afterEnter()},leave:()=>{V.removeFlag(sa.Closing),M.current.afterLeave()},idle:()=>{}})),Y=t6e(()=>{I("hidden"),R(_)},L);mxt({immediate:F,container:_,classes:P,direction:H,onStart:ug(he=>{Y.onStart(_,he,$)}),onStop:ug(he=>{Y.onStop(_,he,j),he==="leave"&&!Yz(Y)&&(I("hidden"),R(_))})});let ne=m,se={ref:v};return F?ne={...ne,className:_7(m.className,...P.current.enter,...P.current.enterFrom)}:(ne.className=_7(m.className,(i=_.current)==null?void 0:i.className),ne.className===""&&delete ne.className),te.createElement(Gz.Provider,{value:Y},te.createElement(zz,{value:cs(k,{visible:sa.Open,hidden:sa.Closed})|V.flags},Cs({ourProps:se,theirProps:ne,defaultTag:Sxt,features:n6e,visible:k==="visible",name:"Transition.Child"})))}function xxt(n,e){let{show:t,appear:i=!1,unmount:r=!0,...o}=n,s=w.useRef(null),a=Xs(s,e);Q2();let l=_k();if(t===void 0&&l!==null&&(t=(l&sa.Open)===sa.Open),![!0,!1].includes(t))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,u]=w.useState(t?"visible":"hidden"),d=t6e(()=>{u("hidden")}),[h,g]=w.useState(!0),p=w.useRef([t]);Gs(()=>{h!==!1&&p.current[p.current.length-1]!==t&&(p.current.push(t),g(!1))},[p,t]);let m=w.useMemo(()=>({show:t,appear:i,initial:h}),[t,i,h]);w.useEffect(()=>{if(t)u("visible");else if(!Yz(d))u("hidden");else{let y=s.current;if(!y)return;let C=y.getBoundingClientRect();C.x===0&&C.y===0&&C.width===0&&C.height===0&&u("hidden")}},[t,d]);let _={unmount:r},v=An(()=>{var y;h&&g(!1),(y=n.beforeEnter)==null||y.call(n)}),b=An(()=>{var y;h&&g(!1),(y=n.beforeLeave)==null||y.call(n)});return te.createElement(Gz.Provider,{value:d},te.createElement(Kz.Provider,{value:m},Cs({ourProps:{..._,as:w.Fragment,children:te.createElement(i6e,{ref:a,..._,...o,beforeEnter:v,beforeLeave:b})},theirProps:{},defaultTag:w.Fragment,features:n6e,visible:c==="visible",name:"Transition"})))}function kxt(n,e){let t=w.useContext(Kz)!==null,i=_k()!==null;return te.createElement(te.Fragment,null,!t&&i?te.createElement(Ene,{ref:e,...n}):te.createElement(i6e,{ref:e,...n}))}let Ene=ws(xxt),i6e=ws(Ext),Txt=ws(kxt),Ly=Object.assign(Ene,{Child:Txt,Root:Ene});const Ixt=Ea(Sne)`
&:focus {
outline: 2px solid ${n=>n.theme.ringColor};
}
border-color: ${n=>n.theme.borderColor};
background-color: ${n=>n.theme.backgroundColor};
`;function gt(n){const e=Vn(),t=ys(),[i,r]=w.useState(!1),[o,s]=w.useState(!1);return w.useEffect(()=>{r(!!n.checked),s(!!n.disabled)},[n.checked,n.disabled]),N(Sne.Group,{as:"div",className:"flex items-center",children:[f(Ixt,{theme:{ringColor:e.$5,borderColor:e.$5,backgroundColor:i?t:e.$5},className:St("relative inline-flex items-center flex-shrink-0 h-6 w-11 rounded-full transition-colors ease-in-out duration-200",{"pointer-events-none opacity-75":o,"border cursor-pointer focus:outline-none focus:ring-2 focus:ring-offset-2":!o}),checked:i,onChange:a=>{o||(r(a),n.onChange&&n.onChange(a),n.onValueChange&&n.onValueChange(a))},"data-cy":n.cypressRef,children:f("span",{"aria-hidden":"true",className:St(i?"translate-x-5":"translate-x-0","pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow ring-0 transition ease-in-out duration-200")})}),n.label&&f(Sne.Label,{as:"span",className:"ml-3",children:f("span",{className:"text-sm",children:n.label})})]})}function Tfe(n){const e=Vn();return n.pages.length===0?null:f("nav",{className:"flex","aria-label":"Breadcrumb",style:{color:e.$3,opacity:e.$10},children:N("ol",{role:"list",className:"flex items-center space-x-4",children:[f("li",{children:f("div",{children:N(Ii,{to:"/dashboard",withoutDefaultStyling:!0,children:[f(G3e,{className:"flex-shrink-0 h-5 w-5","aria-hidden":"true"}),f("span",{className:"sr-only",children:"Home"})]})})}),n.pages.map(t=>f("li",{children:N("div",{className:"flex items-center",children:[f(nhe,{className:"flex-shrink-0 h-5 w-5","aria-hidden":"true"}),f(Ii,{to:t.href,className:"ml-4 text-sm font-medium",withoutDefaultStyling:!0,children:t.name})]})},t.name))]})})}const Lxt="/invoiceninja-logo@light-e793224d.png";/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const Dxt={logo:Lxt};/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Qz(){var t,i;const n=Ti(),e=vi();return((t=n==null?void 0:n.settings)==null?void 0:t.company_logo)||((i=e==null?void 0:e.settings)==null?void 0:i.company_logo)||Dxt.logo}function Axt(){var t;const n=vi(),[e]=ue();return((t=n==null?void 0:n.settings)==null?void 0:t.name)||e("untitled_company")}const Rxt=Ea.button`
color: ${n=>n.theme.color};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`,Nxt=Ea(E0)`
color: ${n=>n.theme.color};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function et(n){const e=Vn(),{prevent:t}=ki(b3),i=Y2(),{actionKey:r}=n;return n.to?N(Nxt,{theme:{color:e.$3,hoverColor:e.$7},to:n.to,className:St({"flex items-center":n.icon},`w-full text-left z-50 block px-4 py-2 text-sm text-gray-700 rounded-lg ${n.className}`),onClick:o=>{t&&(o.preventDefault(),i({url:n.to}))},children:[n.icon,f("div",{className:St({"ml-2":n.icon}),children:n.children})]}):N(Rxt,{theme:{color:e.$3,hoverColor:e.$7},type:"button",onClick:o=>i({fn:()=>{var s,a;(s=n.onClick)==null||s.call(n,o),(a=n.setVisible)==null||a.call(n,!1)},actionKey:r}),ref:n.innerRef,className:St({"flex items-center":n.icon},`w-full text-left z-50 block px-4 py-2 text-sm rounded-lg ${n.className} `),"data-cy":n.cypressRef,children:[n.icon&&f("div",{children:n.icon}),f("div",{className:St({"ml-2":n.icon}),children:n.children})]})}function Oxt(n){const{renderFragmentOnly:e,children:t}=n;return e?f(_t,{children:t}):f(Ly.Child,{as:w.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:t})}function cr(n){const[e,t]=w.useState(!1);w.useEffect(()=>{t(n.visible)},[n.visible]);const i=Vn();return f(Ly.Root,{show:e,as:w.Fragment,children:f(aO,{as:"div",className:"fixed z-10 inset-0 overflow-y-auto",onClose:r=>{!n.disableClosing&&t(r),!n.disableClosing&&n.onClose(r)},children:N("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[f(Ly.Child,{as:w.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:f(aO.Overlay,{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})}),f("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),f(Oxt,{renderFragmentOnly:!!n.renderTransitionChildAsFragment&&e,children:N("div",{style:{backgroundColor:i.$2,color:i.$3,colorScheme:i.$0},className:St("inline-block align-bottom rounded px-4 pt-5 pb-4 text-left shadow-xl transform transition-all sm:my-8 sm:align-middle w-full sm:p-6",{"max-w-sm":n.size==="extraSmall"||typeof n.size>"u","max-w-lg":n.size==="small","max-w-7xl":n.size==="large","max-w-2xl":n.size==="regular","bg-white":n.backgroundColor==="white","bg-gray-50":n.backgroundColor==="gray","overflow-hidden":!n.overflowVisible}),onClick:r=>n.stopPropagationInHeader&&r.stopPropagation(),children:[N("div",{className:"flex flex-col justify-between items-start",style:{backgroundColor:i.$2,color:i.$3,colorScheme:i.$0},children:[N("div",{className:"flex w-full justify-between",children:[f(aO.Title,{as:"h3",className:"text-lg leading-6 font-medium",style:{backgroundColor:i.$2,color:i.$3,colorScheme:i.$0},children:n.title}),!n.disableClosing&&f(L_,{className:"cursor-pointer",onClick:()=>n.onClose(!1),fontSize:22,"data-cy":n.closeButtonCypressRef})]}),f("div",{className:"mt-2",children:n.text&&f("p",{style:{backgroundColor:i.$2,color:i.$3,colorScheme:i.$0},className:"text-sm",children:n.text})})]}),n.children&&f("div",{style:{backgroundColor:i.$2,color:i.$3,colorScheme:i.$0},className:St("text-sm flex flex-col space-y-4",{"justify-center items-center":n.centerContent,"mt-5 sm:mt-6":!n.disableClosing}),children:n.children})]})})]})})})}function Pxt(n){const[e]=ue(),t=Ci(),i=ri(),{id:r}=Fa(),o=ol(),s=Vn(),a=Kr(),[l,c]=w.useState(!1),u=(h,g,p)=>{if(t(h3({type:W2.TOKEN,user:g,token:p})),localStorage.setItem("X-CURRENT-INDEX",h.toString()),a.invalidateQueries(),r){const m="/"+(o.pathname.includes("/settings/gateways")?"settings/online_payments":o.pathname.split("/")[1]||"dashboard");i(m)}window.location.reload()},d=async()=>{l||(ie.processing(),c(!0),Te("POST",ye("/api/v1/companies")).then(()=>{Te("POST",ye("/api/v1/refresh")).then(h=>{const g=h.data.data,p=g.length-1,m=g[p];t(yb(g)),ie.success("created_new_company"),n.setIsModalOpen(!1),u(p,m.user,m.token.token)}).finally(()=>localStorage.setItem("COMPANY-EDIT-OPENED","false"))}).finally(()=>c(!1)))};return N(cr,{title:e("add_company"),visible:n.isModalOpen,onClose:()=>n.setIsModalOpen(!1),backgroundColor:"white",children:[f("span",{className:"text-lg",style:{backgroundColor:s.$2,color:s.$3,colorScheme:s.$0},children:e("are_you_sure")}),N("div",{className:"flex justify-end space-x-4 mt-5",children:[f(Ut,{className:"text-gray-900",onClick:()=>n.setIsModalOpen(!1),type:"minimal",children:f("span",{className:"text-base mx-3",children:e("cancel")})}),f(Ut,{onClick:d,children:f("span",{className:"text-base mx-3",children:e("yes")})})]})]})}var r6e={exports:{}},o6e={};const Af=oue(lpt),bR=oue(lgt),Mxt=oue(_gt);(function(n){var e,t,i=Co&&Co.__generator||function(Oe,lt){var It,tn,Je,ve,je={label:0,sent:function(){if(1&Je[0])throw Je[1];return Je[1]},trys:[],ops:[]};return ve={next:Le(0),throw:Le(1),return:Le(2)},typeof Symbol=="function"&&(ve[Symbol.iterator]=function(){return this}),ve;function Le(fe){return function(Fe){return function(ot){if(It)throw new TypeError("Generator is already executing.");for(;je;)try{if(It=1,tn&&(Je=2&ot[0]?tn.return:ot[0]?tn.throw||((Je=tn.return)&&Je.call(tn),0):tn.next)&&!(Je=Je.call(tn,ot[1])).done)return Je;switch(tn=0,Je&&(ot=[2&ot[0],Je.value]),ot[0]){case 0:case 1:Je=ot;break;case 4:return je.label++,{value:ot[1],done:!1};case 5:je.label++,tn=ot[1],ot=[0];continue;case 7:ot=je.ops.pop(),je.trys.pop();continue;default:if(!((Je=(Je=je.trys).length>0&&Je[Je.length-1])||ot[0]!==6&&ot[0]!==2)){je=0;continue}if(ot[0]===3&&(!Je||ot[1]>Je[0]&&ot[1]<Je[3])){je.label=ot[1];break}if(ot[0]===6&&je.label<Je[1]){je.label=Je[1],Je=ot;break}if(Je&&je.label<Je[2]){je.label=Je[2],je.ops.push(ot);break}Je[2]&&je.ops.pop(),je.trys.pop();continue}ot=lt.call(Oe,je)}catch(Ue){ot=[6,Ue],tn=0}finally{It=Je=0}if(5&ot[0])throw ot[1];return{value:ot[0]?ot[1]:void 0,done:!0}}([fe,Fe])}}},r=Co&&Co.__spreadArray||function(Oe,lt){for(var It=0,tn=lt.length,Je=Oe.length;It<tn;It++,Je++)Oe[Je]=lt[It];return Oe},o=Object.create,s=Object.defineProperty,a=Object.defineProperties,l=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,m=function(Oe,lt,It){return lt in Oe?s(Oe,lt,{enumerable:!0,configurable:!0,writable:!0,value:It}):Oe[lt]=It},_=function(Oe,lt){for(var It in lt||(lt={}))g.call(lt,It)&&m(Oe,It,lt[It]);if(d)for(var tn=0,Je=d(lt);tn<Je.length;tn++)p.call(lt,It=Je[tn])&&m(Oe,It,lt[It]);return Oe},v=function(Oe,lt){return a(Oe,c(lt))},b=function(Oe){return s(Oe,"__esModule",{value:!0})},y=function(Oe,lt){var It={};for(var tn in Oe)g.call(Oe,tn)&&lt.indexOf(tn)<0&&(It[tn]=Oe[tn]);if(Oe!=null&&d)for(var Je=0,ve=d(Oe);Je<ve.length;Je++)lt.indexOf(tn=ve[Je])<0&&p.call(Oe,tn)&&(It[tn]=Oe[tn]);return It},C=function(Oe){return function(lt,It,tn){if(It&&typeof It=="object"||typeof It=="function")for(var Je=function(Le){g.call(lt,Le)||Le==="default"||s(lt,Le,{get:function(){return It[Le]},enumerable:!(tn=l(It,Le))||tn.enumerable})},ve=0,je=u(It);ve<je.length;ve++)Je(je[ve]);return lt}(b(s(Oe!=null?o(h(Oe)):{},"default",Oe&&Oe.__esModule&&"default"in Oe?{get:function(){return Oe.default},enumerable:!0}:{value:Oe,enumerable:!0})),Oe)},x=function(Oe,lt,It){return new Promise(function(tn,Je){var ve=function(fe){try{Le(It.next(fe))}catch(Fe){Je(Fe)}},je=function(fe){try{Le(It.throw(fe))}catch(Fe){Je(Fe)}},Le=function(fe){return fe.done?tn(fe.value):Promise.resolve(fe.value).then(ve,je)};Le((It=It.apply(Oe,lt)).next())})};b(n),function(Oe,lt){for(var It in lt)s(Oe,It,{get:lt[It],enumerable:!0})}(n,{QueryStatus:function(){return e},buildCreateApi:function(){return wt},copyWithStructuralSharing:function(){return L},coreModule:function(){return Qn},coreModuleName:function(){return Ht},createApi:function(){return Fr},defaultSerializeQueryArgs:function(){return ae},fakeBaseQuery:function(){return Tt},fetchBaseQuery:function(){return B},retry:function(){return $},setupListeners:function(){return _e},skipSelector:function(){return Me},skipToken:function(){return we}}),(t=e||(e={})).uninitialized="uninitialized",t.pending="pending",t.fulfilled="fulfilled",t.rejected="rejected";var k=function(Oe){return[].concat.apply([],Oe)},I=C(Af).isPlainObject;function L(Oe,lt){if(Oe===lt||!(I(Oe)&&I(lt)||Array.isArray(Oe)&&Array.isArray(lt)))return lt;for(var It=Object.keys(lt),tn=Object.keys(Oe),Je=It.length===tn.length,ve=Array.isArray(lt)?[]:{},je=0,Le=It;je<Le.length;je++){var fe=Le[je];ve[fe]=L(Oe[fe],lt[fe]),Je&&(Je=Oe[fe]===ve[fe])}return Je?Oe:ve}var D=C(Af),R=function(){for(var Oe=[],lt=0;lt<arguments.length;lt++)Oe[lt]=arguments[lt];return fetch.apply(void 0,Oe)},P=function(Oe){return Oe.status>=200&&Oe.status<=299},M=function(Oe){return/ion\/(vnd\.api\+)?json/.test(Oe.get("content-type")||"")};function O(Oe){if(!(0,D.isPlainObject)(Oe))return Oe;for(var lt=_({},Oe),It=0,tn=Object.entries(lt);It<tn.length;It++){var Je=tn[It];Je[1]===void 0&&delete lt[Je[0]]}return lt}function B(Oe){var lt=this;Oe===void 0&&(Oe={});var It=Oe.baseUrl,tn=Oe.prepareHeaders,Je=tn===void 0?function(Xt){return Xt}:tn,ve=Oe.fetchFn,je=ve===void 0?R:ve,Le=Oe.paramsSerializer,fe=Oe.isJsonContentType,Fe=fe===void 0?M:fe,ot=Oe.jsonContentType,Ue=ot===void 0?"application/json":ot,Qt=Oe.jsonReplacer,gn=Oe.timeout,Pn=Oe.responseHandler,Zn=Oe.validateStatus,wi=y(Oe,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&je===R&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(Xt,ti){return x(lt,null,function(){var or,Dr,xa,pa,Ba,Uo,Xo,qo,Ll,yc,ci,lo,To,Bs,ns,$s,_o,Ar,Gr,hr,yr,zr,Fi,Hn,ni,Ln,Wn,ii,Oi,sn,an,Dn,it,vt,Jt,Nn;return i(this,function(En){switch(En.label){case 0:return or=ti.signal,Dr=ti.getState,xa=ti.extra,pa=ti.endpoint,Ba=ti.forced,Uo=ti.type,Ll=(qo=typeof Xt=="string"?{url:Xt}:Xt).url,ci=(yc=qo.headers)===void 0?new Headers(wi.headers):yc,To=(lo=qo.params)===void 0?void 0:lo,ns=(Bs=qo.responseHandler)===void 0?Pn??"json":Bs,_o=($s=qo.validateStatus)===void 0?Zn??P:$s,Gr=(Ar=qo.timeout)===void 0?gn:Ar,hr=y(qo,["url","headers","params","responseHandler","validateStatus","timeout"]),yr=_(v(_({},wi),{signal:or}),hr),ci=new Headers(O(ci)),zr=yr,[4,Je(ci,{getState:Dr,extra:xa,endpoint:pa,forced:Ba,type:Uo})];case 1:zr.headers=En.sent()||ci,Fi=function(Kn){return typeof Kn=="object"&&((0,D.isPlainObject)(Kn)||Array.isArray(Kn)||typeof Kn.toJSON=="function")},!yr.headers.has("content-type")&&Fi(yr.body)&&yr.headers.set("content-type",Ue),Fi(yr.body)&&Fe(yr.headers)&&(yr.body=JSON.stringify(yr.body,Qt)),To&&(Hn=~Ll.indexOf("?")?"&":"?",ni=Le?Le(To):new URLSearchParams(O(To)),Ll+=Hn+ni),Ll=function(Kn,Cr){if(!Kn)return Cr;if(!Cr)return Kn;if(function(Br){return new RegExp("(^|:)//").test(Br)}(Cr))return Cr;var Yr=Kn.endsWith("/")||!Cr.startsWith("?")?"/":"";return Kn=function(Br){return Br.replace(/\/$/,"")}(Kn),""+Kn+Yr+function(Br){return Br.replace(/^\//,"")}(Cr)}(It,Ll),Ln=new Request(Ll,yr),Wn=new Request(Ll,yr),Xo={request:Wn},Oi=!1,sn=Gr&&setTimeout(function(){Oi=!0,ti.abort()},Gr),En.label=2;case 2:return En.trys.push([2,4,5,6]),[4,je(Ln)];case 3:return ii=En.sent(),[3,6];case 4:return an=En.sent(),[2,{error:{status:Oi?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(an)},meta:Xo}];case 5:return sn&&clearTimeout(sn),[7];case 6:Dn=ii.clone(),Xo.response=Dn,vt="",En.label=7;case 7:return En.trys.push([7,9,,10]),[4,Promise.all([Sn(ii,ns).then(function(Kn){return it=Kn},function(Kn){return Jt=Kn}),Dn.text().then(function(Kn){return vt=Kn},function(){})])];case 8:if(En.sent(),Jt)throw Jt;return[3,10];case 9:return Nn=En.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:ii.status,data:vt,error:String(Nn)},meta:Xo}];case 10:return[2,_o(ii,it)?{data:it,meta:Xo}:{error:{status:ii.status,data:it},meta:Xo}]}})})};function Sn(Xt,ti){return x(this,null,function(){var or;return i(this,function(Dr){switch(Dr.label){case 0:return typeof ti=="function"?[2,ti(Xt)]:(ti==="content-type"&&(ti=Fe(Xt.headers)?"json":"text"),ti!=="json"?[3,2]:[4,Xt.text()]);case 1:return[2,(or=Dr.sent()).length?JSON.parse(or):null];case 2:return[2,Xt.text()]}})})}}var F=function(Oe,lt){lt===void 0&&(lt=void 0),this.value=Oe,this.meta=lt};function H(Oe,lt){return Oe===void 0&&(Oe=0),lt===void 0&&(lt=5),x(this,null,function(){var It,tn;return i(this,function(Je){switch(Je.label){case 0:return It=Math.min(Oe,lt),tn=~~((Math.random()+.4)*(300<<It)),[4,new Promise(function(ve){return setTimeout(function(je){return ve(je)},tn)})];case 1:return Je.sent(),[2]}})})}var V={},$=Object.assign(function(Oe,lt){return function(It,tn,Je){return x(void 0,null,function(){var ve,je,Le,fe,Fe,ot,Ue;return i(this,function(Qt){switch(Qt.label){case 0:ve=[5,(lt||V).maxRetries,(Je||V).maxRetries].filter(function(gn){return gn!==void 0}),je=ve.slice(-1)[0],Le=function(gn,Pn,Zn){return Zn.attempt<=je},fe=_(_({maxRetries:je,backoff:H,retryCondition:Le},lt),Je),Fe=0,Qt.label=1;case 1:Qt.label=2;case 2:return Qt.trys.push([2,4,,6]),[4,Oe(It,tn,Je)];case 3:if((ot=Qt.sent()).error)throw new F(ot);return[2,ot];case 4:if(Ue=Qt.sent(),Fe++,Ue.throwImmediately){if(Ue instanceof F)return[2,Ue.value];throw Ue}return Ue instanceof F&&!fe.retryCondition(Ue.value.error,It,{attempt:Fe,baseQueryApi:tn,extraOptions:Je})?[2,Ue.value]:[4,fe.backoff(Fe,fe.maxRetries)];case 5:return Qt.sent(),[3,6];case 6:return[3,1];case 7:return[2]}})})}},{fail:function(Oe){throw Object.assign(new F({error:Oe}),{throwImmediately:!0})}}),j=C(Af),Y=(0,j.createAction)("__rtkq/focused"),ne=(0,j.createAction)("__rtkq/unfocused"),se=(0,j.createAction)("__rtkq/online"),he=(0,j.createAction)("__rtkq/offline"),xe=!1;function _e(Oe,lt){return lt?lt(Oe,{onFocus:Y,onFocusLost:ne,onOffline:he,onOnline:se}):(It=function(){return Oe(Y())},tn=function(){return Oe(se())},Je=function(){return Oe(he())},ve=function(){window.document.visibilityState==="visible"?It():Oe(ne())},xe||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",ve,!1),window.addEventListener("focus",It,!1),window.addEventListener("online",tn,!1),window.addEventListener("offline",Je,!1),xe=!0),function(){window.removeEventListener("focus",It),window.removeEventListener("visibilitychange",ve),window.removeEventListener("online",tn),window.removeEventListener("offline",Je),xe=!1});var It,tn,Je,ve}var Ie,Re,Ye=C(Af);function Ze(Oe){return Oe.type===Ie.query}function tt(Oe,lt,It,tn,Je,ve){return typeof Oe=="function"?Oe(lt,It,tn,Je).map(Be).map(ve):Array.isArray(Oe)?Oe.map(Be).map(ve):[]}function Be(Oe){return typeof Oe=="string"?{type:Oe}:Oe}(Re=Ie||(Ie={})).query="query",Re.mutation="mutation";var kt=C(Af);function Vt(Oe){return Oe!=null}var xt=Symbol("forceQueryFn"),Kt=function(Oe){return typeof Oe[xt]=="function"},cn=C(Af),wn=C(bR),on=C(Af);function Zt(Oe){return Oe}function pe(Oe,lt,It,tn){return tt(It[Oe.meta.arg.endpointName][lt],(0,cn.isFulfilled)(Oe)?Oe.payload:void 0,(0,cn.isRejectedWithValue)(Oe)?Oe.payload:void 0,Oe.meta.arg.originalArgs,"baseQueryMeta"in Oe.meta?Oe.meta.baseQueryMeta:void 0,tn)}var me=C(bR),Z=C(bR);function G(Oe,lt,It){var tn=Oe[lt];tn&&It(tn)}function K(Oe){var lt;return(lt="arg"in Oe?Oe.arg.fixedCacheKey:Oe.fixedCacheKey)!=null?lt:Oe.requestId}function oe(Oe,lt,It){var tn=Oe[K(lt)];tn&&It(tn)}var le={},we=Symbol.for("RTKQ/skipToken"),Me=we,ft={status:e.uninitialized},Nt=(0,Ye.createNextState)(ft,function(){}),Yt=(0,Ye.createNextState)(ft,function(){}),He=C(Af),Dt=WeakMap?new WeakMap:void 0,ae=function(Oe){var lt=Oe.endpointName,It=Oe.queryArgs,tn="",Je=Dt==null?void 0:Dt.get(It);if(typeof Je=="string")tn=Je;else{var ve=JSON.stringify(It,function(je,Le){return(0,He.isPlainObject)(Le)?Object.keys(Le).sort().reduce(function(fe,Fe){return fe[Fe]=Le[Fe],fe},{}):Le});(0,He.isPlainObject)(It)&&(Dt==null||Dt.set(It,ve)),tn=ve}return lt+"("+tn+")"},Se=C(Af),Xe=C(Mxt);function wt(){for(var Oe=[],lt=0;lt<arguments.length;lt++)Oe[lt]=arguments[lt];return function(It){var tn=(0,Xe.defaultMemoize)(function(fe){var Fe,ot;return(ot=It.extractRehydrationInfo)==null?void 0:ot.call(It,fe,{reducerPath:(Fe=It.reducerPath)!=null?Fe:"api"})}),Je=v(_({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},It),{extractRehydrationInfo:tn,serializeQueryArgs:function(fe){var Fe=ae;if("serializeQueryArgs"in fe.endpointDefinition){var ot=fe.endpointDefinition.serializeQueryArgs;Fe=function(Ue){var Qt=ot(Ue);return typeof Qt=="string"?Qt:ae(v(_({},Ue),{queryArgs:Qt}))}}else It.serializeQueryArgs&&(Fe=It.serializeQueryArgs);return Fe(fe)},tagTypes:r([],It.tagTypes||[])}),ve={endpointDefinitions:{},batch:function(fe){fe()},apiUid:(0,Se.nanoid)(),extractRehydrationInfo:tn,hasRehydrationInfo:(0,Xe.defaultMemoize)(function(fe){return tn(fe)!=null})},je={injectEndpoints:function(fe){for(var Fe=fe.endpoints({query:function(Sn){return v(_({},Sn),{type:Ie.query})},mutation:function(Sn){return v(_({},Sn),{type:Ie.mutation})}}),ot=0,Ue=Object.entries(Fe);ot<Ue.length;ot++){var Qt=Ue[ot],gn=Qt[0],Pn=Qt[1];if(fe.overrideExisting||!(gn in ve.endpointDefinitions)){ve.endpointDefinitions[gn]=Pn;for(var Zn=0,wi=Le;Zn<wi.length;Zn++)wi[Zn].injectEndpoint(gn,Pn)}}return je},enhanceEndpoints:function(fe){var Fe=fe.addTagTypes,ot=fe.endpoints;if(Fe)for(var Ue=0,Qt=Fe;Ue<Qt.length;Ue++){var gn=Qt[Ue];Je.tagTypes.includes(gn)||Je.tagTypes.push(gn)}if(ot)for(var Pn=0,Zn=Object.entries(ot);Pn<Zn.length;Pn++){var wi=Zn[Pn],Sn=wi[0],Xt=wi[1];typeof Xt=="function"?Xt(ve.endpointDefinitions[Sn]):Object.assign(ve.endpointDefinitions[Sn]||{},Xt)}return je}},Le=Oe.map(function(fe){return fe.init(je,Je,ve)});return je.injectEndpoints({endpoints:It.endpoints})}}function Tt(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var zt,Mt=C(Af),On=function(Oe){var lt=Oe.reducerPath,It=Oe.api,tn=Oe.context,Je=Oe.internalState,ve=It.internalActions,je=ve.removeQueryResult,Le=ve.unsubscribeQueryResult;function fe(Ue){var Qt=Je.currentSubscriptions[Ue];return!!Qt&&!function(gn){for(var Pn in gn)return!1;return!0}(Qt)}var Fe={};function ot(Ue,Qt,gn,Pn){var Zn,wi=tn.endpointDefinitions[Qt],Sn=(Zn=wi==null?void 0:wi.keepUnusedDataFor)!=null?Zn:Pn.keepUnusedDataFor;if(Sn!==1/0){var Xt=Math.max(0,Math.min(Sn,2147482647e-3));if(!fe(Ue)){var ti=Fe[Ue];ti&&clearTimeout(ti),Fe[Ue]=setTimeout(function(){fe(Ue)||gn.dispatch(je({queryCacheKey:Ue})),delete Fe[Ue]},1e3*Xt)}}}return function(Ue,Qt,gn){var Pn;if(Le.match(Ue)){var Zn=Qt.getState()[lt];ot(Ba=Ue.payload.queryCacheKey,(Pn=Zn.queries[Ba])==null?void 0:Pn.endpointName,Qt,Zn.config)}if(It.util.resetApiState.match(Ue))for(var wi=0,Sn=Object.entries(Fe);wi<Sn.length;wi++){var Xt=Sn[wi],ti=Xt[0],or=Xt[1];or&&clearTimeout(or),delete Fe[ti]}if(tn.hasRehydrationInfo(Ue)){Zn=Qt.getState()[lt];for(var Dr=tn.extractRehydrationInfo(Ue).queries,xa=0,pa=Object.entries(Dr);xa<pa.length;xa++){var Ba,Uo=pa[xa],Xo=Uo[1];ot(Ba=Uo[0],Xo==null?void 0:Xo.endpointName,Qt,Zn.config)}}}},Ni=C(Af),xn=function(Oe){var lt=Oe.reducerPath,It=Oe.context,tn=Oe.context.endpointDefinitions,Je=Oe.mutationThunk,ve=Oe.api,je=Oe.assertTagType,Le=Oe.refetchQuery,fe=ve.internalActions.removeQueryResult,Fe=(0,Ni.isAnyOf)((0,Ni.isFulfilled)(Je),(0,Ni.isRejectedWithValue)(Je));function ot(Ue,Qt){var gn=Qt.getState(),Pn=gn[lt],Zn=ve.util.selectInvalidatedBy(gn,Ue);It.batch(function(){for(var wi,Sn=0,Xt=Array.from(Zn.values());Sn<Xt.length;Sn++){var ti=Xt[Sn].queryCacheKey,or=Pn.queries[ti],Dr=(wi=Pn.subscriptions[ti])!=null?wi:{};or&&(Object.keys(Dr).length===0?Qt.dispatch(fe({queryCacheKey:ti})):or.status!==e.uninitialized&&Qt.dispatch(Le(or,ti)))}})}return function(Ue,Qt){Fe(Ue)&&ot(pe(Ue,"invalidatesTags",tn,je),Qt),ve.util.invalidateTags.match(Ue)&&ot(tt(Ue.payload,void 0,void 0,void 0,void 0,je),Qt)}},un=function(Oe){var lt=Oe.reducerPath,It=Oe.queryThunk,tn=Oe.api,Je=Oe.refetchQuery,ve=Oe.internalState,je={};function Le(Ue,Qt){var gn=Ue.queryCacheKey,Pn=Qt.getState()[lt].queries[gn];if(Pn&&Pn.status!==e.uninitialized){var Zn=ot(ve.currentSubscriptions[gn]);if(Number.isFinite(Zn)){var wi=je[gn];wi!=null&&wi.timeout&&(clearTimeout(wi.timeout),wi.timeout=void 0);var Sn=Date.now()+Zn,Xt=je[gn]={nextPollTimestamp:Sn,pollingInterval:Zn,timeout:setTimeout(function(){Xt.timeout=void 0,Qt.dispatch(Je(Pn,gn))},Zn)}}}}function fe(Ue,Qt){var gn=Ue.queryCacheKey,Pn=Qt.getState()[lt].queries[gn];if(Pn&&Pn.status!==e.uninitialized){var Zn=ot(ve.currentSubscriptions[gn]);if(Number.isFinite(Zn)){var wi=je[gn],Sn=Date.now()+Zn;(!wi||Sn<wi.nextPollTimestamp)&&Le({queryCacheKey:gn},Qt)}else Fe(gn)}}function Fe(Ue){var Qt=je[Ue];Qt!=null&&Qt.timeout&&clearTimeout(Qt.timeout),delete je[Ue]}function ot(Ue){Ue===void 0&&(Ue={});var Qt=Number.POSITIVE_INFINITY;for(var gn in Ue)Ue[gn].pollingInterval&&(Qt=Math.min(Ue[gn].pollingInterval,Qt));return Qt}return function(Ue,Qt){(tn.internalActions.updateSubscriptionOptions.match(Ue)||tn.internalActions.unsubscribeQueryResult.match(Ue))&&fe(Ue.payload,Qt),(It.pending.match(Ue)||It.rejected.match(Ue)&&Ue.meta.condition)&&fe(Ue.meta.arg,Qt),(It.fulfilled.match(Ue)||It.rejected.match(Ue)&&!Ue.meta.condition)&&Le(Ue.meta.arg,Qt),tn.util.resetApiState.match(Ue)&&function(){for(var gn=0,Pn=Object.keys(je);gn<Pn.length;gn++)Fe(Pn[gn])}()}},ei=C(Af),li=new Error("Promise never resolved before cacheEntryRemoved."),xi=function(Oe){var lt=Oe.api,It=Oe.reducerPath,tn=Oe.context,Je=Oe.queryThunk,ve=Oe.mutationThunk,je=(0,ei.isAsyncThunkAction)(Je),Le=(0,ei.isAsyncThunkAction)(ve),fe=(0,ei.isFulfilled)(Je,ve),Fe={};function ot(Ue,Qt,gn,Pn,Zn){var wi=tn.endpointDefinitions[Ue],Sn=wi==null?void 0:wi.onCacheEntryAdded;if(Sn){var Xt={},ti=new Promise(function(Uo){Xt.cacheEntryRemoved=Uo}),or=Promise.race([new Promise(function(Uo){Xt.valueResolved=Uo}),ti.then(function(){throw li})]);or.catch(function(){}),Fe[gn]=Xt;var Dr=lt.endpoints[Ue].select(wi.type===Ie.query?Qt:gn),xa=Pn.dispatch(function(Uo,Xo,qo){return qo}),pa=v(_({},Pn),{getCacheEntry:function(){return Dr(Pn.getState())},requestId:Zn,extra:xa,updateCachedData:wi.type===Ie.query?function(Uo){return Pn.dispatch(lt.util.updateQueryData(Ue,Qt,Uo))}:void 0,cacheDataLoaded:or,cacheEntryRemoved:ti}),Ba=Sn(Qt,pa);Promise.resolve(Ba).catch(function(Uo){if(Uo!==li)throw Uo})}}return function(Ue,Qt,gn){var Pn=function(Dr){return je(Dr)?Dr.meta.arg.queryCacheKey:Le(Dr)?Dr.meta.requestId:lt.internalActions.removeQueryResult.match(Dr)?Dr.payload.queryCacheKey:lt.internalActions.removeMutationResult.match(Dr)?K(Dr.payload):""}(Ue);if(Je.pending.match(Ue)){var Zn=gn[It].queries[Pn],wi=Qt.getState()[It].queries[Pn];!Zn&&wi&&ot(Ue.meta.arg.endpointName,Ue.meta.arg.originalArgs,Pn,Qt,Ue.meta.requestId)}else if(ve.pending.match(Ue))(wi=Qt.getState()[It].mutations[Pn])&&ot(Ue.meta.arg.endpointName,Ue.meta.arg.originalArgs,Pn,Qt,Ue.meta.requestId);else if(fe(Ue))(or=Fe[Pn])!=null&&or.valueResolved&&(or.valueResolved({data:Ue.payload,meta:Ue.meta.baseQueryMeta}),delete or.valueResolved);else if(lt.internalActions.removeQueryResult.match(Ue)||lt.internalActions.removeMutationResult.match(Ue))(or=Fe[Pn])&&(delete Fe[Pn],or.cacheEntryRemoved());else if(lt.util.resetApiState.match(Ue))for(var Sn=0,Xt=Object.entries(Fe);Sn<Xt.length;Sn++){var ti=Xt[Sn],or=ti[1];delete Fe[ti[0]],or.cacheEntryRemoved()}}},br=C(Af),Wr=function(Oe){var lt=Oe.api,It=Oe.context,tn=Oe.queryThunk,Je=Oe.mutationThunk,ve=(0,br.isPending)(tn,Je),je=(0,br.isRejected)(tn,Je),Le=(0,br.isFulfilled)(tn,Je),fe={};return function(Fe,ot){var Ue,Qt,gn;if(ve(Fe)){var Pn=Fe.meta,Zn=Pn.requestId,wi=Pn.arg,Sn=wi.endpointName,Xt=wi.originalArgs,ti=It.endpointDefinitions[Sn],or=ti==null?void 0:ti.onQueryStarted;if(or){var Dr={},xa=new Promise(function(yc,ci){Dr.resolve=yc,Dr.reject=ci});xa.catch(function(){}),fe[Zn]=Dr;var pa=lt.endpoints[Sn].select(ti.type===Ie.query?Xt:Zn),Ba=ot.dispatch(function(yc,ci,lo){return lo}),Uo=v(_({},ot),{getCacheEntry:function(){return pa(ot.getState())},requestId:Zn,extra:Ba,updateCachedData:ti.type===Ie.query?function(yc){return ot.dispatch(lt.util.updateQueryData(Sn,Xt,yc))}:void 0,queryFulfilled:xa});or(Xt,Uo)}}else if(Le(Fe)){var Xo=Fe.meta,qo=Xo.baseQueryMeta;(Ue=fe[Zn=Xo.requestId])==null||Ue.resolve({data:Fe.payload,meta:qo}),delete fe[Zn]}else if(je(Fe)){var Ll=Fe.meta;qo=Ll.baseQueryMeta,(gn=fe[Zn=Ll.requestId])==null||gn.reject({error:(Qt=Fe.payload)!=null?Qt:Fe.error,isUnhandledError:!Ll.rejectedWithValue,meta:qo}),delete fe[Zn]}}},ko=function(Oe){var lt=Oe.api,It=Oe.context.apiUid;return function(tn,Je){lt.util.resetApiState.match(tn)&&Je.dispatch(lt.internalActions.middlewareRegistered(It))}},oo=C(bR),ea=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof Co<"u"?Co:globalThis):function(Oe){return(zt||(zt=Promise.resolve())).then(Oe).catch(function(lt){return setTimeout(function(){throw lt},0)})};function xr(Oe){for(var lt=[],It=1;It<arguments.length;It++)lt[It-1]=arguments[It];Object.assign.apply(Object,r([Oe],lt))}var Hi=C(bR),Ht=Symbol(),Qn=function(){return{name:Ht,init:function(Oe,lt,It){var tn=lt.baseQuery,Je=lt.reducerPath,ve=lt.serializeQueryArgs,je=lt.keepUnusedDataFor,Le=lt.refetchOnMountOrArgChange,fe=lt.refetchOnFocus,Fe=lt.refetchOnReconnect;(0,Hi.enablePatches)();var ot=function(ci){return ci};Object.assign(Oe,{reducerPath:Je,endpoints:{},internalActions:{onOnline:se,onOffline:he,onFocus:Y,onFocusLost:ne},util:{}});var Ue=function(ci){var lo=this,To=ci.reducerPath,Bs=ci.baseQuery,ns=ci.context.endpointDefinitions,$s=ci.serializeQueryArgs,_o=ci.api,Ar=ci.assertTagType,Gr=function(Hn,ni){return x(lo,[Hn,ni],function(Ln,Wn){var ii,Oi,sn,an,Dn,it,vt,Jt,Nn,En,Kn,Cr,Yr,Br=Wn.signal,$a=Wn.abort,fr=Wn.rejectWithValue,qi=Wn.fulfillWithValue,Vs=Wn.dispatch,zc=Wn.getState,_u=Wn.extra;return i(this,function(Zo){switch(Zo.label){case 0:ii=ns[Ln.endpointName],Zo.label=1;case 1:return Zo.trys.push([1,8,,13]),Oi=Zt,sn=void 0,an={signal:Br,abort:$a,dispatch:Vs,getState:zc,extra:_u,endpoint:Ln.endpointName,type:Ln.type,forced:Ln.type==="query"?hr(Ln,zc()):void 0},(Dn=Ln.type==="query"?Ln[xt]:void 0)?(sn=Dn(),[3,6]):[3,2];case 2:return ii.query?[4,Bs(ii.query(Ln.originalArgs),an,ii.extraOptions)]:[3,4];case 3:return sn=Zo.sent(),ii.transformResponse&&(Oi=ii.transformResponse),[3,6];case 4:return[4,ii.queryFn(Ln.originalArgs,an,ii.extraOptions,function(Cc){return Bs(Cc,an,ii.extraOptions)})];case 5:sn=Zo.sent(),Zo.label=6;case 6:if(sn.error)throw new F(sn.error,sn.meta);return it=qi,[4,Oi(sn.data,sn.meta,Ln.originalArgs)];case 7:return[2,it.apply(void 0,[Zo.sent(),(Cr={fulfilledTimeStamp:Date.now(),baseQueryMeta:sn.meta},Cr[on.SHOULD_AUTOBATCH]=!0,Cr)])];case 8:if(vt=Zo.sent(),!((Jt=vt)instanceof F))return[3,12];Nn=Zt,ii.query&&ii.transformErrorResponse&&(Nn=ii.transformErrorResponse),Zo.label=9;case 9:return Zo.trys.push([9,11,,12]),En=fr,[4,Nn(Jt.value,Jt.meta,Ln.originalArgs)];case 10:return[2,En.apply(void 0,[Zo.sent(),(Yr={baseQueryMeta:Jt.meta},Yr[on.SHOULD_AUTOBATCH]=!0,Yr)])];case 11:return Kn=Zo.sent(),Jt=Kn,[3,12];case 12:throw console.error(Jt),Jt;case 13:return[2]}})})};function hr(Hn,ni){var Ln,Wn,ii,Oi,sn=(Wn=(Ln=ni[To])==null?void 0:Ln.queries)==null?void 0:Wn[Hn.queryCacheKey],an=(ii=ni[To])==null?void 0:ii.config.refetchOnMountOrArgChange,Dn=sn==null?void 0:sn.fulfilledTimeStamp,it=(Oi=Hn.forceRefetch)!=null?Oi:Hn.subscribe&&an;return!!it&&(it===!0||(Number(new Date)-Number(Dn))/1e3>=it)}var yr=(0,on.createAsyncThunk)(To+"/executeQuery",Gr,{getPendingMeta:function(){var Hn;return(Hn={startedTimeStamp:Date.now()})[on.SHOULD_AUTOBATCH]=!0,Hn},condition:function(Hn,ni){var Ln,Wn,ii,Oi=(0,ni.getState)(),sn=(Wn=(Ln=Oi[To])==null?void 0:Ln.queries)==null?void 0:Wn[Hn.queryCacheKey],an=sn==null?void 0:sn.fulfilledTimeStamp,Dn=Hn.originalArgs,it=sn==null?void 0:sn.originalArgs,vt=ns[Hn.endpointName];return!(!Kt(Hn)&&((sn==null?void 0:sn.status)==="pending"||!hr(Hn,Oi)&&(!Ze(vt)||!((ii=vt==null?void 0:vt.forceRefetch)!=null&&ii.call(vt,{currentArg:Dn,previousArg:it,endpointState:sn,state:Oi})))&&an))},dispatchConditionRejection:!0}),zr=(0,on.createAsyncThunk)(To+"/executeMutation",Gr,{getPendingMeta:function(){var Hn;return(Hn={startedTimeStamp:Date.now()})[on.SHOULD_AUTOBATCH]=!0,Hn}});function Fi(Hn){return function(ni){var Ln,Wn;return((Wn=(Ln=ni==null?void 0:ni.meta)==null?void 0:Ln.arg)==null?void 0:Wn.endpointName)===Hn}}return{queryThunk:yr,mutationThunk:zr,prefetch:function(Hn,ni,Ln){return function(Wn,ii){var Oi=function(vt){return"force"in vt}(Ln)&&Ln.force,sn=function(vt){return"ifOlderThan"in vt}(Ln)&&Ln.ifOlderThan,an=function(vt){return vt===void 0&&(vt=!0),_o.endpoints[Hn].initiate(ni,{forceRefetch:vt})},Dn=_o.endpoints[Hn].select(ni)(ii());if(Oi)Wn(an());else if(sn){var it=Dn==null?void 0:Dn.fulfilledTimeStamp;if(!it)return void Wn(an());(Number(new Date)-Number(new Date(it)))/1e3>=sn&&Wn(an())}else Wn(an(!1))}},updateQueryData:function(Hn,ni,Ln,Wn){return Wn===void 0&&(Wn=!0),function(ii,Oi){var sn,an,Dn,it=_o.endpoints[Hn].select(ni)(Oi()),vt={patches:[],inversePatches:[],undo:function(){return ii(_o.util.patchQueryData(Hn,ni,vt.inversePatches,Wn))}};if(it.status===e.uninitialized)return vt;if("data"in it)if((0,wn.isDraftable)(it.data)){var Jt=(0,wn.produceWithPatches)(it.data,Ln),Nn=Jt[0],En=Jt[2];(sn=vt.patches).push.apply(sn,Jt[1]),(an=vt.inversePatches).push.apply(an,En),Dn=Nn}else Dn=Ln(it.data),vt.patches.push({op:"replace",path:[],value:Dn}),vt.inversePatches.push({op:"replace",path:[],value:it.data});return ii(_o.util.patchQueryData(Hn,ni,vt.patches,Wn)),vt}},upsertQueryData:function(Hn,ni,Ln){return function(Wn){var ii;return Wn(_o.endpoints[Hn].initiate(ni,((ii={subscribe:!1,forceRefetch:!0})[xt]=function(){return{data:Ln}},ii)))}},patchQueryData:function(Hn,ni,Ln,Wn){return function(ii,Oi){var sn=ns[Hn],an=$s({queryArgs:ni,endpointDefinition:sn,endpointName:Hn});if(ii(_o.internalActions.queryResultPatched({queryCacheKey:an,patches:Ln})),Wn){var Dn=_o.endpoints[Hn].select(ni)(Oi()),it=tt(sn.providesTags,Dn.data,void 0,ni,{},Ar);ii(_o.internalActions.updateProvidedBy({queryCacheKey:an,providedTags:it}))}}},buildMatchThunkActions:function(Hn,ni){return{matchPending:(0,cn.isAllOf)((0,cn.isPending)(Hn),Fi(ni)),matchFulfilled:(0,cn.isAllOf)((0,cn.isFulfilled)(Hn),Fi(ni)),matchRejected:(0,cn.isAllOf)((0,cn.isRejected)(Hn),Fi(ni))}}}}({baseQuery:tn,reducerPath:Je,context:It,api:Oe,serializeQueryArgs:ve,assertTagType:ot}),Qt=Ue.queryThunk,gn=Ue.mutationThunk,Pn=Ue.patchQueryData,Zn=Ue.updateQueryData,wi=Ue.upsertQueryData,Sn=Ue.prefetch,Xt=Ue.buildMatchThunkActions,ti=function(ci){var lo=ci.reducerPath,To=ci.queryThunk,Bs=ci.mutationThunk,ns=ci.context,$s=ns.endpointDefinitions,_o=ns.apiUid,Ar=ns.extractRehydrationInfo,Gr=ns.hasRehydrationInfo,hr=ci.assertTagType,yr=ci.config,zr=(0,kt.createAction)(lo+"/resetApiState"),Fi=(0,kt.createSlice)({name:lo+"/queries",initialState:le,reducers:{removeQueryResult:{reducer:function(sn,an){delete sn[an.payload.queryCacheKey]},prepare:(0,kt.prepareAutoBatched)()},queryResultPatched:{reducer:function(sn,an){var Dn=an.payload,it=Dn.patches;G(sn,Dn.queryCacheKey,function(vt){vt.data=(0,Z.applyPatches)(vt.data,it.concat())})},prepare:(0,kt.prepareAutoBatched)()}},extraReducers:function(sn){sn.addCase(To.pending,function(an,Dn){var it,vt=Dn.meta,Jt=Dn.meta.arg,Nn=Kt(Jt);(Jt.subscribe||Nn)&&(an[it=Jt.queryCacheKey]!=null||(an[it]={status:e.uninitialized,endpointName:Jt.endpointName})),G(an,Jt.queryCacheKey,function(En){En.status=e.pending,En.requestId=Nn&&En.requestId?En.requestId:vt.requestId,Jt.originalArgs!==void 0&&(En.originalArgs=Jt.originalArgs),En.startedTimeStamp=vt.startedTimeStamp})}).addCase(To.fulfilled,function(an,Dn){var it=Dn.meta,vt=Dn.payload;G(an,it.arg.queryCacheKey,function(Jt){var Nn;if(Jt.requestId===it.requestId||Kt(it.arg)){var En=$s[it.arg.endpointName].merge;if(Jt.status=e.fulfilled,En)if(Jt.data!==void 0){var Kn=it.fulfilledTimeStamp,Cr=it.arg,Yr=it.baseQueryMeta,Br=it.requestId,$a=(0,kt.createNextState)(Jt.data,function(fr){return En(fr,vt,{arg:Cr.originalArgs,baseQueryMeta:Yr,fulfilledTimeStamp:Kn,requestId:Br})});Jt.data=$a}else Jt.data=vt;else Jt.data=(Nn=$s[it.arg.endpointName].structuralSharing)==null||Nn?L((0,me.isDraft)(Jt.data)?(0,Z.original)(Jt.data):Jt.data,vt):vt;delete Jt.error,Jt.fulfilledTimeStamp=it.fulfilledTimeStamp}})}).addCase(To.rejected,function(an,Dn){var it=Dn.meta,vt=it.condition,Jt=it.requestId,Nn=Dn.error,En=Dn.payload;G(an,it.arg.queryCacheKey,function(Kn){if(!vt){if(Kn.requestId!==Jt)return;Kn.status=e.rejected,Kn.error=En??Nn}})}).addMatcher(Gr,function(an,Dn){for(var it=Ar(Dn).queries,vt=0,Jt=Object.entries(it);vt<Jt.length;vt++){var Nn=Jt[vt],En=Nn[1];(En==null?void 0:En.status)!==e.fulfilled&&(En==null?void 0:En.status)!==e.rejected||(an[Nn[0]]=En)}})}}),Hn=(0,kt.createSlice)({name:lo+"/mutations",initialState:le,reducers:{removeMutationResult:{reducer:function(sn,an){var Dn=K(an.payload);Dn in sn&&delete sn[Dn]},prepare:(0,kt.prepareAutoBatched)()}},extraReducers:function(sn){sn.addCase(Bs.pending,function(an,Dn){var it=Dn.meta,vt=it.requestId,Jt=it.arg,Nn=it.startedTimeStamp;Jt.track&&(an[K(Dn.meta)]={requestId:vt,status:e.pending,endpointName:Jt.endpointName,startedTimeStamp:Nn})}).addCase(Bs.fulfilled,function(an,Dn){var it=Dn.payload,vt=Dn.meta;vt.arg.track&&oe(an,vt,function(Jt){Jt.requestId===vt.requestId&&(Jt.status=e.fulfilled,Jt.data=it,Jt.fulfilledTimeStamp=vt.fulfilledTimeStamp)})}).addCase(Bs.rejected,function(an,Dn){var it=Dn.payload,vt=Dn.error,Jt=Dn.meta;Jt.arg.track&&oe(an,Jt,function(Nn){Nn.requestId===Jt.requestId&&(Nn.status=e.rejected,Nn.error=it??vt)})}).addMatcher(Gr,function(an,Dn){for(var it=Ar(Dn).mutations,vt=0,Jt=Object.entries(it);vt<Jt.length;vt++){var Nn=Jt[vt],En=Nn[0],Kn=Nn[1];(Kn==null?void 0:Kn.status)!==e.fulfilled&&(Kn==null?void 0:Kn.status)!==e.rejected||En===(Kn==null?void 0:Kn.requestId)||(an[En]=Kn)}})}}),ni=(0,kt.createSlice)({name:lo+"/invalidation",initialState:le,reducers:{updateProvidedBy:{reducer:function(sn,an){for(var Dn,it,vt,Jt,Nn=an.payload,En=Nn.queryCacheKey,Kn=Nn.providedTags,Cr=0,Yr=Object.values(sn);Cr<Yr.length;Cr++)for(var Br=0,$a=Object.values(Yr[Cr]);Br<$a.length;Br++){var fr=$a[Br],qi=fr.indexOf(En);qi!==-1&&fr.splice(qi,1)}for(var Vs=0,zc=Kn;Vs<zc.length;Vs++){var _u=zc[Vs],Zo=_u.type,Cc=_u.id,tc=(Jt=(it=(Dn=sn[Zo])!=null?Dn:sn[Zo]={})[vt=Cc||"__internal_without_id"])!=null?Jt:it[vt]=[];tc.includes(En)||tc.push(En)}},prepare:(0,kt.prepareAutoBatched)()}},extraReducers:function(sn){sn.addCase(Fi.actions.removeQueryResult,function(an,Dn){for(var it=Dn.payload.queryCacheKey,vt=0,Jt=Object.values(an);vt<Jt.length;vt++)for(var Nn=0,En=Object.values(Jt[vt]);Nn<En.length;Nn++){var Kn=En[Nn],Cr=Kn.indexOf(it);Cr!==-1&&Kn.splice(Cr,1)}}).addMatcher(Gr,function(an,Dn){for(var it,vt,Jt,Nn,En=Ar(Dn).provided,Kn=0,Cr=Object.entries(En);Kn<Cr.length;Kn++)for(var Yr=Cr[Kn],Br=Yr[0],$a=0,fr=Object.entries(Yr[1]);$a<fr.length;$a++)for(var qi=fr[$a],Vs=qi[0],zc=qi[1],_u=(Nn=(vt=(it=an[Br])!=null?it:an[Br]={})[Jt=Vs||"__internal_without_id"])!=null?Nn:vt[Jt]=[],Zo=0,Cc=zc;Zo<Cc.length;Zo++){var tc=Cc[Zo];_u.includes(tc)||_u.push(tc)}}).addMatcher((0,kt.isAnyOf)((0,kt.isFulfilled)(To),(0,kt.isRejectedWithValue)(To)),function(an,Dn){var it=pe(Dn,"providesTags",$s,hr);ni.caseReducers.updateProvidedBy(an,ni.actions.updateProvidedBy({queryCacheKey:Dn.meta.arg.queryCacheKey,providedTags:it}))})}}),Ln=(0,kt.createSlice)({name:lo+"/subscriptions",initialState:le,reducers:{updateSubscriptionOptions:function(sn,an){},unsubscribeQueryResult:function(sn,an){},internal_probeSubscription:function(sn,an){}}}),Wn=(0,kt.createSlice)({name:lo+"/internalSubscriptions",initialState:le,reducers:{subscriptionsUpdated:{reducer:function(sn,an){return(0,Z.applyPatches)(sn,an.payload)},prepare:(0,kt.prepareAutoBatched)()}}}),ii=(0,kt.createSlice)({name:lo+"/config",initialState:_({online:typeof navigator>"u"||navigator.onLine===void 0||navigator.onLine,focused:typeof document>"u"||document.visibilityState!=="hidden",middlewareRegistered:!1},yr),reducers:{middlewareRegistered:function(sn,an){sn.middlewareRegistered=sn.middlewareRegistered!=="conflict"&&_o===an.payload||"conflict"}},extraReducers:function(sn){sn.addCase(se,function(an){an.online=!0}).addCase(he,function(an){an.online=!1}).addCase(Y,function(an){an.focused=!0}).addCase(ne,function(an){an.focused=!1}).addMatcher(Gr,function(an){return _({},an)})}}),Oi=(0,kt.combineReducers)({queries:Fi.reducer,mutations:Hn.reducer,provided:ni.reducer,subscriptions:Wn.reducer,config:ii.reducer});return{reducer:function(sn,an){return Oi(zr.match(an)?void 0:sn,an)},actions:v(_(_(_(_(_(_({},ii.actions),Fi.actions),Ln.actions),Wn.actions),Hn.actions),ni.actions),{unsubscribeMutationResult:Hn.actions.removeMutationResult,resetApiState:zr})}}({context:It,queryThunk:Qt,mutationThunk:gn,reducerPath:Je,assertTagType:ot,config:{refetchOnFocus:fe,refetchOnReconnect:Fe,refetchOnMountOrArgChange:Le,keepUnusedDataFor:je,reducerPath:Je}}),or=ti.reducer,Dr=ti.actions;xr(Oe.util,{patchQueryData:Pn,updateQueryData:Zn,upsertQueryData:wi,prefetch:Sn,resetApiState:Dr.resetApiState}),xr(Oe.internalActions,Dr);var xa=function(ci){var lo=ci.reducerPath,To=ci.queryThunk,Bs=ci.api,ns=ci.context,$s=ns.apiUid,_o={invalidateTags:(0,Mt.createAction)(lo+"/invalidateTags")},Ar=[ko,On,xn,un,xi,Wr];return{middleware:function(hr){var yr=!1,zr=v(_({},ci),{internalState:{currentSubscriptions:{}},refetchQuery:Gr}),Fi=Ar.map(function(Ln){return Ln(zr)}),Hn=function(Ln){var Wn=Ln.api,ii=Ln.queryThunk,Oi=Ln.internalState,sn=Wn.reducerPath+"/subscriptions",an=null,Dn=!1,it=Wn.internalActions,vt=it.updateSubscriptionOptions,Jt=it.unsubscribeQueryResult;return function(Nn,En){var Kn,Cr;if(an||(an=JSON.parse(JSON.stringify(Oi.currentSubscriptions))),Wn.util.resetApiState.match(Nn))return an=Oi.currentSubscriptions={},[!0,!1];if(Wn.internalActions.internal_probeSubscription.match(Nn)){var Yr=Nn.payload;return[!1,!!((Kn=Oi.currentSubscriptions[Yr.queryCacheKey])!=null&&Kn[Yr.requestId])]}var Br=function(qi,Vs){var zc,_u,Zo,Cc,tc,F_,uS,cl,Db;if(vt.match(Vs)){var _h=Vs.payload,B_=_h.queryCacheKey,nd=_h.requestId;return(zc=qi==null?void 0:qi[B_])!=null&&zc[nd]&&(qi[B_][nd]=_h.options),!0}if(Jt.match(Vs)){var jc=Vs.payload;return nd=jc.requestId,qi[B_=jc.queryCacheKey]&&delete qi[B_][nd],!0}if(Wn.internalActions.removeQueryResult.match(Vs))return delete qi[Vs.payload.queryCacheKey],!0;if(ii.pending.match(Vs)){var dS=Vs.meta;if(nd=dS.requestId,(Vg=dS.arg).subscribe)return($_=(Zo=qi[_u=Vg.queryCacheKey])!=null?Zo:qi[_u]={})[nd]=(tc=(Cc=Vg.subscriptionOptions)!=null?Cc:$_[nd])!=null?tc:{},!0}if(ii.rejected.match(Vs)){var $_,Ab=Vs.meta,Vg=Ab.arg;if(nd=Ab.requestId,Ab.condition&&Vg.subscribe)return($_=(uS=qi[F_=Vg.queryCacheKey])!=null?uS:qi[F_]={})[nd]=(Db=(cl=Vg.subscriptionOptions)!=null?cl:$_[nd])!=null?Db:{},!0}return!1}(Oi.currentSubscriptions,Nn);if(Br){Dn||(ea(function(){var qi=JSON.parse(JSON.stringify(Oi.currentSubscriptions)),Vs=(0,oo.produceWithPatches)(an,function(){return qi});En.next(Wn.internalActions.subscriptionsUpdated(Vs[1])),an=qi,Dn=!1}),Dn=!0);var $a=!!((Cr=Nn.type)!=null&&Cr.startsWith(sn)),fr=ii.rejected.match(Nn)&&Nn.meta.condition&&!!Nn.meta.arg.subscribe;return[!$a&&!fr,!1]}return[!0,!1]}}(zr),ni=function(Ln){var Wn=Ln.reducerPath,ii=Ln.context,Oi=Ln.refetchQuery,sn=Ln.internalState,an=Ln.api.internalActions.removeQueryResult;function Dn(it,vt){var Jt=it.getState()[Wn],Nn=Jt.queries,En=sn.currentSubscriptions;ii.batch(function(){for(var Kn=0,Cr=Object.keys(En);Kn<Cr.length;Kn++){var Yr=Cr[Kn],Br=Nn[Yr],$a=En[Yr];$a&&Br&&(Object.values($a).some(function(fr){return fr[vt]===!0})||Object.values($a).every(function(fr){return fr[vt]===void 0})&&Jt.config[vt])&&(Object.keys($a).length===0?it.dispatch(an({queryCacheKey:Yr})):Br.status!==e.uninitialized&&it.dispatch(Oi(Br,Yr)))}})}return function(it,vt){Y.match(it)&&Dn(vt,"refetchOnFocus"),se.match(it)&&Dn(vt,"refetchOnReconnect")}}(zr);return function(Ln){return function(Wn){yr||(yr=!0,hr.dispatch(Bs.internalActions.middlewareRegistered($s)));var ii,Oi=v(_({},hr),{next:Ln}),sn=hr.getState(),an=Hn(Wn,Oi,sn),Dn=an[1];if(ii=an[0]?Ln(Wn):Dn,hr.getState()[lo]&&(ni(Wn,Oi,sn),function(Jt){return!!Jt&&typeof Jt.type=="string"&&Jt.type.startsWith(lo+"/")}(Wn)||ns.hasRehydrationInfo(Wn)))for(var it=0,vt=Fi;it<vt.length;it++)(0,vt[it])(Wn,Oi,sn);return ii}}},actions:_o};function Gr(hr,yr,zr){return zr===void 0&&(zr={}),To(_({type:"query",endpointName:hr.endpointName,originalArgs:hr.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:yr},zr))}}({reducerPath:Je,context:It,queryThunk:Qt,mutationThunk:gn,api:Oe,assertTagType:ot}),pa=xa.middleware;xr(Oe.util,xa.actions),xr(Oe,{reducer:or,middleware:pa});var Ba=function(ci){var lo=ci.serializeQueryArgs,To=ci.reducerPath,Bs=function(Ar){return Nt},ns=function(Ar){return Yt};return{buildQuerySelector:function(Ar,Gr){return function(hr){var yr=lo({queryArgs:hr,endpointDefinition:Gr,endpointName:Ar});return(0,Ye.createSelector)(hr===we?Bs:function(zr){var Fi,Hn,ni;return(ni=(Hn=(Fi=_o(zr))==null?void 0:Fi.queries)==null?void 0:Hn[yr])!=null?ni:Nt},$s)}},buildMutationSelector:function(){return function(Ar){var Gr,hr;return hr=typeof Ar=="object"?(Gr=K(Ar))!=null?Gr:we:Ar,(0,Ye.createSelector)(hr===we?ns:function(yr){var zr,Fi,Hn;return(Hn=(Fi=(zr=_o(yr))==null?void 0:zr.mutations)==null?void 0:Fi[hr])!=null?Hn:Yt},$s)}},selectInvalidatedBy:function(Ar,Gr){for(var hr,yr=Ar[To],zr=new Set,Fi=0,Hn=Gr.map(Be);Fi<Hn.length;Fi++){var ni=Hn[Fi],Ln=yr.provided[ni.type];if(Ln)for(var Wn=0,ii=(hr=ni.id!==void 0?Ln[ni.id]:k(Object.values(Ln)))!=null?hr:[];Wn<ii.length;Wn++)zr.add(ii[Wn])}return k(Array.from(zr.values()).map(function(Oi){var sn=yr.queries[Oi];return sn?[{queryCacheKey:Oi,endpointName:sn.endpointName,originalArgs:sn.originalArgs}]:[]}))}};function $s(Ar){return _(_({},Ar),{status:Gr=Ar.status,isUninitialized:Gr===e.uninitialized,isLoading:Gr===e.pending,isSuccess:Gr===e.fulfilled,isError:Gr===e.rejected});var Gr}function _o(Ar){return Ar[To]}}({serializeQueryArgs:ve,reducerPath:Je}),Uo=Ba.buildQuerySelector,Xo=Ba.buildMutationSelector;xr(Oe.util,{selectInvalidatedBy:Ba.selectInvalidatedBy});var qo=function(ci){var lo=ci.serializeQueryArgs,To=ci.queryThunk,Bs=ci.mutationThunk,ns=ci.api,$s=ci.context,_o=new Map,Ar=new Map,Gr=ns.internalActions,hr=Gr.unsubscribeQueryResult,yr=Gr.removeMutationResult,zr=Gr.updateSubscriptionOptions;return{buildInitiateQuery:function(Fi,Hn){var ni=function(Ln,Wn){var ii=Wn===void 0?{}:Wn,Oi=ii.subscribe,sn=Oi===void 0||Oi,an=ii.forceRefetch,Dn=ii.subscriptionOptions,it=ii[xt];return function(vt,Jt){var Nn,En,Kn=lo({queryArgs:Ln,endpointDefinition:Hn,endpointName:Fi}),Cr=To(((Nn={type:"query",subscribe:sn,forceRefetch:an,subscriptionOptions:Dn,endpointName:Fi,originalArgs:Ln,queryCacheKey:Kn})[xt]=it,Nn)),Yr=ns.endpoints[Fi].select(Ln),Br=vt(Cr),$a=Yr(Jt()),fr=Br.requestId,qi=Br.abort,Vs=$a.requestId!==fr,zc=(En=_o.get(vt))==null?void 0:En[Kn],_u=function(){return Yr(Jt())},Zo=Object.assign(it?Br.then(_u):Vs&&!zc?Promise.resolve($a):Promise.all([zc,Br]).then(_u),{arg:Ln,requestId:fr,subscriptionOptions:Dn,queryCacheKey:Kn,abort:qi,unwrap:function(){return x(this,null,function(){var tc;return i(this,function(F_){switch(F_.label){case 0:return[4,Zo];case 1:if((tc=F_.sent()).isError)throw tc.error;return[2,tc.data]}})})},refetch:function(){return vt(ni(Ln,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){sn&&vt(hr({queryCacheKey:Kn,requestId:fr}))},updateSubscriptionOptions:function(tc){Zo.subscriptionOptions=tc,vt(zr({endpointName:Fi,requestId:fr,queryCacheKey:Kn,options:tc}))}});if(!zc&&!Vs&&!it){var Cc=_o.get(vt)||{};Cc[Kn]=Zo,_o.set(vt,Cc),Zo.then(function(){delete Cc[Kn],Object.keys(Cc).length||_o.delete(vt)})}return Zo}};return ni},buildInitiateMutation:function(Fi){return function(Hn,ni){var Ln=ni===void 0?{}:ni,Wn=Ln.track,ii=Wn===void 0||Wn,Oi=Ln.fixedCacheKey;return function(sn,an){var Dn=Bs({type:"mutation",endpointName:Fi,originalArgs:Hn,track:ii,fixedCacheKey:Oi}),it=sn(Dn),vt=it.requestId,Jt=it.abort,Nn=it.unwrap,En=it.unwrap().then(function(Br){return{data:Br}}).catch(function(Br){return{error:Br}}),Kn=function(){sn(yr({requestId:vt,fixedCacheKey:Oi}))},Cr=Object.assign(En,{arg:it.arg,requestId:vt,abort:Jt,unwrap:Nn,unsubscribe:Kn,reset:Kn}),Yr=Ar.get(sn)||{};return Ar.set(sn,Yr),Yr[vt]=Cr,Cr.then(function(){delete Yr[vt],Object.keys(Yr).length||Ar.delete(sn)}),Oi&&(Yr[Oi]=Cr,Cr.then(function(){Yr[Oi]===Cr&&(delete Yr[Oi],Object.keys(Yr).length||Ar.delete(sn))})),Cr}}},getRunningQueryThunk:function(Fi,Hn){return function(ni){var Ln,Wn=lo({queryArgs:Hn,endpointDefinition:$s.endpointDefinitions[Fi],endpointName:Fi});return(Ln=_o.get(ni))==null?void 0:Ln[Wn]}},getRunningMutationThunk:function(Fi,Hn){return function(ni){var Ln;return(Ln=Ar.get(ni))==null?void 0:Ln[Hn]}},getRunningQueriesThunk:function(){return function(Fi){return Object.values(_o.get(Fi)||{}).filter(Vt)}},getRunningMutationsThunk:function(){return function(Fi){return Object.values(Ar.get(Fi)||{}).filter(Vt)}},getRunningOperationPromises:function(){var Fi=function(Hn){return Array.from(Hn.values()).flatMap(function(ni){return ni?Object.values(ni):[]})};return r(r([],Fi(_o)),Fi(Ar)).filter(Vt)},removalWarning:function(){throw new Error(`This method had to be removed due to a conceptual bug in RTK.
Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.
See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.`)}}}({queryThunk:Qt,mutationThunk:gn,api:Oe,serializeQueryArgs:ve,context:It}),Ll=qo.buildInitiateQuery,yc=qo.buildInitiateMutation;return xr(Oe.util,{getRunningOperationPromises:qo.getRunningOperationPromises,getRunningOperationPromise:qo.removalWarning,getRunningMutationThunk:qo.getRunningMutationThunk,getRunningMutationsThunk:qo.getRunningMutationsThunk,getRunningQueryThunk:qo.getRunningQueryThunk,getRunningQueriesThunk:qo.getRunningQueriesThunk}),{name:Ht,injectEndpoint:function(ci,lo){var To,Bs=Oe;(To=Bs.endpoints)[ci]!=null||(To[ci]={}),Ze(lo)?xr(Bs.endpoints[ci],{name:ci,select:Uo(ci,lo),initiate:Ll(ci,lo)},Xt(Qt,ci)):lo.type===Ie.mutation&&xr(Bs.endpoints[ci],{name:ci,select:Xo(),initiate:yc(ci)},Xt(gn,ci))}}}}},Fr=wt(Qn())})(o6e);r6e.exports=o6e;var Fxt=r6e.exports;/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const Bxt={api:{},latestQueryUrl:""},s6e=H2({name:"companyDocuments",initialState:Bxt,reducers:{updateLatestQueryUrl:(n,e)=>{n.latestQueryUrl=e.payload.url}}});s6e.actions;/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const $xt={currentPage:1,filter:""},a6e=H2({name:"products",initialState:$xt,reducers:{updateCurrentPage:(n,e)=>{n.currentPage=e.payload.number},updateFilter:(n,e)=>{n.filter=e.payload.filter}}});a6e.actions;/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const Vxt={colors:{primary:"#117DC0"},darkMode:!1,activeSettings:{name:"",level:"company"}},l6e=H2({name:"settings",initialState:Vxt,reducers:{updatePrimaryColor:(n,e)=>{n.colors.primary=e.payload.color},setDarkMode:(n,e)=>{n.darkMode=e.payload.status},setActiveSettings:(n,e)=>{n.activeSettings=e.payload.status}}}),{updatePrimaryColor:uhr,setDarkMode:dhr,setActiveSettings:x3}=l6e.actions;/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const y7=d3e({reducer:{companyUsers:P3e.reducer,companyDocuments:s6e.reducer,user:M3e.reducer,products:a6e.reducer,settings:l6e.reducer},middleware:n=>n({serializableCheck:!1})});Fxt.setupListeners(y7.dispatch);function Hxt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19 2H9c-1.103 0-2 .897-2 2v6H5c-1.103 0-2 .897-2 2v9a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1V4c0-1.103-.897-2-2-2zM5 12h6v8H5v-8zm14 8h-6v-8c0-1.103-.897-2-2-2H9V4h10v16z"}},{tag:"path",attr:{d:"M11 6h2v2h-2zm4 0h2v2h-2zm0 4.031h2V12h-2zM15 14h2v2h-2zm-8 .001h2v2H7z"}}]})(n)}function Wxt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M5 21h14c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2zM5 5h14l.001 14H5V5z"}},{tag:"path",attr:{d:"m6.293 13.293 1.414 1.414L12 10.414l4.293 4.293 1.414-1.414L12 7.586z"}}]})(n)}function Ife(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19.903 8.586a.997.997 0 0 0-.196-.293l-6-6a.997.997 0 0 0-.293-.196c-.03-.014-.062-.022-.094-.033a.991.991 0 0 0-.259-.051C13.04 2.011 13.021 2 13 2H6c-1.103 0-2 .897-2 2v16c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2V9c0-.021-.011-.04-.013-.062a.952.952 0 0 0-.051-.259c-.01-.032-.019-.063-.033-.093zM16.586 8H14V5.414L16.586 8zM6 20V4h6v5a1 1 0 0 0 1 1h5l.002 10H6z"}},{tag:"path",attr:{d:"M8 12h8v2H8zm0 4h8v2H8zm0-8h2v2H8z"}}]})(n)}function zxt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M2.5 18.5C2.5 20.43 4.07 22 6 22s3.5-1.57 3.5-3.5c0-1.58-1.06-2.903-2.5-3.337v-3.488c.244.273.509.527.813.744 1.18.844 2.617 1.098 3.918 1.098.966 0 1.853-.14 2.506-.281a3.5 3.5 0 0 0 3.264 2.265c1.93 0 3.5-1.57 3.5-3.5s-1.57-3.5-3.5-3.5a3.5 3.5 0 0 0-3.404 2.718c-1.297.321-3.664.616-5.119-.426-.666-.477-1.09-1.239-1.306-2.236C8.755 7.96 9.5 6.821 9.5 5.5 9.5 3.57 7.93 2 6 2S2.5 3.57 2.5 5.5c0 1.58 1.06 2.903 2.5 3.337v6.326c-1.44.434-2.5 1.757-2.5 3.337zm15-8c.827 0 1.5.673 1.5 1.5s-.673 1.5-1.5 1.5S16 12.827 16 12s.673-1.5 1.5-1.5zm-10 8c0 .827-.673 1.5-1.5 1.5s-1.5-.673-1.5-1.5S5.173 17 6 17s1.5.673 1.5 1.5zm-3-13C4.5 4.673 5.173 4 6 4s1.5.673 1.5 1.5S6.827 7 6 7s-1.5-.673-1.5-1.5z"}}]})(n)}function hhr(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21 4H3a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1zm-1 11a3 3 0 0 0-3 3H7a3 3 0 0 0-3-3V9a3 3 0 0 0 3-3h10a3 3 0 0 0 3 3v6z"}},{tag:"path",attr:{d:"M12 8c-2.206 0-4 1.794-4 4s1.794 4 4 4 4-1.794 4-4-1.794-4-4-4zm0 6c-1.103 0-2-.897-2-2s.897-2 2-2 2 .897 2 2-.897 2-2 2z"}}]})(n)}function eg(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z"}},{tag:"path",attr:{d:"M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.514 2 12 2zm0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8 8 3.589 8 8-3.589 8-8 8z"}}]})(n)}function ISe(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z"}}]})(n)}function jxt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M7 20h2V8h3L8 4 4 8h3zm13-4h-3V4h-2v12h-3l4 4z"}}]})(n)}function Uxt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16 12h2v4h-2z"}},{tag:"path",attr:{d:"M20 7V5c0-1.103-.897-2-2-2H5C3.346 3 2 4.346 2 6v12c0 2.201 1.794 3 3 3h15c1.103 0 2-.897 2-2V9c0-1.103-.897-2-2-2zM5 5h13v2H5a1.001 1.001 0 0 1 0-2zm15 14H5.012C4.55 18.988 4 18.805 4 18V8.815c.314.113.647.185 1 .185h15v10z"}}]})(n)}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Xz(){return Tl(n=>n.companyUsers.api[n.companyUsers.currentIndex])}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function zo(){const n=Xz();return e=>{const t=(n==null?void 0:n.permissions)??"",[i]=e.split("_");return!!(n!=null&&n.is_admin||n!=null&&n.is_owner||t.includes(e)||t.includes(`${i}_all`)&&e!=="view_reports"&&e!=="view_dashboard")}}function ao(){const n=Xz();return{isAdmin:!!(n!=null&&n.is_admin),isOwner:!!(n!=null&&n.is_owner||n!=null&&n.is_owner)}}function c6e(){var C,x;const[n]=ue(),e=Ci(),t=ri(),i=Tl(k=>k.companyUsers),{id:r}=Fa(),o=t3(),s=Qz(),a=ha(),l=ol(),c=Vn(),u=Axt(),d=Kr(),{isAdmin:h,isOwner:g}=ao(),p=vi(),[m,_]=w.useState(!1),[v,b]=w.useState(!1),y=k=>{if(e(h3({type:W2.TOKEN,user:i.api[k].user,token:i.api[k].token.token})),localStorage.setItem("X-CURRENT-INDEX",k.toString()),localStorage.setItem("COMPANY-EDIT-OPENED","false"),sessionStorage.setItem("COMPANY-ACTIVITY-SHOWN","false"),d.invalidateQueries(),r){const I="/"+(l.pathname.includes("/settings/gateways")?"settings/online_payments":l.pathname.split("/")[1]||"dashboard");t(I)}window.location.reload()};return w.useEffect(()=>{i.api.length<10&&_(!0),u0()&&_(!1)},[p]),N(_t,{children:[f(Pxt,{isModalOpen:v,setIsModalOpen:b}),N(K0,{as:"div",className:"relative inline-block text-left w-full","data-cy":"companyDropdown",children:[N(K0.Button,{className:"flex items-center justify-between w-full rounded font-medium pl-2",children:[N("div",{className:"flex items-center justify-center space-x-3",children:[f("img",{className:"w-8",src:s,alt:"Company logo"}),N("div",{className:"flex flex-col items-between",children:[f("span",{className:"text-sm text-start w-28 truncate",children:u}),((a==null?void 0:a.first_name)||(a==null?void 0:a.last_name))&&N("span",{className:"text-xs text-start w-28 truncate",children:[a.first_name," ",a.last_name]})]})]}),f(z2,{size:18,className:"text-gray-300"})]}),f(Ly,{as:w.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:N(K0.Items,{style:{backgroundColor:c.$1,borderColor:c.$4},className:"border origin-top-right absolute left-0 mt-2 w-56 rounded shadow-lg",children:[f("div",{className:"py-1",children:f(K0.Item,{children:N(et,{children:[f("p",{className:"text-sm",children:n("signed_in_as")}),f("p",{className:"text-sm font-medium truncate",children:a==null?void 0:a.email})]})})}),f("div",{className:"py-1",children:((C=i==null?void 0:i.api)==null?void 0:C.length)>=1&&((x=i==null?void 0:i.api)==null?void 0:x.map((k,I)=>f(K0.Item,{children:f(et,{actionKey:"switchCompany",onClick:()=>y(I),children:N("div",{className:"flex items-center space-x-3",children:[f("span",{children:k.company.settings.name||n("untitled_company")}),i.currentIndex===I&&f(Zde,{size:18})]})})},I)))}),N("div",{className:"py-1",children:[m&&o&&(h||g)&&f(K0.Item,{children:f(et,{className:"flex items-center",onClick:()=>b(!0),icon:f(Ve,{element:eg,size:22}),children:f("span",{children:n("add_company")})})}),(h||g)&&f(K0.Item,{children:f(et,{to:"/settings/account_management",icon:f(Ve,{element:iyt,size:22}),children:n("account_management")})}),f(K0.Item,{children:f(et,{to:"/logout",icon:f(Ve,{element:nyt,size:22}),children:n("logout")})})]})]})})]})]})}var qxt="tippy-box",u6e="tippy-content",Kxt="tippy-backdrop",d6e="tippy-arrow",h6e="tippy-svg-arrow",MS={passive:!0,capture:!0},f6e=function(){return document.body};function mQ(n,e,t){if(Array.isArray(n)){var i=n[e];return i??(Array.isArray(t)?t[e]:t)}return n}function Lfe(n,e){var t={}.toString.call(n);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function g6e(n,e){return typeof n=="function"?n.apply(void 0,e):n}function LSe(n,e){if(e===0)return n;var t;return function(i){clearTimeout(t),t=setTimeout(function(){n(i)},e)}}function Gxt(n){return n.split(/\s+/).filter(Boolean)}function QT(n){return[].concat(n)}function DSe(n,e){n.indexOf(e)===-1&&n.push(e)}function Yxt(n){return n.filter(function(e,t){return n.indexOf(e)===t})}function Qxt(n){return n.split("-")[0]}function C7(n){return[].slice.call(n)}function ASe(n){return Object.keys(n).reduce(function(e,t){return n[t]!==void 0&&(e[t]=n[t]),e},{})}function lO(){return document.createElement("div")}function Zz(n){return["Element","Fragment"].some(function(e){return Lfe(n,e)})}function Xxt(n){return Lfe(n,"NodeList")}function Zxt(n){return Lfe(n,"MouseEvent")}function Jxt(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function ekt(n){return Zz(n)?[n]:Xxt(n)?C7(n):Array.isArray(n)?n:C7(document.querySelectorAll(n))}function _Q(n,e){n.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function RSe(n,e){n.forEach(function(t){t&&t.setAttribute("data-state",e)})}function tkt(n){var e,t=QT(n),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function nkt(n,e){var t=e.clientX,i=e.clientY;return n.every(function(r){var o=r.popperRect,s=r.popperState,a=r.props,l=a.interactiveBorder,c=Qxt(s.placement),u=s.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,h=c==="top"?u.bottom.y:0,g=c==="right"?u.left.x:0,p=c==="left"?u.right.x:0,m=o.top-i+d>l,_=i-o.bottom-h>l,v=o.left-t+g>l,b=t-o.right-p>l;return m||_||v||b})}function vQ(n,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){n[i](r,t)})}function NSe(n,e){for(var t=e;t;){var i;if(n.contains(t))return!0;t=t.getRootNode==null||(i=t.getRootNode())==null?void 0:i.host}return!1}var lv={isTouch:!1},OSe=0;function ikt(){lv.isTouch||(lv.isTouch=!0,window.performance&&document.addEventListener("mousemove",p6e))}function p6e(){var n=performance.now();n-OSe<20&&(lv.isTouch=!1,document.removeEventListener("mousemove",p6e)),OSe=n}function rkt(){var n=document.activeElement;if(Jxt(n)){var e=n._tippy;n.blur&&!e.state.isVisible&&n.blur()}}function okt(){document.addEventListener("touchstart",ikt,MS),window.addEventListener("blur",rkt)}var skt=typeof window<"u"&&typeof document<"u",akt=skt?!!window.msCrypto:!1,lkt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},ckt={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Jm=Object.assign({appendTo:f6e,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},lkt,ckt),ukt=Object.keys(Jm),dkt=function(e){var t=Object.keys(e);t.forEach(function(i){Jm[i]=e[i]})};function m6e(n){var e=n.plugins||[],t=e.reduce(function(i,r){var o=r.name,s=r.defaultValue;if(o){var a;i[o]=n[o]!==void 0?n[o]:(a=Jm[o])!=null?a:s}return i},{});return Object.assign({},n,t)}function hkt(n,e){var t=e?Object.keys(m6e(Object.assign({},Jm,{plugins:e}))):ukt,i=t.reduce(function(r,o){var s=(n.getAttribute("data-tippy-"+o)||"").trim();if(!s)return r;if(o==="content")r[o]=s;else try{r[o]=JSON.parse(s)}catch{r[o]=s}return r},{});return i}function PSe(n,e){var t=Object.assign({},e,{content:g6e(e.content,[n])},e.ignoreAttributes?{}:hkt(n,e.plugins));return t.aria=Object.assign({},Jm.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}var fkt=function(){return"innerHTML"};function xne(n,e){n[fkt()]=e}function MSe(n){var e=lO();return n===!0?e.className=d6e:(e.className=h6e,Zz(n)?e.appendChild(n):xne(e,n)),e}function FSe(n,e){Zz(e.content)?(xne(n,""),n.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?xne(n,e.content):n.textContent=e.content)}function kne(n){var e=n.firstElementChild,t=C7(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(u6e)}),arrow:t.find(function(i){return i.classList.contains(d6e)||i.classList.contains(h6e)}),backdrop:t.find(function(i){return i.classList.contains(Kxt)})}}function _6e(n){var e=lO(),t=lO();t.className=qxt,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var i=lO();i.className=u6e,i.setAttribute("data-state","hidden"),FSe(i,n.props),e.appendChild(t),t.appendChild(i),r(n.props,n.props);function r(o,s){var a=kne(e),l=a.box,c=a.content,u=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&FSe(c,n.props),s.arrow?u?o.arrow!==s.arrow&&(l.removeChild(u),l.appendChild(MSe(s.arrow))):l.appendChild(MSe(s.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:r}}_6e.$$tippy=!0;var gkt=1,y6=[],bQ=[];function pkt(n,e){var t=PSe(n,Object.assign({},Jm,m6e(ASe(e)))),i,r,o,s=!1,a=!1,l=!1,c=!1,u,d,h,g=[],p=LSe(xt,t.interactiveDebounce),m,_=gkt++,v=null,b=Yxt(t.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:_,reference:n,popper:lO(),popperInstance:v,props:t,state:y,plugins:b,clearDelayTimeouts:le,setProps:we,setContent:Me,show:ft,hide:Nt,hideWithInteractivity:Yt,enable:K,disable:oe,unmount:He,destroy:Dt};if(!t.render)return C;var x=t.render(C),k=x.popper,I=x.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+C.id,C.popper=k,n._tippy=C,k._tippy=C;var L=b.map(function(ae){return ae.fn(C)}),D=n.hasAttribute("aria-expanded");return Be(),Y(),V(),$("onCreate",[C]),t.showOnCreate&&Z(),k.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&B().addEventListener("mousemove",p)}),C;function R(){var ae=C.props.touch;return Array.isArray(ae)?ae:[ae,0]}function P(){return R()[0]==="hold"}function M(){var ae;return!!((ae=C.props.render)!=null&&ae.$$tippy)}function O(){return m||n}function B(){var ae=O().parentNode;return ae?tkt(ae):document}function F(){return kne(k)}function H(ae){return C.state.isMounted&&!C.state.isVisible||lv.isTouch||u&&u.type==="focus"?0:mQ(C.props.delay,ae?0:1,Jm.delay)}function V(ae){ae===void 0&&(ae=!1),k.style.pointerEvents=C.props.interactive&&!ae?"":"none",k.style.zIndex=""+C.props.zIndex}function $(ae,Se,Xe){if(Xe===void 0&&(Xe=!0),L.forEach(function(Tt){Tt[ae]&&Tt[ae].apply(Tt,Se)}),Xe){var wt;(wt=C.props)[ae].apply(wt,Se)}}function j(){var ae=C.props.aria;if(ae.content){var Se="aria-"+ae.content,Xe=k.id,wt=QT(C.props.triggerTarget||n);wt.forEach(function(Tt){var zt=Tt.getAttribute(Se);if(C.state.isVisible)Tt.setAttribute(Se,zt?zt+" "+Xe:Xe);else{var Mt=zt&&zt.replace(Xe,"").trim();Mt?Tt.setAttribute(Se,Mt):Tt.removeAttribute(Se)}})}}function Y(){if(!(D||!C.props.aria.expanded)){var ae=QT(C.props.triggerTarget||n);ae.forEach(function(Se){C.props.interactive?Se.setAttribute("aria-expanded",C.state.isVisible&&Se===O()?"true":"false"):Se.removeAttribute("aria-expanded")})}}function ne(){B().removeEventListener("mousemove",p),y6=y6.filter(function(ae){return ae!==p})}function se(ae){if(!(lv.isTouch&&(l||ae.type==="mousedown"))){var Se=ae.composedPath&&ae.composedPath()[0]||ae.target;if(!(C.props.interactive&&NSe(k,Se))){if(QT(C.props.triggerTarget||n).some(function(Xe){return NSe(Xe,Se)})){if(lv.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else $("onClickOutside",[C,ae]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||Ie())}}}function he(){l=!0}function xe(){l=!1}function _e(){var ae=B();ae.addEventListener("mousedown",se,!0),ae.addEventListener("touchend",se,MS),ae.addEventListener("touchstart",xe,MS),ae.addEventListener("touchmove",he,MS)}function Ie(){var ae=B();ae.removeEventListener("mousedown",se,!0),ae.removeEventListener("touchend",se,MS),ae.removeEventListener("touchstart",xe,MS),ae.removeEventListener("touchmove",he,MS)}function Re(ae,Se){Ze(ae,function(){!C.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&Se()})}function Ye(ae,Se){Ze(ae,Se)}function Ze(ae,Se){var Xe=F().box;function wt(Tt){Tt.target===Xe&&(vQ(Xe,"remove",wt),Se())}if(ae===0)return Se();vQ(Xe,"remove",d),vQ(Xe,"add",wt),d=wt}function tt(ae,Se,Xe){Xe===void 0&&(Xe=!1);var wt=QT(C.props.triggerTarget||n);wt.forEach(function(Tt){Tt.addEventListener(ae,Se,Xe),g.push({node:Tt,eventType:ae,handler:Se,options:Xe})})}function Be(){P()&&(tt("touchstart",Vt,{passive:!0}),tt("touchend",Kt,{passive:!0})),Gxt(C.props.trigger).forEach(function(ae){if(ae!=="manual")switch(tt(ae,Vt),ae){case"mouseenter":tt("mouseleave",Kt);break;case"focus":tt(akt?"focusout":"blur",cn);break;case"focusin":tt("focusout",cn);break}})}function kt(){g.forEach(function(ae){var Se=ae.node,Xe=ae.eventType,wt=ae.handler,Tt=ae.options;Se.removeEventListener(Xe,wt,Tt)}),g=[]}function Vt(ae){var Se,Xe=!1;if(!(!C.state.isEnabled||wn(ae)||a)){var wt=((Se=u)==null?void 0:Se.type)==="focus";u=ae,m=ae.currentTarget,Y(),!C.state.isVisible&&Zxt(ae)&&y6.forEach(function(Tt){return Tt(ae)}),ae.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||s)&&C.props.hideOnClick!==!1&&C.state.isVisible?Xe=!0:Z(ae),ae.type==="click"&&(s=!Xe),Xe&&!wt&&G(ae)}}function xt(ae){var Se=ae.target,Xe=O().contains(Se)||k.contains(Se);if(!(ae.type==="mousemove"&&Xe)){var wt=me().concat(k).map(function(Tt){var zt,Mt=Tt._tippy,On=(zt=Mt.popperInstance)==null?void 0:zt.state;return On?{popperRect:Tt.getBoundingClientRect(),popperState:On,props:t}:null}).filter(Boolean);nkt(wt,ae)&&(ne(),G(ae))}}function Kt(ae){var Se=wn(ae)||C.props.trigger.indexOf("click")>=0&&s;if(!Se){if(C.props.interactive){C.hideWithInteractivity(ae);return}G(ae)}}function cn(ae){C.props.trigger.indexOf("focusin")<0&&ae.target!==O()||C.props.interactive&&ae.relatedTarget&&k.contains(ae.relatedTarget)||G(ae)}function wn(ae){return lv.isTouch?P()!==ae.type.indexOf("touch")>=0:!1}function on(){Zt();var ae=C.props,Se=ae.popperOptions,Xe=ae.placement,wt=ae.offset,Tt=ae.getReferenceClientRect,zt=ae.moveTransition,Mt=M()?kne(k).arrow:null,On=Tt?{getBoundingClientRect:Tt,contextElement:Tt.contextElement||O()}:n,Ni={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(ei){var li=ei.state;if(M()){var xi=F(),br=xi.box;["placement","reference-hidden","escaped"].forEach(function(Wr){Wr==="placement"?br.setAttribute("data-placement",li.placement):li.attributes.popper["data-popper-"+Wr]?br.setAttribute("data-"+Wr,""):br.removeAttribute("data-"+Wr)}),li.attributes.popper={}}}},xn=[{name:"offset",options:{offset:wt}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!zt}},Ni];M()&&Mt&&xn.push({name:"arrow",options:{element:Mt,padding:3}}),xn.push.apply(xn,(Se==null?void 0:Se.modifiers)||[]),C.popperInstance=T5e(On,k,Object.assign({},Se,{placement:Xe,onFirstUpdate:h,modifiers:xn}))}function Zt(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function pe(){var ae=C.props.appendTo,Se,Xe=O();C.props.interactive&&ae===f6e||ae==="parent"?Se=Xe.parentNode:Se=g6e(ae,[Xe]),Se.contains(k)||Se.appendChild(k),C.state.isMounted=!0,on()}function me(){return C7(k.querySelectorAll("[data-tippy-root]"))}function Z(ae){C.clearDelayTimeouts(),ae&&$("onTrigger",[C,ae]),_e();var Se=H(!0),Xe=R(),wt=Xe[0],Tt=Xe[1];lv.isTouch&&wt==="hold"&&Tt&&(Se=Tt),Se?i=setTimeout(function(){C.show()},Se):C.show()}function G(ae){if(C.clearDelayTimeouts(),$("onUntrigger",[C,ae]),!C.state.isVisible){Ie();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(ae.type)>=0&&s)){var Se=H(!1);Se?r=setTimeout(function(){C.state.isVisible&&C.hide()},Se):o=requestAnimationFrame(function(){C.hide()})}}function K(){C.state.isEnabled=!0}function oe(){C.hide(),C.state.isEnabled=!1}function le(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(o)}function we(ae){if(!C.state.isDestroyed){$("onBeforeUpdate",[C,ae]),kt();var Se=C.props,Xe=PSe(n,Object.assign({},Se,ASe(ae),{ignoreAttributes:!0}));C.props=Xe,Be(),Se.interactiveDebounce!==Xe.interactiveDebounce&&(ne(),p=LSe(xt,Xe.interactiveDebounce)),Se.triggerTarget&&!Xe.triggerTarget?QT(Se.triggerTarget).forEach(function(wt){wt.removeAttribute("aria-expanded")}):Xe.triggerTarget&&n.removeAttribute("aria-expanded"),Y(),V(),I&&I(Se,Xe),C.popperInstance&&(on(),me().forEach(function(wt){requestAnimationFrame(wt._tippy.popperInstance.forceUpdate)})),$("onAfterUpdate",[C,ae])}}function Me(ae){C.setProps({content:ae})}function ft(){var ae=C.state.isVisible,Se=C.state.isDestroyed,Xe=!C.state.isEnabled,wt=lv.isTouch&&!C.props.touch,Tt=mQ(C.props.duration,0,Jm.duration);if(!(ae||Se||Xe||wt)&&!O().hasAttribute("disabled")&&($("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,M()&&(k.style.visibility="visible"),V(),_e(),C.state.isMounted||(k.style.transition="none"),M()){var zt=F(),Mt=zt.box,On=zt.content;_Q([Mt,On],0)}h=function(){var xn;if(!(!C.state.isVisible||c)){if(c=!0,k.offsetHeight,k.style.transition=C.props.moveTransition,M()&&C.props.animation){var un=F(),ei=un.box,li=un.content;_Q([ei,li],Tt),RSe([ei,li],"visible")}j(),Y(),DSe(bQ,C),(xn=C.popperInstance)==null||xn.forceUpdate(),$("onMount",[C]),C.props.animation&&M()&&Ye(Tt,function(){C.state.isShown=!0,$("onShown",[C])})}},pe()}}function Nt(){var ae=!C.state.isVisible,Se=C.state.isDestroyed,Xe=!C.state.isEnabled,wt=mQ(C.props.duration,1,Jm.duration);if(!(ae||Se||Xe)&&($("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,c=!1,s=!1,M()&&(k.style.visibility="hidden"),ne(),Ie(),V(!0),M()){var Tt=F(),zt=Tt.box,Mt=Tt.content;C.props.animation&&(_Q([zt,Mt],wt),RSe([zt,Mt],"hidden"))}j(),Y(),C.props.animation?M()&&Re(wt,C.unmount):C.unmount()}}function Yt(ae){B().addEventListener("mousemove",p),DSe(y6,p),p(ae)}function He(){C.state.isVisible&&C.hide(),C.state.isMounted&&(Zt(),me().forEach(function(ae){ae._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),bQ=bQ.filter(function(ae){return ae!==C}),C.state.isMounted=!1,$("onHidden",[C]))}function Dt(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),kt(),delete n._tippy,C.state.isDestroyed=!0,$("onDestroy",[C]))}}function k3(n,e){e===void 0&&(e={});var t=Jm.plugins.concat(e.plugins||[]);okt();var i=Object.assign({},e,{plugins:t}),r=ekt(n),o=r.reduce(function(s,a){var l=a&&pkt(a,i);return l&&s.push(l),s},[]);return Zz(n)?o[0]:o}k3.defaultProps=Jm;k3.setDefaultProps=dkt;k3.currentInput=lv;Object.assign({},zhe,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}});k3.setDefaultProps({render:_6e});function v6e(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var b6e=typeof window<"u"&&typeof document<"u";function Tne(n,e){n&&(typeof n=="function"&&n(e),{}.hasOwnProperty.call(n,"current")&&(n.current=e))}function BSe(){return b6e&&document.createElement("div")}function mkt(n){var e={"data-placement":n.placement};return n.referenceHidden&&(e["data-reference-hidden"]=""),n.escaped&&(e["data-escaped"]=""),e}function y6e(n,e){if(n===e)return!0;if(typeof n=="object"&&n!=null&&typeof e=="object"&&e!=null){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(var t in n)if(e.hasOwnProperty(t)){if(!y6e(n[t],e[t]))return!1}else return!1;return!0}else return!1}function _kt(n){var e=[];return n.forEach(function(t){e.find(function(i){return y6e(t,i)})||e.push(t)}),e}function vkt(n,e){var t,i;return Object.assign({},e,{popperOptions:Object.assign({},n.popperOptions,e.popperOptions,{modifiers:_kt([].concat(((t=n.popperOptions)==null?void 0:t.modifiers)||[],((i=e.popperOptions)==null?void 0:i.modifiers)||[]))})})}var yQ=b6e?w.useLayoutEffect:w.useEffect;function bkt(n){var e=w.useRef();return e.current||(e.current=typeof n=="function"?n():n),e.current}function $Se(n,e,t){t.split(/\s+/).forEach(function(i){i&&n.classList[e](i)})}var ykt={name:"className",defaultValue:"",fn:function(e){var t=e.popper.firstElementChild,i=function(){var a;return!!((a=e.props.render)!=null&&a.$$tippy)};function r(){e.props.className&&!i()||$Se(t,"add",e.props.className)}function o(){i()&&$Se(t,"remove",e.props.className)}return{onCreate:r,onBeforeUpdate:o,onAfterUpdate:r}}};function Ckt(n){function e(t){var i=t.children,r=t.content,o=t.visible,s=t.singleton,a=t.render,l=t.reference,c=t.disabled,u=c===void 0?!1:c,d=t.ignoreAttributes,h=d===void 0?!0:d;t.__source,t.__self;var g=v6e(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),p=o!==void 0,m=s!==void 0,_=w.useState(!1),v=_[0],b=_[1],y=w.useState({}),C=y[0],x=y[1],k=w.useState(),I=k[0],L=k[1],D=bkt(function(){return{container:BSe(),renders:1}}),R=Object.assign({ignoreAttributes:h},g,{content:D.container});p&&(R.trigger="manual",R.hideOnClick=!1),m&&(u=!0);var P=R,M=R.plugins||[];a&&(P=Object.assign({},R,{plugins:m&&s.data!=null?[].concat(M,[{fn:function(){return{onTrigger:function(H,V){var $=s.data.children.find(function(j){var Y=j.instance;return Y.reference===V.currentTarget});H.state.$$activeSingletonInstance=$.instance,L($.content)}}}}]):M,render:function(){return{popper:D.container}}}));var O=[l].concat(i?[i.type]:[]);return yQ(function(){var B=l;l&&l.hasOwnProperty("current")&&(B=l.current);var F=n(B||D.ref||BSe(),Object.assign({},P,{plugins:[ykt].concat(R.plugins||[])}));return D.instance=F,u&&F.disable(),o&&F.show(),m&&s.hook({instance:F,content:r,props:P,setSingletonContent:L}),b(!0),function(){F.destroy(),s==null||s.cleanup(F)}},O),yQ(function(){var B;if(D.renders===1){D.renders++;return}var F=D.instance;F.setProps(vkt(F.props,P)),(B=F.popperInstance)==null||B.forceUpdate(),u?F.disable():F.enable(),p&&(o?F.show():F.hide()),m&&s.hook({instance:F,content:r,props:P,setSingletonContent:L})}),yQ(function(){var B;if(a){var F=D.instance;F.setProps({popperOptions:Object.assign({},F.props.popperOptions,{modifiers:[].concat((((B=F.props.popperOptions)==null?void 0:B.modifiers)||[]).filter(function(H){var V=H.name;return V!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(V){var $,j=V.state,Y=($=j.modifiersData)==null?void 0:$.hide;(C.placement!==j.placement||C.referenceHidden!==(Y==null?void 0:Y.isReferenceHidden)||C.escaped!==(Y==null?void 0:Y.hasPopperEscaped))&&x({placement:j.placement,referenceHidden:Y==null?void 0:Y.isReferenceHidden,escaped:Y==null?void 0:Y.hasPopperEscaped}),j.attributes.popper={}}}])})})}},[C.placement,C.referenceHidden,C.escaped].concat(O)),te.createElement(te.Fragment,null,i?w.cloneElement(i,{ref:function(F){D.ref=F,Tne(i.ref,F)}}):null,v&&Yp.createPortal(a?a(mkt(C),I,D.instance):r,D.container))}return e}var wkt=function(n,e){return w.forwardRef(function(i,r){var o=i.children,s=v6e(i,["children"]);return te.createElement(n,Object.assign({},e,s),o?w.cloneElement(o,{ref:function(l){Tne(r,l),Tne(o.ref,l)}}):null)})},Skt=wkt(Ckt(k3));const bT=Skt;/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function vk(){var e;const n=Tl(t=>t.companyUsers);return(e=n.api[n.currentIndex])==null?void 0:e.account}var Ekt=function(e){return xkt(e)&&!kkt(e)};function xkt(n){return!!n&&typeof n=="object"}function kkt(n){var e=Object.prototype.toString.call(n);return e==="[object RegExp]"||e==="[object Date]"||Lkt(n)}var Tkt=typeof Symbol=="function"&&Symbol.for,Ikt=Tkt?Symbol.for("react.element"):60103;function Lkt(n){return n.$$typeof===Ikt}function Dkt(n){return Array.isArray(n)?[]:{}}function w7(n,e){return e.clone!==!1&&e.isMergeableObject(n)?HP(Dkt(n),n,e):n}function Akt(n,e,t){return n.concat(e).map(function(i){return w7(i,t)})}function Rkt(n,e,t){var i={};return t.isMergeableObject(n)&&Object.keys(n).forEach(function(r){i[r]=w7(n[r],t)}),Object.keys(e).forEach(function(r){!t.isMergeableObject(e[r])||!n[r]?i[r]=w7(e[r],t):i[r]=HP(n[r],e[r],t)}),i}function HP(n,e,t){t=t||{},t.arrayMerge=t.arrayMerge||Akt,t.isMergeableObject=t.isMergeableObject||Ekt;var i=Array.isArray(e),r=Array.isArray(n),o=i===r;return o?i?t.arrayMerge(n,e,t):Rkt(n,e,t):w7(e,t)}HP.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(i,r){return HP(i,r,t)},{})};var Ine=HP,Nkt=typeof global=="object"&&global&&global.Object===Object&&global;const C6e=Nkt;var Okt=typeof self=="object"&&self&&self.Object===Object&&self,Pkt=C6e||Okt||Function("return this")();const wb=Pkt;var Mkt=wb.Symbol;const ZC=Mkt;var w6e=Object.prototype,Fkt=w6e.hasOwnProperty,Bkt=w6e.toString,yR=ZC?ZC.toStringTag:void 0;function $kt(n){var e=Fkt.call(n,yR),t=n[yR];try{n[yR]=void 0;var i=!0}catch{}var r=Bkt.call(n);return i&&(e?n[yR]=t:delete n[yR]),r}var Vkt=Object.prototype,Hkt=Vkt.toString;function Wkt(n){return Hkt.call(n)}var zkt="[object Null]",jkt="[object Undefined]",VSe=ZC?ZC.toStringTag:void 0;function bk(n){return n==null?n===void 0?jkt:zkt:VSe&&VSe in Object(n)?$kt(n):Wkt(n)}function S6e(n,e){return function(t){return n(e(t))}}var Ukt=S6e(Object.getPrototypeOf,Object);const Dfe=Ukt;function yk(n){return n!=null&&typeof n=="object"}var qkt="[object Object]",Kkt=Function.prototype,Gkt=Object.prototype,E6e=Kkt.toString,Ykt=Gkt.hasOwnProperty,Qkt=E6e.call(Object);function HSe(n){if(!yk(n)||bk(n)!=qkt)return!1;var e=Dfe(n);if(e===null)return!0;var t=Ykt.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&E6e.call(t)==Qkt}var WSe=Array.isArray,zSe=Object.keys,Xkt=Object.prototype.hasOwnProperty,Zkt=typeof Element<"u";function Lne(n,e){if(n===e)return!0;if(n&&e&&typeof n=="object"&&typeof e=="object"){var t=WSe(n),i=WSe(e),r,o,s;if(t&&i){if(o=n.length,o!=e.length)return!1;for(r=o;r--!==0;)if(!Lne(n[r],e[r]))return!1;return!0}if(t!=i)return!1;var a=n instanceof Date,l=e instanceof Date;if(a!=l)return!1;if(a&&l)return n.getTime()==e.getTime();var c=n instanceof RegExp,u=e instanceof RegExp;if(c!=u)return!1;if(c&&u)return n.toString()==e.toString();var d=zSe(n);if(o=d.length,o!==zSe(e).length)return!1;for(r=o;r--!==0;)if(!Xkt.call(e,d[r]))return!1;if(Zkt&&n instanceof Element&&e instanceof Element)return n===e;for(r=o;r--!==0;)if(s=d[r],!(s==="_owner"&&n.$$typeof)&&!Lne(n[s],e[s]))return!1;return!0}return n!==n&&e!==e}var Jkt=function(e,t){try{return Lne(e,t)}catch(i){if(i.message&&i.message.match(/stack|recursion/i)||i.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",i.name,i.message),!1;throw i}};const FS=ja(Jkt);var eTt=!0;function tTt(n,e){if(!eTt){if(n)return;var t="Warning: "+e;typeof console<"u"&&console.warn(t);try{throw Error(t)}catch{}}}function nTt(){this.__data__=[],this.size=0}function x6e(n,e){return n===e||n!==n&&e!==e}function Jz(n,e){for(var t=n.length;t--;)if(x6e(n[t][0],e))return t;return-1}var iTt=Array.prototype,rTt=iTt.splice;function oTt(n){var e=this.__data__,t=Jz(e,n);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():rTt.call(e,t,1),--this.size,!0}function sTt(n){var e=this.__data__,t=Jz(e,n);return t<0?void 0:e[t][1]}function aTt(n){return Jz(this.__data__,n)>-1}function lTt(n,e){var t=this.__data__,i=Jz(t,n);return i<0?(++this.size,t.push([n,e])):t[i][1]=e,this}function T0(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}T0.prototype.clear=nTt;T0.prototype.delete=oTt;T0.prototype.get=sTt;T0.prototype.has=aTt;T0.prototype.set=lTt;function cTt(){this.__data__=new T0,this.size=0}function uTt(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function dTt(n){return this.__data__.get(n)}function hTt(n){return this.__data__.has(n)}function T3(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var fTt="[object AsyncFunction]",gTt="[object Function]",pTt="[object GeneratorFunction]",mTt="[object Proxy]";function k6e(n){if(!T3(n))return!1;var e=bk(n);return e==gTt||e==pTt||e==fTt||e==mTt}var _Tt=wb["__core-js_shared__"];const CQ=_Tt;var jSe=function(){var n=/[^.]+$/.exec(CQ&&CQ.keys&&CQ.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function vTt(n){return!!jSe&&jSe in n}var bTt=Function.prototype,yTt=bTt.toString;function Ck(n){if(n!=null){try{return yTt.call(n)}catch{}try{return n+""}catch{}}return""}var CTt=/[\\^$.*+?()[\]{}|]/g,wTt=/^\[object .+?Constructor\]$/,STt=Function.prototype,ETt=Object.prototype,xTt=STt.toString,kTt=ETt.hasOwnProperty,TTt=RegExp("^"+xTt.call(kTt).replace(CTt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ITt(n){if(!T3(n)||vTt(n))return!1;var e=k6e(n)?TTt:wTt;return e.test(Ck(n))}function LTt(n,e){return n==null?void 0:n[e]}function wk(n,e){var t=LTt(n,e);return ITt(t)?t:void 0}var DTt=wk(wb,"Map");const WP=DTt;var ATt=wk(Object,"create");const zP=ATt;function RTt(){this.__data__=zP?zP(null):{},this.size=0}function NTt(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var OTt="__lodash_hash_undefined__",PTt=Object.prototype,MTt=PTt.hasOwnProperty;function FTt(n){var e=this.__data__;if(zP){var t=e[n];return t===OTt?void 0:t}return MTt.call(e,n)?e[n]:void 0}var BTt=Object.prototype,$Tt=BTt.hasOwnProperty;function VTt(n){var e=this.__data__;return zP?e[n]!==void 0:$Tt.call(e,n)}var HTt="__lodash_hash_undefined__";function WTt(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=zP&&e===void 0?HTt:e,this}function _x(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}_x.prototype.clear=RTt;_x.prototype.delete=NTt;_x.prototype.get=FTt;_x.prototype.has=VTt;_x.prototype.set=WTt;function zTt(){this.size=0,this.__data__={hash:new _x,map:new(WP||T0),string:new _x}}function jTt(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function ej(n,e){var t=n.__data__;return jTt(e)?t[typeof e=="string"?"string":"hash"]:t.map}function UTt(n){var e=ej(this,n).delete(n);return this.size-=e?1:0,e}function qTt(n){return ej(this,n).get(n)}function KTt(n){return ej(this,n).has(n)}function GTt(n,e){var t=ej(this,n),i=t.size;return t.set(n,e),this.size+=t.size==i?0:1,this}function Fw(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var i=n[e];this.set(i[0],i[1])}}Fw.prototype.clear=zTt;Fw.prototype.delete=UTt;Fw.prototype.get=qTt;Fw.prototype.has=KTt;Fw.prototype.set=GTt;var YTt=200;function QTt(n,e){var t=this.__data__;if(t instanceof T0){var i=t.__data__;if(!WP||i.length<YTt-1)return i.push([n,e]),this.size=++t.size,this;t=this.__data__=new Fw(i)}return t.set(n,e),this.size=t.size,this}function J2(n){var e=this.__data__=new T0(n);this.size=e.size}J2.prototype.clear=cTt;J2.prototype.delete=uTt;J2.prototype.get=dTt;J2.prototype.has=hTt;J2.prototype.set=QTt;function XTt(n,e){for(var t=-1,i=n==null?0:n.length;++t<i&&e(n[t],t,n)!==!1;);return n}var ZTt=function(){try{var n=wk(Object,"defineProperty");return n({},"",{}),n}catch{}}();const USe=ZTt;function T6e(n,e,t){e=="__proto__"&&USe?USe(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}var JTt=Object.prototype,eIt=JTt.hasOwnProperty;function I6e(n,e,t){var i=n[e];(!(eIt.call(n,e)&&x6e(i,t))||t===void 0&&!(e in n))&&T6e(n,e,t)}function tj(n,e,t,i){var r=!t;t||(t={});for(var o=-1,s=e.length;++o<s;){var a=e[o],l=i?i(t[a],n[a],a,t,n):void 0;l===void 0&&(l=n[a]),r?T6e(t,a,l):I6e(t,a,l)}return t}function tIt(n,e){for(var t=-1,i=Array(n);++t<n;)i[t]=e(t);return i}var nIt="[object Arguments]";function qSe(n){return yk(n)&&bk(n)==nIt}var L6e=Object.prototype,iIt=L6e.hasOwnProperty,rIt=L6e.propertyIsEnumerable,oIt=qSe(function(){return arguments}())?qSe:function(n){return yk(n)&&iIt.call(n,"callee")&&!rIt.call(n,"callee")};const sIt=oIt;var aIt=Array.isArray;const I3=aIt;function lIt(){return!1}var D6e=typeof exports=="object"&&exports&&!exports.nodeType&&exports,KSe=D6e&&typeof module=="object"&&module&&!module.nodeType&&module,cIt=KSe&&KSe.exports===D6e,GSe=cIt?wb.Buffer:void 0,uIt=GSe?GSe.isBuffer:void 0,dIt=uIt||lIt;const A6e=dIt;var hIt=9007199254740991,fIt=/^(?:0|[1-9]\d*)$/;function gIt(n,e){var t=typeof n;return e=e??hIt,!!e&&(t=="number"||t!="symbol"&&fIt.test(n))&&n>-1&&n%1==0&&n<e}var pIt=9007199254740991;function R6e(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=pIt}var mIt="[object Arguments]",_It="[object Array]",vIt="[object Boolean]",bIt="[object Date]",yIt="[object Error]",CIt="[object Function]",wIt="[object Map]",SIt="[object Number]",EIt="[object Object]",xIt="[object RegExp]",kIt="[object Set]",TIt="[object String]",IIt="[object WeakMap]",LIt="[object ArrayBuffer]",DIt="[object DataView]",AIt="[object Float32Array]",RIt="[object Float64Array]",NIt="[object Int8Array]",OIt="[object Int16Array]",PIt="[object Int32Array]",MIt="[object Uint8Array]",FIt="[object Uint8ClampedArray]",BIt="[object Uint16Array]",$It="[object Uint32Array]",La={};La[AIt]=La[RIt]=La[NIt]=La[OIt]=La[PIt]=La[MIt]=La[FIt]=La[BIt]=La[$It]=!0;La[mIt]=La[_It]=La[LIt]=La[vIt]=La[DIt]=La[bIt]=La[yIt]=La[CIt]=La[wIt]=La[SIt]=La[EIt]=La[xIt]=La[kIt]=La[TIt]=La[IIt]=!1;function VIt(n){return yk(n)&&R6e(n.length)&&!!La[bk(n)]}function Afe(n){return function(e){return n(e)}}var N6e=typeof exports=="object"&&exports&&!exports.nodeType&&exports,cO=N6e&&typeof module=="object"&&module&&!module.nodeType&&module,HIt=cO&&cO.exports===N6e,wQ=HIt&&C6e.process,WIt=function(){try{var n=cO&&cO.require&&cO.require("util").types;return n||wQ&&wQ.binding&&wQ.binding("util")}catch{}}();const wD=WIt;var YSe=wD&&wD.isTypedArray,zIt=YSe?Afe(YSe):VIt;const jIt=zIt;var UIt=Object.prototype,qIt=UIt.hasOwnProperty;function O6e(n,e){var t=I3(n),i=!t&&sIt(n),r=!t&&!i&&A6e(n),o=!t&&!i&&!r&&jIt(n),s=t||i||r||o,a=s?tIt(n.length,String):[],l=a.length;for(var c in n)(e||qIt.call(n,c))&&!(s&&(c=="length"||r&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||gIt(c,l)))&&a.push(c);return a}var KIt=Object.prototype;function Rfe(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||KIt;return n===t}var GIt=S6e(Object.keys,Object);const YIt=GIt;var QIt=Object.prototype,XIt=QIt.hasOwnProperty;function ZIt(n){if(!Rfe(n))return YIt(n);var e=[];for(var t in Object(n))XIt.call(n,t)&&t!="constructor"&&e.push(t);return e}function P6e(n){return n!=null&&R6e(n.length)&&!k6e(n)}function Nfe(n){return P6e(n)?O6e(n):ZIt(n)}function JIt(n,e){return n&&tj(e,Nfe(e),n)}function eLt(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var tLt=Object.prototype,nLt=tLt.hasOwnProperty;function iLt(n){if(!T3(n))return eLt(n);var e=Rfe(n),t=[];for(var i in n)i=="constructor"&&(e||!nLt.call(n,i))||t.push(i);return t}function Ofe(n){return P6e(n)?O6e(n,!0):iLt(n)}function rLt(n,e){return n&&tj(e,Ofe(e),n)}var M6e=typeof exports=="object"&&exports&&!exports.nodeType&&exports,QSe=M6e&&typeof module=="object"&&module&&!module.nodeType&&module,oLt=QSe&&QSe.exports===M6e,XSe=oLt?wb.Buffer:void 0,ZSe=XSe?XSe.allocUnsafe:void 0;function sLt(n,e){if(e)return n.slice();var t=n.length,i=ZSe?ZSe(t):new n.constructor(t);return n.copy(i),i}function F6e(n,e){var t=-1,i=n.length;for(e||(e=Array(i));++t<i;)e[t]=n[t];return e}function aLt(n,e){for(var t=-1,i=n==null?0:n.length,r=0,o=[];++t<i;){var s=n[t];e(s,t,n)&&(o[r++]=s)}return o}function B6e(){return[]}var lLt=Object.prototype,cLt=lLt.propertyIsEnumerable,JSe=Object.getOwnPropertySymbols,uLt=JSe?function(n){return n==null?[]:(n=Object(n),aLt(JSe(n),function(e){return cLt.call(n,e)}))}:B6e;const Pfe=uLt;function dLt(n,e){return tj(n,Pfe(n),e)}function $6e(n,e){for(var t=-1,i=e.length,r=n.length;++t<i;)n[r+t]=e[t];return n}var hLt=Object.getOwnPropertySymbols,fLt=hLt?function(n){for(var e=[];n;)$6e(e,Pfe(n)),n=Dfe(n);return e}:B6e;const V6e=fLt;function gLt(n,e){return tj(n,V6e(n),e)}function H6e(n,e,t){var i=e(n);return I3(n)?i:$6e(i,t(n))}function pLt(n){return H6e(n,Nfe,Pfe)}function mLt(n){return H6e(n,Ofe,V6e)}var _Lt=wk(wb,"DataView");const Dne=_Lt;var vLt=wk(wb,"Promise");const Ane=vLt;var bLt=wk(wb,"Set");const Rne=bLt;var yLt=wk(wb,"WeakMap");const Nne=yLt;var eEe="[object Map]",CLt="[object Object]",tEe="[object Promise]",nEe="[object Set]",iEe="[object WeakMap]",rEe="[object DataView]",wLt=Ck(Dne),SLt=Ck(WP),ELt=Ck(Ane),xLt=Ck(Rne),kLt=Ck(Nne),BS=bk;(Dne&&BS(new Dne(new ArrayBuffer(1)))!=rEe||WP&&BS(new WP)!=eEe||Ane&&BS(Ane.resolve())!=tEe||Rne&&BS(new Rne)!=nEe||Nne&&BS(new Nne)!=iEe)&&(BS=function(n){var e=bk(n),t=e==CLt?n.constructor:void 0,i=t?Ck(t):"";if(i)switch(i){case wLt:return rEe;case SLt:return eEe;case ELt:return tEe;case xLt:return nEe;case kLt:return iEe}return e});const Mfe=BS;var TLt=Object.prototype,ILt=TLt.hasOwnProperty;function LLt(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&ILt.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var DLt=wb.Uint8Array;const oEe=DLt;function Ffe(n){var e=new n.constructor(n.byteLength);return new oEe(e).set(new oEe(n)),e}function ALt(n,e){var t=e?Ffe(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var RLt=/\w*$/;function NLt(n){var e=new n.constructor(n.source,RLt.exec(n));return e.lastIndex=n.lastIndex,e}var sEe=ZC?ZC.prototype:void 0,aEe=sEe?sEe.valueOf:void 0;function OLt(n){return aEe?Object(aEe.call(n)):{}}function PLt(n,e){var t=e?Ffe(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var MLt="[object Boolean]",FLt="[object Date]",BLt="[object Map]",$Lt="[object Number]",VLt="[object RegExp]",HLt="[object Set]",WLt="[object String]",zLt="[object Symbol]",jLt="[object ArrayBuffer]",ULt="[object DataView]",qLt="[object Float32Array]",KLt="[object Float64Array]",GLt="[object Int8Array]",YLt="[object Int16Array]",QLt="[object Int32Array]",XLt="[object Uint8Array]",ZLt="[object Uint8ClampedArray]",JLt="[object Uint16Array]",eDt="[object Uint32Array]";function tDt(n,e,t){var i=n.constructor;switch(e){case jLt:return Ffe(n);case MLt:case FLt:return new i(+n);case ULt:return ALt(n,t);case qLt:case KLt:case GLt:case YLt:case QLt:case XLt:case ZLt:case JLt:case eDt:return PLt(n,t);case BLt:return new i;case $Lt:case WLt:return new i(n);case VLt:return NLt(n);case HLt:return new i;case zLt:return OLt(n)}}var lEe=Object.create,nDt=function(){function n(){}return function(e){if(!T3(e))return{};if(lEe)return lEe(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();const iDt=nDt;function rDt(n){return typeof n.constructor=="function"&&!Rfe(n)?iDt(Dfe(n)):{}}var oDt="[object Map]";function sDt(n){return yk(n)&&Mfe(n)==oDt}var cEe=wD&&wD.isMap,aDt=cEe?Afe(cEe):sDt;const lDt=aDt;var cDt="[object Set]";function uDt(n){return yk(n)&&Mfe(n)==cDt}var uEe=wD&&wD.isSet,dDt=uEe?Afe(uEe):uDt;const hDt=dDt;var fDt=1,gDt=2,pDt=4,W6e="[object Arguments]",mDt="[object Array]",_Dt="[object Boolean]",vDt="[object Date]",bDt="[object Error]",z6e="[object Function]",yDt="[object GeneratorFunction]",CDt="[object Map]",wDt="[object Number]",j6e="[object Object]",SDt="[object RegExp]",EDt="[object Set]",xDt="[object String]",kDt="[object Symbol]",TDt="[object WeakMap]",IDt="[object ArrayBuffer]",LDt="[object DataView]",DDt="[object Float32Array]",ADt="[object Float64Array]",RDt="[object Int8Array]",NDt="[object Int16Array]",ODt="[object Int32Array]",PDt="[object Uint8Array]",MDt="[object Uint8ClampedArray]",FDt="[object Uint16Array]",BDt="[object Uint32Array]",_a={};_a[W6e]=_a[mDt]=_a[IDt]=_a[LDt]=_a[_Dt]=_a[vDt]=_a[DDt]=_a[ADt]=_a[RDt]=_a[NDt]=_a[ODt]=_a[CDt]=_a[wDt]=_a[j6e]=_a[SDt]=_a[EDt]=_a[xDt]=_a[kDt]=_a[PDt]=_a[MDt]=_a[FDt]=_a[BDt]=!0;_a[bDt]=_a[z6e]=_a[TDt]=!1;function l8(n,e,t,i,r,o){var s,a=e&fDt,l=e&gDt,c=e&pDt;if(t&&(s=r?t(n,i,r,o):t(n)),s!==void 0)return s;if(!T3(n))return n;var u=I3(n);if(u){if(s=LLt(n),!a)return F6e(n,s)}else{var d=Mfe(n),h=d==z6e||d==yDt;if(A6e(n))return sLt(n,a);if(d==j6e||d==W6e||h&&!r){if(s=l||h?{}:rDt(n),!a)return l?gLt(n,rLt(s,n)):dLt(n,JIt(s,n))}else{if(!_a[d])return r?n:{};s=tDt(n,d,a)}}o||(o=new J2);var g=o.get(n);if(g)return g;o.set(n,s),hDt(n)?n.forEach(function(_){s.add(l8(_,e,t,_,n,o))}):lDt(n)&&n.forEach(function(_,v){s.set(v,l8(_,e,t,v,n,o))});var p=c?l?mLt:pLt:l?Ofe:Nfe,m=u?void 0:p(n);return XTt(m||n,function(_,v){m&&(v=_,_=n[v]),I6e(s,v,l8(_,e,t,v,n,o))}),s}var $Dt=4;function dEe(n){return l8(n,$Dt)}function U6e(n,e){for(var t=-1,i=n==null?0:n.length,r=Array(i);++t<i;)r[t]=e(n[t],t,n);return r}var VDt="[object Symbol]";function Bfe(n){return typeof n=="symbol"||yk(n)&&bk(n)==VDt}var HDt="Expected a function";function $fe(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(HDt);var t=function(){var i=arguments,r=e?e.apply(this,i):i[0],o=t.cache;if(o.has(r))return o.get(r);var s=n.apply(this,i);return t.cache=o.set(r,s)||o,s};return t.cache=new($fe.Cache||Fw),t}$fe.Cache=Fw;var WDt=500;function zDt(n){var e=$fe(n,function(i){return t.size===WDt&&t.clear(),i}),t=e.cache;return e}var jDt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,UDt=/\\(\\)?/g,qDt=zDt(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(jDt,function(t,i,r,o){e.push(r?o.replace(UDt,"$1"):i||t)}),e});const KDt=qDt;var GDt=1/0;function YDt(n){if(typeof n=="string"||Bfe(n))return n;var e=n+"";return e=="0"&&1/n==-GDt?"-0":e}var QDt=1/0,hEe=ZC?ZC.prototype:void 0,fEe=hEe?hEe.toString:void 0;function q6e(n){if(typeof n=="string")return n;if(I3(n))return U6e(n,q6e)+"";if(Bfe(n))return fEe?fEe.call(n):"";var e=n+"";return e=="0"&&1/n==-QDt?"-0":e}function XDt(n){return n==null?"":q6e(n)}function K6e(n){return I3(n)?U6e(n,YDt):Bfe(n)?[n]:F6e(KDt(XDt(n)))}function Xc(){return Xc=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},Xc.apply(this,arguments)}function G6e(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var nj=w.createContext(void 0);nj.displayName="FormikContext";nj.Provider;nj.Consumer;function ZDt(){var n=w.useContext(nj);return n||tTt(!1),n}var ym=function(e){return typeof e=="function"},ij=function(e){return e!==null&&typeof e=="object"},JDt=function(e){return String(Math.floor(Number(e)))===e},SQ=function(e){return Object.prototype.toString.call(e)==="[object String]"},EQ=function(e){return ij(e)&&ym(e.then)};function Bf(n,e,t,i){i===void 0&&(i=0);for(var r=K6e(e);n&&i<r.length;)n=n[r[i++]];return i!==r.length&&!n||n===void 0?t:n}function zE(n,e,t){for(var i=dEe(n),r=i,o=0,s=K6e(e);o<s.length-1;o++){var a=s[o],l=Bf(n,s.slice(0,o+1));if(l&&(ij(l)||Array.isArray(l)))r=r[a]=dEe(l);else{var c=s[o+1];r=r[a]=JDt(c)&&Number(c)>=0?[]:{}}}return(o===0?n:r)[s[o]]===t?n:(t===void 0?delete r[s[o]]:r[s[o]]=t,o===0&&t===void 0&&delete i[s[o]],i)}function Y6e(n,e,t,i){t===void 0&&(t=new WeakMap),i===void 0&&(i={});for(var r=0,o=Object.keys(n);r<o.length;r++){var s=o[r],a=n[s];ij(a)?t.get(a)||(t.set(a,!0),i[s]=Array.isArray(a)?[]:{},Y6e(a,e,t,i[s])):i[s]=e}return i}function e2t(n,e){switch(e.type){case"SET_VALUES":return Xc({},n,{values:e.payload});case"SET_TOUCHED":return Xc({},n,{touched:e.payload});case"SET_ERRORS":return FS(n.errors,e.payload)?n:Xc({},n,{errors:e.payload});case"SET_STATUS":return Xc({},n,{status:e.payload});case"SET_ISSUBMITTING":return Xc({},n,{isSubmitting:e.payload});case"SET_ISVALIDATING":return Xc({},n,{isValidating:e.payload});case"SET_FIELD_VALUE":return Xc({},n,{values:zE(n.values,e.payload.field,e.payload.value)});case"SET_FIELD_TOUCHED":return Xc({},n,{touched:zE(n.touched,e.payload.field,e.payload.value)});case"SET_FIELD_ERROR":return Xc({},n,{errors:zE(n.errors,e.payload.field,e.payload.value)});case"RESET_FORM":return Xc({},n,e.payload);case"SET_FORMIK_STATE":return e.payload(n);case"SUBMIT_ATTEMPT":return Xc({},n,{touched:Y6e(n.values,!0),isSubmitting:!0,submitCount:n.submitCount+1});case"SUBMIT_FAILURE":return Xc({},n,{isSubmitting:!1});case"SUBMIT_SUCCESS":return Xc({},n,{isSubmitting:!1});default:return n}}var yS={},C6={};function Xp(n){var e=n.validateOnChange,t=e===void 0?!0:e,i=n.validateOnBlur,r=i===void 0?!0:i,o=n.validateOnMount,s=o===void 0?!1:o,a=n.isInitialValid,l=n.enableReinitialize,c=l===void 0?!1:l,u=n.onSubmit,d=G6e(n,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),h=Xc({validateOnChange:t,validateOnBlur:r,validateOnMount:s,onSubmit:u},d),g=w.useRef(h.initialValues),p=w.useRef(h.initialErrors||yS),m=w.useRef(h.initialTouched||C6),_=w.useRef(h.initialStatus),v=w.useRef(!1),b=w.useRef({});w.useEffect(function(){return v.current=!0,function(){v.current=!1}},[]);var y=w.useState(0),C=y[1],x=w.useRef({values:h.initialValues,errors:h.initialErrors||yS,touched:h.initialTouched||C6,status:h.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),k=x.current,I=w.useCallback(function(Z){var G=x.current;x.current=e2t(G,Z),G!==x.current&&C(function(K){return K+1})},[]),L=w.useCallback(function(Z,G){return new Promise(function(K,oe){var le=h.validate(Z,G);le==null?K(yS):EQ(le)?le.then(function(we){K(we||yS)},function(we){oe(we)}):K(le)})},[h.validate]),D=w.useCallback(function(Z,G){var K=h.validationSchema,oe=ym(K)?K(G):K,le=G&&oe.validateAt?oe.validateAt(G,Z):n2t(Z,oe);return new Promise(function(we,Me){le.then(function(){we(yS)},function(ft){ft.name==="ValidationError"?we(t2t(ft)):Me(ft)})})},[h.validationSchema]),R=w.useCallback(function(Z,G){return new Promise(function(K){return K(b.current[Z].validate(G))})},[]),P=w.useCallback(function(Z){var G=Object.keys(b.current).filter(function(oe){return ym(b.current[oe].validate)}),K=G.length>0?G.map(function(oe){return R(oe,Bf(Z,oe))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(K).then(function(oe){return oe.reduce(function(le,we,Me){return we==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||we&&(le=zE(le,G[Me],we)),le},{})})},[R]),M=w.useCallback(function(Z){return Promise.all([P(Z),h.validationSchema?D(Z):{},h.validate?L(Z):{}]).then(function(G){var K=G[0],oe=G[1],le=G[2],we=Ine.all([K,oe,le],{arrayMerge:i2t});return we})},[h.validate,h.validationSchema,P,L,D]),O=Qg(function(Z){return Z===void 0&&(Z=k.values),I({type:"SET_ISVALIDATING",payload:!0}),M(Z).then(function(G){return v.current&&(I({type:"SET_ISVALIDATING",payload:!1}),I({type:"SET_ERRORS",payload:G})),G})});w.useEffect(function(){s&&v.current===!0&&FS(g.current,h.initialValues)&&O(g.current)},[s,O]);var B=w.useCallback(function(Z){var G=Z&&Z.values?Z.values:g.current,K=Z&&Z.errors?Z.errors:p.current?p.current:h.initialErrors||{},oe=Z&&Z.touched?Z.touched:m.current?m.current:h.initialTouched||{},le=Z&&Z.status?Z.status:_.current?_.current:h.initialStatus;g.current=G,p.current=K,m.current=oe,_.current=le;var we=function(){I({type:"RESET_FORM",payload:{isSubmitting:!!Z&&!!Z.isSubmitting,errors:K,touched:oe,status:le,values:G,isValidating:!!Z&&!!Z.isValidating,submitCount:Z&&Z.submitCount&&typeof Z.submitCount=="number"?Z.submitCount:0}})};if(h.onReset){var Me=h.onReset(k.values,Vt);EQ(Me)?Me.then(we):we()}else we()},[h.initialErrors,h.initialStatus,h.initialTouched,h.onReset]);w.useEffect(function(){v.current===!0&&!FS(g.current,h.initialValues)&&c&&(g.current=h.initialValues,B(),s&&O(g.current))},[c,h.initialValues,B,s,O]),w.useEffect(function(){c&&v.current===!0&&!FS(p.current,h.initialErrors)&&(p.current=h.initialErrors||yS,I({type:"SET_ERRORS",payload:h.initialErrors||yS}))},[c,h.initialErrors]),w.useEffect(function(){c&&v.current===!0&&!FS(m.current,h.initialTouched)&&(m.current=h.initialTouched||C6,I({type:"SET_TOUCHED",payload:h.initialTouched||C6}))},[c,h.initialTouched]),w.useEffect(function(){c&&v.current===!0&&!FS(_.current,h.initialStatus)&&(_.current=h.initialStatus,I({type:"SET_STATUS",payload:h.initialStatus}))},[c,h.initialStatus,h.initialTouched]);var F=Qg(function(Z){if(b.current[Z]&&ym(b.current[Z].validate)){var G=Bf(k.values,Z),K=b.current[Z].validate(G);return EQ(K)?(I({type:"SET_ISVALIDATING",payload:!0}),K.then(function(oe){return oe}).then(function(oe){I({type:"SET_FIELD_ERROR",payload:{field:Z,value:oe}}),I({type:"SET_ISVALIDATING",payload:!1})})):(I({type:"SET_FIELD_ERROR",payload:{field:Z,value:K}}),Promise.resolve(K))}else if(h.validationSchema)return I({type:"SET_ISVALIDATING",payload:!0}),D(k.values,Z).then(function(oe){return oe}).then(function(oe){I({type:"SET_FIELD_ERROR",payload:{field:Z,value:Bf(oe,Z)}}),I({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),H=w.useCallback(function(Z,G){var K=G.validate;b.current[Z]={validate:K}},[]),V=w.useCallback(function(Z){delete b.current[Z]},[]),$=Qg(function(Z,G){I({type:"SET_TOUCHED",payload:Z});var K=G===void 0?r:G;return K?O(k.values):Promise.resolve()}),j=w.useCallback(function(Z){I({type:"SET_ERRORS",payload:Z})},[]),Y=Qg(function(Z,G){var K=ym(Z)?Z(k.values):Z;I({type:"SET_VALUES",payload:K});var oe=G===void 0?t:G;return oe?O(K):Promise.resolve()}),ne=w.useCallback(function(Z,G){I({type:"SET_FIELD_ERROR",payload:{field:Z,value:G}})},[]),se=Qg(function(Z,G,K){I({type:"SET_FIELD_VALUE",payload:{field:Z,value:G}});var oe=K===void 0?t:K;return oe?O(zE(k.values,Z,G)):Promise.resolve()}),he=w.useCallback(function(Z,G){var K=G,oe=Z,le;if(!SQ(Z)){Z.persist&&Z.persist();var we=Z.target?Z.target:Z.currentTarget,Me=we.type,ft=we.name,Nt=we.id,Yt=we.value,He=we.checked,Dt=we.outerHTML,ae=we.options,Se=we.multiple;K=G||ft||Nt,oe=/number|range/.test(Me)?(le=parseFloat(Yt),isNaN(le)?"":le):/checkbox/.test(Me)?o2t(Bf(k.values,K),He,Yt):ae&&Se?r2t(ae):Yt}K&&se(K,oe)},[se,k.values]),xe=Qg(function(Z){if(SQ(Z))return function(G){return he(G,Z)};he(Z)}),_e=Qg(function(Z,G,K){G===void 0&&(G=!0),I({type:"SET_FIELD_TOUCHED",payload:{field:Z,value:G}});var oe=K===void 0?r:K;return oe?O(k.values):Promise.resolve()}),Ie=w.useCallback(function(Z,G){Z.persist&&Z.persist();var K=Z.target,oe=K.name,le=K.id,we=K.outerHTML,Me=G||oe||le;_e(Me,!0)},[_e]),Re=Qg(function(Z){if(SQ(Z))return function(G){return Ie(G,Z)};Ie(Z)}),Ye=w.useCallback(function(Z){ym(Z)?I({type:"SET_FORMIK_STATE",payload:Z}):I({type:"SET_FORMIK_STATE",payload:function(){return Z}})},[]),Ze=w.useCallback(function(Z){I({type:"SET_STATUS",payload:Z})},[]),tt=w.useCallback(function(Z){I({type:"SET_ISSUBMITTING",payload:Z})},[]),Be=Qg(function(){return I({type:"SUBMIT_ATTEMPT"}),O().then(function(Z){var G=Z instanceof Error,K=!G&&Object.keys(Z).length===0;if(K){var oe;try{if(oe=xt(),oe===void 0)return}catch(le){throw le}return Promise.resolve(oe).then(function(le){return v.current&&I({type:"SUBMIT_SUCCESS"}),le}).catch(function(le){if(v.current)throw I({type:"SUBMIT_FAILURE"}),le})}else if(v.current&&(I({type:"SUBMIT_FAILURE"}),G))throw Z})}),kt=Qg(function(Z){Z&&Z.preventDefault&&ym(Z.preventDefault)&&Z.preventDefault(),Z&&Z.stopPropagation&&ym(Z.stopPropagation)&&Z.stopPropagation(),Be().catch(function(G){console.warn("Warning: An unhandled error was caught from submitForm()",G)})}),Vt={resetForm:B,validateForm:O,validateField:F,setErrors:j,setFieldError:ne,setFieldTouched:_e,setFieldValue:se,setStatus:Ze,setSubmitting:tt,setTouched:$,setValues:Y,setFormikState:Ye,submitForm:Be},xt=Qg(function(){return u(k.values,Vt)}),Kt=Qg(function(Z){Z&&Z.preventDefault&&ym(Z.preventDefault)&&Z.preventDefault(),Z&&Z.stopPropagation&&ym(Z.stopPropagation)&&Z.stopPropagation(),B()}),cn=w.useCallback(function(Z){return{value:Bf(k.values,Z),error:Bf(k.errors,Z),touched:!!Bf(k.touched,Z),initialValue:Bf(g.current,Z),initialTouched:!!Bf(m.current,Z),initialError:Bf(p.current,Z)}},[k.errors,k.touched,k.values]),wn=w.useCallback(function(Z){return{setValue:function(K,oe){return se(Z,K,oe)},setTouched:function(K,oe){return _e(Z,K,oe)},setError:function(K){return ne(Z,K)}}},[se,_e,ne]),on=w.useCallback(function(Z){var G=ij(Z),K=G?Z.name:Z,oe=Bf(k.values,K),le={name:K,value:oe,onChange:xe,onBlur:Re};if(G){var we=Z.type,Me=Z.value,ft=Z.as,Nt=Z.multiple;we==="checkbox"?Me===void 0?le.checked=!!oe:(le.checked=!!(Array.isArray(oe)&&~oe.indexOf(Me)),le.value=Me):we==="radio"?(le.checked=oe===Me,le.value=Me):ft==="select"&&Nt&&(le.value=le.value||[],le.multiple=!0)}return le},[Re,xe,k.values]),Zt=w.useMemo(function(){return!FS(g.current,k.values)},[g.current,k.values]),pe=w.useMemo(function(){return typeof a<"u"?Zt?k.errors&&Object.keys(k.errors).length===0:a!==!1&&ym(a)?a(h):a:k.errors&&Object.keys(k.errors).length===0},[a,Zt,k.errors,h]),me=Xc({},k,{initialValues:g.current,initialErrors:p.current,initialTouched:m.current,initialStatus:_.current,handleBlur:Re,handleChange:xe,handleReset:Kt,handleSubmit:kt,resetForm:B,setErrors:j,setFormikState:Ye,setFieldTouched:_e,setFieldValue:se,setFieldError:ne,setStatus:Ze,setSubmitting:tt,setTouched:$,setValues:Y,submitForm:Be,validateForm:O,validateField:F,isValid:pe,dirty:Zt,unregisterField:V,registerField:H,getFieldProps:on,getFieldMeta:cn,getFieldHelpers:wn,validateOnBlur:r,validateOnChange:t,validateOnMount:s});return me}function t2t(n){var e={};if(n.inner){if(n.inner.length===0)return zE(e,n.path,n.message);for(var r=n.inner,t=Array.isArray(r),i=0,r=t?r:r[Symbol.iterator]();;){var o;if(t){if(i>=r.length)break;o=r[i++]}else{if(i=r.next(),i.done)break;o=i.value}var s=o;Bf(e,s.path)||(e=zE(e,s.path,s.message))}}return e}function n2t(n,e,t,i){t===void 0&&(t=!1);var r=One(n);return e[t?"validateSync":"validate"](r,{abortEarly:!1,context:i||r})}function One(n){var e=Array.isArray(n)?[]:{};for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t)){var i=String(t);Array.isArray(n[i])===!0?e[i]=n[i].map(function(r){return Array.isArray(r)===!0||HSe(r)?One(r):r!==""?r:void 0}):HSe(n[i])?e[i]=One(n[i]):e[i]=n[i]!==""?n[i]:void 0}return e}function i2t(n,e,t){var i=n.slice();return e.forEach(function(o,s){if(typeof i[s]>"u"){var a=t.clone!==!1,l=a&&t.isMergeableObject(o);i[s]=l?Ine(Array.isArray(o)?[]:{},o,t):o}else t.isMergeableObject(o)?i[s]=Ine(n[s],o,t):n.indexOf(o)===-1&&i.push(o)}),i}function r2t(n){return Array.from(n).filter(function(e){return e.selected}).map(function(e){return e.value})}function o2t(n,e,t){if(typeof n=="boolean")return!!e;var i=[],r=!1,o=-1;if(Array.isArray(n))i=n,o=n.indexOf(t),r=o>=0;else if(!t||t=="true"||t=="false")return!!e;return e&&t&&!r?i.concat(t):r?i.slice(0,o).concat(i.slice(o+1)):i}var s2t=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?w.useLayoutEffect:w.useEffect;function Qg(n){var e=w.useRef(n);return s2t(function(){e.current=n}),w.useCallback(function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return e.current.apply(void 0,i)},[])}var a2t=w.forwardRef(function(n,e){var t=n.action,i=G6e(n,["action"]),r=t??"#",o=ZDt(),s=o.handleReset,a=o.handleSubmit;return w.createElement("form",Xc({onSubmit:a,ref:e,onReset:s,action:r},i))});a2t.displayName="Form";/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function L3(){const n=Ci();return(e,t)=>{n(gk({property:e,value:t}))}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function l2t(){const n=Ci();return e=>{Te("PUT",ye("/api/v1/company_users/:id",{id:e.id}),e).then(t=>{Bn.set({...e},"company_user",t.data.data),hn(["company_users"]),n(Uy(e))})}}const c2t=" Latest Build - 2024-08-06";/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const Q6e=`v${c2t}`;/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const _f=po(0);function Rg(n){const[e]=ue(),t=ri(),i=ol(),r=vi(),o=ha(),[s,a]=w.useState(n.show??!1),[l,c]=w.useState(""),[u,d]=Mo(_f),g=Cn().unix()-u>r.default_password_timeout/1e3&&r.default_password_timeout>0;w.useEffect(()=>{a(n.show)},[n.show]);const p=(m,_)=>{m==null||m.preventDefault(),n.onSave(l,!0),_&&d(Cn().unix()),c(""),n.onClose(!1)};return w.useEffect(()=>{s&&(!g||!(r!=null&&r.oauth_password_required)&&(o!=null&&o.oauth_provider_id)&&o.oauth_provider_id.length>1)&&p()},[s]),N(cr,{onClose:()=>{i.pathname.startsWith("/settings/users")&&!n.tableActions?t("/settings/users"):n.onClose(!1),c("")},visible:s&&g,title:e("confirmation"),text:e("please_enter_your_password"),children:[f("form",{onSubmit:m=>p(m,!0),children:f(ke,{id:"current_password",type:"password",label:e("current_password"),required:!0,changeOverride:!0,value:l,onChange:m=>c(m.target.value)})}),f(Ut,{disabled:l.length===0,onClick:m=>p(m,!0),disableWithoutIcon:!0,children:e("continue")})]})}const xQ=Ea.div`
background-color: ${n=>n.theme.color};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function u2t(n){const[e]=ue(),t=ha(),i=Ci(),r=Vn(),{isAboutVisible:o,setIsAboutVisible:s}=n,a=Ri(_f),[l,c]=w.useState(!1),[u,d]=w.useState(!1),[h,g]=w.useState(!1),[p,m]=w.useState(!1),[_,v]=w.useState(!1),[b,y]=w.useState(),{data:C}=ai({queryKey:["/api/v1/self-update/check_version"],queryFn:()=>Te("POST",ye("/api/v1/self-update/check_version")).then(D=>D.data),staleTime:1/0}),{data:x}=ai({queryKey:["/api/v1/health_check"],queryFn:()=>Te("GET",ye("/api/v1/health_check")).then(D=>D.data),staleTime:1/0,enabled:!"".includes("staging")}),k=D=>{(!l||D)&&(ie.processing(),c(!0),Te("GET",ye("/api/v1/health_check")).then(R=>{y(R.data),d(!0),ie.dismiss()}).finally(()=>c(!1)))},I=()=>{l||(ie.processing(),c(!0),Te("GET",ye("/api/v1/ping?clear_cache=true")).then(()=>{Te("POST",ye("/api/v1/refresh?current_company=true")).then(D=>{i(yb(D.data.data)),ie.dismiss(),k(!0)}).finally(()=>c(!1))}).catch(()=>c(!1)))},L=D=>{if(!l){const R=setTimeout(()=>{v(!0)},25e3);ie.processing(),c(!0),Te("POST",ye("/api/v1/self-update"),{},{headers:{"X-Api-Password":D}}).then(()=>window.location.reload()).catch(P=>{var M;((M=P.response)==null?void 0:M.status)===412&&(ie.error("password_error_incorrect"),a(0))}).finally(()=>{clearTimeout(R),c(!1)})}};return N(_t,{children:[N(cr,{title:e("about"),visible:o,onClose:()=>!l&&s(!1),disableClosing:u||h||p||_,children:[N("div",{className:"flex flex-col text-center",children:[N("div",{className:"flex flex-col",children:[N("span",{className:"text-gray-800",children:[t==null?void 0:t.first_name," ",t==null?void 0:t.last_name]}),f("span",{children:t==null?void 0:t.email})]}),f("span",{className:"mt-4",children:Q6e})]}),N(Ut,{behavior:"button",className:"flex items-center",onClick:k,disableWithoutIcon:!0,disabled:l,children:[f(Ve,{element:Opt,color:"white"}),f("span",{children:e("health_check")})]}),C&&(x==null?void 0:x.api_version)&&x.api_version!==C&&N(Ut,{behavior:"button",className:"flex items-center",onClick:()=>g(!0),disableWithoutIcon:!0,disabled:l,children:[f(Ve,{element:xmt,color:"white"}),f("span",{children:e("force_update")})]}),N("div",{className:"flex flex-wrap justify-center items-center space-x-4 pt-6",children:[f("a",{href:"https://twitter.com/invoiceninja",target:"_blank",rel:"noreferrer",children:f(D_t,{})}),f("a",{href:"https://www.facebook.com/invoiceninja",target:"_blank",rel:"noreferrer",children:f(Amt,{})}),f("a",{href:"https://github.com/invoiceninja",target:"_blank",rel:"noreferrer",children:f(Bmt,{})}),f("a",{href:"https://www.youtube.com/channel/UCXAHcBvhW05PDtWYIq7WDFA/videos",target:"_blank",rel:"noreferrer",children:f(B_t,{})}),f("a",{href:"http://slack.invoiceninja.com/",target:"_blank",rel:"noreferrer",children:f(C_t,{})})]})]}),N(cr,{title:e("health_check"),visible:u,onClose:()=>d(!1),children:[N("div",{className:"flex flex-col space-y-3",children:[N("div",{className:"flex justify-between items-center py-1 px-3",children:[N("div",{className:"flex flex-col",children:[f("span",{className:"font-medium text-base mb-1",children:e("system")}),N("span",{children:[e("email"),": ",b==null?void 0:b.mail_mailer]}),N("span",{children:[e("queue"),": ",b==null?void 0:b.queue]}),N("span",{children:[e("pdf"),": ",b==null?void 0:b.pdf_engine]})]}),f("div",{children:f(Ve,{element:b!=null&&b.system_health?KY:V1,color:b!=null&&b.system_health?"green":"red",size:25})})]}),N("div",{className:"flex justify-between items-center py-1 px-3",children:[N("div",{className:"flex flex-col",children:[f("span",{className:"font-medium text-base mb-1",children:e("database_connection")}),f("span",{children:b!=null&&b.simple_db_check?e("passed"):e("failed")})]}),f("div",{children:f(Ve,{element:b!=null&&b.simple_db_check?KY:V1,color:b!=null&&b.simple_db_check?"green":"red",size:25})})]}),N("div",{className:"flex justify-between items-center py-1 px-3",children:[N("div",{className:"flex flex-col",children:[f("span",{className:"font-medium text-base mb-1",children:"PHP"}),N("span",{children:[e("web"),": ",b==null?void 0:b.php_version.current_php_version]}),N("span",{children:[e("cli"),": ",b==null?void 0:b.php_version.current_php_cli_version]}),N("span",{children:["Memory: ",b==null?void 0:b.php_version.memory_limit]}),N("span",{children:["API: ",b==null?void 0:b.api_version]})]}),f("div",{children:f(Ve,{element:b!=null&&b.php_version.is_okay?KY:V1,color:b!=null&&b.php_version.is_okay?"green":"red",size:25})})]}),(!(b!=null&&b.env_writable)||(b==null?void 0:b.file_permissions)!=="Ok")&&!(b!=null&&b.is_docker)&&N(xQ,{className:"flex justify-between items-center cursor-pointer py-1 px-3",theme:{hoverColor:r.$5},onClick:()=>{var D;return(D=window.open("https://invoiceninja.github.io/en/self-host-installation/#file-permissions","_blank"))==null?void 0:D.focus()},children:[N("div",{className:"flex flex-col",children:[f("span",{className:"font-medium text-base mb-1",children:e("permissions")}),f("span",{children:b!=null&&b.env_writable?b==null?void 0:b.file_permissions:e("env_not_writable")})]}),f("div",{children:f(Ve,{element:V1,color:"red",size:25})})]}),(b==null?void 0:b.pdf_engine)!=="SnapPDF PDF Generator"&&N(xQ,{className:"flex justify-between items-center cursor-pointer py-1 px-3",theme:{hoverColor:r.$5},onClick:()=>{var D;return(D=window.open("https://invoiceninja.github.io/en/self-host-troubleshooting/#pdf-conversion-issues","_blank"))==null?void 0:D.focus()},children:[N("div",{className:"flex flex-col",children:[f("span",{className:"font-medium text-base mb-1",children:e("snappdf_not_enabled")}),f("span",{children:e("use_snappdf")})]}),f("div",{children:f(Ve,{element:Uwe,size:25})})]}),!!(b!=null&&b.exchange_rate_api_not_configured)&&N(xQ,{className:"flex justify-between items-center cursor-pointer py-1 px-3",theme:{hoverColor:r.$5},onClick:()=>{var D;return(D=window.open("https://invoiceninja.github.io/en/self-host-installation/#currency-conversion","_blank"))==null?void 0:D.focus()},children:[N("div",{className:"flex flex-col",children:[f("span",{className:"font-medium text-base mb-1",children:e("exchange_rate_not_enabled")}),f("span",{children:e("add_open_exchange")})]}),f("div",{children:f(Ve,{element:Uwe,size:25})})]})]}),N("div",{className:"flex justify-between",children:[f(Ut,{behavior:"button",type:"secondary",onClick:I,disableWithoutIcon:!0,disabled:l,children:e("clear_cache")}),f(Ut,{behavior:"button",onClick:k,disableWithoutIcon:!0,disabled:l,children:e("refresh")})]})]}),f(cr,{title:e("update_available"),visible:h,onClose:()=>g(!1),disableClosing:l||p||_,children:N("div",{className:"flex flex-col space-y-5",children:[f("span",{className:"font-medium text-base",children:e("a_new_version_is_available")}),N("div",{className:"flex flex-col",children:[N("span",{children:["· ",e("installed_version"),":"," ",x==null?void 0:x.api_version]}),N("span",{children:["· ",e("latest_version"),": ",C]})]}),N("div",{className:"flex justify-between",children:[f(Ut,{behavior:"button",type:"secondary",onClick:()=>{var D;return(D=window.open("https://github.com/invoiceninja/invoiceninja/releases","_blank"))==null?void 0:D.focus()},disableWithoutIcon:!0,disabled:l,children:e("release_notes")}),f(Ut,{behavior:"button",onClick:()=>m(!0),disableWithoutIcon:!0,disabled:l,children:e("update_now")})]})]})}),f(cr,{title:e("updating_app"),visible:_,onClose:()=>v(!1),children:e("upgrade_in_progress")}),f(Rg,{show:p,onClose:m,onSave:L})]})}function X6e(n){var x,k;const[e]=ue(),t=x0(),i=ha(),r=vk(),o=Vn(),{mobileNavbar:s}=n,a=Ci(),l=l2t(),c=L3(),[u,d]=w.useState(!1),[h,g]=w.useState(!1),[p,m]=w.useState(!1),[_,v]=w.useState(!1),b=!!((x=t==null?void 0:t.company_user)!=null&&x.react_settings.show_mini_sidebar),y=Xp({initialValues:{message:"",platform:"R",send_logs:!1},onSubmit:I=>{ie.processing(),Te("POST",ye("/api/v1/support/messages/send"),I).then(()=>ie.success("your_message_has_been_received")).finally(()=>{y.setSubmitting(!1),d(!1)})}}),C=()=>{v(!0),Te("POST",ye("/api/v1/refresh")).then(I=>{a(yb(I.data.data)),v(!1),m(!1)})};return w.useEffect(()=>{var L,D,R,P;const I=(D=(L=t==null?void 0:t.company_user)==null?void 0:L.react_settings)==null?void 0:D.show_mini_sidebar;t&&typeof I<"u"&&((P=(R=i==null?void 0:i.company_user)==null?void 0:R.react_settings)==null?void 0:P.show_mini_sidebar)!==I&&l(t)},[(k=t==null?void 0:t.company_user)==null?void 0:k.react_settings.show_mini_sidebar]),N(_t,{children:[N(cr,{title:e("contact_us"),visible:u,onClose:d,children:[f(ke,{label:e("from"),id:"from",value:`${t==null?void 0:t.first_name} - ${t==null?void 0:t.email}`,disabled:!0}),f(ke,{element:"textarea",label:e("message"),id:"message",onChange:y.handleChange}),f(gt,{id:"send_errors",label:e("include_recent_errors"),onChange:I=>y.setFieldValue("send_logs",I)}),f(Ut,{onClick:()=>y.submitForm(),disabled:y.isSubmitting,children:e("send")})]}),N(cr,{title:e("crons_not_enabled"),visible:p,onClose:m,children:[f(Ut,{onClick:()=>{window.open("https://invoiceninja.github.io/en/self-host-troubleshooting/#cron-not-running-queue-not-running","_blank")},children:e("learn_more")}),f(Ut,{disabled:_,onClick:C,children:e("refresh_data")}),f(Ut,{onClick:()=>{m(!1)},children:e("dismiss")})]}),f(u2t,{isAboutVisible:h,setIsAboutVisible:g}),N("nav",{style:{borderColor:o.$5},className:St("flex p-2 text-white border-t",{"justify-end":s,"justify-around":!s}),children:[!b&&!s&&N(_t,{children:[r&&!r.is_scheduler_running&&f("button",{className:"p-2 hover:bg-ninja-gray-darker rounded-full",onClick:()=>m(!0),children:f(bT,{duration:0,content:e("error"),className:"text-white rounded text-xs mb-2",children:f(Fpt,{})})}),f("button",{className:"p-2 hover:bg-ninja-gray-darker rounded-full",onClick:()=>d(!0),children:f(bT,{duration:0,content:e("contact_us"),className:"text-white rounded text-xs mb-2",children:f(e_t,{})})}),f("a",{href:"https://forum.invoiceninja.com",target:"_blank",className:"p-2 hover:bg-ninja-gray-darker rounded-full",rel:"noreferrer",children:f(bT,{duration:0,content:e("support_forum"),className:"text-white rounded text-xs mb-2",children:f(s_t,{})})}),f("a",{href:n.docsLink&&`https://invoiceninja.github.io/${n.docsLink}`||"https://invoiceninja.github.io",target:"_blank",className:"p-2 hover:bg-ninja-gray-darker rounded-full",rel:"noreferrer",children:f(bT,{duration:0,content:e("user_guide"),className:"text-white rounded text-xs mb-2",children:f(Hmt,{})})}),f("button",{className:"p-2 hover:bg-ninja-gray-darker rounded-full overflow-visible",onClick:()=>g(!0),children:f(bT,{duration:0,content:e("about"),className:"text-white rounded text-xs mb-2",children:f(Gmt,{})})})]}),f("button",{className:"p-2 rounded-full",onClick:()=>c("company_user.react_settings.show_mini_sidebar",!b),children:f(bT,{duration:0,content:f("span",{style:{fontSize:b?"0.6rem":"0.75rem"},children:e(b?"show_menu":"hide_menu")}),className:"text-white rounded mb-1.5",children:b?f(nhe,{}):f(q3e,{})})})]})]})}function U(n){const e=Vn();return N("div",{className:St(`sm:grid sm:gap-10 flex flex-col lg:flex-row ${n.className}`,{"px-5 sm:px-6":!n.noExternalPadding,"py-4 sm:py-3":!n.noVerticalPadding,"lg:items-center":!n.withoutItemsCenter,"sm:grid-cols-2":n.twoGridColumns,"sm:grid-cols-3":!n.twoGridColumns}),onClick:n.onClick,style:{color:e.$3,colorScheme:e.$0},children:[N("dt",{className:St("text-sm flex flex-col",{"opacity-75":n.disabledLabels}),style:{color:e.$3,colorScheme:e.$0},children:[N("span",{className:St("font-medium",{"whitespace-nowrap":n.withoutWrappingLeftSide}),style:{color:e.$3,colorScheme:e.$0},children:[n.leftSide,n.required&&f("span",{className:"ml-1 text-red-600",children:"*"})]}),n.leftSideHelp&&(typeof n.leftSideHelp=="object"?n.leftSideHelp:f("span",{className:"text-xs",dangerouslySetInnerHTML:{__html:n.leftSideHelp},style:{color:e.$3,colorScheme:e.$0,opacity:.8}}))]}),f("dd",{className:St("mt-4 text-sm sm:mt-0",{"flex flex-col sm:flex-row sm:justify-end":n.pushContentToRight,"sm:col-span-1":n.twoGridColumns,"sm:col-span-2":!n.twoGridColumns}),style:{color:e.$3,colorScheme:e.$0},children:n.children})]})}var d2t="tippy-content",h2t="tippy-backdrop",f2t="tippy-arrow",g2t="tippy-svg-arrow",$S={passive:!0,capture:!0},Z6e=function(){return document.body};function kQ(n,e,t){if(Array.isArray(n)){var i=n[e];return i??(Array.isArray(t)?t[e]:t)}return n}function Vfe(n,e){var t={}.toString.call(n);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function J6e(n,e){return typeof n=="function"?n.apply(void 0,e):n}function gEe(n,e){if(e===0)return n;var t;return function(i){clearTimeout(t),t=setTimeout(function(){n(i)},e)}}function p2t(n){return n.split(/\s+/).filter(Boolean)}function XT(n){return[].concat(n)}function pEe(n,e){n.indexOf(e)===-1&&n.push(e)}function m2t(n){return n.filter(function(e,t){return n.indexOf(e)===t})}function _2t(n){return n.split("-")[0]}function S7(n){return[].slice.call(n)}function mEe(n){return Object.keys(n).reduce(function(e,t){return n[t]!==void 0&&(e[t]=n[t]),e},{})}function v2t(){return document.createElement("div")}function eBe(n){return["Element","Fragment"].some(function(e){return Vfe(n,e)})}function b2t(n){return Vfe(n,"NodeList")}function y2t(n){return Vfe(n,"MouseEvent")}function C2t(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function w2t(n){return eBe(n)?[n]:b2t(n)?S7(n):Array.isArray(n)?n:S7(document.querySelectorAll(n))}function TQ(n,e){n.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function _Ee(n,e){n.forEach(function(t){t&&t.setAttribute("data-state",e)})}function S2t(n){var e,t=XT(n),i=t[0];return i!=null&&(e=i.ownerDocument)!=null&&e.body?i.ownerDocument:document}function E2t(n,e){var t=e.clientX,i=e.clientY;return n.every(function(r){var o=r.popperRect,s=r.popperState,a=r.props,l=a.interactiveBorder,c=_2t(s.placement),u=s.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,h=c==="top"?u.bottom.y:0,g=c==="right"?u.left.x:0,p=c==="left"?u.right.x:0,m=o.top-i+d>l,_=i-o.bottom-h>l,v=o.left-t+g>l,b=t-o.right-p>l;return m||_||v||b})}function IQ(n,e,t){var i=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(r){n[i](r,t)})}function vEe(n,e){for(var t=e;t;){var i;if(n.contains(t))return!0;t=t.getRootNode==null||(i=t.getRootNode())==null?void 0:i.host}return!1}var cv={isTouch:!1},bEe=0;function x2t(){cv.isTouch||(cv.isTouch=!0,window.performance&&document.addEventListener("mousemove",tBe))}function tBe(){var n=performance.now();n-bEe<20&&(cv.isTouch=!1,document.removeEventListener("mousemove",tBe)),bEe=n}function k2t(){var n=document.activeElement;if(C2t(n)){var e=n._tippy;n.blur&&!e.state.isVisible&&n.blur()}}function T2t(){document.addEventListener("touchstart",x2t,$S),window.addEventListener("blur",k2t)}var I2t=typeof window<"u"&&typeof document<"u",L2t=I2t?!!window.msCrypto:!1,D2t={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},A2t={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},e_=Object.assign({appendTo:Z6e,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},D2t,A2t),R2t=Object.keys(e_),N2t=function(e){var t=Object.keys(e);t.forEach(function(i){e_[i]=e[i]})};function nBe(n){var e=n.plugins||[],t=e.reduce(function(i,r){var o=r.name,s=r.defaultValue;if(o){var a;i[o]=n[o]!==void 0?n[o]:(a=e_[o])!=null?a:s}return i},{});return Object.assign({},n,t)}function O2t(n,e){var t=e?Object.keys(nBe(Object.assign({},e_,{plugins:e}))):R2t,i=t.reduce(function(r,o){var s=(n.getAttribute("data-tippy-"+o)||"").trim();if(!s)return r;if(o==="content")r[o]=s;else try{r[o]=JSON.parse(s)}catch{r[o]=s}return r},{});return i}function yEe(n,e){var t=Object.assign({},e,{content:J6e(e.content,[n])},e.ignoreAttributes?{}:O2t(n,e.plugins));return t.aria=Object.assign({},e_.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}function CEe(n){var e=n.firstElementChild,t=S7(e.children);return{box:e,content:t.find(function(i){return i.classList.contains(d2t)}),arrow:t.find(function(i){return i.classList.contains(f2t)||i.classList.contains(g2t)}),backdrop:t.find(function(i){return i.classList.contains(h2t)})}}var P2t=1,w6=[],LQ=[];function M2t(n,e){var t=yEe(n,Object.assign({},e_,nBe(mEe(e)))),i,r,o,s=!1,a=!1,l=!1,c=!1,u,d,h,g=[],p=gEe(xt,t.interactiveDebounce),m,_=P2t++,v=null,b=m2t(t.plugins),y={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:_,reference:n,popper:v2t(),popperInstance:v,props:t,state:y,plugins:b,clearDelayTimeouts:le,setProps:we,setContent:Me,show:ft,hide:Nt,hideWithInteractivity:Yt,enable:K,disable:oe,unmount:He,destroy:Dt};if(!t.render)return C;var x=t.render(C),k=x.popper,I=x.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+C.id,C.popper=k,n._tippy=C,k._tippy=C;var L=b.map(function(ae){return ae.fn(C)}),D=n.hasAttribute("aria-expanded");return Be(),Y(),V(),$("onCreate",[C]),t.showOnCreate&&Z(),k.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&B().addEventListener("mousemove",p)}),C;function R(){var ae=C.props.touch;return Array.isArray(ae)?ae:[ae,0]}function P(){return R()[0]==="hold"}function M(){var ae;return!!((ae=C.props.render)!=null&&ae.$$tippy)}function O(){return m||n}function B(){var ae=O().parentNode;return ae?S2t(ae):document}function F(){return CEe(k)}function H(ae){return C.state.isMounted&&!C.state.isVisible||cv.isTouch||u&&u.type==="focus"?0:kQ(C.props.delay,ae?0:1,e_.delay)}function V(ae){ae===void 0&&(ae=!1),k.style.pointerEvents=C.props.interactive&&!ae?"":"none",k.style.zIndex=""+C.props.zIndex}function $(ae,Se,Xe){if(Xe===void 0&&(Xe=!0),L.forEach(function(Tt){Tt[ae]&&Tt[ae].apply(Tt,Se)}),Xe){var wt;(wt=C.props)[ae].apply(wt,Se)}}function j(){var ae=C.props.aria;if(ae.content){var Se="aria-"+ae.content,Xe=k.id,wt=XT(C.props.triggerTarget||n);wt.forEach(function(Tt){var zt=Tt.getAttribute(Se);if(C.state.isVisible)Tt.setAttribute(Se,zt?zt+" "+Xe:Xe);else{var Mt=zt&&zt.replace(Xe,"").trim();Mt?Tt.setAttribute(Se,Mt):Tt.removeAttribute(Se)}})}}function Y(){if(!(D||!C.props.aria.expanded)){var ae=XT(C.props.triggerTarget||n);ae.forEach(function(Se){C.props.interactive?Se.setAttribute("aria-expanded",C.state.isVisible&&Se===O()?"true":"false"):Se.removeAttribute("aria-expanded")})}}function ne(){B().removeEventListener("mousemove",p),w6=w6.filter(function(ae){return ae!==p})}function se(ae){if(!(cv.isTouch&&(l||ae.type==="mousedown"))){var Se=ae.composedPath&&ae.composedPath()[0]||ae.target;if(!(C.props.interactive&&vEe(k,Se))){if(XT(C.props.triggerTarget||n).some(function(Xe){return vEe(Xe,Se)})){if(cv.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else $("onClickOutside",[C,ae]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),a=!0,setTimeout(function(){a=!1}),C.state.isMounted||Ie())}}}function he(){l=!0}function xe(){l=!1}function _e(){var ae=B();ae.addEventListener("mousedown",se,!0),ae.addEventListener("touchend",se,$S),ae.addEventListener("touchstart",xe,$S),ae.addEventListener("touchmove",he,$S)}function Ie(){var ae=B();ae.removeEventListener("mousedown",se,!0),ae.removeEventListener("touchend",se,$S),ae.removeEventListener("touchstart",xe,$S),ae.removeEventListener("touchmove",he,$S)}function Re(ae,Se){Ze(ae,function(){!C.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&Se()})}function Ye(ae,Se){Ze(ae,Se)}function Ze(ae,Se){var Xe=F().box;function wt(Tt){Tt.target===Xe&&(IQ(Xe,"remove",wt),Se())}if(ae===0)return Se();IQ(Xe,"remove",d),IQ(Xe,"add",wt),d=wt}function tt(ae,Se,Xe){Xe===void 0&&(Xe=!1);var wt=XT(C.props.triggerTarget||n);wt.forEach(function(Tt){Tt.addEventListener(ae,Se,Xe),g.push({node:Tt,eventType:ae,handler:Se,options:Xe})})}function Be(){P()&&(tt("touchstart",Vt,{passive:!0}),tt("touchend",Kt,{passive:!0})),p2t(C.props.trigger).forEach(function(ae){if(ae!=="manual")switch(tt(ae,Vt),ae){case"mouseenter":tt("mouseleave",Kt);break;case"focus":tt(L2t?"focusout":"blur",cn);break;case"focusin":tt("focusout",cn);break}})}function kt(){g.forEach(function(ae){var Se=ae.node,Xe=ae.eventType,wt=ae.handler,Tt=ae.options;Se.removeEventListener(Xe,wt,Tt)}),g=[]}function Vt(ae){var Se,Xe=!1;if(!(!C.state.isEnabled||wn(ae)||a)){var wt=((Se=u)==null?void 0:Se.type)==="focus";u=ae,m=ae.currentTarget,Y(),!C.state.isVisible&&y2t(ae)&&w6.forEach(function(Tt){return Tt(ae)}),ae.type==="click"&&(C.props.trigger.indexOf("mouseenter")<0||s)&&C.props.hideOnClick!==!1&&C.state.isVisible?Xe=!0:Z(ae),ae.type==="click"&&(s=!Xe),Xe&&!wt&&G(ae)}}function xt(ae){var Se=ae.target,Xe=O().contains(Se)||k.contains(Se);if(!(ae.type==="mousemove"&&Xe)){var wt=me().concat(k).map(function(Tt){var zt,Mt=Tt._tippy,On=(zt=Mt.popperInstance)==null?void 0:zt.state;return On?{popperRect:Tt.getBoundingClientRect(),popperState:On,props:t}:null}).filter(Boolean);E2t(wt,ae)&&(ne(),G(ae))}}function Kt(ae){var Se=wn(ae)||C.props.trigger.indexOf("click")>=0&&s;if(!Se){if(C.props.interactive){C.hideWithInteractivity(ae);return}G(ae)}}function cn(ae){C.props.trigger.indexOf("focusin")<0&&ae.target!==O()||C.props.interactive&&ae.relatedTarget&&k.contains(ae.relatedTarget)||G(ae)}function wn(ae){return cv.isTouch?P()!==ae.type.indexOf("touch")>=0:!1}function on(){Zt();var ae=C.props,Se=ae.popperOptions,Xe=ae.placement,wt=ae.offset,Tt=ae.getReferenceClientRect,zt=ae.moveTransition,Mt=M()?CEe(k).arrow:null,On=Tt?{getBoundingClientRect:Tt,contextElement:Tt.contextElement||O()}:n,Ni={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(ei){var li=ei.state;if(M()){var xi=F(),br=xi.box;["placement","reference-hidden","escaped"].forEach(function(Wr){Wr==="placement"?br.setAttribute("data-placement",li.placement):li.attributes.popper["data-popper-"+Wr]?br.setAttribute("data-"+Wr,""):br.removeAttribute("data-"+Wr)}),li.attributes.popper={}}}},xn=[{name:"offset",options:{offset:wt}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!zt}},Ni];M()&&Mt&&xn.push({name:"arrow",options:{element:Mt,padding:3}}),xn.push.apply(xn,(Se==null?void 0:Se.modifiers)||[]),C.popperInstance=T5e(On,k,Object.assign({},Se,{placement:Xe,onFirstUpdate:h,modifiers:xn}))}function Zt(){C.popperInstance&&(C.popperInstance.destroy(),C.popperInstance=null)}function pe(){var ae=C.props.appendTo,Se,Xe=O();C.props.interactive&&ae===Z6e||ae==="parent"?Se=Xe.parentNode:Se=J6e(ae,[Xe]),Se.contains(k)||Se.appendChild(k),C.state.isMounted=!0,on()}function me(){return S7(k.querySelectorAll("[data-tippy-root]"))}function Z(ae){C.clearDelayTimeouts(),ae&&$("onTrigger",[C,ae]),_e();var Se=H(!0),Xe=R(),wt=Xe[0],Tt=Xe[1];cv.isTouch&&wt==="hold"&&Tt&&(Se=Tt),Se?i=setTimeout(function(){C.show()},Se):C.show()}function G(ae){if(C.clearDelayTimeouts(),$("onUntrigger",[C,ae]),!C.state.isVisible){Ie();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(ae.type)>=0&&s)){var Se=H(!1);Se?r=setTimeout(function(){C.state.isVisible&&C.hide()},Se):o=requestAnimationFrame(function(){C.hide()})}}function K(){C.state.isEnabled=!0}function oe(){C.hide(),C.state.isEnabled=!1}function le(){clearTimeout(i),clearTimeout(r),cancelAnimationFrame(o)}function we(ae){if(!C.state.isDestroyed){$("onBeforeUpdate",[C,ae]),kt();var Se=C.props,Xe=yEe(n,Object.assign({},Se,mEe(ae),{ignoreAttributes:!0}));C.props=Xe,Be(),Se.interactiveDebounce!==Xe.interactiveDebounce&&(ne(),p=gEe(xt,Xe.interactiveDebounce)),Se.triggerTarget&&!Xe.triggerTarget?XT(Se.triggerTarget).forEach(function(wt){wt.removeAttribute("aria-expanded")}):Xe.triggerTarget&&n.removeAttribute("aria-expanded"),Y(),V(),I&&I(Se,Xe),C.popperInstance&&(on(),me().forEach(function(wt){requestAnimationFrame(wt._tippy.popperInstance.forceUpdate)})),$("onAfterUpdate",[C,ae])}}function Me(ae){C.setProps({content:ae})}function ft(){var ae=C.state.isVisible,Se=C.state.isDestroyed,Xe=!C.state.isEnabled,wt=cv.isTouch&&!C.props.touch,Tt=kQ(C.props.duration,0,e_.duration);if(!(ae||Se||Xe||wt)&&!O().hasAttribute("disabled")&&($("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,M()&&(k.style.visibility="visible"),V(),_e(),C.state.isMounted||(k.style.transition="none"),M()){var zt=F(),Mt=zt.box,On=zt.content;TQ([Mt,On],0)}h=function(){var xn;if(!(!C.state.isVisible||c)){if(c=!0,k.offsetHeight,k.style.transition=C.props.moveTransition,M()&&C.props.animation){var un=F(),ei=un.box,li=un.content;TQ([ei,li],Tt),_Ee([ei,li],"visible")}j(),Y(),pEe(LQ,C),(xn=C.popperInstance)==null||xn.forceUpdate(),$("onMount",[C]),C.props.animation&&M()&&Ye(Tt,function(){C.state.isShown=!0,$("onShown",[C])})}},pe()}}function Nt(){var ae=!C.state.isVisible,Se=C.state.isDestroyed,Xe=!C.state.isEnabled,wt=kQ(C.props.duration,1,e_.duration);if(!(ae||Se||Xe)&&($("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,c=!1,s=!1,M()&&(k.style.visibility="hidden"),ne(),Ie(),V(!0),M()){var Tt=F(),zt=Tt.box,Mt=Tt.content;C.props.animation&&(TQ([zt,Mt],wt),_Ee([zt,Mt],"hidden"))}j(),Y(),C.props.animation?M()&&Re(wt,C.unmount):C.unmount()}}function Yt(ae){B().addEventListener("mousemove",p),pEe(w6,p),p(ae)}function He(){C.state.isVisible&&C.hide(),C.state.isMounted&&(Zt(),me().forEach(function(ae){ae._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),LQ=LQ.filter(function(ae){return ae!==C}),C.state.isMounted=!1,$("onHidden",[C]))}function Dt(){C.state.isDestroyed||(C.clearDelayTimeouts(),C.unmount(),kt(),delete n._tippy,C.state.isDestroyed=!0,$("onDestroy",[C]))}}function D3(n,e){e===void 0&&(e={});var t=e_.plugins.concat(e.plugins||[]);T2t();var i=Object.assign({},e,{plugins:t}),r=w2t(n),o=r.reduce(function(s,a){var l=a&&M2t(a,i);return l&&s.push(l),s},[]);return eBe(n)?o[0]:o}D3.defaultProps=e_;D3.setDefaultProps=N2t;D3.currentInput=cv;Object.assign({},zhe,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}});D3.setDefaultProps({animation:!1});function iBe(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var rBe=typeof window<"u"&&typeof document<"u";function Pne(n,e){n&&(typeof n=="function"&&n(e),{}.hasOwnProperty.call(n,"current")&&(n.current=e))}function wEe(){return rBe&&document.createElement("div")}function F2t(n){var e={"data-placement":n.placement};return n.referenceHidden&&(e["data-reference-hidden"]=""),n.escaped&&(e["data-escaped"]=""),e}function oBe(n,e){if(n===e)return!0;if(typeof n=="object"&&n!=null&&typeof e=="object"&&e!=null){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(var t in n)if(e.hasOwnProperty(t)){if(!oBe(n[t],e[t]))return!1}else return!1;return!0}else return!1}function B2t(n){var e=[];return n.forEach(function(t){e.find(function(i){return oBe(t,i)})||e.push(t)}),e}function $2t(n,e){var t,i;return Object.assign({},e,{popperOptions:Object.assign({},n.popperOptions,e.popperOptions,{modifiers:B2t([].concat(((t=n.popperOptions)==null?void 0:t.modifiers)||[],((i=e.popperOptions)==null?void 0:i.modifiers)||[]))})})}var DQ=rBe?w.useLayoutEffect:w.useEffect;function V2t(n){var e=w.useRef();return e.current||(e.current=typeof n=="function"?n():n),e.current}function SEe(n,e,t){t.split(/\s+/).forEach(function(i){i&&n.classList[e](i)})}var H2t={name:"className",defaultValue:"",fn:function(e){var t=e.popper.firstElementChild,i=function(){var a;return!!((a=e.props.render)!=null&&a.$$tippy)};function r(){e.props.className&&!i()||SEe(t,"add",e.props.className)}function o(){i()&&SEe(t,"remove",e.props.className)}return{onCreate:r,onBeforeUpdate:o,onAfterUpdate:r}}};function W2t(n){function e(t){var i=t.children,r=t.content,o=t.visible,s=t.singleton,a=t.render,l=t.reference,c=t.disabled,u=c===void 0?!1:c,d=t.ignoreAttributes,h=d===void 0?!0:d;t.__source,t.__self;var g=iBe(t,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),p=o!==void 0,m=s!==void 0,_=w.useState(!1),v=_[0],b=_[1],y=w.useState({}),C=y[0],x=y[1],k=w.useState(),I=k[0],L=k[1],D=V2t(function(){return{container:wEe(),renders:1}}),R=Object.assign({ignoreAttributes:h},g,{content:D.container});p&&(R.trigger="manual",R.hideOnClick=!1),m&&(u=!0);var P=R,M=R.plugins||[];a&&(P=Object.assign({},R,{plugins:m&&s.data!=null?[].concat(M,[{fn:function(){return{onTrigger:function(H,V){var $=s.data.children.find(function(j){var Y=j.instance;return Y.reference===V.currentTarget});H.state.$$activeSingletonInstance=$.instance,L($.content)}}}}]):M,render:function(){return{popper:D.container}}}));var O=[l].concat(i?[i.type]:[]);return DQ(function(){var B=l;l&&l.hasOwnProperty("current")&&(B=l.current);var F=n(B||D.ref||wEe(),Object.assign({},P,{plugins:[H2t].concat(R.plugins||[])}));return D.instance=F,u&&F.disable(),o&&F.show(),m&&s.hook({instance:F,content:r,props:P,setSingletonContent:L}),b(!0),function(){F.destroy(),s==null||s.cleanup(F)}},O),DQ(function(){var B;if(D.renders===1){D.renders++;return}var F=D.instance;F.setProps($2t(F.props,P)),(B=F.popperInstance)==null||B.forceUpdate(),u?F.disable():F.enable(),p&&(o?F.show():F.hide()),m&&s.hook({instance:F,content:r,props:P,setSingletonContent:L})}),DQ(function(){var B;if(a){var F=D.instance;F.setProps({popperOptions:Object.assign({},F.props.popperOptions,{modifiers:[].concat((((B=F.props.popperOptions)==null?void 0:B.modifiers)||[]).filter(function(H){var V=H.name;return V!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(V){var $,j=V.state,Y=($=j.modifiersData)==null?void 0:$.hide;(C.placement!==j.placement||C.referenceHidden!==(Y==null?void 0:Y.isReferenceHidden)||C.escaped!==(Y==null?void 0:Y.hasPopperEscaped))&&x({placement:j.placement,referenceHidden:Y==null?void 0:Y.isReferenceHidden,escaped:Y==null?void 0:Y.hasPopperEscaped}),j.attributes.popper={}}}])})})}},[C.placement,C.referenceHidden,C.escaped].concat(O)),te.createElement(te.Fragment,null,i?w.cloneElement(i,{ref:function(F){D.ref=F,Pne(i.ref,F)}}):null,v&&Yp.createPortal(a?a(F2t(C),I,D.instance):r,D.container))}return e}var z2t=function(n,e){return w.forwardRef(function(i,r){var o=i.children,s=iBe(i,["children"]);return te.createElement(n,Object.assign({},e,s),o?w.cloneElement(o,{ref:function(l){Pne(r,l),Pne(o.ref,l)}}):null)})},j2t=z2t(W2t(D3),{render:function(){return""}});const A3=j2t;function U2t(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];n&&n.addEventListener&&n.addEventListener.apply(n,e)}function q2t(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];n&&n.removeEventListener&&n.removeEventListener.apply(n,e)}var K2t=["mousedown","touchstart"],G2t=function(n,e,t){t===void 0&&(t=K2t);var i=w.useRef(e);w.useEffect(function(){i.current=e},[e]),w.useEffect(function(){for(var r=function(l){var c=n.current;c&&!c.contains(l.target)&&i.current(l)},o=0,s=t;o<s.length;o++){var a=s[o];U2t(document,a,r)}return function(){for(var l=0,c=t;l<c.length;l++){var u=c[l];q2t(document,u,r)}}},[t,n])};const Bw=G2t;function Y2t(n,e){e===void 0&&(e=0);var t=w.useRef(!1),i=w.useRef(),r=w.useRef(n),o=w.useCallback(function(){return t.current},[]),s=w.useCallback(function(){t.current=!1,i.current&&clearTimeout(i.current),i.current=setTimeout(function(){t.current=!0,r.current()},e)},[e]),a=w.useCallback(function(){t.current=null,i.current&&clearTimeout(i.current)},[]);return w.useEffect(function(){r.current=n},[n]),w.useEffect(function(){return s(),a},[e]),[o,a,s]}function Hfe(n,e,t){e===void 0&&(e=0),t===void 0&&(t=[]);var i=Y2t(n,e),r=i[0],o=i[1],s=i[2];return w.useEffect(s,t),[r,o]}const Q2t=Ea.button`
color: ${n=>n.theme.color} !important;
background-color: ${n=>n.theme.backgroundColor} !important;
border-color: ${n=>n.theme.borderColor} !important;
`,X2t=Ea.div`
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function Hp(n){const e=w.useRef(null),[t,i]=w.useState(!1),r=ys(),[o,s]=w.useState(),a=(c,u)=>c==="div"?{onClick:()=>i(!1),key:u}:{setVisible:i,key:u};Bw(e,()=>{t&&i(!1)}),w.useEffect(()=>{s(w.Children.toArray(n.children))},[n.children]);const l=Vn();return f("div",{ref:e,children:f(A3,{disabled:n.disabled,placement:"bottom",interactive:!0,render:()=>f(X2t,{theme:{hoverColor:l.$2},className:`border box rounded-md shadow-lg focus:outline-none whitespace-normal ${n.className}`,style:{backgroundColor:l.$1,borderColor:l.$4,minWidth:"12rem",maxWidth:"14.7rem"},"data-cy":n.cypressRef,children:o==null?void 0:o.map((c,u)=>c&&(c.type==et||c.type=="div")?w.cloneElement(c,a(c.type,u)):c)}),visible:t,children:N(Q2t,{theme:{backgroundColor:r,color:l.$9,borderColor:l.$5},type:"button",disabled:n.disabled,onClick:()=>i(!t),className:St(`border inline-flex items-center space-x-2 px-4 justify-center rounded text-sm disabled:cursor-not-allowed disabled:opacity-75 py-2 ${n.className}`,{"hover:bg-white hover:border-gray-300":!n.cardActions,"hover:opacity-90":n.cardActions}),style:{backgroundColor:n.cardActions&&r,color:n.cardActions?"white":""},"data-cy":"chevronDownButton",children:[!n.cardActions&&f("span",{children:n.label}),f(z2,{size:n.cardActions?18:14})]})})})}function Ot(n){const[e]=ue(),{padding:t="regular",height:i}=n,[r,o]=w.useState(n.collapsed),s=Vn();return f("div",{className:St(`border shadow rounded overflow-visible ${n.className}`,{"overflow-y-auto":n.withScrollableBody,"h-full":i==="full"}),style:{...n.style,backgroundColor:s.$1,color:s.$3,borderColor:s.$4},children:N("form",{onSubmit:n.onFormSubmit,className:St({"h-full":i==="full"}),children:[n.title&&f("div",{className:St({"bg-white sticky top-0":n.withScrollableBody,"px-4 sm:px-6 py-3":t=="small","px-4 sm:px-6 py-5":t=="regular","border-b":!n.withoutHeaderBorder}),onClick:()=>typeof n.collapsed<"u"&&o(!r),style:{borderColor:s.$4},children:N("div",{className:St("flex items-center justify-between",{"cursor-pointer select-none":typeof n.collapsed<"u"}),children:[N("div",{children:[f("h3",{className:St("leading-6 font-medium",{"text-lg":t=="regular","text-md":t=="small"}),children:n.title}),n.description&&f("p",{className:"mt-1 max-w-2xl text-sm",children:n.description})]}),n.topRight,typeof n.collapsed<"u"&&r&&f(z2,{}),typeof n.collapsed<"u"&&!r&&f(K3e,{})]})}),N("div",{className:St(n.childrenClassName,{hidden:r,"py-0":n.withoutBodyPadding,"py-4":t==="regular"&&!n.withoutBodyPadding,"py-2":t==="small"&&!n.withoutBodyPadding,"h-full":i==="full"}),children:[n.isLoading&&f(U,{leftSide:f(Vo,{})}),n.withContainer?f(Sb,{children:n.children}):n.children]}),(n.withSaveButton||n.additionalAction)&&f("div",{className:"border-t px-4 py-5 sm:p-0",style:{borderColor:s.$4},children:f("dl",{className:"sm:divide-y sm:divide-gray-200",children:N("div",{className:"sm:py-5 sm:px-6 flex justify-end space-x-4",children:[n.additionalAction,n.withSaveButton&&!n.additionalSaveOptions&&f(Ut,{onClick:n.onSaveClick,disabled:n.disableSubmitButton,disableWithoutIcon:n.disableWithoutIcon,children:n.saveButtonLabel??e("save")}),n.withSaveButton&&n.additionalSaveOptions&&N("div",{className:"flex",children:[f(Ut,{className:"rounded-br-none rounded-tr-none px-3",onClick:n.onSaveClick,disabled:n.disableSubmitButton,disableWithoutIcon:n.disableWithoutIcon,children:n.saveButtonLabel??e("save")}),f(Hp,{className:"rounded-bl-none rounded-tl-none h-full px-1 border-gray-200 border-l-1 border-y-0 border-r-0",disabled:n.disableSubmitButton,cardActions:!0,children:n.additionalSaveOptions.map((a,l)=>f(et,{icon:a.icon,disabled:n.disableSubmitButton,onClick:a.onClick,children:a.text},l))})]})]})})})]})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Sb(n){return f("div",{className:"px-6 py-4 space-y-6",children:n.children})}const Z2t=Ea.button`
color: ${n=>n.theme.color};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}:
`,J2t=Ea.a`
color: ${n=>n.theme.color};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}:
`,eAt=Ea(E0)`
color: ${n=>n.theme.color};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}:
`;function Ja(n){const e=Vn(),t=`block w-full text-left px-4 sm:px-6 block py-4 space-x-3 text-sm ${n.className}`;return n.to?f(eAt,{theme:{hoverColor:e.$4,color:e.$3},to:n.to,style:{pointerEvents:n.disableNavigation?"none":"all"},className:t,children:n.children}):n.href?f(J2t,{theme:{hoverColor:e.$4,color:e.$3},target:"_blank",href:n.href,className:t,rel:"noreferrer",children:n.children}):f(Z2t,{theme:{hoverColor:e.$4,color:e.$3},type:"button",onClick:n.onClick,onChange:n.onChange,className:t,children:n.children})}/*!
* hex-color-regex <https://github.com/regexps/hex-color-regex>
*
* Copyright (c) 2015 Charlike Mike Reagent <@tunnckoCore> (http://www.tunnckocore.tk)
* Released under the MIT license.
*/var tAt=function(e){return e=e&&typeof e=="object"?e:{},e.strict?/^#([a-f0-9]{3,4}|[a-f0-9]{4}(?:[a-f0-9]{2}){1,2})\b$/i:/#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})\b/gi};const nAt=ja(tAt),iAt=["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2f7dc3","#2196f3","#03a9f4","#00bcd4","#009688","#4caf50","#8bc34a","#ff9800","#ff5722","#795548","#9e9e9e","#607d8b","#616161","#000000","#57a6e4","#324da1","#4c9a1c","#cd8900","#b93700"],c8=["sidebar_active_background_color","sidebar_active_font_color","sidebar_inactive_background_color","sidebar_inactive_font_color","invoice_header_background_color","invoice_header_font_color","table_alternate_row_background_color"],Mne={light:{palette:["#58a6e4","#324ea1","#4c9a1d","#cd8900","#b83700"]},dark:{palette:["#298aaa","#0c45a3","#407535","#a87001","#8b3c40"]},cerulean:{palette:["#043c73","#2fa3e7","#74a739","#dd5601","#c71b22"]},cosmo:{palette:["#9954bc","#2680e3","#3db616","#ff7518","#ff0039"]},cyborg:{palette:["#9933cc","#299fd6","#76b400","#ff8802","#cc0100"]},darkly:{palette:["#3498dc","#375a7f","#00bc8c","#f29c13","#e74b3c"]},flatly:{palette:["#3498dc","#2c3f51","#12bd9d","#f29c13","#e74b3c"]},journal:{palette:["#346599","#eb6864","#1fb34d","#f6e524","#f57900"]},litera:{palette:["#1aa1b8","#4581eb","#00b975","#f0ad4e","#d9534f"]},lumen:{palette:["#75caeb","#158cba","#29b72b","#ff851b","#ff4136"]},lux:{palette:["#209bcf","#1a1a1a","#4ac073","#f0ad4e","#d9534f"]},materia:{palette:["#9c27b0","#2196f3","#4dae51","#ff9800","#e61d23"]},minty:{palette:["#6cc3d6","#78c2ad","#55cc9d","#ffce67","#ff7852"]},pulse:{palette:["#009cdd","#583196","#0fba54","#efa31b","#fc3938"]},sandstone:{palette:["#2aaae0","#335d87","#94c44b","#f37c3d","#d9534f"]},simplex:{palette:["#009acf","#d9230d","#479505","#d9831f","#9c479f"]},sketchy:{palette:["#1aa1b8","#333333","#29a645","#ffc008","#db3546"]},slate:{palette:["#5ac0de","#3a3f43","#62c362","#f89407","#ee5f5a"]},solar:{palette:["#258bd2","#b58802","#2aa198","#cb4a15","#d33582"]},spacelab:{palette:["#3199f3","#456e9c","#3cb521","#d47500","#cd0300"]},superhero:{palette:["#cd0300","#df6919","#5bb85b","#f0ad4e","#d9534f"]},united:{palette:["#1aa1b8","#e9551f","#38b549","#eeb83e","#de382c"]},yeti:{palette:["#5ac0de","#008cba","#44ab6a","#ea9005","#f14125"]}};function rAt(){return(n,e)=>n&&nAt().test(n)?n:e}function Ng(){var t,i,r;const n=sl(),e={$1:"",$2:"",$3:"",$4:"",$5:""};return(r=(i=Mne[(t=n==null?void 0:n.color_theme)==null?void 0:t.status_color_theme])==null?void 0:i.palette)==null||r.forEach((o,s)=>{e[`$${s+1}`]=o}),e}function Wfe(){const n=sl(),e={$1:"",$2:"",$3:"",$4:"",$5:"",$6:"",$7:""};return c8.forEach((t,i)=>{var r;e[`$${i+1}`]=((r=n==null?void 0:n.color_theme)==null?void 0:r[t])||""}),e}function oAt(){var s;const[n]=ue(),e=sl(),t=Ci(),i=L3(),r=()=>{let a="";c8.forEach(l=>{var c,u;!a&&((c=e==null?void 0:e.color_theme)!=null&&c[l])&&(a=e.color_theme[l]),a&&((u=e==null?void 0:e.color_theme)!=null&&u[l])&&(a+=","+e.color_theme[l])}),navigator.clipboard.writeText(a).then(()=>ie.success("copied_to_clipboard",{value:""}))},o=()=>{const a=Bn.cloneDeep(e==null?void 0:e.color_theme);a&&(c8.forEach(l=>{a[l]=""}),t(gk({property:"company_user.react_settings.color_theme",value:a})))};return N(_t,{children:[f(U,{leftSide:n("status_color_theme"),children:f(nn,{value:((s=e==null?void 0:e.color_theme)==null?void 0:s.status_color_theme)||"light",onValueChange:a=>i("company_user.react_settings.color_theme.status_color_theme",a),customSelector:!0,children:Object.keys(Mne).map((a,l)=>{var c,u;return f("option",{value:a,children:N("div",{className:"flex w-full space-x-2",children:[f("span",{className:"flex w-1/4 capitalize truncate",children:n(a)}),f("div",{className:"flex",children:(u=(c=Mne[a])==null?void 0:c.palette)==null?void 0:u.map(d=>f("div",{style:{backgroundColor:d,width:50,height:20}},d))})]})},l)})})}),c8.map(a=>f(U,{leftSide:n(a),children:f(sAt,{fieldKey:a})},a)),N("div",{className:"flex justify-end px-6 mt-10 space-x-4",children:[f(Ut,{behavior:"button",type:"secondary",onClick:o,children:n("clear_all")}),f(Ut,{behavior:"button",onClick:r,children:n("export_colors")})]})]})}function sAt(n){var r;const{fieldKey:e}=n,t=sl(),i=L3();return N("div",{className:"flex space-x-20",children:[f(ke,{value:((r=t==null?void 0:t.color_theme)==null?void 0:r[e])||"",onValueChange:o=>i(`company_user.react_settings.color_theme.${e}`,o)}),f(aAt,{fieldKey:e})]})}function aAt(n){var u;const[e]=ue(),{fieldKey:t}=n,i=sl(),r=rAt(),o=L3(),[s,a]=w.useState(!1),[l,c]=w.useState("");return w.useEffect(()=>{var d;s&&c(((d=i==null?void 0:i.color_theme)==null?void 0:d[t])||"")},[s]),N(_t,{children:[N("div",{className:"flex items-center space-x-2",children:[f("div",{className:"cursor-pointer hover:opacity-75",onClick:()=>a(!0),style:{width:100,height:38,backgroundColor:r((u=i==null?void 0:i.color_theme)==null?void 0:u[t],"#9e9e9e")}}),f(Ve,{className:"cursor-pointer",element:f0,size:26,onClick:()=>o(`company_user.react_settings.color_theme.${t}`,"")})]}),f(cr,{title:e(t),visible:s,size:"small",onClose:()=>a(!1),children:N("div",{className:"flex flex-col space-y-6",children:[f("div",{className:"grid grid-cols-6 gap-x-2 gap-y-2",children:iAt.map(d=>f("div",{className:"relative cursor-pointer w-full hover:opacity-75",onClick:()=>c(d),style:{height:32,backgroundColor:d},children:l===d&&f(Ve,{className:"absolute",element:Yhe,color:"white",size:25,style:{top:"0.3rem",left:"1.45rem"}})},d))}),f(Ut,{className:"self-end",behavior:"button",onClick:()=>{o(`company_user.react_settings.color_theme.${t}`,l),a(!1)},children:e("done")})]})})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const R3=n=>{n=n.replace("#",""),n.length===3&&(n=n.split("").map(r=>r+r).join(""));const e=parseInt(n.substring(0,2),16),t=parseInt(n.substring(2,4),16),i=parseInt(n.substring(4,6),16);return{red:e,green:t,blue:i,hex:`#${n}`}},rj=(n,e,t)=>n+e+t>384;function oj(){return(n,e)=>"#"+n.replace(/^#/,"").replace(/../g,r=>{const o="0"+Math.min(255,Math.max(0,parseInt(r,16)+e)).toString(16),s=o.length;return o.substring(s-2,s)})}const lAt=Ea.div`
background-color: ${n=>n.theme.color};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`,EEe=Ea(Ii)`
&:hover {
background-color: ${n=>{if(n.theme.hoverColor){const e=R3(n.theme.hoverColor);return`rgba(${e.red}, ${e.green}, ${e.blue}, 0.1)`}return n.theme.hoverColor}};
}
`;function Fne(n){var s;const{item:e}=n,t=Vn(),i=x0(),r=Wfe(),o=!!((s=i==null?void 0:i.company_user)!=null&&s.react_settings.show_mini_sidebar);return e.visible?N(lAt,{theme:{color:e.current?r.$1||t.$8:r.$3||"transparent",hoverColor:r.$1||t.$8},className:St("flex items-center justify-between group px-4 text-sm font-medium",{"text-white border-l-4 border-transparent":e.current,"text-gray-300 border-l-4 border-transparent":!e.current}),children:[f(EEe,{to:e.href,className:"w-full",withoutDefaultStyling:!0,children:N("div",{className:"flex justify-start items-center my-2",style:{color:e.current?r.$2:r.$4},children:[f(e.icon,{className:St("mr-3 flex-shrink-0 h-5 w-5",{"text-white":e.current,"text-gray-300 group-hover:text-white":!e.current}),"aria-hidden":"true",style:{color:e.current?r.$2:r.$4}}),!o&&e.name]})}),e.rightButton&&!o&&e.rightButton.visible&&f(EEe,{theme:{hoverColor:t.$13},to:e.rightButton.to,className:"rounded-full p-1.5",withoutDefaultStyling:!0,children:f(e.rightButton.icon,{className:"h-5 w-5",style:{color:e.current?r.$2:r.$4}})})]},e.name):f(_t,{})}function du(n){const e=Vn(),{width:t,placement:i,withoutArrow:r,tooltipElement:o,message:s,disabled:a,withoutWrapping:l}=n,c=w.useRef(null),[u,d]=w.useState(0),[h,g]=w.useState(!1);return w.useEffect(()=>{var _,v;const p=(_=c==null?void 0:c.current)==null?void 0:_.offsetWidth,m=(v=c==null?void 0:c.current)==null?void 0:v.children[0];m&&p&&(m.offsetWidth>p?(d(p+10),g(!0)):d(m.offsetWidth+10))},[c,n.message]),f("div",{className:St(n.className,{"max-w-sm":n.size===void 0||n.size==="small","max-w-md":n.size==="regular","max-w-xl":n.size==="large"}),children:f(A3,{placement:i||"top-start",interactive:!0,render:()=>N("div",{className:"flex flex-col items-center",onClick:p=>p.stopPropagation(),children:[N("div",{className:St("relative p-2 text-xs text-center text-white rounded-md",{"leading-1":h,"leading-none":!h,"whitespace-normal break-all":!!s&&!l,"whitespace-nowrap":l}),style:{width:t||u,backgroundColor:e.$5,color:e.$3},children:[s,o]}),!r&&f(Ve,{className:"rotate-90 -mt-2.5",element:oyt,size:24,style:{color:e.$5}})]}),disabled:a,children:f("div",{ref:c,className:St("cursor-pointer",{"truncate w-full":n.truncate}),children:n.children})})})}function cAt(n){var o;const e=x0(),t=!!((o=e==null?void 0:e.company_user)!=null&&o.react_settings.show_mini_sidebar),i=Qz(),r=Vn();return f("div",{className:St("hidden md:flex z-10 md:flex-col md:fixed md:inset-y-0",{"md:w-16":t,"md:w-64":!t}),children:N("div",{style:{backgroundColor:r.$6,borderColor:r.$4},className:"flex flex-col flex-grow overflow-y-auto border-r",children:[f("div",{style:{borderColor:r.$5,backgroundColor:r.$1,color:r.$3},className:St("flex items-center flex-shrink-0 h-16 border-b",{"pl-3 pr-6":!t,"justify-center":t}),children:t?f("img",{className:"w-8",src:i,alt:"Company logo"}):f(c6e,{})}),N("div",{className:"flex-grow flex flex-col mt-4",children:[f("nav",{className:"flex-1 pb-4 space-y-1","data-cy":"navigationBar",children:n.navigation.map((s,a)=>t?f(du,{message:s.name,width:"auto",placement:"right",withoutArrow:!0,withoutWrapping:!0,children:f(Fne,{item:s},a)},a):f(Fne,{item:s},a))}),f(X6e,{docsLink:n.docsLink})]})]})})}function uAt(n){var o;const e=Qz(),t=Vn(),i=x0(),r=!!((o=i==null?void 0:i.company_user)!=null&&o.react_settings.show_mini_sidebar);return f(Ly.Root,{show:n.sidebarOpen,as:w.Fragment,children:N(aO,{as:"div",className:"fixed inset-0 flex z-40 md:hidden",onClose:n.setSidebarOpen,style:{width:r?"4rem":"19.4rem"},children:[f(Ly.Child,{as:w.Fragment,enter:"transition-opacity ease-linear duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity ease-linear duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:f(aO.Overlay,{className:"fixed inset-0 bg-gray-600 bg-opacity-75"})}),f(Ly.Child,{as:w.Fragment,enter:"transition ease-in-out duration-300",enterFrom:"-translate-x-full",enterTo:"translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"translate-x-0",leaveTo:"-translate-x-full",children:N("div",{className:"relative flex-1 flex flex-col max-w-xs w-full bg-ninja-gray dark:bg-gray-900",children:[f(Ly.Child,{as:w.Fragment,enter:"ease-in-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in-out duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:f("div",{className:"absolute top-0 right-0 -mr-12 pt-2",children:N("button",{type:"button",className:"ml-1 flex items-center justify-center h-10 w-10 rounded-full focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white",onClick:()=>n.setSidebarOpen(!1),children:[f("span",{className:"sr-only",children:"Close sidebar"}),f(L_,{className:"text-white"})]})})}),f("div",{className:"flex-shrink-0 flex items-center px-4 py-3 border-b h-16 justify-center border-gray-600",style:{backgroundColor:t.$1,color:t.$3},children:r?f("img",{className:"w-8",src:e,alt:"Company logo"}):f(c6e,{})}),N("div",{className:"flex flex-col flex-1 h-0 overflow-y-auto mt-4",children:[f("nav",{className:"flex-1 space-y-1",children:n.navigation.map((s,a)=>f(Fne,{item:s},a))}),f(X6e,{mobileNavbar:!0})]})]})}),f("div",{className:"flex-shrink-0 w-14","aria-hidden":"true"})]})})}var Xn=(n=>(n[n.Invoices=4096]="Invoices",n[n.RecurringInvoices=1]="RecurringInvoices",n[n.Quotes=4]="Quotes",n[n.Credits=2]="Credits",n[n.Projects=32]="Projects",n[n.Tasks=8]="Tasks",n[n.Vendors=64]="Vendors",n[n.Expenses=16]="Expenses",n[n.RecurringExpenses=512]="RecurringExpenses",n[n.PurchaseOrders=16384]="PurchaseOrders",n[n.Transactions=256]="Transactions",n))(Xn||{});const dAt=[{label:"invoices",bitmask:4096},{label:"recurring_invoices",bitmask:1},{label:"quotes",bitmask:4},{label:"credits",bitmask:2},{label:"projects",bitmask:32},{label:"tasks",bitmask:8},{label:"vendors",bitmask:64},{label:"expenses",bitmask:16},{label:"purchase_orders",bitmask:16384},{label:"recurring_expenses",bitmask:512},{label:"transactions",bitmask:256}];function hAt(){const[n]=ue(),e=Ti(),t=Ci(),i=(r,o)=>t(Vr({object:"company",property:"enabled_modules",value:(e==null?void 0:e.enabled_modules)^o}));return f(Ot,{title:n("enabled_modules"),children:dAt.map((r,o)=>f(U,{leftSide:n(r.label),children:f(gt,{checked:!!((e==null?void 0:e.enabled_modules)&r.bitmask),onChange:s=>i(s,r.bitmask)},r.label)},o))})}function Jn(n){const e=Vn();return f("div",{style:{borderColor:n.borderColor||e.$4},className:St("border-b",{"pt-6 mb-4 border-b":!n.withoutPadding},n.className??"")})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Wp(){return!0}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function ql(){return!0}function fAt(){const[n]=ue(),{isAdmin:e}=ao();return N(Ot,{title:n("integrations"),children:[((Wp()||ql())&&Yo()||t3())&&e&&f(Ja,{to:"/settings/integrations/api_tokens",children:n("api_tokens")}),f(Ja,{to:"/settings/integrations/api_webhooks",children:n("api_webhooks")}),f(Ja,{href:"https://invoiceninja.github.io",children:n("api_docs")}),f(Jn,{}),f(Ja,{className:"mt-4",href:"https://zapier.com/apps/invoice-ninja/integrations",children:"Zapier"}),f(Ja,{to:"/settings/integrations/analytics",children:n("analytics")})]})}function gAt(){const[n]=ue(),e="https://invoiceninja.invoicing.co/client/subscriptions/O5xe7Rwd7r/purchase",[t,i]=w.useState(!1),r=Xp({initialValues:{license:""},onSubmit:o=>{ie.processing(),Te("POST",ye("/api/v1/claim_license?license_key=:key",{key:o.license})).then(()=>{ie.success("bought_white_label"),i(!1)}).finally(()=>r.setSubmitting(!1))}});return N(_t,{children:[f(cr,{title:n("apply_license"),visible:t,onClose:i,children:N("form",{onSubmit:r.handleSubmit,className:"space-y-4",children:[f(ke,{onChange:r.handleChange,label:n("license"),id:"license",required:!0}),f(Ut,{disabled:r.isSubmitting,variant:"block",children:n("submit")})]})}),f(Jn,{withoutPadding:!0}),f(Ja,{href:e,children:n("purchase_license")}),f(Ja,{onClick:()=>i(!0),children:n("apply_license")})]})}var sBe={exports:{}},Ps={};/**
* @license React
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var zfe=Symbol.for("react.element"),jfe=Symbol.for("react.portal"),sj=Symbol.for("react.fragment"),aj=Symbol.for("react.strict_mode"),lj=Symbol.for("react.profiler"),cj=Symbol.for("react.provider"),uj=Symbol.for("react.context"),pAt=Symbol.for("react.server_context"),dj=Symbol.for("react.forward_ref"),hj=Symbol.for("react.suspense"),fj=Symbol.for("react.suspense_list"),gj=Symbol.for("react.memo"),pj=Symbol.for("react.lazy"),mAt=Symbol.for("react.offscreen"),aBe;aBe=Symbol.for("react.module.reference");function Zp(n){if(typeof n=="object"&&n!==null){var e=n.$$typeof;switch(e){case zfe:switch(n=n.type,n){case sj:case lj:case aj:case hj:case fj:return n;default:switch(n=n&&n.$$typeof,n){case pAt:case uj:case dj:case pj:case gj:case cj:return n;default:return e}}case jfe:return e}}}Ps.ContextConsumer=uj;Ps.ContextProvider=cj;Ps.Element=zfe;Ps.ForwardRef=dj;Ps.Fragment=sj;Ps.Lazy=pj;Ps.Memo=gj;Ps.Portal=jfe;Ps.Profiler=lj;Ps.StrictMode=aj;Ps.Suspense=hj;Ps.SuspenseList=fj;Ps.isAsyncMode=function(){return!1};Ps.isConcurrentMode=function(){return!1};Ps.isContextConsumer=function(n){return Zp(n)===uj};Ps.isContextProvider=function(n){return Zp(n)===cj};Ps.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===zfe};Ps.isForwardRef=function(n){return Zp(n)===dj};Ps.isFragment=function(n){return Zp(n)===sj};Ps.isLazy=function(n){return Zp(n)===pj};Ps.isMemo=function(n){return Zp(n)===gj};Ps.isPortal=function(n){return Zp(n)===jfe};Ps.isProfiler=function(n){return Zp(n)===lj};Ps.isStrictMode=function(n){return Zp(n)===aj};Ps.isSuspense=function(n){return Zp(n)===hj};Ps.isSuspenseList=function(n){return Zp(n)===fj};Ps.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===sj||n===lj||n===aj||n===hj||n===fj||n===mAt||typeof n=="object"&&n!==null&&(n.$$typeof===pj||n.$$typeof===gj||n.$$typeof===cj||n.$$typeof===uj||n.$$typeof===dj||n.$$typeof===aBe||n.getModuleId!==void 0)};Ps.typeOf=Zp;sBe.exports=Ps;var lBe=sBe.exports;function E7(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[];return te.Children.forEach(n,function(i){i==null&&!e.keepEmpty||(Array.isArray(i)?t=t.concat(E7(i)):lBe.isFragment(i)&&i.props?t=t.concat(E7(i.props.children,e)):t.push(i))}),t}var Bne={},_At=function(e){};function vAt(n,e){}function bAt(n,e){}function yAt(){Bne={}}function cBe(n,e,t){!e&&!Bne[t]&&(n(!1,t),Bne[t]=!0)}function Uu(n,e){cBe(vAt,n,e)}function uBe(n,e){cBe(bAt,n,e)}Uu.preMessage=_At;Uu.resetWarned=yAt;Uu.noteOnce=uBe;function x7(n){return n instanceof HTMLElement||n instanceof SVGElement}function u8(n){return x7(n)?n:n instanceof te.Component?VW.findDOMNode(n):null}function N3(n,e,t){var i=w.useRef({});return(!("value"in i.current)||t(i.current.condition,e))&&(i.current.value=n(),i.current.condition=e),i.current.value}function Ufe(n,e){typeof n=="function"?n(e):Er(n)==="object"&&n&&"current"in n&&(n.current=e)}function mj(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];var i=e.filter(function(r){return r});return i.length<=1?i[0]:function(r){e.forEach(function(o){Ufe(o,r)})}}function qfe(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return N3(function(){return mj.apply(void 0,e)},e,function(i,r){return i.length!==r.length||i.every(function(o,s){return o!==r[s]})})}function O3(n){var e,t,i=lBe.isMemo(n)?n.type.type:n.type;return!(typeof i=="function"&&!((e=i.prototype)!==null&&e!==void 0&&e.render)||typeof n=="function"&&!((t=n.prototype)!==null&&t!==void 0&&t.render))}var $ne=w.createContext(null);function CAt(n){var e=n.children,t=n.onBatchResize,i=w.useRef(0),r=w.useRef([]),o=w.useContext($ne),s=w.useCallback(function(a,l,c){i.current+=1;var u=i.current;r.current.push({size:a,element:l,data:c}),Promise.resolve().then(function(){u===i.current&&(t==null||t(r.current),r.current=[])}),o==null||o(a,l,c)},[t,o]);return w.createElement($ne.Provider,{value:s},e)}var dBe=function(){if(typeof Map<"u")return Map;function n(e,t){var i=-1;return e.some(function(r,o){return r[0]===t?(i=o,!0):!1}),i}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(t){var i=n(this.__entries__,t),r=this.__entries__[i];return r&&r[1]},e.prototype.set=function(t,i){var r=n(this.__entries__,t);~r?this.__entries__[r][1]=i:this.__entries__.push([t,i])},e.prototype.delete=function(t){var i=this.__entries__,r=n(i,t);~r&&i.splice(r,1)},e.prototype.has=function(t){return!!~n(this.__entries__,t)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,i){i===void 0&&(i=null);for(var r=0,o=this.__entries__;r<o.length;r++){var s=o[r];t.call(i,s[1],s[0])}},e}()}(),Vne=typeof window<"u"&&typeof document<"u"&&window.document===document,k7=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),wAt=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(k7):function(n){return setTimeout(function(){return n(Date.now())},1e3/60)}}(),SAt=2;function EAt(n,e){var t=!1,i=!1,r=0;function o(){t&&(t=!1,n()),i&&a()}function s(){wAt(o)}function a(){var l=Date.now();if(t){if(l-r<SAt)return;i=!0}else t=!0,i=!1,setTimeout(s,e);r=l}return a}var xAt=20,kAt=["top","right","bottom","left","width","height","size","weight"],TAt=typeof MutationObserver<"u",IAt=function(){function n(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=EAt(this.refresh.bind(this),xAt)}return n.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},n.prototype.removeObserver=function(e){var t=this.observers_,i=t.indexOf(e);~i&&t.splice(i,1),!t.length&&this.connected_&&this.disconnect_()},n.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},n.prototype.updateObservers_=function(){var e=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return e.forEach(function(t){return t.broadcastActive()}),e.length>0},n.prototype.connect_=function(){!Vne||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),TAt?(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)},n.prototype.disconnect_=function(){!Vne||!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)},n.prototype.onTransitionEnd_=function(e){var t=e.propertyName,i=t===void 0?"":t,r=kAt.some(function(o){return!!~i.indexOf(o)});r&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n}(),hBe=function(n,e){for(var t=0,i=Object.keys(e);t<i.length;t++){var r=i[t];Object.defineProperty(n,r,{value:e[r],enumerable:!1,writable:!1,configurable:!0})}return n},SD=function(n){var e=n&&n.ownerDocument&&n.ownerDocument.defaultView;return e||k7},fBe=_j(0,0,0,0);function T7(n){return parseFloat(n)||0}function xEe(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.reduce(function(i,r){var o=n["border-"+r+"-width"];return i+T7(o)},0)}function LAt(n){for(var e=["top","right","bottom","left"],t={},i=0,r=e;i<r.length;i++){var o=r[i],s=n["padding-"+o];t[o]=T7(s)}return t}function DAt(n){var e=n.getBBox();return _j(0,0,e.width,e.height)}function AAt(n){var e=n.clientWidth,t=n.clientHeight;if(!e&&!t)return fBe;var i=SD(n).getComputedStyle(n),r=LAt(i),o=r.left+r.right,s=r.top+r.bottom,a=T7(i.width),l=T7(i.height);if(i.boxSizing==="border-box"&&(Math.round(a+o)!==e&&(a-=xEe(i,"left","right")+o),Math.round(l+s)!==t&&(l-=xEe(i,"top","bottom")+s)),!NAt(n)){var c=Math.round(a+o)-e,u=Math.round(l+s)-t;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return _j(r.left,r.top,a,l)}var RAt=function(){return typeof SVGGraphicsElement<"u"?function(n){return n instanceof SD(n).SVGGraphicsElement}:function(n){return n instanceof SD(n).SVGElement&&typeof n.getBBox=="function"}}();function NAt(n){return n===SD(n).document.documentElement}function OAt(n){return Vne?RAt(n)?DAt(n):AAt(n):fBe}function PAt(n){var e=n.x,t=n.y,i=n.width,r=n.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(o.prototype);return hBe(s,{x:e,y:t,width:i,height:r,top:t,right:e+i,bottom:r+t,left:e}),s}function _j(n,e,t,i){return{x:n,y:e,width:t,height:i}}var MAt=function(){function n(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=_j(0,0,0,0),this.target=e}return n.prototype.isActive=function(){var e=OAt(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},n.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},n}(),FAt=function(){function n(e,t){var i=PAt(t);hBe(this,{target:e,contentRect:i})}return n}(),BAt=function(){function n(e,t,i){if(this.activeObservations_=[],this.observations_=new dBe,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=i}return n.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof SD(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new MAt(e)),this.controller_.addObserver(this),this.controller_.refresh())}},n.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof SD(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))}},n.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},n.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},n.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(i){return new FAt(i.target,i.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},n.prototype.clearActive=function(){this.activeObservations_.splice(0)},n.prototype.hasActive=function(){return this.activeObservations_.length>0},n}(),gBe=typeof WeakMap<"u"?new WeakMap:new dBe,pBe=function(){function n(e){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=IAt.getInstance(),i=new BAt(e,t,this);gBe.set(this,i)}return n}();["observe","unobserve","disconnect"].forEach(function(n){pBe.prototype[n]=function(){var e;return(e=gBe.get(this))[n].apply(e,arguments)}});var $At=function(){return typeof k7.ResizeObserver<"u"?k7.ResizeObserver:pBe}(),W1=new Map;function VAt(n){n.forEach(function(e){var t,i=e.target;(t=W1.get(i))===null||t===void 0||t.forEach(function(r){return r(i)})})}var mBe=new $At(VAt);function HAt(n,e){W1.has(n)||(W1.set(n,new Set),mBe.observe(n)),W1.get(n).add(e)}function WAt(n,e){W1.has(n)&&(W1.get(n).delete(e),W1.get(n).size||(mBe.unobserve(n),W1.delete(n)))}var zAt=function(n){I_(t,n);var e=pk(t);function t(){return Ua(this,t),e.apply(this,arguments)}return qa(t,[{key:"render",value:function(){return this.props.children}}]),t}(w.Component);function jAt(n,e){var t=n.children,i=n.disabled,r=w.useRef(null),o=w.useRef(null),s=w.useContext($ne),a=typeof t=="function",l=a?t(r):t,c=w.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),u=!a&&w.isValidElement(l)&&O3(l),d=u?l.ref:null,h=qfe(d,r),g=function(){var v;return u8(r.current)||(r.current&&Er(r.current)==="object"?u8((v=r.current)===null||v===void 0?void 0:v.nativeElement):null)||u8(o.current)};w.useImperativeHandle(e,function(){return g()});var p=w.useRef(n);p.current=n;var m=w.useCallback(function(_){var v=p.current,b=v.onResize,y=v.data,C=_.getBoundingClientRect(),x=C.width,k=C.height,I=_.offsetWidth,L=_.offsetHeight,D=Math.floor(x),R=Math.floor(k);if(c.current.width!==D||c.current.height!==R||c.current.offsetWidth!==I||c.current.offsetHeight!==L){var P={width:D,height:R,offsetWidth:I,offsetHeight:L};c.current=P;var M=I===Math.round(x)?x:I,O=L===Math.round(k)?k:L,B=Qe(Qe({},P),{},{offsetWidth:M,offsetHeight:O});s==null||s(B,_,y),b&&Promise.resolve().then(function(){b(B,_)})}},[]);return w.useEffect(function(){var _=g();return _&&!i&&HAt(_,m),function(){return WAt(_,m)}},[r.current,i]),w.createElement(zAt,{ref:o},u?w.cloneElement(l,{ref:h}):l)}var UAt=w.forwardRef(jAt),qAt="rc-observer-key";function KAt(n,e){var t=n.children,i=typeof t=="function"?[t]:E7(t);return i.map(function(r,o){var s=(r==null?void 0:r.key)||"".concat(qAt,"-").concat(o);return w.createElement(UAt,rt({},n,{key:s,ref:o===0?e:void 0}),r)})}var Kfe=w.forwardRef(KAt);Kfe.Collection=CAt;function GAt(n,e){var t=Qe({},n);return Array.isArray(e)&&e.forEach(function(i){delete t[i]}),t}var _Be=function(e){return+setTimeout(e,16)},vBe=function(e){return clearTimeout(e)};typeof window<"u"&&"requestAnimationFrame"in window&&(_Be=function(e){return window.requestAnimationFrame(e)},vBe=function(e){return window.cancelAnimationFrame(e)});var kEe=0,Gfe=new Map;function bBe(n){Gfe.delete(n)}var af=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;kEe+=1;var i=kEe;function r(o){if(o===0)bBe(i),e();else{var s=_Be(function(){r(o-1)});Gfe.set(i,s)}}return r(t),i};af.cancel=function(n){var e=Gfe.get(n);return bBe(e),vBe(e)};function Yfe(n){for(var e=0,t,i=0,r=n.length;r>=4;++i,r-=4)t=n.charCodeAt(i)&255|(n.charCodeAt(++i)&255)<<8|(n.charCodeAt(++i)&255)<<16|(n.charCodeAt(++i)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(r){case 3:e^=(n.charCodeAt(i+2)&255)<<16;case 2:e^=(n.charCodeAt(i+1)&255)<<8;case 1:e^=n.charCodeAt(i)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}function I7(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=new Set;function r(o,s){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,l=i.has(o);if(Uu(!l,"Warning: There may be circular references"),l)return!1;if(o===s)return!0;if(t&&a>1)return!1;i.add(o);var c=a+1;if(Array.isArray(o)){if(!Array.isArray(s)||o.length!==s.length)return!1;for(var u=0;u<o.length;u++)if(!r(o[u],s[u],c))return!1;return!0}if(o&&s&&Er(o)==="object"&&Er(s)==="object"){var d=Object.keys(o);return d.length!==Object.keys(s).length?!1:d.every(function(h){return r(o[h],s[h],c)})}return!1}return r(n,e)}var TEe="%",YAt=function(){function n(e){Ua(this,n),$e(this,"instanceId",void 0),$e(this,"cache",new Map),this.instanceId=e}return qa(n,[{key:"get",value:function(t){return this.cache.get(t.join(TEe))||null}},{key:"update",value:function(t,i){var r=t.join(TEe),o=this.cache.get(r),s=i(o);s===null?this.cache.delete(r):this.cache.set(r,s)}}]),n}(),Hne="data-token-hash",jE="data-css-hash",wI="__cssinjs_instance__";function QAt(){var n=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){var e=document.body.querySelectorAll("style[".concat(jE,"]"))||[],t=document.head.firstChild;Array.from(e).forEach(function(r){r[wI]=r[wI]||n,r[wI]===n&&document.head.insertBefore(r,t)});var i={};Array.from(document.querySelectorAll("style[".concat(jE,"]"))).forEach(function(r){var o=r.getAttribute(jE);if(i[o]){if(r[wI]===n){var s;(s=r.parentNode)===null||s===void 0||s.removeChild(r)}}else i[o]=!0})}return new YAt(n)}var Qfe=w.createContext({hashPriority:"low",cache:QAt(),defaultCache:!0});function lf(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function XAt(n,e){if(!n)return!1;if(n.contains)return n.contains(e);for(var t=e;t;){if(t===n)return!0;t=t.parentNode}return!1}var IEe="data-rc-order",LEe="data-rc-priority",ZAt="rc-util-key",Wne=new Map;function yBe(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=n.mark;return e?e.startsWith("data-")?e:"data-".concat(e):ZAt}function vj(n){if(n.attachTo)return n.attachTo;var e=document.querySelector("head");return e||document.body}function JAt(n){return n==="queue"?"prependQueue":n?"prepend":"append"}function CBe(n){return Array.from((Wne.get(n)||n).children).filter(function(e){return e.tagName==="STYLE"})}function wBe(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!lf())return null;var t=e.csp,i=e.prepend,r=e.priority,o=r===void 0?0:r,s=JAt(i),a=s==="prependQueue",l=document.createElement("style");l.setAttribute(IEe,s),a&&o&&l.setAttribute(LEe,"".concat(o)),t!=null&&t.nonce&&(l.nonce=t==null?void 0:t.nonce),l.innerHTML=n;var c=vj(e),u=c.firstChild;if(i){if(a){var d=CBe(c).filter(function(h){if(!["prepend","prependQueue"].includes(h.getAttribute(IEe)))return!1;var g=Number(h.getAttribute(LEe)||0);return o>=g});if(d.length)return c.insertBefore(l,d[d.length-1].nextSibling),l}c.insertBefore(l,u)}else c.appendChild(l);return l}function SBe(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=vj(e);return CBe(t).find(function(i){return i.getAttribute(yBe(e))===n})}function L7(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=SBe(n,e);if(t){var i=vj(e);i.removeChild(t)}}function eRt(n,e){var t=Wne.get(n);if(!t||!XAt(document,t)){var i=wBe("",e),r=i.parentNode;Wne.set(n,r),n.removeChild(i)}}function ED(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=vj(t);eRt(i,t);var r=SBe(e,t);if(r){var o,s;if((o=t.csp)!==null&&o!==void 0&&o.nonce&&r.nonce!==((s=t.csp)===null||s===void 0?void 0:s.nonce)){var a;r.nonce=(a=t.csp)===null||a===void 0?void 0:a.nonce}return r.innerHTML!==n&&(r.innerHTML=n),r}var l=wBe(n,t);return l.setAttribute(yBe(t),e),l}function tRt(n,e){if(n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}var Xfe=function(){function n(){Ua(this,n),$e(this,"cache",void 0),$e(this,"keys",void 0),$e(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return qa(n,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(t){var i,r,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s={map:this.cache};return t.forEach(function(a){if(!s)s=void 0;else{var l,c;s=(l=s)===null||l===void 0||(c=l.map)===null||c===void 0?void 0:c.get(a)}}),(i=s)!==null&&i!==void 0&&i.value&&o&&(s.value[1]=this.cacheCallTimes++),(r=s)===null||r===void 0?void 0:r.value}},{key:"get",value:function(t){var i;return(i=this.internalGet(t,!0))===null||i===void 0?void 0:i[0]}},{key:"has",value:function(t){return!!this.internalGet(t)}},{key:"set",value:function(t,i){var r=this;if(!this.has(t)){if(this.size()+1>n.MAX_CACHE_SIZE+n.MAX_CACHE_OFFSET){var o=this.keys.reduce(function(c,u){var d=$t(c,2),h=d[1];return r.internalGet(u)[1]<h?[u,r.internalGet(u)[1]]:c},[this.keys[0],this.cacheCallTimes]),s=$t(o,1),a=s[0];this.delete(a)}this.keys.push(t)}var l=this.cache;t.forEach(function(c,u){if(u===t.length-1)l.set(c,{value:[i,r.cacheCallTimes++]});else{var d=l.get(c);d?d.map||(d.map=new Map):l.set(c,{map:new Map}),l=l.get(c).map}})}},{key:"deleteByPath",value:function(t,i){var r=t.get(i[0]);if(i.length===1){var o;return r.map?t.set(i[0],{map:r.map}):t.delete(i[0]),(o=r.value)===null||o===void 0?void 0:o[0]}var s=this.deleteByPath(r.map,i.slice(1));return(!r.map||r.map.size===0)&&!r.value&&t.delete(i[0]),s}},{key:"delete",value:function(t){if(this.has(t))return this.keys=this.keys.filter(function(i){return!tRt(i,t)}),this.deleteByPath(this.cache,t)}}]),n}();$e(Xfe,"MAX_CACHE_SIZE",20);$e(Xfe,"MAX_CACHE_OFFSET",5);var DEe=0,EBe=function(){function n(e){Ua(this,n),$e(this,"derivatives",void 0),$e(this,"id",void 0),this.derivatives=Array.isArray(e)?e:[e],this.id=DEe,e.length===0&&(e.length>0,void 0),DEe+=1}return qa(n,[{key:"getDerivativeToken",value:function(t){return this.derivatives.reduce(function(i,r){return r(t,i)},void 0)}}]),n}(),AQ=new Xfe;function zne(n){var e=Array.isArray(n)?n:[n];return AQ.has(e)||AQ.set(e,new EBe(e)),AQ.get(e)}var nRt=new WeakMap,RQ={};function iRt(n,e){for(var t=nRt,i=0;i<e.length;i+=1){var r=e[i];t.has(r)||t.set(r,new WeakMap),t=t.get(r)}return t.has(RQ)||t.set(RQ,n()),t.get(RQ)}var AEe=new WeakMap;function D7(n){var e=AEe.get(n)||"";return e||(Object.keys(n).forEach(function(t){var i=n[t];e+=t,i instanceof EBe?e+=i.id:i&&Er(i)==="object"?e+=D7(i):e+=i}),AEe.set(n,e)),e}function rRt(n,e){return Yfe("".concat(e,"_").concat(D7(n)))}var uO="random-".concat(Date.now(),"-").concat(Math.random()).replace(/\./g,""),xBe="_bAmBoO_";function oRt(n,e,t){if(lf()){var i,r;ED(n,uO);var o=document.createElement("div");o.style.position="fixed",o.style.left="0",o.style.top="0",e==null||e(o),document.body.appendChild(o);var s=t?t(o):(i=getComputedStyle(o).content)===null||i===void 0?void 0:i.includes(xBe);return(r=o.parentNode)===null||r===void 0||r.removeChild(o),L7(uO),s}return!1}var NQ=void 0;function sRt(){return NQ===void 0&&(NQ=oRt("@layer ".concat(uO," { .").concat(uO,' { content: "').concat(xBe,'"!important; } }'),function(n){n.className=uO})),NQ}var REe=lf()?w.useLayoutEffect:w.useEffect,wd=function(e,t){var i=w.useRef(!0);REe(function(){return e(i.current)},t),REe(function(){return i.current=!1,function(){i.current=!0}},[])},NEe=function(e,t){wd(function(i){if(!i)return e()},t)},aRt=Qe({},Rp),OEe=aRt.useInsertionEffect,lRt=function(e,t,i){w.useMemo(e,i),wd(function(){return t(!0)},i)},cRt=OEe?function(n,e,t){return OEe(function(){return n(),e()},t)}:lRt,uRt=Qe({},Rp),dRt=uRt.useInsertionEffect,hRt=function(e){var t=[],i=!1;function r(o){i||t.push(o)}return w.useEffect(function(){return i=!1,function(){i=!0,t.length&&t.forEach(function(o){return o()})}},e),r},fRt=function(){return function(e){e()}},gRt=typeof dRt<"u"?hRt:fRt;function kBe(n,e,t,i,r){var o=w.useContext(Qfe),s=o.cache,a=[n].concat(Ir(e)),l=a.join("_"),c=gRt([l]),u=function(p){s.update(a,function(m){var _=m||[],v=$t(_,2),b=v[0],y=b===void 0?0:b,C=v[1],x=C,k=x||t(),I=[y,k];return p?p(I):I})};w.useMemo(function(){u()},[l]);var d=s.get(a),h=d[1];return cRt(function(){r==null||r(h)},function(g){return u(function(p){var m=$t(p,2),_=m[0],v=m[1];return g&&_===0&&(r==null||r(h)),[_+1,v]}),function(){s.update(a,function(p){var m=p||[],_=$t(m,2),v=_[0],b=v===void 0?0:v,y=_[1],C=b-1;return C===0?(c(function(){return i==null?void 0:i(y,!1)}),null):[b-1,y]})}},[l]),h}var pRt={},mRt="css",eE=new Map;function _Rt(n){eE.set(n,(eE.get(n)||0)+1)}function vRt(n,e){if(typeof document<"u"){var t=document.querySelectorAll("style[".concat(Hne,'="').concat(n,'"]'));t.forEach(function(i){if(i[wI]===e){var r;(r=i.parentNode)===null||r===void 0||r.removeChild(i)}})}}var bRt=0;function yRt(n,e){eE.set(n,(eE.get(n)||0)-1);var t=Array.from(eE.keys()),i=t.filter(function(r){var o=eE.get(r)||0;return o<=0});t.length-i.length>bRt&&i.forEach(function(r){vRt(r,e),eE.delete(r)})}var CRt=function(e,t,i,r){var o=i.getDerivativeToken(e),s=Qe(Qe({},o),t);return r&&(s=r(s)),s};function wRt(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=w.useContext(Qfe),r=i.cache.instanceId,o=t.salt,s=o===void 0?"":o,a=t.override,l=a===void 0?pRt:a,c=t.formatToken,u=t.getComputedToken,d=iRt(function(){return Object.assign.apply(Object,[{}].concat(Ir(e)))},e),h=D7(d),g=D7(l),p=kBe("token",[s,n.id,h,g],function(){var m=u?u(d,l,n):CRt(d,l,n,c),_=rRt(m,s);m._tokenKey=_,_Rt(_);var v="".concat(mRt,"-").concat(Yfe(_));return m._hashId=v,[m,v]},function(m){yRt(m[0]._tokenKey,r)});return p}var SRt={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},PEe="data-ant-cssinjs-cache-path",TBe="_FILE_STYLE__",UE,IBe=!0;function ERt(){if(!UE&&(UE={},lf())){var n=document.createElement("div");n.className=PEe,n.style.position="fixed",n.style.visibility="hidden",n.style.top="-9999px",document.body.appendChild(n);var e=getComputedStyle(n).content||"";e=e.replace(/^"/,"").replace(/"$/,""),e.split(";").forEach(function(r){var o=r.split(":"),s=$t(o,2),a=s[0],l=s[1];UE[a]=l});var t=document.querySelector("style[".concat(PEe,"]"));if(t){var i;IBe=!1,(i=t.parentNode)===null||i===void 0||i.removeChild(t)}document.body.removeChild(n)}}function xRt(n){return ERt(),!!UE[n]}function kRt(n){var e=UE[n],t=null;if(e&&lf())if(IBe)t=TBe;else{var i=document.querySelector("style[".concat(jE,'="').concat(UE[n],'"]'));i?t=i.innerHTML:delete UE[n]}return[t,e]}var MEe=lf(),TRt="_skip_check_",LBe="_multi_value_";function FEe(n){var e=WE(H5e(n),W5e);return e.replace(/\{%%%\:[^;];}/g,";")}function IRt(n){return Er(n)==="object"&&n&&(TRt in n||LBe in n)}function LRt(n,e,t){if(!e)return n;var i=".".concat(e),r=t==="low"?":where(".concat(i,")"):i,o=n.split(",").map(function(s){var a,l=s.trim().split(/\s+/),c=l[0]||"",u=((a=c.match(/^\w+/))===null||a===void 0?void 0:a[0])||"";return c="".concat(u).concat(r).concat(c.slice(u.length)),[c].concat(Ir(l.slice(1))).join(" ")});return o.join(",")}var DRt=function n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{root:!0,parentSelectors:[]},r=i.root,o=i.injectHash,s=i.parentSelectors,a=t.hashId,l=t.layer;t.path;var c=t.hashPriority,u=t.transformers,d=u===void 0?[]:u;t.linters;var h="",g={};function p(y){var C=y.getName(a);if(!g[C]){var x=n(y.style,t,{root:!1,parentSelectors:s}),k=$t(x,1),I=k[0];g[C]="@keyframes ".concat(y.getName(a)).concat(I)}}function m(y){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return y.forEach(function(x){Array.isArray(x)?m(x,C):x&&C.push(x)}),C}var _=m(Array.isArray(e)?e:[e]);if(_.forEach(function(y){var C=typeof y=="string"&&!r?{}:y;if(typeof C=="string")h+="".concat(C,`
`);else if(C._keyframe)p(C);else{var x=d.reduce(function(k,I){var L;return(I==null||(L=I.visit)===null||L===void 0?void 0:L.call(I,k))||k},C);Object.keys(x).forEach(function(k){var I=x[k];if(Er(I)==="object"&&I&&(k!=="animationName"||!I._keyframe)&&!IRt(I)){var L=!1,D=k.trim(),R=!1;(r||o)&&a?D.startsWith("@")?L=!0:D=LRt(k,a,c):r&&!a&&(D==="&"||D==="")&&(D="",R=!0);var P=n(I,t,{root:R,injectHash:L,parentSelectors:[].concat(Ir(s),[D])}),M=$t(P,2),O=M[0],B=M[1];g=Qe(Qe({},g),B),h+="".concat(D).concat(O)}else{let V=function($,j){var Y=$.replace(/[A-Z]/g,function(se){return"-".concat(se.toLowerCase())}),ne=j;!SRt[$]&&typeof ne=="number"&&ne!==0&&(ne="".concat(ne,"px")),$==="animationName"&&j!==null&&j!==void 0&&j._keyframe&&(p(j),ne=j.getName(a)),h+="".concat(Y,":").concat(ne,";")};var F,H=(F=I==null?void 0:I.value)!==null&&F!==void 0?F:I;Er(I)==="object"&&I!==null&&I!==void 0&&I[LBe]&&Array.isArray(H)?H.forEach(function($){V(k,$)}):V(k,H)}})}}),!r)h="{".concat(h,"}");else if(l&&sRt()){var v=l.split(","),b=v[v.length-1].trim();h="@layer ".concat(b," {").concat(h,"}"),v.length>1&&(h="@layer ".concat(l,"{%%%:%}").concat(h))}return[h,g]};function ARt(n,e){return Yfe("".concat(n.join("%")).concat(e))}function RRt(){return null}function jne(n,e){var t=n.token,i=n.path,r=n.hashId,o=n.layer,s=n.nonce,a=n.clientOnly,l=n.order,c=l===void 0?0:l,u=w.useContext(Qfe),d=u.autoClear;u.mock;var h=u.defaultCache,g=u.hashPriority,p=u.container,m=u.ssrInline,_=u.transformers,v=u.linters,b=u.cache,y=t._tokenKey,C=[y].concat(Ir(i)),x=MEe,k=kBe("style",C,function(){var P=C.join("|");if(xRt(P)){var M=kRt(P),O=$t(M,2),B=O[0],F=O[1];if(B)return[B,y,F,{},a,c]}var H=e(),V=DRt(H,{hashId:r,hashPriority:g,layer:o,path:i.join("-"),transformers:_,linters:v}),$=$t(V,2),j=$[0],Y=$[1],ne=FEe(j),se=ARt(C,ne);return[ne,y,se,Y,a,c]},function(P,M){var O=$t(P,3),B=O[2];(M||d)&&MEe&&L7(B,{mark:jE})},function(P){var M=$t(P,4),O=M[0];M[1];var B=M[2],F=M[3];if(x&&O!==TBe){var H={mark:jE,prepend:"queue",attachTo:p,priority:c},V=typeof s=="function"?s():s;V&&(H.csp={nonce:V});var $=ED(O,B,H);$[wI]=b.instanceId,$.setAttribute(Hne,y),Object.keys(F).forEach(function(j){ED(FEe(F[j]),"_effect-".concat(j),H)})}}),I=$t(k,3),L=I[0],D=I[1],R=I[2];return function(P){var M;if(!m||x||!h)M=w.createElement(RRt,null);else{var O;M=w.createElement("style",rt({},(O={},$e(O,Hne,D),$e(O,jE,R),O),{dangerouslySetInnerHTML:{__html:L}}))}return w.createElement(w.Fragment,null,M,P)}}var Od=function(){function n(e,t){Ua(this,n),$e(this,"name",void 0),$e(this,"style",void 0),$e(this,"_keyframe",!0),this.name=e,this.style=t}return qa(n,[{key:"getName",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return t?"".concat(t,"-").concat(this.name):this.name}}]),n}();function yT(n){return n.notSplit=!0,n}yT(["borderTop","borderBottom"]),yT(["borderTop"]),yT(["borderBottom"]),yT(["borderLeft","borderRight"]),yT(["borderLeft"]),yT(["borderRight"]);var NRt=w.createContext({});const Zfe=NRt;function t_(n,e){for(var t=n,i=0;i<e.length;i+=1){if(t==null)return;t=t[e[i]]}return t}function DBe(n,e,t,i){if(!e.length)return t;var r=QMe(e),o=r[0],s=r.slice(1),a;return!n&&typeof o=="number"?a=[]:Array.isArray(n)?a=Ir(n):a=Qe({},n),i&&t===void 0&&s.length===1?delete a[o][s[0]]:a[o]=DBe(a[o],s,t,i),a}function Nm(n,e,t){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return e.length&&i&&t===void 0&&!t_(n,e.slice(0,-1))?n:DBe(n,e,t,i)}function ORt(n){return Er(n)==="object"&&n!==null&&Object.getPrototypeOf(n)===Object.prototype}function BEe(n){return Array.isArray(n)?[]:{}}var PRt=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function SI(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];var i=BEe(e[0]);return e.forEach(function(r){function o(s,a){var l=new Set(a),c=t_(r,s),u=Array.isArray(c);if(u||ORt(c)){if(!l.has(c)){l.add(c);var d=t_(i,s);u?i=Nm(i,s,[]):(!d||Er(d)!=="object")&&(i=Nm(i,s,BEe(c))),PRt(c).forEach(function(h){o([].concat(Ir(s),[h]),l)})}}else i=Nm(i,s,c)}o([])}),i}const MRt=w.createContext({}),FRt=w.createContext(void 0),BRt={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"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",page_size:"Page Size"};var $Rt={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"};const VRt={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},ABe=VRt,HRt={lang:Object.assign({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"]},$Rt),timePickerLocale:Object.assign({},ABe)},A7=HRt,Rf="${label} is not a valid ${type}",WRt={locale:"en",Pagination:BRt,DatePicker:A7,TimePicker:ABe,Calendar:A7,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"},Tour:{Next:"Next",Previous:"Previous",Finish:"Finish"},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:Rf,method:Rf,array:Rf,object:Rf,number:Rf,date:Rf,boolean:Rf,integer:Rf,float:Rf,regexp:Rf,email:Rf,url:Rf,hex:Rf},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"},QRCode:{expired:"QR code expired",refresh:"Refresh"},ColorPicker:{presetEmpty:"Empty"}},xD=WRt;Object.assign({},xD.Modal);let d8=[];const $Ee=()=>d8.reduce((n,e)=>Object.assign(Object.assign({},n),e),xD.Modal);function zRt(n){if(n){const e=Object.assign({},n);return d8.push(e),$Ee(),()=>{d8=d8.filter(t=>t!==e),$Ee()}}Object.assign({},xD.Modal)}const jRt=w.createContext(void 0),Jfe=jRt,URt=(n,e)=>{const t=w.useContext(Jfe),i=w.useMemo(()=>{var o;const s=e||xD[n],a=(o=t==null?void 0:t[n])!==null&&o!==void 0?o:{};return Object.assign(Object.assign({},typeof s=="function"?s():s),a||{})},[n,e,t]),r=w.useMemo(()=>{const o=t==null?void 0:t.locale;return t!=null&&t.exist&&!o?xD.locale:o},[t]);return[i,r]},RBe=URt,qRt="internalMark",KRt=n=>{const{locale:e={},children:t,_ANT_MARK__:i}=n;w.useEffect(()=>zRt(e&&e.Modal),[e]);const r=w.useMemo(()=>Object.assign(Object.assign({},e),{exist:!0}),[e]);return w.createElement(Jfe.Provider,{value:r},t)},GRt=KRt;function qu(n,e){YRt(n)&&(n="100%");var t=QRt(n);return n=e===360?n:Math.min(e,Math.max(0,parseFloat(n))),t&&(n=parseInt(String(n*e),10)/100),Math.abs(n-e)<1e-6?1:(e===360?n=(n<0?n%e+e:n%e)/parseFloat(String(e)):n=n%e/parseFloat(String(e)),n)}function S6(n){return Math.min(1,Math.max(0,n))}function YRt(n){return typeof n=="string"&&n.indexOf(".")!==-1&&parseFloat(n)===1}function QRt(n){return typeof n=="string"&&n.indexOf("%")!==-1}function NBe(n){return n=parseFloat(n),(isNaN(n)||n<0||n>1)&&(n=1),n}function E6(n){return n<=1?"".concat(Number(n)*100,"%"):n}function CE(n){return n.length===1?"0"+n:String(n)}function XRt(n,e,t){return{r:qu(n,255)*255,g:qu(e,255)*255,b:qu(t,255)*255}}function VEe(n,e,t){n=qu(n,255),e=qu(e,255),t=qu(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),o=0,s=0,a=(i+r)/2;if(i===r)s=0,o=0;else{var l=i-r;switch(s=a>.5?l/(2-i-r):l/(i+r),i){case n:o=(e-t)/l+(e<t?6:0);break;case e:o=(t-n)/l+2;break;case t:o=(n-e)/l+4;break}o/=6}return{h:o,s,l:a}}function OQ(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*(6*t):t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function ZRt(n,e,t){var i,r,o;if(n=qu(n,360),e=qu(e,100),t=qu(t,100),e===0)r=t,o=t,i=t;else{var s=t<.5?t*(1+e):t+e-t*e,a=2*t-s;i=OQ(a,s,n+1/3),r=OQ(a,s,n),o=OQ(a,s,n-1/3)}return{r:i*255,g:r*255,b:o*255}}function Une(n,e,t){n=qu(n,255),e=qu(e,255),t=qu(t,255);var i=Math.max(n,e,t),r=Math.min(n,e,t),o=0,s=i,a=i-r,l=i===0?0:a/i;if(i===r)o=0;else{switch(i){case n:o=(e-t)/a+(e<t?6:0);break;case e:o=(t-n)/a+2;break;case t:o=(n-e)/a+4;break}o/=6}return{h:o,s:l,v:s}}function JRt(n,e,t){n=qu(n,360)*6,e=qu(e,100),t=qu(t,100);var i=Math.floor(n),r=n-i,o=t*(1-e),s=t*(1-r*e),a=t*(1-(1-r)*e),l=i%6,c=[t,s,o,o,a,t][l],u=[a,t,t,s,o,o][l],d=[o,o,a,t,t,s][l];return{r:c*255,g:u*255,b:d*255}}function qne(n,e,t,i){var r=[CE(Math.round(n).toString(16)),CE(Math.round(e).toString(16)),CE(Math.round(t).toString(16))];return i&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function eNt(n,e,t,i,r){var o=[CE(Math.round(n).toString(16)),CE(Math.round(e).toString(16)),CE(Math.round(t).toString(16)),CE(tNt(i))];return r&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function tNt(n){return Math.round(parseFloat(n)*255).toString(16)}function HEe(n){return Ff(n)/255}function Ff(n){return parseInt(n,16)}function nNt(n){return{r:n>>16,g:(n&65280)>>8,b:n&255}}var Kne={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 ZT(n){var e={r:0,g:0,b:0},t=1,i=null,r=null,o=null,s=!1,a=!1;return typeof n=="string"&&(n=oNt(n)),typeof n=="object"&&(jb(n.r)&&jb(n.g)&&jb(n.b)?(e=XRt(n.r,n.g,n.b),s=!0,a=String(n.r).substr(-1)==="%"?"prgb":"rgb"):jb(n.h)&&jb(n.s)&&jb(n.v)?(i=E6(n.s),r=E6(n.v),e=JRt(n.h,i,r),s=!0,a="hsv"):jb(n.h)&&jb(n.s)&&jb(n.l)&&(i=E6(n.s),o=E6(n.l),e=ZRt(n.h,i,o),s=!0,a="hsl"),Object.prototype.hasOwnProperty.call(n,"a")&&(t=n.a)),t=NBe(t),{ok:s,format:n.format||a,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var iNt="[-\\+]?\\d+%?",rNt="[-\\+]?\\d*\\.\\d+%?",z1="(?:".concat(rNt,")|(?:").concat(iNt,")"),PQ="[\\s|\\(]+(".concat(z1,")[,|\\s]+(").concat(z1,")[,|\\s]+(").concat(z1,")\\s*\\)?"),MQ="[\\s|\\(]+(".concat(z1,")[,|\\s]+(").concat(z1,")[,|\\s]+(").concat(z1,")[,|\\s]+(").concat(z1,")\\s*\\)?"),Cm={CSS_UNIT:new RegExp(z1),rgb:new RegExp("rgb"+PQ),rgba:new RegExp("rgba"+MQ),hsl:new RegExp("hsl"+PQ),hsla:new RegExp("hsla"+MQ),hsv:new RegExp("hsv"+PQ),hsva:new RegExp("hsva"+MQ),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 oNt(n){if(n=n.trim().toLowerCase(),n.length===0)return!1;var e=!1;if(Kne[n])n=Kne[n],e=!0;else if(n==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Cm.rgb.exec(n);return t?{r:t[1],g:t[2],b:t[3]}:(t=Cm.rgba.exec(n),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Cm.hsl.exec(n),t?{h:t[1],s:t[2],l:t[3]}:(t=Cm.hsla.exec(n),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Cm.hsv.exec(n),t?{h:t[1],s:t[2],v:t[3]}:(t=Cm.hsva.exec(n),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Cm.hex8.exec(n),t?{r:Ff(t[1]),g:Ff(t[2]),b:Ff(t[3]),a:HEe(t[4]),format:e?"name":"hex8"}:(t=Cm.hex6.exec(n),t?{r:Ff(t[1]),g:Ff(t[2]),b:Ff(t[3]),format:e?"name":"hex"}:(t=Cm.hex4.exec(n),t?{r:Ff(t[1]+t[1]),g:Ff(t[2]+t[2]),b:Ff(t[3]+t[3]),a:HEe(t[4]+t[4]),format:e?"name":"hex8"}:(t=Cm.hex3.exec(n),t?{r:Ff(t[1]+t[1]),g:Ff(t[2]+t[2]),b:Ff(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function jb(n){return!!Cm.CSS_UNIT.exec(String(n))}var Mu=function(){function n(e,t){e===void 0&&(e=""),t===void 0&&(t={});var i;if(e instanceof n)return e;typeof e=="number"&&(e=nNt(e)),this.originalInput=e;var r=ZT(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(i=t.format)!==null&&i!==void 0?i:r.format,this.gradientType=t.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=r.ok}return n.prototype.isDark=function(){return this.getBrightness()<128},n.prototype.isLight=function(){return!this.isDark()},n.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},n.prototype.getLuminance=function(){var e=this.toRgb(),t,i,r,o=e.r/255,s=e.g/255,a=e.b/255;return o<=.03928?t=o/12.92:t=Math.pow((o+.055)/1.055,2.4),s<=.03928?i=s/12.92:i=Math.pow((s+.055)/1.055,2.4),a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),.2126*t+.7152*i+.0722*r},n.prototype.getAlpha=function(){return this.a},n.prototype.setAlpha=function(e){return this.a=NBe(e),this.roundA=Math.round(100*this.a)/100,this},n.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},n.prototype.toHsv=function(){var e=Une(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},n.prototype.toHsvString=function(){var e=Une(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHsl=function(){var e=VEe(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},n.prototype.toHslString=function(){var e=VEe(this.r,this.g,this.b),t=Math.round(e.h*360),i=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(i,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(i,"%, ").concat(r,"%, ").concat(this.roundA,")")},n.prototype.toHex=function(e){return e===void 0&&(e=!1),qne(this.r,this.g,this.b,e)},n.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},n.prototype.toHex8=function(e){return e===void 0&&(e=!1),eNt(this.r,this.g,this.b,this.a,e)},n.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},n.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},n.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},n.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),i=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(i,")"):"rgba(".concat(e,", ").concat(t,", ").concat(i,", ").concat(this.roundA,")")},n.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(qu(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},n.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(qu(t,255)*100)};return this.a===1?"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,")")},n.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+qne(this.r,this.g,this.b,!1),t=0,i=Object.entries(Kne);t<i.length;t++){var r=i[t],o=r[0],s=r[1];if(e===s)return o}return!1},n.prototype.toString=function(e){var t=!!e;e=e??this.format;var i=!1,r=this.a<1&&this.a>=0,o=!t&&r&&(e.startsWith("hex")||e==="name");return o?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(i=this.toRgbString()),e==="prgb"&&(i=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(i=this.toHexString()),e==="hex3"&&(i=this.toHexString(!0)),e==="hex4"&&(i=this.toHex8String(!0)),e==="hex8"&&(i=this.toHex8String()),e==="name"&&(i=this.toName()),e==="hsl"&&(i=this.toHslString()),e==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},n.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},n.prototype.clone=function(){return new n(this.toString())},n.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=S6(t.l),new n(t)},n.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new n(t)},n.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=S6(t.l),new n(t)},n.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},n.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},n.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=S6(t.s),new n(t)},n.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=S6(t.s),new n(t)},n.prototype.greyscale=function(){return this.desaturate(100)},n.prototype.spin=function(e){var t=this.toHsl(),i=(t.h+e)%360;return t.h=i<0?360+i:i,new n(t)},n.prototype.mix=function(e,t){t===void 0&&(t=50);var i=this.toRgb(),r=new n(e).toRgb(),o=t/100,s={r:(r.r-i.r)*o+i.r,g:(r.g-i.g)*o+i.g,b:(r.b-i.b)*o+i.b,a:(r.a-i.a)*o+i.a};return new n(s)},n.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var i=this.toHsl(),r=360/t,o=[this];for(i.h=(i.h-(r*e>>1)+720)%360;--e;)i.h=(i.h+r)%360,o.push(new n(i));return o},n.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new n(e)},n.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),i=t.h,r=t.s,o=t.v,s=[],a=1/e;e--;)s.push(new n({h:i,s:r,v:o})),o=(o+a)%1;return s},n.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new n({h:(t+72)%360,s:e.s,l:e.l}),new n({h:(t+216)%360,s:e.s,l:e.l})]},n.prototype.onBackground=function(e){var t=this.toRgb(),i=new n(e).toRgb(),r=t.a+i.a*(1-t.a);return new n({r:(t.r*t.a+i.r*i.a*(1-t.a))/r,g:(t.g*t.a+i.g*i.a*(1-t.a))/r,b:(t.b*t.a+i.b*i.a*(1-t.a))/r,a:r})},n.prototype.triad=function(){return this.polyad(3)},n.prototype.tetrad=function(){return this.polyad(4)},n.prototype.polyad=function(e){for(var t=this.toHsl(),i=t.h,r=[this],o=360/e,s=1;s<e;s++)r.push(new n({h:(i+s*o)%360,s:t.s,l:t.l}));return r},n.prototype.equals=function(e){return this.toRgbString()===new n(e).toRgbString()},n}(),x6=2,WEe=.16,sNt=.05,aNt=.05,lNt=.15,OBe=5,PBe=4,cNt=[{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 zEe(n){var e=n.r,t=n.g,i=n.b,r=Une(e,t,i);return{h:r.h*360,s:r.s,v:r.v}}function k6(n){var e=n.r,t=n.g,i=n.b;return"#".concat(qne(e,t,i,!1))}function uNt(n,e,t){var i=t/100,r={r:(e.r-n.r)*i+n.r,g:(e.g-n.g)*i+n.g,b:(e.b-n.b)*i+n.b};return r}function jEe(n,e,t){var i;return Math.round(n.h)>=60&&Math.round(n.h)<=240?i=t?Math.round(n.h)-x6*e:Math.round(n.h)+x6*e:i=t?Math.round(n.h)+x6*e:Math.round(n.h)-x6*e,i<0?i+=360:i>=360&&(i-=360),i}function UEe(n,e,t){if(n.h===0&&n.s===0)return n.s;var i;return t?i=n.s-WEe*e:e===PBe?i=n.s+WEe:i=n.s+sNt*e,i>1&&(i=1),t&&e===OBe&&i>.1&&(i=.1),i<.06&&(i=.06),Number(i.toFixed(2))}function qEe(n,e,t){var i;return t?i=n.v+aNt*e:i=n.v-lNt*e,i>1&&(i=1),Number(i.toFixed(2))}function vx(n){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],i=ZT(n),r=OBe;r>0;r-=1){var o=zEe(i),s=k6(ZT({h:jEe(o,r,!0),s:UEe(o,r,!0),v:qEe(o,r,!0)}));t.push(s)}t.push(k6(i));for(var a=1;a<=PBe;a+=1){var l=zEe(i),c=k6(ZT({h:jEe(l,a),s:UEe(l,a),v:qEe(l,a)}));t.push(c)}return e.theme==="dark"?cNt.map(function(u){var d=u.index,h=u.opacity,g=k6(uNt(ZT(e.backgroundColor||"#141414"),ZT(t[d]),h*100));return g}):t}var FQ={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},h8={},BQ={};Object.keys(FQ).forEach(function(n){h8[n]=vx(FQ[n]),h8[n].primary=h8[n][5],BQ[n]=vx(FQ[n],{theme:"dark",backgroundColor:"#141414"}),BQ[n].primary=BQ[n][5]});var dNt=h8.blue;const hNt=n=>{const{controlHeight:e}=n;return{controlHeightSM:e*.75,controlHeightXS:e*.5,controlHeightLG:e*1.25}},fNt=hNt;function gNt(n){const{sizeUnit:e,sizeStep:t}=n;return{sizeXXL:e*(t+8),sizeXL:e*(t+4),sizeLG:e*(t+2),sizeMD:e*(t+1),sizeMS:e*t,size:e*t,sizeSM:e*(t-1),sizeXS:e*(t-2),sizeXXS:e*(t-3)}}const MBe={blue:"#1677ff",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#eb2f96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},pNt=Object.assign(Object.assign({},MBe),{colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0}),jP=pNt;function mNt(n,e){let{generateColorPalettes:t,generateNeutralColorPalettes:i}=e;const{colorSuccess:r,colorWarning:o,colorError:s,colorInfo:a,colorPrimary:l,colorBgBase:c,colorTextBase:u}=n,d=t(l),h=t(r),g=t(o),p=t(s),m=t(a),_=i(c,u),v=n.colorLink||n.colorInfo,b=t(v);return Object.assign(Object.assign({},_),{colorPrimaryBg:d[1],colorPrimaryBgHover:d[2],colorPrimaryBorder:d[3],colorPrimaryBorderHover:d[4],colorPrimaryHover:d[5],colorPrimary:d[6],colorPrimaryActive:d[7],colorPrimaryTextHover:d[8],colorPrimaryText:d[9],colorPrimaryTextActive:d[10],colorSuccessBg:h[1],colorSuccessBgHover:h[2],colorSuccessBorder:h[3],colorSuccessBorderHover:h[4],colorSuccessHover:h[4],colorSuccess:h[6],colorSuccessActive:h[7],colorSuccessTextHover:h[8],colorSuccessText:h[9],colorSuccessTextActive:h[10],colorErrorBg:p[1],colorErrorBgHover:p[2],colorErrorBorder:p[3],colorErrorBorderHover:p[4],colorErrorHover:p[5],colorError:p[6],colorErrorActive:p[7],colorErrorTextHover:p[8],colorErrorText:p[9],colorErrorTextActive:p[10],colorWarningBg:g[1],colorWarningBgHover:g[2],colorWarningBorder:g[3],colorWarningBorderHover:g[4],colorWarningHover:g[4],colorWarning:g[6],colorWarningActive:g[7],colorWarningTextHover:g[8],colorWarningText:g[9],colorWarningTextActive:g[10],colorInfoBg:m[1],colorInfoBgHover:m[2],colorInfoBorder:m[3],colorInfoBorderHover:m[4],colorInfoHover:m[4],colorInfo:m[6],colorInfoActive:m[7],colorInfoTextHover:m[8],colorInfoText:m[9],colorInfoTextActive:m[10],colorLinkHover:b[4],colorLink:b[6],colorLinkActive:b[7],colorBgMask:new Mu("#000").setAlpha(.45).toRgbString(),colorWhite:"#fff"})}const _Nt=n=>{let e=n,t=n,i=n,r=n;return n<6&&n>=5?e=n+1:n<16&&n>=6?e=n+2:n>=16&&(e=16),n<7&&n>=5?t=4:n<8&&n>=7?t=5:n<14&&n>=8?t=6:n<16&&n>=14?t=7:n>=16&&(t=8),n<6&&n>=2?i=1:n>=6&&(i=2),n>4&&n<8?r=4:n>=8&&(r=6),{borderRadius:n,borderRadiusXS:i,borderRadiusSM:t,borderRadiusLG:e,borderRadiusOuter:r}},vNt=_Nt;function bNt(n){const{motionUnit:e,motionBase:t,borderRadius:i,lineWidth:r}=n;return Object.assign({motionDurationFast:`${(t+e).toFixed(1)}s`,motionDurationMid:`${(t+e*2).toFixed(1)}s`,motionDurationSlow:`${(t+e*3).toFixed(1)}s`,lineWidthBold:r+1},vNt(i))}const Ub=(n,e)=>new Mu(n).setAlpha(e).toRgbString(),CR=(n,e)=>new Mu(n).darken(e).toHexString(),yNt=n=>{const e=vx(n);return{1:e[0],2:e[1],3:e[2],4:e[3],5:e[4],6:e[5],7:e[6],8:e[4],9:e[5],10:e[6]}},CNt=(n,e)=>{const t=n||"#fff",i=e||"#000";return{colorBgBase:t,colorTextBase:i,colorText:Ub(i,.88),colorTextSecondary:Ub(i,.65),colorTextTertiary:Ub(i,.45),colorTextQuaternary:Ub(i,.25),colorFill:Ub(i,.15),colorFillSecondary:Ub(i,.06),colorFillTertiary:Ub(i,.04),colorFillQuaternary:Ub(i,.02),colorBgLayout:CR(t,4),colorBgContainer:CR(t,0),colorBgElevated:CR(t,0),colorBgSpotlight:Ub(i,.85),colorBgBlur:"transparent",colorBorder:CR(t,15),colorBorderSecondary:CR(t,6)}};function wNt(n){const e=new Array(10).fill(null).map((t,i)=>{const r=i-1,o=n*Math.pow(2.71828,r/5),s=i>1?Math.floor(o):Math.ceil(o);return Math.floor(s/2)*2});return e[1]=n,e.map(t=>{const i=t+8;return{size:t,lineHeight:i/t}})}const SNt=n=>{const e=wNt(n),t=e.map(r=>r.size),i=e.map(r=>r.lineHeight);return{fontSizeSM:t[0],fontSize:t[1],fontSizeLG:t[2],fontSizeXL:t[3],fontSizeHeading1:t[6],fontSizeHeading2:t[5],fontSizeHeading3:t[4],fontSizeHeading4:t[3],fontSizeHeading5:t[2],lineHeight:i[1],lineHeightLG:i[2],lineHeightSM:i[0],lineHeightHeading1:i[6],lineHeightHeading2:i[5],lineHeightHeading3:i[4],lineHeightHeading4:i[3],lineHeightHeading5:i[2]}},ENt=SNt;function xNt(n){const e=Object.keys(MBe).map(t=>{const i=vx(n[t]);return new Array(10).fill(1).reduce((r,o,s)=>(r[`${t}-${s+1}`]=i[s],r[`${t}${s+1}`]=i[s],r),{})}).reduce((t,i)=>(t=Object.assign(Object.assign({},t),i),t),{});return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),e),mNt(n,{generateColorPalettes:yNt,generateNeutralColorPalettes:CNt})),ENt(n.fontSize)),gNt(n)),fNt(n)),bNt(n))}const FBe=zne(xNt),BBe={token:jP,override:{override:jP},hashed:!0},$Be=te.createContext(BBe),VBe="anticon",kNt=(n,e)=>e||(n?`ant-${n}`:"ant"),Jp=w.createContext({getPrefixCls:kNt,iconPrefixCls:VBe}),TNt=`-ant-${Date.now()}-${Math.random()}`;function INt(n,e){const t={},i=(s,a)=>{let l=s.clone();return l=(a==null?void 0:a(l))||l,l.toRgbString()},r=(s,a)=>{const l=new Mu(s),c=vx(l.toRgbString());t[`${a}-color`]=i(l),t[`${a}-color-disabled`]=c[1],t[`${a}-color-hover`]=c[4],t[`${a}-color-active`]=c[6],t[`${a}-color-outline`]=l.clone().setAlpha(.2).toRgbString(),t[`${a}-color-deprecated-bg`]=c[0],t[`${a}-color-deprecated-border`]=c[2]};if(e.primaryColor){r(e.primaryColor,"primary");const s=new Mu(e.primaryColor),a=vx(s.toRgbString());a.forEach((c,u)=>{t[`primary-${u+1}`]=c}),t["primary-color-deprecated-l-35"]=i(s,c=>c.lighten(35)),t["primary-color-deprecated-l-20"]=i(s,c=>c.lighten(20)),t["primary-color-deprecated-t-20"]=i(s,c=>c.tint(20)),t["primary-color-deprecated-t-50"]=i(s,c=>c.tint(50)),t["primary-color-deprecated-f-12"]=i(s,c=>c.setAlpha(c.getAlpha()*.12));const l=new Mu(a[0]);t["primary-color-active-deprecated-f-30"]=i(l,c=>c.setAlpha(c.getAlpha()*.3)),t["primary-color-active-deprecated-d-02"]=i(l,c=>c.darken(2))}return e.successColor&&r(e.successColor,"success"),e.warningColor&&r(e.warningColor,"warning"),e.errorColor&&r(e.errorColor,"error"),e.infoColor&&r(e.infoColor,"info"),`
:root {
${Object.keys(t).map(s=>`--${n}-${s}: ${t[s]};`).join(`
`)}
}
`.trim()}function LNt(n,e){const t=INt(n,e);lf()&&ED(t,`${TNt}-dynamic-theme`)}const Gne=w.createContext(!1),DNt=n=>{let{children:e,disabled:t}=n;const i=w.useContext(Gne);return w.createElement(Gne.Provider,{value:t??i},e)},bj=Gne,Yne=w.createContext(void 0),ANt=n=>{let{children:e,size:t}=n;const i=w.useContext(Yne);return w.createElement(Yne.Provider,{value:t||i},e)},yj=Yne;function RNt(){const n=w.useContext(bj),e=w.useContext(yj);return{componentDisabled:n,componentSize:e}}const NNt="5.10.3";function $Q(n){return n>=0&&n<=255}function T6(n,e){const{r:t,g:i,b:r,a:o}=new Mu(n).toRgb();if(o<1)return n;const{r:s,g:a,b:l}=new Mu(e).toRgb();for(let c=.01;c<=1;c+=.01){const u=Math.round((t-s*(1-c))/c),d=Math.round((i-a*(1-c))/c),h=Math.round((r-l*(1-c))/c);if($Q(u)&&$Q(d)&&$Q(h))return new Mu({r:u,g:d,b:h,a:Math.round(c*100)/100}).toRgbString()}return new Mu({r:t,g:i,b:r,a:1}).toRgbString()}var ONt=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};function HBe(n){const{override:e}=n,t=ONt(n,["override"]),i=Object.assign({},e);Object.keys(jP).forEach(h=>{delete i[h]});const r=Object.assign(Object.assign({},t),i),o=480,s=576,a=768,l=992,c=1200,u=1600;if(r.motion===!1){const h="0s";r.motionDurationFast=h,r.motionDurationMid=h,r.motionDurationSlow=h}return Object.assign(Object.assign(Object.assign({},r),{colorFillContent:r.colorFillSecondary,colorFillContentHover:r.colorFill,colorFillAlter:r.colorFillQuaternary,colorBgContainerDisabled:r.colorFillTertiary,colorBorderBg:r.colorBgContainer,colorSplit:T6(r.colorBorderSecondary,r.colorBgContainer),colorTextPlaceholder:r.colorTextQuaternary,colorTextDisabled:r.colorTextQuaternary,colorTextHeading:r.colorText,colorTextLabel:r.colorTextSecondary,colorTextDescription:r.colorTextTertiary,colorTextLightSolid:r.colorWhite,colorHighlight:r.colorError,colorBgTextHover:r.colorFillSecondary,colorBgTextActive:r.colorFill,colorIcon:r.colorTextTertiary,colorIconHover:r.colorText,colorErrorOutline:T6(r.colorErrorBg,r.colorBgContainer),colorWarningOutline:T6(r.colorWarningBg,r.colorBgContainer),fontSizeIcon:r.fontSizeSM,lineWidthFocus:r.lineWidth*4,lineWidth:r.lineWidth,controlOutlineWidth:r.lineWidth*2,controlInteractiveSize:r.controlHeight/2,controlItemBgHover:r.colorFillTertiary,controlItemBgActive:r.colorPrimaryBg,controlItemBgActiveHover:r.colorPrimaryBgHover,controlItemBgActiveDisabled:r.colorFill,controlTmpOutline:r.colorFillQuaternary,controlOutline:T6(r.colorPrimaryBg,r.colorBgContainer),lineType:r.lineType,borderRadius:r.borderRadius,borderRadiusXS:r.borderRadiusXS,borderRadiusSM:r.borderRadiusSM,borderRadiusLG:r.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:r.sizeXXS,paddingXS:r.sizeXS,paddingSM:r.sizeSM,padding:r.size,paddingMD:r.sizeMD,paddingLG:r.sizeLG,paddingXL:r.sizeXL,paddingContentHorizontalLG:r.sizeLG,paddingContentVerticalLG:r.sizeMS,paddingContentHorizontal:r.sizeMS,paddingContentVertical:r.sizeSM,paddingContentHorizontalSM:r.size,paddingContentVerticalSM:r.sizeXS,marginXXS:r.sizeXXS,marginXS:r.sizeXS,marginSM:r.sizeSM,margin:r.size,marginMD:r.sizeMD,marginLG:r.sizeLG,marginXL:r.sizeXL,marginXXL:r.sizeXXL,boxShadow:`
0 6px 16px 0 rgba(0, 0, 0, 0.08),
0 3px 6px -4px rgba(0, 0, 0, 0.12),
0 9px 28px 8px rgba(0, 0, 0, 0.05)
`,boxShadowSecondary:`
0 6px 16px 0 rgba(0, 0, 0, 0.08),
0 3px 6px -4px rgba(0, 0, 0, 0.12),
0 9px 28px 8px rgba(0, 0, 0, 0.05)
`,boxShadowTertiary:`
0 1px 2px 0 rgba(0, 0, 0, 0.03),
0 1px 6px -1px rgba(0, 0, 0, 0.02),
0 2px 4px 0 rgba(0, 0, 0, 0.02)
`,screenXS:o,screenXSMin:o,screenXSMax:s-1,screenSM:s,screenSMMin:s,screenSMMax:a-1,screenMD:a,screenMDMin:a,screenMDMax:l-1,screenLG:l,screenLGMin:l,screenLGMax:c-1,screenXL:c,screenXLMin:c,screenXLMax:u-1,screenXXL:u,screenXXLMin:u,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:`
0 1px 2px -2px ${new Mu("rgba(0, 0, 0, 0.16)").toRgbString()},
0 3px 6px 0 ${new Mu("rgba(0, 0, 0, 0.12)").toRgbString()},
0 5px 12px 4px ${new Mu("rgba(0, 0, 0, 0.09)").toRgbString()}
`,boxShadowDrawerRight:`
-6px 0 16px 0 rgba(0, 0, 0, 0.08),
-3px 0 6px -4px rgba(0, 0, 0, 0.12),
-9px 0 28px 8px rgba(0, 0, 0, 0.05)
`,boxShadowDrawerLeft:`
6px 0 16px 0 rgba(0, 0, 0, 0.08),
3px 0 6px -4px rgba(0, 0, 0, 0.12),
9px 0 28px 8px rgba(0, 0, 0, 0.05)
`,boxShadowDrawerUp:`
0 6px 16px 0 rgba(0, 0, 0, 0.08),
0 3px 6px -4px rgba(0, 0, 0, 0.12),
0 9px 28px 8px rgba(0, 0, 0, 0.05)
`,boxShadowDrawerDown:`
0 -6px 16px 0 rgba(0, 0, 0, 0.08),
0 -3px 6px -4px rgba(0, 0, 0, 0.12),
0 -9px 28px 8px rgba(0, 0, 0, 0.05)
`,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)"}),i)}var KEe=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};const WBe=(n,e,t)=>{const i=t.getDerivativeToken(n),{override:r}=e,o=KEe(e,["override"]);let s=Object.assign(Object.assign({},i),{override:r});return s=HBe(s),o&&Object.entries(o).forEach(a=>{let[l,c]=a;const{theme:u}=c,d=KEe(c,["theme"]);let h=d;u&&(h=WBe(Object.assign(Object.assign({},s),d),{override:d},u)),s[l]=h}),s};function P3(){const{token:n,hashed:e,theme:t,override:i}=te.useContext($Be),r=`${NNt}-${e||""}`,o=t||FBe,[s,a]=wRt(o,[jP,n],{salt:r,override:i,getComputedToken:WBe,formatToken:HBe});return[o,s,e?a:""]}function Wm(n){var e=w.useRef();e.current=n;var t=w.useCallback(function(){for(var i,r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return(i=e.current)===null||i===void 0?void 0:i.call.apply(i,[e].concat(o))},[]);return t}function mL(n){var e=w.useRef(!1),t=w.useState(n),i=$t(t,2),r=i[0],o=i[1];w.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]);function s(a,l){l&&e.current||o(a)}return[r,s]}function VQ(n){return n!==void 0}function xp(n,e){var t=e||{},i=t.defaultValue,r=t.value,o=t.onChange,s=t.postState,a=mL(function(){return VQ(r)?r:VQ(i)?typeof i=="function"?i():i:typeof n=="function"?n():n}),l=$t(a,2),c=l[0],u=l[1],d=r!==void 0?r:c,h=s?s(d):d,g=Wm(o),p=mL([d]),m=$t(p,2),_=m[0],v=m[1];NEe(function(){var y=_[0];c!==y&&g(c,y)},[_]),NEe(function(){VQ(r)||u(r)},[r]);var b=Wm(function(y,C){u(y,C),v([d],C)});return[h,b]}const PNt=(n,e,t,i,r)=>{const o=n/2,s=0,a=o,l=t*1/Math.sqrt(2),c=o-t*(1-1/Math.sqrt(2)),u=o-e*(1/Math.sqrt(2)),d=t*(Math.sqrt(2)-1)+e*(1/Math.sqrt(2)),h=2*o-u,g=d,p=2*o-l,m=c,_=2*o-s,v=a,b=o*Math.sqrt(2)+t*(Math.sqrt(2)-2),y=t*(Math.sqrt(2)-1);return{pointerEvents:"none",width:n,height:n,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:n,height:n/2,background:i,clipPath:{_multi_value_:!0,value:[`polygon(${y}px 100%, 50% ${y}px, ${2*o-y}px 100%, ${y}px 100%)`,`path('M ${s} ${a} A ${t} ${t} 0 0 0 ${l} ${c} L ${u} ${d} A ${e} ${e} 0 0 1 ${h} ${g} L ${p} ${m} A ${t} ${t} 0 0 0 ${_} ${v} Z')`]},content:'""'},"&::after":{content:'""',position:"absolute",width:b,height:b,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${e}px 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:r,zIndex:0,background:"transparent"}}},MNt={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},UP=function(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return{boxSizing:"border-box",margin:0,padding:0,color:n.colorText,fontSize:n.fontSize,lineHeight:n.lineHeight,listStyle:"none",fontFamily:e?"inherit":n.fontFamily}},FNt=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),BNt=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),$Nt=n=>({a:{color:n.colorLink,textDecoration:n.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${n.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:n.colorLinkHover},"&:active":{color:n.colorLinkActive},"&:active,\n &:hover":{textDecoration:n.linkHoverDecoration,outline:0},"&:focus":{textDecoration:n.linkFocusDecoration,outline:0},"&[disabled]":{color:n.colorTextDisabled,cursor:"not-allowed"}}}),VNt=(n,e)=>{const{fontFamily:t,fontSize:i}=n,r=`[class^="${e}"], [class*=" ${e}"]`;return{[r]:{fontFamily:t,fontSize:i,boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"},[r]:{boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}}}}},HNt=n=>({outline:`${n.lineWidthFocus}px solid ${n.colorPrimaryBorder}`,outlineOffset:1,transition:"outline-offset 0s, outline 0s"}),WNt=n=>({"&:focus-visible":Object.assign({},HNt(n))}),zBe=typeof CSSINJS_STATISTIC<"u";let Qne=!0;function lh(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];if(!zBe)return Object.assign.apply(Object,[{}].concat(e));Qne=!1;const i={};return e.forEach(r=>{Object.keys(r).forEach(s=>{Object.defineProperty(i,s,{configurable:!0,enumerable:!0,get:()=>r[s]})})}),Qne=!0,i}const GEe={};function zNt(){}function jNt(n){let e,t=n,i=zNt;return zBe&&(e=new Set,t=new Proxy(n,{get(r,o){return Qne&&e.add(o),r[o]}}),i=(r,o)=>{var s;GEe[r]={global:Array.from(e),component:Object.assign(Object.assign({},(s=GEe[r])===null||s===void 0?void 0:s.component),o)}}),{token:t,keys:e,flush:i}}const UNt=(n,e)=>{const[t,i]=P3();return jne({theme:t,token:i,hashId:"",path:["ant-design-icons",n],nonce:()=>e==null?void 0:e.nonce},()=>[{[`.${n}`]:Object.assign(Object.assign({},FNt()),{[`.${n} .${n}-icon`]:{display:"block"}})}])},jBe=UNt;function eA(n,e,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=Array.isArray(n)?n:[n,n],[o]=r,s=r.join("-");return a=>{const[l,c,u]=P3(),{getPrefixCls:d,iconPrefixCls:h,csp:g}=w.useContext(Jp),p=d(),m={theme:l,token:c,hashId:u,nonce:()=>g==null?void 0:g.nonce,clientOnly:i.clientOnly,order:i.order||-999};return jne(Object.assign(Object.assign({},m),{clientOnly:!1,path:["Shared",p]}),()=>[{"&":$Nt(c)}]),jBe(h,g),[jne(Object.assign(Object.assign({},m),{path:[s,a,h]}),()=>{const{token:_,flush:v}=jNt(c),b=Object.assign({},c[o]);if(i.deprecatedTokens){const{deprecatedTokens:L}=i;L.forEach(D=>{let[R,P]=D;var M;(b!=null&&b[R]||b!=null&&b[P])&&((M=b[P])!==null&&M!==void 0||(b[P]=b==null?void 0:b[R]))})}const y=typeof t=="function"?t(lh(_,b??{})):t,C=Object.assign(Object.assign({},y),b),x=`.${a}`,k=lh(_,{componentCls:x,prefixCls:a,iconCls:`.${h}`,antCls:`.${p}`},C),I=e(k,{hashId:u,prefixCls:a,rootPrefixCls:p,iconPrefixCls:h,overrideComponentToken:b});return v(o,C),[i.resetStyle===!1?null:VNt(c,a),I]}),u]}}const qNt=(n,e,t,i)=>{const r=eA(n,e,t,Object.assign({resetStyle:!1,order:-998},i));return s=>{let{prefixCls:a}=s;return r(a),null}};function KNt(n,e){const t=n||{},i=t.inherit===!1||!e?BBe:e;return N3(()=>{if(!n)return e;const r=Object.assign({},i.components);return Object.keys(n.components||{}).forEach(o=>{r[o]=Object.assign(Object.assign({},r[o]),n.components[o])}),Object.assign(Object.assign(Object.assign({},i),t),{token:Object.assign(Object.assign({},i.token),t.token),components:r})},[t,i],(r,o)=>r.some((s,a)=>{const l=o[a];return!I7(s,l,!0)}))}var GNt=["children"],UBe=w.createContext({});function YNt(n){var e=n.children,t=uu(n,GNt);return w.createElement(UBe.Provider,{value:t},e)}var QNt=function(n){I_(t,n);var e=pk(t);function t(){return Ua(this,t),e.apply(this,arguments)}return qa(t,[{key:"render",value:function(){return this.props.children}}]),t}(w.Component),VS="none",I6="appear",L6="enter",D6="leave",YEe="none",Om="prepare",EI="start",xI="active",ege="end",qBe="prepared";function QEe(n,e){var t={};return t[n.toLowerCase()]=e.toLowerCase(),t["Webkit".concat(n)]="webkit".concat(e),t["Moz".concat(n)]="moz".concat(e),t["ms".concat(n)]="MS".concat(e),t["O".concat(n)]="o".concat(e.toLowerCase()),t}function XNt(n,e){var t={animationend:QEe("Animation","AnimationEnd"),transitionend:QEe("Transition","TransitionEnd")};return n&&("AnimationEvent"in e||delete t.animationend.animation,"TransitionEvent"in e||delete t.transitionend.transition),t}var ZNt=XNt(lf(),typeof window<"u"?window:{}),KBe={};if(lf()){var JNt=document.createElement("div");KBe=JNt.style}var A6={};function GBe(n){if(A6[n])return A6[n];var e=ZNt[n];if(e)for(var t=Object.keys(e),i=t.length,r=0;r<i;r+=1){var o=t[r];if(Object.prototype.hasOwnProperty.call(e,o)&&o in KBe)return A6[n]=e[o],A6[n]}return""}var YBe=GBe("animationend"),QBe=GBe("transitionend"),XBe=!!(YBe&&QBe),XEe=YBe||"animationend",ZEe=QBe||"transitionend";function JEe(n,e){if(!n)return null;if(Er(n)==="object"){var t=e.replace(/-\w/g,function(i){return i[1].toUpperCase()});return n[t]}return"".concat(n,"-").concat(e)}const eOt=function(n){var e=w.useRef(),t=w.useRef(n);t.current=n;var i=w.useCallback(function(s){t.current(s)},[]);function r(s){s&&(s.removeEventListener(ZEe,i),s.removeEventListener(XEe,i))}function o(s){e.current&&e.current!==s&&r(e.current),s&&s!==e.current&&(s.addEventListener(ZEe,i),s.addEventListener(XEe,i),e.current=s)}return w.useEffect(function(){return function(){r(e.current)}},[]),[o,r]};var ZBe=lf()?w.useLayoutEffect:w.useEffect;const tOt=function(){var n=w.useRef(null);function e(){af.cancel(n.current)}function t(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;e();var o=af(function(){r<=1?i({isCanceled:function(){return o!==n.current}}):t(i,r-1)});n.current=o}return w.useEffect(function(){return function(){e()}},[]),[t,e]};var nOt=[Om,EI,xI,ege],iOt=[Om,qBe],JBe=!1,rOt=!0;function e$e(n){return n===xI||n===ege}const oOt=function(n,e,t){var i=mL(YEe),r=$t(i,2),o=r[0],s=r[1],a=tOt(),l=$t(a,2),c=l[0],u=l[1];function d(){s(Om,!0)}var h=e?iOt:nOt;return ZBe(function(){if(o!==YEe&&o!==ege){var g=h.indexOf(o),p=h[g+1],m=t(o);m===JBe?s(p,!0):p&&c(function(_){function v(){_.isCanceled()||s(p,!0)}m===!0?v():Promise.resolve(m).then(v)})}},[n,o]),w.useEffect(function(){return function(){u()}},[]),[d,o]};function sOt(n,e,t,i){var r=i.motionEnter,o=r===void 0?!0:r,s=i.motionAppear,a=s===void 0?!0:s,l=i.motionLeave,c=l===void 0?!0:l,u=i.motionDeadline,d=i.motionLeaveImmediately,h=i.onAppearPrepare,g=i.onEnterPrepare,p=i.onLeavePrepare,m=i.onAppearStart,_=i.onEnterStart,v=i.onLeaveStart,b=i.onAppearActive,y=i.onEnterActive,C=i.onLeaveActive,x=i.onAppearEnd,k=i.onEnterEnd,I=i.onLeaveEnd,L=i.onVisibleChanged,D=mL(),R=$t(D,2),P=R[0],M=R[1],O=mL(VS),B=$t(O,2),F=B[0],H=B[1],V=mL(null),$=$t(V,2),j=$[0],Y=$[1],ne=w.useRef(!1),se=w.useRef(null);function he(){return t()}var xe=w.useRef(!1);function _e(){H(VS,!0),Y(null,!0)}function Ie(Zt){var pe=he();if(!(Zt&&!Zt.deadline&&Zt.target!==pe)){var me=xe.current,Z;F===I6&&me?Z=x==null?void 0:x(pe,Zt):F===L6&&me?Z=k==null?void 0:k(pe,Zt):F===D6&&me&&(Z=I==null?void 0:I(pe,Zt)),F!==VS&&me&&Z!==!1&&_e()}}var Re=eOt(Ie),Ye=$t(Re,1),Ze=Ye[0],tt=function(pe){var me,Z,G;switch(pe){case I6:return me={},$e(me,Om,h),$e(me,EI,m),$e(me,xI,b),me;case L6:return Z={},$e(Z,Om,g),$e(Z,EI,_),$e(Z,xI,y),Z;case D6:return G={},$e(G,Om,p),$e(G,EI,v),$e(G,xI,C),G;default:return{}}},Be=w.useMemo(function(){return tt(F)},[F]),kt=oOt(F,!n,function(Zt){if(Zt===Om){var pe=Be[Om];return pe?pe(he()):JBe}if(Kt in Be){var me;Y(((me=Be[Kt])===null||me===void 0?void 0:me.call(Be,he(),null))||null)}return Kt===xI&&(Ze(he()),u>0&&(clearTimeout(se.current),se.current=setTimeout(function(){Ie({deadline:!0})},u))),Kt===qBe&&_e(),rOt}),Vt=$t(kt,2),xt=Vt[0],Kt=Vt[1],cn=e$e(Kt);xe.current=cn,ZBe(function(){M(e);var Zt=ne.current;ne.current=!0;var pe;!Zt&&e&&a&&(pe=I6),Zt&&e&&o&&(pe=L6),(Zt&&!e&&c||!Zt&&d&&!e&&c)&&(pe=D6);var me=tt(pe);pe&&(n||me[Om])?(H(pe),xt()):H(VS)},[e]),w.useEffect(function(){(F===I6&&!a||F===L6&&!o||F===D6&&!c)&&H(VS)},[a,o,c]),w.useEffect(function(){return function(){ne.current=!1,clearTimeout(se.current)}},[]);var wn=w.useRef(!1);w.useEffect(function(){P&&(wn.current=!0),P!==void 0&&F===VS&&((wn.current||P)&&(L==null||L(P)),wn.current=!0)},[P,F]);var on=j;return Be[Om]&&Kt===EI&&(on=Qe({transition:"none"},on)),[F,Kt,on,P??e]}function aOt(n){var e=n;Er(n)==="object"&&(e=n.transitionSupport);function t(r,o){return!!(r.motionName&&e&&o!==!1)}var i=w.forwardRef(function(r,o){var s=r.visible,a=s===void 0?!0:s,l=r.removeOnLeave,c=l===void 0?!0:l,u=r.forceRender,d=r.children,h=r.motionName,g=r.leavedClassName,p=r.eventProps,m=w.useContext(UBe),_=m.motion,v=t(r,_),b=w.useRef(),y=w.useRef();function C(){try{return b.current instanceof HTMLElement?b.current:u8(y.current)}catch{return null}}var x=sOt(v,a,C,r),k=$t(x,4),I=k[0],L=k[1],D=k[2],R=k[3],P=w.useRef(R);R&&(P.current=!0);var M=w.useCallback(function(Y){b.current=Y,Ufe(o,Y)},[o]),O,B=Qe(Qe({},p),{},{visible:a});if(!d)O=null;else if(I===VS)R?O=d(Qe({},B),M):!c&&P.current&&g?O=d(Qe(Qe({},B),{},{className:g}),M):u||!c&&!g?O=d(Qe(Qe({},B),{},{style:{display:"none"}}),M):O=null;else{var F,H;L===Om?H="prepare":e$e(L)?H="active":L===EI&&(H="start");var V=JEe(h,"".concat(I,"-").concat(H));O=d(Qe(Qe({},B),{},{className:St(JEe(h,I),(F={},$e(F,V,V&&H),$e(F,h,typeof h=="string"),F)),style:D}),M)}if(w.isValidElement(O)&&O3(O)){var $=O,j=$.ref;j||(O=w.cloneElement(O,{ref:M}))}return w.createElement(QNt,{ref:y},O)});return i.displayName="CSSMotion",i}const M3=aOt(XBe);var Xne="add",Zne="keep",Jne="remove",HQ="removed";function lOt(n){var e;return n&&Er(n)==="object"&&"key"in n?e=n:e={key:n},Qe(Qe({},e),{},{key:String(e.key)})}function eie(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return n.map(lOt)}function cOt(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=[],i=0,r=e.length,o=eie(n),s=eie(e);o.forEach(function(c){for(var u=!1,d=i;d<r;d+=1){var h=s[d];if(h.key===c.key){i<d&&(t=t.concat(s.slice(i,d).map(function(g){return Qe(Qe({},g),{},{status:Xne})})),i=d),t.push(Qe(Qe({},h),{},{status:Zne})),i+=1,u=!0;break}}u||t.push(Qe(Qe({},c),{},{status:Jne}))}),i<r&&(t=t.concat(s.slice(i).map(function(c){return Qe(Qe({},c),{},{status:Xne})})));var a={};t.forEach(function(c){var u=c.key;a[u]=(a[u]||0)+1});var l=Object.keys(a).filter(function(c){return a[c]>1});return l.forEach(function(c){t=t.filter(function(u){var d=u.key,h=u.status;return d!==c||h!==Jne}),t.forEach(function(u){u.key===c&&(u.status=Zne)})}),t}var uOt=["component","children","onVisibleChanged","onAllRemoved"],dOt=["status"],hOt=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearPrepare","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function fOt(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:M3,t=function(i){I_(o,i);var r=pk(o);function o(){var s;Ua(this,o);for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return s=r.call.apply(r,[this].concat(l)),$e(Sr(s),"state",{keyEntities:[]}),$e(Sr(s),"removeKey",function(u){var d=s.state.keyEntities,h=d.map(function(g){return g.key!==u?g:Qe(Qe({},g),{},{status:HQ})});return s.setState({keyEntities:h}),h.filter(function(g){var p=g.status;return p!==HQ}).length}),s}return qa(o,[{key:"render",value:function(){var a=this,l=this.state.keyEntities,c=this.props,u=c.component,d=c.children,h=c.onVisibleChanged,g=c.onAllRemoved,p=uu(c,uOt),m=u||w.Fragment,_={};return hOt.forEach(function(v){_[v]=p[v],delete p[v]}),delete p.keys,w.createElement(m,p,l.map(function(v,b){var y=v.status,C=uu(v,dOt),x=y===Xne||y===Zne;return w.createElement(e,rt({},_,{key:C.key,visible:x,eventProps:C,onVisibleChanged:function(I){if(h==null||h(I,{key:C.key}),!I){var L=a.removeKey(C.key);L===0&&g&&g()}}}),function(k,I){return d(Qe(Qe({},k),{},{index:b}),I)})}))}}],[{key:"getDerivedStateFromProps",value:function(a,l){var c=a.keys,u=l.keyEntities,d=eie(c),h=cOt(u,d);return{keyEntities:h.filter(function(g){var p=u.find(function(m){var _=m.key;return g.key===_});return!(p&&p.status===HQ&&g.status===Jne)})}}}]),o}(w.Component);return $e(t,"defaultProps",{component:"div"}),t}fOt(XBe);function gOt(n){const{children:e}=n,[,t]=P3(),{motion:i}=t,r=w.useRef(!1);return r.current=r.current||i===!1,r.current?w.createElement(YNt,{motion:i},e):e}const pOt=()=>null;var mOt=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};const _Ot=["getTargetContainer","getPopupContainer","renderEmpty","pageHeader","input","pagination","form","select","button"],vOt="ant";let t$e;function bOt(){return t$e||vOt}function yOt(n){return Object.keys(n).some(e=>e.endsWith("Color"))}const COt=n=>{let{prefixCls:e,iconPrefixCls:t,theme:i}=n;e!==void 0&&(t$e=e),i&&yOt(i)&&LNt(bOt(),i)},wOt=n=>{const{children:e,csp:t,autoInsertSpaceInButton:i,alert:r,anchor:o,form:s,locale:a,componentSize:l,direction:c,space:u,virtual:d,dropdownMatchSelectWidth:h,popupMatchSelectWidth:g,popupOverflow:p,legacyLocale:m,parentContext:_,iconPrefixCls:v,theme:b,componentDisabled:y,segmented:C,statistic:x,spin:k,calendar:I,carousel:L,cascader:D,collapse:R,typography:P,checkbox:M,descriptions:O,divider:B,drawer:F,skeleton:H,steps:V,image:$,layout:j,list:Y,mentions:ne,modal:se,progress:he,result:xe,slider:_e,breadcrumb:Ie,menu:Re,pagination:Ye,input:Ze,empty:tt,badge:Be,radio:kt,rate:Vt,switch:xt,transfer:Kt,avatar:cn,message:wn,tag:on,table:Zt,card:pe,tabs:me,timeline:Z,timePicker:G,upload:K,notification:oe,tree:le,colorPicker:we,datePicker:Me,flex:ft,wave:Nt,warning:Yt}=n,He=w.useCallback((xn,un)=>{const{prefixCls:ei}=n;if(un)return un;const li=ei||_.getPrefixCls("");return xn?`${li}-${xn}`:li},[_.getPrefixCls,n.prefixCls]),Dt=v||_.iconPrefixCls||VBe,ae=t||_.csp;jBe(Dt,ae);const Se=KNt(b,_.theme),Xe={csp:ae,autoInsertSpaceInButton:i,alert:r,anchor:o,locale:a||m,direction:c,space:u,virtual:d,popupMatchSelectWidth:g??h,popupOverflow:p,getPrefixCls:He,iconPrefixCls:Dt,theme:Se,segmented:C,statistic:x,spin:k,calendar:I,carousel:L,cascader:D,collapse:R,typography:P,checkbox:M,descriptions:O,divider:B,drawer:F,skeleton:H,steps:V,image:$,input:Ze,layout:j,list:Y,mentions:ne,modal:se,progress:he,result:xe,slider:_e,breadcrumb:Ie,menu:Re,pagination:Ye,empty:tt,badge:Be,radio:kt,rate:Vt,switch:xt,transfer:Kt,avatar:cn,message:wn,tag:on,table:Zt,card:pe,tabs:me,timeline:Z,timePicker:G,upload:K,notification:oe,tree:le,colorPicker:we,datePicker:Me,flex:ft,wave:Nt,warning:Yt},wt=Object.assign({},_);Object.keys(Xe).forEach(xn=>{Xe[xn]!==void 0&&(wt[xn]=Xe[xn])}),_Ot.forEach(xn=>{const un=n[xn];un&&(wt[xn]=un)});const Tt=N3(()=>wt,wt,(xn,un)=>{const ei=Object.keys(xn),li=Object.keys(un);return ei.length!==li.length||ei.some(xi=>xn[xi]!==un[xi])}),zt=w.useMemo(()=>({prefixCls:Dt,csp:ae}),[Dt,ae]);let Mt=w.createElement(w.Fragment,null,w.createElement(pOt,{dropdownMatchSelectWidth:h}),e);const On=w.useMemo(()=>{var xn,un,ei,li;return SI(((xn=xD.Form)===null||xn===void 0?void 0:xn.defaultValidateMessages)||{},((ei=(un=Tt.locale)===null||un===void 0?void 0:un.Form)===null||ei===void 0?void 0:ei.defaultValidateMessages)||{},((li=Tt.form)===null||li===void 0?void 0:li.validateMessages)||{},(s==null?void 0:s.validateMessages)||{})},[Tt,s==null?void 0:s.validateMessages]);Object.keys(On).length>0&&(Mt=w.createElement(FRt.Provider,{value:On},Mt)),a&&(Mt=w.createElement(GRt,{locale:a,_ANT_MARK__:qRt},Mt)),(Dt||ae)&&(Mt=w.createElement(Zfe.Provider,{value:zt},Mt)),l&&(Mt=w.createElement(ANt,{size:l},Mt)),Mt=w.createElement(gOt,null,Mt);const Ni=w.useMemo(()=>{const xn=Se||{},{algorithm:un,token:ei,components:li}=xn,xi=mOt(xn,["algorithm","token","components"]),br=un&&(!Array.isArray(un)||un.length>0)?zne(un):FBe,Wr={};Object.entries(li||{}).forEach(oo=>{let[ea,xr]=oo;const Hi=Object.assign({},xr);"algorithm"in Hi&&(Hi.algorithm===!0?Hi.theme=br:(Array.isArray(Hi.algorithm)||typeof Hi.algorithm=="function")&&(Hi.theme=zne(Hi.algorithm)),delete Hi.algorithm),Wr[ea]=Hi});const ko=Object.assign(Object.assign({},jP),ei);return Object.assign(Object.assign({},xi),{theme:br,token:ko,components:Wr,override:Object.assign({override:ko},Wr)})},[Se]);return b&&(Mt=w.createElement($Be.Provider,{value:Ni},Mt)),Tt.warning&&(Mt=w.createElement(MRt.Provider,{value:Tt.warning},Mt)),y!==void 0&&(Mt=w.createElement(DNt,{disabled:y},Mt)),w.createElement(Jp.Provider,{value:Tt},Mt)},tA=n=>{const e=w.useContext(Jp),t=w.useContext(Jfe);return w.createElement(wOt,Object.assign({parentContext:e,legacyLocale:t},n))};tA.ConfigContext=Jp;tA.SizeContext=yj;tA.config=COt;tA.useConfig=RNt;Object.defineProperty(tA,"SizeContext",{get:()=>yj});const tge=tA;function n$e(n){var e;return n==null||(e=n.getRootNode)===null||e===void 0?void 0:e.call(n)}function SOt(n){return n$e(n)instanceof ShadowRoot}function R7(n){return SOt(n)?n$e(n):null}function EOt(n){return n.replace(/-(.)/g,function(e,t){return t.toUpperCase()})}function xOt(n,e){Uu(n,"[@ant-design/icons] ".concat(e))}function exe(n){return Er(n)==="object"&&typeof n.name=="string"&&typeof n.theme=="string"&&(Er(n.icon)==="object"||typeof n.icon=="function")}function txe(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(n).reduce(function(e,t){var i=n[t];switch(t){case"class":e.className=i,delete e.class;break;default:delete e[t],e[EOt(t)]=i}return e},{})}function tie(n,e,t){return t?te.createElement(n.tag,Qe(Qe({key:e},txe(n.attrs)),t),(n.children||[]).map(function(i,r){return tie(i,"".concat(e,"-").concat(n.tag,"-").concat(r))})):te.createElement(n.tag,Qe({key:e},txe(n.attrs)),(n.children||[]).map(function(i,r){return tie(i,"".concat(e,"-").concat(n.tag,"-").concat(r))}))}function i$e(n){return vx(n)[0]}function r$e(n){return n?Array.isArray(n)?n:[n]:[]}var kOt=`
.anticon {
display: inline-block;
color: inherit;
font-style: normal;
line-height: 0;
text-align: center;
text-transform: none;
vertical-align: -0.125em;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.anticon > * {
line-height: 1;
}
.anticon svg {
display: inline-block;
}
.anticon::before {
display: none;
}
.anticon .anticon-icon {
display: block;
}
.anticon[tabindex] {
cursor: pointer;
}
.anticon-spin::before,
.anticon-spin {
display: inline-block;
-webkit-animation: loadingCircle 1s infinite linear;
animation: loadingCircle 1s infinite linear;
}
@-webkit-keyframes loadingCircle {
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes loadingCircle {
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
`,TOt=function(e){var t=w.useContext(Zfe),i=t.csp,r=t.prefixCls,o=kOt;r&&(o=o.replace(/anticon/g,r)),w.useEffect(function(){var s=e.current,a=R7(s);ED(o,"@ant-design-icons",{prepend:!0,csp:i,attachTo:a})},[])},IOt=["icon","className","onClick","style","primaryColor","secondaryColor"],dO={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function LOt(n){var e=n.primaryColor,t=n.secondaryColor;dO.primaryColor=e,dO.secondaryColor=t||i$e(e),dO.calculated=!!t}function DOt(){return Qe({},dO)}var Cj=function(e){var t=e.icon,i=e.className,r=e.onClick,o=e.style,s=e.primaryColor,a=e.secondaryColor,l=uu(e,IOt),c=w.useRef(),u=dO;if(s&&(u={primaryColor:s,secondaryColor:a||i$e(s)}),TOt(c),xOt(exe(t),"icon should be icon definiton, but got ".concat(t)),!exe(t))return null;var d=t;return d&&typeof d.icon=="function"&&(d=Qe(Qe({},d),{},{icon:d.icon(u.primaryColor,u.secondaryColor)})),tie(d.icon,"svg-".concat(d.name),Qe(Qe({className:i,onClick:r,style:o,"data-icon":d.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l),{},{ref:c}))};Cj.displayName="IconReact";Cj.getTwoToneColors=DOt;Cj.setTwoToneColors=LOt;const nge=Cj;function o$e(n){var e=r$e(n),t=$t(e,2),i=t[0],r=t[1];return nge.setTwoToneColors({primaryColor:i,secondaryColor:r})}function AOt(){var n=nge.getTwoToneColors();return n.calculated?[n.primaryColor,n.secondaryColor]:n.primaryColor}var ROt=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];o$e(dNt.primary);var wj=w.forwardRef(function(n,e){var t,i=n.className,r=n.icon,o=n.spin,s=n.rotate,a=n.tabIndex,l=n.onClick,c=n.twoToneColor,u=uu(n,ROt),d=w.useContext(Zfe),h=d.prefixCls,g=h===void 0?"anticon":h,p=d.rootClassName,m=St(p,g,(t={},$e(t,"".concat(g,"-").concat(r.name),!!r.name),$e(t,"".concat(g,"-spin"),!!o||r.name==="loading"),t),i),_=a;_===void 0&&l&&(_=-1);var v=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,b=r$e(c),y=$t(b,2),C=y[0],x=y[1];return w.createElement("span",rt({role:"img","aria-label":r.name},u,{ref:e,tabIndex:_,onClick:l,className:m}),w.createElement(nge,{icon:r,primaryColor:C,secondaryColor:x,style:v}))});wj.displayName="AntdIcon";wj.getTwoToneColor=AOt;wj.setTwoToneColor=o$e;const F3=wj;var NOt={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"};const OOt=NOt;var POt=function(e,t){return w.createElement(F3,rt({},e,{ref:t,icon:OOt}))};const s$e=w.forwardRef(POt);var MOt=`accept acceptCharset accessKey action allowFullScreen allowTransparency
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
charSet checked classID className colSpan cols content contentEditable contextMenu
controls coords crossOrigin data dateTime default defer dir disabled download draggable
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
mediaGroup method min minLength multiple muted name noValidate nonce open
optimum pattern placeholder poster preload radioGroup readOnly rel required
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
summary tabIndex target title type useMap value width wmode wrap`,FOt=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,BOt="".concat(MOt," ").concat(FOt).split(/[\s\n]+/),$Ot="aria-",VOt="data-";function nxe(n,e){return n.indexOf(e)===0}function a$e(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,t;e===!1?t={aria:!0,data:!0,attr:!0}:e===!0?t={aria:!0}:t=Qe({},e);var i={};return Object.keys(n).forEach(function(r){(t.aria&&(r==="role"||nxe(r,$Ot))||t.data&&nxe(r,VOt)||t.attr&&BOt.includes(r))&&(i[r]=n[r])}),i}const{isValidElement:l$e}=Rp;function HOt(n){return n&&l$e(n)&&n.type===w.Fragment}function WOt(n,e,t){return l$e(n)?w.cloneElement(n,typeof t=="function"?t(n.props||{}):t):e}function c$e(n,e){return WOt(n,n,e)}var Rn={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>=Rn.F1&&t<=Rn.F12)return!1;switch(t){case Rn.ALT:case Rn.CAPS_LOCK:case Rn.CONTEXT_MENU:case Rn.CTRL:case Rn.DOWN:case Rn.END:case Rn.ESC:case Rn.HOME:case Rn.INSERT:case Rn.LEFT:case Rn.MAC_FF_META:case Rn.META:case Rn.NUMLOCK:case Rn.NUM_CENTER:case Rn.PAGE_DOWN:case Rn.PAGE_UP:case Rn.PAUSE:case Rn.PRINT_SCREEN:case Rn.RIGHT:case Rn.SHIFT:case Rn.UP:case Rn.WIN_KEY:case Rn.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=Rn.ZERO&&e<=Rn.NINE||e>=Rn.NUM_ZERO&&e<=Rn.NUM_MULTIPLY||e>=Rn.A&&e<=Rn.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&e===0)return!0;switch(e){case Rn.SPACE:case Rn.QUESTION_MARK:case Rn.NUM_PLUS:case Rn.NUM_MINUS:case Rn.NUM_PERIOD:case Rn.NUM_DIVISION:case Rn.SEMICOLON:case Rn.DASH:case Rn.EQUALS:case Rn.COMMA:case Rn.PERIOD:case Rn.SLASH:case Rn.APOSTROPHE:case Rn.SINGLE_QUOTE:case Rn.OPEN_SQUARE_BRACKET:case Rn.BACKSLASH:case Rn.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},zOt={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"};const jOt=zOt;var UOt=function(e,t){return w.createElement(F3,rt({},e,{ref:t,icon:jOt}))};const qOt=w.forwardRef(UOt);function ch(){ch=function(){return e};var n,e={},t=Object.prototype,i=t.hasOwnProperty,r=Object.defineProperty||function(H,V,$){H[V]=$.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(H,V,$){return Object.defineProperty(H,V,{value:$,enumerable:!0,configurable:!0,writable:!0}),H[V]}try{c({},"")}catch{c=function($,j,Y){return $[j]=Y}}function u(H,V,$,j){var Y=V&&V.prototype instanceof v?V:v,ne=Object.create(Y.prototype),se=new B(j||[]);return r(ne,"_invoke",{value:R(H,$,se)}),ne}function d(H,V,$){try{return{type:"normal",arg:H.call(V,$)}}catch(j){return{type:"throw",arg:j}}}e.wrap=u;var h="suspendedStart",g="suspendedYield",p="executing",m="completed",_={};function v(){}function b(){}function y(){}var C={};c(C,s,function(){return this});var x=Object.getPrototypeOf,k=x&&x(x(F([])));k&&k!==t&&i.call(k,s)&&(C=k);var I=y.prototype=v.prototype=Object.create(C);function L(H){["next","throw","return"].forEach(function(V){c(H,V,function($){return this._invoke(V,$)})})}function D(H,V){function $(Y,ne,se,he){var xe=d(H[Y],H,ne);if(xe.type!=="throw"){var _e=xe.arg,Ie=_e.value;return Ie&&Er(Ie)=="object"&&i.call(Ie,"__await")?V.resolve(Ie.__await).then(function(Re){$("next",Re,se,he)},function(Re){$("throw",Re,se,he)}):V.resolve(Ie).then(function(Re){_e.value=Re,se(_e)},function(Re){return $("throw",Re,se,he)})}he(xe.arg)}var j;r(this,"_invoke",{value:function(ne,se){function he(){return new V(function(xe,_e){$(ne,se,xe,_e)})}return j=j?j.then(he,he):he()}})}function R(H,V,$){var j=h;return function(Y,ne){if(j===p)throw new Error("Generator is already running");if(j===m){if(Y==="throw")throw ne;return{value:n,done:!0}}for($.method=Y,$.arg=ne;;){var se=$.delegate;if(se){var he=P(se,$);if(he){if(he===_)continue;return he}}if($.method==="next")$.sent=$._sent=$.arg;else if($.method==="throw"){if(j===h)throw j=m,$.arg;$.dispatchException($.arg)}else $.method==="return"&&$.abrupt("return",$.arg);j=p;var xe=d(H,V,$);if(xe.type==="normal"){if(j=$.done?m:g,xe.arg===_)continue;return{value:xe.arg,done:$.done}}xe.type==="throw"&&(j=m,$.method="throw",$.arg=xe.arg)}}}function P(H,V){var $=V.method,j=H.iterator[$];if(j===n)return V.delegate=null,$==="throw"&&H.iterator.return&&(V.method="return",V.arg=n,P(H,V),V.method==="throw")||$!=="return"&&(V.method="throw",V.arg=new TypeError("The iterator does not provide a '"+$+"' method")),_;var Y=d(j,H.iterator,V.arg);if(Y.type==="throw")return V.method="throw",V.arg=Y.arg,V.delegate=null,_;var ne=Y.arg;return ne?ne.done?(V[H.resultName]=ne.value,V.next=H.nextLoc,V.method!=="return"&&(V.method="next",V.arg=n),V.delegate=null,_):ne:(V.method="throw",V.arg=new TypeError("iterator result is not an object"),V.delegate=null,_)}function M(H){var V={tryLoc:H[0]};1 in H&&(V.catchLoc=H[1]),2 in H&&(V.finallyLoc=H[2],V.afterLoc=H[3]),this.tryEntries.push(V)}function O(H){var V=H.completion||{};V.type="normal",delete V.arg,H.completion=V}function B(H){this.tryEntries=[{tryLoc:"root"}],H.forEach(M,this),this.reset(!0)}function F(H){if(H||H===""){var V=H[s];if(V)return V.call(H);if(typeof H.next=="function")return H;if(!isNaN(H.length)){var $=-1,j=function Y(){for(;++$<H.length;)if(i.call(H,$))return Y.value=H[$],Y.done=!1,Y;return Y.value=n,Y.done=!0,Y};return j.next=j}}throw new TypeError(Er(H)+" is not iterable")}return b.prototype=y,r(I,"constructor",{value:y,configurable:!0}),r(y,"constructor",{value:b,configurable:!0}),b.displayName=c(y,l,"GeneratorFunction"),e.isGeneratorFunction=function(H){var V=typeof H=="function"&&H.constructor;return!!V&&(V===b||(V.displayName||V.name)==="GeneratorFunction")},e.mark=function(H){return Object.setPrototypeOf?Object.setPrototypeOf(H,y):(H.__proto__=y,c(H,l,"GeneratorFunction")),H.prototype=Object.create(I),H},e.awrap=function(H){return{__await:H}},L(D.prototype),c(D.prototype,a,function(){return this}),e.AsyncIterator=D,e.async=function(H,V,$,j,Y){Y===void 0&&(Y=Promise);var ne=new D(u(H,V,$,j),Y);return e.isGeneratorFunction(V)?ne:ne.next().then(function(se){return se.done?se.value:ne.next()})},L(I),c(I,l,"Generator"),c(I,s,function(){return this}),c(I,"toString",function(){return"[object Generator]"}),e.keys=function(H){var V=Object(H),$=[];for(var j in V)$.push(j);return $.reverse(),function Y(){for(;$.length;){var ne=$.pop();if(ne in V)return Y.value=ne,Y.done=!1,Y}return Y.done=!0,Y}},e.values=F,B.prototype={constructor:B,reset:function(V){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(O),!V)for(var $ in this)$.charAt(0)==="t"&&i.call(this,$)&&!isNaN(+$.slice(1))&&(this[$]=n)},stop:function(){this.done=!0;var V=this.tryEntries[0].completion;if(V.type==="throw")throw V.arg;return this.rval},dispatchException:function(V){if(this.done)throw V;var $=this;function j(_e,Ie){return se.type="throw",se.arg=V,$.next=_e,Ie&&($.method="next",$.arg=n),!!Ie}for(var Y=this.tryEntries.length-1;Y>=0;--Y){var ne=this.tryEntries[Y],se=ne.completion;if(ne.tryLoc==="root")return j("end");if(ne.tryLoc<=this.prev){var he=i.call(ne,"catchLoc"),xe=i.call(ne,"finallyLoc");if(he&&xe){if(this.prev<ne.catchLoc)return j(ne.catchLoc,!0);if(this.prev<ne.finallyLoc)return j(ne.finallyLoc)}else if(he){if(this.prev<ne.catchLoc)return j(ne.catchLoc,!0)}else{if(!xe)throw new Error("try statement without catch or finally");if(this.prev<ne.finallyLoc)return j(ne.finallyLoc)}}}},abrupt:function(V,$){for(var j=this.tryEntries.length-1;j>=0;--j){var Y=this.tryEntries[j];if(Y.tryLoc<=this.prev&&i.call(Y,"finallyLoc")&&this.prev<Y.finallyLoc){var ne=Y;break}}ne&&(V==="break"||V==="continue")&&ne.tryLoc<=$&&$<=ne.finallyLoc&&(ne=null);var se=ne?ne.completion:{};return se.type=V,se.arg=$,ne?(this.method="next",this.next=ne.finallyLoc,_):this.complete(se)},complete:function(V,$){if(V.type==="throw")throw V.arg;return V.type==="break"||V.type==="continue"?this.next=V.arg:V.type==="return"?(this.rval=this.arg=V.arg,this.method="return",this.next="end"):V.type==="normal"&&$&&(this.next=$),_},finish:function(V){for(var $=this.tryEntries.length-1;$>=0;--$){var j=this.tryEntries[$];if(j.finallyLoc===V)return this.complete(j.completion,j.afterLoc),O(j),_}},catch:function(V){for(var $=this.tryEntries.length-1;$>=0;--$){var j=this.tryEntries[$];if(j.tryLoc===V){var Y=j.completion;if(Y.type==="throw"){var ne=Y.arg;O(j)}return ne}}throw new Error("illegal catch attempt")},delegateYield:function(V,$,j){return this.delegate={iterator:F(V),resultName:$,nextLoc:j},this.method==="next"&&(this.arg=n),_}},e}function ixe(n,e,t,i,r,o,s){try{var a=n[o](s),l=a.value}catch(c){t(c);return}a.done?e(l):Promise.resolve(l).then(i,r)}function Sk(n){return function(){var e=this,t=arguments;return new Promise(function(i,r){var o=n.apply(e,t);function s(l){ixe(o,i,r,s,a,"next",l)}function a(l){ixe(o,i,r,s,a,"throw",l)}s(void 0)})}}var B3=Qe({},Alt),KOt=B3.version,GOt=B3.render,YOt=B3.unmountComponentAtNode,Sj;try{var QOt=Number((KOt||"").split(".")[0]);QOt>=18&&(Sj=B3.createRoot)}catch{}function rxe(n){var e=B3.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&Er(e)==="object"&&(e.usingClientEntryPoint=n)}var N7="__rc_react_root__";function XOt(n,e){rxe(!0);var t=e[N7]||Sj(e);rxe(!1),t.render(n),e[N7]=t}function ZOt(n,e){GOt(n,e)}function JOt(n,e){if(Sj){XOt(n,e);return}ZOt(n,e)}function ePt(n){return nie.apply(this,arguments)}function nie(){return nie=Sk(ch().mark(function n(e){return ch().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",Promise.resolve().then(function(){var r;(r=e[N7])===null||r===void 0||r.unmount(),delete e[N7]}));case 1:case"end":return i.stop()}},n)})),nie.apply(this,arguments)}function tPt(n){YOt(n)}function nPt(n){return iie.apply(this,arguments)}function iie(){return iie=Sk(ch().mark(function n(e){return ch().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(Sj===void 0){i.next=2;break}return i.abrupt("return",ePt(e));case 2:tPt(e);case 3:case"end":return i.stop()}},n)})),iie.apply(this,arguments)}const ige=function(n){if(!n)return!1;if(n instanceof Element){if(n.offsetParent)return!0;if(n.getBBox){var e=n.getBBox(),t=e.width,i=e.height;if(t||i)return!0}if(n.getBoundingClientRect){var r=n.getBoundingClientRect(),o=r.width,s=r.height;if(o||s)return!0}}return!1},iPt=n=>{const{componentCls:e,colorPrimary:t}=n;return{[e]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:`var(--wave-color, ${t})`,boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:[`box-shadow 0.4s ${n.motionEaseOutCirc}`,`opacity 2s ${n.motionEaseOutCirc}`].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0},"&.wave-quick":{transition:[`box-shadow 0.3s ${n.motionEaseInOut}`,`opacity 0.35s ${n.motionEaseInOut}`].join(",")}}}}},rPt=eA("Wave",n=>[iPt(n)]);function oPt(n){const e=(n||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return e&&e[1]&&e[2]&&e[3]?!(e[1]===e[2]&&e[2]===e[3]):!0}function WQ(n){return n&&n!=="#fff"&&n!=="#ffffff"&&n!=="rgb(255, 255, 255)"&&n!=="rgba(255, 255, 255, 1)"&&oPt(n)&&!/rgba\((?:\d*, ){3}0\)/.test(n)&&n!=="transparent"}function sPt(n){const{borderTopColor:e,borderColor:t,backgroundColor:i}=getComputedStyle(n);return WQ(e)?e:WQ(t)?t:WQ(i)?i:null}const u$e="ant-wave-target";function zQ(n){return Number.isNaN(n)?0:n}const aPt=n=>{const{className:e,target:t,component:i}=n,r=w.useRef(null),[o,s]=w.useState(null),[a,l]=w.useState([]),[c,u]=w.useState(0),[d,h]=w.useState(0),[g,p]=w.useState(0),[m,_]=w.useState(0),[v,b]=w.useState(!1),y={left:c,top:d,width:g,height:m,borderRadius:a.map(k=>`${k}px`).join(" ")};o&&(y["--wave-color"]=o);function C(){const k=getComputedStyle(t);s(sPt(t));const I=k.position==="static",{borderLeftWidth:L,borderTopWidth:D}=k;u(I?t.offsetLeft:zQ(-parseFloat(L))),h(I?t.offsetTop:zQ(-parseFloat(D))),p(t.offsetWidth),_(t.offsetHeight);const{borderTopLeftRadius:R,borderTopRightRadius:P,borderBottomLeftRadius:M,borderBottomRightRadius:O}=k;l([R,P,O,M].map(B=>zQ(parseFloat(B))))}if(w.useEffect(()=>{if(t){const k=af(()=>{C(),b(!0)});let I;return typeof ResizeObserver<"u"&&(I=new ResizeObserver(C),I.observe(t)),()=>{af.cancel(k),I==null||I.disconnect()}}},[]),!v)return null;const x=(i==="Checkbox"||i==="Radio")&&(t==null?void 0:t.classList.contains(u$e));return w.createElement(M3,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(k,I)=>{var L;if(I.deadline||I.propertyName==="opacity"){const D=(L=r.current)===null||L===void 0?void 0:L.parentElement;nPt(D).then(()=>{D==null||D.remove()})}return!1}},k=>{let{className:I}=k;return w.createElement("div",{ref:r,className:St(e,{"wave-quick":x},I),style:y})})},lPt=(n,e)=>{var t;const{component:i}=e;if(i==="Checkbox"&&!(!((t=n.querySelector("input"))===null||t===void 0)&&t.checked))return;const r=document.createElement("div");r.style.position="absolute",r.style.left="0px",r.style.top="0px",n==null||n.insertBefore(r,n==null?void 0:n.firstChild),JOt(w.createElement(aPt,Object.assign({},e,{target:n})),r)},cPt=lPt;function uPt(n,e,t){const{wave:i}=w.useContext(Jp),[,r,o]=P3(),s=Wm(c=>{const u=n.current;if(i!=null&&i.disabled||!u)return;const d=u.querySelector(`.${u$e}`)||u,{showEffect:h}=i||{};(h||cPt)(d,{className:e,token:r,component:t,event:c,hashId:o})}),a=w.useRef();return c=>{af.cancel(a.current),a.current=af(()=>{s(c)})}}const dPt=n=>{const{children:e,disabled:t,component:i}=n,{getPrefixCls:r}=w.useContext(Jp),o=w.useRef(null),s=r("wave"),[,a]=rPt(s),l=uPt(o,St(s,a),i);if(te.useEffect(()=>{const u=o.current;if(!u||u.nodeType!==1||t)return;const d=h=>{!ige(h.target)||!u.getAttribute||u.getAttribute("disabled")||u.disabled||u.className.includes("disabled")||u.className.includes("-leave")||l(h)};return u.addEventListener("click",d,!0),()=>{u.removeEventListener("click",d,!0)}},[t]),!te.isValidElement(e))return e??null;const c=O3(e)?mj(e.ref,o):o;return c$e(e,{ref:c})},hPt=dPt,fPt=n=>{const e=te.useContext(yj);return te.useMemo(()=>n?typeof n=="string"?n??e:n instanceof Function?n(e):e:e,[n,e])},rge=fPt;globalThis&&globalThis.__rest;const gPt=w.createContext(null),oge=(n,e)=>{const t=w.useContext(gPt),i=w.useMemo(()=>{if(!t)return"";const{compactDirection:r,isFirstItem:o,isLastItem:s}=t,a=r==="vertical"?"-vertical-":"-";return St(`${n}-compact${a}item`,{[`${n}-compact${a}first-item`]:o,[`${n}-compact${a}last-item`]:s,[`${n}-compact${a}item-rtl`]:e==="rtl"})},[n,e,t]);return{compactSize:t==null?void 0:t.compactSize,compactDirection:t==null?void 0:t.compactDirection,compactItemClassnames:i}};var pPt=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};const d$e=w.createContext(void 0),mPt=n=>{const{getPrefixCls:e,direction:t}=w.useContext(Jp),{prefixCls:i,size:r,className:o}=n,s=pPt(n,["prefixCls","size","className"]),a=e("btn-group",i),[,,l]=P3();let c="";switch(r){case"large":c="lg";break;case"small":c="sm";break}const u=St(a,{[`${a}-${c}`]:c,[`${a}-rtl`]:t==="rtl"},o,l);return w.createElement(d$e.Provider,{value:r},w.createElement("div",Object.assign({},s,{className:u})))},_Pt=mPt,oxe=/^[\u4e00-\u9fa5]{2}$/,rie=oxe.test.bind(oxe);function sxe(n){return typeof n=="string"}function jQ(n){return n==="text"||n==="link"}function vPt(n,e){if(n==null)return;const t=e?" ":"";return typeof n!="string"&&typeof n!="number"&&sxe(n.type)&&rie(n.props.children)?c$e(n,{children:n.props.children.split("").join(t)}):sxe(n)?rie(n)?te.createElement("span",null,n.split("").join(t)):te.createElement("span",null,n):HOt(n)?te.createElement("span",null,n):n}function bPt(n,e){let t=!1;const i=[];return te.Children.forEach(n,r=>{const o=typeof r,s=o==="string"||o==="number";if(t&&s){const a=i.length-1,l=i[a];i[a]=`${l}${r}`}else i.push(r);t=s}),te.Children.map(i,r=>vPt(r,e))}const yPt=w.forwardRef((n,e)=>{const{className:t,style:i,children:r,prefixCls:o}=n,s=St(`${o}-icon`,t);return te.createElement("span",{ref:e,className:s,style:i},r)}),h$e=yPt,axe=w.forwardRef((n,e)=>{let{prefixCls:t,className:i,style:r,iconClassName:o}=n;const s=St(`${t}-loading-icon`,i);return te.createElement(h$e,{prefixCls:t,className:s,style:r,ref:e},te.createElement(qOt,{className:o}))}),UQ=()=>({width:0,opacity:0,transform:"scale(0)"}),qQ=n=>({width:n.scrollWidth,opacity:1,transform:"scale(1)"}),CPt=n=>{const{prefixCls:e,loading:t,existIcon:i,className:r,style:o}=n,s=!!t;return i?te.createElement(axe,{prefixCls:e,className:r,style:o}):te.createElement(M3,{visible:s,motionName:`${e}-loading-icon-motion`,motionLeave:s,removeOnLeave:!0,onAppearStart:UQ,onAppearActive:qQ,onEnterStart:UQ,onEnterActive:qQ,onLeaveStart:qQ,onLeaveActive:UQ},(a,l)=>{let{className:c,style:u}=a;return te.createElement(axe,{prefixCls:e,className:r,style:Object.assign(Object.assign({},o),u),ref:l,iconClassName:c})})},wPt=CPt,lxe=(n,e)=>({[`> span, > ${n}`]:{"&:not(:last-child)":{[`&, & > ${n}`]:{"&:not(:disabled)":{borderInlineEndColor:e}}},"&:not(:first-child)":{[`&, & > ${n}`]:{"&:not(:disabled)":{borderInlineStartColor:e}}}}}),SPt=n=>{const{componentCls:e,fontSize:t,lineWidth:i,groupBorderColor:r,colorErrorHover:o}=n;return{[`${e}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:-i,[`&, & > ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[e]:{position:"relative",zIndex:1,"&:hover,\n &:focus,\n &:active":{zIndex:2},"&[disabled]":{zIndex:0}},[`${e}-icon-only`]:{fontSize:t}},lxe(`${e}-primary`,r),lxe(`${e}-danger`,o)]}},EPt=SPt,xPt=n=>{const{componentCls:e,iconCls:t,fontWeight:i}=n;return{[e]:{outline:"none",position:"relative",display:"inline-block",fontWeight:i,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",backgroundColor:"transparent",border:`${n.lineWidth}px ${n.lineType} transparent`,cursor:"pointer",transition:`all ${n.motionDurationMid} ${n.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation",lineHeight:n.lineHeight,color:n.colorText,"&:disabled > *":{pointerEvents:"none"},"> span":{display:"inline-block"},[`${e}-icon`]:{lineHeight:0},[`> ${t} + span, > span + ${t}`]:{marginInlineStart:n.marginXS},[`&:not(${e}-icon-only) > ${e}-icon`]:{[`&${e}-loading-icon, &:not(:last-child)`]:{marginInlineEnd:n.marginXS}},"> a":{color:"currentColor"},"&:not(:disabled)":Object.assign({},WNt(n)),[`&${e}-two-chinese-chars::first-letter`]:{letterSpacing:"0.34em"},[`&${e}-two-chinese-chars > *:not(${t})`]:{marginInlineEnd:"-0.34em",letterSpacing:"0.34em"},[`&-icon-only${e}-compact-item`]:{flex:"none"},[`&-compact-item${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:-n.lineWidth,insetInlineStart:-n.lineWidth,display:"inline-block",width:n.lineWidth,height:`calc(100% + ${n.lineWidth*2}px)`,backgroundColor:n.colorPrimaryHover,content:'""'}}},"&-compact-vertical-item":{[`&${e}-primary`]:{[`&:not([disabled]) + ${e}-compact-vertical-item${e}-primary:not([disabled])`]:{position:"relative","&:before":{position:"absolute",top:-n.lineWidth,insetInlineStart:-n.lineWidth,display:"inline-block",width:`calc(100% + ${n.lineWidth*2}px)`,height:n.lineWidth,backgroundColor:n.colorPrimaryHover,content:'""'}}}}}}},p0=(n,e,t)=>({[`&:not(:disabled):not(${n}-disabled)`]:{"&:hover":e,"&:active":t}}),kPt=n=>({minWidth:n.controlHeight,paddingInlineStart:0,paddingInlineEnd:0,borderRadius:"50%"}),TPt=n=>({borderRadius:n.controlHeight,paddingInlineStart:n.controlHeight/2,paddingInlineEnd:n.controlHeight/2}),IPt=n=>({cursor:"not-allowed",borderColor:n.borderColorDisabled,color:n.colorTextDisabled,backgroundColor:n.colorBgContainerDisabled,boxShadow:"none"}),qP=(n,e,t,i,r,o,s,a)=>({[`&${n}-background-ghost`]:Object.assign(Object.assign({color:t||void 0,backgroundColor:e,borderColor:i||void 0,boxShadow:"none"},p0(n,Object.assign({backgroundColor:e},s),Object.assign({backgroundColor:e},a))),{"&:disabled":{cursor:"not-allowed",color:r||void 0,borderColor:o||void 0}})}),sge=n=>({[`&:disabled, &${n.componentCls}-disabled`]:Object.assign({},IPt(n))}),f$e=n=>Object.assign({},sge(n)),O7=n=>({[`&:disabled, &${n.componentCls}-disabled`]:{cursor:"not-allowed",color:n.colorTextDisabled}}),g$e=n=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},f$e(n)),{backgroundColor:n.defaultBg,borderColor:n.defaultBorderColor,color:n.defaultColor,boxShadow:n.defaultShadow}),p0(n.componentCls,{color:n.colorPrimaryHover,borderColor:n.colorPrimaryHover},{color:n.colorPrimaryActive,borderColor:n.colorPrimaryActive})),qP(n.componentCls,n.ghostBg,n.defaultGhostColor,n.defaultGhostBorderColor,n.colorTextDisabled,n.colorBorder)),{[`&${n.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({color:n.colorError,borderColor:n.colorError},p0(n.componentCls,{color:n.colorErrorHover,borderColor:n.colorErrorBorderHover},{color:n.colorErrorActive,borderColor:n.colorErrorActive})),qP(n.componentCls,n.ghostBg,n.colorError,n.colorError,n.colorTextDisabled,n.colorBorder)),sge(n))}),LPt=n=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},f$e(n)),{color:n.primaryColor,backgroundColor:n.colorPrimary,boxShadow:n.primaryShadow}),p0(n.componentCls,{color:n.colorTextLightSolid,backgroundColor:n.colorPrimaryHover},{color:n.colorTextLightSolid,backgroundColor:n.colorPrimaryActive})),qP(n.componentCls,n.ghostBg,n.colorPrimary,n.colorPrimary,n.colorTextDisabled,n.colorBorder,{color:n.colorPrimaryHover,borderColor:n.colorPrimaryHover},{color:n.colorPrimaryActive,borderColor:n.colorPrimaryActive})),{[`&${n.componentCls}-dangerous`]:Object.assign(Object.assign(Object.assign({backgroundColor:n.colorError,boxShadow:n.dangerShadow,color:n.dangerColor},p0(n.componentCls,{backgroundColor:n.colorErrorHover},{backgroundColor:n.colorErrorActive})),qP(n.componentCls,n.ghostBg,n.colorError,n.colorError,n.colorTextDisabled,n.colorBorder,{color:n.colorErrorHover,borderColor:n.colorErrorHover},{color:n.colorErrorActive,borderColor:n.colorErrorActive})),sge(n))}),DPt=n=>Object.assign(Object.assign({},g$e(n)),{borderStyle:"dashed"}),APt=n=>Object.assign(Object.assign(Object.assign({color:n.colorLink},p0(n.componentCls,{color:n.colorLinkHover,backgroundColor:n.linkHoverBg},{color:n.colorLinkActive})),O7(n)),{[`&${n.componentCls}-dangerous`]:Object.assign(Object.assign({color:n.colorError},p0(n.componentCls,{color:n.colorErrorHover},{color:n.colorErrorActive})),O7(n))}),RPt=n=>Object.assign(Object.assign(Object.assign({},p0(n.componentCls,{color:n.colorText,backgroundColor:n.textHoverBg},{color:n.colorText,backgroundColor:n.colorBgTextActive})),O7(n)),{[`&${n.componentCls}-dangerous`]:Object.assign(Object.assign({color:n.colorError},O7(n)),p0(n.componentCls,{color:n.colorErrorHover,backgroundColor:n.colorErrorBg},{color:n.colorErrorHover,backgroundColor:n.colorErrorBg}))}),NPt=n=>{const{componentCls:e}=n;return{[`${e}-default`]:g$e(n),[`${e}-primary`]:LPt(n),[`${e}-dashed`]:DPt(n),[`${e}-link`]:APt(n),[`${e}-text`]:RPt(n),[`${e}-ghost`]:qP(n.componentCls,n.ghostBg,n.colorBgContainer,n.colorBgContainer,n.colorTextDisabled,n.colorBorder)}},age=function(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const{componentCls:t,controlHeight:i,fontSize:r,lineHeight:o,lineWidth:s,borderRadius:a,buttonPaddingHorizontal:l,iconCls:c}=n,u=Math.max(0,(i-r*o)/2-s),d=`${t}-icon-only`;return[{[`${t}${e}`]:{fontSize:r,height:i,padding:`${u}px ${l}px`,borderRadius:a,[`&${d}`]:{width:i,paddingInlineStart:0,paddingInlineEnd:0,[`&${t}-round`]:{width:"auto"},[c]:{fontSize:n.buttonIconOnlyFontSize}},[`&${t}-loading`]:{opacity:n.opacityLoading,cursor:"default"},[`${t}-loading-icon`]:{transition:`width ${n.motionDurationSlow} ${n.motionEaseInOut}, opacity ${n.motionDurationSlow} ${n.motionEaseInOut}`}}},{[`${t}${t}-circle${e}`]:kPt(n)},{[`${t}${t}-round${e}`]:TPt(n)}]},OPt=n=>age(lh(n,{fontSize:n.contentFontSize})),PPt=n=>{const e=lh(n,{controlHeight:n.controlHeightSM,fontSize:n.contentFontSizeSM,padding:n.paddingXS,buttonPaddingHorizontal:n.paddingInlineSM,borderRadius:n.borderRadiusSM,buttonIconOnlyFontSize:n.onlyIconSizeSM});return age(e,`${n.componentCls}-sm`)},MPt=n=>{const e=lh(n,{controlHeight:n.controlHeightLG,fontSize:n.contentFontSizeLG,buttonPaddingHorizontal:n.paddingInlineLG,borderRadius:n.borderRadiusLG,buttonIconOnlyFontSize:n.onlyIconSizeLG});return age(e,`${n.componentCls}-lg`)},FPt=n=>{const{componentCls:e}=n;return{[e]:{[`&${e}-block`]:{width:"100%"}}}},p$e=n=>{const{paddingInline:e,onlyIconSize:t}=n;return lh(n,{buttonPaddingHorizontal:e,buttonIconOnlyFontSize:t})},m$e=n=>({fontWeight:400,defaultShadow:`0 ${n.controlOutlineWidth}px 0 ${n.controlTmpOutline}`,primaryShadow:`0 ${n.controlOutlineWidth}px 0 ${n.controlOutline}`,dangerShadow:`0 ${n.controlOutlineWidth}px 0 ${n.colorErrorOutline}`,primaryColor:n.colorTextLightSolid,dangerColor:n.colorTextLightSolid,borderColorDisabled:n.colorBorder,defaultGhostColor:n.colorBgContainer,ghostBg:"transparent",defaultGhostBorderColor:n.colorBgContainer,paddingInline:n.paddingContentHorizontal-n.lineWidth,paddingInlineLG:n.paddingContentHorizontal-n.lineWidth,paddingInlineSM:8-n.lineWidth,onlyIconSize:n.fontSizeLG,onlyIconSizeSM:n.fontSizeLG-2,onlyIconSizeLG:n.fontSizeLG+2,groupBorderColor:n.colorPrimaryHover,linkHoverBg:"transparent",textHoverBg:n.colorBgTextHover,defaultColor:n.colorText,defaultBg:n.colorBgContainer,defaultBorderColor:n.colorBorder,defaultBorderColorDisabled:n.colorBorder,contentFontSize:n.fontSize,contentFontSizeSM:n.fontSize,contentFontSizeLG:n.fontSizeLG}),BPt=eA("Button",n=>{const e=p$e(n);return[xPt(e),PPt(e),OPt(e),MPt(e),FPt(e),NPt(e),EPt(e)]},m$e);function $Pt(n,e,t){const{focusElCls:i,focus:r,borderElCls:o}=t,s=o?"> *":"",a=["hover",r?"focus":null,"active"].filter(Boolean).map(l=>`&:${l} ${s}`).join(",");return{[`&-item:not(${e}-last-item)`]:{marginInlineEnd:-n.lineWidth},"&-item":Object.assign(Object.assign({[a]:{zIndex:2}},i?{[`&${i}`]:{zIndex:2}}:{}),{[`&[disabled] ${s}`]:{zIndex:0}})}}function VPt(n,e,t){const{borderElCls:i}=t,r=i?`> ${i}`:"";return{[`&-item:not(${e}-first-item):not(${e}-last-item) ${r}`]:{borderRadius:0},[`&-item:not(${e}-last-item)${e}-first-item`]:{[`& ${r}, &${n}-sm ${r}, &${n}-lg ${r}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${e}-first-item)${e}-last-item`]:{[`& ${r}, &${n}-sm ${r}, &${n}-lg ${r}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function lge(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{focus:!0};const{componentCls:t}=n,i=`${t}-compact`;return{[i]:Object.assign(Object.assign({},$Pt(n,i,e)),VPt(t,i,e))}}function HPt(n,e){return{[`&-item:not(${e}-last-item)`]:{marginBottom:-n.lineWidth},"&-item":{"&:hover,&:focus,&:active":{zIndex:2},"&[disabled]":{zIndex:0}}}}function WPt(n,e){return{[`&-item:not(${e}-first-item):not(${e}-last-item)`]:{borderRadius:0},[`&-item${e}-first-item:not(${e}-last-item)`]:{[`&, &${n}-sm, &${n}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${e}-last-item:not(${e}-first-item)`]:{[`&, &${n}-sm, &${n}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function zPt(n){const e=`${n.componentCls}-compact-vertical`;return{[e]:Object.assign(Object.assign({},HPt(n,e)),WPt(n.componentCls,e))}}const jPt=qNt(["Button","compact"],n=>{const e=p$e(n);return[lge(e),zPt(e)]},m$e);var UPt=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};function qPt(n){if(typeof n=="object"&&n){let e=n==null?void 0:n.delay;return e=!Number.isNaN(e)&&typeof e=="number"?e:0,{loading:e<=0,delay:e}}return{loading:!!n,delay:0}}const KPt=(n,e)=>{var t,i;const{loading:r=!1,prefixCls:o,type:s="default",danger:a,shape:l="default",size:c,styles:u,disabled:d,className:h,rootClassName:g,children:p,icon:m,ghost:_=!1,block:v=!1,htmlType:b="button",classNames:y,style:C={}}=n,x=UPt(n,["loading","prefixCls","type","danger","shape","size","styles","disabled","className","rootClassName","children","icon","ghost","block","htmlType","classNames","style"]),{getPrefixCls:k,autoInsertSpaceInButton:I,direction:L,button:D}=w.useContext(Jp),R=k("btn",o),[P,M]=BPt(R),O=w.useContext(bj),B=d??O,F=w.useContext(d$e),H=w.useMemo(()=>qPt(r),[r]),[V,$]=w.useState(H.loading),[j,Y]=w.useState(!1),se=mj(e,w.createRef()),he=w.Children.count(p)===1&&!m&&!jQ(s);w.useEffect(()=>{let pe=null;H.delay>0?pe=setTimeout(()=>{pe=null,$(!0)},H.delay):$(H.loading);function me(){pe&&(clearTimeout(pe),pe=null)}return me},[H]),w.useEffect(()=>{if(!se||!se.current||I===!1)return;const pe=se.current.textContent;he&&rie(pe)?j||Y(!0):j&&Y(!1)},[se]);const xe=pe=>{const{onClick:me}=n;if(V||B){pe.preventDefault();return}me==null||me(pe)},_e=I!==!1,{compactSize:Ie,compactItemClassnames:Re}=oge(R,L),Ye={large:"lg",small:"sm",middle:void 0},Ze=rge(pe=>{var me,Z;return(Z=(me=c??Ie)!==null&&me!==void 0?me:F)!==null&&Z!==void 0?Z:pe}),tt=Ze&&Ye[Ze]||"",Be=V?"loading":m,kt=GAt(x,["navigate"]),Vt=St(R,M,{[`${R}-${l}`]:l!=="default"&&l,[`${R}-${s}`]:s,[`${R}-${tt}`]:tt,[`${R}-icon-only`]:!p&&p!==0&&!!Be,[`${R}-background-ghost`]:_&&!jQ(s),[`${R}-loading`]:V,[`${R}-two-chinese-chars`]:j&&_e&&!V,[`${R}-block`]:v,[`${R}-dangerous`]:!!a,[`${R}-rtl`]:L==="rtl"},Re,h,g,D==null?void 0:D.className),xt=Object.assign(Object.assign({},D==null?void 0:D.style),C),Kt=St(y==null?void 0:y.icon,(t=D==null?void 0:D.classNames)===null||t===void 0?void 0:t.icon),cn=Object.assign(Object.assign({},(u==null?void 0:u.icon)||{}),((i=D==null?void 0:D.styles)===null||i===void 0?void 0:i.icon)||{}),wn=m&&!V?te.createElement(h$e,{prefixCls:R,className:Kt,style:cn},m):te.createElement(wPt,{existIcon:!!m,prefixCls:R,loading:!!V}),on=p||p===0?bPt(p,he&&_e):null;if(kt.href!==void 0)return P(te.createElement("a",Object.assign({},kt,{className:St(Vt,{[`${R}-disabled`]:B}),style:xt,onClick:xe,ref:se}),wn,on));let Zt=te.createElement("button",Object.assign({},x,{type:b,className:Vt,style:xt,onClick:xe,disabled:B,ref:se}),wn,on,Re&&te.createElement(jPt,{key:"compact",prefixCls:R}));return jQ(s)||(Zt=te.createElement(hPt,{component:"Button",disabled:!!V},Zt)),P(Zt)},cge=w.forwardRef(KPt);cge.Group=_Pt;cge.__ANT_BUTTON=!0;const GPt=cge;var _$e=w.createContext(null),cxe=[];function YPt(n,e){var t=w.useState(function(){if(!lf())return null;var p=document.createElement("div");return p}),i=$t(t,1),r=i[0],o=w.useRef(!1),s=w.useContext(_$e),a=w.useState(cxe),l=$t(a,2),c=l[0],u=l[1],d=s||(o.current?void 0:function(p){u(function(m){var _=[p].concat(Ir(m));return _})});function h(){r.parentElement||document.body.appendChild(r),o.current=!0}function g(){var p;(p=r.parentElement)===null||p===void 0||p.removeChild(r),o.current=!1}return wd(function(){return n?s?s(h):h():g(),g},[n]),wd(function(){c.length&&(c.forEach(function(p){return p()}),u(cxe))},[c]),[r,d]}var KQ;function QPt(n){if(typeof document>"u")return 0;if(n||KQ===void 0){var e=document.createElement("div");e.style.width="100%",e.style.height="200px";var t=document.createElement("div"),i=t.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",t.appendChild(e),document.body.appendChild(t);var r=e.offsetWidth;t.style.overflow="scroll";var o=e.offsetWidth;r===o&&(o=t.clientWidth),document.body.removeChild(t),KQ=r-o}return KQ}function uxe(n){var e=n.match(/^(.*)px$/),t=Number(e==null?void 0:e[1]);return Number.isNaN(t)?QPt():t}function XPt(n){if(typeof document>"u"||!n||!(n instanceof Element))return{width:0,height:0};var e=getComputedStyle(n,"::-webkit-scrollbar"),t=e.width,i=e.height;return{width:uxe(t),height:uxe(i)}}function ZPt(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var JPt="rc-util-locker-".concat(Date.now()),dxe=0;function eMt(n){var e=!!n,t=w.useState(function(){return dxe+=1,"".concat(JPt,"_").concat(dxe)}),i=$t(t,1),r=i[0];wd(function(){if(e){var o=XPt(document.body).width,s=ZPt();ED(`
html body {
overflow-y: hidden;
`.concat(s?"width: calc(100% - ".concat(o,"px);"):"",`
}`),r)}else L7(r);return function(){L7(r)}},[e,r])}var hxe=!1;function tMt(n){return typeof n=="boolean"&&(hxe=n),hxe}var fxe=function(e){return e===!1?!1:!lf()||!e?null:typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e},v$e=w.forwardRef(function(n,e){var t=n.open,i=n.autoLock,r=n.getContainer;n.debug;var o=n.autoDestroy,s=o===void 0?!0:o,a=n.children,l=w.useState(t),c=$t(l,2),u=c[0],d=c[1],h=u||t;w.useEffect(function(){(s||t)&&d(t)},[t,s]);var g=w.useState(function(){return fxe(r)}),p=$t(g,2),m=p[0],_=p[1];w.useEffect(function(){var P=fxe(r);_(P??null)});var v=YPt(h&&!m),b=$t(v,2),y=b[0],C=b[1],x=m??y;eMt(i&&t&&lf()&&(x===y||x===document.body));var k=null;if(a&&O3(a)&&e){var I=a;k=I.ref}var L=qfe(k,e);if(!h||!lf()||m===void 0)return null;var D=x===!1||tMt(),R=a;return e&&(R=w.cloneElement(a,{ref:L})),w.createElement(_$e.Provider,{value:C},D?R:Yp.createPortal(R,x))});function nMt(){var n=Qe({},Rp);return n.useId}var gxe=0,pxe=nMt();const iMt=pxe?function(e){var t=pxe();return e||t}:function(e){var t=w.useState("ssr-id"),i=$t(t,2),r=i[0],o=i[1];return w.useEffect(function(){var s=gxe;gxe+=1,o("rc_unique_".concat(s))},[]),e||r};var wE="RC_FORM_INTERNAL_HOOKS",Hs=function(){Uu(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},kD=w.createContext({getFieldValue:Hs,getFieldsValue:Hs,getFieldError:Hs,getFieldWarning:Hs,getFieldsError:Hs,isFieldsTouched:Hs,isFieldTouched:Hs,isFieldValidating:Hs,isFieldsValidating:Hs,resetFields:Hs,setFields:Hs,setFieldValue:Hs,setFieldsValue:Hs,validateFields:Hs,submit:Hs,getInternalHooks:function(){return Hs(),{dispatch:Hs,initEntityValue:Hs,registerField:Hs,useSubscribe:Hs,setInitialValues:Hs,destroyForm:Hs,setCallbacks:Hs,registerWatch:Hs,getFields:Hs,setValidateMessages:Hs,setPreserve:Hs,getInitialValue:Hs}}}),P7=w.createContext(null);function oie(n){return n==null?[]:Array.isArray(n)?n:[n]}function rMt(n){return n&&!!n._init}function SE(){return SE=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},SE.apply(this,arguments)}function oMt(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,KP(n,e)}function sie(n){return sie=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},sie(n)}function KP(n,e){return KP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},KP(n,e)}function sMt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function f8(n,e,t){return sMt()?f8=Reflect.construct.bind():f8=function(r,o,s){var a=[null];a.push.apply(a,o);var l=Function.bind.apply(r,a),c=new l;return s&&KP(c,s.prototype),c},f8.apply(null,arguments)}function aMt(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function aie(n){var e=typeof Map=="function"?new Map:void 0;return aie=function(i){if(i===null||!aMt(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(i))return e.get(i);e.set(i,r)}function r(){return f8(i,arguments,sie(this).constructor)}return r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),KP(r,i)},aie(n)}var lMt=/%[sdj%]/g,cMt=function(){};typeof process<"u"&&process.env;function lie(n){if(!n||!n.length)return null;var e={};return n.forEach(function(t){var i=t.field;e[i]=e[i]||[],e[i].push(t)}),e}function tg(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];var r=0,o=t.length;if(typeof n=="function")return n.apply(null,t);if(typeof n=="string"){var s=n.replace(lMt,function(a){if(a==="%%")return"%";if(r>=o)return a;switch(a){case"%s":return String(t[r++]);case"%d":return Number(t[r++]);case"%j":try{return JSON.stringify(t[r++])}catch{return"[Circular]"}break;default:return a}});return s}return n}function uMt(n){return n==="string"||n==="url"||n==="hex"||n==="email"||n==="date"||n==="pattern"}function Bc(n,e){return!!(n==null||e==="array"&&Array.isArray(n)&&!n.length||uMt(e)&&typeof n=="string"&&!n)}function dMt(n,e,t){var i=[],r=0,o=n.length;function s(a){i.push.apply(i,a||[]),r++,r===o&&t(i)}n.forEach(function(a){e(a,s)})}function mxe(n,e,t){var i=0,r=n.length;function o(s){if(s&&s.length){t(s);return}var a=i;i=i+1,a<r?e(n[a],o):t([])}o([])}function hMt(n){var e=[];return Object.keys(n).forEach(function(t){e.push.apply(e,n[t]||[])}),e}var _xe=function(n){oMt(e,n);function e(t,i){var r;return r=n.call(this,"Async Validation Error")||this,r.errors=t,r.fields=i,r}return e}(aie(Error));function fMt(n,e,t,i,r){if(e.first){var o=new Promise(function(h,g){var p=function(v){return i(v),v.length?g(new _xe(v,lie(v))):h(r)},m=hMt(n);mxe(m,t,p)});return o.catch(function(h){return h}),o}var s=e.firstFields===!0?Object.keys(n):e.firstFields||[],a=Object.keys(n),l=a.length,c=0,u=[],d=new Promise(function(h,g){var p=function(_){if(u.push.apply(u,_),c++,c===l)return i(u),u.length?g(new _xe(u,lie(u))):h(r)};a.length||(i(u),h(r)),a.forEach(function(m){var _=n[m];s.indexOf(m)!==-1?mxe(_,t,p):dMt(_,t,p)})});return d.catch(function(h){return h}),d}function gMt(n){return!!(n&&n.message!==void 0)}function pMt(n,e){for(var t=n,i=0;i<e.length;i++){if(t==null)return t;t=t[e[i]]}return t}function vxe(n,e){return function(t){var i;return n.fullFields?i=pMt(e,n.fullFields):i=e[t.field||n.fullField],gMt(t)?(t.field=t.field||n.fullField,t.fieldValue=i,t):{message:typeof t=="function"?t():t,fieldValue:i,field:t.field||n.fullField}}}function bxe(n,e){if(e){for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];typeof i=="object"&&typeof n[t]=="object"?n[t]=SE({},n[t],i):n[t]=i}}return n}var b$e=function(e,t,i,r,o,s){e.required&&(!i.hasOwnProperty(e.field)||Bc(t,s||e.type))&&r.push(tg(o.messages.required,e.fullField))},mMt=function(e,t,i,r,o){(/^\s+$/.test(t)||t==="")&&r.push(tg(o.messages.whitespace,e.fullField))},R6,_Mt=function(){if(R6)return R6;var n="[a-fA-F\\d:]",e=function(C){return C&&C.includeBoundaries?"(?:(?<=\\s|^)(?="+n+")|(?<="+n+")(?=\\s|$))":""},t="(?: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}",r=(`
(?:
(?:`+i+":){7}(?:"+i+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
(?:`+i+":){6}(?:"+t+"|:"+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
(?:`+i+":){5}(?::"+t+"|(?::"+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
(?:`+i+":){4}(?:(?::"+i+"){0,1}:"+t+"|(?::"+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
(?:`+i+":){3}(?:(?::"+i+"){0,2}:"+t+"|(?::"+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
(?:`+i+":){2}(?:(?::"+i+"){0,3}:"+t+"|(?::"+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
(?:`+i+":){1}(?:(?::"+i+"){0,4}:"+t+"|(?::"+i+`){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
(?::(?:(?::`+i+"){0,5}:"+t+"|(?::"+i+`){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
`).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),o=new RegExp("(?:^"+t+"$)|(?:^"+r+"$)"),s=new RegExp("^"+t+"$"),a=new RegExp("^"+r+"$"),l=function(C){return C&&C.exact?o:new RegExp("(?:"+e(C)+t+e(C)+")|(?:"+e(C)+r+e(C)+")","g")};l.v4=function(y){return y&&y.exact?s:new RegExp(""+e(y)+t+e(y),"g")},l.v6=function(y){return y&&y.exact?a:new RegExp(""+e(y)+r+e(y),"g")};var c="(?:(?:[a-z]+:)?//)",u="(?:\\S+(?::\\S*)?@)?",d=l.v4().source,h=l.v6().source,g="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",p="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",m="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",_="(?::\\d{2,5})?",v='(?:[/?#][^\\s"]*)?',b="(?:"+c+"|www\\.)"+u+"(?:localhost|"+d+"|"+h+"|"+g+p+m+")"+_+v;return R6=new RegExp("(?:^"+b+"$)","i"),R6},yxe={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},_N={integer:function(e){return _N.number(e)&&parseInt(e,10)===e},float:function(e){return _N.number(e)&&!_N.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number:function(e){return isNaN(e)?!1:typeof e=="number"},object:function(e){return typeof e=="object"&&!_N.array(e)},method:function(e){return typeof e=="function"},email:function(e){return typeof e=="string"&&e.length<=320&&!!e.match(yxe.email)},url:function(e){return typeof e=="string"&&e.length<=2048&&!!e.match(_Mt())},hex:function(e){return typeof e=="string"&&!!e.match(yxe.hex)}},vMt=function(e,t,i,r,o){if(e.required&&t===void 0){b$e(e,t,i,r,o);return}var s=["integer","float","array","regexp","object","method","email","number","date","url","hex"],a=e.type;s.indexOf(a)>-1?_N[a](t)||r.push(tg(o.messages.types[a],e.fullField,e.type)):a&&typeof t!==e.type&&r.push(tg(o.messages.types[a],e.fullField,e.type))},bMt=function(e,t,i,r,o){var s=typeof e.len=="number",a=typeof e.min=="number",l=typeof e.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=t,d=null,h=typeof t=="number",g=typeof t=="string",p=Array.isArray(t);if(h?d="number":g?d="string":p&&(d="array"),!d)return!1;p&&(u=t.length),g&&(u=t.replace(c,"_").length),s?u!==e.len&&r.push(tg(o.messages[d].len,e.fullField,e.len)):a&&!l&&u<e.min?r.push(tg(o.messages[d].min,e.fullField,e.min)):l&&!a&&u>e.max?r.push(tg(o.messages[d].max,e.fullField,e.max)):a&&l&&(u<e.min||u>e.max)&&r.push(tg(o.messages[d].range,e.fullField,e.min,e.max))},CT="enum",yMt=function(e,t,i,r,o){e[CT]=Array.isArray(e[CT])?e[CT]:[],e[CT].indexOf(t)===-1&&r.push(tg(o.messages[CT],e.fullField,e[CT].join(", ")))},CMt=function(e,t,i,r,o){if(e.pattern){if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||r.push(tg(o.messages.pattern.mismatch,e.fullField,t,e.pattern));else if(typeof e.pattern=="string"){var s=new RegExp(e.pattern);s.test(t)||r.push(tg(o.messages.pattern.mismatch,e.fullField,t,e.pattern))}}},wo={required:b$e,whitespace:mMt,type:vMt,range:bMt,enum:yMt,pattern:CMt},wMt=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Bc(t,"string")&&!e.required)return i();wo.required(e,t,r,s,o,"string"),Bc(t,"string")||(wo.type(e,t,r,s,o),wo.range(e,t,r,s,o),wo.pattern(e,t,r,s,o),e.whitespace===!0&&wo.whitespace(e,t,r,s,o))}i(s)},SMt=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Bc(t)&&!e.required)return i();wo.required(e,t,r,s,o),t!==void 0&&wo.type(e,t,r,s,o)}i(s)},EMt=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(t===""&&(t=void 0),Bc(t)&&!e.required)return i();wo.required(e,t,r,s,o),t!==void 0&&(wo.type(e,t,r,s,o),wo.range(e,t,r,s,o))}i(s)},xMt=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Bc(t)&&!e.required)return i();wo.required(e,t,r,s,o),t!==void 0&&wo.type(e,t,r,s,o)}i(s)},kMt=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Bc(t)&&!e.required)return i();wo.required(e,t,r,s,o),Bc(t)||wo.type(e,t,r,s,o)}i(s)},TMt=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Bc(t)&&!e.required)return i();wo.required(e,t,r,s,o),t!==void 0&&(wo.type(e,t,r,s,o),wo.range(e,t,r,s,o))}i(s)},IMt=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Bc(t)&&!e.required)return i();wo.required(e,t,r,s,o),t!==void 0&&(wo.type(e,t,r,s,o),wo.range(e,t,r,s,o))}i(s)},LMt=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(t==null&&!e.required)return i();wo.required(e,t,r,s,o,"array"),t!=null&&(wo.type(e,t,r,s,o),wo.range(e,t,r,s,o))}i(s)},DMt=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Bc(t)&&!e.required)return i();wo.required(e,t,r,s,o),t!==void 0&&wo.type(e,t,r,s,o)}i(s)},AMt="enum",RMt=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Bc(t)&&!e.required)return i();wo.required(e,t,r,s,o),t!==void 0&&wo[AMt](e,t,r,s,o)}i(s)},NMt=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Bc(t,"string")&&!e.required)return i();wo.required(e,t,r,s,o),Bc(t,"string")||wo.pattern(e,t,r,s,o)}i(s)},OMt=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Bc(t,"date")&&!e.required)return i();if(wo.required(e,t,r,s,o),!Bc(t,"date")){var l;t instanceof Date?l=t:l=new Date(t),wo.type(e,l,r,s,o),l&&wo.range(e,l.getTime(),r,s,o)}}i(s)},PMt=function(e,t,i,r,o){var s=[],a=Array.isArray(t)?"array":typeof t;wo.required(e,t,r,s,o,a),i(s)},GQ=function(e,t,i,r,o){var s=e.type,a=[],l=e.required||!e.required&&r.hasOwnProperty(e.field);if(l){if(Bc(t,s)&&!e.required)return i();wo.required(e,t,r,a,o,s),Bc(t,s)||wo.type(e,t,r,a,o)}i(a)},MMt=function(e,t,i,r,o){var s=[],a=e.required||!e.required&&r.hasOwnProperty(e.field);if(a){if(Bc(t)&&!e.required)return i();wo.required(e,t,r,s,o)}i(s)},hO={string:wMt,method:SMt,number:EMt,boolean:xMt,regexp:kMt,integer:TMt,float:IMt,array:LMt,object:DMt,enum:RMt,pattern:NMt,date:OMt,url:GQ,hex:GQ,email:GQ,required:PMt,any:MMt};function cie(){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 uie=cie(),$3=function(){function n(t){this.rules=null,this._messages=uie,this.define(t)}var e=n.prototype;return e.define=function(i){var r=this;if(!i)throw new Error("Cannot configure a schema with no rules");if(typeof i!="object"||Array.isArray(i))throw new Error("Rules must be an object");this.rules={},Object.keys(i).forEach(function(o){var s=i[o];r.rules[o]=Array.isArray(s)?s:[s]})},e.messages=function(i){return i&&(this._messages=bxe(cie(),i)),this._messages},e.validate=function(i,r,o){var s=this;r===void 0&&(r={}),o===void 0&&(o=function(){});var a=i,l=r,c=o;if(typeof l=="function"&&(c=l,l={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,a),Promise.resolve(a);function u(m){var _=[],v={};function b(C){if(Array.isArray(C)){var x;_=(x=_).concat.apply(x,C)}else _.push(C)}for(var y=0;y<m.length;y++)b(m[y]);_.length?(v=lie(_),c(_,v)):c(null,a)}if(l.messages){var d=this.messages();d===uie&&(d=cie()),bxe(d,l.messages),l.messages=d}else l.messages=this.messages();var h={},g=l.keys||Object.keys(this.rules);g.forEach(function(m){var _=s.rules[m],v=a[m];_.forEach(function(b){var y=b;typeof y.transform=="function"&&(a===i&&(a=SE({},a)),v=a[m]=y.transform(v)),typeof y=="function"?y={validator:y}:y=SE({},y),y.validator=s.getValidationMethod(y),y.validator&&(y.field=m,y.fullField=y.fullField||m,y.type=s.getType(y),h[m]=h[m]||[],h[m].push({rule:y,value:v,source:a,field:m}))})});var p={};return fMt(h,l,function(m,_){var v=m.rule,b=(v.type==="object"||v.type==="array")&&(typeof v.fields=="object"||typeof v.defaultField=="object");b=b&&(v.required||!v.required&&m.value),v.field=m.field;function y(k,I){return SE({},I,{fullField:v.fullField+"."+k,fullFields:v.fullFields?[].concat(v.fullFields,[k]):[k]})}function C(k){k===void 0&&(k=[]);var I=Array.isArray(k)?k:[k];!l.suppressWarning&&I.length&&n.warning("async-validator:",I),I.length&&v.message!==void 0&&(I=[].concat(v.message));var L=I.map(vxe(v,a));if(l.first&&L.length)return p[v.field]=1,_(L);if(!b)_(L);else{if(v.required&&!m.value)return v.message!==void 0?L=[].concat(v.message).map(vxe(v,a)):l.error&&(L=[l.error(v,tg(l.messages.required,v.field))]),_(L);var D={};v.defaultField&&Object.keys(m.value).map(function(M){D[M]=v.defaultField}),D=SE({},D,m.rule.fields);var R={};Object.keys(D).forEach(function(M){var O=D[M],B=Array.isArray(O)?O:[O];R[M]=B.map(y.bind(null,M))});var P=new n(R);P.messages(l.messages),m.rule.options&&(m.rule.options.messages=l.messages,m.rule.options.error=l.error),P.validate(m.value,m.rule.options||l,function(M){var O=[];L&&L.length&&O.push.apply(O,L),M&&M.length&&O.push.apply(O,M),_(O.length?O:null)})}}var x;if(v.asyncValidator)x=v.asyncValidator(v,m.value,C,m.source,l);else if(v.validator){try{x=v.validator(v,m.value,C,m.source,l)}catch(k){console.error==null||console.error(k),l.suppressValidatorError||setTimeout(function(){throw k},0),C(k.message)}x===!0?C():x===!1?C(typeof v.message=="function"?v.message(v.fullField||v.field):v.message||(v.fullField||v.field)+" fails"):x instanceof Array?C(x):x instanceof Error&&C(x.message)}x&&x.then&&x.then(function(){return C()},function(k){return C(k)})},function(m){u(m)},a)},e.getType=function(i){if(i.type===void 0&&i.pattern instanceof RegExp&&(i.type="pattern"),typeof i.validator!="function"&&i.type&&!hO.hasOwnProperty(i.type))throw new Error(tg("Unknown rule type %s",i.type));return i.type||"string"},e.getValidationMethod=function(i){if(typeof i.validator=="function")return i.validator;var r=Object.keys(i),o=r.indexOf("message");return o!==-1&&r.splice(o,1),r.length===1&&r[0]==="required"?hO.required:hO[this.getType(i)]||void 0},n}();$3.register=function(e,t){if(typeof t!="function")throw new Error("Cannot register a validator by type, validator is not a function");hO[e]=t};$3.warning=cMt;$3.messages=uie;$3.validators=hO;var Nf="'${name}' is not a valid ${type}",y$e={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:Nf,method:Nf,array:Nf,object:Nf,number:Nf,date:Nf,boolean:Nf,integer:Nf,float:Nf,regexp:Nf,email:Nf,url:Nf,hex:Nf},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}"}},Cxe=$3;function FMt(n,e){return n.replace(/\$\{\w+\}/g,function(t){var i=t.slice(2,-1);return e[i]})}var wxe="CODE_LOGIC_ERROR";function die(n,e,t,i,r){return hie.apply(this,arguments)}function hie(){return hie=Sk(ch().mark(function n(e,t,i,r,o){var s,a,l,c,u,d,h,g,p;return ch().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return s=Qe({},i),delete s.ruleIndex,Cxe.warning=function(){},s.validator&&(a=s.validator,s.validator=function(){try{return a.apply(void 0,arguments)}catch(v){return console.error(v),Promise.reject(wxe)}}),l=null,s&&s.type==="array"&&s.defaultField&&(l=s.defaultField,delete s.defaultField),c=new Cxe($e({},e,[s])),u=SI(y$e,r.validateMessages),c.messages(u),d=[],_.prev=10,_.next=13,Promise.resolve(c.validate($e({},e,t),Qe({},r)));case 13:_.next=18;break;case 15:_.prev=15,_.t0=_.catch(10),_.t0.errors&&(d=_.t0.errors.map(function(v,b){var y=v.message,C=y===wxe?u.default:y;return w.isValidElement(C)?w.cloneElement(C,{key:"error_".concat(b)}):C}));case 18:if(!(!d.length&&l)){_.next=23;break}return _.next=21,Promise.all(t.map(function(v,b){return die("".concat(e,".").concat(b),v,l,r,o)}));case 21:return h=_.sent,_.abrupt("return",h.reduce(function(v,b){return[].concat(Ir(v),Ir(b))},[]));case 23:return g=Qe(Qe({},i),{},{name:e,enum:(i.enum||[]).join(", ")},o),p=d.map(function(v){return typeof v=="string"?FMt(v,g):v}),_.abrupt("return",p);case 26:case"end":return _.stop()}},n,null,[[10,15]])})),hie.apply(this,arguments)}function BMt(n,e,t,i,r,o){var s=n.join("."),a=t.map(function(u,d){var h=u.validator,g=Qe(Qe({},u),{},{ruleIndex:d});return h&&(g.validator=function(p,m,_){var v=!1,b=function(){for(var x=arguments.length,k=new Array(x),I=0;I<x;I++)k[I]=arguments[I];Promise.resolve().then(function(){Uu(!v,"Your validator function has already return a promise. `callback` will be ignored."),v||_.apply(void 0,k)})},y=h(p,m,b);v=y&&typeof y.then=="function"&&typeof y.catch=="function",Uu(v,"`callback` is deprecated. Please return a promise instead."),v&&y.then(function(){_()}).catch(function(C){_(C||" ")})}),g}).sort(function(u,d){var h=u.warningOnly,g=u.ruleIndex,p=d.warningOnly,m=d.ruleIndex;return!!h==!!p?g-m:h?1:-1}),l;if(r===!0)l=new Promise(function(){var u=Sk(ch().mark(function d(h,g){var p,m,_;return ch().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:p=0;case 1:if(!(p<a.length)){b.next=12;break}return m=a[p],b.next=5,die(s,e,m,i,o);case 5:if(_=b.sent,!_.length){b.next=9;break}return g([{errors:_,rule:m}]),b.abrupt("return");case 9:p+=1,b.next=1;break;case 12:h([]);case 13:case"end":return b.stop()}},d)}));return function(d,h){return u.apply(this,arguments)}}());else{var c=a.map(function(u){return die(s,e,u,i,o).then(function(d){return{errors:d,rule:u}})});l=(r?VMt(c):$Mt(c)).then(function(u){return Promise.reject(u)})}return l.catch(function(u){return u}),l}function $Mt(n){return fie.apply(this,arguments)}function fie(){return fie=Sk(ch().mark(function n(e){return ch().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",Promise.all(e).then(function(r){var o,s=(o=[]).concat.apply(o,Ir(r));return s}));case 1:case"end":return i.stop()}},n)})),fie.apply(this,arguments)}function VMt(n){return gie.apply(this,arguments)}function gie(){return gie=Sk(ch().mark(function n(e){var t;return ch().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=0,r.abrupt("return",new Promise(function(o){e.forEach(function(s){s.then(function(a){a.errors.length&&o([a]),t+=1,t===e.length&&o([])})})}));case 2:case"end":return r.stop()}},n)})),gie.apply(this,arguments)}function Ol(n){return oie(n)}function Sxe(n,e){var t={};return e.forEach(function(i){var r=t_(n,i);t=Nm(t,i,r)}),t}function _L(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return n&&n.some(function(i){return C$e(e,i,t)})}function C$e(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!n||!e||!t&&n.length!==e.length?!1:e.every(function(i,r){return n[r]===i})}function HMt(n,e){if(n===e)return!0;if(!n&&e||n&&!e||!n||!e||Er(n)!=="object"||Er(e)!=="object")return!1;var t=Object.keys(n),i=Object.keys(e),r=new Set([].concat(t,i));return Ir(r).every(function(o){var s=n[o],a=e[o];return typeof s=="function"&&typeof a=="function"?!0:s===a})}function WMt(n){var e=arguments.length<=1?void 0:arguments[1];return e&&e.target&&Er(e.target)==="object"&&n in e.target?e.target[n]:e}function Exe(n,e,t){var i=n.length;if(e<0||e>=i||t<0||t>=i)return n;var r=n[e],o=e-t;return o>0?[].concat(Ir(n.slice(0,t)),[r],Ir(n.slice(t,e)),Ir(n.slice(e+1,i))):o<0?[].concat(Ir(n.slice(0,e)),Ir(n.slice(e+1,t+1)),[r],Ir(n.slice(t+1,i))):n}var zMt=["name"],Xg=[];function xxe(n,e,t,i,r,o){return typeof n=="function"?n(e,t,"source"in o?{source:o.source}:{}):i!==r}var uge=function(n){I_(t,n);var e=pk(t);function t(i){var r;if(Ua(this,t),r=e.call(this,i),$e(Sr(r),"state",{resetCount:0}),$e(Sr(r),"cancelRegisterFunc",null),$e(Sr(r),"mounted",!1),$e(Sr(r),"touched",!1),$e(Sr(r),"dirty",!1),$e(Sr(r),"validatePromise",void 0),$e(Sr(r),"prevValidating",void 0),$e(Sr(r),"errors",Xg),$e(Sr(r),"warnings",Xg),$e(Sr(r),"cancelRegister",function(){var l=r.props,c=l.preserve,u=l.isListField,d=l.name;r.cancelRegisterFunc&&r.cancelRegisterFunc(u,c,Ol(d)),r.cancelRegisterFunc=null}),$e(Sr(r),"getNamePath",function(){var l=r.props,c=l.name,u=l.fieldContext,d=u.prefixName,h=d===void 0?[]:d;return c!==void 0?[].concat(Ir(h),Ir(c)):[]}),$e(Sr(r),"getRules",function(){var l=r.props,c=l.rules,u=c===void 0?[]:c,d=l.fieldContext;return u.map(function(h){return typeof h=="function"?h(d):h})}),$e(Sr(r),"refresh",function(){r.mounted&&r.setState(function(l){var c=l.resetCount;return{resetCount:c+1}})}),$e(Sr(r),"metaCache",null),$e(Sr(r),"triggerMetaEvent",function(l){var c=r.props.onMetaChange;if(c){var u=Qe(Qe({},r.getMeta()),{},{destroy:l});I7(r.metaCache,u)||c(u),r.metaCache=u}else r.metaCache=null}),$e(Sr(r),"onStoreChange",function(l,c,u){var d=r.props,h=d.shouldUpdate,g=d.dependencies,p=g===void 0?[]:g,m=d.onReset,_=u.store,v=r.getNamePath(),b=r.getValue(l),y=r.getValue(_),C=c&&_L(c,v);switch(u.type==="valueUpdate"&&u.source==="external"&&b!==y&&(r.touched=!0,r.dirty=!0,r.validatePromise=null,r.errors=Xg,r.warnings=Xg,r.triggerMetaEvent()),u.type){case"reset":if(!c||C){r.touched=!1,r.dirty=!1,r.validatePromise=void 0,r.errors=Xg,r.warnings=Xg,r.triggerMetaEvent(),m==null||m(),r.refresh();return}break;case"remove":{if(h){r.reRender();return}break}case"setField":{var x=u.data;if(C){"touched"in x&&(r.touched=x.touched),"validating"in x&&!("originRCField"in x)&&(r.validatePromise=x.validating?Promise.resolve([]):null),"errors"in x&&(r.errors=x.errors||Xg),"warnings"in x&&(r.warnings=x.warnings||Xg),r.dirty=!0,r.triggerMetaEvent(),r.reRender();return}else if("value"in x&&_L(c,v,!0)){r.reRender();return}if(h&&!v.length&&xxe(h,l,_,b,y,u)){r.reRender();return}break}case"dependenciesUpdate":{var k=p.map(Ol);if(k.some(function(I){return _L(u.relatedFields,I)})){r.reRender();return}break}default:if(C||(!p.length||v.length||h)&&xxe(h,l,_,b,y,u)){r.reRender();return}break}h===!0&&r.reRender()}),$e(Sr(r),"validateRules",function(l){var c=r.getNamePath(),u=r.getValue(),d=l||{},h=d.triggerName,g=d.validateOnly,p=g===void 0?!1:g,m=Promise.resolve().then(Sk(ch().mark(function _(){var v,b,y,C,x,k,I;return ch().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(r.mounted){D.next=2;break}return D.abrupt("return",[]);case 2:if(v=r.props,b=v.validateFirst,y=b===void 0?!1:b,C=v.messageVariables,x=v.validateDebounce,k=r.getRules(),h&&(k=k.filter(function(R){return R}).filter(function(R){var P=R.validateTrigger;if(!P)return!0;var M=oie(P);return M.includes(h)})),!(x&&h)){D.next=10;break}return D.next=8,new Promise(function(R){setTimeout(R,x)});case 8:if(r.validatePromise===m){D.next=10;break}return D.abrupt("return",[]);case 10:return I=BMt(c,u,k,l,y,C),I.catch(function(R){return R}).then(function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Xg;if(r.validatePromise===m){var P;r.validatePromise=null;var M=[],O=[];(P=R.forEach)===null||P===void 0||P.call(R,function(B){var F=B.rule.warningOnly,H=B.errors,V=H===void 0?Xg:H;F?O.push.apply(O,Ir(V)):M.push.apply(M,Ir(V))}),r.errors=M,r.warnings=O,r.triggerMetaEvent(),r.reRender()}}),D.abrupt("return",I);case 13:case"end":return D.stop()}},_)})));return p||(r.validatePromise=m,r.dirty=!0,r.errors=Xg,r.warnings=Xg,r.triggerMetaEvent(),r.reRender()),m}),$e(Sr(r),"isFieldValidating",function(){return!!r.validatePromise}),$e(Sr(r),"isFieldTouched",function(){return r.touched}),$e(Sr(r),"isFieldDirty",function(){if(r.dirty||r.props.initialValue!==void 0)return!0;var l=r.props.fieldContext,c=l.getInternalHooks(wE),u=c.getInitialValue;return u(r.getNamePath())!==void 0}),$e(Sr(r),"getErrors",function(){return r.errors}),$e(Sr(r),"getWarnings",function(){return r.warnings}),$e(Sr(r),"isListField",function(){return r.props.isListField}),$e(Sr(r),"isList",function(){return r.props.isList}),$e(Sr(r),"isPreserve",function(){return r.props.preserve}),$e(Sr(r),"getMeta",function(){r.prevValidating=r.isFieldValidating();var l={touched:r.isFieldTouched(),validating:r.prevValidating,errors:r.errors,warnings:r.warnings,name:r.getNamePath(),validated:r.validatePromise===null};return l}),$e(Sr(r),"getOnlyChild",function(l){if(typeof l=="function"){var c=r.getMeta();return Qe(Qe({},r.getOnlyChild(l(r.getControlled(),c,r.props.fieldContext))),{},{isFunction:!0})}var u=E7(l);return u.length!==1||!w.isValidElement(u[0])?{child:u,isFunction:!1}:{child:u[0],isFunction:!1}}),$e(Sr(r),"getValue",function(l){var c=r.props.fieldContext.getFieldsValue,u=r.getNamePath();return t_(l||c(!0),u)}),$e(Sr(r),"getControlled",function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},c=r.props,u=c.trigger,d=c.validateTrigger,h=c.getValueFromEvent,g=c.normalize,p=c.valuePropName,m=c.getValueProps,_=c.fieldContext,v=d!==void 0?d:_.validateTrigger,b=r.getNamePath(),y=_.getInternalHooks,C=_.getFieldsValue,x=y(wE),k=x.dispatch,I=r.getValue(),L=m||function(M){return $e({},p,M)},D=l[u],R=Qe(Qe({},l),L(I));R[u]=function(){r.touched=!0,r.dirty=!0,r.triggerMetaEvent();for(var M,O=arguments.length,B=new Array(O),F=0;F<O;F++)B[F]=arguments[F];h?M=h.apply(void 0,B):M=WMt.apply(void 0,[p].concat(B)),g&&(M=g(M,I,C(!0))),k({type:"updateValue",namePath:b,value:M}),D&&D.apply(void 0,B)};var P=oie(v||[]);return P.forEach(function(M){var O=R[M];R[M]=function(){O&&O.apply(void 0,arguments);var B=r.props.rules;B&&B.length&&k({type:"validateField",namePath:b,triggerName:M})}}),R}),i.fieldContext){var o=i.fieldContext.getInternalHooks,s=o(wE),a=s.initEntityValue;a(Sr(r))}return r}return qa(t,[{key:"componentDidMount",value:function(){var r=this.props,o=r.shouldUpdate,s=r.fieldContext;if(this.mounted=!0,s){var a=s.getInternalHooks,l=a(wE),c=l.registerField;this.cancelRegisterFunc=c(this)}o===!0&&this.reRender()}},{key:"componentWillUnmount",value:function(){this.cancelRegister(),this.triggerMetaEvent(!0),this.mounted=!1}},{key:"reRender",value:function(){this.mounted&&this.forceUpdate()}},{key:"render",value:function(){var r=this.state.resetCount,o=this.props.children,s=this.getOnlyChild(o),a=s.child,l=s.isFunction,c;return l?c=a:w.isValidElement(a)?c=w.cloneElement(a,this.getControlled(a.props)):(Uu(!a,"`children` of Field is not validate ReactElement."),c=a),w.createElement(w.Fragment,{key:r},c)}}]),t}(w.Component);$e(uge,"contextType",kD);$e(uge,"defaultProps",{trigger:"onChange",valuePropName:"value"});function w$e(n){var e=n.name,t=uu(n,zMt),i=w.useContext(kD),r=w.useContext(P7),o=e!==void 0?Ol(e):void 0,s="keep";return t.isListField||(s="_".concat((o||[]).join("_"))),w.createElement(uge,rt({key:s,name:o,isListField:!!r},t,{fieldContext:i}))}function jMt(n){var e=n.name,t=n.initialValue,i=n.children,r=n.rules,o=n.validateTrigger,s=n.isListField,a=w.useContext(kD),l=w.useContext(P7),c=w.useRef({keys:[],id:0}),u=c.current,d=w.useMemo(function(){var m=Ol(a.prefixName)||[];return[].concat(Ir(m),Ir(Ol(e)))},[a.prefixName,e]),h=w.useMemo(function(){return Qe(Qe({},a),{},{prefixName:d})},[a,d]),g=w.useMemo(function(){return{getKey:function(_){var v=d.length,b=_[v];return[u.keys[b],_.slice(v+1)]}}},[d]);if(typeof i!="function")return Uu(!1,"Form.List only accepts function as children."),null;var p=function(_,v,b){var y=b.source;return y==="internal"?!1:_!==v};return w.createElement(P7.Provider,{value:g},w.createElement(kD.Provider,{value:h},w.createElement(w$e,{name:[],shouldUpdate:p,rules:r,validateTrigger:o,initialValue:t,isList:!0,isListField:s??!!l},function(m,_){var v=m.value,b=v===void 0?[]:v,y=m.onChange,C=a.getFieldValue,x=function(){var D=C(d||[]);return D||[]},k={add:function(D,R){var P=x();R>=0&&R<=P.length?(u.keys=[].concat(Ir(u.keys.slice(0,R)),[u.id],Ir(u.keys.slice(R))),y([].concat(Ir(P.slice(0,R)),[D],Ir(P.slice(R))))):(u.keys=[].concat(Ir(u.keys),[u.id]),y([].concat(Ir(P),[D]))),u.id+=1},remove:function(D){var R=x(),P=new Set(Array.isArray(D)?D:[D]);P.size<=0||(u.keys=u.keys.filter(function(M,O){return!P.has(O)}),y(R.filter(function(M,O){return!P.has(O)})))},move:function(D,R){if(D!==R){var P=x();D<0||D>=P.length||R<0||R>=P.length||(u.keys=Exe(u.keys,D,R),y(Exe(P,D,R)))}}},I=b||[];return Array.isArray(I)||(I=[]),i(I.map(function(L,D){var R=u.keys[D];return R===void 0&&(u.keys[D]=u.id,R=u.keys[D],u.id+=1),{name:D,key:R,isListField:!0}}),k,_)})))}function UMt(n){var e=!1,t=n.length,i=[];return n.length?new Promise(function(r,o){n.forEach(function(s,a){s.catch(function(l){return e=!0,l}).then(function(l){t-=1,i[a]=l,!(t>0)&&(e&&o(i),r(i))})})}):Promise.resolve([])}var S$e="__@field_split__";function YQ(n){return n.map(function(e){return"".concat(Er(e),":").concat(e)}).join(S$e)}var wT=function(){function n(){Ua(this,n),$e(this,"kvs",new Map)}return qa(n,[{key:"set",value:function(t,i){this.kvs.set(YQ(t),i)}},{key:"get",value:function(t){return this.kvs.get(YQ(t))}},{key:"update",value:function(t,i){var r=this.get(t),o=i(r);o?this.set(t,o):this.delete(t)}},{key:"delete",value:function(t){this.kvs.delete(YQ(t))}},{key:"map",value:function(t){return Ir(this.kvs.entries()).map(function(i){var r=$t(i,2),o=r[0],s=r[1],a=o.split(S$e);return t({key:a.map(function(l){var c=l.match(/^([^:]*):(.*)$/),u=$t(c,3),d=u[1],h=u[2];return d==="number"?Number(h):h}),value:s})})}},{key:"toJSON",value:function(){var t={};return this.map(function(i){var r=i.key,o=i.value;return t[r.join(".")]=o,null}),t}}]),n}(),qMt=["name"],KMt=qa(function n(e){var t=this;Ua(this,n),$e(this,"formHooked",!1),$e(this,"forceRootUpdate",void 0),$e(this,"subscribable",!0),$e(this,"store",{}),$e(this,"fieldEntities",[]),$e(this,"initialValues",{}),$e(this,"callbacks",{}),$e(this,"validateMessages",null),$e(this,"preserve",null),$e(this,"lastValidatePromise",null),$e(this,"getForm",function(){return{getFieldValue:t.getFieldValue,getFieldsValue:t.getFieldsValue,getFieldError:t.getFieldError,getFieldWarning:t.getFieldWarning,getFieldsError:t.getFieldsError,isFieldsTouched:t.isFieldsTouched,isFieldTouched:t.isFieldTouched,isFieldValidating:t.isFieldValidating,isFieldsValidating:t.isFieldsValidating,resetFields:t.resetFields,setFields:t.setFields,setFieldValue:t.setFieldValue,setFieldsValue:t.setFieldsValue,validateFields:t.validateFields,submit:t.submit,_init:!0,getInternalHooks:t.getInternalHooks}}),$e(this,"getInternalHooks",function(i){return i===wE?(t.formHooked=!0,{dispatch:t.dispatch,initEntityValue:t.initEntityValue,registerField:t.registerField,useSubscribe:t.useSubscribe,setInitialValues:t.setInitialValues,destroyForm:t.destroyForm,setCallbacks:t.setCallbacks,setValidateMessages:t.setValidateMessages,getFields:t.getFields,setPreserve:t.setPreserve,getInitialValue:t.getInitialValue,registerWatch:t.registerWatch}):(Uu(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),$e(this,"useSubscribe",function(i){t.subscribable=i}),$e(this,"prevWithoutPreserves",null),$e(this,"setInitialValues",function(i,r){if(t.initialValues=i||{},r){var o,s=SI(i,t.store);(o=t.prevWithoutPreserves)===null||o===void 0||o.map(function(a){var l=a.key;s=Nm(s,l,t_(i,l))}),t.prevWithoutPreserves=null,t.updateStore(s)}}),$e(this,"destroyForm",function(){var i=new wT;t.getFieldEntities(!0).forEach(function(r){t.isMergedPreserve(r.isPreserve())||i.set(r.getNamePath(),!0)}),t.prevWithoutPreserves=i}),$e(this,"getInitialValue",function(i){var r=t_(t.initialValues,i);return i.length?SI(r):r}),$e(this,"setCallbacks",function(i){t.callbacks=i}),$e(this,"setValidateMessages",function(i){t.validateMessages=i}),$e(this,"setPreserve",function(i){t.preserve=i}),$e(this,"watchList",[]),$e(this,"registerWatch",function(i){return t.watchList.push(i),function(){t.watchList=t.watchList.filter(function(r){return r!==i})}}),$e(this,"notifyWatch",function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(t.watchList.length){var r=t.getFieldsValue(),o=t.getFieldsValue(!0);t.watchList.forEach(function(s){s(r,o,i)})}}),$e(this,"timeoutId",null),$e(this,"warningUnhooked",function(){}),$e(this,"updateStore",function(i){t.store=i}),$e(this,"getFieldEntities",function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return i?t.fieldEntities.filter(function(r){return r.getNamePath().length}):t.fieldEntities}),$e(this,"getFieldsMap",function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,r=new wT;return t.getFieldEntities(i).forEach(function(o){var s=o.getNamePath();r.set(s,o)}),r}),$e(this,"getFieldEntitiesForNamePathList",function(i){if(!i)return t.getFieldEntities(!0);var r=t.getFieldsMap(!0);return i.map(function(o){var s=Ol(o);return r.get(s)||{INVALIDATE_NAME_PATH:Ol(o)}})}),$e(this,"getFieldsValue",function(i,r){t.warningUnhooked();var o,s,a;if(i===!0||Array.isArray(i)?(o=i,s=r):i&&Er(i)==="object"&&(a=i.strict,s=i.filter),o===!0&&!s)return t.store;var l=t.getFieldEntitiesForNamePathList(Array.isArray(o)?o:null),c=[];return l.forEach(function(u){var d,h,g="INVALIDATE_NAME_PATH"in u?u.INVALIDATE_NAME_PATH:u.getNamePath();if(a){var p,m;if((p=(m=u).isList)!==null&&p!==void 0&&p.call(m))return}else if(!o&&(d=(h=u).isListField)!==null&&d!==void 0&&d.call(h))return;if(!s)c.push(g);else{var _="getMeta"in u?u.getMeta():null;s(_)&&c.push(g)}}),Sxe(t.store,c.map(Ol))}),$e(this,"getFieldValue",function(i){t.warningUnhooked();var r=Ol(i);return t_(t.store,r)}),$e(this,"getFieldsError",function(i){t.warningUnhooked();var r=t.getFieldEntitiesForNamePathList(i);return r.map(function(o,s){return o&&!("INVALIDATE_NAME_PATH"in o)?{name:o.getNamePath(),errors:o.getErrors(),warnings:o.getWarnings()}:{name:Ol(i[s]),errors:[],warnings:[]}})}),$e(this,"getFieldError",function(i){t.warningUnhooked();var r=Ol(i),o=t.getFieldsError([r])[0];return o.errors}),$e(this,"getFieldWarning",function(i){t.warningUnhooked();var r=Ol(i),o=t.getFieldsError([r])[0];return o.warnings}),$e(this,"isFieldsTouched",function(){t.warningUnhooked();for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];var s=r[0],a=r[1],l,c=!1;r.length===0?l=null:r.length===1?Array.isArray(s)?(l=s.map(Ol),c=!1):(l=null,c=s):(l=s.map(Ol),c=a);var u=t.getFieldEntities(!0),d=function(_){return _.isFieldTouched()};if(!l)return c?u.every(d):u.some(d);var h=new wT;l.forEach(function(m){h.set(m,[])}),u.forEach(function(m){var _=m.getNamePath();l.forEach(function(v){v.every(function(b,y){return _[y]===b})&&h.update(v,function(b){return[].concat(Ir(b),[m])})})});var g=function(_){return _.some(d)},p=h.map(function(m){var _=m.value;return _});return c?p.every(g):p.some(g)}),$e(this,"isFieldTouched",function(i){return t.warningUnhooked(),t.isFieldsTouched([i])}),$e(this,"isFieldsValidating",function(i){t.warningUnhooked();var r=t.getFieldEntities();if(!i)return r.some(function(s){return s.isFieldValidating()});var o=i.map(Ol);return r.some(function(s){var a=s.getNamePath();return _L(o,a)&&s.isFieldValidating()})}),$e(this,"isFieldValidating",function(i){return t.warningUnhooked(),t.isFieldsValidating([i])}),$e(this,"resetWithFieldInitialValue",function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=new wT,o=t.getFieldEntities(!0);o.forEach(function(l){var c=l.props.initialValue,u=l.getNamePath();if(c!==void 0){var d=r.get(u)||new Set;d.add({entity:l,value:c}),r.set(u,d)}});var s=function(c){c.forEach(function(u){var d=u.props.initialValue;if(d!==void 0){var h=u.getNamePath(),g=t.getInitialValue(h);if(g!==void 0)Uu(!1,"Form already set 'initialValues' with path '".concat(h.join("."),"'. Field can not overwrite it."));else{var p=r.get(h);if(p&&p.size>1)Uu(!1,"Multiple Field with path '".concat(h.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(p){var m=t.getFieldValue(h),_=u.isListField();!_&&(!i.skipExist||m===void 0)&&t.updateStore(Nm(t.store,h,Ir(p)[0].value))}}}})},a;i.entities?a=i.entities:i.namePathList?(a=[],i.namePathList.forEach(function(l){var c=r.get(l);if(c){var u;(u=a).push.apply(u,Ir(Ir(c).map(function(d){return d.entity})))}})):a=o,s(a)}),$e(this,"resetFields",function(i){t.warningUnhooked();var r=t.store;if(!i){t.updateStore(SI(t.initialValues)),t.resetWithFieldInitialValue(),t.notifyObservers(r,null,{type:"reset"}),t.notifyWatch();return}var o=i.map(Ol);o.forEach(function(s){var a=t.getInitialValue(s);t.updateStore(Nm(t.store,s,a))}),t.resetWithFieldInitialValue({namePathList:o}),t.notifyObservers(r,o,{type:"reset"}),t.notifyWatch(o)}),$e(this,"setFields",function(i){t.warningUnhooked();var r=t.store,o=[];i.forEach(function(s){var a=s.name,l=uu(s,qMt),c=Ol(a);o.push(c),"value"in l&&t.updateStore(Nm(t.store,c,l.value)),t.notifyObservers(r,[c],{type:"setField",data:s})}),t.notifyWatch(o)}),$e(this,"getFields",function(){var i=t.getFieldEntities(!0),r=i.map(function(o){var s=o.getNamePath(),a=o.getMeta(),l=Qe(Qe({},a),{},{name:s,value:t.getFieldValue(s)});return Object.defineProperty(l,"originRCField",{value:!0}),l});return r}),$e(this,"initEntityValue",function(i){var r=i.props.initialValue;if(r!==void 0){var o=i.getNamePath(),s=t_(t.store,o);s===void 0&&t.updateStore(Nm(t.store,o,r))}}),$e(this,"isMergedPreserve",function(i){var r=i!==void 0?i:t.preserve;return r??!0}),$e(this,"registerField",function(i){t.fieldEntities.push(i);var r=i.getNamePath();if(t.notifyWatch([r]),i.props.initialValue!==void 0){var o=t.store;t.resetWithFieldInitialValue({entities:[i],skipExist:!0}),t.notifyObservers(o,[i.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(s,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.fieldEntities=t.fieldEntities.filter(function(d){return d!==i}),!t.isMergedPreserve(a)&&(!s||l.length>1)){var c=s?void 0:t.getInitialValue(r);if(r.length&&t.getFieldValue(r)!==c&&t.fieldEntities.every(function(d){return!C$e(d.getNamePath(),r)})){var u=t.store;t.updateStore(Nm(u,r,c,!0)),t.notifyObservers(u,[r],{type:"remove"}),t.triggerDependenciesUpdate(u,r)}}t.notifyWatch([r])}}),$e(this,"dispatch",function(i){switch(i.type){case"updateValue":{var r=i.namePath,o=i.value;t.updateValue(r,o);break}case"validateField":{var s=i.namePath,a=i.triggerName;t.validateFields([s],{triggerName:a});break}}}),$e(this,"notifyObservers",function(i,r,o){if(t.subscribable){var s=Qe(Qe({},o),{},{store:t.getFieldsValue(!0)});t.getFieldEntities().forEach(function(a){var l=a.onStoreChange;l(i,r,s)})}else t.forceRootUpdate()}),$e(this,"triggerDependenciesUpdate",function(i,r){var o=t.getDependencyChildrenFields(r);return o.length&&t.validateFields(o),t.notifyObservers(i,o,{type:"dependenciesUpdate",relatedFields:[r].concat(Ir(o))}),o}),$e(this,"updateValue",function(i,r){var o=Ol(i),s=t.store;t.updateStore(Nm(t.store,o,r)),t.notifyObservers(s,[o],{type:"valueUpdate",source:"internal"}),t.notifyWatch([o]);var a=t.triggerDependenciesUpdate(s,o),l=t.callbacks.onValuesChange;if(l){var c=Sxe(t.store,[o]);l(c,t.getFieldsValue())}t.triggerOnFieldsChange([o].concat(Ir(a)))}),$e(this,"setFieldsValue",function(i){t.warningUnhooked();var r=t.store;if(i){var o=SI(t.store,i);t.updateStore(o)}t.notifyObservers(r,null,{type:"valueUpdate",source:"external"}),t.notifyWatch()}),$e(this,"setFieldValue",function(i,r){t.setFields([{name:i,value:r}])}),$e(this,"getDependencyChildrenFields",function(i){var r=new Set,o=[],s=new wT;t.getFieldEntities().forEach(function(l){var c=l.props.dependencies;(c||[]).forEach(function(u){var d=Ol(u);s.update(d,function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return h.add(l),h})})});var a=function l(c){var u=s.get(c)||new Set;u.forEach(function(d){if(!r.has(d)){r.add(d);var h=d.getNamePath();d.isFieldDirty()&&h.length&&(o.push(h),l(h))}})};return a(i),o}),$e(this,"triggerOnFieldsChange",function(i,r){var o=t.callbacks.onFieldsChange;if(o){var s=t.getFields();if(r){var a=new wT;r.forEach(function(c){var u=c.name,d=c.errors;a.set(u,d)}),s.forEach(function(c){c.errors=a.get(c.name)||c.errors})}var l=s.filter(function(c){var u=c.name;return _L(i,u)});l.length&&o(l,s)}}),$e(this,"validateFields",function(i,r){var o;t.warningUnhooked();var s,a;Array.isArray(i)||typeof i=="string"||typeof r=="string"?(s=i,a=r):a=i;var l=!!s,c=l?s.map(Ol):[],u=[],d=String(Date.now()),h=new Set,g=(o=a)===null||o===void 0?void 0:o.recursive;t.getFieldEntities(!0).forEach(function(v){if(l||c.push(v.getNamePath()),!(!v.props.rules||!v.props.rules.length)){var b=v.getNamePath();if(h.add(b.join(d)),!l||_L(c,b,g)){var y=v.validateRules(Qe({validateMessages:Qe(Qe({},y$e),t.validateMessages)},a));u.push(y.then(function(){return{name:b,errors:[],warnings:[]}}).catch(function(C){var x,k=[],I=[];return(x=C.forEach)===null||x===void 0||x.call(C,function(L){var D=L.rule.warningOnly,R=L.errors;D?I.push.apply(I,Ir(R)):k.push.apply(k,Ir(R))}),k.length?Promise.reject({name:b,errors:k,warnings:I}):{name:b,errors:k,warnings:I}}))}}});var p=UMt(u);t.lastValidatePromise=p,p.catch(function(v){return v}).then(function(v){var b=v.map(function(y){var C=y.name;return C});t.notifyObservers(t.store,b,{type:"validateFinish"}),t.triggerOnFieldsChange(b,v)});var m=p.then(function(){return t.lastValidatePromise===p?Promise.resolve(t.getFieldsValue(c)):Promise.reject([])}).catch(function(v){var b=v.filter(function(y){return y&&y.errors.length});return Promise.reject({values:t.getFieldsValue(c),errorFields:b,outOfDate:t.lastValidatePromise!==p})});m.catch(function(v){return v});var _=c.filter(function(v){return h.has(v.join(d))});return t.triggerOnFieldsChange(_),m}),$e(this,"submit",function(){t.warningUnhooked(),t.validateFields().then(function(i){var r=t.callbacks.onFinish;if(r)try{r(i)}catch(o){console.error(o)}}).catch(function(i){var r=t.callbacks.onFinishFailed;r&&r(i)})}),this.forceRootUpdate=e});function E$e(n){var e=w.useRef(),t=w.useState({}),i=$t(t,2),r=i[1];if(!e.current)if(n)e.current=n;else{var o=function(){r({})},s=new KMt(o);e.current=s.getForm()}return[e.current]}var pie=w.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),GMt=function(e){var t=e.validateMessages,i=e.onFormChange,r=e.onFormFinish,o=e.children,s=w.useContext(pie),a=w.useRef({});return w.createElement(pie.Provider,{value:Qe(Qe({},s),{},{validateMessages:Qe(Qe({},s.validateMessages),t),triggerFormChange:function(c,u){i&&i(c,{changedFields:u,forms:a.current}),s.triggerFormChange(c,u)},triggerFormFinish:function(c,u){r&&r(c,{values:u,forms:a.current}),s.triggerFormFinish(c,u)},registerForm:function(c,u){c&&(a.current=Qe(Qe({},a.current),{},$e({},c,u))),s.registerForm(c,u)},unregisterForm:function(c){var u=Qe({},a.current);delete u[c],a.current=u,s.unregisterForm(c)}})},o)},YMt=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],QMt=function(e,t){var i=e.name,r=e.initialValues,o=e.fields,s=e.form,a=e.preserve,l=e.children,c=e.component,u=c===void 0?"form":c,d=e.validateMessages,h=e.validateTrigger,g=h===void 0?"onChange":h,p=e.onValuesChange,m=e.onFieldsChange,_=e.onFinish,v=e.onFinishFailed,b=uu(e,YMt),y=w.useContext(pie),C=E$e(s),x=$t(C,1),k=x[0],I=k.getInternalHooks(wE),L=I.useSubscribe,D=I.setInitialValues,R=I.setCallbacks,P=I.setValidateMessages,M=I.setPreserve,O=I.destroyForm;w.useImperativeHandle(t,function(){return k}),w.useEffect(function(){return y.registerForm(i,k),function(){y.unregisterForm(i)}},[y,k,i]),P(Qe(Qe({},y.validateMessages),d)),R({onValuesChange:p,onFieldsChange:function(se){if(y.triggerFormChange(i,se),m){for(var he=arguments.length,xe=new Array(he>1?he-1:0),_e=1;_e<he;_e++)xe[_e-1]=arguments[_e];m.apply(void 0,[se].concat(xe))}},onFinish:function(se){y.triggerFormFinish(i,se),_&&_(se)},onFinishFailed:v}),M(a);var B=w.useRef(null);D(r,!B.current),B.current||(B.current=!0),w.useEffect(function(){return O},[]);var F,H=typeof l=="function";if(H){var V=k.getFieldsValue(!0);F=l(V,k)}else F=l;L(!H);var $=w.useRef();w.useEffect(function(){HMt($.current||[],o||[])||k.setFields(o||[]),$.current=o},[o,k]);var j=w.useMemo(function(){return Qe(Qe({},k),{},{validateTrigger:g})},[k,g]),Y=w.createElement(P7.Provider,{value:null},w.createElement(kD.Provider,{value:j},F));return u===!1?Y:w.createElement(u,rt({},b,{onSubmit:function(se){se.preventDefault(),se.stopPropagation(),k.submit()},onReset:function(se){var he;se.preventDefault(),k.resetFields(),(he=b.onReset)===null||he===void 0||he.call(b,se)}}),Y)};function kxe(n){try{return JSON.stringify(n)}catch{return Math.random()}}function XMt(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];var i=e[0],r=i===void 0?[]:i,o=e[1],s=o===void 0?{}:o,a=rMt(s)?{form:s}:s,l=a.form,c=w.useState(),u=$t(c,2),d=u[0],h=u[1],g=w.useMemo(function(){return kxe(d)},[d]),p=w.useRef(g);p.current=g;var m=w.useContext(kD),_=l||m,v=_&&_._init,b=Ol(r),y=w.useRef(b);return y.current=b,w.useEffect(function(){if(v){var C=_.getFieldsValue,x=_.getInternalHooks,k=x(wE),I=k.registerWatch,L=I(function(R,P){var M=t_(a.preserve?P:R,y.current),O=kxe(M);p.current!==O&&(p.current=O,h(M))}),D=t_(a.preserve?C(!0):C(),y.current);return d!==D&&h(D),L}},[v]),d}var ZMt=w.forwardRef(QMt),V3=ZMt;V3.FormProvider=GMt;V3.Field=w$e;V3.List=jMt;V3.useForm=E$e;V3.useWatch=XMt;const x$e=w.createContext({}),JMt=n=>({animationDuration:n,animationFillMode:"both"}),e4t=n=>({animationDuration:n,animationFillMode:"both"}),k$e=function(n,e,t,i){const o=(arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1)?"&":"";return{[`
${o}${n}-enter,
${o}${n}-appear
`]:Object.assign(Object.assign({},JMt(i)),{animationPlayState:"paused"}),[`${o}${n}-leave`]:Object.assign(Object.assign({},e4t(i)),{animationPlayState:"paused"}),[`
${o}${n}-enter${n}-enter-active,
${o}${n}-appear${n}-appear-active
`]:{animationName:e,animationPlayState:"running"},[`${o}${n}-leave${n}-leave-active`]:{animationName:t,animationPlayState:"running",pointerEvents:"none"}}},t4t=new Od("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),n4t=new Od("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),i4t=new Od("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),r4t=new Od("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),o4t=new Od("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),s4t=new Od("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),a4t=new Od("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),l4t=new Od("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),c4t={"move-up":{inKeyframes:a4t,outKeyframes:l4t},"move-down":{inKeyframes:t4t,outKeyframes:n4t},"move-left":{inKeyframes:i4t,outKeyframes:r4t},"move-right":{inKeyframes:o4t,outKeyframes:s4t}},Txe=(n,e)=>{const{antCls:t}=n,i=`${t}-${e}`,{inKeyframes:r,outKeyframes:o}=c4t[e];return[k$e(i,r,o,n.motionDurationMid),{[`
${i}-enter,
${i}-appear
`]:{opacity:0,animationTimingFunction:n.motionEaseOutCirc},[`${i}-leave`]:{animationTimingFunction:n.motionEaseInOutCirc}}]},T$e=new Od("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),I$e=new Od("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),L$e=new Od("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),D$e=new Od("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),u4t=new Od("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),d4t=new Od("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),h4t=new Od("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),f4t=new Od("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),g4t={"slide-up":{inKeyframes:T$e,outKeyframes:I$e},"slide-down":{inKeyframes:L$e,outKeyframes:D$e},"slide-left":{inKeyframes:u4t,outKeyframes:d4t},"slide-right":{inKeyframes:h4t,outKeyframes:f4t}},Ixe=(n,e)=>{const{antCls:t}=n,i=`${t}-${e}`,{inKeyframes:r,outKeyframes:o}=g4t[e];return[k$e(i,r,o,n.motionDurationMid),{[`
${i}-enter,
${i}-appear
`]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:n.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${i}-leave`]:{animationTimingFunction:n.motionEaseInQuint}}]};function p4t(n){return function(t){return w.createElement(tge,{theme:{token:{motion:!1,zIndexPopupBase:0}}},w.createElement(n,Object.assign({},t)))}}function A$e(n,e,t,i){function r(o){const{prefixCls:s,style:a}=o,l=w.useRef(null),[c,u]=w.useState(0),[d,h]=w.useState(0),[g,p]=xp(!1,{value:o.open}),{getPrefixCls:m}=w.useContext(Jp),_=m(e||"select",s);w.useEffect(()=>{if(p(!0),typeof ResizeObserver<"u"){const b=new ResizeObserver(C=>{const x=C[0].target;u(x.offsetHeight+8),h(x.offsetWidth)}),y=setInterval(()=>{var C;const x=t?`.${t(_)}`:`.${_}-dropdown`,k=(C=l.current)===null||C===void 0?void 0:C.querySelector(x);k&&(clearInterval(y),b.observe(k))},10);return()=>{clearInterval(y),b.disconnect()}}},[]);let v=Object.assign(Object.assign({},o),{style:Object.assign(Object.assign({},a),{margin:0}),open:g,visible:g,getPopupContainer:()=>l.current});return i&&(v=i(v)),w.createElement("div",{ref:l,style:{paddingBottom:c,position:"relative",minWidth:d}},w.createElement(n,Object.assign({},v)))}return p4t(r)}const m4t=function(){if(typeof navigator>"u"||typeof window>"u")return!1;var n=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(n)||/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(n==null?void 0:n.substr(0,4))};function _4t(n){var e=n.prefixCls,t=n.align,i=n.arrow,r=n.arrowPos,o=i||{},s=o.className,a=o.content,l=r.x,c=l===void 0?0:l,u=r.y,d=u===void 0?0:u,h=w.useRef();if(!t||!t.points)return null;var g={position:"absolute"};if(t.autoArrow!==!1){var p=t.points[0],m=t.points[1],_=p[0],v=p[1],b=m[0],y=m[1];_===b||!["t","b"].includes(_)?g.top=d:_==="t"?g.top=0:g.bottom=0,v===y||!["l","r"].includes(v)?g.left=c:v==="l"?g.left=0:g.right=0}return w.createElement("div",{ref:h,className:St("".concat(e,"-arrow"),s),style:g},a)}function v4t(n){var e=n.prefixCls,t=n.open,i=n.zIndex,r=n.mask,o=n.motion;return r?w.createElement(M3,rt({},o,{motionAppear:!0,visible:t,removeOnLeave:!0}),function(s){var a=s.className;return w.createElement("div",{style:{zIndex:i},className:St("".concat(e,"-mask"),a)})}):null}var b4t=w.memo(function(n){var e=n.children;return e},function(n,e){return e.cache}),y4t=w.forwardRef(function(n,e){var t=n.popup,i=n.className,r=n.prefixCls,o=n.style,s=n.target,a=n.onVisibleChanged,l=n.open,c=n.keepDom,u=n.fresh,d=n.onClick,h=n.mask,g=n.arrow,p=n.arrowPos,m=n.align,_=n.motion,v=n.maskMotion,b=n.forceRender,y=n.getPopupContainer,C=n.autoDestroy,x=n.portal,k=n.zIndex,I=n.onMouseEnter,L=n.onMouseLeave,D=n.onPointerEnter,R=n.ready,P=n.offsetX,M=n.offsetY,O=n.offsetR,B=n.offsetB,F=n.onAlign,H=n.onPrepare,V=n.stretch,$=n.targetWidth,j=n.targetHeight,Y=typeof t=="function"?t():t,ne=l||c,se=(y==null?void 0:y.length)>0,he=w.useState(!y||!se),xe=$t(he,2),_e=xe[0],Ie=xe[1];if(wd(function(){!_e&&se&&s&&Ie(!0)},[_e,se,s]),!_e)return null;var Re="auto",Ye={left:"-1000vw",top:"-1000vh",right:Re,bottom:Re};if(R||!l){var Ze,tt=m.points,Be=m.dynamicInset||((Ze=m._experimental)===null||Ze===void 0?void 0:Ze.dynamicInset),kt=Be&&tt[0][1]==="r",Vt=Be&&tt[0][0]==="b";kt?(Ye.right=O,Ye.left=Re):(Ye.left=P,Ye.right=Re),Vt?(Ye.bottom=B,Ye.top=Re):(Ye.top=M,Ye.bottom=Re)}var xt={};return V&&(V.includes("height")&&j?xt.height=j:V.includes("minHeight")&&j&&(xt.minHeight=j),V.includes("width")&&$?xt.width=$:V.includes("minWidth")&&$&&(xt.minWidth=$)),l||(xt.pointerEvents="none"),w.createElement(x,{open:b||ne,getContainer:y&&function(){return y(s)},autoDestroy:C},w.createElement(v4t,{prefixCls:r,open:l,zIndex:k,mask:h,motion:v}),w.createElement(Kfe,{onResize:F,disabled:!l},function(Kt){return w.createElement(M3,rt({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:b,leavedClassName:"".concat(r,"-hidden")},_,{onAppearPrepare:H,onEnterPrepare:H,visible:l,onVisibleChanged:function(wn){var on;_==null||(on=_.onVisibleChanged)===null||on===void 0||on.call(_,wn),a(wn)}}),function(cn,wn){var on=cn.className,Zt=cn.style,pe=St(r,on,i);return w.createElement("div",{ref:mj(Kt,e,wn),className:pe,style:Qe(Qe(Qe(Qe({"--arrow-x":"".concat(p.x||0,"px"),"--arrow-y":"".concat(p.y||0,"px")},Ye),xt),Zt),{},{boxSizing:"border-box",zIndex:k},o),onMouseEnter:I,onMouseLeave:L,onPointerEnter:D,onClick:d},g&&w.createElement(_4t,{prefixCls:r,arrow:g,arrowPos:p,align:m}),w.createElement(b4t,{cache:!l&&!u},Y))})}))}),C4t=w.forwardRef(function(n,e){var t=n.children,i=n.getTriggerDOMNode,r=O3(t),o=w.useCallback(function(a){Ufe(e,i?i(a):a)},[i]),s=qfe(o,t.ref);return r?w.cloneElement(t,{ref:s}):t}),Lxe=w.createContext(null);function Dxe(n){return n?Array.isArray(n)?n:[n]:[]}function w4t(n,e,t,i){return w.useMemo(function(){var r=Dxe(t??e),o=Dxe(i??e),s=new Set(r),a=new Set(o);return n&&(s.has("hover")&&(s.delete("hover"),s.add("click")),a.has("hover")&&(a.delete("hover"),a.add("click"))),[s,a]},[n,e,t,i])}function S4t(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2?arguments[2]:void 0;return t?n[0]===e[0]:n[0]===e[0]&&n[1]===e[1]}function E4t(n,e,t,i){for(var r=t.points,o=Object.keys(n),s=0;s<o.length;s+=1){var a,l=o[s];if(S4t((a=n[l])===null||a===void 0?void 0:a.points,r,i))return"".concat(e,"-placement-").concat(l)}return""}function Axe(n,e,t,i){return e||(t?{motionName:"".concat(n,"-").concat(t)}:i?{motionName:i}:null)}function H3(n){return n.ownerDocument.defaultView}function mie(n){for(var e=[],t=n==null?void 0:n.parentElement,i=["hidden","scroll","clip","auto"];t;){var r=H3(t).getComputedStyle(t),o=r.overflowX,s=r.overflowY,a=r.overflow;[o,s,a].some(function(l){return i.includes(l)})&&e.push(t),t=t.parentElement}return e}function GP(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(n)?e:n}function wR(n){return GP(parseFloat(n),0)}function Rxe(n,e){var t=Qe({},n);return(e||[]).forEach(function(i){if(!(i instanceof HTMLBodyElement||i instanceof HTMLHtmlElement)){var r=H3(i).getComputedStyle(i),o=r.overflow,s=r.overflowClipMargin,a=r.borderTopWidth,l=r.borderBottomWidth,c=r.borderLeftWidth,u=r.borderRightWidth,d=i.getBoundingClientRect(),h=i.offsetHeight,g=i.clientHeight,p=i.offsetWidth,m=i.clientWidth,_=wR(a),v=wR(l),b=wR(c),y=wR(u),C=GP(Math.round(d.width/p*1e3)/1e3),x=GP(Math.round(d.height/h*1e3)/1e3),k=(p-m-b-y)*C,I=(h-g-_-v)*x,L=_*x,D=v*x,R=b*C,P=y*C,M=0,O=0;if(o==="clip"){var B=wR(s);M=B*C,O=B*x}var F=d.x+R-M,H=d.y+L-O,V=F+d.width+2*M-R-P-k,$=H+d.height+2*O-L-D-I;t.left=Math.max(t.left,F),t.top=Math.max(t.top,H),t.right=Math.min(t.right,V),t.bottom=Math.min(t.bottom,$)}}),t}function Nxe(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t="".concat(e),i=t.match(/^(.*)\%$/);return i?n*(parseFloat(i[1])/100):parseFloat(t)}function Oxe(n,e){var t=e||[],i=$t(t,2),r=i[0],o=i[1];return[Nxe(n.width,r),Nxe(n.height,o)]}function Pxe(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[n[0],n[1]]}function ST(n,e){var t=e[0],i=e[1],r,o;return t==="t"?o=n.y:t==="b"?o=n.y+n.height:o=n.y+n.height/2,i==="l"?r=n.x:i==="r"?r=n.x+n.width:r=n.x+n.width/2,{x:r,y:o}}function Y0(n,e){var t={t:"b",b:"t",l:"r",r:"l"};return n.map(function(i,r){return r===e?t[i]||"c":i}).join("")}function x4t(n,e,t,i,r,o,s){var a=w.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:r[i]||{}}),l=$t(a,2),c=l[0],u=l[1],d=w.useRef(0),h=w.useMemo(function(){return e?mie(e):[]},[e]),g=w.useRef({}),p=function(){g.current={}};n||p();var m=Wm(function(){if(e&&t&&n){let hr=function(zr,Fi){var Hn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Zt,ni=j.x+zr,Ln=j.y+Fi,Wn=ni+Ye,ii=Ln+Re,Oi=Math.max(ni,Hn.left),sn=Math.max(Ln,Hn.top),an=Math.min(Wn,Hn.right),Dn=Math.min(ii,Hn.bottom);return Math.max(0,(an-Oi)*(Dn-sn))},yr=function(){Fr=j.y+un,Oe=Fr+Re,lt=j.x+xn,It=lt+Ye};var b,y,C=e,x=C.ownerDocument,k=H3(C),I=k.getComputedStyle(C),L=I.width,D=I.height,R=I.position,P=C.style.left,M=C.style.top,O=C.style.right,B=C.style.bottom,F=Qe(Qe({},r[i]),o),H=x.createElement("div");(b=C.parentElement)===null||b===void 0||b.appendChild(H),H.style.left="".concat(C.offsetLeft,"px"),H.style.top="".concat(C.offsetTop,"px"),H.style.position=R,H.style.height="".concat(C.offsetHeight,"px"),H.style.width="".concat(C.offsetWidth,"px"),C.style.left="0",C.style.top="0",C.style.right="auto",C.style.bottom="auto";var V;if(Array.isArray(t))V={x:t[0],y:t[1],width:0,height:0};else{var $=t.getBoundingClientRect();V={x:$.x,y:$.y,width:$.width,height:$.height}}var j=C.getBoundingClientRect(),Y=x.documentElement,ne=Y.clientWidth,se=Y.clientHeight,he=Y.scrollWidth,xe=Y.scrollHeight,_e=Y.scrollTop,Ie=Y.scrollLeft,Re=j.height,Ye=j.width,Ze=V.height,tt=V.width,Be={left:0,top:0,right:ne,bottom:se},kt={left:-Ie,top:-_e,right:he-Ie,bottom:xe-_e},Vt=F.htmlRegion,xt="visible",Kt="visibleFirst";Vt!=="scroll"&&Vt!==Kt&&(Vt=xt);var cn=Vt===Kt,wn=Rxe(kt,h),on=Rxe(Be,h),Zt=Vt===xt?on:wn,pe=cn?on:Zt;C.style.left="auto",C.style.top="auto",C.style.right="0",C.style.bottom="0";var me=C.getBoundingClientRect();C.style.left=P,C.style.top=M,C.style.right=O,C.style.bottom=B,(y=C.parentElement)===null||y===void 0||y.removeChild(H);var Z=GP(Math.round(Ye/parseFloat(L)*1e3)/1e3),G=GP(Math.round(Re/parseFloat(D)*1e3)/1e3);if(Z===0||G===0||x7(t)&&!ige(t))return;var K=F.offset,oe=F.targetOffset,le=Oxe(j,K),we=$t(le,2),Me=we[0],ft=we[1],Nt=Oxe(V,oe),Yt=$t(Nt,2),He=Yt[0],Dt=Yt[1];V.x-=He,V.y-=Dt;var ae=F.points||[],Se=$t(ae,2),Xe=Se[0],wt=Se[1],Tt=Pxe(wt),zt=Pxe(Xe),Mt=ST(V,Tt),On=ST(j,zt),Ni=Qe({},F),xn=Mt.x-On.x+Me,un=Mt.y-On.y+ft,ei=hr(xn,un),li=hr(xn,un,on),xi=ST(V,["t","l"]),br=ST(j,["t","l"]),Wr=ST(V,["b","r"]),ko=ST(j,["b","r"]),oo=F.overflow||{},ea=oo.adjustX,xr=oo.adjustY,Hi=oo.shiftX,Ht=oo.shiftY,Qn=function(Fi){return typeof Fi=="boolean"?Fi:Fi>=0},Fr,Oe,lt,It;yr();var tn=Qn(xr),Je=zt[0]===Tt[0];if(tn&&zt[0]==="t"&&(Oe>pe.bottom||g.current.bt)){var ve=un;Je?ve-=Re-Ze:ve=xi.y-ko.y-ft;var je=hr(xn,ve),Le=hr(xn,ve,on);je>ei||je===ei&&(!cn||Le>=li)?(g.current.bt=!0,un=ve,ft=-ft,Ni.points=[Y0(zt,0),Y0(Tt,0)]):g.current.bt=!1}if(tn&&zt[0]==="b"&&(Fr<pe.top||g.current.tb)){var fe=un;Je?fe+=Re-Ze:fe=Wr.y-br.y-ft;var Fe=hr(xn,fe),ot=hr(xn,fe,on);Fe>ei||Fe===ei&&(!cn||ot>=li)?(g.current.tb=!0,un=fe,ft=-ft,Ni.points=[Y0(zt,0),Y0(Tt,0)]):g.current.tb=!1}var Ue=Qn(ea),Qt=zt[1]===Tt[1];if(Ue&&zt[1]==="l"&&(It>pe.right||g.current.rl)){var gn=xn;Qt?gn-=Ye-tt:gn=xi.x-ko.x-Me;var Pn=hr(gn,un),Zn=hr(gn,un,on);Pn>ei||Pn===ei&&(!cn||Zn>=li)?(g.current.rl=!0,xn=gn,Me=-Me,Ni.points=[Y0(zt,1),Y0(Tt,1)]):g.current.rl=!1}if(Ue&&zt[1]==="r"&&(lt<pe.left||g.current.lr)){var wi=xn;Qt?wi+=Ye-tt:wi=Wr.x-br.x-Me;var Sn=hr(wi,un),Xt=hr(wi,un,on);Sn>ei||Sn===ei&&(!cn||Xt>=li)?(g.current.lr=!0,xn=wi,Me=-Me,Ni.points=[Y0(zt,1),Y0(Tt,1)]):g.current.lr=!1}yr();var ti=Hi===!0?0:Hi;typeof ti=="number"&&(lt<on.left&&(xn-=lt-on.left-Me,V.x+tt<on.left+ti&&(xn+=V.x-on.left+tt-ti)),It>on.right&&(xn-=It-on.right-Me,V.x>on.right-ti&&(xn+=V.x-on.right+ti)));var or=Ht===!0?0:Ht;typeof or=="number"&&(Fr<on.top&&(un-=Fr-on.top-ft,V.y+Ze<on.top+or&&(un+=V.y-on.top+Ze-or)),Oe>on.bottom&&(un-=Oe-on.bottom-ft,V.y>on.bottom-or&&(un+=V.y-on.bottom+or)));var Dr=j.x+xn,xa=Dr+Ye,pa=j.y+un,Ba=pa+Re,Uo=V.x,Xo=Uo+tt,qo=V.y,Ll=qo+Ze,yc=Math.max(Dr,Uo),ci=Math.min(xa,Xo),lo=(yc+ci)/2,To=lo-Dr,Bs=Math.max(pa,qo),ns=Math.min(Ba,Ll),$s=(Bs+ns)/2,_o=$s-pa;s==null||s(e,Ni);var Ar=me.right-j.x-(xn+j.width),Gr=me.bottom-j.y-(un+j.height);u({ready:!0,offsetX:xn/Z,offsetY:un/G,offsetR:Ar/Z,offsetB:Gr/G,arrowX:To/Z,arrowY:_o/G,scaleX:Z,scaleY:G,align:Ni})}}),_=function(){d.current+=1;var y=d.current;Promise.resolve().then(function(){d.current===y&&m()})},v=function(){u(function(y){return Qe(Qe({},y),{},{ready:!1})})};return wd(v,[i]),wd(function(){n||v()},[n]),[c.ready,c.offsetX,c.offsetY,c.offsetR,c.offsetB,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,_]}function k4t(n,e,t,i,r){wd(function(){if(n&&e&&t){let d=function(){i(),r()};var o=e,s=t,a=mie(o),l=mie(s),c=H3(s),u=new Set([c].concat(Ir(a),Ir(l)));return u.forEach(function(h){h.addEventListener("scroll",d,{passive:!0})}),c.addEventListener("resize",d,{passive:!0}),i(),function(){u.forEach(function(h){h.removeEventListener("scroll",d),c.removeEventListener("resize",d)})}}},[n,e,t])}function T4t(n,e,t,i,r,o,s,a){var l=w.useRef(n),c=w.useRef(!1);l.current!==n&&(c.current=!0,l.current=n),w.useEffect(function(){var u=af(function(){c.current=!1});return function(){af.cancel(u)}},[n]),w.useEffect(function(){if(e&&i&&(!r||o)){var u=function(){var k=!1,I=function(R){var P=R.target;k=s(P)},L=function(R){var P=R.target;!c.current&&l.current&&!k&&!s(P)&&a(!1)};return[I,L]},d=u(),h=$t(d,2),g=h[0],p=h[1],m=u(),_=$t(m,2),v=_[0],b=_[1],y=H3(i);y.addEventListener("mousedown",g,!0),y.addEventListener("click",p,!0),y.addEventListener("contextmenu",p,!0);var C=R7(t);return C&&(C.addEventListener("mousedown",v,!0),C.addEventListener("click",b,!0),C.addEventListener("contextmenu",b,!0)),function(){y.removeEventListener("mousedown",g,!0),y.removeEventListener("click",p,!0),y.removeEventListener("contextmenu",p,!0),C&&(C.removeEventListener("mousedown",v,!0),C.removeEventListener("click",b,!0),C.removeEventListener("contextmenu",b,!0))}}},[e,t,i,r,o])}var I4t=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function L4t(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v$e,e=w.forwardRef(function(t,i){var r=t.prefixCls,o=r===void 0?"rc-trigger-popup":r,s=t.children,a=t.action,l=a===void 0?"hover":a,c=t.showAction,u=t.hideAction,d=t.popupVisible,h=t.defaultPopupVisible,g=t.onPopupVisibleChange,p=t.afterPopupVisibleChange,m=t.mouseEnterDelay,_=t.mouseLeaveDelay,v=_===void 0?.1:_,b=t.focusDelay,y=t.blurDelay,C=t.mask,x=t.maskClosable,k=x===void 0?!0:x,I=t.getPopupContainer,L=t.forceRender,D=t.autoDestroy,R=t.destroyPopupOnHide,P=t.popup,M=t.popupClassName,O=t.popupStyle,B=t.popupPlacement,F=t.builtinPlacements,H=F===void 0?{}:F,V=t.popupAlign,$=t.zIndex,j=t.stretch,Y=t.getPopupClassNameFromAlign,ne=t.fresh,se=t.alignPoint,he=t.onPopupClick,xe=t.onPopupAlign,_e=t.arrow,Ie=t.popupMotion,Re=t.maskMotion,Ye=t.popupTransitionName,Ze=t.popupAnimation,tt=t.maskTransitionName,Be=t.maskAnimation,kt=t.className,Vt=t.getTriggerDOMNode,xt=uu(t,I4t),Kt=D||R||!1,cn=w.useState(!1),wn=$t(cn,2),on=wn[0],Zt=wn[1];wd(function(){Zt(m4t())},[]);var pe=w.useRef({}),me=w.useContext(Lxe),Z=w.useMemo(function(){return{registerSubPopup:function(vt,Jt){pe.current[vt]=Jt,me==null||me.registerSubPopup(vt,Jt)}}},[me]),G=iMt(),K=w.useState(null),oe=$t(K,2),le=oe[0],we=oe[1],Me=Wm(function(it){x7(it)&&le!==it&&we(it),me==null||me.registerSubPopup(G,it)}),ft=w.useState(null),Nt=$t(ft,2),Yt=Nt[0],He=Nt[1],Dt=w.useRef(null),ae=Wm(function(it){x7(it)&&Yt!==it&&(He(it),Dt.current=it)}),Se=w.Children.only(s),Xe=(Se==null?void 0:Se.props)||{},wt={},Tt=Wm(function(it){var vt,Jt,Nn=Yt;return(Nn==null?void 0:Nn.contains(it))||((vt=R7(Nn))===null||vt===void 0?void 0:vt.host)===it||it===Nn||(le==null?void 0:le.contains(it))||((Jt=R7(le))===null||Jt===void 0?void 0:Jt.host)===it||it===le||Object.values(pe.current).some(function(En){return(En==null?void 0:En.contains(it))||it===En})}),zt=Axe(o,Ie,Ze,Ye),Mt=Axe(o,Re,Be,tt),On=w.useState(h||!1),Ni=$t(On,2),xn=Ni[0],un=Ni[1],ei=d??xn,li=Wm(function(it){d===void 0&&un(it)});wd(function(){un(d||!1)},[d]);var xi=w.useRef(ei);xi.current=ei;var br=Wm(function(it){Yp.flushSync(function(){ei!==it&&(li(it),g==null||g(it))})}),Wr=w.useRef(),ko=function(){clearTimeout(Wr.current)},oo=function(vt){var Jt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;ko(),Jt===0?br(vt):Wr.current=setTimeout(function(){br(vt)},Jt*1e3)};w.useEffect(function(){return ko},[]);var ea=w.useState(!1),xr=$t(ea,2),Hi=xr[0],Ht=xr[1];wd(function(it){(!it||ei)&&Ht(!0)},[ei]);var Qn=w.useState(null),Fr=$t(Qn,2),Oe=Fr[0],lt=Fr[1],It=w.useState([0,0]),tn=$t(It,2),Je=tn[0],ve=tn[1],je=function(vt){ve([vt.clientX,vt.clientY])},Le=x4t(ei,le,se?Je:Yt,B,H,V,xe),fe=$t(Le,11),Fe=fe[0],ot=fe[1],Ue=fe[2],Qt=fe[3],gn=fe[4],Pn=fe[5],Zn=fe[6],wi=fe[7],Sn=fe[8],Xt=fe[9],ti=fe[10],or=w4t(on,l,c,u),Dr=$t(or,2),xa=Dr[0],pa=Dr[1],Ba=xa.has("click"),Uo=pa.has("click")||pa.has("contextMenu"),Xo=Wm(function(){Hi||ti()}),qo=function(){xi.current&&se&&Uo&&oo(!1)};k4t(ei,Yt,le,Xo,qo),wd(function(){Xo()},[Je,B]),wd(function(){ei&&!(H!=null&&H[B])&&Xo()},[JSON.stringify(V)]);var Ll=w.useMemo(function(){var it=E4t(H,o,Xt,se);return St(it,Y==null?void 0:Y(Xt))},[Xt,Y,H,o,se]);w.useImperativeHandle(i,function(){return{nativeElement:Dt.current,forceAlign:Xo}});var yc=w.useState(0),ci=$t(yc,2),lo=ci[0],To=ci[1],Bs=w.useState(0),ns=$t(Bs,2),$s=ns[0],_o=ns[1],Ar=function(){if(j&&Yt){var vt=Yt.getBoundingClientRect();To(vt.width),_o(vt.height)}},Gr=function(){Ar(),Xo()},hr=function(vt){Ht(!1),ti(),p==null||p(vt)},yr=function(){return new Promise(function(vt){Ar(),lt(function(){return vt})})};wd(function(){Oe&&(ti(),Oe(),lt(null))},[Oe]);function zr(it,vt,Jt,Nn){wt[it]=function(En){var Kn;Nn==null||Nn(En),oo(vt,Jt);for(var Cr=arguments.length,Yr=new Array(Cr>1?Cr-1:0),Br=1;Br<Cr;Br++)Yr[Br-1]=arguments[Br];(Kn=Xe[it])===null||Kn===void 0||Kn.call.apply(Kn,[Xe,En].concat(Yr))}}(Ba||Uo)&&(wt.onClick=function(it){var vt;xi.current&&Uo?oo(!1):!xi.current&&Ba&&(je(it),oo(!0));for(var Jt=arguments.length,Nn=new Array(Jt>1?Jt-1:0),En=1;En<Jt;En++)Nn[En-1]=arguments[En];(vt=Xe.onClick)===null||vt===void 0||vt.call.apply(vt,[Xe,it].concat(Nn))}),T4t(ei,Uo,Yt,le,C,k,Tt,oo);var Fi=xa.has("hover"),Hn=pa.has("hover"),ni,Ln;Fi&&(zr("onMouseEnter",!0,m,function(it){je(it)}),zr("onPointerEnter",!0,m,function(it){je(it)}),ni=function(){(ei||Hi)&&oo(!0,m)},se&&(wt.onMouseMove=function(it){var vt;(vt=Xe.onMouseMove)===null||vt===void 0||vt.call(Xe,it)})),Hn&&(zr("onMouseLeave",!1,v),zr("onPointerLeave",!1,v),Ln=function(){oo(!1,v)}),xa.has("focus")&&zr("onFocus",!0,b),pa.has("focus")&&zr("onBlur",!1,y),xa.has("contextMenu")&&(wt.onContextMenu=function(it){var vt;xi.current&&pa.has("contextMenu")?oo(!1):(je(it),oo(!0)),it.preventDefault();for(var Jt=arguments.length,Nn=new Array(Jt>1?Jt-1:0),En=1;En<Jt;En++)Nn[En-1]=arguments[En];(vt=Xe.onContextMenu)===null||vt===void 0||vt.call.apply(vt,[Xe,it].concat(Nn))}),kt&&(wt.className=St(Xe.className,kt));var Wn=Qe(Qe({},Xe),wt),ii={},Oi=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Oi.forEach(function(it){xt[it]&&(ii[it]=function(){for(var vt,Jt=arguments.length,Nn=new Array(Jt),En=0;En<Jt;En++)Nn[En]=arguments[En];(vt=Wn[it])===null||vt===void 0||vt.call.apply(vt,[Wn].concat(Nn)),xt[it].apply(xt,Nn)})});var sn=w.cloneElement(Se,Qe(Qe({},Wn),ii)),an={x:Pn,y:Zn},Dn=_e?Qe({},_e!==!0?_e:{}):null;return w.createElement(w.Fragment,null,w.createElement(Kfe,{disabled:!ei,ref:ae,onResize:Gr},w.createElement(C4t,{getTriggerDOMNode:Vt},sn)),w.createElement(Lxe.Provider,{value:Z},w.createElement(y4t,{portal:n,ref:Me,prefixCls:o,popup:P,className:St(M,Ll),style:O,target:Yt,onMouseEnter:ni,onMouseLeave:Ln,onPointerEnter:ni,zIndex:$,open:ei,keepDom:Hi,fresh:ne,onClick:he,mask:C,motion:zt,maskMotion:Mt,onVisibleChanged:hr,onPrepare:yr,forceRender:L,autoDestroy:Kt,getPopupContainer:I,align:Xt,arrow:Dn,arrowPos:an,ready:Fe,offsetX:ot,offsetY:Ue,offsetR:Qt,offsetB:gn,onAlign:Xo,stretch:j,targetWidth:lo/wi,targetHeight:$s/Sn})))});return e}const D4t=L4t(v$e);function R$e(n,e,t){return St({[`${n}-status-success`]:e==="success",[`${n}-status-warning`]:e==="warning",[`${n}-status-error`]:e==="error",[`${n}-status-validating`]:e==="validating",[`${n}-has-feedback`]:t})}const N$e=(n,e)=>e||n;var O$e={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Co,function(){return function(t,i){i.prototype.weekday=function(r){var o=this.$locale().weekStart||0,s=this.$W,a=(s<o?s+7:s)-o;return this.$utils().u(r)?a:this.subtract(a,"day").add(r,"day")}}})})(O$e);var A4t=O$e.exports;const R4t=ja(A4t);var P$e={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Co,function(){return function(t,i,r){var o=i.prototype,s=function(d){return d&&(d.indexOf?d:d.s)},a=function(d,h,g,p,m){var _=d.name?d:d.$locale(),v=s(_[h]),b=s(_[g]),y=v||b.map(function(x){return x.slice(0,p)});if(!m)return y;var C=_.weekStart;return y.map(function(x,k){return y[(k+(C||0))%7]})},l=function(){return r.Ls[r.locale()]},c=function(d,h){return d.formats[h]||function(g){return g.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(p,m,_){return m||_.slice(1)})}(d.formats[h.toUpperCase()])},u=function(){var d=this;return{months:function(h){return h?h.format("MMMM"):a(d,"months")},monthsShort:function(h){return h?h.format("MMM"):a(d,"monthsShort","months",3)},firstDayOfWeek:function(){return d.$locale().weekStart||0},weekdays:function(h){return h?h.format("dddd"):a(d,"weekdays")},weekdaysMin:function(h){return h?h.format("dd"):a(d,"weekdaysMin","weekdays",2)},weekdaysShort:function(h){return h?h.format("ddd"):a(d,"weekdaysShort","weekdays",3)},longDateFormat:function(h){return c(d.$locale(),h)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};o.localeData=function(){return u.bind(this)()},r.localeData=function(){var d=l();return{firstDayOfWeek:function(){return d.weekStart||0},weekdays:function(){return r.weekdays()},weekdaysShort:function(){return r.weekdaysShort()},weekdaysMin:function(){return r.weekdaysMin()},months:function(){return r.months()},monthsShort:function(){return r.monthsShort()},longDateFormat:function(h){return c(d,h)},meridiem:d.meridiem,ordinal:d.ordinal}},r.months=function(){return a(l(),"months")},r.monthsShort=function(){return a(l(),"monthsShort","months",3)},r.weekdays=function(d){return a(l(),"weekdays",null,null,d)},r.weekdaysShort=function(d){return a(l(),"weekdaysShort","weekdays",3,d)},r.weekdaysMin=function(d){return a(l(),"weekdaysMin","weekdays",2,d)}}})})(P$e);var N4t=P$e.exports;const O4t=ja(N4t);var M$e={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Co,function(){var t="week",i="year";return function(r,o,s){var a=o.prototype;a.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var c=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var u=s(this).startOf(i).add(1,i).date(c),d=s(this).endOf(t);if(u.isBefore(d))return 1}var h=s(this).startOf(i).date(c).startOf(t).subtract(1,"millisecond"),g=this.diff(h,t,!0);return g<0?s(this).startOf("week").week():Math.ceil(g)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})})(M$e);var P4t=M$e.exports;const M4t=ja(P4t);var F$e={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Co,function(){return function(t,i){i.prototype.weekYear=function(){var r=this.month(),o=this.week(),s=this.year();return o===1&&r===11?s+1:r===0&&o>=52?s-1:s}}})})(F$e);var F4t=F$e.exports;const B4t=ja(F4t);var B$e={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Co,function(){return function(t,i){var r=i.prototype,o=r.format;r.format=function(s){var a=this,l=this.$locale();if(!this.isValid())return o.bind(this)(s);var c=this.$utils(),u=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(d){switch(d){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return l.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return l.ordinal(a.week(),"W");case"w":case"ww":return c.s(a.week(),d==="w"?1:2,"0");case"W":case"WW":return c.s(a.isoWeek(),d==="W"?1:2,"0");case"k":case"kk":return c.s(String(a.$H===0?24:a.$H),d==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return d}});return o.bind(this)(u)}}})})(B$e);var $4t=B$e.exports;const V4t=ja($4t);var $$e={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Co,function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},i=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d\d/,o=/\d\d?/,s=/\d*[^-_:/,()\s\d]+/,a={},l=function(m){return(m=+m)+(m>68?1900:2e3)},c=function(m){return function(_){this[m]=+_}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(m){(this.zone||(this.zone={})).offset=function(_){if(!_||_==="Z")return 0;var v=_.match(/([+-]|\d\d)/g),b=60*v[1]+(+v[2]||0);return b===0?0:v[0]==="+"?-b:b}(m)}],d=function(m){var _=a[m];return _&&(_.indexOf?_:_.s.concat(_.f))},h=function(m,_){var v,b=a.meridiem;if(b){for(var y=1;y<=24;y+=1)if(m.indexOf(b(y,0,_))>-1){v=y>12;break}}else v=m===(_?"pm":"PM");return v},g={A:[s,function(m){this.afternoon=h(m,!1)}],a:[s,function(m){this.afternoon=h(m,!0)}],S:[/\d/,function(m){this.milliseconds=100*+m}],SS:[r,function(m){this.milliseconds=10*+m}],SSS:[/\d{3}/,function(m){this.milliseconds=+m}],s:[o,c("seconds")],ss:[o,c("seconds")],m:[o,c("minutes")],mm:[o,c("minutes")],H:[o,c("hours")],h:[o,c("hours")],HH:[o,c("hours")],hh:[o,c("hours")],D:[o,c("day")],DD:[r,c("day")],Do:[s,function(m){var _=a.ordinal,v=m.match(/\d+/);if(this.day=v[0],_)for(var b=1;b<=31;b+=1)_(b).replace(/\[|\]/g,"")===m&&(this.day=b)}],M:[o,c("month")],MM:[r,c("month")],MMM:[s,function(m){var _=d("months"),v=(d("monthsShort")||_.map(function(b){return b.slice(0,3)})).indexOf(m)+1;if(v<1)throw new Error;this.month=v%12||v}],MMMM:[s,function(m){var _=d("months").indexOf(m)+1;if(_<1)throw new Error;this.month=_%12||_}],Y:[/[+-]?\d+/,c("year")],YY:[r,function(m){this.year=l(m)}],YYYY:[/\d{4}/,c("year")],Z:u,ZZ:u};function p(m){var _,v;_=m,v=a&&a.formats;for(var b=(m=_.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(D,R,P){var M=P&&P.toUpperCase();return R||v[P]||t[P]||v[M].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(O,B,F){return B||F.slice(1)})})).match(i),y=b.length,C=0;C<y;C+=1){var x=b[C],k=g[x],I=k&&k[0],L=k&&k[1];b[C]=L?{regex:I,parser:L}:x.replace(/^\[|\]$/g,"")}return function(D){for(var R={},P=0,M=0;P<y;P+=1){var O=b[P];if(typeof O=="string")M+=O.length;else{var B=O.regex,F=O.parser,H=D.slice(M),V=B.exec(H)[0];F.call(R,V),D=D.replace(V,"")}}return function($){var j=$.afternoon;if(j!==void 0){var Y=$.hours;j?Y<12&&($.hours+=12):Y===12&&($.hours=0),delete $.afternoon}}(R),R}}return function(m,_,v){v.p.customParseFormat=!0,m&&m.parseTwoDigitYear&&(l=m.parseTwoDigitYear);var b=_.prototype,y=b.parse;b.parse=function(C){var x=C.date,k=C.utc,I=C.args;this.$u=k;var L=I[1];if(typeof L=="string"){var D=I[2]===!0,R=I[3]===!0,P=D||R,M=I[2];R&&(M=I[2]),a=this.$locale(),!D&&M&&(a=v.Ls[M]),this.$d=function(H,V,$){try{if(["x","X"].indexOf(V)>-1)return new Date((V==="X"?1e3:1)*H);var j=p(V)(H),Y=j.year,ne=j.month,se=j.day,he=j.hours,xe=j.minutes,_e=j.seconds,Ie=j.milliseconds,Re=j.zone,Ye=new Date,Ze=se||(Y||ne?1:Ye.getDate()),tt=Y||Ye.getFullYear(),Be=0;Y&&!ne||(Be=ne>0?ne-1:Ye.getMonth());var kt=he||0,Vt=xe||0,xt=_e||0,Kt=Ie||0;return Re?new Date(Date.UTC(tt,Be,Ze,kt,Vt,xt,Kt+60*Re.offset*1e3)):$?new Date(Date.UTC(tt,Be,Ze,kt,Vt,xt,Kt)):new Date(tt,Be,Ze,kt,Vt,xt,Kt)}catch{return new Date("")}}(x,L,k),this.init(),M&&M!==!0&&(this.$L=this.locale(M).$L),P&&x!=this.format(L)&&(this.$d=new Date("")),a={}}else if(L instanceof Array)for(var O=L.length,B=1;B<=O;B+=1){I[1]=L[B-1];var F=v.apply(this,I);if(F.isValid()){this.$d=F.$d,this.$L=F.$L,this.init();break}B===O&&(this.$d=new Date(""))}else y.call(this,C)}}})})($$e);var H4t=$$e.exports;const dge=ja(H4t);Cn.extend(dge);Cn.extend(V4t);Cn.extend(R4t);Cn.extend(O4t);Cn.extend(M4t);Cn.extend(B4t);Cn.extend(function(n,e){var t=e.prototype,i=t.format;t.format=function(o){var s=(o||"").replace("Wo","wo");return i.bind(this)(s)}});var W4t={bn_BD:"bn-bd",by_BY:"be",en_GB:"en-gb",en_US:"en",fr_BE:"fr",fr_CA:"fr-ca",hy_AM:"hy-am",kmr_IQ:"ku",nl_BE:"nl-be",pt_BR:"pt-br",zh_CN:"zh-cn",zh_HK:"zh-hk",zh_TW:"zh-tw"},CS=function(e){var t=W4t[e];return t||e.split("_")[0]},Mxe=function(){uBe(!1,"Not match any format. Please help to fire a issue about this.")},z4t={getNow:function(){return Cn()},getFixedDate:function(e){return Cn(e,["YYYY-M-DD","YYYY-MM-DD"])},getEndDate:function(e){return e.endOf("month")},getWeekDay:function(e){var t=e.locale("en");return t.weekday()+t.localeData().firstDayOfWeek()},getYear:function(e){return e.year()},getMonth:function(e){return e.month()},getDate:function(e){return e.date()},getHour:function(e){return e.hour()},getMinute:function(e){return e.minute()},getSecond:function(e){return e.second()},addYear:function(e,t){return e.add(t,"year")},addMonth:function(e,t){return e.add(t,"month")},addDate:function(e,t){return e.add(t,"day")},setYear:function(e,t){return e.year(t)},setMonth:function(e,t){return e.month(t)},setDate:function(e,t){return e.date(t)},setHour:function(e,t){return e.hour(t)},setMinute:function(e,t){return e.minute(t)},setSecond:function(e,t){return e.second(t)},isAfter:function(e,t){return e.isAfter(t)},isValidate:function(e){return e.isValid()},locale:{getWeekFirstDay:function(e){return Cn().locale(CS(e)).localeData().firstDayOfWeek()},getWeekFirstDate:function(e,t){return t.locale(CS(e)).weekday(0)},getWeek:function(e,t){return t.locale(CS(e)).week()},getShortWeekDays:function(e){return Cn().locale(CS(e)).localeData().weekdaysMin()},getShortMonths:function(e){return Cn().locale(CS(e)).localeData().monthsShort()},format:function(e,t,i){return t.locale(CS(e)).format(i)},parse:function(e,t,i){for(var r=CS(e),o=0;o<i.length;o+=1){var s=i[o],a=t;if(s.includes("wo")||s.includes("Wo")){for(var l=a.split("-")[0],c=a.split("-")[1],u=Cn(l,"YYYY").startOf("year").locale(r),d=0;d<=52;d+=1){var h=u.add(d,"week");if(h.format("Wo")===c)return h}return Mxe(),null}var g=Cn(a,s,!0).locale(r);if(g.isValid())return g}return t&&Mxe(),null}}},Gm=10,Dy=Gm*10,fO=7;function Ek(n,e){if(!n&&!e)return!0;if(!n||!e)return!1}function j4t(n,e,t){var i=Ek(e,t);if(typeof i=="boolean")return i;var r=Math.floor(n.getYear(e)/10),o=Math.floor(n.getYear(t)/10);return r===o}function W3(n,e,t){var i=Ek(e,t);return typeof i=="boolean"?i:n.getYear(e)===n.getYear(t)}function _ie(n,e){var t=Math.floor(n.getMonth(e)/3);return t+1}function V$e(n,e,t){var i=Ek(e,t);return typeof i=="boolean"?i:W3(n,e,t)&&_ie(n,e)===_ie(n,t)}function hge(n,e,t){var i=Ek(e,t);return typeof i=="boolean"?i:W3(n,e,t)&&n.getMonth(e)===n.getMonth(t)}function Ay(n,e,t){var i=Ek(e,t);return typeof i=="boolean"?i:n.getYear(e)===n.getYear(t)&&n.getMonth(e)===n.getMonth(t)&&n.getDate(e)===n.getDate(t)}function U4t(n,e,t){var i=Ek(e,t);return typeof i=="boolean"?i:n.getHour(e)===n.getHour(t)&&n.getMinute(e)===n.getMinute(t)&&n.getSecond(e)===n.getSecond(t)}function g8(n,e,t,i){var r=Ek(t,i);return typeof r=="boolean"?r:W3(n,t,i)&&n.locale.getWeek(e,t)===n.locale.getWeek(e,i)}function TD(n,e,t){return Ay(n,e,t)&&U4t(n,e,t)}function vN(n,e,t,i){return!e||!t||!i?!1:!Ay(n,e,i)&&!Ay(n,t,i)&&n.isAfter(i,e)&&n.isAfter(t,i)}function q4t(n,e,t){var i=e.locale.getWeekFirstDay(n),r=e.setDate(t,1),o=e.getWeekDay(r),s=e.addDate(r,i-o);return e.getMonth(s)===e.getMonth(t)&&e.getDate(s)>1&&(s=e.addDate(s,-7)),s}function gO(n,e,t){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;switch(e){case"year":return t.addYear(n,i*10);case"quarter":case"month":return t.addYear(n,i);default:return t.addMonth(n,i)}}function kd(n,e){var t=e.generateConfig,i=e.locale,r=e.format;return typeof r=="function"?r(n):t.locale.format(i.locale,n,r)}function H$e(n,e){var t=e.generateConfig,i=e.locale,r=e.formatList;return!n||typeof r[0]=="function"?null:t.locale.parse(i.locale,n,r)}function M7(n){var e=n.cellDate,t=n.mode,i=n.disabledDate,r=n.generateConfig;if(!i)return!1;var o=function(p,m,_){for(var v=m;v<=_;){var b=void 0;switch(p){case"date":{if(b=r.setDate(e,v),!i(b))return!1;break}case"month":{if(b=r.setMonth(e,v),!M7({cellDate:b,mode:"month",generateConfig:r,disabledDate:i}))return!1;break}case"year":{if(b=r.setYear(e,v),!M7({cellDate:b,mode:"year",generateConfig:r,disabledDate:i}))return!1;break}}v+=1}return!0};switch(t){case"date":case"week":return i(e);case"month":{var s=1,a=r.getDate(r.getEndDate(e));return o("date",s,a)}case"quarter":{var l=Math.floor(r.getMonth(e)/3)*3,c=l+2;return o("month",l,c)}case"year":return o("month",0,11);case"decade":{var u=r.getYear(e),d=Math.floor(u/Gm)*Gm,h=d+Gm-1;return o("year",d,h)}}}function F7(n,e){var t=e.formatList,i=e.generateConfig,r=e.locale,o=N3(function(){if(!n)return[[""],""];for(var c="",u=[],d=0;d<t.length;d+=1){var h=t[d],g=kd(n,{generateConfig:i,locale:r,format:h});u.push(g),d===0&&(c=g)}return[u,c]},[n,t,r],function(c,u){return!TD(i,c[0],u[0])||!I7(c[1],u[1],!0)||!I7(c[2],u[2],!0)}),s=$t(o,2),a=s[0],l=s[1];return w.useMemo(function(){return[a,l]},[a.join(""),l])}function vie(n,e){var t=e.formatList,i=e.generateConfig,r=e.locale,o=w.useState(null),s=$t(o,2),a=s[0],l=s[1],c=w.useRef(null);function u(_){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(cancelAnimationFrame(c.current),v){l(_);return}c.current=requestAnimationFrame(function(){l(_)})}var d=F7(a,{formatList:t,generateConfig:i,locale:r}),h=$t(d,2),g=h[1];function p(_){u(_)}function m(){var _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;u(null,_)}return w.useEffect(function(){m(!0)},[n]),w.useEffect(function(){return function(){return cancelAnimationFrame(c.current)}},[]),[g,p,m]}var N6=new Map;function K4t(n,e){var t;function i(){ige(n)?e():t=af(function(){i()})}return i(),function(){af.cancel(t)}}function bie(n,e,t){if(N6.get(n)&&cancelAnimationFrame(N6.get(n)),t<=0){N6.set(n,requestAnimationFrame(function(){n.scrollTop=e}));return}var i=e-n.scrollTop,r=i/t*10;N6.set(n,requestAnimationFrame(function(){n.scrollTop+=r,n.scrollTop!==e&&bie(n,e,t-10)}))}function nA(n,e){var t=e.onLeftRight,i=e.onCtrlLeftRight,r=e.onUpDown,o=e.onPageUpDown,s=e.onEnter,a=n.which,l=n.ctrlKey,c=n.metaKey;switch(a){case Rn.LEFT:if(l||c){if(i)return i(-1),!0}else if(t)return t(-1),!0;break;case Rn.RIGHT:if(l||c){if(i)return i(1),!0}else if(t)return t(1),!0;break;case Rn.UP:if(r)return r(-1),!0;break;case Rn.DOWN:if(r)return r(1),!0;break;case Rn.PAGE_UP:if(o)return o(-1),!0;break;case Rn.PAGE_DOWN:if(o)return o(1),!0;break;case Rn.ENTER:if(s)return s(),!0;break}return!1}function W$e(n,e,t,i){var r=n;if(!r)switch(e){case"time":r=i?"hh:mm:ss a":"HH:mm:ss";break;case"week":r="gggg-wo";break;case"month":r="YYYY-MM";break;case"quarter":r="YYYY-[Q]Q";break;case"year":r="YYYY";break;default:r=t?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD"}return r}function z$e(n,e,t){var i=n==="time"?8:10,r=typeof e=="function"?e(t.getNow()).length:e.length;return Math.max(i,r)+2}var SR=null,O6=new Set;function G4t(n){return!SR&&typeof window<"u"&&window.addEventListener&&(SR=function(t){Ir(O6).forEach(function(i){i(t)})},window.addEventListener("mousedown",SR)),O6.add(n),function(){O6.delete(n),O6.size===0&&(window.removeEventListener("mousedown",SR),SR=null)}}function Y4t(n){var e=n.target;if(n.composed&&e.shadowRoot){var t;return((t=n.composedPath)===null||t===void 0?void 0:t.call(n)[0])||e}return e}var Q4t=function(e){return e==="month"||e==="date"?"year":e},X4t=function(e){return e==="date"?"month":e},Z4t=function(e){return e==="month"||e==="date"?"quarter":e},J4t=function(e){return e==="date"?"week":e},e3t={year:Q4t,month:X4t,quarter:Z4t,week:J4t,time:null,date:null};function j$e(n,e){return n.some(function(t){return t&&t.contains(e)})}function yie(n){var e=n.open,t=n.value,i=n.isClickOutside,r=n.triggerOpen,o=n.forwardKeyDown,s=n.onKeyDown,a=n.blurToCancel,l=n.changeOnBlur,c=n.onSubmit,u=n.onCancel,d=n.onFocus,h=n.onBlur,g=w.useState(!1),p=$t(g,2),m=p[0],_=p[1],v=w.useState(!1),b=$t(v,2),y=b[0],C=b[1],x=w.useRef(!1),k=w.useRef(!1),I=w.useRef(!1),L={onMouseDown:function(){_(!0),r(!0)},onKeyDown:function(R){var P=function(){I.current=!0};if(s(R,P),!I.current){switch(R.which){case Rn.ENTER:{e?c()!==!1&&_(!0):r(!0),R.preventDefault();return}case Rn.TAB:{m&&e&&!R.shiftKey?(_(!1),R.preventDefault()):!m&&e&&!o(R)&&R.shiftKey&&(_(!0),R.preventDefault());return}case Rn.ESC:{_(!0),u();return}}!e&&![Rn.SHIFT].includes(R.which)?r(!0):m||o(R)}},onFocus:function(R){_(!0),C(!0),d&&d(R)},onBlur:function(R){if(x.current||!i(document.activeElement)){x.current=!1;return}a?setTimeout(function(){for(var P=document,M=P.activeElement;M&&M.shadowRoot;)M=M.shadowRoot.activeElement;i(M)&&u()},0):e&&(r(!1),k.current&&c()),C(!1),h==null||h(R)}};return w.useEffect(function(){k.current=!1},[e]),w.useEffect(function(){k.current=!0},[t]),w.useEffect(function(){return G4t(function(D){var R=Y4t(D),P=i(R);e&&(P?!l&&!a&&(!y||P)&&r(!1):(x.current=!0,af(function(){x.current=!1})))})}),[L,{focused:y,typing:m}]}function U$e(n,e){return w.useMemo(function(){return n||(e?(Uu(!1,"`ranges` is deprecated. Please use `presets` instead."),Object.entries(e).map(function(t){var i=$t(t,2),r=i[0],o=i[1];return{label:r,value:o}})):[])},[n,e])}function Cie(n){var e=n.valueTexts,t=n.onTextChange,i=w.useState(""),r=$t(i,2),o=r[0],s=r[1],a=w.useRef([]);a.current=e;function l(u){s(u),t(u)}function c(){s(a.current[0])}return wd(function(){e.every(function(u){return u!==o})&&c()},[e.join("||")]),[o,l,c]}var cf=w.createContext({});function q$e(n){var e=n.cellRender,t=n.monthCellRender,i=n.dateRender,r=te.useMemo(function(){if(e)return e;if(!(!t&&!i))return function(o,s){var a=o;return i&&s.type==="date"?i(a,s.today):t&&s.type==="month"?t(a,s.locale):s.originNode}},[e,t,i]);return r}function K$e(n,e){for(var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0",i=String(n);i.length<e;)i="".concat(t).concat(n);return i}var t3t=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return t};function G$e(n){return n==null?[]:Array.isArray(n)?n:[n]}function io(n,e){return n?n[e]:null}function lp(n,e,t){var i=[io(n,0),io(n,1)];return i[t]=typeof e=="function"?e(i[t]):e,!i[0]&&!i[1]?null:i}function Fxe(n){return typeof n=="function"?n():n}function Ej(n){var e=n.cellPrefixCls,t=n.generateConfig,i=n.rangedValue,r=n.hoverRangedValue,o=n.isInView,s=n.isSameCell,a=n.offsetCell,l=n.today,c=n.value;function u(d){var h,g=a(d,-1),p=a(d,1),m=io(i,0),_=io(i,1),v=io(r,0),b=io(r,1),y=vN(t,v,b,d);function C(R){return s(m,R)}function x(R){return s(_,R)}var k=s(v,d),I=s(b,d),L=(y||I)&&(!o(g)||x(g)),D=(y||k)&&(!o(p)||C(p));return h={},$e(h,"".concat(e,"-in-view"),o(d)),$e(h,"".concat(e,"-in-range"),vN(t,m,_,d)),$e(h,"".concat(e,"-range-start"),C(d)),$e(h,"".concat(e,"-range-end"),x(d)),$e(h,"".concat(e,"-range-start-single"),C(d)&&!_),$e(h,"".concat(e,"-range-end-single"),x(d)&&!m),$e(h,"".concat(e,"-range-start-near-hover"),C(d)&&(s(g,v)||vN(t,v,b,g))),$e(h,"".concat(e,"-range-end-near-hover"),x(d)&&(s(p,b)||vN(t,v,b,p))),$e(h,"".concat(e,"-range-hover"),y),$e(h,"".concat(e,"-range-hover-start"),k),$e(h,"".concat(e,"-range-hover-end"),I),$e(h,"".concat(e,"-range-hover-edge-start"),L),$e(h,"".concat(e,"-range-hover-edge-end"),D),$e(h,"".concat(e,"-range-hover-edge-start-near-range"),L&&s(g,_)),$e(h,"".concat(e,"-range-hover-edge-end-near-range"),D&&s(p,m)),$e(h,"".concat(e,"-today"),s(l,d)),$e(h,"".concat(e,"-selected"),s(c,d)),h}return u}var xk=w.createContext({});function Y$e(n,e,t,i,r){var o=n.setHour(e,t);return o=n.setMinute(o,i),o=n.setSecond(o,r),o}function Q$e(n,e,t){if(!t)return e;var i=e;return i=n.setHour(i,n.getHour(t)),i=n.setMinute(i,n.getMinute(t)),i=n.setSecond(i,n.getSecond(t)),i}function n3t(n,e,t,i,r,o){var s=Math.floor(n/i)*i;if(s<n)return[s,60-r,60-o];var a=Math.floor(e/r)*r;if(a<e)return[s,a,60-o];var l=Math.floor(t/o)*o;return[s,a,l]}function i3t(n,e){var t=n.getYear(e),i=n.getMonth(e)+1,r=n.getEndDate(n.getFixedDate("".concat(t,"-").concat(i,"-01"))),o=n.getDate(r),s=i<10?"0".concat(i):"".concat(i);return"".concat(t,"-").concat(s,"-").concat(o)}function z3(n){for(var e=n.prefixCls,t=n.disabledDate,i=n.onSelect,r=n.picker,o=n.rowNum,s=n.colNum,a=n.prefixColumn,l=n.rowClassName,c=n.baseDate,u=n.getCellClassName,d=n.getCellText,h=n.getCellNode,g=n.getCellDate,p=n.generateConfig,m=n.titleCell,_=n.headerCells,v=w.useContext(cf),b=v.onDateMouseEnter,y=v.onDateMouseLeave,C=v.mode,x="".concat(e,"-cell"),k=[],I=0;I<o;I+=1){for(var L=[],D=void 0,R=function(){var O,B=I*s+P,F=g(c,B),H=M7({cellDate:F,mode:C,disabledDate:t,generateConfig:p});P===0&&(D=F,a&&L.push(a(D)));var V=m&&m(F),$=w.createElement("div",{className:"".concat(x,"-inner")},d(F));L.push(w.createElement("td",{key:P,title:V,className:St(x,Qe((O={},$e(O,"".concat(x,"-disabled"),H),$e(O,"".concat(x,"-start"),d(F)===1||r==="year"&&Number(V)%10===0),$e(O,"".concat(x,"-end"),V===i3t(p,F)||r==="year"&&Number(V)%10===9),O),u(F))),onClick:function(){H||i(F)},onMouseEnter:function(){!H&&b&&b(F)},onMouseLeave:function(){!H&&y&&y(F)}},h?h(F,$):$))},P=0;P<s;P+=1)R();k.push(w.createElement("tr",{key:I,className:l&&l(D)},L))}return w.createElement("div",{className:"".concat(e,"-body")},w.createElement("table",{className:"".concat(e,"-content")},_&&w.createElement("thead",null,w.createElement("tr",null,_)),w.createElement("tbody",null,k)))}function r3t(n){var e=n.prefixCls,t=n.generateConfig,i=n.prefixColumn,r=n.locale,o=n.rowCount,s=n.viewDate,a=n.value,l=n.cellRender,c=n.isSameCell,u=w.useContext(xk),d=u.rangedValue,h=u.hoverRangedValue,g=q4t(r.locale,t,s),p="".concat(e,"-cell"),m=t.locale.getWeekFirstDay(r.locale),_=t.getNow(),v=[],b=r.shortWeekDays||(t.locale.getShortWeekDays?t.locale.getShortWeekDays(r.locale):[]);i&&v.push(w.createElement("th",{key:"empty","aria-label":"empty cell"}));for(var y=0;y<fO;y+=1)v.push(w.createElement("th",{key:y},b[(y+m)%fO]));var C=Ej({cellPrefixCls:p,today:_,value:a,generateConfig:t,rangedValue:i?null:d,hoverRangedValue:i?null:h,isSameCell:c||function(k,I){return Ay(t,k,I)},isInView:function(I){return hge(t,I,s)},offsetCell:function(I,L){return t.addDate(I,L)}}),x=l?function(k,I){return l(k,{originNode:I,today:_,type:"date",locale:r})}:void 0;return w.createElement(z3,rt({},n,{rowNum:o,colNum:fO,baseDate:g,getCellNode:x,getCellText:t.getDate,getCellClassName:C,getCellDate:t.addDate,titleCell:function(I){return kd(I,{locale:r,format:"YYYY-MM-DD",generateConfig:t})},headerCells:v}))}var P6={visibility:"hidden"};function iA(n){var e=n.prefixCls,t=n.prevIcon,i=t===void 0?"":t,r=n.nextIcon,o=r===void 0?"":r,s=n.superPrevIcon,a=s===void 0?"«":s,l=n.superNextIcon,c=l===void 0?"»":l,u=n.onSuperPrev,d=n.onSuperNext,h=n.onPrev,g=n.onNext,p=n.children,m=w.useContext(cf),_=m.hideNextBtn,v=m.hidePrevBtn;return w.createElement("div",{className:e},u&&w.createElement("button",{type:"button",onClick:u,tabIndex:-1,className:"".concat(e,"-super-prev-btn"),style:v?P6:{}},a),h&&w.createElement("button",{type:"button",onClick:h,tabIndex:-1,className:"".concat(e,"-prev-btn"),style:v?P6:{}},i),w.createElement("div",{className:"".concat(e,"-view")},p),g&&w.createElement("button",{type:"button",onClick:g,tabIndex:-1,className:"".concat(e,"-next-btn"),style:_?P6:{}},o),d&&w.createElement("button",{type:"button",onClick:d,tabIndex:-1,className:"".concat(e,"-super-next-btn"),style:_?P6:{}},c))}function o3t(n){var e=n.prefixCls,t=n.generateConfig,i=n.locale,r=n.viewDate,o=n.onNextMonth,s=n.onPrevMonth,a=n.onNextYear,l=n.onPrevYear,c=n.onYearClick,u=n.onMonthClick,d=w.useContext(cf),h=d.hideHeader;if(h)return null;var g="".concat(e,"-header"),p=i.shortMonths||(t.locale.getShortMonths?t.locale.getShortMonths(i.locale):[]),m=t.getMonth(r),_=w.createElement("button",{type:"button",key:"year",onClick:c,tabIndex:-1,className:"".concat(e,"-year-btn")},kd(r,{locale:i,format:i.yearFormat,generateConfig:t})),v=w.createElement("button",{type:"button",key:"month",onClick:u,tabIndex:-1,className:"".concat(e,"-month-btn")},i.monthFormat?kd(r,{locale:i,format:i.monthFormat,generateConfig:t}):p[m]),b=i.monthBeforeYear?[v,_]:[_,v];return w.createElement(iA,rt({},n,{prefixCls:g,onSuperPrev:l,onPrev:s,onNext:o,onSuperNext:a}),b)}var s3t=6;function fge(n){var e=n.prefixCls,t=n.panelName,i=t===void 0?"date":t,r=n.keyboardConfig,o=n.active,s=n.operationRef,a=n.generateConfig,l=n.value,c=n.viewDate,u=n.onViewDateChange,d=n.onPanelChange,h=n.onSelect,g="".concat(e,"-").concat(i,"-panel");s.current={onKeyDown:function(v){return nA(v,Qe({onLeftRight:function(y){h(a.addDate(l||c,y),"key")},onCtrlLeftRight:function(y){h(a.addYear(l||c,y),"key")},onUpDown:function(y){h(a.addDate(l||c,y*fO),"key")},onPageUpDown:function(y){h(a.addMonth(l||c,y),"key")}},r))}};var p=function(v){var b=a.addYear(c,v);u(b),d(null,b)},m=function(v){var b=a.addMonth(c,v);u(b),d(null,b)};return w.createElement("div",{className:St(g,$e({},"".concat(g,"-active"),o))},w.createElement(o3t,rt({},n,{prefixCls:e,value:l,viewDate:c,onPrevYear:function(){p(-1)},onNextYear:function(){p(1)},onPrevMonth:function(){m(-1)},onNextMonth:function(){m(1)},onMonthClick:function(){d("month",c)},onYearClick:function(){d("year",c)}})),w.createElement(r3t,rt({},n,{onSelect:function(v){return h(v,"mouse")},prefixCls:e,value:l,viewDate:c,rowCount:s3t})))}function a3t(n){var e=n.value,t=n.generateConfig,i=n.disabledMinutes,r=n.disabledSeconds,o=n.minutes,s=n.seconds,a=n.use12Hours,l=function(u,d,h,g){var p=t.getNow(),m=e||p,_=!a||!u?d:d+12,v=d<0?t.getHour(p):_,b=h<0?t.getMinute(p):h,y=g<0?t.getSecond(p):g,C=i&&i(v);if(C!=null&&C.includes(b)){var x=o.find(function(L){return!C.includes(L.value)});if(x)b=x.value;else return null}var k=r&&r(v,b);if(k!=null&&k.includes(y)){var I=s.find(function(L){return!k.includes(L.value)});if(I)y=I.value;else return null}return m=Y$e(t,m,v,b,y),m};return l}function M6(n){var e=n.prefixCls,t=n.units,i=n.onSelect,r=n.value,o=n.active,s=n.hideDisabledOptions,a=n.info,l=n.type,c="".concat(e,"-cell"),u=w.useContext(cf),d=u.open,h=w.useRef(null),g=w.useRef(new Map),p=w.useRef();return w.useLayoutEffect(function(){var m=g.current.get(r);m&&d!==!1&&bie(h.current,m.offsetTop,120)},[r]),w.useLayoutEffect(function(){if(d){var m=g.current.get(r);m&&(p.current=K4t(m,function(){bie(h.current,m.offsetTop,0)}))}return function(){var _;(_=p.current)===null||_===void 0||_.call(p)}},[d]),w.createElement("ul",{className:St("".concat(e,"-column"),$e({},"".concat(e,"-column-active"),o)),ref:h,style:{position:"relative"}},t.map(function(m){var _;return s&&m.disabled?null:w.createElement("li",{key:m.value,ref:function(b){g.current.set(m.value,b)},className:St(c,(_={},$e(_,"".concat(c,"-disabled"),m.disabled),$e(_,"".concat(c,"-selected"),r===m.value),_)),onClick:function(){m.disabled||i(m.value)}},a.cellRender?a.cellRender(m.value,{today:a.today,locale:a.locale,originNode:w.createElement("div",{className:"".concat(c,"-inner")},m.label),type:"time",subType:l}):w.createElement("div",{className:"".concat(c,"-inner")},m.label))}))}function l3t(n,e){if(n.length!==e.length)return!0;for(var t=0;t<n.length;t+=1)if(n[t].disabled!==e[t].disabled)return!0;return!1}function QQ(n,e,t,i){for(var r=[],o=t>=1?t|0:1,s=n;s<=e;s+=o)r.push({label:K$e(s,2),value:s,disabled:(i||[]).includes(s)});return r}function c3t(n){var e=n.generateConfig,t=n.prefixCls,i=n.operationRef,r=n.activeColumnIndex,o=n.value,s=n.showHour,a=n.showMinute,l=n.showSecond,c=n.use12Hours,u=n.hourStep,d=u===void 0?1:u,h=n.minuteStep,g=h===void 0?1:h,p=n.secondStep,m=p===void 0?1:p,_=n.disabledHours,v=n.disabledMinutes,b=n.disabledSeconds,y=n.disabledTime,C=n.hideDisabledOptions,x=n.onSelect,k=n.cellRender,I=n.locale,L=[],D="".concat(t,"-content"),R="".concat(t,"-time-panel"),P,M=o?e.getHour(o):-1,O=M,B=o?e.getMinute(o):-1,F=o?e.getSecond(o):-1,H=e.getNow(),V=w.useMemo(function(){if(y){var xt=y(H);return[xt.disabledHours,xt.disabledMinutes,xt.disabledSeconds]}return[_,v,b]},[_,v,b,y,H]),$=$t(V,3),j=$[0],Y=$[1],ne=$[2],se=QQ(0,23,d,j&&j()),he=N3(function(){return se},se,l3t);c&&(P=O>=12,O%=12);var xe=w.useMemo(function(){if(!c)return[!1,!1];var xt=[!0,!0];return he.forEach(function(Kt){var cn=Kt.disabled,wn=Kt.value;cn||(wn>=12?xt[1]=!1:xt[0]=!1)}),xt},[c,he]),_e=$t(xe,2),Ie=_e[0],Re=_e[1],Ye=w.useMemo(function(){return c?he.filter(P?function(xt){return xt.value>=12}:function(xt){return xt.value<12}).map(function(xt){var Kt=xt.value%12,cn=Kt===0?"12":K$e(Kt,2);return Qe(Qe({},xt),{},{label:cn,value:Kt})}):he},[c,P,he]),Ze=QQ(0,59,g,Y&&Y(M)),tt=QQ(0,59,m,ne&&ne(M,B)),Be=a3t({value:o,generateConfig:e,disabledMinutes:Y,disabledSeconds:ne,minutes:Ze,seconds:tt,use12Hours:c});i.current={onUpDown:function(Kt){var cn=L[r];if(cn)for(var wn=cn.units.findIndex(function(me){return me.value===cn.value}),on=cn.units.length,Zt=1;Zt<on;Zt+=1){var pe=cn.units[(wn+Kt*Zt+on)%on];if(pe.disabled!==!0){cn.onSelect(pe.value);break}}}};function kt(xt,Kt,cn,wn,on){xt!==!1&&L.push({node:w.cloneElement(Kt,{prefixCls:R,value:cn,active:r===L.length,onSelect:on,units:wn,hideDisabledOptions:C}),onSelect:on,value:cn,units:wn})}kt(s,w.createElement(M6,{key:"hour",type:"hour",info:{today:H,locale:I,cellRender:k}}),O,Ye,function(xt){x(Be(P,xt,B,F),"mouse")}),kt(a,w.createElement(M6,{key:"minute",type:"minute",info:{today:H,locale:I,cellRender:k}}),B,Ze,function(xt){x(Be(P,O,xt,F),"mouse")}),kt(l,w.createElement(M6,{key:"second",type:"second",info:{today:H,locale:I,cellRender:k}}),F,tt,function(xt){x(Be(P,O,B,xt),"mouse")});var Vt=-1;return typeof P=="boolean"&&(Vt=P?1:0),kt(c===!0,w.createElement(M6,{key:"meridiem",type:"meridiem",info:{today:H,locale:I,cellRender:k}}),Vt,[{label:"AM",value:0,disabled:Ie},{label:"PM",value:1,disabled:Re}],function(xt){x(Be(!!xt,O,B,F),"mouse")}),w.createElement("div",{className:D},L.map(function(xt){var Kt=xt.node;return Kt}))}function u3t(n){var e=w.useContext(cf),t=e.hideHeader;if(t)return null;var i=n.prefixCls,r=n.generateConfig,o=n.locale,s=n.value,a=n.format,l="".concat(i,"-header");return w.createElement(iA,{prefixCls:l},s?kd(s,{locale:o,format:a,generateConfig:r}):" ")}var d3t=function(e){return e.filter(function(t){return t!==!1}).length};function X$e(n){var e=n.generateConfig,t=n.format,i=t===void 0?"HH:mm:ss":t,r=n.prefixCls,o=n.active,s=n.operationRef,a=n.showHour,l=n.showMinute,c=n.showSecond,u=n.use12Hours,d=u===void 0?!1:u,h=n.onSelect,g=n.value,p="".concat(r,"-time-panel"),m=w.useRef(),_=w.useState(-1),v=$t(_,2),b=v[0],y=v[1],C=d3t([a,l,c,d]);return s.current={onKeyDown:function(k){return nA(k,{onLeftRight:function(L){y((b+L+C)%C)},onUpDown:function(L){b===-1?y(0):m.current&&m.current.onUpDown(L)},onEnter:function(){h(g||e.getNow(),"key"),y(-1)}})},onBlur:function(){y(-1)}},w.createElement("div",{className:St(p,$e({},"".concat(p,"-active"),o))},w.createElement(u3t,rt({},n,{format:i,prefixCls:r})),w.createElement(c3t,rt({},n,{prefixCls:r,activeColumnIndex:b,operationRef:m})))}var Bxe=t3t("date","time"),XQ=function(e,t,i){var r=new Set(t);if(r.has(e)){for(var o=0;o<=i;o++)if(!r.has(o)&&o>=e)return o}return e};function h3t(n){var e=n.prefixCls,t=n.operationRef,i=n.generateConfig,r=n.value,o=n.defaultValue,s=n.disabledTime,a=n.showTime,l=n.onSelect,c=n.cellRender,u="".concat(e,"-datetime-panel"),d=w.useState(null),h=$t(d,2),g=h[0],p=h[1],m=w.useRef({}),_=w.useRef({}),v=Er(a)==="object"?Qe({},a):{};function b(k){var I=Bxe.indexOf(g)+k,L=Bxe[I]||null;return L}var y=function(I){_.current.onBlur&&_.current.onBlur(I),p(null)};t.current={onKeyDown:function(I){if(I.which===Rn.TAB){var L=b(I.shiftKey?-1:1);return p(L),L&&I.preventDefault(),!0}if(g){var D=g==="date"?m:_;return D.current&&D.current.onKeyDown&&D.current.onKeyDown(I),!0}return[Rn.LEFT,Rn.RIGHT,Rn.UP,Rn.DOWN].includes(I.which)?(p("date"),!0):!1},onBlur:y,onClose:y};var C=function(I,L){var D=I;if(L==="date"){var R,P,M,O=(s==null?void 0:s(r||v.defaultValue))||{},B=XQ(i.getHour(D),((R=O.disabledHours)===null||R===void 0?void 0:R.call(O))||[-1],23),F=XQ(i.getMinute(D),((P=O.disabledMinutes)===null||P===void 0?void 0:P.call(O,B))||[-1],59),H=XQ(i.getSecond(D),((M=O.disabledSeconds)===null||M===void 0?void 0:M.call(O,B,F))||[-1],59);D=i.setHour(D,B),D=i.setMinute(D,F),D=i.setSecond(D,H)}else L==="time"&&!r&&o&&(D=i.setYear(D,i.getYear(o)),D=i.setMonth(D,i.getMonth(o)),D=i.setDate(D,i.getDate(o)));l&&l(D,"mouse")},x=s?s(r||null):{};return w.createElement("div",{className:St(u,$e({},"".concat(u,"-active"),g))},w.createElement(fge,rt({},n,{cellRender:c,operationRef:m,active:g==="date",onSelect:function(I){C(Q$e(i,I,!r&&Er(a)==="object"?a.defaultValue:null),"date")}})),w.createElement(X$e,rt({},n,{cellRender:c?function(k,I){return c(k,Qe(Qe({},I),{},{type:"time"}))}:void 0,format:void 0},v,x,{disabledTime:null,defaultValue:void 0,operationRef:_,active:g==="time",onSelect:function(I){C(I,"time")}})))}function f3t(n){var e=n.prefixCls,t=n.generateConfig,i=n.viewDate,r=n.onPrevDecades,o=n.onNextDecades,s=w.useContext(cf),a=s.hideHeader;if(a)return null;var l="".concat(e,"-header"),c=t.getYear(i),u=Math.floor(c/Dy)*Dy,d=u+Dy-1;return w.createElement(iA,rt({},n,{prefixCls:l,onSuperPrev:r,onSuperNext:o}),u,"-",d)}var wie=3,$xe=4;function g3t(n){var e=Gm-1,t=n.prefixCls,i=n.viewDate,r=n.generateConfig,o=n.cellRender,s=n.locale,a="".concat(t,"-cell"),l=r.getYear(i),c=Math.floor(l/Gm)*Gm,u=Math.floor(l/Dy)*Dy,d=u+Dy-1,h=r.setYear(i,u-Math.ceil((wie*$xe*Gm-Dy)/2)),g=function(_){var v,b=r.getYear(_),y=b+e;return v={},$e(v,"".concat(a,"-in-view"),u<=b&&y<=d),$e(v,"".concat(a,"-selected"),b===c),v},p=o?function(m,_){return o(m,{originNode:_,today:r.getNow(),type:"decade",locale:s})}:void 0;return w.createElement(z3,rt({},n,{rowNum:$xe,colNum:wie,baseDate:h,getCellNode:p,getCellText:function(_){var v=r.getYear(_);return"".concat(v,"-").concat(v+e)},getCellClassName:g,getCellDate:function(_,v){return r.addYear(_,v*Gm)}}))}function p3t(n){var e=n.prefixCls,t=n.onViewDateChange,i=n.generateConfig,r=n.viewDate,o=n.operationRef,s=n.onSelect,a=n.onPanelChange,l="".concat(e,"-decade-panel");o.current={onKeyDown:function(h){return nA(h,{onLeftRight:function(p){s(i.addYear(r,p*Gm),"key")},onCtrlLeftRight:function(p){s(i.addYear(r,p*Dy),"key")},onUpDown:function(p){s(i.addYear(r,p*Gm*wie),"key")},onEnter:function(){a("year",r)}})}};var c=function(h){var g=i.addYear(r,h*Dy);t(g),a(null,g)},u=function(h){s(h,"mouse"),a("year",h)};return w.createElement("div",{className:l},w.createElement(f3t,rt({},n,{prefixCls:e,onPrevDecades:function(){c(-1)},onNextDecades:function(){c(1)}})),w.createElement(g3t,rt({},n,{prefixCls:e,onSelect:u})))}function m3t(n){var e=n.prefixCls,t=n.generateConfig,i=n.locale,r=n.viewDate,o=n.onNextYear,s=n.onPrevYear,a=n.onYearClick,l=w.useContext(cf),c=l.hideHeader;if(c)return null;var u="".concat(e,"-header");return w.createElement(iA,rt({},n,{prefixCls:u,onSuperPrev:s,onSuperNext:o}),w.createElement("button",{type:"button",onClick:a,className:"".concat(e,"-year-btn")},kd(r,{locale:i,format:i.yearFormat,generateConfig:t})))}var gge=3,_3t=4;function v3t(n){var e=n.prefixCls,t=n.locale,i=n.value,r=n.viewDate,o=n.generateConfig,s=n.cellRender,a=w.useContext(xk),l=a.rangedValue,c=a.hoverRangedValue,u="".concat(e,"-cell"),d=Ej({cellPrefixCls:u,value:i,generateConfig:o,rangedValue:l,hoverRangedValue:c,isSameCell:function(_,v){return hge(o,_,v)},isInView:function(){return!0},offsetCell:function(_,v){return o.addMonth(_,v)}}),h=t.shortMonths||(o.locale.getShortMonths?o.locale.getShortMonths(t.locale):[]),g=o.setMonth(r,0),p=s?function(m,_){return s(m,{originNode:_,locale:t,today:o.getNow(),type:"month"})}:void 0;return w.createElement(z3,rt({},n,{rowNum:_3t,colNum:gge,baseDate:g,getCellNode:p,getCellText:function(_){return t.monthFormat?kd(_,{locale:t,format:t.monthFormat,generateConfig:o}):h[o.getMonth(_)]},getCellClassName:d,getCellDate:o.addMonth,titleCell:function(_){return kd(_,{locale:t,format:"YYYY-MM",generateConfig:o})}}))}function b3t(n){var e=n.prefixCls,t=n.operationRef,i=n.onViewDateChange,r=n.generateConfig,o=n.value,s=n.viewDate,a=n.onPanelChange,l=n.onSelect,c="".concat(e,"-month-panel");t.current={onKeyDown:function(h){return nA(h,{onLeftRight:function(p){l(r.addMonth(o||s,p),"key")},onCtrlLeftRight:function(p){l(r.addYear(o||s,p),"key")},onUpDown:function(p){l(r.addMonth(o||s,p*gge),"key")},onEnter:function(){a("date",o||s)}})}};var u=function(h){var g=r.addYear(s,h);i(g),a(null,g)};return w.createElement("div",{className:c},w.createElement(m3t,rt({},n,{prefixCls:e,onPrevYear:function(){u(-1)},onNextYear:function(){u(1)},onYearClick:function(){a("year",s)}})),w.createElement(v3t,rt({},n,{prefixCls:e,onSelect:function(h){l(h,"mouse"),a("date",h)}})))}function y3t(n){var e=n.prefixCls,t=n.generateConfig,i=n.locale,r=n.viewDate,o=n.onNextYear,s=n.onPrevYear,a=n.onYearClick,l=w.useContext(cf),c=l.hideHeader;if(c)return null;var u="".concat(e,"-header");return w.createElement(iA,rt({},n,{prefixCls:u,onSuperPrev:s,onSuperNext:o}),w.createElement("button",{type:"button",onClick:a,className:"".concat(e,"-year-btn")},kd(r,{locale:i,format:i.yearFormat,generateConfig:t})))}var C3t=4,w3t=1;function S3t(n){var e=n.prefixCls,t=n.locale,i=n.value,r=n.viewDate,o=n.generateConfig,s=n.cellRender,a=w.useContext(xk),l=a.rangedValue,c=a.hoverRangedValue,u="".concat(e,"-cell"),d=Ej({cellPrefixCls:u,value:i,generateConfig:o,rangedValue:l,hoverRangedValue:c,isSameCell:function(m,_){return V$e(o,m,_)},isInView:function(){return!0},offsetCell:function(m,_){return o.addMonth(m,_*3)}}),h=o.setDate(o.setMonth(r,0),1),g=s?function(p,m){return s(p,{originNode:m,locale:t,today:o.getNow(),type:"quarter"})}:void 0;return w.createElement(z3,rt({},n,{rowNum:w3t,colNum:C3t,baseDate:h,getCellNode:g,getCellText:function(m){return kd(m,{locale:t,format:t.quarterFormat||"[Q]Q",generateConfig:o})},getCellClassName:d,getCellDate:function(m,_){return o.addMonth(m,_*3)},titleCell:function(m){return kd(m,{locale:t,format:"YYYY-[Q]Q",generateConfig:o})}}))}function E3t(n){var e=n.prefixCls,t=n.operationRef,i=n.onViewDateChange,r=n.generateConfig,o=n.value,s=n.viewDate,a=n.onPanelChange,l=n.onSelect,c="".concat(e,"-quarter-panel");t.current={onKeyDown:function(h){return nA(h,{onLeftRight:function(p){l(r.addMonth(o||s,p*3),"key")},onCtrlLeftRight:function(p){l(r.addYear(o||s,p),"key")},onUpDown:function(p){l(r.addYear(o||s,p),"key")}})}};var u=function(h){var g=r.addYear(s,h);i(g),a(null,g)};return w.createElement("div",{className:c},w.createElement(y3t,rt({},n,{prefixCls:e,onPrevYear:function(){u(-1)},onNextYear:function(){u(1)},onYearClick:function(){a("year",s)}})),w.createElement(S3t,rt({},n,{prefixCls:e,onSelect:function(h){l(h,"mouse")}})))}function x3t(n){var e=n.prefixCls,t=n.generateConfig,i=n.locale,r=n.value,o=n.disabledDate,s=n.onSelect,a=w.useContext(xk),l=a.rangedValue,c=a.hoverRangedValue,u=w.useContext(cf),d=u.onDateMouseEnter,h=u.onDateMouseLeave,g=(c==null?void 0:c[0])||(l==null?void 0:l[0]),p=(c==null?void 0:c[1])||(l==null?void 0:l[1]),m="".concat(e,"-cell"),_=function(C){var x=M7({cellDate:C,mode:"week",disabledDate:o,generateConfig:t});return w.createElement("td",{key:"week",className:St(m,"".concat(m,"-week")),onClick:function(){x||s(C,"mouse")},onMouseEnter:function(){!x&&d&&d(C)},onMouseLeave:function(){!x&&h&&h(C)}},w.createElement("div",{className:"".concat(m,"-inner")},t.locale.getWeek(i.locale,C)))},v="".concat(e,"-week-panel-row"),b=function(C){var x,k=g8(t,i.locale,g,C),I=g8(t,i.locale,p,C);return St(v,(x={},$e(x,"".concat(v,"-selected"),!l&&g8(t,i.locale,r,C)),$e(x,"".concat(v,"-range-start"),k),$e(x,"".concat(v,"-range-end"),I),$e(x,"".concat(v,"-range-hover"),!k&&!I&&vN(t,g,p,C)),x))};return w.createElement(fge,rt({},n,{panelName:"week",prefixColumn:_,rowClassName:b,keyboardConfig:{onLeftRight:null},isSameCell:function(){return!1}}))}var j1=10;function k3t(n){var e=n.prefixCls,t=n.generateConfig,i=n.viewDate,r=n.onPrevDecade,o=n.onNextDecade,s=n.onDecadeClick,a=w.useContext(cf),l=a.hideHeader;if(l)return null;var c="".concat(e,"-header"),u=t.getYear(i),d=Math.floor(u/j1)*j1,h=d+j1-1;return w.createElement(iA,rt({},n,{prefixCls:c,onSuperPrev:r,onSuperNext:o}),w.createElement("button",{type:"button",onClick:s,className:"".concat(e,"-decade-btn")},d,"-",h))}var Sie=3,Vxe=4;function T3t(n){var e=n.prefixCls,t=n.value,i=n.viewDate,r=n.locale,o=n.generateConfig,s=n.cellRender,a=w.useContext(xk),l=a.rangedValue,c=a.hoverRangedValue,u="".concat(e,"-cell"),d=o.getYear(i),h=Math.floor(d/j1)*j1,g=h+j1-1,p=o.setYear(i,h-Math.ceil((Sie*Vxe-j1)/2)),m=o.getNow(),_=function(C){var x=o.getYear(C);return h<=x&&x<=g},v=Ej({cellPrefixCls:u,value:t,generateConfig:o,rangedValue:l,hoverRangedValue:c,isSameCell:function(C,x){return W3(o,C,x)},isInView:_,offsetCell:function(C,x){return o.addYear(C,x)}}),b=s?function(y,C){return s(y,{originNode:C,today:m,type:"year",locale:r})}:void 0;return w.createElement(z3,rt({},n,{rowNum:Vxe,colNum:Sie,baseDate:p,getCellNode:b,getCellText:o.getYear,getCellClassName:v,getCellDate:o.addYear,titleCell:function(C){return kd(C,{locale:r,format:"YYYY",generateConfig:o})}}))}function I3t(n){var e=n.prefixCls,t=n.operationRef,i=n.onViewDateChange,r=n.generateConfig,o=n.value,s=n.viewDate,a=n.sourceMode,l=n.onSelect,c=n.onPanelChange,u="".concat(e,"-year-panel");t.current={onKeyDown:function(g){return nA(g,{onLeftRight:function(m){l(r.addYear(o||s,m),"key")},onCtrlLeftRight:function(m){l(r.addYear(o||s,m*j1),"key")},onUpDown:function(m){l(r.addYear(o||s,m*Sie),"key")},onEnter:function(){c(a==="date"?"date":"month",o||s)}})}};var d=function(g){var p=r.addYear(s,g*10);i(p),c(null,p)};return w.createElement("div",{className:u},w.createElement(k3t,rt({},n,{prefixCls:e,onPrevDecade:function(){d(-1)},onNextDecade:function(){d(1)},onDecadeClick:function(){c("decade",s)}})),w.createElement(T3t,rt({},n,{prefixCls:e,onSelect:function(g){c(a==="date"?"date":"month",g),l(g,"mouse")}})))}function Z$e(n,e,t){return t?w.createElement("div",{className:"".concat(n,"-footer-extra")},t(e)):null}function J$e(n){var e=n.prefixCls,t=n.components,i=t===void 0?{}:t,r=n.needConfirmButton,o=n.onNow,s=n.onOk,a=n.okDisabled,l=n.showNow,c=n.locale,u,d;if(r){var h=i.button||"button";o&&l!==!1&&(u=w.createElement("li",{className:"".concat(e,"-now")},w.createElement("a",{className:"".concat(e,"-now-btn"),onClick:o},c.now))),d=r&&w.createElement("li",{className:"".concat(e,"-ok")},w.createElement(h,{disabled:a,onClick:s},c.ok))}return!u&&!d?null:w.createElement("ul",{className:"".concat(e,"-ranges")},u,d)}var L3t=["date","month"];function e8e(n){var e,t=n,i=t.prefixCls,r=i===void 0?"rc-picker":i,o=t.className,s=t.style,a=t.locale,l=t.generateConfig,c=t.value,u=t.defaultValue,d=t.pickerValue,h=t.defaultPickerValue,g=t.disabledDate,p=t.mode,m=t.picker,_=m===void 0?"date":m,v=t.tabIndex,b=v===void 0?0:v,y=t.showNow,C=t.showTime,x=t.showToday,k=t.renderExtraFooter,I=t.hideHeader,L=t.onSelect,D=t.onChange,R=t.onPanelChange,P=t.onMouseDown,M=t.onPickerValueChange,O=t.onOk,B=t.components,F=t.direction,H=t.hourStep,V=H===void 0?1:H,$=t.minuteStep,j=$===void 0?1:$,Y=t.secondStep,ne=Y===void 0?1:Y,se=t.dateRender,he=t.monthCellRender,xe=t.cellRender,_e=_==="date"&&!!C||_==="time",Ie=24%V===0,Re=60%j===0,Ye=60%ne===0,Ze=w.useContext(cf),tt=Ze.operationRef,Be=Ze.onSelect,kt=Ze.hideRanges,Vt=Ze.defaultOpenValue,xt=w.useContext(xk),Kt=xt.inRange,cn=xt.panelPosition,wn=xt.rangedValue,on=xt.hoverRangedValue,Zt=w.useRef({}),pe=w.useRef(!0),me=xp(null,{value:c,defaultValue:u,postState:function(Ht){return!Ht&&Vt&&_==="time"?Vt:Ht}}),Z=$t(me,2),G=Z[0],K=Z[1],oe=xp(null,{value:d,defaultValue:h||G,postState:function(Ht){var Qn=l.getNow();if(!Ht)return Qn;if(!G&&C){var Fr=Er(C)==="object"?C.defaultValue:u;return Q$e(l,Array.isArray(Ht)?Ht[0]:Ht,Fr||Qn)}return Array.isArray(Ht)?Ht[0]:Ht}}),le=$t(oe,2),we=le[0],Me=le[1],ft=function(Ht){Me(Ht),M&&M(Ht)},Nt=function(Ht){var Qn=e3t[_];return Qn?Qn(Ht):Ht},Yt=xp(function(){return _==="time"?"time":Nt("date")},{value:p}),He=$t(Yt,2),Dt=He[0],ae=He[1];w.useEffect(function(){ae(_)},[_]);var Se=w.useState(function(){return Dt}),Xe=$t(Se,2),wt=Xe[0],Tt=Xe[1],zt=function(Ht,Qn){var Fr=Nt(Ht||Dt);Tt(Dt),ae(Fr),R&&(Dt!==Fr||TD(l,we,we))&&R(Qn,Fr)},Mt=function(Ht,Qn){var Fr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;(Dt===_||Fr)&&(K(Ht),L&&L(Ht),Be&&Be(Ht,Qn),D&&!TD(l,Ht,G)&&!(g!=null&&g(Ht))&&D(Ht))},On=function(Ht){if(L3t.includes(Dt)){var Qn,Fr,Oe=Dt==="date";switch(Ht===Rn.PAGE_UP||Ht===Rn.PAGE_DOWN?Fr=Oe?l.addMonth:l.addYear:Fr=Oe?l.addDate:l.addMonth,Ht){case Rn.LEFT:case Rn.PAGE_UP:Qn=Fr(we,-1);break;case Rn.RIGHT:case Rn.PAGE_DOWN:Qn=Fr(we,1);break;case Rn.UP:case Rn.DOWN:Qn=Fr(we,Number("".concat(Ht===Rn.UP?"-":"").concat(Oe?fO:gge)));break}if(Qn)return!(g!=null&&g(Qn))}return!0},Ni=function(Ht){if(Zt.current&&Zt.current.onKeyDown){var Qn=!0,Fr=Ht.which;if([Rn.LEFT,Rn.RIGHT,Rn.UP,Rn.DOWN,Rn.PAGE_UP,Rn.PAGE_DOWN,Rn.ENTER].includes(Fr)&&(Ht.preventDefault(),Fr!==Rn.ENTER&&b===0&&(Qn=On(Fr))),Qn)return Zt.current.onKeyDown(Ht)}return Uu(!1,"Panel not correct handle keyDown event. Please help to fire issue about this."),!1},xn=function(Ht){Zt.current&&Zt.current.onBlur&&Zt.current.onBlur(Ht)};tt&&cn!=="right"&&(tt.current={onKeyDown:Ni,onClose:function(){Zt.current&&Zt.current.onClose&&Zt.current.onClose()}}),w.useEffect(function(){c&&!pe.current&&Me(c)},[c]),w.useEffect(function(){pe.current=!1},[]);var un,ei=q$e({cellRender:xe,monthCellRender:he,dateRender:se}),li=Qe(Qe({},n),{},{cellRender:ei,operationRef:Zt,prefixCls:r,viewDate:we,value:G,onViewDateChange:ft,sourceMode:wt,onPanelChange:zt,disabledDate:g});switch(delete li.onChange,delete li.onSelect,Dt){case"decade":un=w.createElement(p3t,rt({},li,{onSelect:function(Ht,Qn){ft(Ht),Mt(Ht,Qn)}}));break;case"year":un=w.createElement(I3t,rt({},li,{onSelect:function(Ht,Qn){ft(Ht),Mt(Ht,Qn)}}));break;case"month":un=w.createElement(b3t,rt({},li,{onSelect:function(Ht,Qn){ft(Ht),Mt(Ht,Qn)}}));break;case"quarter":un=w.createElement(E3t,rt({},li,{onSelect:function(Ht,Qn){ft(Ht),Mt(Ht,Qn)}}));break;case"week":un=w.createElement(x3t,rt({},li,{onSelect:function(Ht,Qn){ft(Ht),Mt(Ht,Qn)}}));break;case"time":delete li.showTime,un=w.createElement(X$e,rt({},li,Er(C)==="object"?C:null,{onSelect:function(Ht,Qn){ft(Ht),Mt(Ht,Qn)}}));break;default:C?un=w.createElement(h3t,rt({},li,{onSelect:function(Ht,Qn){ft(Ht),Mt(Ht,Qn)}})):un=w.createElement(fge,rt({},li,{onSelect:function(Ht,Qn){ft(Ht),Mt(Ht,Qn)}}))}var xi,br,Wr=function(){var Ht=l.getNow(),Qn=n3t(l.getHour(Ht),l.getMinute(Ht),l.getSecond(Ht),Ie?V:1,Re?j:1,Ye?ne:1),Fr=Y$e(l,Ht,Qn[0],Qn[1],Qn[2]);Mt(Fr,"submit")};kt||(xi=Z$e(r,Dt,k),C&&Dt!=="date"?br=null:br=J$e({prefixCls:r,components:B,needConfirmButton:_e,okDisabled:!G||g&&g(G),locale:a,showNow:y,onNow:_e&&Wr,onOk:function(){G&&(Mt(G,"submit",!0),O&&O(G))}}));var ko;if(x&&Dt==="date"&&_==="date"&&!C){var oo=l.getNow(),ea="".concat(r,"-today-btn"),xr=g&&g(oo);ko=w.createElement("a",{className:St(ea,xr&&"".concat(ea,"-disabled")),"aria-disabled":xr,onClick:function(){xr||Mt(oo,"mouse",!0)}},a.today)}return w.createElement(cf.Provider,{value:Qe(Qe({},Ze),{},{mode:Dt,hideHeader:"hideHeader"in n?I:Ze.hideHeader,hidePrevBtn:Kt&&cn==="right",hideNextBtn:Kt&&cn==="left"})},w.createElement("div",{tabIndex:b,className:St("".concat(r,"-panel"),o,(e={},$e(e,"".concat(r,"-panel-has-range"),wn&&wn[0]&&wn[1]),$e(e,"".concat(r,"-panel-has-range-hover"),on&&on[0]&&on[1]),$e(e,"".concat(r,"-panel-rtl"),F==="rtl"),e)),style:s,onKeyDown:Ni,onBlur:xn,onMouseDown:P},un,xi||br||ko?w.createElement("div",{className:"".concat(r,"-footer")},xi,br,ko):null))}var D3t={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:0,adjustY:1}}};function t8e(n){var e,t=n.prefixCls,i=n.popupElement,r=n.popupStyle,o=n.visible,s=n.dropdownClassName,a=n.dropdownAlign,l=n.transitionName,c=n.getPopupContainer,u=n.children,d=n.range,h=n.popupPlacement,g=n.direction,p="".concat(t,"-dropdown"),m=function(){return h!==void 0?h:g==="rtl"?"bottomRight":"bottomLeft"};return w.createElement(D4t,{showAction:[],hideAction:[],popupPlacement:m(),builtinPlacements:D3t,prefixCls:p,popupTransitionName:l,popup:i,popupAlign:a,popupVisible:o,popupClassName:St(s,(e={},$e(e,"".concat(p,"-range"),d),$e(e,"".concat(p,"-rtl"),g==="rtl"),e)),popupStyle:r,getPopupContainer:c},u)}function n8e(n){var e=n.prefixCls,t=n.presets,i=n.onClick,r=n.onHover;return t.length?w.createElement("div",{className:"".concat(e,"-presets")},w.createElement("ul",null,t.map(function(o,s){var a=o.label,l=o.value;return w.createElement("li",{key:s,onClick:function(){return i==null?void 0:i(Fxe(l))},onMouseEnter:function(){return r==null?void 0:r(Fxe(l))},onMouseLeave:function(){return r==null?void 0:r(null)}},a)}))):null}function i8e(n,e,t){var i=Er(e)==="object"?e.clearIcon:t;return i||te.createElement("span",{className:"".concat(n,"-clear-btn")})}function A3t(n){var e,t=n,i=t.prefixCls,r=i===void 0?"rc-picker":i,o=t.id,s=t.name,a=t.tabIndex,l=t.style,c=t.className,u=t.dropdownClassName,d=t.dropdownAlign,h=t.popupStyle,g=t.transitionName,p=t.generateConfig,m=t.locale,_=t.inputReadOnly,v=t.allowClear,b=t.autoFocus,y=t.showTime,C=t.picker,x=C===void 0?"date":C,k=t.format,I=t.use12Hours,L=t.value,D=t.defaultValue,R=t.presets,P=t.open,M=t.defaultOpen,O=t.defaultOpenValue,B=t.suffixIcon,F=t.clearIcon,H=t.disabled,V=t.disabledDate,$=t.placeholder,j=t.getPopupContainer,Y=t.pickerRef,ne=t.panelRender,se=t.onChange,he=t.onOpenChange,xe=t.onFocus,_e=t.onBlur,Ie=t.onMouseDown,Re=t.onMouseUp,Ye=t.onMouseEnter,Ze=t.onMouseLeave,tt=t.onContextMenu,Be=t.onClick,kt=t.onKeyDown,Vt=t.onSelect,xt=t.direction,Kt=t.autoComplete,cn=Kt===void 0?"off":Kt,wn=t.inputRender,on=t.changeOnBlur,Zt=w.useRef(null),pe=x==="date"&&!!y||x==="time",me=U$e(R),Z=G$e(W$e(k,x,y,I)),G=w.useRef(null),K=w.useRef(null),oe=w.useRef(null),le=xp(null,{value:L,defaultValue:D}),we=$t(le,2),Me=we[0],ft=we[1],Nt=w.useState(Me),Yt=$t(Nt,2),He=Yt[0],Dt=Yt[1],ae=w.useRef(null),Se=xp(!1,{value:P,defaultValue:M,postState:function(Xt){return H?!1:Xt},onChange:function(Xt){he&&he(Xt),!Xt&&ae.current&&ae.current.onClose&&ae.current.onClose()}}),Xe=$t(Se,2),wt=Xe[0],Tt=Xe[1],zt=F7(He,{formatList:Z,generateConfig:p,locale:m}),Mt=$t(zt,2),On=Mt[0],Ni=Mt[1],xn=Cie({valueTexts:On,onTextChange:function(Xt){var ti=H$e(Xt,{locale:m,formatList:Z,generateConfig:p});ti&&(!V||!V(ti))&&Dt(ti)}}),un=$t(xn,3),ei=un[0],li=un[1],xi=un[2],br=function(Xt){Dt(Xt),ft(Xt),se&&!TD(p,Me,Xt)&&se(Xt,Xt?kd(Xt,{generateConfig:p,locale:m,format:Z[0]}):"")},Wr=function(Xt){H&&Xt||Tt(Xt)},ko=function(Xt){return wt&&ae.current&&ae.current.onKeyDown?ae.current.onKeyDown(Xt):(Uu(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},oo=function(){for(var Xt=arguments.length,ti=new Array(Xt),or=0;or<Xt;or++)ti[or]=arguments[or];Be==null||Be.apply(void 0,ti),Zt.current&&(Zt.current.focus(),Wr(!0))},ea=function(Xt){on&&br(He),_e==null||_e(Xt)},xr=yie({blurToCancel:pe,changeOnBlur:on,open:wt,value:ei,triggerOpen:Wr,forwardKeyDown:ko,isClickOutside:function(Xt){return!j$e([G.current,K.current,oe.current],Xt)},onSubmit:function(){return!He||V&&V(He)?!1:(br(He),Wr(!1),xi(),!0)},onCancel:function(){Wr(!1),Dt(Me),xi()},onKeyDown:function(Xt,ti){kt==null||kt(Xt,ti)},onFocus:xe,onBlur:ea}),Hi=$t(xr,2),Ht=Hi[0],Qn=Hi[1],Fr=Qn.focused,Oe=Qn.typing;w.useEffect(function(){wt||(Dt(Me),!On.length||On[0]===""?li(""):Ni!==ei&&xi())},[wt,On]),w.useEffect(function(){wt||xi()},[x]),w.useEffect(function(){Dt(Me)},[Me]),Y&&(Y.current={focus:function(){var Xt;(Xt=Zt.current)===null||Xt===void 0||Xt.focus()},blur:function(){var Xt;(Xt=Zt.current)===null||Xt===void 0||Xt.blur()}});var lt=vie(ei,{formatList:Z,generateConfig:p,locale:m}),It=$t(lt,3),tn=It[0],Je=It[1],ve=It[2],je=Qe(Qe({},n),{},{className:void 0,style:void 0,pickerValue:void 0,onPickerValueChange:void 0,onChange:null}),Le=w.createElement("div",{className:"".concat(r,"-panel-layout")},w.createElement(n8e,{prefixCls:r,presets:me,onClick:function(Xt){br(Xt),Wr(!1)}}),w.createElement(e8e,rt({},je,{generateConfig:p,className:St($e({},"".concat(r,"-panel-focused"),!Oe)),value:He,locale:m,tabIndex:-1,onSelect:function(Xt){Vt==null||Vt(Xt),Dt(Xt)},direction:xt,onPanelChange:function(Xt,ti){var or=n.onPanelChange;ve(!0),or==null||or(Xt,ti)}})));ne&&(Le=ne(Le));var fe=w.createElement("div",{className:"".concat(r,"-panel-container"),ref:G,onMouseDown:function(Xt){Xt.preventDefault()}},Le),Fe;B&&(Fe=w.createElement("span",{className:"".concat(r,"-suffix"),onMouseDown:function(Xt){Xt.preventDefault()}},B));var ot=i8e(r,v,F),Ue=w.createElement("span",{onMouseDown:function(Xt){Xt.preventDefault(),Xt.stopPropagation()},onMouseUp:function(Xt){Xt.preventDefault(),Xt.stopPropagation(),br(null),Wr(!1)},className:"".concat(r,"-clear"),role:"button"},ot),Qt=!!v&&Me&&!H,gn=Qe(Qe(Qe({id:o,tabIndex:a,disabled:H,readOnly:_||typeof Z[0]=="function"||!Oe,value:tn||ei,onChange:function(Xt){li(Xt.target.value)},autoFocus:b,placeholder:$,ref:Zt,title:ei},Ht),{},{size:z$e(x,Z[0],p),name:s},a$e(n,{aria:!0,data:!0})),{},{autoComplete:cn}),Pn=wn?wn(gn):w.createElement("input",gn),Zn=function(Xt,ti){(ti==="submit"||ti!=="key"&&!pe)&&(br(Xt),Wr(!1))},wi=xt==="rtl"?"bottomRight":"bottomLeft";return w.createElement(cf.Provider,{value:{operationRef:ae,hideHeader:x==="time",onSelect:Zn,open:wt,defaultOpenValue:O,onDateMouseEnter:Je,onDateMouseLeave:ve}},w.createElement(t8e,{visible:wt,popupElement:fe,popupStyle:h,prefixCls:r,dropdownClassName:u,dropdownAlign:d,getPopupContainer:j,transitionName:g,popupPlacement:wi,direction:xt},w.createElement("div",{ref:oe,className:St(r,c,(e={},$e(e,"".concat(r,"-disabled"),H),$e(e,"".concat(r,"-focused"),Fr),$e(e,"".concat(r,"-rtl"),xt==="rtl"),e)),style:l,onMouseDown:Ie,onMouseUp:Re,onMouseEnter:Ye,onMouseLeave:Ze,onContextMenu:tt,onClick:oo},w.createElement("div",{className:St("".concat(r,"-input"),$e({},"".concat(r,"-input-placeholder"),!!tn)),ref:K},Pn,Fe,Qt&&Ue))))}var R3t=function(n){I_(t,n);var e=pk(t);function t(){var i;Ua(this,t);for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return i=e.call.apply(e,[this].concat(o)),$e(Sr(i),"pickerRef",w.createRef()),$e(Sr(i),"focus",function(){i.pickerRef.current&&i.pickerRef.current.focus()}),$e(Sr(i),"blur",function(){i.pickerRef.current&&i.pickerRef.current.blur()}),i}return qa(t,[{key:"render",value:function(){return w.createElement(A3t,rt({},this.props,{pickerRef:this.pickerRef}))}}]),t}(w.Component);function N3t(n,e){var t=n.picker,i=n.locale,r=n.selectedValue,o=n.disabledDate,s=n.disabled,a=n.generateConfig,l=io(r,0),c=io(r,1);function u(m){return a.locale.getWeekFirstDate(i.locale,m)}function d(m){var _=a.getYear(m),v=a.getMonth(m);return _*100+v}function h(m){var _=a.getYear(m),v=_ie(a,m);return _*10+v}var g=w.useCallback(function(m){if(s[0]||o&&o(m))return!0;if(s[1]&&c)return!Ay(a,m,c)&&a.isAfter(m,c);if(!e&&c)switch(t){case"quarter":return h(m)>h(c);case"month":return d(m)>d(c);case"week":return u(m)>u(c);default:return!Ay(a,m,c)&&a.isAfter(m,c)}return!1},[o,s[1],c,e]),p=w.useCallback(function(m){if(s[1]||o&&o(m))return!0;if(s[0]&&l)return!Ay(a,m,c)&&a.isAfter(l,m);if(!e&&l)switch(t){case"quarter":return h(m)<h(l);case"month":return d(m)<d(l);case"week":return u(m)<u(l);default:return!Ay(a,m,l)&&a.isAfter(l,m)}return!1},[o,s[0],l,e]);return[g,p]}function O3t(n,e,t,i,r,o,s,a,l,c,u){var d=w.useState(!1),h=$t(d,2),g=h[0],p=h[1],m=xp(n||!1,{value:e}),_=$t(m,2),v=_[0],b=_[1],y=xp(n||!1,{value:e,onChange:function($){u==null||u($)}}),C=$t(y,2),x=C[0],k=C[1],I=xp(0,{value:t}),L=$t(I,2),D=L[0],R=L[1],P=w.useState(null),M=$t(P,2),O=M[0],B=M[1];w.useEffect(function(){x&&p(!0)},[x]);var F=function($){return $===0?1:0},H=Wm(function(V,$,j){if($===!1)k(V);else if(V){R($),k(V);var Y=F($);!x||![a,l][Y]?B(Y):(p(!1),O!==null&&B(null))}else if(j==="confirm"||j==="blur"&&i){var ne=v&&!r?F($):O;ne!==null&&(p(!1),R(ne)),B(null),ne!==null&&!c[ne]?af(function(){var se,he=[o,s][ne];(se=he.current)===null||se===void 0||se.focus()}):k(!1)}else k(!1),b(!1)});return[x,D,g,H]}function P3t(n,e,t,i){var r=gO(n,t,i,1);function o(s){return s(n,e)?"same":s(r,e)?"closing":"far"}switch(t){case"year":return o(function(s,a){return j4t(i,s,a)});case"quarter":case"month":return o(function(s,a){return W3(i,s,a)});default:return o(function(s,a){return hge(i,s,a)})}}function M3t(n,e,t,i){var r=io(n,0),o=io(n,1);if(e===0)return r;if(r&&o){var s=P3t(r,o,t,i);switch(s){case"same":return r;case"closing":return r;default:return gO(o,t,i,-1)}}return r}function F3t(n){var e=n.values,t=n.picker,i=n.defaultDates,r=n.generateConfig,o=w.useState(function(){return[io(i,0),io(i,1)]}),s=$t(o,2),a=s[0],l=s[1],c=w.useState(null),u=$t(c,2),d=u[0],h=u[1],g=io(e,0),p=io(e,1);function m(v){return a[v]?a[v]:io(d,v)||M3t(e,v,t,r)||g||p||r.getNow()}function _(v,b){if(v){var y=lp(d,v,b);l(lp(a,null,b)||[null,null]);var C=(b+1)%2;io(e,C)||(y=lp(y,v,C)),h(y)}else(g||p)&&h(null)}return[m,_]}function Hxe(n,e){return n&&n[0]&&n[1]&&e.isAfter(n[0],n[1])?[n[1],n[0]]:n}function Wxe(n,e,t,i){return!!(n||i&&i[e]||t[(e+1)%2])}function B3t(n){var e,t,i,r=n,o=r.prefixCls,s=o===void 0?"rc-picker":o,a=r.id,l=r.style,c=r.className,u=r.popupStyle,d=r.dropdownClassName,h=r.transitionName,g=r.dropdownAlign,p=r.getPopupContainer,m=r.generateConfig,_=r.locale,v=r.placeholder,b=r.autoFocus,y=r.disabled,C=r.format,x=r.picker,k=x===void 0?"date":x,I=r.showTime,L=r.use12Hours,D=r.separator,R=D===void 0?"~":D,P=r.value,M=r.defaultValue,O=r.defaultPickerValue,B=r.open,F=r.defaultOpen,H=r.disabledDate,V=r.disabledTime,$=r.dateRender,j=r.monthCellRender,Y=r.cellRender,ne=r.panelRender,se=r.presets,he=r.ranges,xe=r.allowEmpty,_e=r.allowClear,Ie=r.suffixIcon,Re=r.clearIcon,Ye=r.pickerRef,Ze=r.inputReadOnly,tt=r.mode,Be=r.renderExtraFooter,kt=r.onChange,Vt=r.onOpenChange,xt=r.onPanelChange,Kt=r.onCalendarChange,cn=r.onFocus,wn=r.onBlur,on=r.onMouseDown,Zt=r.onMouseUp,pe=r.onMouseEnter,me=r.onMouseLeave,Z=r.onClick,G=r.onOk,K=r.onKeyDown,oe=r.components,le=r.order,we=r.direction,Me=r.activePickerIndex,ft=r.autoComplete,Nt=ft===void 0?"off":ft,Yt=r.changeOnBlur,He=k==="date"&&!!I||k==="time",Dt=w.useRef(null),ae=w.useRef(null),Se=w.useRef(null),Xe=w.useRef(null),wt=w.useRef(null),Tt=w.useRef(null),zt=w.useRef(null),Mt=w.useRef(null),On=G$e(W$e(C,k,I,L)),Ni=function(jn,Rr){return jn&&jn[Rr]?kd(jn[Rr],{generateConfig:m,locale:_,format:On[0]}):""},xn=w.useRef(null),un=w.useMemo(function(){return Array.isArray(y)?y:[y||!1,y||!1]},[y]),ei=xp(null,{value:P,defaultValue:M,postState:function(jn){return k==="time"&&!le?jn:Hxe(jn,m)}}),li=$t(ei,2),xi=li[0],br=li[1],Wr=F3t({values:xi,picker:k,defaultDates:O,generateConfig:m}),ko=$t(Wr,2),oo=ko[0],ea=ko[1],xr=xp(xi,{postState:function(jn){var Rr=jn;if(un[0]&&un[1])return Rr;for(var kr=0;kr<2;kr+=1)un[kr]&&!Rr&&!io(Rr,kr)&&!io(xe,kr)&&(Rr=lp(Rr,m.getNow(),kr));return Rr}}),Hi=$t(xr,2),Ht=Hi[0],Qn=Hi[1],Fr=xp([k,k],{value:tt}),Oe=$t(Fr,2),lt=Oe[0],It=Oe[1];w.useEffect(function(){It([k,k])},[k]);var tn=function(jn,Rr){It(jn),xt&&xt(Rr,jn)},Je=O3t(F,B,Me,Yt,He,Tt,zt,io(Ht,0),io(Ht,1),un,Vt),ve=$t(Je,4),je=ve[0],Le=ve[1],fe=ve[2],Fe=ve[3],ot=je&&Le===0,Ue=je&&Le===1,Qt=N3t({picker:k,selectedValue:Ht,locale:_,disabled:un,disabledDate:H,generateConfig:m},!je||fe),gn=$t(Qt,2),Pn=gn[0],Zn=gn[1],wi=w.useState(0),Sn=$t(wi,2),Xt=Sn[0],ti=Sn[1];w.useEffect(function(){!je&&Dt.current&&ti(Dt.current.offsetWidth)},[je]);function or(jr){Fe(!0,jr,"open"),af(function(){var jn,Rr=[Tt,zt][jr];(jn=Rr.current)===null||jn===void 0||jn.focus()},0)}function Dr(jr,jn,Rr){var kr=jr,is=io(kr,0),Uc=io(kr,1);is&&Uc&&m.isAfter(is,Uc)&&(k==="week"&&!g8(m,_.locale,is,Uc)||k==="quarter"&&!V$e(m,is,Uc)||k!=="week"&&k!=="quarter"&&k!=="time"&&!Ay(m,is,Uc)?jn===0?(kr=[is,null],Uc=null):(is=null,kr=[null,Uc]):(k!=="time"||le!==!1)&&(kr=Hxe(kr,m))),Qn(kr);var vh=Ni(kr,0),Ka=Ni(kr,1);if(Kt){var Wg={range:jn===0?"start":"end"};Kt(kr,[vh,Ka],Wg)}if(!Rr){var um=Wxe(is,0,un,xe),V_=Wxe(Uc,1,un,xe),rd=kr===null||um&&V_;rd&&(br(kr),kt&&(!TD(m,io(xi,0),is)||!TD(m,io(xi,1),Uc))&&kt(kr,[vh,Ka]))}}var xa=function(jn){return je&&xn.current&&xn.current.onKeyDown?xn.current.onKeyDown(jn):(Uu(!1,"Picker not correct forward KeyDown operation. Please help to fire issue about this."),!1)},pa={formatList:On,generateConfig:m,locale:_},Ba=F7(io(Ht,0),pa),Uo=$t(Ba,2),Xo=Uo[0],qo=Uo[1],Ll=F7(io(Ht,1),pa),yc=$t(Ll,2),ci=yc[0],lo=yc[1],To=function(jn,Rr){var kr=H$e(jn,{locale:_,formatList:On,generateConfig:m}),is=Rr===0?Pn:Zn;kr&&!is(kr)&&(Qn(lp(Ht,kr,Rr)),ea(kr,Rr))},Bs=Cie({valueTexts:Xo,onTextChange:function(jn){return To(jn,0)}}),ns=$t(Bs,3),$s=ns[0],_o=ns[1],Ar=ns[2],Gr=Cie({valueTexts:ci,onTextChange:function(jn){return To(jn,1)}}),hr=$t(Gr,3),yr=hr[0],zr=hr[1],Fi=hr[2],Hn=w.useState(null),ni=$t(Hn,2),Ln=ni[0],Wn=ni[1],ii=w.useState(null),Oi=$t(ii,2),sn=Oi[0],an=Oi[1],Dn=vie($s,{formatList:On,generateConfig:m,locale:_}),it=$t(Dn,3),vt=it[0],Jt=it[1],Nn=it[2],En=vie(yr,{formatList:On,generateConfig:m,locale:_}),Kn=$t(En,3),Cr=Kn[0],Yr=Kn[1],Br=Kn[2],$a=function(jn){an(lp(Ht,jn,Le)),Le===0?Jt(jn):Yr(jn)},fr=function(){an(lp(Ht,null,Le)),Le===0?Nn():Br()},qi=w.useState(je),Vs=$t(qi,2),zc=Vs[0],_u=Vs[1];w.useEffect(function(){_u(je)},[je]);var Zo=function(jn){if(zc){if(He){var Rr=Le?0:1,kr=io(Ht,Rr);kr&&Dr(Ht,Rr,!0)}else if(Yt){var is=io(Ht,Le);is&&Dr(Ht,Le)}}return wn==null?void 0:wn(jn)},Cc=function(jn,Rr){return{blurToCancel:!Yt&&He,changeOnBlur:Yt,forwardKeyDown:xa,onBlur:Zo,isClickOutside:function(is){var Uc=[Se.current,Xe.current,Dt.current];return!j$e([].concat(Ir(He?[Uc[Le]]:Uc),[ae.current]),is)},onFocus:function(is){cn&&cn(is)},triggerOpen:function(is){is?Fe(is,jn,"open"):Fe(is,io(Ht,jn)?jn:!1,"blur")},onSubmit:function(){if(!Ht||H&&H(Ht[jn]))return!1;Dr(Ht,jn),Rr(),Fe(!1,Le,"confirm")},onCancel:function(){Fe(!1,jn,"cancel"),Qn(xi),Rr()}}},tc={onKeyDown:function(jn,Rr){K==null||K(jn,Rr)}},F_=yie(Qe(Qe({},Cc(0,Ar)),{},{open:ot,value:$s},tc)),uS=$t(F_,2),cl=uS[0],Db=uS[1],_h=Db.focused,B_=Db.typing,nd=yie(Qe(Qe({},Cc(1,Fi)),{},{open:Ue,value:yr},tc)),jc=$t(nd,2),dS=jc[0],$_=jc[1],Ab=$_.focused,Vg=$_.typing,eF=function(jn){Z&&Z(jn),!je&&!Tt.current.contains(jn.target)&&!zt.current.contains(jn.target)&&(un[0]?un[1]||or(1):or(0))},tF=function(jn){on&&on(jn),je&&(_h||Ab)&&!Tt.current.contains(jn.target)&&!zt.current.contains(jn.target)&&jn.preventDefault()},Md=xi&&xi[0]?kd(xi[0],{locale:_,format:"YYYYMMDDHHmmss",generateConfig:m}):"",jK=xi&&xi[1]?kd(xi[1],{locale:_,format:"YYYYMMDDHHmmss",generateConfig:m}):"";w.useEffect(function(){je||(Qn(xi),!Xo.length||Xo[0]===""?_o(""):qo!==$s&&Ar(),!ci.length||ci[0]===""?zr(""):lo!==yr&&Fi())},[je,Xo,ci]),w.useEffect(function(){Qn(xi)},[Md,jK]);var id=q$e({cellRender:Y,monthCellRender:j,dateRender:$}),UK=w.useMemo(function(){if(id)return function(jr,jn){return id(jr,Qe(Qe({},jn),{},{range:Le?"end":"start"}))}},[Le,id]);Ye&&(Ye.current={focus:function(){Tt.current&&Tt.current.focus()},blur:function(){Tt.current&&Tt.current.blur(),zt.current&&zt.current.blur()}});var nF=U$e(se,he);function Hg(){var jr=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,jn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Rr=null;je&&sn&&sn[0]&&sn[1]&&m.isAfter(sn[1],sn[0])&&(Rr=sn);var kr=I;if(I&&Er(I)==="object"&&I.defaultValue){var is=I.defaultValue;kr=Qe(Qe({},I),{},{defaultValue:io(is,Le)||void 0})}return w.createElement(xk.Provider,{value:{inRange:!0,panelPosition:jr,rangedValue:Ln||Ht,hoverRangedValue:Rr}},w.createElement(e8e,rt({},n,jn,{cellRender:UK,showTime:kr,mode:lt[Le],generateConfig:m,style:void 0,direction:we,disabledDate:Le===0?Pn:Zn,disabledTime:function(vh){return V?V(vh,Le===0?"start":"end"):!1},className:St($e({},"".concat(s,"-panel-focused"),Le===0?!B_:!Vg)),value:io(Ht,Le),locale:_,tabIndex:-1,onPanelChange:function(vh,Ka){Le===0&&Nn(!0),Le===1&&Br(!0),tn(lp(lt,Ka,Le),lp(Ht,vh,Le));var Wg=vh;jr==="right"&&lt[Le]===Ka&&(Wg=gO(Wg,Ka,m,-1)),ea(Wg,Le)},onOk:null,onSelect:void 0,onChange:void 0,defaultValue:Le===0?io(Ht,1):io(Ht,0)})))}var xf=0,Yk=0;if(Le&&Se.current&&wt.current&&ae.current&&Mt.current){xf=Se.current.offsetWidth+wt.current.offsetWidth;var ma=Mt.current.offsetLeft>xf?Mt.current.offsetLeft-xf:Mt.current.offsetLeft,cm=ae.current.offsetWidth,Qk=Mt.current.offsetWidth;cm&&Qk&&xf>cm-Qk-(we==="rtl"?0:ma)&&(Yk=xf)}var qK=we==="rtl"?{right:xf}:{left:xf};function HA(){var jr,jn=Z$e(s,lt[Le],Be),Rr=J$e({prefixCls:s,components:oe,needConfirmButton:He,okDisabled:!io(Ht,Le)||H&&H(Ht[Le]),locale:_,onOk:function(){var rd=io(Ht,Le);rd&&(Dr(Ht,Le),G==null||G(Ht),Fe(!1,Le,"confirm"))}});if(k!=="time"&&!I){var kr=oo(Le),is=gO(kr,k,m),Uc=lt[Le],vh=Uc===k,Ka=Hg(vh?"left":!1,{pickerValue:kr,onPickerValueChange:function(rd){ea(rd,Le)}}),Wg=Hg("right",{pickerValue:is,onPickerValueChange:function(rd){ea(gO(rd,k,m,-1),Le)}});we==="rtl"?jr=w.createElement(w.Fragment,null,Wg,vh&&Ka):jr=w.createElement(w.Fragment,null,Ka,vh&&Wg)}else jr=Hg();var um=w.createElement("div",{className:"".concat(s,"-panel-layout")},w.createElement(n8e,{prefixCls:s,presets:nF,onClick:function(rd){Dr(rd,null),Fe(!1,Le,"preset")},onHover:function(rd){Wn(rd)}}),w.createElement("div",null,w.createElement("div",{className:"".concat(s,"-panels")},jr),(jn||Rr)&&w.createElement("div",{className:"".concat(s,"-footer")},jn,Rr)));return ne&&(um=ne(um)),w.createElement("div",{className:"".concat(s,"-panel-container"),style:{marginLeft:Yk},ref:ae,onMouseDown:function(rd){rd.preventDefault()}},um)}var KK=w.createElement("div",{className:St("".concat(s,"-range-wrapper"),"".concat(s,"-").concat(k,"-range-wrapper")),style:{minWidth:Xt}},w.createElement("div",{ref:Mt,className:"".concat(s,"-range-arrow"),style:qK}),HA()),iF;Ie&&(iF=w.createElement("span",{className:"".concat(s,"-suffix"),onMouseDown:function(jn){jn.preventDefault()}},Ie));var GK=i8e(s,_e,Re),rF=w.createElement("span",{onMouseDown:function(jn){jn.preventDefault(),jn.stopPropagation()},onMouseUp:function(jn){jn.preventDefault(),jn.stopPropagation();var Rr=xi;un[0]||(Rr=lp(Rr,null,0)),un[1]||(Rr=lp(Rr,null,1)),Dr(Rr,null),Fe(!1,Le,"clear")},className:"".concat(s,"-clear"),role:"button"},GK),Xk=_e&&(io(xi,0)&&!un[0]||io(xi,1)&&!un[1]),Rb={size:z$e(k,On[0],m)},WA=0,Zk=0;Se.current&&Xe.current&&wt.current&&(Le===0?Zk=Se.current.offsetWidth:(WA=xf,Zk=Xe.current.offsetWidth));var oF=we==="rtl"?{right:WA}:{left:WA},zA=function(jn,Rr){var kr=lp(Ht,jn,Le);if(Rr==="submit"||Rr!=="key"&&!He){Dr(kr,Le),Le===0?Nn():Br();var is=Le===0?1:0;un[is]?Fe(!1,!1,"confirm"):Fe(!1,Le,"confirm")}else Qn(kr)};return w.createElement(cf.Provider,{value:{operationRef:xn,hideHeader:k==="time",onDateMouseEnter:$a,onDateMouseLeave:fr,hideRanges:!0,onSelect:zA,open:je}},w.createElement(t8e,{visible:je,popupElement:KK,popupStyle:u,prefixCls:s,dropdownClassName:d,dropdownAlign:g,getPopupContainer:p,transitionName:h,range:!0,direction:we},w.createElement("div",rt({ref:Dt,className:St(s,"".concat(s,"-range"),c,(e={},$e(e,"".concat(s,"-disabled"),un[0]&&un[1]),$e(e,"".concat(s,"-focused"),Le===0?_h:Ab),$e(e,"".concat(s,"-rtl"),we==="rtl"),e)),style:l,onClick:eF,onMouseEnter:pe,onMouseLeave:me,onMouseDown:tF,onMouseUp:Zt},a$e(n,{aria:!0,data:!0})),w.createElement("div",{className:St("".concat(s,"-input"),(t={},$e(t,"".concat(s,"-input-active"),Le===0),$e(t,"".concat(s,"-input-placeholder"),!!vt),t)),ref:Se},w.createElement("input",rt({id:a,disabled:un[0],readOnly:Ze||typeof On[0]=="function"||!B_,value:vt||$s,onChange:function(jn){_o(jn.target.value)},autoFocus:b,placeholder:io(v,0)||"",ref:Tt},cl,Rb,{autoComplete:Nt}))),w.createElement("div",{className:"".concat(s,"-range-separator"),ref:wt},R),w.createElement("div",{className:St("".concat(s,"-input"),(i={},$e(i,"".concat(s,"-input-active"),Le===1),$e(i,"".concat(s,"-input-placeholder"),!!Cr),i)),ref:Xe},w.createElement("input",rt({disabled:un[1],readOnly:Ze||typeof On[0]=="function"||!Vg,value:Cr||yr,onChange:function(jn){zr(jn.target.value)},placeholder:io(v,1)||"",ref:zt},dS,Rb,{autoComplete:Nt}))),w.createElement("div",{className:"".concat(s,"-active-bar"),style:Qe(Qe({},oF),{},{width:Zk,position:"absolute"})}),iF,Xk&&rF)))}var $3t=function(n){I_(t,n);var e=pk(t);function t(){var i;Ua(this,t);for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return i=e.call.apply(e,[this].concat(o)),$e(Sr(i),"pickerRef",w.createRef()),$e(Sr(i),"focus",function(){i.pickerRef.current&&i.pickerRef.current.focus()}),$e(Sr(i),"blur",function(){i.pickerRef.current&&i.pickerRef.current.blur()}),i}return qa(t,[{key:"render",value:function(){return w.createElement(B3t,rt({},this.props,{pickerRef:this.pickerRef}))}}]),t}(w.Component);const V3t=n=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:n,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),pge=n=>({borderColor:n.hoverBorderColor,backgroundColor:n.hoverBg}),ID=n=>({borderColor:n.activeBorderColor,boxShadow:n.activeShadow,outline:0,backgroundColor:n.activeBg}),r8e=n=>({color:n.colorTextDisabled,backgroundColor:n.colorBgContainerDisabled,borderColor:n.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"&:hover":Object.assign({},pge(lh(n,{hoverBorderColor:n.colorBorder,hoverBg:n.colorBgContainerDisabled})))}),o8e=n=>{const{paddingBlockLG:e,fontSizeLG:t,lineHeightLG:i,borderRadiusLG:r,paddingInlineLG:o}=n;return{padding:`${e}px ${o}px`,fontSize:t,lineHeight:i,borderRadius:r}},s8e=n=>({padding:`${n.paddingBlockSM}px ${n.paddingInlineSM}px`,borderRadius:n.borderRadiusSM}),a8e=(n,e)=>{const{componentCls:t,colorError:i,colorWarning:r,errorActiveShadow:o,warningActiveShadow:s,colorErrorBorderHover:a,colorWarningBorderHover:l}=n;return{[`&-status-error:not(${e}-disabled):not(${e}-borderless)${e}`]:{borderColor:i,"&:hover":{borderColor:a},"&:focus, &:focus-within":Object.assign({},ID(lh(n,{activeBorderColor:i,activeShadow:o}))),[`${t}-prefix, ${t}-suffix`]:{color:i}},[`&-status-warning:not(${e}-disabled):not(${e}-borderless)${e}`]:{borderColor:r,"&:hover":{borderColor:l},"&:focus, &:focus-within":Object.assign({},ID(lh(n,{activeBorderColor:r,activeShadow:s}))),[`${t}-prefix, ${t}-suffix`]:{color:r}}}},mge=n=>Object.assign(Object.assign({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${n.paddingBlock}px ${n.paddingInline}px`,color:n.colorText,fontSize:n.fontSize,lineHeight:n.lineHeight,backgroundColor:n.colorBgContainer,backgroundImage:"none",borderWidth:n.lineWidth,borderStyle:n.lineType,borderColor:n.colorBorder,borderRadius:n.borderRadius,transition:`all ${n.motionDurationMid}`},V3t(n.colorTextPlaceholder)),{"&:hover":Object.assign({},pge(n)),"&:focus, &:focus-within":Object.assign({},ID(n)),"&-disabled, &[disabled]":Object.assign({},r8e(n)),"&-borderless":{"&, &:hover, &:focus, &-focused, &-disabled, &[disabled]":{backgroundColor:"transparent",border:"none",boxShadow:"none"}},"textarea&":{maxWidth:"100%",height:"auto",minHeight:n.controlHeight,lineHeight:n.lineHeight,verticalAlign:"bottom",transition:`all ${n.motionDurationSlow}, height 0s`,resize:"vertical"},"&-lg":Object.assign({},o8e(n)),"&-sm":Object.assign({},s8e(n)),"&-rtl":{direction:"rtl"},"&-textarea-rtl":{direction:"rtl"}}),H3t=n=>{const{componentCls:e,antCls:t}=n;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:n.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${e}, &-lg > ${e}-group-addon`]:Object.assign({},o8e(n)),[`&-sm ${e}, &-sm > ${e}-group-addon`]:Object.assign({},s8e(n)),[`&-lg ${t}-select-single ${t}-select-selector`]:{height:n.controlHeightLG},[`&-sm ${t}-select-single ${t}-select-selector`]:{height:n.controlHeightSM},[`> ${e}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${e}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${n.paddingInline}px`,color:n.colorText,fontWeight:"normal",fontSize:n.fontSize,textAlign:"center",backgroundColor:n.addonBg,border:`${n.lineWidth}px ${n.lineType} ${n.colorBorder}`,borderRadius:n.borderRadius,transition:`all ${n.motionDurationSlow}`,lineHeight:1,[`${t}-select`]:{margin:`-${n.paddingBlock+1}px -${n.paddingInline}px`,[`&${t}-select-single:not(${t}-select-customize-input):not(${t}-pagination-size-changer)`]:{[`${t}-select-selector`]:{backgroundColor:"inherit",border:`${n.lineWidth}px ${n.lineType} transparent`,boxShadow:"none"}},"&-open, &-focused":{[`${t}-select-selector`]:{color:n.colorPrimary}}},[`${t}-cascader-picker`]:{margin:`-9px -${n.paddingInline}px`,backgroundColor:"transparent",[`${t}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},[`${e}`]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1,[`${e}-search-with-button &`]:{zIndex:0}}},[`> ${e}:first-child, ${e}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}-affix-wrapper`]:{[`&:not(:first-child) ${e}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${e}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${e}:last-child, ${e}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${t}-select ${t}-select-selector`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${e}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0,[`${e}-search &`]:{borderStartStartRadius:n.borderRadius,borderEndStartRadius:n.borderRadius}},[`&:not(:first-child), ${e}-search &:not(:first-child)`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${e}-group-compact`]:Object.assign(Object.assign({display:"block"},BNt()),{[`${e}-group-addon, ${e}-group-wrap, > ${e}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:n.lineWidth,"&:hover":{zIndex:1},"&:focus":{zIndex:1}}},"& > *":{display:"inline-block",float:"none",verticalAlign:"top",borderRadius:0},[`
& > ${e}-affix-wrapper,
& > ${e}-number-affix-wrapper,
& > ${t}-picker-range
`]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:-n.lineWidth,borderInlineEndWidth:n.lineWidth},[`${e}`]:{float:"none"},[`& > ${t}-select > ${t}-select-selector,
& > ${t}-select-auto-complete ${e},
& > ${t}-cascader-picker ${e},
& > ${e}-group-wrapper ${e}`]:{borderInlineEndWidth:n.lineWidth,borderRadius:0,"&:hover":{zIndex:1},"&:focus":{zIndex:1}},[`& > ${t}-select-focused`]:{zIndex:1},[`& > ${t}-select > ${t}-select-arrow`]:{zIndex:1},[`& > *:first-child,
& > ${t}-select:first-child > ${t}-select-selector,
& > ${t}-select-auto-complete:first-child ${e},
& > ${t}-cascader-picker:first-child ${e}`]:{borderStartStartRadius:n.borderRadius,borderEndStartRadius:n.borderRadius},[`& > *:last-child,
& > ${t}-select:last-child > ${t}-select-selector,
& > ${t}-cascader-picker:last-child ${e},
& > ${t}-cascader-picker-focused:last-child ${e}`]:{borderInlineEndWidth:n.lineWidth,borderStartEndRadius:n.borderRadius,borderEndEndRadius:n.borderRadius},[`& > ${t}-select-auto-complete ${e}`]:{verticalAlign:"top"},[`${e}-group-wrapper + ${e}-group-wrapper`]:{marginInlineStart:-n.lineWidth,[`${e}-affix-wrapper`]:{borderRadius:0}},[`${e}-group-wrapper:not(:last-child)`]:{[`&${e}-search > ${e}-group`]:{[`& > ${e}-group-addon > ${e}-search-button`]:{borderRadius:0},[`& > ${e}`]:{borderStartStartRadius:n.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:n.borderRadius}}}})}},W3t=n=>{const{componentCls:e,controlHeightSM:t,lineWidth:i}=n,r=16,o=(t-i*2-r)/2;return{[e]:Object.assign(Object.assign(Object.assign(Object.assign({},UP(n)),mge(n)),a8e(n,e)),{'&[type="color"]':{height:n.controlHeight,[`&${e}-lg`]:{height:n.controlHeightLG},[`&${e}-sm`]:{height:t,paddingTop:o,paddingBottom:o}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{"-webkit-appearance":"none"}})}},z3t=n=>{const{componentCls:e}=n;return{[`${e}-clear-icon`]:{margin:0,color:n.colorTextQuaternary,fontSize:n.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${n.motionDurationSlow}`,"&:hover":{color:n.colorTextTertiary},"&:active":{color:n.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${n.inputAffixPadding}px`}}}},j3t=n=>{const{componentCls:e,inputAffixPadding:t,colorTextDescription:i,motionDurationSlow:r,colorIcon:o,colorIconHover:s,iconCls:a}=n;return{[`${e}-affix-wrapper`]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},mge(n)),{display:"inline-flex",[`&:not(${e}-affix-wrapper-disabled):hover`]:{zIndex:1,[`${e}-search-with-button &`]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},"&-disabled":{[`${e}[disabled]`]:{background:"transparent"}},[`> input${e}`]:{padding:0,fontSize:"inherit",border:"none",borderRadius:0,outline:"none","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[`${e}`]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:n.paddingXS}},"&-show-count-suffix":{color:i},"&-show-count-has-suffix":{marginInlineEnd:n.paddingXXS},"&-prefix":{marginInlineEnd:t},"&-suffix":{marginInlineStart:t}}}),z3t(n)),{[`${a}${e}-password-icon`]:{color:o,cursor:"pointer",transition:`all ${r}`,"&:hover":{color:s}}}),a8e(n,`${e}-affix-wrapper`))}},U3t=n=>{const{componentCls:e,colorError:t,colorWarning:i,borderRadiusLG:r,borderRadiusSM:o}=n;return{[`${e}-group`]:Object.assign(Object.assign(Object.assign({},UP(n)),H3t(n)),{"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${e}-group-addon`]:{borderRadius:r,fontSize:n.fontSizeLG}},"&-sm":{[`${e}-group-addon`]:{borderRadius:o}},"&-status-error":{[`${e}-group-addon`]:{color:t,borderColor:t}},"&-status-warning":{[`${e}-group-addon`]:{color:i,borderColor:i}},"&-disabled":{[`${e}-group-addon`]:Object.assign({},r8e(n))},[`&:not(${e}-compact-first-item):not(${e}-compact-last-item)${e}-compact-item`]:{[`${e}, ${e}-group-addon`]:{borderRadius:0}},[`&:not(${e}-compact-last-item)${e}-compact-first-item`]:{[`${e}, ${e}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${e}-compact-first-item)${e}-compact-last-item`]:{[`${e}, ${e}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}})}},q3t=n=>{const{componentCls:e,antCls:t}=n,i=`${e}-search`;return{[i]:{[`${e}`]:{"&:hover, &:focus":{borderColor:n.colorPrimaryHover,[`+ ${e}-group-addon ${i}-button:not(${t}-btn-primary)`]:{borderInlineStartColor:n.colorPrimaryHover}}},[`${e}-affix-wrapper`]:{borderRadius:0},[`${e}-lg`]:{lineHeight:n.lineHeightLG-2e-4},[`> ${e}-group`]:{[`> ${e}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${i}-button`]:{paddingTop:0,paddingBottom:0,borderStartStartRadius:0,borderStartEndRadius:n.borderRadius,borderEndEndRadius:n.borderRadius,borderEndStartRadius:0,boxShadow:"none"},[`${i}-button:not(${t}-btn-primary)`]:{color:n.colorTextDescription,"&:hover":{color:n.colorPrimaryHover},"&:active":{color:n.colorPrimaryActive},[`&${t}-btn-loading::before`]:{insetInlineStart:0,insetInlineEnd:0,insetBlockStart:0,insetBlockEnd:0}}}},[`${i}-button`]:{height:n.controlHeight,"&:hover, &:focus":{zIndex:1}},[`&-large ${i}-button`]:{height:n.controlHeightLG},[`&-small ${i}-button`]:{height:n.controlHeightSM},"&-rtl":{direction:"rtl"},[`&${e}-compact-item`]:{[`&:not(${e}-compact-last-item)`]:{[`${e}-group-addon`]:{[`${e}-search-button`]:{marginInlineEnd:-n.lineWidth,borderRadius:0}}},[`&:not(${e}-compact-first-item)`]:{[`${e},${e}-affix-wrapper`]:{borderRadius:0}},[`> ${e}-group-addon ${e}-search-button,
> ${e},
${e}-affix-wrapper`]:{"&:hover,&:focus,&:active":{zIndex:2}},[`> ${e}-affix-wrapper-focused`]:{zIndex:2}}}}},K3t=n=>{const{componentCls:e,paddingLG:t}=n,i=`${e}-textarea`;return{[i]:{position:"relative","&-show-count":{[`> ${e}`]:{height:"100%"},[`${e}-data-count`]:{position:"absolute",bottom:-n.fontSize*n.lineHeight,insetInlineEnd:0,color:n.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},"&-allow-clear":{[`> ${e}`]:{paddingInlineEnd:t}},[`&-affix-wrapper${i}-has-feedback`]:{[`${e}`]:{paddingInlineEnd:t}},[`&-affix-wrapper${e}-affix-wrapper`]:{padding:0,[`> textarea${e}`]:{fontSize:"inherit",border:"none",outline:"none","&:focus":{boxShadow:"none !important"}},[`${e}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${e}-clear-icon`]:{position:"absolute",insetInlineEnd:n.paddingXS,insetBlockStart:n.paddingXS},[`${i}-suffix`]:{position:"absolute",top:0,insetInlineEnd:n.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}}}}};function l8e(n){return lh(n,{inputAffixPadding:n.paddingXXS})}const c8e=n=>{const{controlHeight:e,fontSize:t,lineHeight:i,lineWidth:r,controlHeightSM:o,controlHeightLG:s,fontSizeLG:a,lineHeightLG:l,paddingSM:c,controlPaddingHorizontalSM:u,controlPaddingHorizontal:d,colorFillAlter:h,colorPrimaryHover:g,colorPrimary:p,controlOutlineWidth:m,controlOutline:_,colorErrorOutline:v,colorWarningOutline:b}=n;return{paddingBlock:Math.max(Math.round((e-t*i)/2*10)/10-r,0),paddingBlockSM:Math.max(Math.round((o-t*i)/2*10)/10-r,0),paddingBlockLG:Math.ceil((s-a*l)/2*10)/10-r,paddingInline:c-r,paddingInlineSM:u-r,paddingInlineLG:d-r,addonBg:h,activeBorderColor:p,hoverBorderColor:g,activeShadow:`0 0 0 ${m}px ${_}`,errorActiveShadow:`0 0 0 ${m}px ${v}`,warningActiveShadow:`0 0 0 ${m}px ${b}`,hoverBg:"",activeBg:""}};eA("Input",n=>{const e=lh(n,l8e(n));return[W3t(e),K3t(e),j3t(e),U3t(e),q3t(e),lge(e)]},c8e);const ZQ=(n,e,t,i)=>{const{lineHeight:r}=n,o=Math.floor(t*r)+2,s=Math.max((e-o)/2,0),a=Math.max(e-o-s,0);return{padding:`${s}px ${i}px ${a}px`}},G3t=n=>{const{componentCls:e,pickerCellCls:t,pickerCellInnerCls:i,cellHeight:r,motionDurationSlow:o,borderRadiusSM:s,motionDurationMid:a,cellHoverBg:l,lineWidth:c,lineType:u,colorPrimary:d,cellActiveWithRangeBg:h,colorTextLightSolid:g,controlHeightSM:p,cellRangeBorderColor:m,pickerCellBorderGap:_,cellHoverWithRangeBg:v,cellWidth:b,colorTextDisabled:y,cellBgDisabled:C}=n;return{"&::before":{position:"absolute",top:"50%",insetInlineStart:0,insetInlineEnd:0,zIndex:1,height:r,transform:"translateY(-50%)",transition:`all ${o}`,content:'""'},[i]:{position:"relative",zIndex:2,display:"inline-block",minWidth:r,height:r,lineHeight:`${r}px`,borderRadius:s,transition:`background ${a}, border ${a}`},"&-range-hover-start, &-range-hover-end":{[i]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:hover:not(${t}-in-view),
&:hover:not(${t}-selected):not(${t}-range-start):not(${t}-range-end):not(${t}-range-hover-start):not(${t}-range-hover-end)`]:{[i]:{background:l}},[`&-in-view${t}-today ${i}`]:{"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:1,border:`${c}px ${u} ${d}`,borderRadius:s,content:'""'}},[`&-in-view${t}-in-range`]:{position:"relative","&::before":{background:h}},[`&-in-view${t}-selected ${i},
&-in-view${t}-range-start ${i},
&-in-view${t}-range-end ${i}`]:{color:g,background:d},[`&-in-view${t}-range-start:not(${t}-range-start-single),
&-in-view${t}-range-end:not(${t}-range-end-single)`]:{"&::before":{background:h}},[`&-in-view${t}-range-start::before`]:{insetInlineStart:"50%"},[`&-in-view${t}-range-end::before`]:{insetInlineEnd:"50%"},[`&-in-view${t}-range-hover-start:not(${t}-in-range):not(${t}-range-start):not(${t}-range-end),
&-in-view${t}-range-hover-end:not(${t}-in-range):not(${t}-range-start):not(${t}-range-end),
&-in-view${t}-range-hover-start${t}-range-start-single,
&-in-view${t}-range-hover-start${t}-range-start${t}-range-end${t}-range-end-near-hover,
&-in-view${t}-range-hover-end${t}-range-start${t}-range-end${t}-range-start-near-hover,
&-in-view${t}-range-hover-end${t}-range-end-single,
&-in-view${t}-range-hover:not(${t}-in-range)`]:{"&::after":{position:"absolute",top:"50%",zIndex:0,height:p,borderTop:`${c}px dashed ${m}`,borderBottom:`${c}px dashed ${m}`,transform:"translateY(-50%)",transition:`all ${o}`,content:'""'}},"&-range-hover-start::after,\n &-range-hover-end::after,\n &-range-hover::after":{insetInlineEnd:0,insetInlineStart:_},[`&-in-view${t}-in-range${t}-range-hover::before,
&-in-view${t}-in-range${t}-range-hover-start::before,
&-in-view${t}-in-range${t}-range-hover-end::before,
&-in-view${t}-range-start${t}-range-hover::before,
&-in-view${t}-range-end${t}-range-hover::before,
&-in-view${t}-range-start:not(${t}-range-start-single)${t}-range-hover-start::before,
&-in-view${t}-range-end:not(${t}-range-end-single)${t}-range-hover-end::before,
${e}-panel
> :not(${e}-date-panel)
&-in-view${t}-in-range${t}-range-hover-start::before,
${e}-panel
> :not(${e}-date-panel)
&-in-view${t}-in-range${t}-range-hover-end::before`]:{background:v},[`&-in-view${t}-range-start:not(${t}-range-start-single):not(${t}-range-end) ${i}`]:{borderStartStartRadius:s,borderEndStartRadius:s,borderStartEndRadius:0,borderEndEndRadius:0},[`&-in-view${t}-range-end:not(${t}-range-end-single):not(${t}-range-start) ${i}`]:{borderStartStartRadius:0,borderEndStartRadius:0,borderStartEndRadius:s,borderEndEndRadius:s},[`&-range-hover${t}-range-end::after`]:{insetInlineStart:"50%"},[`tr > &-in-view${t}-range-hover:first-child::after,
tr > &-in-view${t}-range-hover-end:first-child::after,
&-in-view${t}-start${t}-range-hover-edge-start${t}-range-hover-edge-start-near-range::after,
&-in-view${t}-range-hover-edge-start:not(${t}-range-hover-edge-start-near-range)::after,
&-in-view${t}-range-hover-start::after`]:{insetInlineStart:(b-r)/2,borderInlineStart:`${c}px dashed ${m}`,borderStartStartRadius:s,borderEndStartRadius:s},[`tr > &-in-view${t}-range-hover:last-child::after,
tr > &-in-view${t}-range-hover-start:last-child::after,
&-in-view${t}-end${t}-range-hover-edge-end${t}-range-hover-edge-end-near-range::after,
&-in-view${t}-range-hover-edge-end:not(${t}-range-hover-edge-end-near-range)::after,
&-in-view${t}-range-hover-end::after`]:{insetInlineEnd:(b-r)/2,borderInlineEnd:`${c}px dashed ${m}`,borderStartEndRadius:s,borderEndEndRadius:s},"&-disabled":{color:y,pointerEvents:"none",[i]:{background:"transparent"},"&::before":{background:C}},[`&-disabled${t}-today ${i}::before`]:{borderColor:y}}},Y3t=n=>{const{componentCls:e,pickerCellCls:t,pickerCellInnerCls:i,pickerYearMonthCellWidth:r,pickerControlIconSize:o,cellWidth:s,paddingSM:a,paddingXS:l,paddingXXS:c,colorBgContainer:u,lineWidth:d,lineType:h,borderRadiusLG:g,colorPrimary:p,colorTextHeading:m,colorSplit:_,pickerControlIconBorderWidth:v,colorIcon:b,textHeight:y,motionDurationMid:C,colorIconHover:x,fontWeightStrong:k,cellHeight:I,pickerCellPaddingVertical:L,colorTextDisabled:D,colorText:R,fontSize:P,cellHoverWithRangeBg:M,motionDurationSlow:O,withoutTimeCellHeight:B,pickerQuarterPanelContentHeight:F,colorLink:H,colorLinkActive:V,colorLinkHover:$,cellRangeBorderColor:j,borderRadiusSM:Y,colorTextLightSolid:ne,cellHoverBg:se,timeColumnHeight:he,timeColumnWidth:xe,timeCellHeight:_e,controlItemBgActive:Ie,marginXXS:Re,pickerDatePanelPaddingHorizontal:Ye}=n,Ze=s*7+Ye*2,tt=(Ze-l*2)/3-r-a,Be=(Ze-l*2)/4-r;return{[e]:{"&-panel":{display:"inline-flex",flexDirection:"column",textAlign:"center",background:u,border:`${d}px ${h} ${_}`,borderRadius:g,outline:"none","&-focused":{borderColor:p},"&-rtl":{direction:"rtl",[`${e}-prev-icon,
${e}-super-prev-icon`]:{transform:"rotate(45deg)"},[`${e}-next-icon,
${e}-super-next-icon`]:{transform:"rotate(-135deg)"}}},"&-decade-panel,\n &-year-panel,\n &-quarter-panel,\n &-month-panel,\n &-week-panel,\n &-date-panel,\n &-time-panel":{display:"flex",flexDirection:"column",width:Ze},"&-header":{display:"flex",padding:`0 ${l}px`,color:m,borderBottom:`${d}px ${h} ${_}`,"> *":{flex:"none"},button:{padding:0,color:b,lineHeight:`${y}px`,background:"transparent",border:0,cursor:"pointer",transition:`color ${C}`,fontSize:"inherit"},"> button":{minWidth:"1.6em",fontSize:P,"&:hover":{color:x}},"&-view":{flex:"auto",fontWeight:k,lineHeight:`${y}px`,button:{color:"inherit",fontWeight:"inherit",verticalAlign:"top","&:not(:first-child)":{marginInlineStart:l},"&:hover":{color:p}}}},"&-prev-icon,\n &-next-icon,\n &-super-prev-icon,\n &-super-next-icon":{position:"relative",display:"inline-block",width:o,height:o,"&::before":{position:"absolute",top:0,insetInlineStart:0,display:"inline-block",width:o,height:o,border:"0 solid currentcolor",borderBlockStartWidth:v,borderBlockEndWidth:0,borderInlineStartWidth:v,borderInlineEndWidth:0,content:'""'}},"&-super-prev-icon,\n &-super-next-icon":{"&::after":{position:"absolute",top:Math.ceil(o/2),insetInlineStart:Math.ceil(o/2),display:"inline-block",width:o,height:o,border:"0 solid currentcolor",borderBlockStartWidth:v,borderBlockEndWidth:0,borderInlineStartWidth:v,borderInlineEndWidth:0,content:'""'}},"&-prev-icon,\n &-super-prev-icon":{transform:"rotate(-45deg)"},"&-next-icon,\n &-super-next-icon":{transform:"rotate(135deg)"},"&-content":{width:"100%",tableLayout:"fixed",borderCollapse:"collapse","th, td":{position:"relative",minWidth:I,fontWeight:"normal"},th:{height:I+L*2,color:R,verticalAlign:"middle"}},"&-cell":Object.assign({padding:`${L}px 0`,color:D,cursor:"pointer","&-in-view":{color:R}},G3t(n)),[`&-date-panel ${e}-cell-in-view${e}-cell-in-range${e}-cell-range-hover-start ${i},
&-date-panel ${e}-cell-in-view${e}-cell-in-range${e}-cell-range-hover-end ${i}`]:{"&::after":{position:"absolute",top:0,bottom:0,zIndex:-1,background:M,transition:`all ${O}`,content:'""'}},[`&-date-panel
${e}-cell-in-view${e}-cell-in-range${e}-cell-range-hover-start
${i}::after`]:{insetInlineEnd:-(s-I)/2,insetInlineStart:0},[`&-date-panel ${e}-cell-in-view${e}-cell-in-range${e}-cell-range-hover-end ${i}::after`]:{insetInlineEnd:0,insetInlineStart:-(s-I)/2},[`&-range-hover${e}-range-start::after`]:{insetInlineEnd:"50%"},"&-decade-panel,\n &-year-panel,\n &-quarter-panel,\n &-month-panel":{[`${e}-content`]:{height:B*4},[i]:{padding:`0 ${l}px`}},"&-quarter-panel":{[`${e}-content`]:{height:F},[`${e}-cell-range-hover-start::after`]:{insetInlineStart:Be,borderInlineStart:`${d}px dashed ${j}`,[`${e}-panel-rtl &`]:{insetInlineEnd:Be,borderInlineEnd:`${d}px dashed ${j}`}},[`${e}-cell-range-hover-end::after`]:{insetInlineEnd:Be,borderInlineEnd:`${d}px dashed ${j}`,[`${e}-panel-rtl &`]:{insetInlineStart:Be,borderInlineStart:`${d}px dashed ${j}`}}},[`&-panel ${e}-footer`]:{borderTop:`${d}px ${h} ${_}`},"&-footer":{width:"min-content",minWidth:"100%",lineHeight:`${y-2*d}px`,textAlign:"center","&-extra":{padding:`0 ${a}px`,lineHeight:`${y-2*d}px`,textAlign:"start","&:not(:last-child)":{borderBottom:`${d}px ${h} ${_}`}}},"&-now":{textAlign:"start"},"&-today-btn":{color:H,"&:hover":{color:$},"&:active":{color:V},[`&${e}-today-btn-disabled`]:{color:D,cursor:"not-allowed"}},"&-decade-panel":{[i]:{padding:`0 ${l/2}px`},[`${e}-cell::before`]:{display:"none"}},"&-year-panel,\n &-quarter-panel,\n &-month-panel":{[`${e}-body`]:{padding:`0 ${l}px`},[i]:{width:r},[`${e}-cell-range-hover-start::after`]:{borderStartStartRadius:Y,borderEndStartRadius:Y,borderStartEndRadius:0,borderEndEndRadius:0,[`${e}-panel-rtl &`]:{borderStartStartRadius:0,borderEndStartRadius:0,borderStartEndRadius:Y,borderEndEndRadius:Y}},[`${e}-cell-range-hover-end::after`]:{borderStartStartRadius:0,borderEndStartRadius:0,borderStartEndRadius:Y,borderEndEndRadius:Y,[`${e}-panel-rtl &`]:{borderStartStartRadius:Y,borderEndStartRadius:Y,borderStartEndRadius:0,borderEndEndRadius:0}}},"&-year-panel,\n &-month-panel":{[`${e}-cell-range-hover-start::after`]:{insetInlineStart:tt,borderInlineStart:`${d}px dashed ${j}`,[`${e}-panel-rtl &`]:{insetInlineEnd:tt,borderInlineEnd:`${d}px dashed ${j}`}},[`${e}-cell-range-hover-end::after`]:{insetInlineEnd:tt,borderInlineEnd:`${d}px dashed ${j}`,[`${e}-panel-rtl &`]:{insetInlineStart:tt,borderInlineStart:`${d}px dashed ${j}`}}},"&-week-panel":{[`${e}-body`]:{padding:`${l}px ${a}px`},[`${e}-cell`]:{[`&:hover ${i},
&-selected ${i},
${i}`]:{background:"transparent !important"}},"&-row":{td:{"&:before":{transition:`background ${C}`},"&:first-child:before":{borderStartStartRadius:Y,borderEndStartRadius:Y},"&:last-child:before":{borderStartEndRadius:Y,borderEndEndRadius:Y}},"&:hover td":{"&:before":{background:se}},"&-range-start td,\n &-range-end td,\n &-selected td":{[`&${t}`]:{"&:before":{background:p},[`&${e}-cell-week`]:{color:new Mu(ne).setAlpha(.5).toHexString()},[i]:{color:ne}}},"&-range-hover td:before":{background:Ie}}},"&-date-panel":{[`${e}-body`]:{padding:`${l}px ${Ye}px`},[`${e}-content`]:{width:s*7,th:{width:s,boxSizing:"border-box",padding:0}}},"&-datetime-panel":{display:"flex",[`${e}-time-panel`]:{borderInlineStart:`${d}px ${h} ${_}`},[`${e}-date-panel,
${e}-time-panel`]:{transition:`opacity ${O}`},"&-active":{[`${e}-date-panel,
${e}-time-panel`]:{opacity:.3,"&-active":{opacity:1}}}},"&-time-panel":{width:"auto",minWidth:"auto",direction:"ltr",[`${e}-content`]:{display:"flex",flex:"auto",height:he},"&-column":{flex:"1 0 auto",width:xe,margin:`${c}px 0`,padding:0,overflowY:"hidden",textAlign:"start",listStyle:"none",transition:`background ${C}`,overflowX:"hidden","&::-webkit-scrollbar":{width:8,backgroundColor:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:n.colorTextTertiary,borderRadius:4},"&":{scrollbarWidth:"thin",scrollbarColor:`${n.colorTextTertiary} transparent`},"&::after":{display:"block",height:he-_e,content:'""'},"&:not(:first-child)":{borderInlineStart:`${d}px ${h} ${_}`},"&-active":{background:new Mu(Ie).setAlpha(.2).toHexString()},"&:hover":{overflowY:"auto"},"> li":{margin:0,padding:0,[`&${e}-time-panel-cell`]:{marginInline:Re,[`${e}-time-panel-cell-inner`]:{display:"block",width:xe-2*Re,height:_e,margin:0,paddingBlock:0,paddingInlineEnd:0,paddingInlineStart:(xe-_e)/2,color:R,lineHeight:`${_e}px`,borderRadius:Y,cursor:"pointer",transition:`background ${C}`,"&:hover":{background:se}},"&-selected":{[`${e}-time-panel-cell-inner`]:{background:Ie}},"&-disabled":{[`${e}-time-panel-cell-inner`]:{color:D,background:"transparent",cursor:"not-allowed"}}}}}},[`&-datetime-panel ${e}-time-panel-column:after`]:{height:he-_e+c*2}}}},Q3t=n=>{const{componentCls:e,colorBgContainer:t,colorError:i,errorActiveShadow:r,colorWarning:o,warningActiveShadow:s,colorErrorHover:a,colorWarningHover:l}=n;return{[`${e}:not(${e}-disabled):not([disabled])`]:{[`&${e}-status-error`]:{backgroundColor:t,borderColor:i,"&:hover":{borderColor:a},[`&${e}-focused, &:focus`]:Object.assign({},ID(lh(n,{activeBorderColor:i,activeShadow:r}))),[`${e}-active-bar`]:{background:i}},[`&${e}-status-warning`]:{backgroundColor:t,borderColor:o,"&:hover":{borderColor:l},[`&${e}-focused, &:focus`]:Object.assign({},ID(lh(n,{activeBorderColor:o,activeShadow:s}))),[`${e}-active-bar`]:{background:o}}}}},X3t=n=>{const{componentCls:e,antCls:t,controlHeight:i,fontSize:r,paddingInline:o,colorBgContainer:s,lineWidth:a,lineType:l,colorBorder:c,borderRadius:u,motionDurationMid:d,colorBgContainerDisabled:h,colorTextDisabled:g,colorTextPlaceholder:p,controlHeightLG:m,fontSizeLG:_,controlHeightSM:v,paddingInlineSM:b,paddingXS:y,marginXS:C,colorTextDescription:x,lineWidthBold:k,lineHeight:I,colorPrimary:L,motionDurationSlow:D,zIndexPopup:R,paddingXXS:P,paddingSM:M,textHeight:O,cellActiveWithRangeBg:B,colorPrimaryBorder:F,sizePopupArrow:H,borderRadiusXS:V,borderRadiusOuter:$,colorBgElevated:j,borderRadiusLG:Y,boxShadowSecondary:ne,borderRadiusSM:se,colorSplit:he,cellHoverBg:xe,presetsWidth:_e,presetsMaxWidth:Ie,boxShadowPopoverArrow:Re,colorTextQuaternary:Ye}=n;return[{[e]:Object.assign(Object.assign(Object.assign({},UP(n)),ZQ(n,i,r,o)),{position:"relative",display:"inline-flex",alignItems:"center",background:s,lineHeight:1,border:`${a}px ${l} ${c}`,borderRadius:u,transition:`border ${d}, box-shadow ${d}`,"&:hover":Object.assign({},pge(n)),[`&-focused${e}`]:Object.assign({},ID(n)),[`&${e}-disabled`]:{background:h,borderColor:c,cursor:"not-allowed",[`${e}-suffix`]:{color:Ye}},[`&${e}-borderless`]:{backgroundColor:"transparent !important",borderColor:"transparent !important",boxShadow:"none !important"},[`${e}-input`]:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%","> input":Object.assign(Object.assign({},mge(n)),{flex:"auto",minWidth:1,height:"auto",padding:0,background:"transparent",border:0,borderRadius:0,fontFamily:"inherit","&:focus":{boxShadow:"none"},"&[disabled]":{background:"transparent"}}),"&:hover":{[`${e}-clear`]:{opacity:1}},"&-placeholder":{"> input":{color:p}}},"&-large":Object.assign(Object.assign({},ZQ(n,m,_,o)),{[`${e}-input > input`]:{fontSize:_}}),"&-small":Object.assign({},ZQ(n,v,r,b)),[`${e}-suffix`]:{display:"flex",flex:"none",alignSelf:"center",marginInlineStart:y/2,color:g,lineHeight:1,pointerEvents:"none","> *":{verticalAlign:"top","&:not(:last-child)":{marginInlineEnd:C}}},[`${e}-clear`]:{position:"absolute",top:"50%",insetInlineEnd:0,color:g,lineHeight:1,background:s,transform:"translateY(-50%)",cursor:"pointer",opacity:0,transition:`opacity ${d}, color ${d}`,"> *":{verticalAlign:"top"},"&:hover":{color:x}},[`${e}-separator`]:{position:"relative",display:"inline-block",width:"1em",height:_,color:g,fontSize:_,verticalAlign:"top",cursor:"default",[`${e}-focused &`]:{color:x},[`${e}-range-separator &`]:{[`${e}-disabled &`]:{cursor:"not-allowed"}}},"&-range":{position:"relative",display:"inline-flex",[`${e}-clear`]:{insetInlineEnd:o},"&:hover":{[`${e}-clear`]:{opacity:1}},[`${e}-active-bar`]:{bottom:-a,height:k,marginInlineStart:o,background:L,opacity:0,transition:`all ${D} ease-out`,pointerEvents:"none"},[`&${e}-focused`]:{[`${e}-active-bar`]:{opacity:1}},[`${e}-range-separator`]:{alignItems:"center",padding:`0 ${y}px`,lineHeight:1},[`&${e}-small`]:{[`${e}-clear`]:{insetInlineEnd:b},[`${e}-active-bar`]:{marginInlineStart:b}}},"&-dropdown":Object.assign(Object.assign(Object.assign({},UP(n)),Y3t(n)),{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:R,[`&${e}-dropdown-hidden`]:{display:"none"},[`&${e}-dropdown-placement-bottomLeft`]:{[`${e}-range-arrow`]:{top:0,display:"block",transform:"translateY(-100%)"}},[`&${e}-dropdown-placement-topLeft`]:{[`${e}-range-arrow`]:{bottom:0,display:"block",transform:"translateY(100%) rotate(180deg)"}},[`&${t}-slide-up-enter${t}-slide-up-enter-active${e}-dropdown-placement-topLeft,
&${t}-slide-up-enter${t}-slide-up-enter-active${e}-dropdown-placement-topRight,
&${t}-slide-up-appear${t}-slide-up-appear-active${e}-dropdown-placement-topLeft,
&${t}-slide-up-appear${t}-slide-up-appear-active${e}-dropdown-placement-topRight`]:{animationName:L$e},[`&${t}-slide-up-enter${t}-slide-up-enter-active${e}-dropdown-placement-bottomLeft,
&${t}-slide-up-enter${t}-slide-up-enter-active${e}-dropdown-placement-bottomRight,
&${t}-slide-up-appear${t}-slide-up-appear-active${e}-dropdown-placement-bottomLeft,
&${t}-slide-up-appear${t}-slide-up-appear-active${e}-dropdown-placement-bottomRight`]:{animationName:T$e},[`&${t}-slide-up-leave${t}-slide-up-leave-active${e}-dropdown-placement-topLeft,
&${t}-slide-up-leave${t}-slide-up-leave-active${e}-dropdown-placement-topRight`]:{animationName:D$e},[`&${t}-slide-up-leave${t}-slide-up-leave-active${e}-dropdown-placement-bottomLeft,
&${t}-slide-up-leave${t}-slide-up-leave-active${e}-dropdown-placement-bottomRight`]:{animationName:I$e},[`${e}-panel > ${e}-time-panel`]:{paddingTop:P},[`${e}-ranges`]:{marginBottom:0,padding:`${P}px ${M}px`,overflow:"hidden",lineHeight:`${O-2*a-y/2}px`,textAlign:"start",listStyle:"none",display:"flex",justifyContent:"space-between","> li":{display:"inline-block"},[`${e}-preset > ${t}-tag-blue`]:{color:L,background:B,borderColor:F,cursor:"pointer"},[`${e}-ok`]:{marginInlineStart:"auto"}},[`${e}-range-wrapper`]:{display:"flex",position:"relative"},[`${e}-range-arrow`]:Object.assign({position:"absolute",zIndex:1,display:"none",marginInlineStart:o*1.5,transition:`left ${D} ease-out`},PNt(H,V,$,j,Re)),[`${e}-panel-container`]:{overflow:"hidden",verticalAlign:"top",background:j,borderRadius:Y,boxShadow:ne,transition:`margin ${D}`,[`${e}-panel-layout`]:{display:"flex",flexWrap:"nowrap",alignItems:"stretch"},[`${e}-presets`]:{display:"flex",flexDirection:"column",minWidth:_e,maxWidth:Ie,ul:{height:0,flex:"auto",listStyle:"none",overflow:"auto",margin:0,padding:y,borderInlineEnd:`${a}px ${l} ${he}`,li:Object.assign(Object.assign({},MNt),{borderRadius:se,paddingInline:y,paddingBlock:(v-Math.round(r*I))/2,cursor:"pointer",transition:`all ${D}`,"+ li":{marginTop:C},"&:hover":{background:xe}})}},[`${e}-panels`]:{display:"inline-flex",flexWrap:"nowrap",direction:"ltr",[`${e}-panel`]:{borderWidth:`0 0 ${a}px`},"&:last-child":{[`${e}-panel`]:{borderWidth:0}}},[`${e}-panel`]:{verticalAlign:"top",background:"transparent",borderRadius:0,borderWidth:0,[`${e}-content,
table`]:{textAlign:"center"},"&-focused":{borderColor:c}}}}),"&-dropdown-range":{padding:`${H*2/3}px 0`,"&-hidden":{display:"none"}},"&-rtl":{direction:"rtl",[`${e}-separator`]:{transform:"rotate(180deg)"},[`${e}-footer`]:{"&-extra":{direction:"rtl"}}}})},Ixe(n,"slide-up"),Ixe(n,"slide-down"),Txe(n,"move-up"),Txe(n,"move-down")]},Z3t=n=>{const{componentCls:e,controlHeightLG:t,paddingXXS:i,padding:r}=n;return{pickerCellCls:`${e}-cell`,pickerCellInnerCls:`${e}-cell-inner`,pickerYearMonthCellWidth:t*1.5,pickerQuarterPanelContentHeight:t*1.4,pickerCellPaddingVertical:i+i/2,pickerCellBorderGap:2,pickerControlIconSize:7,pickerControlIconBorderWidth:1.5,pickerDatePanelPaddingHorizontal:r+i/2}},J3t=n=>({cellHoverBg:n.controlItemBgHover,cellActiveWithRangeBg:n.controlItemBgActive,cellHoverWithRangeBg:new Mu(n.colorPrimary).lighten(35).toHexString(),cellRangeBorderColor:new Mu(n.colorPrimary).lighten(20).toHexString(),cellBgDisabled:n.colorBgContainerDisabled,timeColumnWidth:n.controlHeightLG*1.4,timeColumnHeight:28*8,timeCellHeight:28,cellWidth:n.controlHeightSM*1.5,cellHeight:n.controlHeightSM,textHeight:n.controlHeightLG,withoutTimeCellHeight:n.controlHeightLG*1.65}),u8e=eA("DatePicker",n=>{const e=lh(l8e(n),Z3t(n));return[X3t(e),Q3t(e),lge(n,{focusElCls:`${n.componentCls}-focused`})]},n=>Object.assign(Object.assign(Object.assign({},c8e(n)),J3t(n)),{presetsWidth:120,presetsMaxWidth:200,zIndexPopup:n.zIndexPopupBase+50})),e5t=n=>{const{componentCls:e,sizePaddingEdgeHorizontal:t,colorSplit:i,lineWidth:r,textPaddingInline:o,orientationMargin:s,verticalMarginInline:a}=n;return{[e]:Object.assign(Object.assign({},UP(n)),{borderBlockStart:`${r}px solid ${i}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:a,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${r}px solid ${i}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${n.dividerHorizontalGutterMargin}px 0`},[`&-horizontal${e}-with-text`]:{display:"flex",alignItems:"center",margin:`${n.dividerHorizontalWithTextGutterMargin}px 0`,color:n.colorTextHeading,fontWeight:500,fontSize:n.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${i}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${r}px solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${e}-with-text-left`]:{"&::before":{width:`${s*100}%`},"&::after":{width:`${100-s*100}%`}},[`&-horizontal${e}-with-text-right`]:{"&::before":{width:`${100-s*100}%`},"&::after":{width:`${s*100}%`}},[`${e}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:o},"&-dashed":{background:"none",borderColor:i,borderStyle:"dashed",borderWidth:`${r}px 0 0`},[`&-horizontal${e}-with-text${e}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${e}-dashed`]:{borderInlineStartWidth:r,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${e}-with-text`]:{color:n.colorText,fontWeight:"normal",fontSize:n.fontSize},[`&-horizontal${e}-with-text-left${e}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${e}-inner-text`]:{paddingInlineStart:t}},[`&-horizontal${e}-with-text-right${e}-no-default-orientation-margin-right`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${e}-inner-text`]:{paddingInlineEnd:t}}})}},t5t=eA("Divider",n=>{const e=lh(n,{dividerHorizontalWithTextGutterMargin:n.margin,dividerHorizontalGutterMargin:n.marginLG,sizePaddingEdgeHorizontal:0});return[e5t(e)]},n=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:n.marginXS}));var n5t=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};const i5t=n=>{const{getPrefixCls:e,direction:t,divider:i}=w.useContext(Jp),{prefixCls:r,type:o="horizontal",orientation:s="center",orientationMargin:a,className:l,rootClassName:c,children:u,dashed:d,plain:h,style:g}=n,p=n5t(n,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),m=e("divider",r),[_,v]=t5t(m),b=s.length>0?`-${s}`:s,y=!!u,C=s==="left"&&a!=null,x=s==="right"&&a!=null,k=St(m,i==null?void 0:i.className,v,`${m}-${o}`,{[`${m}-with-text`]:y,[`${m}-with-text${b}`]:y,[`${m}-dashed`]:!!d,[`${m}-plain`]:!!h,[`${m}-rtl`]:t==="rtl",[`${m}-no-default-orientation-margin-left`]:C,[`${m}-no-default-orientation-margin-right`]:x},l,c),I=w.useMemo(()=>typeof a=="number"?a:/^\d+$/.test(a)?Number(a):a,[a]),L=Object.assign(Object.assign({},C&&{marginLeft:I}),x&&{marginRight:I});return _(w.createElement("div",Object.assign({className:k,style:Object.assign(Object.assign({},i==null?void 0:i.style),g)},p,{role:"separator"}),u&&o!=="vertical"&&w.createElement("span",{className:`${m}-inner-text`,style:L},u)))},r5t=i5t;var o5t={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"}}]},name:"calendar",theme:"outlined"};const s5t=o5t;var a5t=function(e,t){return w.createElement(F3,rt({},e,{ref:t,icon:s5t}))};const d8e=w.forwardRef(a5t);var l5t={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:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"};const c5t=l5t;var u5t=function(e,t){return w.createElement(F3,rt({},e,{ref:t,icon:c5t}))};const h8e=w.forwardRef(u5t);var d5t={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M873.1 596.2l-164-208A32 32 0 00684 376h-64.8c-6.7 0-10.4 7.7-6.3 13l144.3 183H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h695.9c26.8 0 41.7-30.8 25.2-51.8z"}}]},name:"swap-right",theme:"outlined"};const h5t=d5t;var f5t=function(e,t){return w.createElement(F3,rt({},e,{ref:t,icon:h5t}))};const g5t=w.forwardRef(f5t);function p5t(n,e,t){return t!==void 0?t:e==="year"&&n.lang.yearPlaceholder?n.lang.yearPlaceholder:e==="quarter"&&n.lang.quarterPlaceholder?n.lang.quarterPlaceholder:e==="month"&&n.lang.monthPlaceholder?n.lang.monthPlaceholder:e==="week"&&n.lang.weekPlaceholder?n.lang.weekPlaceholder:e==="time"&&n.timePickerLocale.placeholder?n.timePickerLocale.placeholder:n.lang.placeholder}function m5t(n,e,t){return t!==void 0?t:e==="year"&&n.lang.yearPlaceholder?n.lang.rangeYearPlaceholder:e==="quarter"&&n.lang.quarterPlaceholder?n.lang.rangeQuarterPlaceholder:e==="month"&&n.lang.monthPlaceholder?n.lang.rangeMonthPlaceholder:e==="week"&&n.lang.weekPlaceholder?n.lang.rangeWeekPlaceholder:e==="time"&&n.timePickerLocale.placeholder?n.timePickerLocale.rangePlaceholder:n.lang.rangePlaceholder}function _ge(n,e){const t={adjustX:1,adjustY:1};switch(e){case"bottomLeft":return{points:["tl","bl"],offset:[0,4],overflow:t};case"bottomRight":return{points:["tr","br"],offset:[0,4],overflow:t};case"topLeft":return{points:["bl","tl"],offset:[0,-4],overflow:t};case"topRight":return{points:["br","tr"],offset:[0,-4],overflow:t};default:return{points:n==="rtl"?["tr","br"]:["tl","bl"],offset:[0,4],overflow:t}}}function _5t(n){return n?Array.isArray(n)?n:[n]:[]}function B7(n){const{format:e,picker:t,showHour:i,showMinute:r,showSecond:o,use12Hours:s}=n,a=_5t(e)[0],l=Object.assign({},n);return e&&Array.isArray(e)&&(l.format=a),a&&typeof a=="string"&&(!a.includes("s")&&o===void 0&&(l.showSecond=!1),!a.includes("m")&&r===void 0&&(l.showMinute=!1),!a.includes("H")&&!a.includes("h")&&!a.includes("K")&&!a.includes("k")&&i===void 0&&(l.showHour=!1),(a.includes("a")||a.includes("A"))&&s===void 0&&(l.use12Hours=!0)),t==="time"?l:(typeof a=="function"&&delete l.format,{showTime:l})}function f8e(n,e,t){if(n===!1)return!1;const i={clearIcon:e??t};return typeof n=="object"?Object.assign(Object.assign({},i),n):i}function v5t(n){return w.createElement(GPt,Object.assign({size:"small",type:"primary"},n))}const b5t={button:v5t},g8e=b5t;var y5t=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};function C5t(n){return w.forwardRef((t,i)=>{const{prefixCls:r,getPopupContainer:o,className:s,placement:a,size:l,disabled:c,bordered:u=!0,placeholder:d,popupClassName:h,dropdownClassName:g,status:p,clearIcon:m,allowClear:_,rootClassName:v}=t,b=y5t(t,["prefixCls","getPopupContainer","className","placement","size","disabled","bordered","placeholder","popupClassName","dropdownClassName","status","clearIcon","allowClear","rootClassName"]),y=w.useRef(null),{getPrefixCls:C,direction:x,getPopupContainer:k}=w.useContext(Jp),I=C("picker",r),{compactSize:L,compactItemClassnames:D}=oge(I,x),{format:R,showTime:P,picker:M}=t,O=C(),[B,F]=u8e(I),H=Object.assign(Object.assign({},P?B7(Object.assign({format:R,picker:M},P)):{}),M==="time"?B7(Object.assign(Object.assign({format:R},t),{picker:M})):{}),V=rge(Re=>{var Ye;return(Ye=l??L)!==null&&Ye!==void 0?Ye:Re}),$=w.useContext(bj),j=c??$,Y=w.useContext(x$e),{hasFeedback:ne,status:se,feedbackIcon:he}=Y,xe=w.createElement(w.Fragment,null,M==="time"?w.createElement(h8e,null):w.createElement(d8e,null),ne&&he);w.useImperativeHandle(i,()=>({focus:()=>{var Re;return(Re=y.current)===null||Re===void 0?void 0:Re.focus()},blur:()=>{var Re;return(Re=y.current)===null||Re===void 0?void 0:Re.blur()}}));const[_e]=RBe("Calendar",A7),Ie=Object.assign(Object.assign({},_e),t.locale);return B(w.createElement($3t,Object.assign({separator:w.createElement("span",{"aria-label":"to",className:`${I}-separator`},w.createElement(g5t,null)),disabled:j,ref:y,dropdownAlign:_ge(x,a),placeholder:m5t(Ie,M,d),suffixIcon:xe,prevIcon:w.createElement("span",{className:`${I}-prev-icon`}),nextIcon:w.createElement("span",{className:`${I}-next-icon`}),superPrevIcon:w.createElement("span",{className:`${I}-super-prev-icon`}),superNextIcon:w.createElement("span",{className:`${I}-super-next-icon`}),transitionName:`${O}-slide-up`},b,H,{className:St({[`${I}-${V}`]:V,[`${I}-borderless`]:!u},R$e(I,N$e(se,p),ne),F,D,s,v),locale:Ie.lang,prefixCls:I,getPopupContainer:o||k,generateConfig:n,components:g8e,direction:x,dropdownClassName:St(F,h||g,v),allowClear:f8e(_,m,w.createElement(s$e,null))})))})}var w5t=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t};function S5t(n){function e(l,c){const u=c==="TimePicker"?"timePicker":"datePicker",d=w.forwardRef((h,g)=>{const{prefixCls:p,getPopupContainer:m,style:_,className:v,rootClassName:b,size:y,bordered:C=!0,placement:x,placeholder:k,popupClassName:I,dropdownClassName:L,disabled:D,status:R,clearIcon:P,allowClear:M}=h,O=w5t(h,["prefixCls","getPopupContainer","style","className","rootClassName","size","bordered","placement","placeholder","popupClassName","dropdownClassName","disabled","status","clearIcon","allowClear"]),{getPrefixCls:B,direction:F,getPopupContainer:H,[u]:V}=w.useContext(Jp),$=B("picker",p),{compactSize:j,compactItemClassnames:Y}=oge($,F),ne=w.useRef(null),{format:se,showTime:he}=h,[xe,_e]=u8e($);w.useImperativeHandle(g,()=>({focus:()=>{var pe;return(pe=ne.current)===null||pe===void 0?void 0:pe.focus()},blur:()=>{var pe;return(pe=ne.current)===null||pe===void 0?void 0:pe.blur()}}));const Ie={showToday:!0};let Re={};l&&(Re.picker=l);const Ye=l||h.picker;Re=Object.assign(Object.assign(Object.assign({},Re),he?B7(Object.assign({format:se,picker:Ye},he)):{}),Ye==="time"?B7(Object.assign(Object.assign({format:se},h),{picker:Ye})):{});const Ze=B(),tt=rge(pe=>{var me;return(me=y??j)!==null&&me!==void 0?me:pe}),Be=w.useContext(bj),kt=D??Be,Vt=w.useContext(x$e),{hasFeedback:xt,status:Kt,feedbackIcon:cn}=Vt,wn=w.createElement(w.Fragment,null,Ye==="time"?w.createElement(h8e,null):w.createElement(d8e,null),xt&&cn),[on]=RBe("DatePicker",A7),Zt=Object.assign(Object.assign({},on),h.locale);return xe(w.createElement(R3t,Object.assign({ref:ne,placeholder:p5t(Zt,Ye,k),suffixIcon:wn,dropdownAlign:_ge(F,x),prevIcon:w.createElement("span",{className:`${$}-prev-icon`}),nextIcon:w.createElement("span",{className:`${$}-next-icon`}),superPrevIcon:w.createElement("span",{className:`${$}-super-prev-icon`}),superNextIcon:w.createElement("span",{className:`${$}-super-next-icon`}),transitionName:`${Ze}-slide-up`},Ie,O,Re,{locale:Zt.lang,className:St({[`${$}-${tt}`]:tt,[`${$}-borderless`]:!C},R$e($,N$e(Kt,R),xt),_e,Y,V==null?void 0:V.className,v,b),style:Object.assign(Object.assign({},V==null?void 0:V.style),_),prefixCls:$,getPopupContainer:m||H,generateConfig:n,components:g8e,direction:F,disabled:kt,dropdownClassName:St(_e,b,I||L),allowClear:f8e(M,P,w.createElement(s$e,null))})))});return c&&(d.displayName=c),d}const t=e(),i=e("week","WeekPicker"),r=e("month","MonthPicker"),o=e("year","YearPicker"),s=e("time","TimePicker"),a=e("quarter","QuarterPicker");return{DatePicker:t,WeekPicker:i,MonthPicker:r,YearPicker:o,TimePicker:s,QuarterPicker:a}}function p8e(n){const{DatePicker:e,WeekPicker:t,MonthPicker:i,YearPicker:r,TimePicker:o,QuarterPicker:s}=S5t(n),a=C5t(n),l=e;return l.WeekPicker=t,l.MonthPicker=i,l.YearPicker=r,l.RangePicker=a,l.TimePicker=o,l.QuarterPicker=s,l}const rA=p8e(z4t);function m8e(n){const e=_ge(n.direction,n.placement);return e.overflow.adjustY=!1,e.overflow.adjustX=!1,Object.assign(Object.assign({},n),{dropdownAlign:e})}const E5t=A$e(rA,"picker",null,m8e);rA._InternalPanelDoNotUseOrYouWillBeFired=E5t;const x5t=A$e(rA.RangePicker,"picker",null,m8e);rA._InternalRangePanelDoNotUseOrYouWillBeFired=x5t;rA.generatePicker=p8e;const _8e=rA;function k5t(){const[n]=ue(),e=Ci(),t=Ti(),i=vk(),[r,o]=w.useState(!0),s=(l,c)=>e(Vr({object:"company",property:l,value:c})),a=()=>{ie.processing(),Te("POST",ye(`/api/v1/companies/${t.id}/default`),{}).then(l=>{ie.success(l.data.message),o(!1)})};return N(Ot,{title:n("overview"),children:[f(U,{leftSide:n("activate_company"),leftSideHelp:n("activate_company_help"),children:f(gt,{checked:!(t!=null&&t.is_disabled),onChange:l=>s("is_disabled",!l)})}),f(U,{leftSide:n("enable_markdown"),leftSideHelp:n("enable_markdown_help"),children:f(gt,{checked:t==null?void 0:t.markdown_enabled,onChange:l=>s("markdown_enabled",l)})}),f(U,{leftSide:n("include_drafts"),leftSideHelp:n("include_drafts_help"),children:f(gt,{checked:t==null?void 0:t.report_include_drafts,onChange:l=>s("report_include_drafts",l)})}),i.default_company_id!==(t==null?void 0:t.id)&&r&&N(_t,{children:[f(r5t,{}),f(U,{leftSide:n("set_default_company"),children:f(Ut,{type:"minimal",behavior:"button",onClick:a,children:t==null?void 0:t.settings.name})})]})]})}function T5t(){const[n]=ue();ha();const e=vk(),{dateFormat:t}=Il();return N(Ot,{title:n("plan"),children:[f(U,{className:"mb-3",leftSide:n("plan"),children:f("span",{children:n((e==null?void 0:e.plan_expires)!==""&&!Cn(e.plan_expires).isBefore(Cn())?"licensed":"plan_free_self_hosted")})}),(e==null?void 0:e.plan_expires)!==""&&f(U,{leftSide:n("expires_on"),children:Cn(e.plan_expires).year()>2e3?Jr(e.plan_expires,t):n("forever_free")}),Yo(),!u0()&&f(gAt,{})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const Ss=po(void 0);function I5t(){const[n]=ue(),e=Ti(),t=Ci(),i=ki(Ss),r=[{value:18e5,label:dt(n("count_minutes"),{count:"30"})},{value:72e5,label:dt(n("count_hours"),{count:"2"})},{value:288e5,label:dt(n("count_hours"),{count:"8"})},{value:864e5,label:dt(n("count_day"),{count:"1"})},{value:6048e5,label:dt(n("count_days"),{count:"7"})},{value:2592e6,label:dt(n("count_days"),{count:"30"})},{value:0,label:n("never")}],o=a=>t(Vr({object:"company",property:a.target.id,value:a.target.value})),s=(a,l)=>t(Vr({object:"company",property:a,value:l}));return N(Ot,{title:n("security_settings"),children:[f(U,{leftSide:n("password_timeout"),children:f(nn,{id:"default_password_timeout",value:e==null?void 0:e.default_password_timeout,onChange:o,errorMessage:i==null?void 0:i.errors.default_password_timeout,children:r.map(a=>f("option",{value:a.value,children:a.label},a.value))})}),f(U,{leftSide:n("web_session_timeout"),children:f(nn,{id:"session_timeout",value:e==null?void 0:e.session_timeout,onChange:o,errorMessage:i==null?void 0:i.errors.session_timeout,children:r.map(a=>f("option",{value:a.value,children:a.label},a.value))})}),f(U,{leftSide:n("require_password_with_social_login"),children:f(gt,{checked:e==null?void 0:e.oauth_password_required,id:"oauth_password_required",onChange:a=>s("oauth_password_required",a)})})]})}function L5t(){const[n]=ue(),e=vi(),t=Ri(_f),i=Tl(_=>_.companyUsers),[r,o]=w.useState(""),[s,a]=w.useState(""),[l,c]=w.useState(!1),[u,d]=w.useState(!1),[h,g]=w.useState(""),p=()=>{ie.processing(),Te("POST",ye("/api/v1/companies/purge_save_settings/:id",{id:e.id}),{cancellation_message:s},{headers:{"X-Api-Password":r}}).then(()=>ie.success("purge_successful")).catch(_=>{var v;((v=_.response)==null?void 0:v.status)===412&&(ie.error("password_error_incorrect"),t(0))}).finally(()=>c(!1))},m=()=>{ie.processing(),Te("DELETE",ye("/api/v1/companies/:id",{id:e.id}),{},{headers:{"X-Api-Password":r}}).then(()=>window.location.reload()).catch(_=>{var v;((v=_.response)==null?void 0:v.status)===412&&(ie.error("password_error_incorrect"),t(0))})};return N(_t,{children:[N(cr,{title:n("purge_data"),text:n("purge_data_message"),visible:l,onClose:c,children:[f(ke,{label:dt(n("please_type_to_confirm"),{value:"purge"}),id:"purge_data",onChange:_=>g(_.target.value),required:!0}),f(ke,{type:"password",label:n("password"),id:"password",onChange:_=>o(_.target.value),required:!0}),h==="purge"&&f(Ut,{onClick:p,children:n("continue")})]}),N(cr,{title:(i==null?void 0:i.api.length)>1?n("delete_company"):n("cancel_account"),text:(i==null?void 0:i.api.length)>1?`${n("delete_company_message")} (${e==null?void 0:e.settings.name})`:n("cancel_account_message"),visible:u,onClose:d,children:[f(ke,{label:dt(n("please_type_to_confirm"),{value:"delete"}),id:"cancel_account",onChange:_=>g(_.target.value),required:!0}),f(ke,{type:"text",label:n("reason_for_canceling"),id:"feedback",onChange:_=>a(_.target.value)}),f(ke,{type:"password",label:n("password"),id:"password",onChange:_=>o(_.target.value),required:!0}),h==="delete"&&f(Ut,{onClick:m,children:n("continue")})]}),N(Ot,{title:n("danger_zone"),children:[f(Ja,{onClick:()=>c(!0),className:"text-red-500 hover:text-red-600",children:n("purge_data")}),f(Ja,{onClick:()=>d(!0),className:"text-red-500 hover:text-red-600",children:(i==null?void 0:i.api.length)>1?n("delete_company"):n("cancel_account")})]})]})}function ec(n){const e=n.text||"",t=()=>{navigator.clipboard.writeText(e),ie.success("copied_to_clipboard",{value:""})};return N("div",{className:`inline-flex space-x-2 ${n.className}`,children:[f("span",{children:n.secure?n.text.split("").map(()=>"*"):e}),e.length>0&&navigator.clipboard&&window.isSecureContext&&f("button",{type:"button",onClick:t,children:f(O5e,{size:18})})]})}function D5t(){var t,i,r;const[n]=ue(),e=ha();return N(Ot,{title:n("referral_program"),children:[f(U,{leftSide:n("referral_code"),children:f(ec,{text:`https://app.invoicing.co/#/register?rc=${e==null?void 0:e.referral_code}`})}),f(U,{leftSide:n("free"),children:((t=e==null?void 0:e.referral_meta)==null?void 0:t.free)||0}),f(U,{leftSide:n("pro"),children:((i=e==null?void 0:e.referral_meta)==null?void 0:i.pro)||0}),f(U,{leftSide:n("enterprise"),children:((r=e==null?void 0:e.referral_meta)==null?void 0:r.enterprise)||0})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function A5t(){return[{name:"income",icon:dyt,visible:!0},{name:"expense",icon:vyt,visible:!0},{name:"settings",icon:myt,visible:Yo()}]}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const Hc=po(void 0);/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function v8e(n){const{isAdmin:e}=ao(),{status:t}=n||{};return ai(["/api/v1/company_gateways",n],()=>Te("GET",ye("/api/v1/company_gateways?sort=id|desc&status=:status",{status:t||"active"})),{staleTime:1/0,enabled:e})}function R5t(n){const{isAdmin:e}=ao();return ai(["/api/v1/company_gateways",n.id,n.queryParams],()=>Te("GET",ye(`/api/v1/company_gateways/:id?${n.queryParams||""}`,{id:n.id})),{staleTime:1/0,enabled:(n.enabled??!0)&&e})}function N5t(){const{isAdmin:n}=ao();return ai(["/api/v1/company_gateways/create"],()=>Te("GET",ye("/api/v1/company_gateways/create")),{staleTime:1/0,enabled:n})}function b8e(){const n=Kr(),e=ki(Hc);return async(t,i)=>(ie.processing(),Te("POST",ye("/api/v1/company_gateways/bulk"),{action:i,ids:t}).then(()=>{ie.success(`${i}d_company_gateway`),hn(["company_gateways"]),e&&n.invalidateQueries([e])}))}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function y8e(n){const{isAdmin:e,isOwner:t}=ao();return ai(["/api/v1/bank_integrations",n.id],()=>Te("GET",ye("/api/v1/bank_integrations/:id",{id:n.id})).then(i=>i.data.data),{enabled:(n.enabled??!0)&&(e||t),staleTime:1/0})}function O5t(n){const{perPage:e}=n||{};return ai(["/api/v1/bank_integrations"],()=>Te("GET",ye("/api/v1/bank_integrations?per_page=:perPage&status=active",{perPage:e??20})).then(t=>t.data.data),{staleTime:1/0})}function C8e(){const{isAdmin:n,isOwner:e}=ao();return ai(["/api/v1/bank_integrations","create"],()=>Te("GET",ye("/api/v1/bank_integrations/create")).then(t=>t.data.data),{staleTime:1/0,enabled:n||e})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function w8e(n){return ai(["/api/v1/tax_rates",n],()=>Te("GET",ye("/api/v1/tax_rates?per_page=:perPage&page=:currentPage&sort=:sort&status=:status",{perPage:n.perPage??1e3,currentPage:n.currentPage,sort:n.sort??"id|asc",status:n.status??"all"})),{staleTime:1/0})}function P5t(n){return ai(["/api/v1/tax_rates",n.id],()=>Te("GET",ye("/api/v1/tax_rates/:id",{id:n.id})),{staleTime:1/0})}function M5t(){const{isAdmin:n}=ao();return ai(["/api/v1/tax_rates","create"],()=>Te("GET",ye("/api/v1/tax_rates/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function F5t(){return(n,e)=>{ie.processing(),Te("POST",ye("/api/v1/tax_rates/bulk"),{action:e,ids:[n]}).then(()=>{ie.success(`${e}d_tax_rate`),hn(["tax_rates"])})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function rr(n){const e=y7.getState().companyUsers.currentIndex;return()=>{var i,r,o;const t=!!(((o=(r=(i=y7.getState().companyUsers.api)==null?void 0:i[e])==null?void 0:r.company)==null?void 0:o.enabled_modules)&n);return new Promise(s=>s(t))}}function S8e(){const n=vi();return e=>!!((n==null?void 0:n.enabled_modules)&e)}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function B5t(){const n=vi(),e=zo(),t=S8e(),{isAdmin:i,isOwner:r}=ao(),{data:o}=v8e(),{data:s}=O5t(),{data:a}=w8e({}),[l,c]=w.useState(),[u,d]=w.useState(),[h,g]=w.useState();return w.useEffect(()=>{o&&c(o.data.data),s&&d(s),a&&g(a.data.data)},[o,s,a]),[{key:"client",url:"/clients/create",section:"income",visible:e("create_client")},{key:"product",url:"/products/create",section:"income",visible:e("create_product")},{key:"invoice",url:"/invoices/create",section:"income",visible:e("create_invoice")&&t(Xn.Invoices)},{key:"recurring_invoice",url:"/recurring_invoices/create",section:"income",visible:e("create_recurring_invoice")&&t(Xn.RecurringInvoices)},{key:"quote",url:"/quotes/create",section:"income",visible:e("create_quote")&&t(Xn.Quotes)},{key:"credit",url:"/credits/create",section:"income",visible:e("create_credit")&&t(Xn.Credits)},{key:"payment",url:"/payments/create",section:"income",visible:e("create_payment")},{key:"subscription",url:"/settings/subscription/create",section:"income",visible:(Wp()||ql())&&(i||r)},{key:"expense",url:"/expenses/create",section:"expense",visible:e("create_expense")&&t(Xn.Expenses)},{key:"purchase_order",url:"/purchase_orders/create",section:"expense",visible:e("create_purchase_order")&&t(Xn.PurchaseOrders)},{key:"vendor",url:"/vendors/create",section:"expense",visible:e("create_vendor")&&t(Xn.Vendors)},{key:"transaction",url:"/transactions/create",section:"expense",visible:e("create_bank_transaction")&&t(Xn.Transactions)},{key:"add_stripe",url:"/settings/gateways/create",section:"settings",visible:!(l!=null&&l.length)&&(i||r)},{key:"add_bank_account",url:"/settings/bank_accounts/create",section:"settings",visible:ql()&&!(u!=null&&u.length)&&(i||r)},{key:"tax_settings",url:"/settings/tax_rates/create",section:"settings",visible:!(h!=null&&h.length)&&(i||r)},{key:"add_company_logo",url:"/settings/company_details/logo",section:"settings",visible:!(n!=null&&n.settings.company_logo)&&(i||r)},{key:"templates_and_reminders",url:"/settings/templates_and_reminders",section:"settings",visible:(Wp()||ql())&&(i||r)}]}const $5t=Ea.div`
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function V5t(){var l;const[n]=ue(),e=Y2(),t=Vn(),i=ys(),r=B5t(),o=A5t(),s=x0(),a=!!((l=s==null?void 0:s.company_user)!=null&&l.react_settings.show_mini_sidebar);return f(fQ,{className:"relative mt-2",children:()=>N(_t,{children:[N(fQ.Button,{"data-cy":"quickPopoverButton",style:{backgroundColor:t.$1,color:t.$3},className:St("group inline-flex items-center rounded text-base font-medium focus:outline-none focus:ring-1 focus:ring-gray-200 focus:ring-offset-2"),children:[f(ISe,{className:"cursor-pointer text-xl"}),f(gyt,{className:"cursor-pointer text-xl"})]}),f(Ly,{as:w.Fragment,enter:"transition ease-out duration-200",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-100 translate-y-0",leave:"transition ease-in duration-150",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-1",children:f(fQ.Panel,{className:St("absolute z-10 mt-3 w-screen max-w-md -translate-x-1/2 transform px-2",{"left-14 md:-left-12 md:max-w-2xl lg:max-w-3xl lg:left-full":Yo(),"left-14 md:left-52 md:max-w-2xl lg:max-w-3xl":Yo(),"left-14 md:left-8 lg:max-w-lg lg:left-full":!a,"left-14 md:left-8 lg:max-w-lg lg:left-20":a}),children:f("div",{style:{borderColor:t.$4},className:"border overflow-hidden rounded-lg shadow-lg ring-1 ring-black ring-opacity-5",children:f("div",{style:{backgroundColor:t.$1},className:St("relative grid gap-y-4 md:gap-y-0 px-2 py-4 grid-cols-2",{"md:grid-cols-3":Yo()}),children:o.map(c=>c.visible&&N("div",{className:"flex flex-col items-start rounded-lg transition duration-150 ease-in-out",children:[N("div",{className:"flex items-center pl-3",children:[f(c.icon,{className:"text-base",color:i}),f("p",{style:{color:t.$3},className:"uppercase text-sm tracking-wide font-medium ml-1 md:ml-2",children:n(c.name)})]}),f("div",{className:"flex flex-col w-full mt-2 space-y-2",children:r.map(u=>u.section===c.name&&u.visible&&N($5t,{theme:{hoverColor:t.$2},className:"flex items-center pl-3 space-x-1 py-1 cursor-pointer rounded",onClick:()=>e({url:u.url,externalLink:u.externalLink}),children:[f(ISe,{className:"text-base",style:{color:t.$3}}),f("span",{style:{color:t.$3},className:"text-sm text-gray-800",children:n(u.key)})]},u.key))})]},c.name))})})})})]})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function H5t(){const n=vk();return ao(),new Date(n==null?void 0:n.plan_expires)<new Date,Yo()}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function W5t(){const n=vk(),{isAdmin:e,isOwner:t}=ao(),i=new Date(n==null?void 0:n.plan_expires)<new Date;return((n==null?void 0:n.plan)&&i||!(n!=null&&n.plan))&&(e||t)}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/var pO=(n=>(n.Company="company",n.Group="group",n.Client="client",n))(pO||{});/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function vge(){const n=Tl(e=>e.settings.activeSettings);return{name:n.name,level:n.level}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Ms(){const n=vge(),e=pO.Company===n.level,t=pO.Group===n.level,i=pO.Client===n.level;return{isCompanySettingsActive:e,isGroupSettingsActive:t,isClientSettingsActive:i}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function z5t(){const[n]=ue(),e=ol(),{isCompanySettingsActive:t}=Ms(),{isOwner:i,isAdmin:r}=ao(),o=[{name:n("company_details"),href:"/settings/company_details",current:e.pathname.startsWith("/settings/company_details"),enabled:r||i||!1},{name:n("user_details"),href:"/settings/user_details",current:e.pathname.startsWith("/settings/user_details"),enabled:t},{name:n("localization"),href:"/settings/localization",current:e.pathname.startsWith("/settings/localization"),enabled:r||i||!1},{name:n("payment_settings"),href:"/settings/online_payments",current:e.pathname.startsWith("/settings/online_payments")||e.pathname.startsWith("/settings/gateways")||e.pathname.startsWith("/settings/payment_terms"),enabled:r||i||!1},{name:n("tax_settings"),href:"/settings/tax_settings",current:e.pathname.startsWith("/settings/tax_settings")||e.pathname.startsWith("/settings/tax_rates"),enabled:r||i||!1},{name:n("product_settings"),href:"/settings/product_settings",current:e.pathname.startsWith("/settings/product_settings"),enabled:(r||i)&&t||!1},{name:n("task_settings"),href:"/settings/task_settings",current:e.pathname.startsWith("/settings/task_settings")||e.pathname.startsWith("/settings/task_statuses"),enabled:r||i||!1},{name:n("expense_settings"),href:"/settings/expense_settings",current:e.pathname.startsWith("/settings/expense_settings")||e.pathname.startsWith("/settings/expense_categories"),enabled:(r||i)&&t||!1},{name:n("workflow_settings"),href:"/settings/workflow_settings",current:e.pathname.startsWith("/settings/workflow_settings"),enabled:r||i||!1},{name:n("account_management"),href:"/settings/account_management",current:e.pathname.startsWith("/settings/account_management"),enabled:(r||i)&&t||!1},{name:n("backup_restore"),href:"/settings/backup_restore",current:e.pathname.startsWith("/settings/backup_restore"),enabled:(r||i)&&t||!1},{name:n("import_export"),href:"/settings/import_export",current:e.pathname.startsWith("/settings/import_export"),enabled:(r||i)&&t||!1}],s=[{name:n("invoice_design"),href:"/settings/invoice_design",current:e.pathname.endsWith("/settings/invoice_design"),enabled:r||i||!1},{name:n("custom_fields"),href:"/settings/custom_fields",current:e.pathname.startsWith("/settings/custom_fields"),enabled:(r||i)&&t||!1},{name:n("generated_numbers"),href:"/settings/generated_numbers",current:e.pathname.startsWith("/settings/generated_numbers"),enabled:r||i||!1},{name:n("client_portal"),href:"/settings/client_portal",current:e.pathname.startsWith("/settings/client_portal"),enabled:r||i||!1},{name:n("email_settings"),href:"/settings/email_settings",current:e.pathname.startsWith("/settings/email_settings"),enabled:r||i||!1},{name:n("templates_and_reminders"),href:"/settings/templates_and_reminders",current:e.pathname.startsWith("/settings/templates_and_reminders"),enabled:r||i||!1},{name:n("bank_accounts"),href:"/settings/bank_accounts",current:e.pathname.startsWith("/settings/bank_accounts"),enabled:(r||i)&&t||!1},{name:n("group_settings"),href:"/settings/group_settings",current:e.pathname.startsWith("/settings/group_settings"),enabled:(r||i)&&t||!1},{name:n("payment_links"),href:"/settings/subscriptions",current:e.pathname.startsWith("/settings/subscriptions"),enabled:(r||i)&&t||!1},{name:n("schedules"),href:"/settings/schedules",current:e.pathname.startsWith("/settings/schedules"),enabled:(r||i)&&t||!1},{name:n("user_management"),href:"/settings/users",current:e.pathname.startsWith("/settings/users"),enabled:(r||i)&&t||!1},{name:n("system_logs"),href:"/settings/system_logs",current:e.pathname.startsWith("/settings/system_logs"),enabled:(r||i)&&t||!1}];return{basic:o,advanced:s}}const E8e=po(null);function fhr(n,e=[]){const[t,i]=Mo(E8e),{displayButton:r=!0}=n||{};return w.useEffect(()=>(n&&r&&i(n),n&&!r&&i(null),()=>{i(null)}),e),t}const j5t=po(null);function U5t(n,e=[]){const[t,i]=Mo(j5t);return w.useEffect(()=>(n&&i(n),()=>{i(null)}),e),t}function q5t({variant:n,children:e}){return f("div",{className:St("flex justify-center items-center px-3 py-2 text-xs md:px-6 md:text-sm leading-6 text-gray-900",{"bg-orange-300":n==="orange"}),children:e})}const K5t="font-medium text-xs md:text-sm underline cursor-pointer";function G5t(){return ue(),ha(),null}function Y5t(){const[n]=ue(),e=vi(),t=ha();return!e||!(t!=null&&t.email_verified_at)||e&&!e.is_disabled?null:f(q5t,{variant:"orange",children:N("div",{className:"flex space-x-1",children:[N("span",{children:[n("company_disabled_warning"),"."]}),f(E0,{className:K5t,to:"/settings/account_management/overview",children:n("activate_company")})]})})}var x8e={};/*! For license information please see index.js.LICENSE.txt */(function(n){(()=>{var e={184:(a,l)=>{var c;(function(){var u={}.hasOwnProperty;function d(){for(var h=[],g=0;g<arguments.length;g++){var p=arguments[g];if(p){var m=typeof p;if(m==="string"||m==="number")h.push(p);else if(Array.isArray(p)){if(p.length){var _=d.apply(null,p);_&&h.push(_)}}else if(m==="object"){if(p.toString!==Object.prototype.toString&&!p.toString.toString().includes("[native code]")){h.push(p.toString());continue}for(var v in p)u.call(p,v)&&p[v]&&h.push(v)}}}return h.join(" ")}a.exports?(d.default=d,a.exports=d):(c=(function(){return d}).apply(l,[]))===void 0||(a.exports=c)})()},28:(a,l,c)=>{c.d(l,{Z:()=>p});var u=c(81),d=c.n(u),h=c(645),g=c.n(h)()(d());g.push([a.id,`/* :where() gives the styles specificity 0, which makes them overridable */
:where(.vi__wrapper) {
position: relative;
width: min-content;
}
.vi {
top: 0;
right: 0;
bottom: 0;
left: 0;
box-sizing: border-box;
position: absolute;
color: transparent;
background: transparent;
caret-color: transparent;
outline: none;
border: 0 none transparent;
}
.vi::-ms-reveal,
.vi::-ms-clear {
display: none;
}
.vi::selection {
background: transparent;
}
:where(.vi__container) {
display: flex;
gap: 8px;
height: 50px;
width: 300px;
}
:where(.vi__character) {
height: 100%;
flex-grow: 1;
flex-basis: 0;
text-align: center;
font-size: 36px;
line-height: 50px;
color: black;
background-color: white;
border: 1px solid black;
cursor: default;
user-select: none;
box-sizing: border-box;
}
:where(.vi__character--inactive) {
color: dimgray;
background-color: lightgray;
}
:where(.vi__character--selected) {
outline: 2px solid cornflowerblue;
color: cornflowerblue;
}
`,""]);const p=g},645:a=>{a.exports=function(l){var c=[];return c.toString=function(){return this.map(function(u){var d="",h=u[5]!==void 0;return u[4]&&(d+="@supports (".concat(u[4],") {")),u[2]&&(d+="@media ".concat(u[2]," {")),h&&(d+="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {")),d+=l(u),h&&(d+="}"),u[2]&&(d+="}"),u[4]&&(d+="}"),d}).join("")},c.i=function(u,d,h,g,p){typeof u=="string"&&(u=[[null,u,void 0]]);var m={};if(h)for(var _=0;_<this.length;_++){var v=this[_][0];v!=null&&(m[v]=!0)}for(var b=0;b<u.length;b++){var y=[].concat(u[b]);h&&m[y[0]]||(p!==void 0&&(y[5]===void 0||(y[1]="@layer".concat(y[5].length>0?" ".concat(y[5]):""," {").concat(y[1],"}")),y[5]=p),d&&(y[2]&&(y[1]="@media ".concat(y[2]," {").concat(y[1],"}")),y[2]=d),g&&(y[4]?(y[1]="@supports (".concat(y[4],") {").concat(y[1],"}"),y[4]=g):y[4]="".concat(g)),c.push(y))}},c}},81:a=>{a.exports=function(l){return l[1]}},703:(a,l,c)=>{var u=c(414);function d(){}function h(){}h.resetWarningCache=d,a.exports=function(){function g(_,v,b,y,C,x){if(x!==u){var k=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw k.name="Invariant Violation",k}}function p(){return g}g.isRequired=g;var m={array:g,bigint:g,bool:g,func:g,number:g,object:g,string:g,symbol:g,any:g,arrayOf:p,element:g,elementType:g,instanceOf:p,node:g,objectOf:p,oneOf:p,oneOfType:p,shape:p,exact:p,checkPropTypes:h,resetWarningCache:d};return m.PropTypes=m,m}},697:(a,l,c)=>{a.exports=c(703)()},414:a=>{a.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},t={};function i(a){var l=t[a];if(l!==void 0)return l.exports;var c=t[a]={id:a,exports:{}};return e[a](c,c.exports,i),c.exports}i.n=a=>{var l=a&&a.__esModule?()=>a.default:()=>a;return i.d(l,{a:l}),l},i.d=(a,l)=>{for(var c in l)i.o(l,c)&&!i.o(a,c)&&Object.defineProperty(a,c,{enumerable:!0,get:l[c]})},i.o=(a,l)=>Object.prototype.hasOwnProperty.call(a,l),i.r=a=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})};var r={};(()=>{i.r(r),i.d(r,{default:()=>L});const a=w;var l=i.n(a),c=i(184),u=i.n(c),d=i(697),h=i.n(d),g=i(28);function p(D){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},p(D)}var m=["className","type"],_=["className"];function v(D,R,P){return(R=function(M){var O=function(B,F){if(p(B)!=="object"||B===null)return B;var H=B[Symbol.toPrimitive];if(H!==void 0){var V=H.call(B,"string");if(p(V)!=="object")return V;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(B)}(M);return p(O)==="symbol"?O:String(O)}(R))in D?Object.defineProperty(D,R,{value:P,enumerable:!0,configurable:!0,writable:!0}):D[R]=P,D}function b(){return b=Object.assign?Object.assign.bind():function(D){for(var R=1;R<arguments.length;R++){var P=arguments[R];for(var M in P)Object.prototype.hasOwnProperty.call(P,M)&&(D[M]=P[M])}return D},b.apply(this,arguments)}function y(D,R){if(D==null)return{};var P,M,O=function(F,H){if(F==null)return{};var V,$,j={},Y=Object.keys(F);for($=0;$<Y.length;$++)V=Y[$],H.indexOf(V)>=0||(j[V]=F[V]);return j}(D,R);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(D);for(M=0;M<B.length;M++)P=B[M],R.indexOf(P)>=0||Object.prototype.propertyIsEnumerable.call(D,P)&&(O[P]=D[P])}return O}function C(D,R){return function(P){if(Array.isArray(P))return P}(D)||function(P,M){var O=P==null?null:typeof Symbol<"u"&&P[Symbol.iterator]||P["@@iterator"];if(O!=null){var B,F,H,V,$=[],j=!0,Y=!1;try{if(H=(O=O.call(P)).next,M===0){if(Object(O)!==O)return;j=!1}else for(;!(j=(B=H.call(O)).done)&&($.push(B.value),$.length!==M);j=!0);}catch(ne){Y=!0,F=ne}finally{try{if(!j&&O.return!=null&&(V=O.return(),Object(V)!==V))return}finally{if(Y)throw F}}return $}}(D,R)||x(D,R)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function x(D,R){if(D){if(typeof D=="string")return k(D,R);var P=Object.prototype.toString.call(D).slice(8,-1);return P==="Object"&&D.constructor&&(P=D.constructor.name),P==="Map"||P==="Set"?Array.from(D):P==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(P)?k(D,R):void 0}}function k(D,R){(R==null||R>D.length)&&(R=D.length);for(var P=0,M=new Array(R);P<R;P++)M[P]=D[P];return M}var I=(0,a.forwardRef)(function(D,R){var P=D.value,M=D.length,O=D.validChars,B=D.placeholder,F=D.autoFocus,H=D.passwordMode,V=D.inputProps,$=D.containerProps,j=D.classNames,Y=D.onChange,ne=D.onFocus,se=D.onBlur,he=D.onComplete,xe=C((0,a.useState)(""),2),_e=xe[0],Ie=xe[1],Re=C((0,a.useState)(!1),2),Ye=Re[0],Ze=Re[1],tt=(0,a.useRef)(null);(0,a.useEffect)(function(){F&&tt.current.focus()},[F]);var Be,kt=function(){tt.current.focus()},Vt=function(){return P??_e},xt=V.className,Kt=V.type,cn=y(V,m),wn=$.className,on=y($,_);return l().createElement("div",{className:"vi__wrapper"},l().createElement("input",b({"aria-label":"verification input",spellCheck:!1,value:Vt(),onChange:function(Zt){var pe=Zt.target.value.replace(/\s/g,"");RegExp("^[".concat(O,"]{0,").concat(M,"}$")).test(pe)&&(Y&&(Y==null||Y(pe)),Ie(pe),pe.length===M&&(he==null||he(pe)))},ref:function(Zt){tt.current=Zt,typeof R=="function"?R(Zt):R&&(R.current=Zt)},className:u()("vi",xt),onKeyDown:function(Zt){["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(Zt.key)&&Zt.preventDefault()},onFocus:function(){Ze(!0),ne==null||ne()},onBlur:function(){Ze(!1),se==null||se()},onSelect:function(Zt){var pe=Zt.target.value;Zt.target.setSelectionRange(pe.length,pe.length)},type:H?"password":Kt},cn)),l().createElement("div",b({"data-testid":"container",className:u()("vi__container",j.container,wn),onClick:function(){return tt.current.focus()}},on),(Be=Array(M),function(Zt){if(Array.isArray(Zt))return k(Zt)}(Be)||function(Zt){if(typeof Symbol<"u"&&Zt[Symbol.iterator]!=null||Zt["@@iterator"]!=null)return Array.from(Zt)}(Be)||x(Be)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()).map(function(Zt,pe){var me;return l().createElement("div",{className:u()("vi__character",j.character,(me={"vi__character--selected":(Vt().length===pe||Vt().length===pe+1&&M===pe+1)&&Ye},v(me,j.characterSelected,(Vt().length===pe||Vt().length===pe+1&&M===pe+1)&&Ye),v(me,"vi__character--inactive",Vt().length<pe),v(me,j.characterInactive,Vt().length<pe),me)),onClick:kt,id:"field-".concat(pe),"data-testid":"character-".concat(pe),key:pe},H&&Vt()[pe]?"*":Vt()[pe]||B)})),l().createElement("style",{dangerouslySetInnerHTML:{__html:g.Z}}))});I.displayName="VerificationInput",I.propTypes={value:h().string,length:h().number,validChars:h().string,placeholder:h().string,autoFocus:h().bool,passwordMode:h().bool,inputProps:h().object,containerProps:h().object,classNames:h().shape({container:h().string,character:h().string,characterInactive:h().string,characterSelected:h().string}),onChange:h().func,onFocus:h().func,onBlur:h().func,onComplete:h().func},I.defaultProps={length:6,validChars:"A-Za-z0-9",placeholder:"·",autoFocus:!1,inputProps:{},containerProps:{},classNames:{}};const L=I})();var o=n;for(var s in r)o[s]=r[s];r.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})()})(x8e);const k8e=ja(x8e);function Q5t(){ue(),w.useState(!1),ha();const n=vk();return vi(),null}let F6;const X5t=new Uint8Array(16);function Z5t(){if(!F6&&(F6=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!F6))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return F6(X5t)}const yu=[];for(let n=0;n<256;++n)yu.push((n+256).toString(16).slice(1));function J5t(n,e=0){return yu[n[e+0]]+yu[n[e+1]]+yu[n[e+2]]+yu[n[e+3]]+"-"+yu[n[e+4]]+yu[n[e+5]]+"-"+yu[n[e+6]]+yu[n[e+7]]+"-"+yu[n[e+8]]+yu[n[e+9]]+"-"+yu[n[e+10]]+yu[n[e+11]]+yu[n[e+12]]+yu[n[e+13]]+yu[n[e+14]]+yu[n[e+15]]}const eFt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),zxe={randomUUID:eFt};function xj(n,e,t){if(zxe.randomUUID&&!e&&!n)return zxe.randomUUID();n=n||{};const i=n.random||(n.rng||Z5t)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(let r=0;r<16;++r)e[t+r]=i[r];return e}return J5t(i)}var T8e={exports:{}},tFt=function(){var e=this,t=-1;return{next:function(){return t+=1,{value:e.items[t],done:t>=e.items.length}}}},nFt=function(){return this.items};function Eie(n){"@babel/helpers - typeof";return Eie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Eie(n)}var al={isArray:function(e){return Array.isArray(e)},isObject:function(e){return Eie(e)==="object"&&Array.isArray(e)===!1&&e!==null},isFunction:function(e){return typeof e=="function"}},iFt=al,rFt=iFt.isFunction,I8e=function(e){return e===void 0?this.sum()/this.items.length:rFt(e)?new this.constructor(this.items).sum(e)/this.items.length:new this.constructor(this.items).pluck(e).sum()/this.items.length},oFt=I8e,sFt=oFt;function xie(n){"@babel/helpers - typeof";return xie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xie(n)}var aFt=function(e){var t=this,i=[],r=0;if(Array.isArray(this.items))do{var o=this.items.slice(r,r+e),s=new this.constructor(o);i.push(s),r+=e}while(r<this.items.length);else if(xie(this.items)==="object"){var a=Object.keys(this.items),l=function(){var u=a.slice(r,r+e),d=new t.constructor({});u.forEach(function(h){return d.put(h,t.items[h])}),i.push(d),r+=e};do l();while(r<a.length)}else i.push(new this.constructor([this.items]));return new this.constructor(i)};function lFt(n){return hFt(n)||dFt(n)||uFt(n)||cFt()}function cFt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uFt(n,e){if(n){if(typeof n=="string")return kie(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return kie(n,e)}}function dFt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function hFt(n){if(Array.isArray(n))return kie(n)}function kie(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}var fFt=function(){var e;return new this.constructor((e=[]).concat.apply(e,lFt(this.items)))};function gFt(n,e){return vFt(n)||_Ft(n,e)||mFt(n,e)||pFt()}function pFt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mFt(n,e){if(n){if(typeof n=="string")return jxe(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return jxe(n,e)}}function jxe(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function _Ft(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i=[],r=!0,o=!1,s,a;try{for(t=t.call(n);!(r=(s=t.next()).done)&&(i.push(s.value),!(e&&i.length===e));r=!0);}catch(l){o=!0,a=l}finally{try{!r&&t.return!=null&&t.return()}finally{if(o)throw a}}return i}}function vFt(n){if(Array.isArray(n))return n}function $7(n){"@babel/helpers - typeof";return $7=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$7(n)}var bFt=function(e){var t=this,i=e;i instanceof this.constructor&&(i=e.all());var r={};if(Array.isArray(this.items)&&Array.isArray(i))this.items.forEach(function(a,l){r[a]=i[l]});else if($7(this.items)==="object"&&$7(i)==="object")Object.keys(this.items).forEach(function(a,l){r[t.items[a]]=i[Object.keys(i)[l]]});else if(Array.isArray(this.items))r[this.items[0]]=i;else if(typeof this.items=="string"&&Array.isArray(i)){var o=i,s=gFt(o,1);r[this.items]=s[0]}else typeof this.items=="string"&&(r[this.items]=i);return new this.constructor(r)};function yFt(n){return EFt(n)||SFt(n)||wFt(n)||CFt()}function CFt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wFt(n,e){if(n){if(typeof n=="string")return Tie(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Tie(n,e)}}function SFt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function EFt(n){if(Array.isArray(n))return Tie(n)}function Tie(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}var L8e=function(e){var t;if(Array.isArray(e)){var i;t=[],(i=t).push.apply(i,yFt(e))}else t={},Object.keys(e).forEach(function(r){t[r]=e[r]});return t};function V7(n){"@babel/helpers - typeof";return V7=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},V7(n)}var xFt=L8e,kFt=function(e){var t=e;e instanceof this.constructor?t=e.all():V7(e)==="object"&&(t=[],Object.keys(e).forEach(function(r){t.push(e[r])}));var i=xFt(this.items);return t.forEach(function(r){V7(r)==="object"?Object.keys(r).forEach(function(o){return i.push(r[o])}):i.push(r)}),new this.constructor(i)};function Uxe(n){return DFt(n)||LFt(n)||IFt(n)||TFt()}function TFt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IFt(n,e){if(n){if(typeof n=="string")return Iie(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Iie(n,e)}}function LFt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function DFt(n){if(Array.isArray(n))return Iie(n)}function Iie(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}var Eb=function(e){var t=[];return Array.isArray(e)?t.push.apply(t,Uxe(e)):e.constructor.name==="Collection"?t.push.apply(t,Uxe(e.all())):Object.keys(e).forEach(function(i){return t.push(e[i])}),t};function AFt(n){return PFt(n)||OFt(n)||NFt(n)||RFt()}function RFt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NFt(n,e){if(n){if(typeof n=="string")return Lie(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Lie(n,e)}}function OFt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function PFt(n){if(Array.isArray(n))return Lie(n)}function Lie(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}var MFt=Eb,FFt=al,BFt=FFt.isFunction,D8e=function(e,t){if(t!==void 0)return Array.isArray(this.items)?this.items.filter(function(r){return r[e]!==void 0&&r[e]===t}).length>0:this.items[e]!==void 0&&this.items[e]===t;if(BFt(e))return this.items.filter(function(r,o){return e(r,o)}).length>0;if(Array.isArray(this.items))return this.items.indexOf(e)!==-1;var i=MFt(this.items);return i.push.apply(i,AFt(Object.keys(this.items))),i.indexOf(e)!==-1},$Ft=function(){return this.count()===1},VFt=function(){var e=0;return Array.isArray(this.items)&&(e=this.items.length),Math.max(Object.keys(this.items).length,e)},HFt=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(t){return t};return new this.constructor(this.items).groupBy(e).map(function(t){return t.count()})},WFt=function(){function e(o,s,a){var l=a[0];l instanceof s&&(l=l.all());for(var c=a.slice(1),u=!c.length,d=[],h=0;h<l.length;h+=1){var g=o.slice();g.push(l[h]),u?d.push(g):d=d.concat(e(g,s,c))}return d}for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return new this.constructor(e([],this.constructor,[].concat([this.items],i)))},zFt=function(){this.dump(),typeof process<"u"&&process.exit(1)},jFt=function(e){var t;e instanceof this.constructor?t=e.all():t=e;var i=this.items.filter(function(r){return t.indexOf(r)===-1});return new this.constructor(i)},UFt=function(e){var t=this,i=e;e instanceof this.constructor&&(i=e.all());var r={};return Object.keys(this.items).forEach(function(o){(i[o]===void 0||i[o]!==t.items[o])&&(r[o]=t.items[o])}),new this.constructor(r)},qFt=function(e){var t;e instanceof this.constructor?t=e.all():t=e;var i=Object.keys(t),r=Object.keys(this.items).filter(function(o){return i.indexOf(o)===-1});return new this.constructor(this.items).only(r)},KFt=function(e,t){var i=this.items.filter(function(r){return!(e&&e.some(function(o){return t(r,o)===0}))});return new this.constructor(i)},GFt=function(e,t){return!this.contains(e,t)},YFt=function(){return console.log(this),this};function H7(n){"@babel/helpers - typeof";return H7=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H7(n)}var QFt=function(){var e=this,t=[],i={},r=function(s){return Array.isArray(s)||H7(s)==="object"?JSON.stringify(s):s};return Array.isArray(this.items)?this.items.forEach(function(o,s){var a=r(o);t.indexOf(a)===-1?t.push(a):i[s]=o}):H7(this.items)==="object"&&Object.keys(this.items).forEach(function(o){var s=r(e.items[o]);t.indexOf(s)===-1?t.push(s):i[o]=e.items[o]}),new this.constructor(i)},XFt=function(e){var t=!1;if(Array.isArray(this.items))for(var i=this.items.length,r=0;r<i&&!t;r+=1)t=e(this.items[r],r,this.items)===!1;else for(var o=Object.keys(this.items),s=o.length,a=0;a<s&&!t;a+=1){var l=o[a];t=e(this.items[l],l,this.items)===!1}return this};function ZFt(n){return n6t(n)||t6t(n)||e6t(n)||JFt()}function JFt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e6t(n,e){if(n){if(typeof n=="string")return Die(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Die(n,e)}}function t6t(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function n6t(n){if(Array.isArray(n))return Die(n)}function Die(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}var i6t=function(e){return this.each(function(t,i){e.apply(void 0,ZFt(t).concat([i]))}),this},r6t=Eb,o6t=function(e){var t=r6t(this.items);return t.every(e)},kj=function(e){return Array.isArray(e[0])?e[0]:e},s6t=kj,a6t=function(){for(var e=this,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var o=s6t(i);if(Array.isArray(this.items)){var s=this.items.filter(function(l){return o.indexOf(l)===-1});return new this.constructor(s)}var a={};return Object.keys(this.items).forEach(function(l){o.indexOf(l)===-1&&(a[l]=e.items[l])}),new this.constructor(a)};function Aie(n){"@babel/helpers - typeof";return Aie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Aie(n)}function A8e(n){if(Array.isArray(n)){if(n.length)return!1}else if(n!=null&&Aie(n)==="object"){if(Object.keys(n).length)return!1}else if(n)return!1;return!0}function l6t(n,e){var t={};return Object.keys(e).forEach(function(i){n?n(e[i],i)&&(t[i]=e[i]):A8e(e[i])||(t[i]=e[i])}),t}function c6t(n,e){if(n)return e.filter(n);for(var t=[],i=0;i<e.length;i+=1){var r=e[i];A8e(r)||t.push(r)}return t}var u6t=function(e){var t=e||!1,i=null;return Array.isArray(this.items)?i=c6t(t,this.items):i=l6t(t,this.items),new this.constructor(i)},d6t=al,JQ=d6t.isFunction,h6t=function(e,t){if(JQ(e)){for(var i=Object.keys(this.items),r=0;r<i.length;r+=1){var o=i[r],s=this.items[o];if(e(s,o))return s}return JQ(t)?t():t}if(Array.isArray(this.items)&&this.items.length||Object.keys(this.items).length){if(Array.isArray(this.items))return this.items[0];var a=Object.keys(this.items)[0];return this.items[a]}return JQ(t)?t():t},f6t=al,g6t=f6t.isFunction,p6t=function(e,t,i){if(g6t(e))return this.first(e,function(){throw new Error("Item not found.")});var r=this.where(e,t,i);if(r.isEmpty())throw new Error("Item not found.");return r.first()},m6t=function(e,t,i){return this.where(e,t,i).first()||null},_6t=function(e){return this.map(e).collapse()},R8e=al,eX=R8e.isArray,tX=R8e.isObject,v6t=function(e){var t=e||1/0,i=!1,r=[],o=function(a){r=[],eX(a)?a.forEach(function(l){eX(l)?r=r.concat(l):tX(l)?Object.keys(l).forEach(function(c){r=r.concat(l[c])}):r.push(l)}):Object.keys(a).forEach(function(l){eX(a[l])?r=r.concat(a[l]):tX(a[l])?Object.keys(a[l]).forEach(function(c){r=r.concat(a[l][c])}):r.push(a[l])}),i=r.filter(function(l){return tX(l)}),i=i.length===0,t-=1};for(o(this.items);!i&&t>0;)o(r);return new this.constructor(r)},b6t=function(){var e=this,t={};return Array.isArray(this.items)?Object.keys(this.items).forEach(function(i){t[e.items[i]]=Number(i)}):Object.keys(this.items).forEach(function(i){t[e.items[i]]=i}),new this.constructor(t)},y6t=function(e,t){var i=this,r={};return Array.isArray(this.items)?r=this.items.slice(e*t-t,e*t):Object.keys(this.items).slice(e*t-t,e*t).forEach(function(o){r[o]=i.items[o]}),new this.constructor(r)},C6t=function(e){return Array.isArray(this.items)?this.items.splice(e,1):delete this.items[e],this},w6t=al,S6t=w6t.isFunction,E6t=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return this.items[e]!==void 0?this.items[e]:S6t(t)?t():t!==null?t:null},$w=function(e,t){try{return t.split(".").reduce(function(i,r){return i[r]},e)}catch{return e}},nX=$w,x6t=al,k6t=x6t.isFunction,T6t=function(e){var t=this,i={};return this.items.forEach(function(r,o){var s;k6t(e)?s=e(r,o):nX(r,e)||nX(r,e)===0?s=nX(r,e):s="",i[s]===void 0&&(i[s]=new t.constructor([])),i[s].push(r)}),new this.constructor(i)},I6t=kj,L6t=function(){for(var e=this,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var o=I6t(i);return o.filter(function(s){return Object.hasOwnProperty.call(e.items,s)}).length===o.length},D6t=function(e,t){return t===void 0?this.items.join(e):new this.constructor(this.items).pluck(e).all().join(t)},A6t=function(e){var t=e;e instanceof this.constructor&&(t=e.all());var i=this.items.filter(function(r){return t.indexOf(r)!==-1});return new this.constructor(i)},R6t=function(e){var t=this,i=Object.keys(e);e instanceof this.constructor&&(i=Object.keys(e.all()));var r={};return Object.keys(this.items).forEach(function(o){i.indexOf(o)!==-1&&(r[o]=t.items[o])}),new this.constructor(r)},N6t=function(){return Array.isArray(this.items)?!this.items.length:!Object.keys(this.items).length},O6t=function(){return!this.isEmpty()},P6t=function(e,t){var i=this.values();if(t===void 0)return i.implode(e);var r=i.count();if(r===0)return"";if(r===1)return i.last();var o=i.pop();return i.implode(e)+t+o},M6t=$w,F6t=al,B6t=F6t.isFunction,$6t=function(e){var t={};return B6t(e)?this.items.forEach(function(i){t[e(i)]=i}):this.items.forEach(function(i){var r=M6t(i,e);t[r||""]=i}),new this.constructor(t)},V6t=function(){var e=Object.keys(this.items);return Array.isArray(this.items)&&(e=e.map(Number)),new this.constructor(e)},H6t=al,qxe=H6t.isFunction,W6t=function(e,t){var i=this.items;if(qxe(e)&&(i=this.filter(e).all()),Array.isArray(i)&&!i.length||!Object.keys(i).length)return qxe(t)?t():t;if(Array.isArray(i))return i[i.length-1];var r=Object.keys(i);return i[r[r.length-1]]},z6t=function(e,t){this.constructor.prototype[e]=t},j6t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return new this.constructor(e)},U6t=function(e){var t=this;if(Array.isArray(this.items))return new this.constructor(this.items.map(e));var i={};return Object.keys(this.items).forEach(function(r){i[r]=e(t.items[r],r)}),new this.constructor(i)};function q6t(n){return Q6t(n)||Y6t(n)||G6t(n)||K6t()}function K6t(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function G6t(n,e){if(n){if(typeof n=="string")return Rie(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Rie(n,e)}}function Y6t(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function Q6t(n){if(Array.isArray(n))return Rie(n)}function Rie(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}var X6t=function(e){return this.map(function(t,i){return e.apply(void 0,q6t(t).concat([i]))})};function Z6t(n,e){return nBt(n)||tBt(n,e)||eBt(n,e)||J6t()}function J6t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eBt(n,e){if(n){if(typeof n=="string")return Kxe(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Kxe(n,e)}}function Kxe(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function tBt(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i=[],r=!0,o=!1,s,a;try{for(t=t.call(n);!(r=(s=t.next()).done)&&(i.push(s.value),!(e&&i.length===e));r=!0);}catch(l){o=!0,a=l}finally{try{!r&&t.return!=null&&t.return()}finally{if(o)throw a}}return i}}function nBt(n){if(Array.isArray(n))return n}var iBt=function(e){var t={};return this.items.forEach(function(i,r){var o=e(i,r),s=Z6t(o,2),a=s[0],l=s[1];t[a]===void 0?t[a]=[l]:t[a].push(l)}),new this.constructor(t)},rBt=function(e){return this.map(function(t,i){return new e(t,i)})};function oBt(n,e){return cBt(n)||lBt(n,e)||aBt(n,e)||sBt()}function sBt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aBt(n,e){if(n){if(typeof n=="string")return Gxe(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Gxe(n,e)}}function Gxe(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function lBt(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i=[],r=!0,o=!1,s,a;try{for(t=t.call(n);!(r=(s=t.next()).done)&&(i.push(s.value),!(e&&i.length===e));r=!0);}catch(l){o=!0,a=l}finally{try{!r&&t.return!=null&&t.return()}finally{if(o)throw a}}return i}}function cBt(n){if(Array.isArray(n))return n}var uBt=function(e){var t={};return this.items.forEach(function(i,r){var o=e(i,r),s=oBt(o,2),a=s[0],l=s[1];t[a]===void 0?t[a]=[l]:t[a].push(l)}),new this.constructor(t)};function Yxe(n,e){return gBt(n)||fBt(n,e)||hBt(n,e)||dBt()}function dBt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hBt(n,e){if(n){if(typeof n=="string")return Qxe(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Qxe(n,e)}}function Qxe(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function fBt(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i=[],r=!0,o=!1,s,a;try{for(t=t.call(n);!(r=(s=t.next()).done)&&(i.push(s.value),!(e&&i.length===e));r=!0);}catch(l){o=!0,a=l}finally{try{!r&&t.return!=null&&t.return()}finally{if(o)throw a}}return i}}function gBt(n){if(Array.isArray(n))return n}var pBt=function(e){var t=this,i={};return Array.isArray(this.items)?this.items.forEach(function(r,o){var s=e(r,o),a=Yxe(s,2),l=a[0],c=a[1];i[l]=c}):Object.keys(this.items).forEach(function(r){var o=e(t.items[r],r),s=Yxe(o,2),a=s[0],l=s[1];i[a]=l}),new this.constructor(i)};function Xxe(n){return bBt(n)||vBt(n)||_Bt(n)||mBt()}function mBt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _Bt(n,e){if(n){if(typeof n=="string")return Nie(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Nie(n,e)}}function vBt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function bBt(n){if(Array.isArray(n))return Nie(n)}function Nie(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}var yBt=function(e){if(typeof e=="string"){var t=this.items.filter(function(i){return i[e]!==void 0});return Math.max.apply(Math,Xxe(t.map(function(i){return i[e]})))}return Math.max.apply(Math,Xxe(this.items))},CBt=function(e){var t=this.items.length;return e===void 0?t%2===0?(this.items[t/2-1]+this.items[t/2])/2:this.items[Math.floor(t/2)]:t%2===0?(this.items[t/2-1][e]+this.items[t/2][e])/2:this.items[Math.floor(t/2)][e]},wBt=function(e){var t=e;if(typeof t=="string"&&(t=[t]),Array.isArray(this.items)&&Array.isArray(t))return new this.constructor(this.items.concat(t));var i=JSON.parse(JSON.stringify(this.items));return Object.keys(t).forEach(function(r){i[r]=t[r]}),new this.constructor(i)};function W7(n){"@babel/helpers - typeof";return W7=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W7(n)}function Zxe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Jxe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Zxe(Object(t),!0).forEach(function(i){SBt(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Zxe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function SBt(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var EBt=function(e){var t=function i(r,o){var s={},a=Object.keys(Jxe(Jxe({},r),o));return a.forEach(function(l){r[l]===void 0&&o[l]!==void 0?s[l]=o[l]:r[l]!==void 0&&o[l]===void 0?s[l]=r[l]:r[l]!==void 0&&o[l]!==void 0&&(r[l]===o[l]?s[l]=r[l]:!Array.isArray(r[l])&&W7(r[l])==="object"&&!Array.isArray(o[l])&&W7(o[l])==="object"?s[l]=i(r[l],o[l]):s[l]=[].concat(r[l],o[l]))}),s};return e?e.constructor.name==="Collection"?new this.constructor(t(this.items,e.all())):new this.constructor(t(this.items,e)):this};function eke(n){return IBt(n)||TBt(n)||kBt(n)||xBt()}function xBt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kBt(n,e){if(n){if(typeof n=="string")return Oie(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Oie(n,e)}}function TBt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function IBt(n){if(Array.isArray(n))return Oie(n)}function Oie(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}var LBt=function(e){if(e!==void 0){var t=this.items.filter(function(i){return i[e]!==void 0});return Math.min.apply(Math,eke(t.map(function(i){return i[e]})))}return Math.min.apply(Math,eke(this.items))},DBt=function(e){var t=[],i=1;return this.items.length?(this.items.forEach(function(r){var o=t.filter(function(a){return e!==void 0?a.key===r[e]:a.key===r});if(!o.length)e!==void 0?t.push({key:r[e],count:1}):t.push({key:r,count:1});else{o[0].count+=1;var s=o[0].count;s>i&&(i=s)}}),t.filter(function(r){return r.count===i}).map(function(r){return r.key})):null},ABt=Eb,RBt=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=ABt(this.items),r=i.slice(t).filter(function(o,s){return s%e===0});return new this.constructor(r)},NBt=kj,OBt=function(){for(var e=this,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var o=NBt(i);if(Array.isArray(this.items)){var s=this.items.filter(function(l){return o.indexOf(l)!==-1});return new this.constructor(s)}var a={};return Object.keys(this.items).forEach(function(l){o.indexOf(l)!==-1&&(a[l]=e.items[l])}),new this.constructor(a)},PBt=L8e,MBt=function(e,t){var i=Math.abs(e),r=this.count();if(i<=r)return this;for(var o=i-r,s=PBt(this.items),a=Array.isArray(this.items),l=e<0,c=0;c<o;)a?l?s.unshift(t):s.push(t):s[c]!==void 0?o+=1:s[c]=t,c+=1;return new this.constructor(s)},FBt=function(e){var t=this,i;return Array.isArray(this.items)?(i=[new this.constructor([]),new this.constructor([])],this.items.forEach(function(r){e(r)===!0?i[0].push(r):i[1].push(r)})):(i=[new this.constructor({}),new this.constructor({})],Object.keys(this.items).forEach(function(r){var o=t.items[r];e(o)===!0?i[0].put(r,o):i[1].put(r,o)})),new this.constructor(i)},BBt=function(e){return e(this)},N8e=al,$Bt=N8e.isArray,VBt=N8e.isObject,B6=$w,HBt=function(e){var t={};return e.forEach(function(i,r){function o(s,a){VBt(s)?Object.keys(s).forEach(function(l){o(s[l],"".concat(a,".").concat(l))}):$Bt(s)&&s.forEach(function(l,c){o(l,"".concat(a,".").concat(c))}),t[a]=s}o(i,r)}),t},WBt=function(e,t){if(e.indexOf("*")!==-1){var i=HBt(this.items),r=[];if(t!==void 0){var o=new RegExp("0.".concat(t),"g"),s="0.".concat(t).split(".").length;Object.keys(i).forEach(function(h){var g=h.match(o);if(g){var p=g[0];p.split(".").length===s&&r.push(i[p])}})}var a=[],l=new RegExp("0.".concat(e),"g"),c="0.".concat(e).split(".").length;if(Object.keys(i).forEach(function(h){var g=h.match(l);if(g){var p=g[0];p.split(".").length===c&&a.push(i[p])}}),t!==void 0){var u={};return this.items.forEach(function(h,g){u[r[g]||""]=a}),new this.constructor(u)}return new this.constructor([a])}if(t!==void 0){var d={};return this.items.forEach(function(h){B6(h,e)!==void 0?d[h[t]||""]=B6(h,e):d[h[t]||""]=null}),new this.constructor(d)}return this.map(function(h){return B6(h,e)!==void 0?B6(h,e):null})},zBt=kj,O8e=function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];zBt(i).forEach(function(o){delete e[o]})},P8e=al,jBt=P8e.isArray,UBt=P8e.isObject,tke=O8e,qBt=function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;if(this.isEmpty())return null;if(jBt(this.items))return t===1?this.items.pop():new this.constructor(this.items.splice(-t));if(UBt(this.items)){var i=Object.keys(this.items);if(t===1){var r=i[i.length-1],o=this.items[r];return tke(this.items,r),o}var s=i.slice(-t),a=s.reduce(function(l,c){return l[c]=e.items[c],l},{});return tke(this.items,s),new this.constructor(a)}return null},KBt=function(e,t){return t!==void 0?this.put(t,e):(this.items.unshift(e),this)},GBt=al,YBt=GBt.isFunction,QBt=function(e,t){var i=this.items[e]||null;return!i&&t!==void 0&&(YBt(t)?i=t():i=t),delete this.items[e],i},XBt=function(){var e;return(e=this.items).push.apply(e,arguments),this},ZBt=function(e,t){return this.items[e]=t,this},JBt=Eb,e$t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=JBt(this.items),i=new this.constructor(t).shuffle();return e!==parseInt(e,10)?i.first():i.take(e)},t$t=function(e,t){var i=this,r=null;return t!==void 0&&(r=t),Array.isArray(this.items)?this.items.forEach(function(o){r=e(r,o)}):Object.keys(this.items).forEach(function(o){r=e(r,i.items[o],o)}),r},n$t=function(e){return new this.constructor(this.items).filter(function(t){return!e(t)})};function nke(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function $6(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?nke(Object(t),!0).forEach(function(i){i$t(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):nke(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function i$t(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var r$t=function(e){if(!e)return this;if(Array.isArray(e)){var t=this.items.map(function(o,s){return e[s]||o});return new this.constructor(t)}if(e.constructor.name==="Collection"){var i=$6($6({},this.items),e.all());return new this.constructor(i)}var r=$6($6({},this.items),e);return new this.constructor(r)};function tE(n){"@babel/helpers - typeof";return tE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tE(n)}function ike(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function ET(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ike(Object(t),!0).forEach(function(i){o$t(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ike(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function o$t(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var s$t=function(e){var t=function i(r,o){var s=ET({},r),a=Object.keys(ET(ET({},r),o));return a.forEach(function(l){!Array.isArray(o[l])&&tE(o[l])==="object"?s[l]=i(r[l],o[l]):r[l]===void 0&&o[l]!==void 0?tE(r[l])==="object"?s[l]=ET({},o[l]):s[l]=o[l]:r[l]!==void 0&&o[l]===void 0?tE(r[l])==="object"?s[l]=ET({},r[l]):s[l]=r[l]:r[l]!==void 0&&o[l]!==void 0&&(tE(o[l])==="object"?s[l]=ET({},o[l]):s[l]=o[l])}),s};return e?!Array.isArray(e)&&tE(e)!=="object"?new this.constructor(t(this.items,[e])):e.constructor.name==="Collection"?new this.constructor(t(this.items,e.all())):new this.constructor(t(this.items,e)):this},a$t=function(){var e=[].concat(this.items).reverse();return new this.constructor(e)},bge=al,l$t=bge.isArray,c$t=bge.isObject,u$t=bge.isFunction,d$t=function(e,t){var i=this,r,o=function(a,l){return u$t(e)?e(i.items[l],l):t?i.items[l]===e:i.items[l]==e};return l$t(this.items)?r=this.items.findIndex(o):c$t(this.items)&&(r=Object.keys(this.items).find(function(s){return o(i.items[s],s)})),r===void 0||r<0?!1:r},M8e=al,h$t=M8e.isArray,f$t=M8e.isObject,g$t=O8e,p$t=function(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;if(this.isEmpty())return null;if(h$t(this.items))return t===1?this.items.shift():new this.constructor(this.items.splice(0,t));if(f$t(this.items)){if(t===1){var i=Object.keys(this.items)[0],r=this.items[i];return delete this.items[i],r}var o=Object.keys(this.items),s=o.slice(0,t),a=s.reduce(function(l,c){return l[c]=e.items[c],l},{});return g$t(this.items,s),new this.constructor(a)}return null},m$t=Eb,_$t=function(){var e=m$t(this.items),t,i,r;for(r=e.length;r;r-=1)t=Math.floor(Math.random()*r),i=e[r-1],e[r-1]=e[t],e[t]=i;return this.items=e,this},v$t=al,b$t=v$t.isObject,y$t=function(e){var t=this;return b$t(this.items)?new this.constructor(Object.keys(this.items).reduce(function(i,r,o){return o+1>e&&(i[r]=t.items[r]),i},{})):new this.constructor(this.items.slice(e))},yge=al,C$t=yge.isArray,w$t=yge.isObject,S$t=yge.isFunction,E$t=function(e){var t=this,i=null,r,o=function(a){return a===e};return S$t(e)&&(o=e),C$t(this.items)&&(r=this.items.filter(function(s){return i!==!0&&(i=o(s)),i})),w$t(this.items)&&(r=Object.keys(this.items).reduce(function(s,a){return i!==!0&&(i=o(t.items[a])),i!==!1&&(s[a]=t.items[a]),s},{})),new this.constructor(r)},Cge=al,x$t=Cge.isArray,k$t=Cge.isObject,T$t=Cge.isFunction,I$t=function(e){var t=this,i=null,r,o=function(a){return a===e};return T$t(e)&&(o=e),x$t(this.items)&&(r=this.items.filter(function(s){return i!==!0&&(i=!o(s)),i})),k$t(this.items)&&(r=Object.keys(this.items).reduce(function(s,a){return i!==!0&&(i=!o(t.items[a])),i!==!1&&(s[a]=t.items[a]),s},{})),new this.constructor(r)},L$t=function(e,t){var i=this.items.slice(e);return t!==void 0&&(i=i.slice(0,t)),new this.constructor(i)},D$t=al,A$t=D$t.isFunction,R$t=function(e,t,i){var r;if(A$t(e)?r=this.filter(e):r=this.where(e,t,i),r.isEmpty())throw new Error("Item not found.");if(r.count()>1)throw new Error("Multiple items found.");return r.first()},N$t=D8e,O$t=N$t,P$t=function(e){var t=[].concat(this.items);return e===void 0?this.every(function(i){return typeof i=="number"})?t.sort(function(i,r){return i-r}):t.sort():t.sort(e),new this.constructor(t)},M$t=function(){return this.sort().reverse()},F$t=$w,B$t=al,$$t=B$t.isFunction,V$t=function(e){var t=[].concat(this.items),i=function(o){return $$t(e)?e(o):F$t(o,e)};return t.sort(function(r,o){var s=i(r),a=i(o);return s==null?1:a==null||s<a?-1:s>a?1:0}),new this.constructor(t)},H$t=function(e){return this.sortBy(e).reverse()},W$t=function(){var e=this,t={};return Object.keys(this.items).sort().forEach(function(i){t[i]=e.items[i]}),new this.constructor(t)},z$t=function(){var e=this,t={};return Object.keys(this.items).sort().reverse().forEach(function(i){t[i]=e.items[i]}),new this.constructor(t)},j$t=function(e,t,i){var r=this.slice(e,t);if(this.items=this.diff(r.all()).all(),Array.isArray(i))for(var o=0,s=i.length;o<s;o+=1)this.items.splice(e+o,0,i[o]);return r},U$t=function(e){for(var t=Math.round(this.items.length/e),i=JSON.parse(JSON.stringify(this.items)),r=[],o=0;o<e;o+=1)r.push(new this.constructor(i.splice(0,t)));return new this.constructor(r)},q$t=Eb,K$t=al,G$t=K$t.isFunction,Y$t=function(e){var t=q$t(this.items),i=0;if(e===void 0)for(var r=0,o=t.length;r<o;r+=1)i+=parseFloat(t[r]);else if(G$t(e))for(var s=0,a=t.length;s<a;s+=1)i+=parseFloat(e(t[s]));else for(var l=0,c=t.length;l<c;l+=1)i+=parseFloat(t[l][e]);return parseFloat(i.toPrecision(12))};function Pie(n){"@babel/helpers - typeof";return Pie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pie(n)}var Q$t=function(e){var t=this;if(!Array.isArray(this.items)&&Pie(this.items)==="object"){var i=Object.keys(this.items),r;e<0?r=i.slice(e):r=i.slice(0,e);var o={};return i.forEach(function(s){r.indexOf(s)!==-1&&(o[s]=t.items[s])}),new this.constructor(o)}return e<0?new this.constructor(this.items.slice(e)):new this.constructor(this.items.slice(0,e))},wge=al,X$t=wge.isArray,Z$t=wge.isObject,J$t=wge.isFunction,e8t=function(e){var t=this,i=null,r,o=function(a){return a===e};return J$t(e)&&(o=e),X$t(this.items)&&(r=this.items.filter(function(s){return i!==!1&&(i=!o(s)),i})),Z$t(this.items)&&(r=Object.keys(this.items).reduce(function(s,a){return i!==!1&&(i=!o(t.items[a])),i!==!1&&(s[a]=t.items[a]),s},{})),new this.constructor(r)},Sge=al,t8t=Sge.isArray,n8t=Sge.isObject,i8t=Sge.isFunction,r8t=function(e){var t=this,i=null,r,o=function(a){return a===e};return i8t(e)&&(o=e),t8t(this.items)&&(r=this.items.filter(function(s){return i!==!1&&(i=o(s)),i})),n8t(this.items)&&(r=Object.keys(this.items).reduce(function(s,a){return i!==!1&&(i=o(t.items[a])),i!==!1&&(s[a]=t.items[a]),s},{})),new this.constructor(r)},o8t=function(e){return e(this),this},s8t=function(e,t){for(var i=1;i<=e;i+=1)this.items.push(t(i));return this},a8t=function(){var e=this.constructor;function t(r,o){var s=[];r instanceof e?(r.items.forEach(function(a){return t(a,s)}),o.push(s)):Array.isArray(r)?(r.forEach(function(a){return t(a,s)}),o.push(s)):o.push(r)}if(Array.isArray(this.items)){var i=[];return this.items.forEach(function(r){t(r,i)}),i}return this.values().all()};function Mie(n){"@babel/helpers - typeof";return Mie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mie(n)}var l8t=function(){return Mie(this.items)==="object"&&!Array.isArray(this.items)?JSON.stringify(this.all()):JSON.stringify(this.toArray())},c8t=function(e){var t=this;if(Array.isArray(this.items))this.items=this.items.map(e);else{var i={};Object.keys(this.items).forEach(function(r){i[r]=e(t.items[r],r)}),this.items=i}return this};function rke(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function oke(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?rke(Object(t),!0).forEach(function(i){u8t(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):rke(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function u8t(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var d8t=function(){var e=this;if(Array.isArray(this.items))return this;var t={};return Object.keys(this.items).forEach(function(i){if(i.indexOf(".")!==-1){var r=t;i.split(".").reduce(function(o,s,a,l){return o[s]||(o[s]={}),a===l.length-1&&(o[s]=e.items[i]),o[s]},r),t=oke(oke({},t),r)}else t[i]=e.items[i]}),new this.constructor(t)},h8t=function(e,t,i){e?i(this):t(this)},ske=function(e,t){if(Array.isArray(this.items)&&this.items.length)return e(this);if(Object.keys(this.items).length)return e(this);if(t!==void 0){if(Array.isArray(this.items)&&!this.items.length)return t(this);if(!Object.keys(this.items).length)return t(this)}return this},ake=function(e,t){if(Array.isArray(this.items)&&!this.items.length)return e(this);if(!Object.keys(this.items).length)return e(this);if(t!==void 0){if(Array.isArray(this.items)&&this.items.length)return t(this);if(Object.keys(this.items).length)return t(this)}return this},f8t=function(e){var t=this,i=JSON.parse(JSON.stringify(this.items));return Object.keys(e).forEach(function(r){t.items[r]===void 0&&(i[r]=e[r])}),new this.constructor(i)},g8t=al,p8t=g8t.isFunction,m8t=function(e){var t;if(e===void 0)t=this.items.filter(function(a,l,c){return c.indexOf(a)===l});else{t=[];for(var i=[],r=0,o=this.items.length;r<o;r+=1){var s=void 0;p8t(e)?s=e(this.items[r]):s=this.items[r][e],i.indexOf(s)===-1&&(t.push(this.items[r]),i.push(s))}}return new this.constructor(t)},_8t=function(e){return e instanceof this.constructor?e.all():e},v8t=Eb,b8t=function(){return new this.constructor(v8t(this.items))},y8t=function(e,t,i){return e?t(this,e):i?i(this,e):this},C8t=Eb,Zg=$w,w8t=function(e,t,i){var r=t,o=i,s=C8t(this.items);if(t===void 0||t===!0)return new this.constructor(s.filter(function(l){return Zg(l,e)}));if(t===!1)return new this.constructor(s.filter(function(l){return!Zg(l,e)}));i===void 0&&(o=t,r="===");var a=s.filter(function(l){switch(r){case"==":return Zg(l,e)===Number(o)||Zg(l,e)===o.toString();default:case"===":return Zg(l,e)===o;case"!=":case"<>":return Zg(l,e)!==Number(o)&&Zg(l,e)!==o.toString();case"!==":return Zg(l,e)!==o;case"<":return Zg(l,e)<o;case"<=":return Zg(l,e)<=o;case">":return Zg(l,e)>o;case">=":return Zg(l,e)>=o}});return new this.constructor(a)},S8t=function(e,t){return this.where(e,">=",t[0]).where(e,"<=",t[t.length-1])},E8t=Eb,x8t=$w,k8t=function(e,t){var i=E8t(t),r=this.items.filter(function(o){return i.indexOf(x8t(o,e))!==-1});return new this.constructor(r)},T8t=function(e){return this.filter(function(t){return t instanceof e})},lke=$w,I8t=function(e,t){return this.filter(function(i){return lke(i,e)<t[0]||lke(i,e)>t[t.length-1]})},L8t=Eb,D8t=$w,A8t=function(e,t){var i=L8t(t),r=this.items.filter(function(o){return i.indexOf(D8t(o,e))===-1});return new this.constructor(r)},R8t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.where(e,"===",null)},N8t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.where(e,"!==",null)};function Fie(n){"@babel/helpers - typeof";return Fie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fie(n)}var O8t=function(e){return e instanceof this.constructor?e:Fie(e)==="object"?new this.constructor(e):new this.constructor([e])},P8t=function(e){var t=this,i=e;i instanceof this.constructor&&(i=i.all());var r=this.items.map(function(o,s){return new t.constructor([o,i[s]])});return new this.constructor(r)};(function(n){function e(o){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},e(o)}function t(o){o!==void 0&&!Array.isArray(o)&&e(o)!=="object"?this.items=[o]:o instanceof this.constructor?this.items=o.all():this.items=o||[]}var i=tFt;typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=i),t.prototype.toJSON=function(){return this.items},t.prototype.all=nFt,t.prototype.average=I8e,t.prototype.avg=sFt,t.prototype.chunk=aFt,t.prototype.collapse=fFt,t.prototype.combine=bFt,t.prototype.concat=kFt,t.prototype.contains=D8e,t.prototype.containsOneItem=$Ft,t.prototype.count=VFt,t.prototype.countBy=HFt,t.prototype.crossJoin=WFt,t.prototype.dd=zFt,t.prototype.diff=jFt,t.prototype.diffAssoc=UFt,t.prototype.diffKeys=qFt,t.prototype.diffUsing=KFt,t.prototype.doesntContain=GFt,t.prototype.dump=YFt,t.prototype.duplicates=QFt,t.prototype.each=XFt,t.prototype.eachSpread=i6t,t.prototype.every=o6t,t.prototype.except=a6t,t.prototype.filter=u6t,t.prototype.first=h6t,t.prototype.firstOrFail=p6t,t.prototype.firstWhere=m6t,t.prototype.flatMap=_6t,t.prototype.flatten=v6t,t.prototype.flip=b6t,t.prototype.forPage=y6t,t.prototype.forget=C6t,t.prototype.get=E6t,t.prototype.groupBy=T6t,t.prototype.has=L6t,t.prototype.implode=D6t,t.prototype.intersect=A6t,t.prototype.intersectByKeys=R6t,t.prototype.isEmpty=N6t,t.prototype.isNotEmpty=O6t,t.prototype.join=P6t,t.prototype.keyBy=$6t,t.prototype.keys=V6t,t.prototype.last=W6t,t.prototype.macro=z6t,t.prototype.make=j6t,t.prototype.map=U6t,t.prototype.mapSpread=X6t,t.prototype.mapToDictionary=iBt,t.prototype.mapInto=rBt,t.prototype.mapToGroups=uBt,t.prototype.mapWithKeys=pBt,t.prototype.max=yBt,t.prototype.median=CBt,t.prototype.merge=wBt,t.prototype.mergeRecursive=EBt,t.prototype.min=LBt,t.prototype.mode=DBt,t.prototype.nth=RBt,t.prototype.only=OBt,t.prototype.pad=MBt,t.prototype.partition=FBt,t.prototype.pipe=BBt,t.prototype.pluck=WBt,t.prototype.pop=qBt,t.prototype.prepend=KBt,t.prototype.pull=QBt,t.prototype.push=XBt,t.prototype.put=ZBt,t.prototype.random=e$t,t.prototype.reduce=t$t,t.prototype.reject=n$t,t.prototype.replace=r$t,t.prototype.replaceRecursive=s$t,t.prototype.reverse=a$t,t.prototype.search=d$t,t.prototype.shift=p$t,t.prototype.shuffle=_$t,t.prototype.skip=y$t,t.prototype.skipUntil=E$t,t.prototype.skipWhile=I$t,t.prototype.slice=L$t,t.prototype.sole=R$t,t.prototype.some=O$t,t.prototype.sort=P$t,t.prototype.sortDesc=M$t,t.prototype.sortBy=V$t,t.prototype.sortByDesc=H$t,t.prototype.sortKeys=W$t,t.prototype.sortKeysDesc=z$t,t.prototype.splice=j$t,t.prototype.split=U$t,t.prototype.sum=Y$t,t.prototype.take=Q$t,t.prototype.takeUntil=e8t,t.prototype.takeWhile=r8t,t.prototype.tap=o8t,t.prototype.times=s8t,t.prototype.toArray=a8t,t.prototype.toJson=l8t,t.prototype.transform=c8t,t.prototype.undot=d8t,t.prototype.unless=h8t,t.prototype.unlessEmpty=ske,t.prototype.unlessNotEmpty=ake,t.prototype.union=f8t,t.prototype.unique=m8t,t.prototype.unwrap=_8t,t.prototype.values=b8t,t.prototype.when=y8t,t.prototype.whenEmpty=ake,t.prototype.whenNotEmpty=ske,t.prototype.where=w8t,t.prototype.whereBetween=S8t,t.prototype.whereIn=k8t,t.prototype.whereInstanceOf=T8t,t.prototype.whereNotBetween=I8t,t.prototype.whereNotIn=A8t,t.prototype.whereNull=R8t,t.prototype.whereNotNull=N8t,t.prototype.wrap=O8t,t.prototype.zip=P8t;var r=function(s){return new t(s)};n.exports=r,n.exports.collect=r,n.exports.default=r,n.exports.Collection=t})(T8e);var M8t=T8e.exports;const Wa=ja(M8t);function F8t(){const[n]=ue(),{data:e}=ai(["/api/v1/search"],()=>Te("POST",ye("/api/v1/search")).then(t=>{const i=[];return Object.entries(t.data).forEach(([r,o])=>{o.forEach(s=>{i.push({id:xj(),label:s.name,value:s.id,resource:s,searchable:`${n(r)}: ${s.name}`,eventType:"external"})})}),i}),{staleTime:1/0});return e}const cke=Ea(Hm.Option)`
color: ${n=>n.theme.color};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function B8t(){const[n]=ue(),[e,t]=w.useState(""),[i,r]=w.useState(!1),o=Y2(),s=F8t(),a=Vn(),l=w.useRef(null),c=w.useRef(null),u=Wa(s).filter(d=>d.searchable.toLowerCase().includes(e.toLowerCase())||d.label.toLowerCase().includes(e.toLowerCase())||d.value.toString().toLowerCase().includes(e.toLowerCase())).take(100);return w.useEffect(()=>{const d=h=>{var g;h.ctrlKey&&h.key==="k"&&(h.preventDefault(),(g=c.current)==null||g.focus())};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}},[]),w.useEffect(()=>{i===!1&&t("")},[i]),Bw(l,()=>r(!1)),f(Hm,{as:"div",onChange:d=>d.resource?o({url:d.resource.path}):null,className:"w-full",ref:l,children:N("div",{className:"relative mt-2",children:[f(Hm.Input,{className:"border-transparent focus:border-transparent focus:ring-0 w-full",onChange:d=>t(d.target.value),ref:c,onFocus:()=>r(!0),placeholder:`${n("search")}... (Ctrl K)`,style:{backgroundColor:a.$1,color:a.$3}}),N(Hm.Options,{className:St("absolute border rounded w-96 max-h-72 overflow-y-auto shadow-lg",{hidden:!i}),style:{backgroundColor:a.$1,borderColor:a.$4},static:!0,children:[u==null?void 0:u.map(d=>f(cke,{value:d,theme:{color:a.$3,hoverColor:a.$2},className:"cursor-pointer rounded px-4 py-2 active:font-semibold",children:({active:h})=>{var g;return f("span",{className:St("block truncate space-x-1",h&&"font-semibold"),children:N("div",{children:[f("p",{className:"text-xs font-semibold",children:(g=d.resource)==null?void 0:g.heading}),f("p",{children:d.label})]})})}},d.id)),u.count()===0&&f(cke,{value:null,theme:{color:a.$3,hoverColor:a.$2},className:"cursor-not-allowed rounded px-4 py-2 active:font-semibold",disabled:!0,children:({active:d})=>f("span",{className:St("block truncate space-x-1",d&&"font-semibold"),children:f("p",{className:"text-sm",children:n("no_match_found")})})})]})]})})}const $8t=w.memo(B8t);function oA(n){var v;const[e]=ue(),t=ol(),i=zo(),r=Vn(),o=Y2(),s=S8e(),a=x0(),l=vi(),c=Xz(),u=!!((v=a==null?void 0:a.company_user)!=null&&v.react_settings.show_mini_sidebar),d=!u0()&&(H5t()||W5t()),[h,g]=w.useState(!1),p=[{name:e("dashboard"),href:"/dashboard",icon:G3e,current:t.pathname.startsWith("/dashboard"),visible:i("view_dashboard")},{name:e("clients"),href:"/clients",icon:N_t,current:t.pathname.startsWith("/clients"),visible:i("view_client")||i("create_client")||i("edit_client"),rightButton:{icon:dd,to:"/clients/create",label:e("new_client"),visible:i("create_client")}},{name:e("products"),href:"/products",icon:Gpt,current:t.pathname.startsWith("/products"),visible:i("view_product")||i("create_product")||i("edit_product"),rightButton:{icon:dd,to:"/products/create",label:e("new_product"),visible:i("create_product")}},{name:e("invoices"),href:"/invoices",icon:QC,current:t.pathname.startsWith("/invoices"),visible:s(Xn.Invoices)&&(i("view_invoice")||i("create_invoice")||i("edit_invoice")),rightButton:{icon:dd,to:"/invoices/create",label:e("new_invoice"),visible:i("create_invoice")}},{name:e("recurring_invoices"),href:"/recurring_invoices",icon:i7,current:t.pathname.startsWith("/recurring_invoices"),visible:s(Xn.RecurringInvoices)&&(i("view_recurring_invoice")||i("create_recurring_invoice")||i("edit_recurring_invoice")),rightButton:{icon:dd,to:"/recurring_invoices/create",label:e("new_recurring_invoice"),visible:i("create_recurring_invoice")}},{name:e("payments"),href:"/payments",icon:wmt,current:t.pathname.startsWith("/payments"),visible:i("view_payment")||i("create_payment")||i("edit_payment"),rightButton:{icon:dd,to:"/payments/create",label:e("new_payment"),visible:i("create_payment")}},{name:e("quotes"),href:"/quotes",icon:fhe,current:t.pathname.startsWith("/quotes"),visible:s(Xn.Quotes)&&(i("view_quote")||i("create_quote")||i("edit_quote")),rightButton:{icon:dd,to:"/quotes/create",label:e("new_quote"),visible:i("create_quote")}},{name:e("credits"),href:"/credits",icon:QC,current:t.pathname.startsWith("/credits"),visible:s(Xn.Credits)&&(i("view_credit")||i("create_credit")||i("edit_credit")),rightButton:{icon:dd,to:"/credits/create",label:e("new_credit"),visible:i("create_credit")}},{name:e("projects"),href:"/projects",icon:Xpt,current:t.pathname.startsWith("/projects"),visible:s(Xn.Projects)&&(i("view_project")||i("create_project")||i("edit_project")),rightButton:{icon:dd,to:"/projects/create",label:e("new_project"),visible:i("create_project")}},{name:e("tasks"),href:"/tasks",icon:bmt,current:t.pathname.startsWith("/tasks"),visible:s(Xn.Tasks)&&(i("view_task")||i("edit_task")||i("create_task")),rightButton:{icon:dd,to:"/tasks/create",label:e("new_task"),visible:i("create_task")}},{name:e("vendors"),href:"/vendors",icon:Hxt,current:t.pathname.startsWith("/vendors"),visible:s(Xn.Vendors)&&(i("view_vendor")||i("create_vendor")||i("edit_vendor")),rightButton:{icon:dd,to:"/vendors/create",label:e("new_vendor"),visible:i("create_vendor")}},{name:e("purchase_orders"),href:"/purchase_orders",icon:Ife,current:t.pathname.startsWith("/purchase_orders"),visible:s(Xn.PurchaseOrders)&&(i("view_purchase_order")||i("create_purchase_order")||i("edit_purchase_order")),rightButton:{icon:dd,to:"/purchase_orders/create",label:e("new_purchase_order"),visible:i("create_purchase_order")}},{name:e("expenses"),href:"/expenses",icon:Uxt,current:t.pathname.startsWith("/expenses"),visible:s(Xn.Expenses)&&(i("view_expense")||i("create_expense")||i("edit_expense")),rightButton:{icon:dd,to:"/expenses/create",label:e("new_expense"),visible:i("create_expense")}},{name:e("recurring_expenses"),href:"/recurring_expenses",icon:i7,current:t.pathname.startsWith("/recurring_expenses"),visible:s(Xn.RecurringExpenses)&&(i("view_recurring_expense")||i("create_recurring_expense")||i("edit_recurring_expense")),rightButton:{icon:dd,to:"/recurring_expenses/create",label:e("new_recurring_expense"),visible:i("create_recurring_expense")}},{name:e("reports"),href:"/reports",icon:c_t,current:t.pathname.startsWith("/reports"),visible:i("view_reports")},{name:e("transactions"),href:"/transactions",icon:pwt,current:t.pathname.startsWith("/transactions"),visible:s(Xn.Transactions)&&(i("view_bank_transaction")||i("create_bank_transaction")||i("edit_bank_transaction")),rightButton:{icon:dd,to:"/transactions/create",label:e("new_transaction"),visible:i("create_bank_transaction")}},{name:e("settings"),href:c!=null&&c.is_admin||c!=null&&c.is_owner?"/settings/company_details":"/settings/user_details",icon:Ihe,current:t.pathname.startsWith("/settings"),visible:!!l}],m=ki(E8e),_=U5t();return N("div",{children:[f(Y5t,{}),f(G5t,{}),f(Q5t,{}),f(uAt,{navigation:p,sidebarOpen:h,setSidebarOpen:g}),f(cAt,{navigation:p,docsLink:n.docsLink}),N("div",{className:`${u?"md:pl-16":"md:pl-64"} flex flex-col flex-1`,children:[N("div",{style:{backgroundColor:r.$1,borderColor:r.$4},className:"sticky top-0 z-10 flex-shrink-0 flex h-16 border-b shadow",children:[N("button",{type:"button",className:"px-4 border-r border-gray-200 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500 md:hidden",onClick:()=>g(!0),children:[f("span",{className:"sr-only",children:"Open sidebar"}),f(i_t,{className:"dark:text-gray-100"})]}),N("div",{className:"flex-1 px-4 xl:px-8 flex items-center","data-cy":"topNavbar",children:[N("div",{className:"flex flex-1 items-center space-x-4",children:[f("h2",{style:{color:r.$3},className:"text-sm md:text-lg whitespace-nowrap",children:n.title}),f(V5t,{}),f($8t,{})]}),N("div",{className:"ml-4 flex items-center md:ml-6 space-x-2 lg:space-x-3",children:[d&&f("button",{className:"hidden sm:inline-flex items-center justify-center py-2 px-4 rounded text-sm text-white bg-green-500 hover:bg-green-600",onClick:()=>o({url:"https://invoiceninja.invoicing.co/client/subscriptions/O5xe7Rwd7r/purchase",externalLink:!0}),children:f("span",{children:e("white_label_button")})}),n.onCancelClick&&f(Ut,{onClick:n.onCancelClick,type:"secondary",children:e("cancel")}),(!!n.onSaveClick||m)&&N("div",{children:[!n.additionalSaveOptions&&f(Ut,{onClick:(m==null?void 0:m.onClick)||n.onSaveClick,disabled:(m==null?void 0:m.disableSaveButton)||n.disableSaveButton,disableWithoutIcon:!0,children:((m==null?void 0:m.label)||n.saveButtonLabel)??e("save")}),n.additionalSaveOptions&&N("div",{className:"flex",children:[f(Ut,{className:"rounded-br-none rounded-tr-none px-3",onClick:(m==null?void 0:m.onClick)||n.onSaveClick,disabled:(m==null?void 0:m.disableSaveButton)||n.disableSaveButton,disableWithoutIcon:!0,children:((m==null?void 0:m.label)||n.saveButtonLabel)??e("save")}),f(Hp,{className:"rounded-bl-none rounded-tl-none h-full px-1 border-gray-200 border-l-1 border-y-0 border-r-0",cardActions:!0,disabled:(m==null?void 0:m.disableSaveButton)||n.disableSaveButton,children:n.additionalSaveOptions.map((b,y)=>f(et,{icon:b.icon,disabled:n.disableSaveButton,onClick:b.onClick,children:b.label},y))})]})]}),(_||n.navigationTopRight)&&f("div",{className:"flex space-x-3 items-center",children:(_==null?void 0:_.element)||n.navigationTopRight})]})]})]}),n.aboveMainContainer,N("main",{className:"flex-1",children:[(n.breadcrumbs||n.topRight)&&n.breadcrumbs.length>0&&N("div",{className:"pt-4 px-4 md:px-8 md:pt-8 dark:text-gray-100 flex flex-col lg:flex-row lg:justify-between lg:items-center space-y-4 lg:space-y-0",children:[f("div",{className:"",children:n.breadcrumbs&&f(Tfe,{pages:n.breadcrumbs})}),n.topRight&&f("div",{children:n.topRight})]}),f("div",{style:{color:r.$3,backgroundColor:r.$2},className:"p-4 md:py-8 xl:p-8 dark:text-gray-100",children:n.children})]})]})]})}function F8e({children:n,type:e="page"}){return f(w.Suspense,{fallback:e==="page"||e==="component"?f(oA,{breadcrumbs:[],children:f(Vo,{})}):f(Vo,{}),children:n})}function B8e(){const n=Vde(),e=Tl(t=>t.user);return n?e.user.id?f(F8e,{children:f(ah,{})}):f(Tpt,{}):f(aD,{to:"/login"})}function V8t(){const[n]=ue(),[e,t]=w.useState(!0);return w.useEffect(()=>(setTimeout(()=>{t(!1)},1e3),()=>{t(!0)}),[]),f(oA,{breadcrumbs:[],children:f("div",{className:"flex flex-col items-center mt-14 space-y-4",children:e?f(Vo,{}):N(_t,{children:[f(j3e,{size:128}),N("h1",{className:"text-2xl",children:[n("not_allowed"),"."]})]})})})}function H8t(){const[n]=ue(),[e,t]=w.useState(!0);return w.useEffect(()=>(setTimeout(()=>{t(!1)},1e3),()=>{t(!0)}),[]),f("div",{className:"flex flex-col items-center mt-14 space-y-4",children:e?f(Vo,{}):N(_t,{children:[f(j3e,{size:128}),N("h1",{className:"text-2xl",children:[n("not_allowed"),"."]})]})})}function W8t(){const n=Xz(),e=Kr(),t=Fa(),i=ha(),r=vge();return{companyUser:n,queryClient:e,params:t,user:i,settingsLevel:r.level}}function vn({guards:n,component:e,type:t="page"}){const[i,r]=w.useState("loading"),{companyUser:o,queryClient:s,params:a,user:l,settingsLevel:c}=W8t();return w.useEffect(()=>{const u=n.map(d=>d({companyUser:o,queryClient:s,params:a,user:l,settingsLevel:c}));Promise.all(u).then(d=>{d.includes(!1)?r("unauthorized"):r("authorized")}).catch(()=>r("loading"))}),i==="loading"?t==="page"?f(oA,{breadcrumbs:[],children:f(Vo,{})}):f(Vo,{}):i==="unauthorized"?t==="page"?f(V8t,{}):t==="subPage"?f(H8t,{}):null:f(F8e,{type:t,children:e})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Rt(n){const[e]=n.split("_");return({companyUser:t})=>{const i=(t==null?void 0:t.permissions)??"",r=!!(t!=null&&t.is_admin||t!=null&&t.is_owner||i.includes(n)||i.includes(`${e}_all`)&&n!=="view_reports"&&n!=="view_dashboard");return Promise.resolve(r)}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function si(...n){return async e=>new Promise(async t=>{for(const i of n)if(await i(e)===!0){t(!0);break}t(!1)})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Ys(n,e="id"){return({params:t,user:i})=>{const r=t[e],o=dt(n,{id:r});return Te("GET",ye(o)).then(s=>s.data.data.user_id===(i==null?void 0:i.id)||s.data.data.assigned_user_id===(i==null?void 0:i.id)?Promise.resolve(!0):Promise.resolve(!1)).catch(()=>Promise.resolve(!1))}}const z8t=w.lazy(()=>X(()=>import("./bundle2.js"),["bundle2.js","bundle394.js","bundle404.js","bundle395.js","bundle401.js","bundle396.js","bundle397.js","bundle398.js","bundle405.js","bundle406.js","bundle407.js","bundle408.js","bundle399.js","bundle400.js","bundle409.js","bundle402.js","bundle403.js"])),j8t=w.lazy(()=>X(()=>import("./bundle3.js"),["bundle3.js","bundle394.js","bundle404.js","bundle410.js","bundle411.js"])),U8t=w.lazy(()=>X(()=>import("./bundle4.js"),[])),q8t=w.lazy(()=>X(()=>import("./bundle5.js"),["bundle5.js","bundle412.js","bundle410.js","bundle411.js"])),K8t=w.lazy(()=>X(()=>import("./bundle6.js"),["bundle6.js","bundle413.js","bundle417.js","bundle414.js","bundle415.js","bundle418.js","bundle416.js","bundle410.js","bundle401.js","bundle404.js"])),G8t=w.lazy(()=>X(()=>import("./bundle7.js"),["bundle7.js","bundle418.js"])),Y8t=w.lazy(()=>X(()=>import("./bundle8.js"),["bundle8.js","bundle419.js","bundle418.js"])),uke=w.lazy(()=>X(()=>import("./bundle9.js"),[])),dke=w.lazy(()=>X(()=>import("./bundle10.js"),["bundle10.js","bundle420.js","bundle421.js","bundle422.js"])),Q8t=w.lazy(()=>X(()=>import("./bundle11.js"),[])),X8t=w.lazy(()=>X(()=>import("./bundle12.js"),[])),Z8t=w.lazy(()=>X(()=>import("./bundle13.js"),["bundle13.js","bundle402.js"])),J8t=w.lazy(()=>X(()=>import("./bundle14.js"),["bundle14.js","bundle413.js","bundle417.js","bundle414.js","bundle415.js","bundle418.js","bundle416.js","bundle410.js"])),e9t=N(ge,{path:"/invoices",children:[f(ge,{path:"",element:f(vn,{guards:[rr(Xn.Invoices),si(Rt("view_invoice"),Rt("create_invoice"),Rt("edit_invoice"))],component:f(z8t,{})})}),f(ge,{path:"import",element:f(vn,{guards:[rr(Xn.Invoices),si(Rt("create_invoice"),Rt("edit_invoice"))],component:f(U8t,{})})}),N(ge,{path:"create",element:f(vn,{guards:[rr(Xn.Invoices),Rt("create_invoice")],component:f(q8t,{})}),children:[f(ge,{path:"",element:f(J8t,{})}),f(ge,{path:"documents",element:f(uke,{})}),f(ge,{path:"settings",element:f(dke,{})})]}),N(ge,{path:":id",element:f(vn,{guards:[rr(Xn.Invoices),si(Rt("view_invoice"),Rt("edit_invoice"),Ys("/api/v1/invoices/:id"))],component:f(j8t,{})}),children:[f(ge,{path:"edit",element:f(K8t,{})}),f(ge,{path:"documents",element:f(uke,{})}),f(ge,{path:"settings",element:f(dke,{})}),f(ge,{path:"activity",element:f(Q8t,{})}),f(ge,{path:"history",element:f(X8t,{})}),f(ge,{path:"email_history",element:f(Z8t,{})})]}),f(ge,{path:":id/pdf",element:f(vn,{guards:[rr(Xn.Invoices),si(Rt("edit_invoice"),Ys("/api/v1/invoices/:id"))],component:f(G8t,{})})}),f(ge,{path:":id/email",element:f(vn,{guards:[rr(Xn.Invoices),si(Rt("edit_invoice"),Ys("/api/v1/invoices/:id"))],component:f(Y8t,{})})})]}),t9t=w.lazy(()=>X(()=>import("./bundle15.js"),["bundle15.js","bundle396.js","bundle397.js"])),n9t=w.lazy(()=>X(()=>import("./bundle16.js"),[])),i9t=w.lazy(()=>X(()=>import("./bundle17.js"),[])),r9t=w.lazy(()=>X(()=>import("./bundle18.js"),[])),o9t=w.lazy(()=>X(()=>import("./bundle19.js"),["bundle19.js","bundle423.js","bundle402.js"])),s9t=w.lazy(()=>X(()=>import("./bundle20.js"),["bundle20.js","bundle424.js","bundle405.js","bundle408.js"])),a9t=w.lazy(()=>X(()=>import("./bundle21.js"),["bundle21.js","bundle425.js","bundle400.js","bundle409.js","bundle426.js","bundle406.js"])),l9t=w.lazy(()=>X(()=>import("./bundle22.js"),["bundle22.js","bundle427.js","bundle408.js"])),c9t=w.lazy(()=>X(()=>import("./bundle23.js"),["bundle23.js","bundle428.js","bundle430.js","bundle395.js","bundle401.js","bundle404.js","bundle429.js","bundle405.js","bundle406.js","bundle407.js"])),u9t=w.lazy(()=>X(()=>import("./bundle24.js"),["bundle24.js","bundle431.js","bundle432.js"])),d9t=w.lazy(()=>X(()=>import("./bundle25.js"),["bundle25.js","bundle433.js"])),h9t=w.lazy(()=>X(()=>import("./bundle26.js"),[])),f9t=w.lazy(()=>X(()=>import("./bundle27.js"),["bundle27.js","bundle434.js"])),g9t=w.lazy(()=>X(()=>import("./bundle28.js"),[])),p9t=w.lazy(()=>X(()=>import("./bundle29.js"),["bundle29.js","bundle395.js","bundle401.js","bundle404.js","bundle394.js","bundle398.js","bundle405.js","bundle406.js","bundle407.js","bundle408.js"])),m9t=w.lazy(()=>X(()=>import("./bundle30.js"),[])),_9t=w.lazy(()=>X(()=>import("./bundle31.js"),["bundle31.js","bundle396.js"])),v9t=N(ge,{path:"clients",children:[f(ge,{path:"",element:f(vn,{guards:[si(Rt("view_client"),Rt("create_client"),Rt("edit_client"))],component:f(t9t,{})})}),f(ge,{path:"import",element:f(vn,{guards:[si(Rt("create_client"),Rt("edit_client"))],component:f(n9t,{})})}),f(ge,{path:"create",element:f(vn,{guards:[Rt("create_client")],component:f(i9t,{})})}),f(ge,{path:":id/edit",element:f(vn,{guards:[si(Rt("edit_client"),Ys("/api/v1/clients/:id"))],component:f(r9t,{})})}),N(ge,{path:":id",element:f(vn,{guards:[si(Rt("view_client"),Rt("edit_client"),Ys("/api/v1/clients/:id"))],component:f(o9t,{})}),children:[f(ge,{path:"",element:f(p9t,{})}),f(ge,{path:"quotes",element:f(s9t,{})}),f(ge,{path:"payments",element:f(a9t,{})}),f(ge,{path:"recurring_invoices",element:f(l9t,{})}),f(ge,{path:"credits",element:f(c9t,{})}),f(ge,{path:"projects",element:f(u9t,{})}),f(ge,{path:"tasks",element:f(d9t,{})}),f(ge,{path:"expenses",element:f(h9t,{})}),f(ge,{path:"recurring_expenses",element:f(f9t,{})}),f(ge,{path:"activities",element:f(m9t,{})}),f(ge,{path:"documents",element:f(_9t,{})})]}),f(ge,{path:":id/statement",element:f(vn,{guards:[si(Rt("edit_client"),Ys("/api/v1/clients/:id"))],component:f(g9t,{})})})]});/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function kI(){return({companyUser:n})=>Promise.resolve(!!(n!=null&&n.is_admin))}const iX=w.lazy(()=>X(()=>import("./bundle32.js"),[])),b9t=w.lazy(()=>X(()=>import("./bundle33.js"),[])),y9t=w.lazy(()=>X(()=>import("./bundle34.js"),["bundle34.js","bundle396.js","bundle397.js"])),C9t=w.lazy(()=>X(()=>import("./bundle35.js"),[])),w9t=w.lazy(()=>X(()=>import("./bundle36.js"),[])),S9t=w.lazy(()=>X(()=>import("./bundle37.js"),[])),E9t=w.lazy(()=>X(()=>import("./bundle38.js"),[])),x9t=w.lazy(()=>X(()=>import("./bundle39.js"),[])),k9t=N(ge,{path:"products",children:[f(ge,{path:"",element:f(vn,{guards:[si(Rt("view_product"),Rt("create_product"),Rt("edit_product"))],component:f(y9t,{})})}),f(ge,{path:"import",element:f(vn,{guards:[si(Rt("create_product"),Rt("edit_product"))],component:f(b9t,{})})}),f(ge,{path:"create",element:f(vn,{guards:[Rt("create_product")],component:f(C9t,{})})}),N(ge,{path:":id",element:f(vn,{guards:[si(Rt("view_product"),Rt("edit_product"),Ys("/api/v1/products/:id"))],component:f(iX,{})}),children:[f(ge,{path:"",element:f(S9t,{})}),f(ge,{path:"documents",element:f(E9t,{})})]}),f(ge,{path:":id",element:f(vn,{guards:[kI()],component:f(iX,{})}),children:f(ge,{path:"product_fields",element:f(x9t,{})})}),f(ge,{path:":id/edit",element:f(vn,{guards:[si(Rt("view_product"),Rt("edit_product"),Ys("/api/v1/products/:id"))],component:f(iX,{})}),children:f(ge,{path:"",element:f(w9t,{})})})]}),T9t=w.lazy(()=>X(()=>import("./bundle40.js"),[])),I9t=w.lazy(()=>X(()=>import("./bundle41.js"),["bundle41.js","bundle397.js","bundle396.js","bundle399.js","bundle427.js","bundle408.js","bundle403.js"])),L9t=w.lazy(()=>X(()=>import("./bundle42.js"),["bundle42.js","bundle412.js","bundle413.js","bundle417.js","bundle415.js","bundle418.js","bundle435.js","bundle420.js","bundle421.js","bundle422.js","bundle416.js"])),D9t=w.lazy(()=>X(()=>import("./bundle43.js"),["bundle43.js","bundle413.js","bundle417.js","bundle415.js","bundle418.js","bundle435.js","bundle420.js","bundle421.js","bundle422.js","bundle416.js"])),A9t=w.lazy(()=>X(()=>import("./bundle44.js"),["bundle44.js","bundle418.js"])),R9t=N(ge,{path:"/recurring_invoices",children:[f(ge,{path:"",element:f(vn,{guards:[rr(Xn.RecurringInvoices),si(Rt("view_recurring_invoice"),Rt("create_recurring_invoice"),Rt("edit_recurring_invoice"))],component:f(I9t,{})})}),f(ge,{path:"create",element:f(vn,{guards:[rr(Xn.RecurringInvoices),Rt("create_recurring_invoice")],component:f(L9t,{})})}),N(ge,{path:":id",children:[f(ge,{path:"edit",element:f(vn,{guards:[rr(Xn.RecurringInvoices),si(Rt("edit_recurring_invoice"),Rt("view_recurring_invoice"),Ys("/api/v1/recurring_invoices/:id"))],component:f(D9t,{})})}),f(ge,{path:"pdf",element:f(vn,{guards:[rr(Xn.RecurringInvoices),si(Rt("edit_recurring_invoice"),Ys("/api/v1/recurring_invoices/:id"))],component:f(A9t,{})})})]}),f(ge,{path:"import",element:f(vn,{guards:[rr(Xn.Invoices),si(Rt("create_recurring_invoice"),Rt("edit_recurring_invoice"))],component:f(T9t,{})})})]}),rX=w.lazy(()=>X(()=>import("./bundle45.js"),["bundle45.js","bundle406.js","bundle426.js"])),N9t=w.lazy(()=>X(()=>import("./bundle46.js"),["bundle46.js","bundle425.js","bundle400.js","bundle409.js","bundle396.js","bundle426.js","bundle406.js","bundle399.js","bundle401.js","bundle404.js","bundle430.js"])),O9t=w.lazy(()=>X(()=>import("./bundle47.js"),["bundle47.js","bundle406.js","bundle436.js","bundle407.js"])),P9t=w.lazy(()=>X(()=>import("./bundle48.js"),["bundle48.js","bundle436.js","bundle400.js","bundle409.js","bundle423.js","bundle417.js"])),M9t=w.lazy(()=>X(()=>import("./bundle49.js"),["bundle49.js","bundle406.js"])),F9t=w.lazy(()=>X(()=>import("./bundle50.js"),[])),B9t=w.lazy(()=>X(()=>import("./bundle51.js"),["bundle51.js","bundle406.js"])),$9t=w.lazy(()=>X(()=>import("./bundle52.js"),["bundle52.js","bundle406.js"])),V9t=N(ge,{path:"/payments",children:[f(ge,{path:"",element:f(vn,{guards:[si(Rt("view_payment"),Rt("create_payment"),Rt("edit_payment"))],component:f(N9t,{})})}),f(ge,{path:"create",element:f(vn,{guards:[Rt("create_payment")],component:f(O9t,{})})}),N(ge,{path:":id",element:f(vn,{guards:[si(Rt("edit_payment"),Ys("/api/v1/payments/:id"))],component:f(rX,{})}),children:[f(ge,{path:"apply",element:f(B9t,{})}),f(ge,{path:"refund",element:f($9t,{})})]}),N(ge,{path:":id",element:f(vn,{guards:[si(Rt("view_payment"),Rt("edit_payment"),Ys("/api/v1/payments/:id"))],component:f(rX,{})}),children:[f(ge,{path:"edit",element:f(P9t,{})}),f(ge,{path:"documents",element:f(M9t,{})})]}),f(ge,{path:":id",element:f(vn,{guards:[kI()],component:f(rX,{})}),children:f(ge,{path:"payment_fields",element:f(F9t,{})})})]});/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Ls(n){return({companyUser:e})=>new Promise(t=>t(!0))}function H9t(){const n=ri();return w.useEffect(()=>{n("/settings/company_details")}),f(_t,{})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function bc(n){const e=vi(),t=Ti(),i=Ci(),{isCompanySettingsActive:r}=Ms();return w.useEffect(()=>{t&&(n==null?void 0:n.overwrite)===!1||r&&i(gx({object:"company",data:e}))},[e]),t}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function gi(n,e=!0){const[t]=ue();vi();const[i,r]=w.useState(e?t(n)||"":n),o=()=>{let s="";return s="Invoice Ninja",`${s}: ${i}`};return w.useEffect(()=>{document.title=o()},[i]),{documentTitle:i,setDocumentTitle:r}}function W9t(n){const[e]=ue(),{entity:t}=n||{};return(i,r)=>i==="id"&&t==="client"?N("div",{className:"inline-flex flex-col justify-center",children:[N("div",{className:"flex items-center space-x-2",children:[N("span",{children:[e("clients_limit"),"!"]}),N(Ii,{className:"underline",to:"/settings/account_management",children:[e("unlock_unlimited_clients"),"!"]})]}),f("span",{children:r})]}):r}function z9t(n){const{entity:e,withoutTopMessage:t,withoutListBullets:i}=n,r=W9t({entity:e});return N(bs,{className:"mb-6",type:"danger",children:[!t&&f("p",{children:n.errors.message}),f("ul",{children:Object.keys(n.errors.errors).map((o,s)=>N("li",{children:[!i&&f(_t,{children:" "}),r(o,n.errors.errors[o])]},s))})]})}function ghr(n){return bn({tag:"svg",attr:{viewBox:"0 0 496 512"},child:[{tag:"path",attr:{d:"M131.5 217.5L55.1 100.1c47.6-59.2 119-91.8 192-92.1 42.3-.3 85.5 10.5 124.8 33.2 43.4 25.2 76.4 61.4 97.4 103L264 133.4c-58.1-3.4-113.4 29.3-132.5 84.1zm32.9 38.5c0 46.2 37.4 83.6 83.6 83.6s83.6-37.4 83.6-83.6-37.4-83.6-83.6-83.6-83.6 37.3-83.6 83.6zm314.9-89.2L339.6 174c37.9 44.3 38.5 108.2 6.6 157.2L234.1 503.6c46.5 2.5 94.4-7.7 137.8-32.9 107.4-62 150.9-192 107.4-303.9zM133.7 303.6L40.4 120.1C14.9 159.1 0 205.9 0 256c0 124 90.8 226.7 209.5 244.9l63.7-124.8c-57.6 10.8-113.2-20.8-139.5-72.5z"}}]})(n)}function j9t(n){return bn({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M480 128V96h20c6.627 0 12-5.373 12-12V44c0-6.627-5.373-12-12-12h-40c-6.627 0-12 5.373-12 12v20H64V44c0-6.627-5.373-12-12-12H12C5.373 32 0 37.373 0 44v40c0 6.627 5.373 12 12 12h20v320H12c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-20h384v20c0 6.627 5.373 12 12 12h40c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-20V128zM96 276V140c0-6.627 5.373-12 12-12h168c6.627 0 12 5.373 12 12v136c0 6.627-5.373 12-12 12H108c-6.627 0-12-5.373-12-12zm320 96c0 6.627-5.373 12-12 12H236c-6.627 0-12-5.373-12-12v-52h72c13.255 0 24-10.745 24-24v-72h84c6.627 0 12 5.373 12 12v136z"}}]})(n)}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function $8e(){const n=Ci();return()=>{n(Bde("company")),n(x3({status:{name:"",level:"company"}}))}}const hke=Ea(E0)`
color: ${n=>n.theme.color};
background-color: ${n=>n.theme.backgroundColor};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function $i(n){const[e]=ue(),[t,i]=Mo(Ss),r=vge(),o=$8e(),{isGroupSettingsActive:s,isClientSettingsActive:a}=Ms(),l=ol(),c=ri(),u=l.pathname.split("/")[2],{basic:d,advanced:h}=z5t();w.useEffect(()=>{i(void 0)},[u]);const g=Vn();return f(oA,{onSaveClick:n.onSaveClick,onCancelClick:n.onCancelClick,title:n.title,docsLink:n.docsLink,navigationTopRight:n.navigationTopRight,disableSaveButton:n.disableSaveButton,breadcrumbs:[],children:N("div",{className:"grid grid-cols-12 lg:gap-10",children:[N("div",{className:"col-span-12 lg:col-span-3",children:[(s||a)&&N("div",{className:"flex items-center justify-between border py-3 rounded space-x-3 px-2",style:{backgroundColor:g.$1,borderColor:g.$5},children:[N("div",{className:"flex items-center space-x-2 flex-1 min-w-0",children:[f("div",{children:f(Ve,{element:s?j9t:N5e,size:20})}),N("span",{className:"text-sm truncate",children:[e(s?"group_settings":"client_settings"),": ",r.name]})]}),f("div",{className:"cursor-pointer",onClick:()=>{o(),s&&c("/settings/group_settings"),a&&c("/clients")},children:f(Ve,{element:f0,size:20})})]}),f("a",{className:"flex items-center py-4 px-3 text-xs uppercase font-medium",children:f("span",{className:"truncate",children:e("basic_settings")})}),f(nn,{className:"lg:hidden",value:l.pathname,onValueChange:p=>c(p),withBlank:!0,children:d.map(p=>p.enabled&&f("option",{value:p.href,children:p.name},p.name))}),f("nav",{className:"space-y-1 hidden lg:block","aria-label":"Sidebar",children:d.map(p=>p.enabled&&f(hke,{to:p.href,className:PY("flex items-center px-3 py-2 text-sm font-medium rounded"),"aria-current":p.current?"page":void 0,theme:{backgroundColor:p.current?g.$5:"",color:p.current?g.$3:"",hoverColor:g.$5},children:f("span",{className:"truncate",children:p.name})},p.name))}),h.filter(p=>p.enabled).length>0&&N("div",{className:"flex items-center py-4 px-3 text-xs uppercase font-medium mt-8 truncate space-x-1",children:[f("span",{children:e("advanced_settings")}),f("sup",{children:e("pro")})]}),f(nn,{className:"lg:hidden",value:l.pathname,onValueChange:p=>c(p),withBlank:!0,children:h.map(p=>p.enabled&&f("option",{value:p.href,children:p.name},p.name))}),f("nav",{className:"space-y-1 hidden lg:block","aria-label":"Sidebar",children:h.map((p,m)=>N("div",{children:[p.enabled&&f(hke,{to:p.href,className:PY("flex items-center px-3 py-2 text-sm font-medium rounded"),"aria-current":p.current?"page":void 0,theme:{backgroundColor:p.current?g.$5:"",color:p.current?g.$3:"",hoverColor:g.$5},children:f("span",{className:"truncate",children:p.name})},p.name),p.children&&p.current&&f("div",{className:"bg-gray-100 space-y-4 py-3 rounded-b",children:p.children&&p.children.map((_,v)=>f(E0,{to:_.href,className:PY(_.current?"text-gray-900 font-semibold":"","ml-4 px-3 text-sm block text-gray-700 hover:text-gray-900 transition duration-200 ease-in-out"),children:_.name},v))})]},m))})]}),N("div",{className:"col-span-12 lg:col-start-4 space-y-6 mt-5",children:[n.breadcrumbs&&f(Tfe,{pages:n.breadcrumbs}),t&&f(z9t,{errors:t}),n.children]})]})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const kk=po(void 0);/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function vf(){const n=Ci(),{isCompanySettingsActive:e,isGroupSettingsActive:t,isClientSettingsActive:i}=Ms(),r=ki(kk);return()=>{e&&n(Bde("company")),(t||i)&&r&&n(Vr({object:"company",property:"settings",value:r.settings}))}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const Tj=po(!1);/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const V8e={industry_id:"",size_id:"",lock_invoices:"",show_all_tasks_client_portal:"",portal_design_id:"",timezone_id:"",date_format_id:"",language_id:"",company_gateway_ids:"",currency_id:"",custom_value1:"",custom_value2:"",custom_value3:"",custom_value4:"",default_task_rate:0,payment_terms:"",custom_message_dashboard:"",custom_message_unpaid_invoice:"",custom_message_paid_invoice:"",custom_message_unapproved_quote:"",entity_send_time:0,quote_footer:"",counter_number_applied:"",quote_number_applied:"",invoice_number_pattern:"",invoice_number_counter:0,recurring_invoice_number_pattern:"",recurring_invoice_number_counter:0,quote_number_pattern:"",quote_number_counter:0,client_number_pattern:"",client_number_counter:0,credit_number_pattern:"",credit_number_counter:0,task_number_pattern:"",task_number_counter:0,expense_number_pattern:"",expense_number_counter:0,recurring_expense_number_pattern:"",recurring_expense_number_counter:0,recurring_quote_number_pattern:"",recurring_quote_number_counter:0,vendor_number_pattern:"",vendor_number_counter:0,ticket_number_pattern:"",ticket_number_counter:0,payment_number_pattern:"",payment_number_counter:0,project_number_pattern:"",project_number_counter:0,postmark_secret:"",mailgun_secret:"",mailgun_domain:"",mailgun_endpoint:"",purchase_order_number_pattern:"",purchase_order_number_counter:0,recurring_number_prefix:"",reset_counter_frequency_id:0,reset_counter_date:"",counter_padding:0,auto_bill:"",auto_bill_date:"",invoice_terms:"",quote_terms:"",invoice_taxes:0,invoice_design_id:"",quote_design_id:"",credit_design_id:"",purchase_order_design_id:"",purchase_order_footer:"",purchase_order_terms:"",purchase_order_public_notes:"",invoice_footer:"",credit_footer:"",credit_terms:"",invoice_labels:"",tax_name1:"",tax_rate1:0,tax_name2:"",tax_rate2:0,tax_name3:"",tax_rate3:0,payment_type_id:"",valid_until:"",email_sending_method:"",gmail_sending_user_id:"",reply_to_email:"",reply_to_name:"",bcc_email:"",email_style:"",email_style_custom:"",email_subject_invoice:"",email_subject_quote:"",email_subject_credit:"",email_subject_payment:"",email_subject_payment_partial:"",email_subject_statement:"",email_subject_purchase_order:"",email_template_purchase_order:"",email_template_invoice:"",email_template_credit:"",email_template_quote:"",email_template_payment:"",email_template_payment_partial:"",email_template_statement:"",email_subject_reminder1:"",email_subject_reminder2:"",email_subject_reminder3:"",email_subject_reminder_endless:"",email_template_reminder1:"",email_template_reminder2:"",email_template_reminder3:"",email_template_reminder_endless:"",email_signature:"",email_subject_custom1:"",email_subject_custom2:"",email_subject_custom3:"",email_template_custom1:"",email_template_custom2:"",email_template_custom3:"",num_days_reminder1:0,num_days_reminder2:0,num_days_reminder3:0,schedule_reminder1:"",schedule_reminder2:"",schedule_reminder3:"",reminder_send_time:0,late_fee_amount1:0,late_fee_amount2:0,late_fee_amount3:0,late_fee_percent1:0,late_fee_percent2:0,late_fee_percent3:0,endless_reminder_frequency_id:"",late_fee_endless_amount:0,late_fee_endless_percent:0,name:"",company_logo:"",website:"",address1:"",address2:"",city:"",state:"",postal_code:"",phone:"",email:"",country_id:"",vat_number:"",id_number:"",page_size:"",page_layout:"",font_size:0,primary_font:"",secondary_font:"",primary_color:"",secondary_color:"",page_numbering_alignment:"",portal_custom_head:"",portal_custom_css:"",portal_custom_footer:"",portal_custom_js:"",client_portal_terms:"",client_portal_privacy_policy:"",client_portal_under_payment_minimum:0,use_credits_payment:"",email_from_name:"",first_month_of_year:"",qr_iban:"",besr_id:"",company_logo_size:"",client_initiated_payments_minimum:0,e_invoice_type:"",default_expense_payment_type_id:"",classification:"",e_quote_type:"",brevo_secret:""};/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function H8e(n){const{id:e}=Fa(),t=Kr(),i=Ci(),r=Ti(),o=ki(kk),s=ki(Hc),{isGroupSettingsActive:a}=Ms(),{groupSettings:l,setErrors:c,setIsFormBusy:u,isFormBusy:d}=n,h=()=>{const g=Bn.cloneDeep(r==null?void 0:r.settings);return g&&((!g.email_template_custom1||!g.email_subject_custom1)&&(delete g.email_template_custom1,delete g.email_subject_custom1),(!g.email_template_custom2||!g.email_subject_custom2)&&(delete g.email_template_custom2,delete g.email_subject_custom2),(!g.email_template_custom3||!g.email_subject_custom3)&&(delete g.email_template_custom3,delete g.email_subject_custom3),Object.entries(g).forEach(([p,m])=>{m===null&&(g[p]=V8e[p])})),{...o,settings:g}};return()=>{d||(ie.processing(),c==null||c(void 0),u==null||u(!0),Te("PUT",ye("/api/v1/group_settings/:id",{id:e||(o==null?void 0:o.id)}),l||h()).then(g=>{ie.success("updated_group"),hn(["group_settings"]),a&&(i(Vr({object:"company",property:"settings",value:g.data.data.settings})),i(x3({status:{name:g.data.data.name,level:"group"}}))),s&&t.invalidateQueries([s])}).catch(g=>{var p;((p=g.response)==null?void 0:p.status)===422&&(ie.dismiss(),c==null||c(g.response.data))}).finally(()=>u==null?void 0:u(!1)))}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function U9t(){const n=Ci(),e=Ti(),t=ki(kk),i=Ri(Ss),r=()=>{const o=Bn.cloneDeep(e==null?void 0:e.settings);return o&&((!o.email_template_custom1||!o.email_subject_custom1)&&(delete o.email_template_custom1,delete o.email_subject_custom1),(!o.email_template_custom2||!o.email_subject_custom2)&&(delete o.email_template_custom2,delete o.email_subject_custom2),(!o.email_template_custom3||!o.email_subject_custom3)&&(delete o.email_template_custom3,delete o.email_subject_custom3),Object.entries(o).forEach(([s,a])=>{a===null&&(o[s]=V8e[s])})),{...t,settings:o}};return()=>{ie.processing(),i(void 0),Te("PUT",ye("/api/v1/clients/:id",{id:t==null?void 0:t.id}),r()).then(o=>{ie.success("updated_settings"),hn(["clients"]),n(Vr({object:"company",property:"settings",value:o.data.data.settings})),n(x3({status:{name:o.data.data.display_name,level:"client"}}))}).catch(o=>{var s;((s=o.response)==null?void 0:s.status)===422&&(ie.dismiss(),i(o.response.data))})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function pu(){const n=Ci(),e=bc(),t=H8e({}),i=U9t(),{isGroupSettingsActive:r,isCompanySettingsActive:o,isClientSettingsActive:s}=Ms(),[,a]=Mo(Ss),[l,c]=Mo(Tj),u=Cct();return async d=>{if(!u()&&o)return;if(r)return t();if(s)return i();const h=typeof d=="boolean"&&d;return!h&&ie.processing(),a(void 0),Te("PUT",ye("/api/v1/companies/:id",{id:e==null?void 0:e.id}),e).then(g=>{n(Pw({object:"company",data:g.data.data})),!h&&ie.dismiss(),l&&(hn(["statics"]),c(!1)),!h&&ie.success("updated_settings")}).catch(g=>{var p;((p=g.response)==null?void 0:p.status)===422&&(a(g.response.data),ie.dismiss())})}}function Vw(n){var g;const e=ri(),{visible:t=!0,withoutDefaultTabSpace:i,tabBarClassName:r}=n,o=Fa(),s=ol(),a=Vn(),l=ys(),[c]=i3(),u=w.useRef(null),d=p=>{var m;return s.pathname===p.href||((m=p.matcher)==null?void 0:m.some(_=>_(o)===dt(s.pathname,o)))},h=p=>{const m=p.currentTarget,_=u.current,v=_.scrollWidth/6,b=m.getBoundingClientRect().width/2;_.scrollTo({left:m.offsetLeft-v-b})};return w.useEffect(()=>{if(n.tabs.length&&!n.disableBackupNavigation){const p=n.tabs.some(({href:m})=>m===s.pathname);if(c.get("redirect")==="false")return;p||e(n.tabs[0].href)}},[]),t?N("div",{className:n.className,"data-cy":"tabs",children:[N("div",{className:"flex flex-col space-y-5 sm:hidden",children:[f("label",{htmlFor:"tabs",className:"sr-only",children:"Select a tab"}),f("select",{id:"tabs",name:"tabs",className:"block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md",defaultValue:(g=n.tabs.find(p=>p))==null?void 0:g.name,children:n.tabs.map(p=>{var m;return(typeof p.enabled>"u"||p.enabled)&&f("option",{children:((m=p.formatName)==null?void 0:m.call(p))||p.name},p.name)})}),n.rightSide]}),f("div",{className:"hidden sm:block",children:N("div",{className:"flex justify-between border-b",style:{borderColor:a.$5},children:[f("nav",{ref:u,className:St("-mb-px flex relative scroll-smooth overflow-x-auto",{"space-x-8":!i},r),"aria-label":"Tabs",children:n.tabs.map(p=>{var m;return(typeof p.enabled>"u"||p.enabled)&&f(E0,{to:p.href,onClick:_=>h(_),style:{borderColor:d(p)?l:"transparent",color:d(p)?l:a.$3},className:"whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm","aria-current":d(p)?"page":void 0,children:((m=p.formatName)==null?void 0:m.call(p))||p.name},p.name)})}),n.rightSide]})})]}):f(_t,{})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function W8e(n){return ai(["/api/v1/documents",n],()=>Te("GET",ye("/api/v1/documents?per_page=:perPage&page=:currentPage&company_documents=:companyDocuments",{perPage:n.perPage,currentPage:n.currentPage,companyDocuments:n.companyDocuments??"false"})),{staleTime:1/0})}const z8e=()=>(n,e)=>{ie.processing(),Te("POST",ye("/api/v1/documents/bulk?per_page=100"),{action:e,ids:n}).then(()=>ie.success("exported_data"))},j8e=()=>async(n,e)=>(ie.processing(),Te("PUT",ye("/api/v1/documents/:id",{id:n}),{is_public:e}).then(()=>ie.success("success")));function Ege(n){const[e]=ue(),{numberOfDocuments:t}=n;return N("div",{className:"flex space-x-1",children:[f("span",{children:e("documents")}),!!t&&N("span",{className:"font-bold",children:["(",t,")"]})]})}function q9t(){const{t:n}=ue(),{data:e}=W8e({companyDocuments:"true"}),{isGroupSettingsActive:t,isClientSettingsActive:i}=Ms();let r=[{name:n("details"),href:"/settings/company_details"},{name:n("address"),href:"/settings/company_details/address"},{name:n("logo"),href:"/settings/company_details/logo"},{name:n("defaults"),href:"/settings/company_details/defaults"},{name:n("documents"),href:"/settings/company_details/documents",formatName:()=>{var o;return f(Ege,{numberOfDocuments:(o=e==null?void 0:e.data)==null?void 0:o.meta.pagination.total})}},{name:n("custom_fields"),href:"/settings/company_details/custom_fields"}];return(t||i)&&(r=r.filter(o=>o.name!==n("custom_fields")&&o.name!==n("documents"))),r}function K9t(){const[n]=ue();gi("company_details");const e=[{name:n("settings"),href:"/settings"},{name:n("company_details"),href:"/settings/company_details"}],t=pu(),i=vf(),r=q9t();return bc(),N($i,{onSaveClick:t,onCancelClick:i,title:n("company_details"),breadcrumbs:e,docsLink:"en/basic-settings/#company_details",children:[f(Vw,{tabs:r,className:"mt-6"}),f("div",{className:"my-4",children:f(ah,{})})]})}function sA(){return(sA=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n}).apply(this,arguments)}function Ij(n,e){if(n==null)return{};var t,i,r={},o=Object.keys(n);for(i=0;i<o.length;i++)e.indexOf(t=o[i])>=0||(r[t]=n[t]);return r}function YP(n){var e=w.useRef(n),t=w.useRef(function(i){e.current&&e.current(i)});return e.current=n,t.current}var QP=function(n,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),n>t?t:n<e?e:n},mO=function(n){return"touches"in n},Bie=function(n){return n&&n.ownerDocument.defaultView||self},fke=function(n,e,t){var i=n.getBoundingClientRect(),r=mO(e)?function(o,s){for(var a=0;a<o.length;a++)if(o[a].identifier===s)return o[a];return o[0]}(e.touches,t):e;return{left:QP((r.pageX-(i.left+Bie(n).pageXOffset))/i.width),top:QP((r.pageY-(i.top+Bie(n).pageYOffset))/i.height)}},gke=function(n){!mO(n)&&n.preventDefault()},U8e=te.memo(function(n){var e=n.onMove,t=n.onKey,i=Ij(n,["onMove","onKey"]),r=w.useRef(null),o=YP(e),s=YP(t),a=w.useRef(null),l=w.useRef(!1),c=w.useMemo(function(){var g=function(_){gke(_),(mO(_)?_.touches.length>0:_.buttons>0)&&r.current?o(fke(r.current,_,a.current)):m(!1)},p=function(){return m(!1)};function m(_){var v=l.current,b=Bie(r.current),y=_?b.addEventListener:b.removeEventListener;y(v?"touchmove":"mousemove",g),y(v?"touchend":"mouseup",p)}return[function(_){var v=_.nativeEvent,b=r.current;if(b&&(gke(v),!function(C,x){return x&&!mO(C)}(v,l.current)&&b)){if(mO(v)){l.current=!0;var y=v.changedTouches||[];y.length&&(a.current=y[0].identifier)}b.focus(),o(fke(b,v,a.current)),m(!0)}},function(_){var v=_.which||_.keyCode;v<37||v>40||(_.preventDefault(),s({left:v===39?.05:v===37?-.05:0,top:v===40?.05:v===38?-.05:0}))},m]},[s,o]),u=c[0],d=c[1],h=c[2];return w.useEffect(function(){return h},[h]),te.createElement("div",sA({},i,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:r,onKeyDown:d,tabIndex:0,role:"slider"}))}),xge=function(n){return n.filter(Boolean).join(" ")},q8e=function(n){var e=n.color,t=n.left,i=n.top,r=i===void 0?.5:i,o=xge(["react-colorful__pointer",n.className]);return te.createElement("div",{className:o,style:{top:100*r+"%",left:100*t+"%"}},te.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},Fu=function(n,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*n)/t},G9t=function(n){return J9t($ie(n))},$ie=function(n){return n[0]==="#"&&(n=n.substring(1)),n.length<6?{r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:n.length===4?Fu(parseInt(n[3]+n[3],16)/255,2):1}:{r:parseInt(n.substring(0,2),16),g:parseInt(n.substring(2,4),16),b:parseInt(n.substring(4,6),16),a:n.length===8?Fu(parseInt(n.substring(6,8),16)/255,2):1}},Y9t=function(n){return Z9t(X9t(n))},Q9t=function(n){var e=n.s,t=n.v,i=n.a,r=(200-e)*t/100;return{h:Fu(n.h),s:Fu(r>0&&r<200?e*t/100/(r<=100?r:200-r)*100:0),l:Fu(r/2),a:Fu(i,2)}},Vie=function(n){var e=Q9t(n);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},X9t=function(n){var e=n.h,t=n.s,i=n.v,r=n.a;e=e/360*6,t/=100,i/=100;var o=Math.floor(e),s=i*(1-t),a=i*(1-(e-o)*t),l=i*(1-(1-e+o)*t),c=o%6;return{r:Fu(255*[i,a,s,s,l,i][c]),g:Fu(255*[l,i,i,a,s,s][c]),b:Fu(255*[s,s,l,i,i,a][c]),a:Fu(r,2)}},V6=function(n){var e=n.toString(16);return e.length<2?"0"+e:e},Z9t=function(n){var e=n.r,t=n.g,i=n.b,r=n.a,o=r<1?V6(Fu(255*r)):"";return"#"+V6(e)+V6(t)+V6(i)+o},J9t=function(n){var e=n.r,t=n.g,i=n.b,r=n.a,o=Math.max(e,t,i),s=o-Math.min(e,t,i),a=s?o===e?(t-i)/s:o===t?2+(i-e)/s:4+(e-t)/s:0;return{h:Fu(60*(a<0?a+6:a)),s:Fu(o?s/o*100:0),v:Fu(o/255*100),a:r}},e7t=te.memo(function(n){var e=n.hue,t=n.onChange,i=xge(["react-colorful__hue",n.className]);return te.createElement("div",{className:i},te.createElement(U8e,{onMove:function(r){t({h:360*r.left})},onKey:function(r){t({h:QP(e+360*r.left,0,360)})},"aria-label":"Hue","aria-valuenow":Fu(e),"aria-valuemax":"360","aria-valuemin":"0"},te.createElement(q8e,{className:"react-colorful__hue-pointer",left:e/360,color:Vie({h:e,s:100,v:100,a:1})})))}),t7t=te.memo(function(n){var e=n.hsva,t=n.onChange,i={backgroundColor:Vie({h:e.h,s:100,v:100,a:1})};return te.createElement("div",{className:"react-colorful__saturation",style:i},te.createElement(U8e,{onMove:function(r){t({s:100*r.left,v:100-100*r.top})},onKey:function(r){t({s:QP(e.s+100*r.left,0,100),v:QP(e.v-100*r.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Fu(e.s)+"%, Brightness "+Fu(e.v)+"%"},te.createElement(q8e,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:Vie(e)})))}),K8e=function(n,e){if(n===e)return!0;for(var t in n)if(n[t]!==e[t])return!1;return!0},n7t=function(n,e){return n.toLowerCase()===e.toLowerCase()||K8e($ie(n),$ie(e))};function i7t(n,e,t){var i=YP(t),r=w.useState(function(){return n.toHsva(e)}),o=r[0],s=r[1],a=w.useRef({color:e,hsva:o});w.useEffect(function(){if(!n.equal(e,a.current.color)){var c=n.toHsva(e);a.current={hsva:c,color:e},s(c)}},[e,n]),w.useEffect(function(){var c;K8e(o,a.current.hsva)||n.equal(c=n.fromHsva(o),a.current.color)||(a.current={hsva:o,color:c},i(c))},[o,n,i]);var l=w.useCallback(function(c){s(function(u){return Object.assign({},u,c)})},[]);return[o,l]}var r7t=typeof window<"u"?w.useLayoutEffect:w.useEffect,o7t=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},pke=new Map,s7t=function(n){r7t(function(){var e=n.current?n.current.ownerDocument:document;if(e!==void 0&&!pke.has(e)){var t=e.createElement("style");t.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,pke.set(e,t);var i=o7t();i&&t.setAttribute("nonce",i),e.head.appendChild(t)}},[])},a7t=function(n){var e=n.className,t=n.colorModel,i=n.color,r=i===void 0?t.defaultColor:i,o=n.onChange,s=Ij(n,["className","colorModel","color","onChange"]),a=w.useRef(null);s7t(a);var l=i7t(t,r,o),c=l[0],u=l[1],d=xge(["react-colorful",e]);return te.createElement("div",sA({},s,{ref:a,className:d}),te.createElement(t7t,{hsva:c,onChange:u}),te.createElement(e7t,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},l7t={defaultColor:"000",toHsva:G9t,fromHsva:function(n){return Y9t({h:n.h,s:n.s,v:n.v,a:1})},equal:n7t},c7t=function(n){return te.createElement(a7t,sA({},n,{colorModel:l7t}))},u7t=/^#?([0-9A-F]{3,8})$/i,d7t=function(n){var e=n.color,t=e===void 0?"":e,i=n.onChange,r=n.onBlur,o=n.escape,s=n.validate,a=n.format,l=n.process,c=Ij(n,["color","onChange","onBlur","escape","validate","format","process"]),u=w.useState(function(){return o(t)}),d=u[0],h=u[1],g=YP(i),p=YP(r),m=w.useCallback(function(v){var b=o(v.target.value);h(b),s(b)&&g(l?l(b):b)},[o,l,s,g]),_=w.useCallback(function(v){s(v.target.value)||h(o(t)),p(v)},[t,o,s,p]);return w.useEffect(function(){h(o(t))},[t,o]),te.createElement("input",sA({},c,{value:a?a(d):d,spellCheck:"false",onChange:m,onBlur:_}))},mke=function(n){return"#"+n},h7t=function(n){var e=n.prefixed,t=n.alpha,i=Ij(n,["prefixed","alpha"]),r=w.useCallback(function(s){return s.replace(/([^0-9A-F]+)/gi,"").substring(0,t?8:6)},[t]),o=w.useCallback(function(s){return function(a,l){var c=u7t.exec(a),u=c?c[1].length:0;return u===3||u===6||!!l&&u===4||!!l&&u===8}(s,t)},[t]);return te.createElement(d7t,sA({},i,{escape:r,format:e?mke:void 0,process:mke,validate:o}))};const f7t=["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2f7dc3","#2196f3","#03a9f4","#00bcd4","#009688","#4caf50","#8bc34a","#ff9800","#ff5722","#795548","#9e9e9e","#607d8b","#616161","#000000","#57a6e4","#324da1","#4c9a1c","#cd8900","#b93700"];function Tk(n){const{t:e}=ue(),{includeDefaultPalette:t}=n,i=Vn(),[r,o]=w.useState(n.value||"#000000"),[s,a]=w.useState(!1),[l,c]=w.useState(!1);return Hfe(()=>{var u;return(u=n.onValueChange)==null?void 0:u.call(n,r)},500,[r]),w.useEffect(()=>{n.value&&o(n.value)},[n.value]),N("div",{children:[N(cr,{title:e("color"),visible:s,onClose:a,centerContent:!0,disableClosing:l,children:[f(c7t,{color:r,onChange:o}),f(h7t,{color:r,onChange:o,className:"border rounded-md my-2 p-2 border-gray-300",style:{backgroundColor:i.$1,borderColor:i.$4}}),N("div",{className:"flex w-full justify-between",children:[t&&f(Ut,{behavior:"button",type:"secondary",onClick:()=>c(!0),children:e("default")}),f(Ut,{className:St({"w-full":!t}),behavior:"button",onClick:()=>a(!1),children:e("done")})]})]}),f(cr,{title:e("default"),visible:l,size:"small",onClose:()=>c(!1),children:N("div",{className:"flex flex-col space-y-6",children:[f("div",{className:"grid grid-cols-6 gap-x-2 gap-y-2",children:f7t.map(u=>f("div",{className:"relative cursor-pointer w-full hover:opacity-75",onClick:()=>o(u),style:{height:32,backgroundColor:u},children:r===u&&f(Ve,{className:"absolute",element:Yhe,color:"white",size:25,style:{top:"0.3rem",left:"1.45rem"}})},u))}),f("div",{className:"flex justify-end",children:f(Ut,{behavior:"button",onClick:()=>c(!1),children:e("done")})})]})}),f("div",{style:{backgroundColor:r},className:St("w-16 h-6 shadow rounded-md",{"opacity-75 cursor-not-allowed":n.disabled,"cursor-pointer":typeof n.disabled>"u"||!n.disabled}),onClick:()=>(!n.disabled||typeof n.disabled>"u")&&a(!0)})]})}function g7t(){var i,r;const[n]=ue(),e=Ci(),t=Tl(o=>o.user.changes);return f(Ot,{title:n("accent_color"),children:f(U,{leftSide:n("accent_color"),children:f(Tk,{value:((r=(i=t==null?void 0:t.company_user)==null?void 0:i.settings)==null?void 0:r.accent_color)||Q3e.primary,onValueChange:o=>e(gk({property:"company_user.settings.accent_color",value:o}))})})})}const p7t=w.createContext(null);function m7t(){const n=w.useContext(p7t);if(!n)throw new Error("Google OAuth components must be used within GoogleOAuthProvider");return n}function _7t(n){var e;return(e=n==null?void 0:n.clientId)!==null&&e!==void 0?e:n==null?void 0:n.client_id}const v7t={large:40,medium:32,small:20};function G8e({onSuccess:n,onError:e,useOneTap:t,promptMomentNotification:i,type:r="standard",theme:o="outline",size:s="large",text:a,shape:l,logo_alignment:c,width:u,locale:d,click_listener:h,containerProps:g,...p}){const m=w.useRef(null),{clientId:_,scriptLoadedSuccessfully:v}=m7t(),b=w.useRef(n);b.current=n;const y=w.useRef(e);y.current=e;const C=w.useRef(i);return C.current=i,w.useEffect(()=>{var x,k,I,L,D,R,P,M,O;if(v)return(I=(k=(x=window==null?void 0:window.google)===null||x===void 0?void 0:x.accounts)===null||k===void 0?void 0:k.id)===null||I===void 0||I.initialize({client_id:_,callback:B=>{var F;if(!(B!=null&&B.credential))return(F=y.current)===null||F===void 0?void 0:F.call(y);const{credential:H,select_by:V}=B;b.current({credential:H,clientId:_7t(B),select_by:V})},...p}),(R=(D=(L=window==null?void 0:window.google)===null||L===void 0?void 0:L.accounts)===null||D===void 0?void 0:D.id)===null||R===void 0||R.renderButton(m.current,{type:r,theme:o,size:s,text:a,shape:l,logo_alignment:c,width:u,locale:d,click_listener:h}),t&&((O=(M=(P=window==null?void 0:window.google)===null||P===void 0?void 0:P.accounts)===null||M===void 0?void 0:M.id)===null||O===void 0||O.prompt(C.current)),()=>{var B,F,H;t&&((H=(F=(B=window==null?void 0:window.google)===null||B===void 0?void 0:B.accounts)===null||F===void 0?void 0:F.id)===null||H===void 0||H.cancel())}},[_,v,t,r,o,s,a,l,c,u,d]),te.createElement("div",{...g,ref:m,style:{height:v7t[s],...g==null?void 0:g.style}})}/*! @azure/msal-common v14.3.0 2023-10-30 */const st={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",CACHE_PREFIX:"msal",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_RESPONSE_TYPE:"code",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",FRAGMENT_RESPONSE_MODE:"fragment",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",REGIONAL_AUTH_NON_MSI_QUERY_STRING:"allowestsrnonmsi=true",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],TOKEN_RESPONSE_TYPE:"token",ID_TOKEN_RESPONSE_TYPE:"id_token",SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},H6={SUCCESS_RANGE_START:200,SUCCESS_RANGE_END:299,REDIRECT:302,CLIENT_ERROR_RANGE_START:400,CLIENT_ERROR_RANGE_END:499,SERVER_ERROR_RANGE_START:500,SERVER_ERROR_RANGE_END:599},j3=[st.OPENID_SCOPE,st.PROFILE_SCOPE,st.OFFLINE_ACCESS_SCOPE],_ke=[...j3,st.EMAIL_SCOPE],Lv={CONTENT_TYPE:"Content-Type",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},bu={ID_TOKEN:"idtoken",CLIENT_INFO:"client.info",ADAL_ID_TOKEN:"adal.idtoken",ERROR:"error",ERROR_DESC:"error.description",ACTIVE_ACCOUNT:"active-account",ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},_O={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},mr={CLIENT_ID:"client_id",REDIRECT_URI:"redirect_uri",RESPONSE_TYPE:"response_type",RESPONSE_MODE:"response_mode",GRANT_TYPE:"grant_type",CLAIMS:"claims",SCOPE:"scope",ERROR:"error",ERROR_DESCRIPTION:"error_description",ACCESS_TOKEN:"access_token",ID_TOKEN:"id_token",REFRESH_TOKEN:"refresh_token",EXPIRES_IN:"expires_in",STATE:"state",NONCE:"nonce",PROMPT:"prompt",SESSION_STATE:"session_state",CLIENT_INFO:"client_info",CODE:"code",CODE_CHALLENGE:"code_challenge",CODE_CHALLENGE_METHOD:"code_challenge_method",CODE_VERIFIER:"code_verifier",CLIENT_REQUEST_ID:"client-request-id",X_CLIENT_SKU:"x-client-SKU",X_CLIENT_VER:"x-client-VER",X_CLIENT_OS:"x-client-OS",X_CLIENT_CPU:"x-client-CPU",X_CLIENT_CURR_TELEM:"x-client-current-telemetry",X_CLIENT_LAST_TELEM:"x-client-last-telemetry",X_MS_LIB_CAPABILITY:"x-ms-lib-capability",X_APP_NAME:"x-app-name",X_APP_VER:"x-app-ver",POST_LOGOUT_URI:"post_logout_redirect_uri",ID_TOKEN_HINT:"id_token_hint",DEVICE_CODE:"device_code",CLIENT_SECRET:"client_secret",CLIENT_ASSERTION:"client_assertion",CLIENT_ASSERTION_TYPE:"client_assertion_type",TOKEN_TYPE:"token_type",REQ_CNF:"req_cnf",OBO_ASSERTION:"assertion",REQUESTED_TOKEN_USE:"requested_token_use",ON_BEHALF_OF:"on_behalf_of",FOCI:"foci",CCS_HEADER:"X-AnchorMailbox",RETURN_SPA_CODE:"return_spa_code",NATIVE_BROKER:"nativebroker",LOGOUT_HINT:"logout_hint"},W6={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},Ed={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},oX={ACCOUNT:"account",SID:"sid",LOGIN_HINT:"login_hint",ID_TOKEN:"id_token",DOMAIN_HINT:"domain_hint",ORGANIZATIONS:"organizations",CONSUMERS:"consumers",ACCOUNT_ID:"accountIdentifier",HOMEACCOUNT_ID:"homeAccountIdentifier"},vke={PLAIN:"plain",S256:"S256"},U3={QUERY:"query",FRAGMENT:"fragment"},b7t={...U3,FORM_POST:"form_post"},Y8e={IMPLICIT_GRANT:"implicit",AUTHORIZATION_CODE_GRANT:"authorization_code",CLIENT_CREDENTIALS_GRANT:"client_credentials",RESOURCE_OWNER_PASSWORD_GRANT:"password",REFRESH_TOKEN_GRANT:"refresh_token",DEVICE_CODE_GRANT:"device_code",JWT_BEARER:"urn:ietf:params:oauth:grant-type:jwt-bearer"},z6={MSSTS_ACCOUNT_TYPE:"MSSTS",ADFS_ACCOUNT_TYPE:"ADFS",MSAV1_ACCOUNT_TYPE:"MSA",GENERIC_ACCOUNT_TYPE:"Generic"},Du={CACHE_KEY_SEPARATOR:"-",CLIENT_INFO_SEPARATOR:"."},dr={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},Hie="appmetadata",y7t="client_info",vO="1",bO={CACHE_KEY:"authority-metadata",REFRESH_TIME_SECONDS:3600*24},$f={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},Cu={SCHEMA_VERSION:5,MAX_CUR_HEADER_BYTES:80,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},Us={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},yO={DEFAULT_THROTTLE_TIME_SECONDS:60,DEFAULT_MAX_THROTTLE_TIME_SECONDS:3600,THROTTLING_PREFIX:"throttling",X_MS_LIB_CAPABILITY_VALUE:"retry-after, h429"},bke={INVALID_GRANT_ERROR:"invalid_grant",CLIENT_MISMATCH_ERROR:"client_mismatch"},yke={username:"username",password:"password"},j6={httpSuccess:200,httpBadRequest:400},xT={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},sX={CONFIGURED_MATCHES_DETECTED:"1",CONFIGURED_NO_AUTO_DETECTION:"2",CONFIGURED_NOT_DETECTED:"3",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},HS={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},C7t={Jwt:"JWT",Jwk:"JWK",Pop:"pop"};/*! @azure/msal-common v14.3.0 2023-10-30 */const kge="unexpected_error",w7t="post_request_failed";/*! @azure/msal-common v14.3.0 2023-10-30 */const Cke={[kge]:"Unexpected error in authentication.",[w7t]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."};class il extends Error{constructor(e,t,i){const r=t?`${e}: ${t}`:e;super(r),Object.setPrototypeOf(this,il.prototype),this.errorCode=e||st.EMPTY_STRING,this.errorMessage=t||st.EMPTY_STRING,this.subError=i||st.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function Q8e(n,e){return new il(n,e?`${Cke[n]} ${e}`:Cke[n])}/*! @azure/msal-common v14.3.0 2023-10-30 */const Tge="client_info_decoding_error",X8e="client_info_empty_error",Ige="token_parsing_error",Z8e="null_or_empty_token",ly="endpoints_resolution_error",J8e="network_error",e9e="openid_config_error",Wie="hash_not_deserialized",LD="invalid_state",t9e="state_mismatch",z7="state_not_found",n9e="nonce_mismatch",Lge="auth_time_not_found",i9e="max_age_transpired",S7t="multiple_matching_tokens",E7t="multiple_matching_accounts",r9e="multiple_matching_appMetadata",o9e="request_cannot_be_made",s9e="cannot_remove_empty_scope",a9e="cannot_append_scopeset",zie="empty_input_scopeset",x7t="device_code_polling_cancelled",k7t="device_code_expired",T7t="device_code_unknown_error",Dge="no_account_in_silent_request",l9e="invalid_cache_record",Age="invalid_cache_environment",jie="no_account_found",Uie="no_crypto_object",qie="unexpected_credential_type",I7t="invalid_assertion",L7t="invalid_client_credential",U1="token_refresh_required",D7t="user_timeout_reached",c9e="token_claims_cnf_required_for_signedjwt",u9e="authorization_code_missing_from_server_response",d9e="binding_key_not_removed",h9e="end_session_endpoint_not_supported",Rge="key_id_missing",A7t="no_network_connectivity",R7t="user_canceled",N7t="missing_tenant_id_error",ho="method_not_implemented",O7t="nested_app_auth_bridge_disabled";/*! @azure/msal-common v14.3.0 2023-10-30 */const wke={[Tge]:"The client info could not be parsed/decoded correctly",[X8e]:"The client info was empty",[Ige]:"Token cannot be parsed",[Z8e]:"The token is null or empty",[ly]:"Endpoints cannot be resolved",[J8e]:"Network request failed",[e9e]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[Wie]:"The hash parameters could not be deserialized",[LD]:"State was not the expected format",[t9e]:"State mismatch error",[z7]:"State not found",[n9e]:"Nonce mismatch error",[Lge]:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information.",[i9e]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[S7t]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[E7t]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[r9e]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[o9e]:"Token request cannot be made without authorization code or refresh token.",[s9e]:"Cannot remove null or empty scope from ScopeSet",[a9e]:"Cannot append ScopeSet",[zie]:"Empty input ScopeSet cannot be processed",[x7t]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[k7t]:"Device code is expired.",[T7t]:"Device code stopped polling for unknown reasons.",[Dge]:"Please pass an account object, silent flow is not supported without account information",[l9e]:"Cache record object was null or undefined.",[Age]:"Invalid environment when attempting to create cache entry",[jie]:"No account found in cache for given key.",[Uie]:"No crypto object detected.",[qie]:"Unexpected credential type.",[I7t]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[L7t]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[U1]:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",[D7t]:"User defined timeout for device code polling reached",[c9e]:"Cannot generate a POP jwt if the token_claims are not populated",[u9e]:"Server response does not contain an authorization code to proceed",[d9e]:"Could not remove the credential's binding key from storage.",[h9e]:"The provided authority does not support logout",[Rge]:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",[A7t]:"No network connectivity. Check your internet connection.",[R7t]:"User cancelled the flow.",[N7t]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[ho]:"This method has not been implemented",[O7t]:"The nested app auth bridge is disabled"};class Lj extends il{constructor(e,t){super(e,t?`${wke[e]}: ${t}`:wke[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,Lj.prototype)}}function dn(n,e){return new Lj(n,e)}/*! @azure/msal-common v14.3.0 2023-10-30 */const j7={createNewGuid:()=>{throw dn(ho)},base64Decode:()=>{throw dn(ho)},base64Encode:()=>{throw dn(ho)},async getPublicKeyThumbprint(){throw dn(ho)},async removeTokenBindingKey(){throw dn(ho)},async clearKeystore(){throw dn(ho)},async signJwt(){throw dn(ho)},async hashString(){throw dn(ho)}};/*! @azure/msal-common v14.3.0 2023-10-30 */var Qc;(function(n){n[n.Error=0]="Error",n[n.Warning=1]="Warning",n[n.Info=2]="Info",n[n.Verbose=3]="Verbose",n[n.Trace=4]="Trace"})(Qc||(Qc={}));class bx{constructor(e,t,i){this.level=Qc.Info;const r=()=>{},o=e||bx.createDefaultLoggerOptions();this.localCallback=o.loggerCallback||r,this.piiLoggingEnabled=o.piiLoggingEnabled||!1,this.level=typeof o.logLevel=="number"?o.logLevel:Qc.Info,this.correlationId=o.correlationId||st.EMPTY_STRING,this.packageName=t||st.EMPTY_STRING,this.packageVersion=i||st.EMPTY_STRING}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:Qc.Info}}clone(e,t,i){return new bx({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:i||this.correlationId},e,t)}logMessage(e,t){if(t.logLevel>this.level||!this.piiLoggingEnabled&&t.containsPii)return;const o=`${`[${new Date().toUTCString()}] : [${t.correlationId||this.correlationId||""}]`} : ${this.packageName}@${this.packageVersion} : ${Qc[t.logLevel]} - ${e}`;this.executeCallback(t.logLevel,o,t.containsPii||!1)}executeCallback(e,t,i){this.localCallback&&this.localCallback(e,t,i)}error(e,t){this.logMessage(e,{logLevel:Qc.Error,containsPii:!1,correlationId:t||st.EMPTY_STRING})}errorPii(e,t){this.logMessage(e,{logLevel:Qc.Error,containsPii:!0,correlationId:t||st.EMPTY_STRING})}warning(e,t){this.logMessage(e,{logLevel:Qc.Warning,containsPii:!1,correlationId:t||st.EMPTY_STRING})}warningPii(e,t){this.logMessage(e,{logLevel:Qc.Warning,containsPii:!0,correlationId:t||st.EMPTY_STRING})}info(e,t){this.logMessage(e,{logLevel:Qc.Info,containsPii:!1,correlationId:t||st.EMPTY_STRING})}infoPii(e,t){this.logMessage(e,{logLevel:Qc.Info,containsPii:!0,correlationId:t||st.EMPTY_STRING})}verbose(e,t){this.logMessage(e,{logLevel:Qc.Verbose,containsPii:!1,correlationId:t||st.EMPTY_STRING})}verbosePii(e,t){this.logMessage(e,{logLevel:Qc.Verbose,containsPii:!0,correlationId:t||st.EMPTY_STRING})}trace(e,t){this.logMessage(e,{logLevel:Qc.Trace,containsPii:!1,correlationId:t||st.EMPTY_STRING})}tracePii(e,t){this.logMessage(e,{logLevel:Qc.Trace,containsPii:!0,correlationId:t||st.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}/*! @azure/msal-common v14.3.0 2023-10-30 */const f9e="@azure/msal-common",Nge="14.3.0";/*! @azure/msal-common v14.3.0 2023-10-30 */const Oge={None:"none",AzurePublic:"https://login.microsoftonline.com",AzurePpe:"https://login.windows-ppe.net",AzureChina:"https://login.chinacloudapi.cn",AzureGermany:"https://login.microsoftonline.de",AzureUsGovernment:"https://login.microsoftonline.us"};/*! @azure/msal-common v14.3.0 2023-10-30 */function JC(n,e){const t=P7t(n);try{const i=e(t);return JSON.parse(i)}catch{throw dn(Ige)}}function P7t(n){if(!n)throw dn(Z8e);const t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(n);if(!t||t.length<4)throw dn(Ige);return t[2]}function g9e(n,e){if(e===0||Date.now()-3e5>n+e)throw dn(i9e)}/*! @azure/msal-common v14.3.0 2023-10-30 */class th{static nowSeconds(){return Math.round(new Date().getTime()/1e3)}static isTokenExpired(e,t){const i=Number(e)||0;return th.nowSeconds()+t>i}static wasClockTurnedBack(e){return Number(e)>th.nowSeconds()}static delay(e,t){return new Promise(i=>setTimeout(()=>i(t),e))}}/*! @azure/msal-common v14.3.0 2023-10-30 */function TI(n){return[M7t(n),F7t(n),B7t(n),$7t(n),V7t(n)].join(Du.CACHE_KEY_SEPARATOR).toLowerCase()}function Dj(n,e,t,i,r){return{credentialType:dr.ID_TOKEN,homeAccountId:n,environment:e,clientId:i,secret:t,realm:r}}function Aj(n,e,t,i,r,o,s,a,l,c,u,d,h,g,p){var _,v;const m={homeAccountId:n,credentialType:dr.ACCESS_TOKEN,secret:t,cachedAt:th.nowSeconds().toString(),expiresOn:s.toString(),extendedExpiresOn:a.toString(),environment:e,clientId:i,realm:r,target:o,tokenType:u||Us.BEARER};if(d&&(m.userAssertionHash=d),c&&(m.refreshOn=c.toString()),g&&(m.requestedClaims=g,m.requestedClaimsHash=p),((_=m.tokenType)==null?void 0:_.toLowerCase())!==Us.BEARER.toLowerCase())switch(m.credentialType=dr.ACCESS_TOKEN_WITH_AUTH_SCHEME,m.tokenType){case Us.POP:const b=JC(t,l);if(!((v=b==null?void 0:b.cnf)!=null&&v.kid))throw dn(c9e);m.keyId=b.cnf.kid;break;case Us.SSH:m.keyId=h}return m}function p9e(n,e,t,i,r,o){const s={credentialType:dr.REFRESH_TOKEN,homeAccountId:n,environment:e,clientId:i,secret:t};return o&&(s.userAssertionHash=o),r&&(s.familyId=r),s}function Pge(n){return n.hasOwnProperty("homeAccountId")&&n.hasOwnProperty("environment")&&n.hasOwnProperty("credentialType")&&n.hasOwnProperty("clientId")&&n.hasOwnProperty("secret")}function Ske(n){return n?Pge(n)&&n.hasOwnProperty("realm")&&n.hasOwnProperty("target")&&(n.credentialType===dr.ACCESS_TOKEN||n.credentialType===dr.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}function Eke(n){return n?Pge(n)&&n.hasOwnProperty("realm")&&n.credentialType===dr.ID_TOKEN:!1}function xke(n){return n?Pge(n)&&n.credentialType===dr.REFRESH_TOKEN:!1}function M7t(n){return[n.homeAccountId,n.environment].join(Du.CACHE_KEY_SEPARATOR).toLowerCase()}function F7t(n){const e=n.credentialType===dr.REFRESH_TOKEN&&n.familyId||n.clientId;return[n.credentialType,e,n.realm||""].join(Du.CACHE_KEY_SEPARATOR).toLowerCase()}function B7t(n){return(n.target||"").toLowerCase()}function $7t(n){return(n.requestedClaimsHash||"").toLowerCase()}function V7t(n){return n.tokenType&&n.tokenType.toLowerCase()!==Us.BEARER.toLowerCase()?n.tokenType.toLowerCase():""}/*! @azure/msal-common v14.3.0 2023-10-30 */const m9e="redirect_uri_empty",H7t="claims_request_parsing_error",_9e="authority_uri_insecure",bN="url_parse_error",Mge="empty_url_error",v9e="empty_input_scopes_error",b9e="invalid_prompt_value",Fge="invalid_claims",y9e="token_request_empty",C9e="logout_request_empty",w9e="invalid_code_challenge_method",Bge="pkce_params_missing",$ge="invalid_cloud_discovery_metadata",S9e="invalid_authority_metadata",E9e="untrusted_authority",Rj="missing_ssh_jwk",x9e="missing_ssh_kid",W7t="missing_nonce_authentication_header",z7t="invalid_authentication_header",k9e="cannot_set_OIDCOptions",T9e="cannot_allow_native_broker",I9e="authority_mismatch";/*! @azure/msal-common v14.3.0 2023-10-30 */const j7t={[m9e]:"A redirect URI is required for all calls, and none has been set.",[H7t]:"Could not parse the given claims request object.",[_9e]:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options",[bN]:"URL could not be parsed into appropriate segments.",[Mge]:"URL was empty or null.",[v9e]:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",[b9e]:"Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest",[Fge]:"Given claims parameter must be a stringified JSON object.",[y9e]:"Token request was empty and not found in cache.",[C9e]:"The logout request was null or undefined.",[w9e]:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',[Bge]:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",[$ge]:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",[S9e]:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",[E9e]:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",[Rj]:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",[x9e]:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",[W7t]:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",[z7t]:"Invalid authentication header provided",[k9e]:"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",[T9e]:"Cannot set allowNativeBroker parameter to true when not in AAD protocol mode.",[I9e]:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority."};class Vge extends il{constructor(e){super(e,j7t[e]),this.name="ClientConfigurationError",Object.setPrototypeOf(this,Vge.prototype)}}function qs(n){return new Vge(n)}/*! @azure/msal-common v14.3.0 2023-10-30 */class qf{static isEmptyObj(e){if(e)try{const t=JSON.parse(e);return Object.keys(t).length===0}catch{}return!0}static startsWith(e,t){return e.indexOf(t)===0}static endsWith(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length}static queryStringToObject(e){const t={},i=e.split("&"),r=o=>decodeURIComponent(o.replace(/\+/g," "));return i.forEach(o=>{if(o.trim()){const[s,a]=o.split(/=(.+)/g,2);s&&a&&(t[r(s)]=r(a))}}),t}static trimArrayEntries(e){return e.map(t=>t.trim())}static removeEmptyStringsFromArray(e){return e.filter(t=>!!t)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}static matchPattern(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)}}/*! @azure/msal-common v14.3.0 2023-10-30 */class cc{constructor(e){const t=e?qf.trimArrayEntries([...e]):[],i=t?qf.removeEmptyStringsFromArray(t):[];this.validateInputScopes(i),this.scopes=new Set,i.forEach(r=>this.scopes.add(r))}static fromString(e){const i=(e||st.EMPTY_STRING).split(" ");return new cc(i)}static createSearchScopes(e){const t=new cc(e);return t.containsOnlyOIDCScopes()?t.removeScope(st.OFFLINE_ACCESS_SCOPE):t.removeOIDCScopes(),t}validateInputScopes(e){if(!e||e.length<1)throw qs(v9e)}containsScope(e){const t=this.printScopesLowerCase().split(" "),i=new cc(t);return e?i.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(t=>this.containsScope(t))}containsOnlyOIDCScopes(){let e=0;return _ke.forEach(t=>{this.containsScope(t)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(t=>this.appendScope(t))}catch{throw dn(a9e)}}removeScope(e){if(!e)throw dn(s9e);this.scopes.delete(e.trim())}removeOIDCScopes(){_ke.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw dn(zie);const t=new Set;return e.scopes.forEach(i=>t.add(i.toLowerCase())),this.scopes.forEach(i=>t.add(i.toLowerCase())),t}intersectingScopeSets(e){if(!e)throw dn(zie);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();const t=this.unionScopeSets(e),i=e.getScopeCount(),r=this.getScopeCount();return t.size<r+i}getScopeCount(){return this.scopes.size}asArray(){const e=[];return this.scopes.forEach(t=>e.push(t)),e}printScopes(){return this.scopes?this.asArray().join(" "):st.EMPTY_STRING}printScopesLowerCase(){return this.printScopes().toLowerCase()}}/*! @azure/msal-common v14.3.0 2023-10-30 */function Kie(n,e){if(!n)throw dn(X8e);try{const t=e.base64Decode(n);return JSON.parse(t)}catch{throw dn(Tge)}}function II(n){if(!n)throw dn(Tge);const e=n.split(Du.CLIENT_INFO_SEPARATOR,2);return{uid:e[0],utid:e.length<2?st.EMPTY_STRING:e[1]}}/*! @azure/msal-common v14.3.0 2023-10-30 */const Pm={Default:0,Adfs:1,Dsts:2,Ciam:3};/*! @azure/msal-common v14.3.0 2023-10-30 */const Ky={AAD:"AAD",OIDC:"OIDC"};/*! @azure/msal-common v14.3.0 2023-10-30 */class Kl{generateAccountId(){return[this.homeAccountId,this.environment].join(Du.CACHE_KEY_SEPARATOR).toLowerCase()}generateAccountKey(){return Kl.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})}getAccountInfo(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,name:this.name,idTokenClaims:this.idTokenClaims,nativeAccountId:this.nativeAccountId,authorityType:this.authorityType}}static generateAccountCacheKey(e){return[e.homeAccountId,e.environment||st.EMPTY_STRING,e.tenantId||st.EMPTY_STRING].join(Du.CACHE_KEY_SEPARATOR).toLowerCase()}static createAccount(e,t){const i=new Kl;t.authorityType===Pm.Adfs?i.authorityType=z6.ADFS_ACCOUNT_TYPE:t.protocolMode===Ky.AAD?i.authorityType=z6.MSSTS_ACCOUNT_TYPE:i.authorityType=z6.GENERIC_ACCOUNT_TYPE,i.clientInfo=e.clientInfo,i.homeAccountId=e.homeAccountId,i.nativeAccountId=e.nativeAccountId;const r=e.environment||t&&t.getPreferredCache();if(!r)throw dn(Age);i.environment=r,i.realm=e.idTokenClaims.tid||st.EMPTY_STRING,i.localAccountId=e.idTokenClaims.oid||e.idTokenClaims.sub||st.EMPTY_STRING;const o=e.idTokenClaims.preferred_username||e.idTokenClaims.upn,s=e.idTokenClaims.emails?e.idTokenClaims.emails[0]:null;return i.username=o||s||st.EMPTY_STRING,i.name=e.idTokenClaims.name,i.cloudGraphHostName=e.cloudGraphHostName,i.msGraphHost=e.msGraphHost,i}static createFromAccountInfo(e,t,i){const r=new Kl;return r.authorityType=e.authorityType||z6.GENERIC_ACCOUNT_TYPE,r.homeAccountId=e.homeAccountId,r.localAccountId=e.localAccountId,r.nativeAccountId=e.nativeAccountId,r.realm=e.tenantId,r.environment=e.environment,r.username=e.username,r.name=e.name,r.cloudGraphHostName=t,r.msGraphHost=i,r}static generateHomeAccountId(e,t,i,r,o){const s=o!=null&&o.sub?o.sub:st.EMPTY_STRING;if(t===Pm.Adfs||t===Pm.Dsts)return s;if(e)try{const a=Kie(e,r);if(a.uid&&a.utid)return`${a.uid}${Du.CLIENT_INFO_SEPARATOR}${a.utid}`}catch{}return i.verbose("No client info in response"),s}static isAccountEntity(e){return e?e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"):!1}static accountInfoIsEqual(e,t,i){if(!e||!t)return!1;let r=!0;if(i){const o=e.idTokenClaims||{},s=t.idTokenClaims||{};r=o.iat===s.iat&&o.nonce===s.nonce}return e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username&&e.tenantId===t.tenantId&&e.environment===t.environment&&e.nativeAccountId===t.nativeAccountId&&r}}/*! @azure/msal-common v14.3.0 2023-10-30 */class tr{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw qs(Mge);this.getHash()||(this._urlString=tr.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let t=e.toLowerCase();return qf.endsWith(t,"?")?t=t.slice(0,-1):qf.endsWith(t,"?/")&&(t=t.slice(0,-2)),qf.endsWith(t,"/")||(t+="/"),t}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw qs(bN)}if(!e.HostNameAndPort||!e.PathSegments)throw qs(bN);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw qs(_9e)}static appendQueryString(e,t){return t?e.indexOf("?")<0?`${e}?${t}`:`${e}&${t}`:e}static removeHashFromUrl(e){return tr.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const t=this.getUrlComponents(),i=t.PathSegments;return e&&i.length!==0&&(i[0]===_O.COMMON||i[0]===_O.ORGANIZATIONS)&&(i[0]=e),tr.constructAuthorityUriFromObject(t)}getHash(){return tr.parseHash(this.urlString)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw qs(bN);const i={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]};let r=i.AbsolutePath.split("/");return r=r.filter(o=>o&&o.length>0),i.PathSegments=r,i.QueryString&&i.QueryString.endsWith("/")&&(i.QueryString=i.QueryString.substring(0,i.QueryString.length-1)),i}static getDomainFromUrl(e){const t=RegExp("^([^:/?#]+://)?([^/?#]*)"),i=e.match(t);if(!i)throw qs(bN);return i[2]}static getAbsoluteUrl(e,t){if(e[0]===st.FORWARD_SLASH){const r=new tr(t).getUrlComponents();return r.Protocol+"//"+r.HostNameAndPort+e}return e}static parseHash(e){const t=e.indexOf("#"),i=e.indexOf("#/");return i>-1?e.substring(i+2):t>-1?e.substring(t+1):st.EMPTY_STRING}static parseQueryString(e){const t=e.indexOf("?"),i=e.indexOf("/?");return i>-1?e.substring(i+2):t>-1?e.substring(t+1):st.EMPTY_STRING}static parseQueryServerResponse(e){const t=e.indexOf("?code"),i=e.indexOf("/?code"),r=e.indexOf("#");return i>-1&&r>-1?e.substring(i+2,r):i>-1?e.substring(i+2):t>-1&&r>-1?e.substring(t+1,r):t>-1?e.substring(t+1):st.EMPTY_STRING}static constructAuthorityUriFromObject(e){return new tr(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}static getDeserializedHash(e){if(!e)return{};const t=tr.parseHash(e),i=qf.queryStringToObject(t||e);if(!i)throw dn(Wie);return i}static getDeserializedQueryString(e){if(!e)return{};const t=tr.parseQueryString(e),i=qf.queryStringToObject(t||e);if(!i)throw dn(Wie);return i}static getDeserializedCodeResponse(e,t){const i=new tr(t);let r;return e===U3.QUERY?r=tr.getDeserializedQueryString(t):r=tr.getDeserializedHash(i.getHash()),r}static hashContainsKnownProperties(e){if(!e||e.indexOf("=")<0)return!1;const t=tr.getDeserializedHash(e);return!!(t.code||t.error_description||t.error||t.state)}}/*! @azure/msal-common v14.3.0 2023-10-30 */const L9e={endpointMetadata:{"https://login.microsoftonline.com/common/":{token_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/common/":{token_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/common/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/common/":{token_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/consumers/":{token_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/consumers/":{token_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/consumers/":{token_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/organizations/":{token_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/organizations/":{token_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/organizations/":{token_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"}},instanceDiscoveryMetadata:{tenant_discovery_endpoint:"https://{canonicalAuthority}/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}},kke=L9e.endpointMetadata,Hge=L9e.instanceDiscoveryMetadata,D9e=new Set;Hge.metadata.forEach(n=>{n.aliases.forEach(e=>{D9e.add(e)})});function U7t(n,e){var r;let t;const i=n.canonicalAuthority;if(i){const o=new tr(i).getUrlComponents().HostNameAndPort;t=Tke(o,(r=n.cloudDiscoveryMetadata)==null?void 0:r.metadata,$f.CONFIG,e)||Tke(o,Hge.metadata,$f.HARDCODED_VALUES,e)||n.knownAuthorities}return t||[]}function Tke(n,e,t,i){if(i==null||i.trace(`getAliasesFromMetadata called with source: ${t}`),n&&e){const r=U7(e,n);if(r)return i==null||i.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${t}, returning aliases`),r.aliases;i==null||i.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${t}`)}return null}function q7t(n){return U7(Hge.metadata,n)}function U7(n,e){for(let t=0;t<n.length;t++){const i=n[t];if(i.aliases.includes(e))return i}return null}/*! @azure/msal-common v14.3.0 2023-10-30 */class C1{constructor(e,t,i,r){this.clientId=e,this.cryptoImpl=t,this.commonLogger=i.clone(f9e,Nge),this.staticAuthorityOptions=r}getAllAccounts(e){const t=[];return this.getAccountsFilteredBy(e||{}).forEach(i=>{const r=this.getAccountInfoFromEntity(i,e);r&&t.push(r)}),t}getAccountInfoFilteredBy(e){const t=this.getAllAccounts(e);return t.length>1?t.filter(i=>!!i.idTokenClaims)[0]:t.length===1?t[0]:null}getBaseAccountInfo(e){const t=this.getAccountsFilteredBy(e);return t.length>0?t[0].getAccountInfo():null}getAccountInfoFromEntity(e,t){const i=e.getAccountInfo(),r=this.getIdToken(i);if(r){const o=JC(r.secret,this.cryptoImpl.base64Decode);if(this.idTokenClaimsMatchAccountFilter(o,t))return i.idToken=r.secret,i.idTokenClaims=o,i}return i}idTokenClaimsMatchAccountFilter(e,t){return!(t&&(t.loginHint&&!this.matchLoginHint(e,t.loginHint)||t.sid&&!this.matchSid(e,t.sid)))}async saveCacheRecord(e,t){if(!e)throw dn(l9e);e.account&&this.setAccount(e.account),e.idToken&&(t==null?void 0:t.idToken)!==!1&&this.setIdTokenCredential(e.idToken),e.accessToken&&(t==null?void 0:t.accessToken)!==!1&&await this.saveAccessToken(e.accessToken),e.refreshToken&&(t==null?void 0:t.refreshToken)!==!1&&this.setRefreshTokenCredential(e.refreshToken),e.appMetadata&&this.setAppMetadata(e.appMetadata)}async saveAccessToken(e){const t={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},i=this.getTokenKeys(),r=cc.fromString(e.target),o=[];i.accessToken.forEach(s=>{if(!this.accessTokenKeyMatchesFilter(s,t,!1))return;const a=this.getAccessTokenCredential(s);a&&this.credentialMatchesFilter(a,t)&&cc.fromString(a.target).intersectingScopeSets(r)&&o.push(this.removeAccessToken(s))}),await Promise.all(o),this.setAccessTokenCredential(e)}getAccountsFilteredBy(e){const t=this.getAccountKeys(),i=[];return t.forEach(r=>{if(!this.isAccountKey(r,e.homeAccountId,e.tenantId))return;const o=this.getAccount(r);o&&(e.homeAccountId&&!this.matchHomeAccountId(o,e.homeAccountId)||e.localAccountId&&!this.matchLocalAccountId(o,e.localAccountId)||e.username&&!this.matchUsername(o,e.username)||e.environment&&!this.matchEnvironment(o,e.environment)||e.realm&&!this.matchRealm(o,e.realm)||e.tenantId&&!this.matchRealm(o,e.tenantId)||e.nativeAccountId&&!this.matchNativeAccountId(o,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(o,e.authorityType)||e.name&&!this.matchName(o,e.name)||i.push(o))}),i}isAccountKey(e,t,i){return!(e.split(Du.CACHE_KEY_SEPARATOR).length<3||t&&!e.toLowerCase().includes(t.toLowerCase())||i&&!e.toLowerCase().includes(i.toLowerCase()))}isCredentialKey(e){if(e.split(Du.CACHE_KEY_SEPARATOR).length<6)return!1;const t=e.toLowerCase();if(t.indexOf(dr.ID_TOKEN.toLowerCase())===-1&&t.indexOf(dr.ACCESS_TOKEN.toLowerCase())===-1&&t.indexOf(dr.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())===-1&&t.indexOf(dr.REFRESH_TOKEN.toLowerCase())===-1)return!1;if(t.indexOf(dr.REFRESH_TOKEN.toLowerCase())>-1){const i=`${dr.REFRESH_TOKEN}${Du.CACHE_KEY_SEPARATOR}${this.clientId}${Du.CACHE_KEY_SEPARATOR}`,r=`${dr.REFRESH_TOKEN}${Du.CACHE_KEY_SEPARATOR}${vO}${Du.CACHE_KEY_SEPARATOR}`;if(t.indexOf(i.toLowerCase())===-1&&t.indexOf(r.toLowerCase())===-1)return!1}else if(t.indexOf(this.clientId.toLowerCase())===-1)return!1;return!0}credentialMatchesFilter(e,t){return!(t.clientId&&!this.matchClientId(e,t.clientId)||t.userAssertionHash&&!this.matchUserAssertionHash(e,t.userAssertionHash)||typeof t.homeAccountId=="string"&&!this.matchHomeAccountId(e,t.homeAccountId)||t.environment&&!this.matchEnvironment(e,t.environment)||t.realm&&!this.matchRealm(e,t.realm)||t.credentialType&&!this.matchCredentialType(e,t.credentialType)||t.familyId&&!this.matchFamilyId(e,t.familyId)||t.target&&!this.matchTarget(e,t.target)||(t.requestedClaimsHash||e.requestedClaimsHash)&&e.requestedClaimsHash!==t.requestedClaimsHash||e.credentialType===dr.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(t.tokenType&&!this.matchTokenType(e,t.tokenType)||t.tokenType===Us.SSH&&t.keyId&&!this.matchKeyId(e,t.keyId)))}getAppMetadataFilteredBy(e){return this.getAppMetadataFilteredByInternal(e.environment,e.clientId)}getAppMetadataFilteredByInternal(e,t){const i=this.getKeys(),r={};return i.forEach(o=>{if(!this.isAppMetadata(o))return;const s=this.getAppMetadata(o);s&&(e&&!this.matchEnvironment(s,e)||t&&!this.matchClientId(s,t)||(r[o]=s))}),r}getAuthorityMetadataByAlias(e){const t=this.getAuthorityMetadataKeys();let i=null;return t.forEach(r=>{if(!this.isAuthorityMetadata(r)||r.indexOf(this.clientId)===-1)return;const o=this.getAuthorityMetadata(r);o&&o.aliases.indexOf(e)!==-1&&(i=o)}),i}async removeAllAccounts(){const e=this.getAccountKeys(),t=[];e.forEach(i=>{t.push(this.removeAccount(i))}),await Promise.all(t)}async removeAccount(e){const t=this.getAccount(e);t&&(await this.removeAccountContext(t),this.removeItem(e))}async removeAccountContext(e){const t=this.getTokenKeys(),i=e.generateAccountId(),r=[];t.idToken.forEach(o=>{o.indexOf(i)===0&&this.removeIdToken(o)}),t.accessToken.forEach(o=>{o.indexOf(i)===0&&r.push(this.removeAccessToken(o))}),t.refreshToken.forEach(o=>{o.indexOf(i)===0&&this.removeRefreshToken(o)}),await Promise.all(r)}async removeAccessToken(e){const t=this.getAccessTokenCredential(e);if(t){if(t.credentialType.toLowerCase()===dr.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&t.tokenType===Us.POP){const r=t.keyId;if(r)try{await this.cryptoImpl.removeTokenBindingKey(r)}catch{throw dn(d9e)}}return this.removeItem(e)}}removeAppMetadata(){return this.getKeys().forEach(t=>{this.isAppMetadata(t)&&this.removeItem(t)}),!0}readCacheRecord(e,t,i){const r=this.getTokenKeys(),o=this.readAccountFromCache(e),s=this.getIdToken(e,r),a=this.getAccessToken(e,t,r),l=this.getRefreshToken(e,!1,r),c=this.readAppMetadataFromCache(i);return o&&s&&(o.idTokenClaims=JC(s.secret,this.cryptoImpl.base64Decode)),{account:o,idToken:s,accessToken:a,refreshToken:l,appMetadata:c}}readAccountFromCache(e){const t=Kl.generateAccountCacheKey(e);return this.getAccount(t)}getIdToken(e,t){this.commonLogger.trace("CacheManager - getIdToken called");const i={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:dr.ID_TOKEN,clientId:this.clientId,realm:e.tenantId},r=this.getIdTokensByFilter(i,t),o=r.length;return o<1?(this.commonLogger.info("CacheManager:getIdToken - No token found"),null):o>1?(this.commonLogger.info("CacheManager:getIdToken - Multiple id tokens found, clearing them"),r.forEach(s=>{this.removeIdToken(TI(s))}),null):(this.commonLogger.info("CacheManager:getIdToken - Returning id token"),r[0])}getIdTokensByFilter(e,t){const i=t&&t.idToken||this.getTokenKeys().idToken,r=[];return i.forEach(o=>{if(!this.idTokenKeyMatchesFilter(o,{clientId:this.clientId,...e}))return;const s=this.getIdTokenCredential(o);s&&this.credentialMatchesFilter(s,e)&&r.push(s)}),r}idTokenKeyMatchesFilter(e,t){const i=e.toLowerCase();return!(t.clientId&&i.indexOf(t.clientId.toLowerCase())===-1||t.homeAccountId&&i.indexOf(t.homeAccountId.toLowerCase())===-1)}removeIdToken(e){this.removeItem(e)}removeRefreshToken(e){this.removeItem(e)}getAccessToken(e,t,i){this.commonLogger.trace("CacheManager - getAccessToken called");const r=cc.createSearchScopes(t.scopes),o=t.authenticationScheme||Us.BEARER,s=o&&o.toLowerCase()!==Us.BEARER.toLowerCase()?dr.ACCESS_TOKEN_WITH_AUTH_SCHEME:dr.ACCESS_TOKEN,a={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:s,clientId:this.clientId,realm:e.tenantId,target:r,tokenType:o,keyId:t.sshKid,requestedClaimsHash:t.requestedClaimsHash},l=i&&i.accessToken||this.getTokenKeys().accessToken,c=[];l.forEach(d=>{if(this.accessTokenKeyMatchesFilter(d,a,!0)){const h=this.getAccessTokenCredential(d);h&&this.credentialMatchesFilter(h,a)&&c.push(h)}});const u=c.length;return u<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found"),null):u>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them"),c.forEach(d=>{this.removeAccessToken(TI(d))}),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token"),c[0])}accessTokenKeyMatchesFilter(e,t,i){const r=e.toLowerCase();if(t.clientId&&r.indexOf(t.clientId.toLowerCase())===-1||t.homeAccountId&&r.indexOf(t.homeAccountId.toLowerCase())===-1||t.realm&&r.indexOf(t.realm.toLowerCase())===-1||t.requestedClaimsHash&&r.indexOf(t.requestedClaimsHash.toLowerCase())===-1)return!1;if(t.target){const o=t.target.asArray();for(let s=0;s<o.length;s++){if(i&&!r.includes(o[s].toLowerCase()))return!1;if(!i&&r.includes(o[s].toLowerCase()))return!0}}return!0}getAccessTokensByFilter(e){const t=this.getTokenKeys(),i=[];return t.accessToken.forEach(r=>{if(!this.accessTokenKeyMatchesFilter(r,e,!0))return;const o=this.getAccessTokenCredential(r);o&&this.credentialMatchesFilter(o,e)&&i.push(o)}),i}getRefreshToken(e,t,i){this.commonLogger.trace("CacheManager - getRefreshToken called");const r=t?vO:void 0,o={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:dr.REFRESH_TOKEN,clientId:this.clientId,familyId:r},s=i&&i.refreshToken||this.getTokenKeys().refreshToken,a=[];return s.forEach(c=>{if(this.refreshTokenKeyMatchesFilter(c,o)){const u=this.getRefreshTokenCredential(c);u&&this.credentialMatchesFilter(u,o)&&a.push(u)}}),a.length<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found."),null):(this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token"),a[0])}refreshTokenKeyMatchesFilter(e,t){const i=e.toLowerCase();return!(t.familyId&&i.indexOf(t.familyId.toLowerCase())===-1||!t.familyId&&t.clientId&&i.indexOf(t.clientId.toLowerCase())===-1||t.homeAccountId&&i.indexOf(t.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e){const t={environment:e,clientId:this.clientId},i=this.getAppMetadataFilteredBy(t),r=Object.keys(i).map(s=>i[s]),o=r.length;if(o<1)return null;if(o>1)throw dn(r9e);return r[0]}isAppMetadataFOCI(e){const t=this.readAppMetadataFromCache(e);return!!(t&&t.familyId===vO)}matchHomeAccountId(e,t){return typeof e.homeAccountId=="string"&&t===e.homeAccountId}matchLocalAccountId(e,t){return typeof e.localAccountId=="string"&&t===e.localAccountId}matchUsername(e,t){return typeof e.username=="string"&&t.toLowerCase()===e.username.toLowerCase()}matchName(e,t){var i;return t.toLowerCase()===((i=e.name)==null?void 0:i.toLowerCase())}matchUserAssertionHash(e,t){return!!(e.userAssertionHash&&t===e.userAssertionHash)}matchEnvironment(e,t){if(this.staticAuthorityOptions){const r=U7t(this.staticAuthorityOptions,this.commonLogger);if(r.includes(t)&&r.includes(e.environment))return!0}const i=this.getAuthorityMetadataByAlias(t);return!!(i&&i.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,t){return!!(e.clientId&&t===e.clientId)}matchFamilyId(e,t){return!!(e.familyId&&t===e.familyId)}matchRealm(e,t){return!!(e.realm&&t===e.realm)}matchNativeAccountId(e,t){return!!(e.nativeAccountId&&t===e.nativeAccountId)}matchLoginHint(e,t){return(e==null?void 0:e.login_hint)===t||e.preferred_username===t||(e==null?void 0:e.upn)===t}matchSid(e,t){return!!(e!=null&&e.sid&&e.sid===t)}matchAuthorityType(e,t){return!!(e.authorityType&&t.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,t){return e.credentialType!==dr.ACCESS_TOKEN&&e.credentialType!==dr.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:cc.fromString(e.target).containsScopeSet(t)}matchTokenType(e,t){return!!(e.tokenType&&e.tokenType===t)}matchKeyId(e,t){return!!(e.keyId&&e.keyId===t)}isAppMetadata(e){return e.indexOf(Hie)!==-1}isAuthorityMetadata(e){return e.indexOf(bO.CACHE_KEY)!==-1}generateAuthorityMetadataCacheKey(e){return`${bO.CACHE_KEY}-${this.clientId}-${e}`}static toObject(e,t){for(const i in t)e[i]=t[i];return e}}class K7t extends C1{setAccount(){throw dn(ho)}getAccount(){throw dn(ho)}setIdTokenCredential(){throw dn(ho)}getIdTokenCredential(){throw dn(ho)}setAccessTokenCredential(){throw dn(ho)}getAccessTokenCredential(){throw dn(ho)}setRefreshTokenCredential(){throw dn(ho)}getRefreshTokenCredential(){throw dn(ho)}setAppMetadata(){throw dn(ho)}getAppMetadata(){throw dn(ho)}setServerTelemetry(){throw dn(ho)}getServerTelemetry(){throw dn(ho)}setAuthorityMetadata(){throw dn(ho)}getAuthorityMetadata(){throw dn(ho)}getAuthorityMetadataKeys(){throw dn(ho)}setThrottlingCache(){throw dn(ho)}getThrottlingCache(){throw dn(ho)}removeItem(){throw dn(ho)}containsKey(){throw dn(ho)}getKeys(){throw dn(ho)}getAccountKeys(){throw dn(ho)}getTokenKeys(){throw dn(ho)}async clear(){throw dn(ho)}updateCredentialCacheKey(){throw dn(ho)}}/*! @azure/msal-common v14.3.0 2023-10-30 */const G7t=300,A9e={tokenRenewalOffsetSeconds:G7t,preventCorsPreflight:!1},Y7t={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:Qc.Info,correlationId:st.EMPTY_STRING},Q7t={claimsBasedCachingEnabled:!1},X7t={async sendGetRequestAsync(){throw dn(ho)},async sendPostRequestAsync(){throw dn(ho)}},Z7t={sku:st.SKU,version:Nge,cpu:st.EMPTY_STRING,os:st.EMPTY_STRING},J7t={clientSecret:st.EMPTY_STRING,clientAssertion:void 0},eVt={azureCloudInstance:Oge.None,tenant:`${st.DEFAULT_COMMON_TENANT}`},tVt={application:{appName:"",appVersion:""}};function nVt({authOptions:n,systemOptions:e,loggerOptions:t,cacheOptions:i,storageInterface:r,networkInterface:o,cryptoInterface:s,clientCredentials:a,libraryInfo:l,telemetry:c,serverTelemetryManager:u,persistencePlugin:d,serializableCache:h}){const g={...Y7t,...t};return{authOptions:iVt(n),systemOptions:{...A9e,...e},loggerOptions:g,cacheOptions:{...Q7t,...i},storageInterface:r||new K7t(n.clientId,j7,new bx(g)),networkInterface:o||X7t,cryptoInterface:s||j7,clientCredentials:a||J7t,libraryInfo:{...Z7t,...l},telemetry:{...tVt,...c},serverTelemetryManager:u||null,persistencePlugin:d||null,serializableCache:h||null}}function iVt(n){return{clientCapabilities:[],azureCloudOptions:eVt,skipAuthorityMetadataCache:!1,...n}}function Gie(n){return n.authOptions.authority.options.protocolMode===Ky.OIDC}/*! @azure/msal-common v14.3.0 2023-10-30 */class ew extends il{constructor(e,t,i){super(e,t,i),this.name="ServerError",Object.setPrototypeOf(this,ew.prototype)}}/*! @azure/msal-common v14.3.0 2023-10-30 */class mv{static generateThrottlingStorageKey(e){return`${yO.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,t){var o;const i=mv.generateThrottlingStorageKey(t),r=e.getThrottlingCache(i);if(r){if(r.throttleTime<Date.now()){e.removeItem(i);return}throw new ew(((o=r.errorCodes)==null?void 0:o.join(" "))||st.EMPTY_STRING,r.errorMessage,r.subError)}}static postProcess(e,t,i){if(mv.checkResponseStatus(i)||mv.checkResponseForRetryAfter(i)){const r={throttleTime:mv.calculateThrottleTime(parseInt(i.headers[Lv.RETRY_AFTER])),error:i.body.error,errorCodes:i.body.error_codes,errorMessage:i.body.error_description,subError:i.body.suberror};e.setThrottlingCache(mv.generateThrottlingStorageKey(t),r)}}static checkResponseStatus(e){return e.status===429||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(Lv.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){const t=e<=0?0:e,i=Date.now()/1e3;return Math.floor(Math.min(i+(t||yO.DEFAULT_THROTTLE_TIME_SECONDS),i+yO.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)}static removeThrottle(e,t,i,r){const o={clientId:t,authority:i.authority,scopes:i.scopes,homeAccountIdentifier:r,claims:i.claims,authenticationScheme:i.authenticationScheme,resourceRequestMethod:i.resourceRequestMethod,resourceRequestUri:i.resourceRequestUri,shrClaims:i.shrClaims,sshKid:i.sshKid},s=this.generateThrottlingStorageKey(o);e.removeItem(s)}}/*! @azure/msal-common v14.3.0 2023-10-30 */class rVt{constructor(e,t){this.networkClient=e,this.cacheManager=t}async sendPostRequest(e,t,i){mv.preProcess(this.cacheManager,e);let r;try{r=await this.networkClient.sendPostRequestAsync(t,i)}catch(o){throw o instanceof il?o:dn(J8e)}return mv.postProcess(this.cacheManager,e,r),r}}/*! @azure/msal-common v14.3.0 2023-10-30 */const ng={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};/*! @azure/msal-common v14.3.0 2023-10-30 */class WS{static validateRedirectUri(e){if(!e)throw qs(m9e)}static validatePrompt(e){const t=[];for(const i in Ed)t.push(Ed[i]);if(t.indexOf(e)<0)throw qs(b9e)}static validateClaims(e){try{JSON.parse(e)}catch{throw qs(Fge)}}static validateCodeChallengeParams(e,t){if(!e||!t)throw qs(Bge);this.validateCodeChallengeMethod(t)}static validateCodeChallengeMethod(e){if([vke.PLAIN,vke.S256].indexOf(e)<0)throw qs(w9e)}static sanitizeEQParams(e,t){return e?(t.forEach((i,r)=>{e[r]&&delete e[r]}),Object.fromEntries(Object.entries(e).filter(i=>i[1]!==""))):{}}}/*! @azure/msal-common v14.3.0 2023-10-30 */class CO{constructor(){this.parameters=new Map}addResponseTypeCode(){this.parameters.set(mr.RESPONSE_TYPE,encodeURIComponent(st.CODE_RESPONSE_TYPE))}addResponseTypeForTokenAndIdToken(){this.parameters.set(mr.RESPONSE_TYPE,encodeURIComponent(`${st.TOKEN_RESPONSE_TYPE} ${st.ID_TOKEN_RESPONSE_TYPE}`))}addResponseMode(e){this.parameters.set(mr.RESPONSE_MODE,encodeURIComponent(e||b7t.QUERY))}addNativeBroker(){this.parameters.set(mr.NATIVE_BROKER,encodeURIComponent("1"))}addScopes(e,t=!0,i=j3){t&&!i.includes("openid")&&!e.includes("openid")&&i.push("openid");const r=t?[...e||[],...i]:e||[],o=new cc(r);this.parameters.set(mr.SCOPE,encodeURIComponent(o.printScopes()))}addClientId(e){this.parameters.set(mr.CLIENT_ID,encodeURIComponent(e))}addRedirectUri(e){WS.validateRedirectUri(e),this.parameters.set(mr.REDIRECT_URI,encodeURIComponent(e))}addPostLogoutRedirectUri(e){WS.validateRedirectUri(e),this.parameters.set(mr.POST_LOGOUT_URI,encodeURIComponent(e))}addIdTokenHint(e){this.parameters.set(mr.ID_TOKEN_HINT,encodeURIComponent(e))}addDomainHint(e){this.parameters.set(oX.DOMAIN_HINT,encodeURIComponent(e))}addLoginHint(e){this.parameters.set(oX.LOGIN_HINT,encodeURIComponent(e))}addCcsUpn(e){this.parameters.set(Lv.CCS_HEADER,encodeURIComponent(`UPN:${e}`))}addCcsOid(e){this.parameters.set(Lv.CCS_HEADER,encodeURIComponent(`Oid:${e.uid}@${e.utid}`))}addSid(e){this.parameters.set(oX.SID,encodeURIComponent(e))}addClaims(e,t){const i=this.addClientCapabilitiesToClaims(e,t);WS.validateClaims(i),this.parameters.set(mr.CLAIMS,encodeURIComponent(i))}addCorrelationId(e){this.parameters.set(mr.CLIENT_REQUEST_ID,encodeURIComponent(e))}addLibraryInfo(e){this.parameters.set(mr.X_CLIENT_SKU,e.sku),this.parameters.set(mr.X_CLIENT_VER,e.version),e.os&&this.parameters.set(mr.X_CLIENT_OS,e.os),e.cpu&&this.parameters.set(mr.X_CLIENT_CPU,e.cpu)}addApplicationTelemetry(e){e!=null&&e.appName&&this.parameters.set(mr.X_APP_NAME,e.appName),e!=null&&e.appVersion&&this.parameters.set(mr.X_APP_VER,e.appVersion)}addPrompt(e){WS.validatePrompt(e),this.parameters.set(`${mr.PROMPT}`,encodeURIComponent(e))}addState(e){e&&this.parameters.set(mr.STATE,encodeURIComponent(e))}addNonce(e){this.parameters.set(mr.NONCE,encodeURIComponent(e))}addCodeChallengeParams(e,t){if(WS.validateCodeChallengeParams(e,t),e&&t)this.parameters.set(mr.CODE_CHALLENGE,encodeURIComponent(e)),this.parameters.set(mr.CODE_CHALLENGE_METHOD,encodeURIComponent(t));else throw qs(Bge)}addAuthorizationCode(e){this.parameters.set(mr.CODE,encodeURIComponent(e))}addDeviceCode(e){this.parameters.set(mr.DEVICE_CODE,encodeURIComponent(e))}addRefreshToken(e){this.parameters.set(mr.REFRESH_TOKEN,encodeURIComponent(e))}addCodeVerifier(e){this.parameters.set(mr.CODE_VERIFIER,encodeURIComponent(e))}addClientSecret(e){this.parameters.set(mr.CLIENT_SECRET,encodeURIComponent(e))}addClientAssertion(e){e&&this.parameters.set(mr.CLIENT_ASSERTION,encodeURIComponent(e))}addClientAssertionType(e){e&&this.parameters.set(mr.CLIENT_ASSERTION_TYPE,encodeURIComponent(e))}addOboAssertion(e){this.parameters.set(mr.OBO_ASSERTION,encodeURIComponent(e))}addRequestTokenUse(e){this.parameters.set(mr.REQUESTED_TOKEN_USE,encodeURIComponent(e))}addGrantType(e){this.parameters.set(mr.GRANT_TYPE,encodeURIComponent(e))}addClientInfo(){this.parameters.set(y7t,"1")}addExtraQueryParameters(e){const t=WS.sanitizeEQParams(e,this.parameters);Object.keys(t).forEach(i=>{this.parameters.set(i,e[i])})}addClientCapabilitiesToClaims(e,t){let i;if(!e)i={};else try{i=JSON.parse(e)}catch{throw qs(Fge)}return t&&t.length>0&&(i.hasOwnProperty(W6.ACCESS_TOKEN)||(i[W6.ACCESS_TOKEN]={}),i[W6.ACCESS_TOKEN][W6.XMS_CC]={values:t}),JSON.stringify(i)}addUsername(e){this.parameters.set(yke.username,encodeURIComponent(e))}addPassword(e){this.parameters.set(yke.password,encodeURIComponent(e))}addPopToken(e){e&&(this.parameters.set(mr.TOKEN_TYPE,Us.POP),this.parameters.set(mr.REQ_CNF,encodeURIComponent(e)))}addSshJwk(e){e&&(this.parameters.set(mr.TOKEN_TYPE,Us.SSH),this.parameters.set(mr.REQ_CNF,encodeURIComponent(e)))}addServerTelemetry(e){this.parameters.set(mr.X_CLIENT_CURR_TELEM,e.generateCurrentRequestHeaderValue()),this.parameters.set(mr.X_CLIENT_LAST_TELEM,e.generateLastRequestHeaderValue())}addThrottling(){this.parameters.set(mr.X_MS_LIB_CAPABILITY,yO.X_MS_LIB_CAPABILITY_VALUE)}addLogoutHint(e){this.parameters.set(mr.LOGOUT_HINT,encodeURIComponent(e))}createQueryString(){const e=new Array;return this.parameters.forEach((t,i)=>{e.push(`${i}=${t}`)}),e.join("&")}}/*! @azure/msal-common v14.3.0 2023-10-30 */function oVt(n){return n.hasOwnProperty("authorization_endpoint")&&n.hasOwnProperty("token_endpoint")&&n.hasOwnProperty("issuer")&&n.hasOwnProperty("jwks_uri")}/*! @azure/msal-common v14.3.0 2023-10-30 */class Yie{constructor(){this.expiresAt=th.nowSeconds()+bO.REFRESH_TIME_SECONDS}updateCloudDiscoveryMetadata(e,t){this.aliases=e.aliases,this.preferred_cache=e.preferred_cache,this.preferred_network=e.preferred_network,this.aliasesFromNetwork=t}updateEndpointMetadata(e,t){this.authorization_endpoint=e.authorization_endpoint,this.token_endpoint=e.token_endpoint,this.end_session_endpoint=e.end_session_endpoint,this.issuer=e.issuer,this.endpointsFromNetwork=t,this.jwks_uri=e.jwks_uri}updateCanonicalAuthority(e){this.canonical_authority=e}resetExpiresAt(){this.expiresAt=th.nowSeconds()+bO.REFRESH_TIME_SECONDS}isExpired(){return this.expiresAt<=th.nowSeconds()}static isAuthorityMetadataEntity(e,t){return t?e.indexOf(bO.CACHE_KEY)===0&&t.hasOwnProperty("aliases")&&t.hasOwnProperty("preferred_cache")&&t.hasOwnProperty("preferred_network")&&t.hasOwnProperty("canonical_authority")&&t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("aliasesFromNetwork")&&t.hasOwnProperty("endpointsFromNetwork")&&t.hasOwnProperty("expiresAt")&&t.hasOwnProperty("jwks_uri"):!1}}/*! @azure/msal-common v14.3.0 2023-10-30 */function sVt(n){return n.hasOwnProperty("tenant_discovery_endpoint")&&n.hasOwnProperty("metadata")}/*! @azure/msal-common v14.3.0 2023-10-30 */function aVt(n){return n.hasOwnProperty("error")&&n.hasOwnProperty("error_description")}/*! @azure/msal-common v14.3.0 2023-10-30 */const ut={AcquireTokenByCode:"acquireTokenByCode",AcquireTokenByRefreshToken:"acquireTokenByRefreshToken",AcquireTokenSilent:"acquireTokenSilent",AcquireTokenSilentAsync:"acquireTokenSilentAsync",AcquireTokenPopup:"acquireTokenPopup",CryptoOptsGetPublicKeyThumbprint:"cryptoOptsGetPublicKeyThumbprint",CryptoOptsSignJwt:"cryptoOptsSignJwt",SilentCacheClientAcquireToken:"silentCacheClientAcquireToken",SilentIframeClientAcquireToken:"silentIframeClientAcquireToken",SilentRefreshClientAcquireToken:"silentRefreshClientAcquireToken",SsoSilent:"ssoSilent",StandardInteractionClientGetDiscoveredAuthority:"standardInteractionClientGetDiscoveredAuthority",FetchAccountIdWithNativeBroker:"fetchAccountIdWithNativeBroker",NativeInteractionClientAcquireToken:"nativeInteractionClientAcquireToken",BaseClientCreateTokenRequestHeaders:"baseClientCreateTokenRequestHeaders",RefreshTokenClientExecutePostToTokenEndpoint:"refreshTokenClientExecutePostToTokenEndpoint",AuthorizationCodeClientExecutePostToTokenEndpoint:"authorizationCodeClientExecutePostToTokenEndpoint",BrokerHandhshake:"brokerHandshake",AcquireTokenByRefreshTokenInBroker:"acquireTokenByRefreshTokenInBroker",AcquireTokenByBroker:"acquireTokenByBroker",RefreshTokenClientExecuteTokenRequest:"refreshTokenClientExecuteTokenRequest",RefreshTokenClientAcquireToken:"refreshTokenClientAcquireToken",RefreshTokenClientAcquireTokenWithCachedRefreshToken:"refreshTokenClientAcquireTokenWithCachedRefreshToken",RefreshTokenClientAcquireTokenByRefreshToken:"refreshTokenClientAcquireTokenByRefreshToken",RefreshTokenClientCreateTokenRequestBody:"refreshTokenClientCreateTokenRequestBody",AcquireTokenFromCache:"acquireTokenFromCache",SilentFlowClientAcquireCachedToken:"silentFlowClientAcquireCachedToken",SilentFlowClientGenerateResultFromCacheRecord:"silentFlowClientGenerateResultFromCacheRecord",AcquireTokenBySilentIframe:"acquireTokenBySilentIframe",InitializeBaseRequest:"initializeBaseRequest",InitializeSilentRequest:"initializeSilentRequest",InitializeClientApplication:"initializeClientApplication",SilentIframeClientTokenHelper:"silentIframeClientTokenHelper",SilentHandlerInitiateAuthRequest:"silentHandlerInitiateAuthRequest",SilentHandlerMonitorIframeForHash:"silentHandlerMonitorIframeForHash",SilentHandlerLoadFrame:"silentHandlerLoadFrame",SilentHandlerLoadFrameSync:"silentHandlerLoadFrameSync",StandardInteractionClientCreateAuthCodeClient:"standardInteractionClientCreateAuthCodeClient",StandardInteractionClientGetClientConfiguration:"standardInteractionClientGetClientConfiguration",StandardInteractionClientInitializeAuthorizationRequest:"standardInteractionClientInitializeAuthorizationRequest",StandardInteractionClientInitializeAuthorizationCodeRequest:"standardInteractionClientInitializeAuthorizationCodeRequest",GetAuthCodeUrl:"getAuthCodeUrl",HandleCodeResponseFromServer:"handleCodeResponseFromServer",HandleCodeResponseFromHash:"handleCodeResponseFromHash",UpdateTokenEndpointAuthority:"updateTokenEndpointAuthority",AuthClientAcquireToken:"authClientAcquireToken",AuthClientExecuteTokenRequest:"authClientExecuteTokenRequest",AuthClientCreateTokenRequestBody:"authClientCreateTokenRequestBody",AuthClientCreateQueryString:"authClientCreateQueryString",PopTokenGenerateCnf:"popTokenGenerateCnf",PopTokenGenerateKid:"popTokenGenerateKid",HandleServerTokenResponse:"handleServerTokenResponse",AuthorityFactoryCreateDiscoveredInstance:"authorityFactoryCreateDiscoveredInstance",AuthorityResolveEndpointsAsync:"authorityResolveEndpointsAsync",AuthorityResolveEndpointsFromLocalSources:"authorityResolveEndpointsFromLocalSources",AuthorityGetCloudDiscoveryMetadataFromNetwork:"authorityGetCloudDiscoveryMetadataFromNetwork",AuthorityUpdateCloudDiscoveryMetadata:"authorityUpdateCloudDiscoveryMetadata",AuthorityGetEndpointMetadataFromNetwork:"authorityGetEndpointMetadataFromNetwork",AuthorityUpdateEndpointMetadata:"authorityUpdateEndpointMetadata",AuthorityUpdateMetadataWithRegionalInformation:"authorityUpdateMetadataWithRegionalInformation",RegionDiscoveryDetectRegion:"regionDiscoveryDetectRegion",RegionDiscoveryGetRegionFromIMDS:"regionDiscoveryGetRegionFromIMDS",RegionDiscoveryGetCurrentVersion:"regionDiscoveryGetCurrentVersion",AcquireTokenByCodeAsync:"acquireTokenByCodeAsync",GetEndpointMetadataFromNetwork:"getEndpointMetadataFromNetwork",GetCloudDiscoveryMetadataFromNetworkMeasurement:"getCloudDiscoveryMetadataFromNetworkMeasurement",HandleRedirectPromiseMeasurement:"handleRedirectPromiseMeasurement",UpdateCloudDiscoveryMetadataMeasurement:"updateCloudDiscoveryMetadataMeasurement",UsernamePasswordClientAcquireToken:"usernamePasswordClientAcquireToken",NativeMessageHandlerHandshake:"nativeMessageHandlerHandshake",NativeGenerateAuthResult:"nativeGenerateAuthResult",RemoveHiddenIframe:"removeHiddenIframe",ClearTokensAndKeysWithClaims:"clearTokensAndKeysWithClaims",CacheManagerGetRefreshToken:"cacheManagerGetRefreshToken",GeneratePkceCodes:"generatePkceCodes",GenerateCodeVerifier:"generateCodeVerifier",GenerateCodeChallengeFromVerifier:"generateCodeChallengeFromVerifier",Sha256Digest:"sha256Digest",GetRandomValues:"getRandomValues"},lVt={NotStarted:0,InProgress:1,Completed:2};/*! @azure/msal-common v14.3.0 2023-10-30 */const q3=(n,e,t,i,r)=>(...o)=>{t.trace(`Executing function ${e}`);const s=i==null?void 0:i.startMeasurement(e,r);try{const a=n(...o);return s==null||s.end({success:!0}),t.trace(`Returning result from ${e}`),a}catch(a){t.trace(`Error occurred in ${e}`);try{t.trace(JSON.stringify(a))}catch{t.trace("Unable to print error message.")}throw s==null||s.end({success:!1}),a}},Mn=(n,e,t,i,r)=>(...o)=>{t.trace(`Executing function ${e}`);const s=i==null?void 0:i.startMeasurement(e,r);return i==null||i.setPreQueueTime(e,r),n(...o).then(a=>(t.trace(`Returning result from ${e}`),s==null||s.end({success:!0}),a)).catch(a=>{t.trace(`Error occurred in ${e}`);try{t.trace(JSON.stringify(a))}catch{t.trace("Unable to print error message.")}throw s==null||s.end({success:!1}),a})};/*! @azure/msal-common v14.3.0 2023-10-30 */class Nj{constructor(e,t,i,r){this.networkInterface=e,this.logger=t,this.performanceClient=i,this.correlationId=r}async detectRegion(e,t){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(ut.RegionDiscoveryDetectRegion,this.correlationId);let i=e;if(i)t.region_source=xT.ENVIRONMENT_VARIABLE;else{const o=Nj.IMDS_OPTIONS;try{const s=await Mn(this.getRegionFromIMDS.bind(this),ut.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(st.IMDS_VERSION,o);if(s.status===j6.httpSuccess&&(i=s.body,t.region_source=xT.IMDS),s.status===j6.httpBadRequest){const a=await Mn(this.getCurrentVersion.bind(this),ut.RegionDiscoveryGetCurrentVersion,this.logger,this.performanceClient,this.correlationId)(o);if(!a)return t.region_source=xT.FAILED_AUTO_DETECTION,null;const l=await Mn(this.getRegionFromIMDS.bind(this),ut.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(a,o);l.status===j6.httpSuccess&&(i=l.body,t.region_source=xT.IMDS)}}catch{return t.region_source=xT.FAILED_AUTO_DETECTION,null}}return i||(t.region_source=xT.FAILED_AUTO_DETECTION),i||null}async getRegionFromIMDS(e,t){var i;return(i=this.performanceClient)==null||i.addQueueMeasurement(ut.RegionDiscoveryGetRegionFromIMDS,this.correlationId),this.networkInterface.sendGetRequestAsync(`${st.IMDS_ENDPOINT}?api-version=${e}&format=text`,t,st.IMDS_TIMEOUT)}async getCurrentVersion(e){var t;(t=this.performanceClient)==null||t.addQueueMeasurement(ut.RegionDiscoveryGetCurrentVersion,this.correlationId);try{const i=await this.networkInterface.sendGetRequestAsync(`${st.IMDS_ENDPOINT}?format=json`,e);return i.status===j6.httpBadRequest&&i.body&&i.body["newest-versions"]&&i.body["newest-versions"].length>0?i.body["newest-versions"][0]:null}catch{return null}}}Nj.IMDS_OPTIONS={headers:{Metadata:"true"}};/*! @azure/msal-common v14.3.0 2023-10-30 */class md{constructor(e,t,i,r,o,s,a){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=i,this.authorityOptions=r,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=o,this.performanceClient=s,this.correlationId=a,this.regionDiscovery=new Nj(t,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(st.CIAM_AUTH_URL))return Pm.Ciam;const t=e.PathSegments;if(t.length)switch(t[0].toLowerCase()){case st.ADFS:return Pm.Adfs;case st.DSTS:return Pm.Dsts}return Pm.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new tr(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw dn(ly)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw dn(ly)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw dn(ly)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw dn(h9e);return this.replacePath(this.metadata.end_session_endpoint)}else throw dn(ly)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw dn(ly)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw dn(ly)}canReplaceTenant(e){return e.PathSegments.length===1&&!md.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===Pm.Default&&this.protocolMode===Ky.AAD}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let t=e;const r=new tr(this.metadata.canonical_authority).getUrlComponents(),o=r.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((a,l)=>{let c=o[l];if(l===0&&this.canReplaceTenant(r)){const u=new tr(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];c!==u&&(this.logger.verbose(`Replacing tenant domain name ${c} with id ${u}`),c=u)}a!==c&&(t=t.replace(`/${c}/`,`/${a}/`))}),this.replaceTenant(t)}get defaultOpenIdConfigurationEndpoint(){const e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===Pm.Adfs||this.protocolMode!==Ky.AAD&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(ut.AuthorityResolveEndpointsAsync,this.correlationId);const e=this.getCurrentMetadataEntity(),t=await Mn(this.updateCloudDiscoveryMetadata.bind(this),ut.AuthorityUpdateCloudDiscoveryMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const i=await Mn(this.updateEndpointMetadata.bind(this),ut.AuthorityUpdateEndpointMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,t,{source:i})}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);return e||(e=new Yie,e.updateCanonicalAuthority(this.canonicalAuthority)),e}updateCachedMetadata(e,t,i){t!==$f.CACHE&&(i==null?void 0:i.source)!==$f.CACHE&&(e.resetExpiresAt(),e.updateCanonicalAuthority(this.canonicalAuthority));const r=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache);this.cacheManager.setAuthorityMetadata(r,e),this.metadata=e}async updateEndpointMetadata(e){var r,o,s;(r=this.performanceClient)==null||r.addQueueMeasurement(ut.AuthorityUpdateEndpointMetadata,this.correlationId);const t=this.updateEndpointMetadataFromLocalSources(e);if(t){if(t.source===$f.HARDCODED_VALUES&&(o=this.authorityOptions.azureRegionConfiguration)!=null&&o.azureRegion&&t.metadata){const a=await Mn(this.updateMetadataWithRegionalInformation.bind(this),ut.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(t.metadata);e.updateEndpointMetadata(a,!1)}return t.source}let i=await Mn(this.getEndpointMetadataFromNetwork.bind(this),ut.AuthorityGetEndpointMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(i)return(s=this.authorityOptions.azureRegionConfiguration)!=null&&s.azureRegion&&(i=await Mn(this.updateMetadataWithRegionalInformation.bind(this),ut.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(i)),e.updateEndpointMetadata(i,!0),$f.NETWORK;throw dn(e9e,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration");const t=this.getEndpointMetadataFromConfig();if(t)return this.logger.verbose("Found endpoint metadata in authority configuration"),e.updateEndpointMetadata(t,!1),{source:$f.CONFIG};if(this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values."),this.authorityOptions.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get endpoint metadata from the network metadata cache.");else{const r=this.getEndpointMetadataFromHardcodedValues();if(r)return e.updateEndpointMetadata(r,!1),{source:$f.HARDCODED_VALUES,metadata:r};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.")}const i=e.isExpired();return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!i?(this.logger.verbose("Found endpoint metadata in the cache."),{source:$f.CACHE}):(i&&this.logger.verbose("The metadata entity is expired."),null)}isAuthoritySameType(e){return new tr(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw qs(S9e)}return null}async getEndpointMetadataFromNetwork(){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(ut.AuthorityGetEndpointMetadataFromNetwork,this.correlationId);const e={},t=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from ${t}`);try{const r=await this.networkInterface.sendGetRequestAsync(t,e);return oVt(r.body)?r.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration"),null)}catch(r){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${r}`),null}}getEndpointMetadataFromHardcodedValues(){return this.canonicalAuthority in kke?kke[this.canonicalAuthority]:null}async updateMetadataWithRegionalInformation(e){var i,r,o;(i=this.performanceClient)==null||i.addQueueMeasurement(ut.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId);const t=(r=this.authorityOptions.azureRegionConfiguration)==null?void 0:r.azureRegion;if(t){if(t!==st.AZURE_REGION_AUTO_DISCOVER_FLAG)return this.regionDiscoveryMetadata.region_outcome=sX.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=t,md.replaceWithRegionalInformation(e,t);const s=await Mn(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),ut.RegionDiscoveryDetectRegion,this.logger,this.performanceClient,this.correlationId)((o=this.authorityOptions.azureRegionConfiguration)==null?void 0:o.environmentRegion,this.regionDiscoveryMetadata);if(s)return this.regionDiscoveryMetadata.region_outcome=sX.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=s,md.replaceWithRegionalInformation(e,s);this.regionDiscoveryMetadata.region_outcome=sX.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(ut.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId);const t=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(t)return t;const i=await Mn(this.getCloudDiscoveryMetadataFromNetwork.bind(this),ut.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(i)return e.updateCloudDiscoveryMetadata(i,!0),$f.NETWORK;throw qs(E9e)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration"),this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities||st.NOT_APPLICABLE}`),this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata||st.NOT_APPLICABLE}`),this.logger.verbosePii(`Canonical Authority: ${e.canonical_authority||st.NOT_APPLICABLE}`);const t=this.getCloudDiscoveryMetadataFromConfig();if(t)return this.logger.verbose("Found cloud discovery metadata in authority configuration"),e.updateCloudDiscoveryMetadata(t,!1),$f.CONFIG;if(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values."),this.options.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded cloud discovery metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get cloud discovery metadata from the network metadata cache.");else{const r=q7t(this.hostnameAndPort);if(r)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),e.updateCloudDiscoveryMetadata(r,!1),$f.HARDCODED_VALUES;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.")}const i=e.isExpired();return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!i?(this.logger.verbose("Found cloud discovery metadata in the cache."),$f.CACHE):(i&&this.logger.verbose("The metadata entity is expired."),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===Pm.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),md.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");const e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),t=U7(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),t)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),t;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch{throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),qs($ge)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),md.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(ut.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId);const e=`${st.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`,t={};let i=null;try{const o=await this.networkInterface.sendGetRequestAsync(e,t);let s,a;if(sVt(o.body))s=o.body,a=s.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: ${s.tenant_discovery_endpoint}`);else if(aVt(o.body)){if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${o.status}`),s=o.body,s.error===st.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${s.error}`),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${s.error_description}`),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),a=[]}else return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),null;this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),i=U7(a,this.hostnameAndPort)}catch(o){if(o instanceof il)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata.
Error: ${o.errorCode}
Error Description: ${o.errorMessage}`);else{const s=o;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.
Error: ${s.name}
Error Description: ${s.message}`)}return null}return i||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),i=md.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),i}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(t=>tr.getDomainFromUrl(t).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,t){let i;if(t&&t.azureCloudInstance!==Oge.None){const r=t.tenant?t.tenant:st.DEFAULT_COMMON_TENANT;i=`${t.azureCloudInstance}/${r}/`}return i||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.discoveryComplete())return this.metadata.preferred_cache;throw dn(ly)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return D9e.has(e)}static isPublicCloudAuthority(e){return st.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,t,i){const r=new tr(e);r.validateAsUri();const o=r.getUrlComponents();let s=`${t}.${o.HostNameAndPort}`;this.isPublicCloudAuthority(o.HostNameAndPort)&&(s=`${t}.${st.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const a=tr.constructAuthorityUriFromObject({...r.getUrlComponents(),HostNameAndPort:s}).urlString;return i?`${a}?${i}`:a}static replaceWithRegionalInformation(e,t){const i={...e};return i.authorization_endpoint=md.buildRegionalAuthorityString(i.authorization_endpoint,t),i.token_endpoint=md.buildRegionalAuthorityString(i.token_endpoint,t,st.REGIONAL_AUTH_NON_MSI_QUERY_STRING),i.end_session_endpoint&&(i.end_session_endpoint=md.buildRegionalAuthorityString(i.end_session_endpoint,t)),i}static transformCIAMAuthority(e){let t=e;const r=new tr(e).getUrlComponents();if(r.PathSegments.length===0&&r.HostNameAndPort.endsWith(st.CIAM_AUTH_URL)){const o=r.HostNameAndPort.split(".")[0];t=`${t}${o}${st.AAD_TENANT_DOMAIN_SUFFIX}`}return t}}md.reservedTenantDomains=new Set(["{tenant}","{tenantid}",_O.COMMON,_O.CONSUMERS,_O.ORGANIZATIONS]);function R9e(n){return n.endsWith(st.FORWARD_SLASH)?n:`${n}${st.FORWARD_SLASH}`}function cVt(n){const e=n.cloudDiscoveryMetadata;let t;if(e)try{t=JSON.parse(e)}catch{throw qs($ge)}return{canonicalAuthority:n.authority?R9e(n.authority):void 0,knownAuthorities:n.knownAuthorities,cloudDiscoveryMetadata:t}}/*! @azure/msal-common v14.3.0 2023-10-30 */class yx{static async createDiscoveredInstance(e,t,i,r,o,s,a){s==null||s.addQueueMeasurement(ut.AuthorityFactoryCreateDiscoveredInstance,a);const l=md.transformCIAMAuthority(R9e(e)),c=yx.createInstance(l,t,i,r,o,s,a);try{return await Mn(c.resolveEndpointsAsync.bind(c),ut.AuthorityResolveEndpointsAsync,o,s,a)(),c}catch{throw dn(ly)}}static createInstance(e,t,i,r,o,s,a){if(!e)throw qs(Mge);return new md(e,t,i,r,o,s,a)}}/*! @azure/msal-common v14.3.0 2023-10-30 */let Wge=class{constructor(e,t){this.config=nVt(e),this.logger=new bx(this.config.loggerOptions,f9e,Nge),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new rVt(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}createTokenRequestHeaders(e){const t={};if(t[Lv.CONTENT_TYPE]=st.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case ng.HOME_ACCOUNT_ID:try{const i=II(e.credential);t[Lv.CCS_HEADER]=`Oid:${i.uid}@${i.utid}`}catch(i){this.logger.verbose("Could not parse home account ID for CCS Header: "+i)}break;case ng.UPN:t[Lv.CCS_HEADER]=`UPN: ${e.credential}`;break}return t}async executePostToTokenEndpoint(e,t,i,r,o,s){var l,c,u,d;s&&((l=this.performanceClient)==null||l.addQueueMeasurement(s,o));const a=await this.networkManager.sendPostRequest(r,e,{body:t,headers:i});return(d=this.performanceClient)==null||d.addFields({refreshTokenSize:((c=a.body.refresh_token)==null?void 0:c.length)||0,httpVerToken:((u=a.headers)==null?void 0:u[Lv.X_MS_HTTP_VERSION])||""},o),this.config.serverTelemetryManager&&a.status<500&&a.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),a}async updateAuthority(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(ut.UpdateTokenEndpointAuthority,t);const i=`https://${e}/${this.authority.tenant}/`,r=await yx.createDiscoveredInstance(i,this.networkClient,this.cacheManager,this.authority.options,this.logger,this.performanceClient,t);this.authority=r}createTokenQueryParameters(e){const t=new CO;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()}};/*! @azure/msal-common v14.3.0 2023-10-30 */const q7="no_tokens_found",N9e="native_account_unavailable",uVt="interaction_required",dVt="consent_required",hVt="login_required";/*! @azure/msal-common v14.3.0 2023-10-30 */const Ike=[uVt,dVt,hVt],fVt=["message_only","additional_action","basic_action","user_password_expired","consent_required"],gVt={[q7]:"No refresh token found in the cache. Please sign-in.",[N9e]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API."};class Gv extends il{constructor(e,t,i,r,o,s,a){super(e,t,i),Object.setPrototypeOf(this,Gv.prototype),this.timestamp=r||st.EMPTY_STRING,this.traceId=o||st.EMPTY_STRING,this.correlationId=s||st.EMPTY_STRING,this.claims=a||st.EMPTY_STRING,this.name="InteractionRequiredAuthError"}}function Lke(n,e,t){const i=!!n&&Ike.indexOf(n)>-1,r=!!t&&fVt.indexOf(t)>-1,o=!!e&&Ike.some(s=>e.indexOf(s)>-1);return i||o||r}function O9e(n){return new Gv(n,gVt[n])}/*! @azure/msal-common v14.3.0 2023-10-30 */class vL{constructor(e,t,i,r,o){this.account=e||null,this.idToken=t||null,this.accessToken=i||null,this.refreshToken=r||null,this.appMetadata=o||null}}/*! @azure/msal-common v14.3.0 2023-10-30 */class u_{static setRequestState(e,t,i){const r=u_.generateLibraryState(e,i);return t?`${r}${st.RESOURCE_DELIM}${t}`:r}static generateLibraryState(e,t){if(!e)throw dn(Uie);const i={id:e.createNewGuid()};t&&(i.meta=t);const r=JSON.stringify(i);return e.base64Encode(r)}static parseRequestState(e,t){if(!e)throw dn(Uie);if(!t)throw dn(LD);try{const i=t.split(st.RESOURCE_DELIM),r=i[0],o=i.length>1?i.slice(1).join(st.RESOURCE_DELIM):st.EMPTY_STRING,s=e.base64Decode(r),a=JSON.parse(s);return{userRequestState:o||st.EMPTY_STRING,libraryState:a}}catch{throw dn(LD)}}}/*! @azure/msal-common v14.3.0 2023-10-30 */const pVt={SW:"sw",UHW:"uhw"};class DD{constructor(e,t){this.cryptoUtils=e,this.performanceClient=t}async generateCnf(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(ut.PopTokenGenerateCnf,e.correlationId);const i=await Mn(this.generateKid.bind(this),ut.PopTokenGenerateCnf,t,this.performanceClient,e.correlationId)(e),r=this.cryptoUtils.base64Encode(JSON.stringify(i));return{kid:i.kid,reqCnfString:r,reqCnfHash:await this.cryptoUtils.hashString(r)}}async generateKid(e){var i;return(i=this.performanceClient)==null||i.addQueueMeasurement(ut.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:pVt.SW}}async signPopToken(e,t,i){return this.signPayload(e,t,i)}async signPayload(e,t,i,r){const{resourceRequestMethod:o,resourceRequestUri:s,shrClaims:a,shrNonce:l}=i,c=s?new tr(s):void 0,u=c==null?void 0:c.getUrlComponents();return await this.cryptoUtils.signJwt({at:e,ts:th.nowSeconds(),m:o==null?void 0:o.toUpperCase(),u:u==null?void 0:u.HostNameAndPort,nonce:l||this.cryptoUtils.createNewGuid(),p:u==null?void 0:u.AbsolutePath,q:u!=null&&u.QueryString?[[],u.QueryString]:void 0,client_claims:a||void 0,...r},t,i.correlationId)}}/*! @azure/msal-common v14.3.0 2023-10-30 */class AD{generateAppMetadataKey(){return AD.generateAppMetadataCacheKey(this.environment,this.clientId)}static generateAppMetadataCacheKey(e,t){return[Hie,e,t].join(Du.CACHE_KEY_SEPARATOR).toLowerCase()}static createAppMetadataEntity(e,t,i){const r=new AD;return r.clientId=e,r.environment=t,i&&(r.familyId=i),r}static isAppMetadataEntity(e,t){return t?e.indexOf(Hie)===0&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("environment"):!1}}/*! @azure/msal-common v14.3.0 2023-10-30 */class mVt{constructor(e,t){this.cache=e,this.hasChanged=t}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}/*! @azure/msal-common v14.3.0 2023-10-30 */class Cx{constructor(e,t,i,r,o,s,a){this.clientId=e,this.cacheStorage=t,this.cryptoObj=i,this.logger=r,this.serializableCache=o,this.persistencePlugin=s,this.performanceClient=a}validateServerAuthorizationCodeResponse(e,t){if(!e.state||!t)throw e.state?dn(z7,"Cached State"):dn(z7,"Server State");let i,r;try{i=decodeURIComponent(e.state)}catch{throw dn(LD,e.state)}try{r=decodeURIComponent(t)}catch{throw dn(LD,e.state)}if(i!==r)throw dn(t9e);if(e.error||e.error_description||e.suberror)throw Lke(e.error,e.error_description,e.suberror)?new Gv(e.error||"",e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||""):new ew(e.error||"",e.error_description,e.suberror)}validateTokenResponse(e,t){if(e.error||e.error_description||e.suberror){const i=`${e.error_codes} - [${e.timestamp}]: ${e.error_description} - Correlation ID: ${e.correlation_id} - Trace ID: ${e.trace_id}`,r=new ew(e.error,i,e.suberror);if(t&&e.status&&e.status>=H6.SERVER_ERROR_RANGE_START&&e.status<=H6.SERVER_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed.
${r}`);return}else if(t&&e.status&&e.status>=H6.CLIENT_ERROR_RANGE_START&&e.status<=H6.CLIENT_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token.
${r}`);return}throw Lke(e.error,e.error_description,e.suberror)?new Gv(e.error,e.error_description,e.suberror,e.timestamp||st.EMPTY_STRING,e.trace_id||st.EMPTY_STRING,e.correlation_id||st.EMPTY_STRING,e.claims||st.EMPTY_STRING):r}}async handleServerTokenResponse(e,t,i,r,o,s,a,l,c){var p;(p=this.performanceClient)==null||p.addQueueMeasurement(ut.HandleServerTokenResponse,e.correlation_id);let u;if(e.id_token){if(u=JC(e.id_token||st.EMPTY_STRING,this.cryptoObj.base64Decode),o&&o.nonce&&u.nonce!==o.nonce)throw dn(n9e);if(r.maxAge||r.maxAge===0){const m=u.auth_time;if(!m)throw dn(Lge);g9e(m,r.maxAge)}}this.homeAccountIdentifier=Kl.generateHomeAccountId(e.client_info||st.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,u);let d;o&&o.state&&(d=u_.parseRequestState(this.cryptoObj,o.state)),e.key_id=e.key_id||r.sshKid||void 0;const h=this.generateCacheRecord(e,t,i,r,u,s,o);let g;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),g=new mVt(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(g)),a&&!l&&h.account){const m=h.account.generateAccountKey();if(!this.cacheStorage.getAccount(m))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),Cx.generateAuthenticationResult(this.cryptoObj,t,h,!1,r,u,d,void 0,c)}await this.cacheStorage.saveCacheRecord(h,r.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&g&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(g))}return Cx.generateAuthenticationResult(this.cryptoObj,t,h,!1,r,u,d,e,c)}generateCacheRecord(e,t,i,r,o,s,a){const l=t.getPreferredCache();if(!l)throw dn(Age);let c,u;e.id_token&&o&&(c=Dj(this.homeAccountIdentifier,l,e.id_token,this.clientId,o.tid||""),u=Kl.createAccount({homeAccountId:this.homeAccountIdentifier,idTokenClaims:o,clientInfo:e.client_info,cloudGraphHostName:a==null?void 0:a.cloud_graph_host_name,msGraphHost:a==null?void 0:a.msgraph_host},t));let d=null;if(e.access_token){const p=e.scope?cc.fromString(e.scope):new cc(r.scopes||[]),m=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,_=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,v=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,b=i+m,y=b+_,C=v&&v>0?i+v:void 0;d=Aj(this.homeAccountIdentifier,l,e.access_token,this.clientId,(o==null?void 0:o.tid)||t.tenant,p.printScopes(),b,y,this.cryptoObj.base64Decode,C,e.token_type,s,e.key_id,r.claims,r.requestedClaimsHash)}let h=null;e.refresh_token&&(h=p9e(this.homeAccountIdentifier,l,e.refresh_token,this.clientId,e.foci,s));let g=null;return e.foci&&(g=AD.createAppMetadataEntity(this.clientId,l,e.foci)),new vL(u,c,d,h,g)}static async generateAuthenticationResult(e,t,i,r,o,s,a,l,c){var y,C,x,k;let u=st.EMPTY_STRING,d=[],h=null,g,p,m=st.EMPTY_STRING;if(i.accessToken){if(i.accessToken.tokenType===Us.POP){const I=new DD(e),{secret:L,keyId:D}=i.accessToken;if(!D)throw dn(Rge);u=await I.signPopToken(L,D,o)}else u=i.accessToken.secret;d=cc.fromString(i.accessToken.target).asArray(),h=new Date(Number(i.accessToken.expiresOn)*1e3),g=new Date(Number(i.accessToken.extendedExpiresOn)*1e3),i.accessToken.refreshOn&&(p=new Date(Number(i.accessToken.refreshOn)*1e3))}i.appMetadata&&(m=i.appMetadata.familyId===vO?vO:"");const _=(s==null?void 0:s.oid)||(s==null?void 0:s.sub)||"",v=(s==null?void 0:s.tid)||"";l!=null&&l.spa_accountid&&i.account&&(i.account.nativeAccountId=l==null?void 0:l.spa_accountid);const b=i.account?{...i.account.getAccountInfo(),idTokenClaims:s}:null;return{authority:t.canonicalAuthority,uniqueId:_,tenantId:v,scopes:d,account:b,idToken:((y=i==null?void 0:i.idToken)==null?void 0:y.secret)||"",idTokenClaims:s||{},accessToken:u,fromCache:r,expiresOn:h,extExpiresOn:g,refreshOn:p,correlationId:o.correlationId,requestId:c||st.EMPTY_STRING,familyId:m,tokenType:((C=i.accessToken)==null?void 0:C.tokenType)||st.EMPTY_STRING,state:a?a.userRequestState:st.EMPTY_STRING,cloudGraphHostName:((x=i.account)==null?void 0:x.cloudGraphHostName)||st.EMPTY_STRING,msGraphHost:((k=i.account)==null?void 0:k.msGraphHost)||st.EMPTY_STRING,code:l==null?void 0:l.spa_code,fromNativeBroker:!1}}}/*! @azure/msal-common v14.3.0 2023-10-30 */class P9e extends Wge{constructor(e,t){var i;super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=(i=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:i.defaultScopes}async getAuthCodeUrl(e){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(ut.GetAuthCodeUrl,e.correlationId);const t=await Mn(this.createAuthCodeUrlQueryString.bind(this),ut.AuthClientCreateQueryString,this.logger,this.performanceClient,e.correlationId)(e);return tr.appendQueryString(this.authority.authorizationEndpoint,t)}async acquireToken(e,t){var a,l;if((a=this.performanceClient)==null||a.addQueueMeasurement(ut.AuthClientAcquireToken,e.correlationId),!e.code)throw dn(o9e);const i=th.nowSeconds(),r=await Mn(this.executeTokenRequest.bind(this),ut.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),o=(l=r.headers)==null?void 0:l[Lv.X_MS_REQUEST_ID],s=new Cx(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return s.validateTokenResponse(r.body),Mn(s.handleServerTokenResponse.bind(s),ut.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,i,e,t,void 0,void 0,void 0,o)}handleFragmentResponse(e,t){var o;const i=new Cx(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null),r=tr.getDeserializedCodeResponse((o=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:o.serverResponseType,e);if(i.validateServerAuthorizationCodeResponse(r,t),!r.code)throw dn(u9e);return{...r,code:r.code}}getLogoutUri(e){if(!e)throw qs(C9e);const t=this.createLogoutUrlQueryString(e);return tr.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){var c,u;(c=this.performanceClient)==null||c.addQueueMeasurement(ut.AuthClientExecuteTokenRequest,t.correlationId);const i=this.createTokenQueryParameters(t),r=tr.appendQueryString(e.tokenEndpoint,i),o=await Mn(this.createTokenRequestBody.bind(this),ut.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,t.correlationId)(t);let s;if(t.clientInfo)try{const d=Kie(t.clientInfo,this.cryptoUtils);s={credential:`${d.uid}${Du.CLIENT_INFO_SEPARATOR}${d.utid}`,type:ng.HOME_ACCOUNT_ID}}catch(d){this.logger.verbose("Could not parse client info for CCS Header: "+d)}const a=this.createTokenRequestHeaders(s||t.ccsCredential),l={clientId:((u=t.tokenBodyParameters)==null?void 0:u.clientId)||this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid};return Mn(this.executePostToTokenEndpoint.bind(this),ut.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,t.correlationId)(r,o,a,l,t.correlationId,ut.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,s;(o=this.performanceClient)==null||o.addQueueMeasurement(ut.AuthClientCreateTokenRequestBody,e.correlationId);const t=new CO;if(t.addClientId(((s=e.tokenBodyParameters)==null?void 0:s[mr.CLIENT_ID])||this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):WS.validateRedirectUri(e.redirectUri),t.addScopes(e.scopes,!0,this.oidcDefaultScopes),t.addAuthorizationCode(e.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&!Gie(this.config)&&t.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&t.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const a=this.config.clientCredentials.clientAssertion;t.addClientAssertion(a.assertion),t.addClientAssertionType(a.assertionType)}if(t.addGrantType(Y8e.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),e.authenticationScheme===Us.POP){const a=new DD(this.cryptoUtils,this.performanceClient),l=await Mn(a.generateCnf.bind(a),ut.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger);t.addPopToken(l.reqCnfString)}else if(e.authenticationScheme===Us.SSH)if(e.sshJwk)t.addSshJwk(e.sshJwk);else throw qs(Rj);const i=e.correlationId||this.config.cryptoInterface.createNewGuid();t.addCorrelationId(i),(!qf.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities);let r;if(e.clientInfo)try{const a=Kie(e.clientInfo,this.cryptoUtils);r={credential:`${a.uid}${Du.CLIENT_INFO_SEPARATOR}${a.utid}`,type:ng.HOME_ACCOUNT_ID}}catch(a){this.logger.verbose("Could not parse client info for CCS Header: "+a)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case ng.HOME_ACCOUNT_ID:try{const a=II(r.credential);t.addCcsOid(a)}catch(a){this.logger.verbose("Could not parse home account ID for CCS Header: "+a)}break;case ng.UPN:t.addCcsUpn(r.credential);break}return e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[mr.RETURN_SPA_CODE])&&t.addExtraQueryParameters({[mr.RETURN_SPA_CODE]:"1"}),t.createQueryString()}async createAuthCodeUrlQueryString(e){var o,s;(o=this.performanceClient)==null||o.addQueueMeasurement(ut.AuthClientCreateQueryString,e.correlationId);const t=new CO;t.addClientId(((s=e.extraQueryParameters)==null?void 0:s[mr.CLIENT_ID])||this.config.authOptions.clientId);const i=[...e.scopes||[],...e.extraScopesToConsent||[]];t.addScopes(i,!0,this.oidcDefaultScopes),t.addRedirectUri(e.redirectUri);const r=e.correlationId||this.config.cryptoInterface.createNewGuid();if(t.addCorrelationId(r),t.addResponseMode(e.responseMode),t.addResponseTypeCode(),t.addLibraryInfo(this.config.libraryInfo),Gie(this.config)||t.addApplicationTelemetry(this.config.telemetry.application),t.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&t.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&t.addPrompt(e.prompt),e.domainHint&&t.addDomainHint(e.domainHint),e.prompt!==Ed.SELECT_ACCOUNT)if(e.sid&&e.prompt===Ed.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),t.addSid(e.sid);else if(e.account){const a=this.extractAccountSid(e.account),l=this.extractLoginHint(e.account);if(l){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),t.addLoginHint(l);try{const c=II(e.account.homeAccountId);t.addCcsOid(c)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(a&&e.prompt===Ed.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),t.addSid(a);try{const c=II(e.account.homeAccountId);t.addCcsOid(c)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),t.addLoginHint(e.account.username);try{const c=II(e.account.homeAccountId);t.addCcsOid(c)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&t.addNonce(e.nonce),e.state&&t.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters),e.nativeBroker&&(t.addNativeBroker(),e.authenticationScheme===Us.POP)){const a=new DD(this.cryptoUtils),l=await Mn(a.generateCnf.bind(a),ut.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger);t.addPopToken(l.reqCnfHash)}return t.createQueryString()}createLogoutUrlQueryString(e){const t=new CO;return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters),t.createQueryString()}extractAccountSid(e){var t;return((t=e.idTokenClaims)==null?void 0:t.sid)||null}extractLoginHint(e){var t;return((t=e.idTokenClaims)==null?void 0:t.login_hint)||null}}/*! @azure/msal-common v14.3.0 2023-10-30 */class Qie extends Wge{constructor(e,t){super(e,t)}async acquireToken(e){var s,a;(s=this.performanceClient)==null||s.addQueueMeasurement(ut.RefreshTokenClientAcquireToken,e.correlationId);const t=th.nowSeconds(),i=await Mn(this.executeTokenRequest.bind(this),ut.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),r=(a=i.headers)==null?void 0:a[Lv.X_MS_REQUEST_ID],o=new Cx(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return o.validateTokenResponse(i.body),Mn(o.handleServerTokenResponse.bind(o),ut.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(i.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,r)}async acquireTokenByRefreshToken(e){var i;if(!e)throw qs(y9e);if((i=this.performanceClient)==null||i.addQueueMeasurement(ut.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw dn(Dge);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return Mn(this.acquireTokenWithCachedRefreshToken.bind(this),ut.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(r){const o=r instanceof Gv&&r.errorCode===q7,s=r instanceof ew&&r.errorCode===bke.INVALID_GRANT_ERROR&&r.subError===bke.CLIENT_MISMATCH_ERROR;if(o||s)return Mn(this.acquireTokenWithCachedRefreshToken.bind(this),ut.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw r}return Mn(this.acquireTokenWithCachedRefreshToken.bind(this),ut.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(ut.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const i=q3(this.cacheManager.getRefreshToken.bind(this.cacheManager),ut.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,t);if(!i)throw O9e(q7);const r={...e,refreshToken:i.secret,authenticationScheme:e.authenticationScheme||Us.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:ng.HOME_ACCOUNT_ID}};return Mn(this.acquireToken.bind(this),ut.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(r)}async executeTokenRequest(e,t){var l,c;(l=this.performanceClient)==null||l.addQueueMeasurement(ut.RefreshTokenClientExecuteTokenRequest,e.correlationId);const i=this.createTokenQueryParameters(e),r=tr.appendQueryString(t.tokenEndpoint,i),o=await Mn(this.createTokenRequestBody.bind(this),ut.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),s=this.createTokenRequestHeaders(e.ccsCredential),a={clientId:((c=e.tokenBodyParameters)==null?void 0:c.clientId)||this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return Mn(this.executePostToTokenEndpoint.bind(this),ut.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(r,o,s,a,e.correlationId,ut.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var r,o,s;(r=this.performanceClient)==null||r.addQueueMeasurement(ut.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const t=e.correlationId,i=new CO;if(i.addClientId(((o=e.tokenBodyParameters)==null?void 0:o[mr.CLIENT_ID])||this.config.authOptions.clientId),e.redirectUri&&i.addRedirectUri(e.redirectUri),i.addScopes(e.scopes,!0,(s=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:s.defaultScopes),i.addGrantType(Y8e.REFRESH_TOKEN_GRANT),i.addClientInfo(),i.addLibraryInfo(this.config.libraryInfo),i.addApplicationTelemetry(this.config.telemetry.application),i.addThrottling(),this.serverTelemetryManager&&!Gie(this.config)&&i.addServerTelemetry(this.serverTelemetryManager),i.addCorrelationId(t),i.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&i.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const a=this.config.clientCredentials.clientAssertion;i.addClientAssertion(a.assertion),i.addClientAssertionType(a.assertionType)}if(e.authenticationScheme===Us.POP){const a=new DD(this.cryptoUtils,this.performanceClient),l=await Mn(a.generateCnf.bind(a),ut.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger);i.addPopToken(l.reqCnfString)}else if(e.authenticationScheme===Us.SSH)if(e.sshJwk)i.addSshJwk(e.sshJwk);else throw qs(Rj);if((!qf.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&i.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case ng.HOME_ACCOUNT_ID:try{const a=II(e.ccsCredential.credential);i.addCcsOid(a)}catch(a){this.logger.verbose("Could not parse home account ID for CCS Header: "+a)}break;case ng.UPN:i.addCcsUpn(e.ccsCredential.credential);break}return e.tokenBodyParameters&&i.addExtraQueryParameters(e.tokenBodyParameters),i.createQueryString()}}/*! @azure/msal-common v14.3.0 2023-10-30 */class _Vt extends Wge{constructor(e,t){super(e,t)}async acquireToken(e){try{const[t,i]=await this.acquireCachedToken(e);return i===HS.PROACTIVELY_REFRESHED&&(this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed."),new Qie(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch(()=>{})),t}catch(t){if(t instanceof Lj&&t.errorCode===U1)return new Qie(this.config,this.performanceClient).acquireTokenByRefreshToken(e);throw t}}async acquireCachedToken(e){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(ut.SilentFlowClientAcquireCachedToken,e.correlationId);let t=HS.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!qf.isEmptyObj(e.claims))throw this.setCacheOutcome(HS.FORCE_REFRESH_OR_CLAIMS,e.correlationId),dn(U1);if(!e.account)throw dn(Dge);const i=e.authority||this.authority.getPreferredCache(),r=this.cacheManager.readCacheRecord(e.account,e,i);if(r.accessToken){if(th.wasClockTurnedBack(r.accessToken.cachedAt)||th.isTokenExpired(r.accessToken.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(HS.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),dn(U1);r.accessToken.refreshOn&&th.isTokenExpired(r.accessToken.refreshOn,0)&&(t=HS.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(HS.NO_CACHED_ACCESS_TOKEN,e.correlationId),dn(U1);return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await Mn(this.generateResultFromCacheRecord.bind(this),ut.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(r,e),t]}setCacheOutcome(e,t){var i,r;(i=this.serverTelemetryManager)==null||i.setCacheOutcome(e),(r=this.performanceClient)==null||r.addFields({cacheOutcome:e},t),this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(ut.SilentFlowClientGenerateResultFromCacheRecord,t.correlationId);let i;if(e.idToken&&(i=JC(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||t.maxAge===0){const o=i==null?void 0:i.auth_time;if(!o)throw dn(Lge);g9e(o,t.maxAge)}return await Cx.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,i)}}/*! @azure/msal-common v14.3.0 2023-10-30 */class K7{constructor(){this.failedRequests=[],this.errors=[],this.cacheHits=0}static isServerTelemetryEntity(e,t){const i=e.indexOf(Cu.CACHE_KEY)===0;let r=!0;return t&&(r=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),i&&r}}/*! @azure/msal-common v14.3.0 2023-10-30 */class Dke{static isThrottlingEntity(e,t){let i=!1;e&&(i=e.indexOf(yO.THROTTLING_PREFIX)===0);let r=!0;return t&&(r=t.hasOwnProperty("throttleTime")),i&&r}}/*! @azure/msal-common v14.3.0 2023-10-30 */const vVt={sendGetRequestAsync:()=>Promise.reject(dn(ho)),sendPostRequestAsync:()=>Promise.reject(dn(ho))};/*! @azure/msal-common v14.3.0 2023-10-30 */const M9e="missing_kid_error",F9e="missing_alg_error";/*! @azure/msal-common v14.3.0 2023-10-30 */const bVt={[M9e]:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.",[F9e]:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."};class zge extends il{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,zge.prototype)}}function Ake(n){return new zge(n,bVt[n])}/*! @azure/msal-common v14.3.0 2023-10-30 */class jge{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw Ake(M9e);if(!e.alg)throw Ake(F9e);const t=new jge({typ:e.typ||C7t.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}}/*! @azure/msal-common v14.3.0 2023-10-30 */class G7{constructor(e,t){this.cacheOutcome=HS.NOT_APPLICABLE,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||st.EMPTY_STRING,this.wrapperVer=e.wrapperVer||st.EMPTY_STRING,this.telemetryCacheKey=Cu.CACHE_KEY+Du.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${Cu.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer].join(Cu.VALUE_SEPARATOR),i=this.getRegionDiscoveryFields(),r=[e,i].join(Cu.VALUE_SEPARATOR);return[Cu.SCHEMA_VERSION,r,t].join(Cu.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=G7.maxErrorsToSend(e),i=e.failedRequests.slice(0,2*t).join(Cu.VALUE_SEPARATOR),r=e.errors.slice(0,t).join(Cu.VALUE_SEPARATOR),o=e.errors.length,s=t<o?Cu.OVERFLOW_TRUE:Cu.OVERFLOW_FALSE,a=[o,s].join(Cu.VALUE_SEPARATOR);return[Cu.SCHEMA_VERSION,e.cacheHits,i,r,a].join(Cu.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=Cu.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof il?e.subError?t.errors.push(e.subError):e.errorCode?t.errors.push(e.errorCode):t.errors.push(e.toString()):t.errors.push(e.toString()):t.errors.push(Cu.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits}getLastRequests(){const e=new K7;return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),t=G7.maxErrorsToSend(e),i=e.errors.length;if(t===i)this.cacheManager.removeItem(this.telemetryCacheKey);else{const r=new K7;r.failedRequests=e.failedRequests.slice(t*2),r.errors=e.errors.slice(t),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,r)}}static maxErrorsToSend(e){let t,i=0,r=0;const o=e.errors.length;for(t=0;t<o;t++){const s=e.failedRequests[2*t]||st.EMPTY_STRING,a=e.failedRequests[2*t+1]||st.EMPTY_STRING,l=e.errors[t]||st.EMPTY_STRING;if(r+=s.toString().length+a.toString().length+l.length+3,r<Cu.MAX_LAST_HEADER_BYTES)i+=1;else break}return i}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||st.EMPTY_STRING),e.push(this.regionSource||st.EMPTY_STRING),e.push(this.regionOutcome||st.EMPTY_STRING),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}}/*! @azure/msal-common v14.3.0 2023-10-30 */class Rke{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class yVt{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:lVt.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new Rke}}startPerformanceMeasurement(){return new Rke}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-browser v3.4.0 2023-10-30 */const Uge="pkce_not_created",B9e="crypto_nonexistent",Oj="empty_navigate_uri",Pj="hash_empty_error",$9e="no_state_in_hash",qge="hash_does_not_contain_known_properties",V9e="unable_to_parse_state",H9e="state_interaction_type_mismatch",W9e="interaction_in_progress",z9e="popup_window_error",j9e="empty_window_error",wx="user_cancelled",U9e="monitor_popup_timeout",q9e="monitor_window_timeout",K9e="redirect_in_iframe",G9e="block_iframe_reload",Y9e="block_nested_popups",CVt="iframe_closed_prematurely",Mj="silent_logout_unsupported",Q9e="no_account_error",X9e="silent_prompt_value_error",Z9e="no_token_request_cache_error",J9e="unable_to_parse_token_request_cache_error",Kge="no_cached_authority_error",wVt="auth_request_not_set_error",SVt="invalid_cache_type",e7e="non_browser_environment",JT="database_not_open",Y7="no_network_connectivity",t7e="post_request_failed",n7e="get_request_failed",Xie="failed_to_parse_response",wm="unable_to_load_token",Gge="crypto_key_not_found",i7e="auth_code_required",r7e="auth_code_or_nativeAccountId_required",o7e="spa_code_and_nativeAccountId_present",Yge="database_unavailable",s7e="unable_to_acquire_token_from_native_platform",a7e="native_handshake_timeout",l7e="native_extension_not_installed",K3="native_connection_not_established",c7e="uninitialized_public_client_application",u7e="native_prompt_not_supported",d7e="invalid_base64_string";/*! @azure/msal-browser v3.4.0 2023-10-30 */const qb="For more visit: aka.ms/msaljs/browser-errors",EVt={[Uge]:"The PKCE code challenge and verifier could not be generated.",[B9e]:"The crypto object or function is not available.",[Oj]:"Navigation URI is empty. Please check stack trace for more info.",[Pj]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${qb}`,[$9e]:"Hash does not contain state. Please verify that the request originated from msal.",[qge]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${qb}`,[V9e]:"Unable to parse state. Please verify that the request originated from msal.",[H9e]:"Hash contains state but the interaction type does not match the caller.",[W9e]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${qb}`,[z9e]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[j9e]:"window.open returned null or undefined window object.",[wx]:"User cancelled the flow.",[U9e]:`Token acquisition in popup failed due to timeout. ${qb}`,[q9e]:`Token acquisition in iframe failed due to timeout. ${qb}`,[K9e]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[G9e]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${qb}`,[Y9e]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[CVt]:"The iframe being monitored was closed prematurely.",[Mj]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[Q9e]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[X9e]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[Z9e]:"No token request found in cache.",[J9e]:"The cached token request could not be parsed.",[Kge]:"No cached authority found.",[wVt]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[SVt]:"Invalid cache type",[e7e]:"Login and token requests are not supported in non-browser environments.",[JT]:"Database is not open!",[Y7]:"No network connectivity. Check your internet connection.",[t7e]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[n7e]:"Network request failed. Please check the network trace to determine root cause.",[Xie]:"Failed to parse network response. Check network trace.",[wm]:"Error loading token to cache.",[Gge]:"Cryptographic Key or Keypair not found in browser storage.",[i7e]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[r7e]:"An authorization code or nativeAccountId must be provided to this flow.",[o7e]:"Request cannot contain both spa code and native account id.",[Yge]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[s7e]:`Unable to acquire token from native platform. ${qb}`,[a7e]:"Timed out while attempting to establish connection to browser extension",[l7e]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[K3]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${qb}`,[c7e]:`You must call and await the initialize function before attempting to call any other MSAL API. ${qb}`,[u7e]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[d7e]:"Invalid base64 encoded string."};class G3 extends il{constructor(e){super(e,EVt[e]),Object.setPrototypeOf(this,G3.prototype),this.name="BrowserAuthError"}}function qn(n){return new G3(n)}/*! @azure/msal-browser v3.4.0 2023-10-30 */const zm={INTERACTION_IN_PROGRESS_VALUE:"interaction_in_progress",INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},yN={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},EE={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},ru={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},Nke={GET:"GET",POST:"POST"},as={AUTHORITY:"authority",ACQUIRE_TOKEN_ACCOUNT:"acquireToken.account",SESSION_STATE:"session.state",REQUEST_STATE:"request.state",NONCE_IDTOKEN:"nonce.id_token",ORIGIN_URI:"request.origin",RENEW_STATUS:"token.renew.status",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",SCOPES:"scopes",INTERACTION_STATUS_KEY:"interaction.status",CCS_CREDENTIAL:"ccs.credential",CORRELATION_ID:"request.correlationId",NATIVE_REQUEST:"request.native",REDIRECT_CONTEXT:"request.redirect.context"},Q0={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys"},U6={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},Da={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var pi;(function(n){n.Redirect="redirect",n.Popup="popup",n.Silent="silent",n.None="none"})(pi||(pi={}));const Oke={scopes:j3},h7e="jwk",Zie="msal.db",xVt=1,kVt=`${Zie}.keys`,Jg={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5};/*! @azure/msal-browser v3.4.0 2023-10-30 */function TVt(n){n.location.hash="",typeof n.history.replaceState=="function"&&n.history.replaceState(null,"",`${n.location.origin}${n.location.pathname}${n.location.search}`)}function IVt(n){const e=n.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function Qge(){return window.parent!==window}function LVt(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${zm.POPUP_NAME_PREFIX}.`)===0}function Ry(){return window.location.href.split("?")[0].split("#")[0]}function DVt(){const e=new tr(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function aX(){if(tr.hashContainsKnownProperties(window.location.hash)&&Qge())throw qn(G9e)}function AVt(n,e){const t=Qge();if(n===pi.Redirect&&t&&!e)throw qn(K9e)}function RVt(){if(LVt())throw qn(Y9e)}function NVt(n){if(!n)throw qn(e7e)}function Pke(n){if(!n)throw qn(c7e)}function f7e(n){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(n).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}/*! @azure/msal-browser v3.4.0 2023-10-30 */class Q7{navigateInternal(e,t){return Q7.defaultNavigateWindow(e,t)}navigateExternal(e,t){return Q7.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(i=>{setTimeout(()=>{i(!0)},t.timeout)})}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class OVt{async sendGetRequestAsync(e,t){let i;try{i=await fetch(e,{method:Nke.GET,headers:this.getFetchHeaders(t)})}catch{throw window.navigator.onLine?qn(n7e):qn(Y7)}try{return{headers:this.getHeaderDict(i.headers),body:await i.json(),status:i.status}}catch{throw qn(Xie)}}async sendPostRequestAsync(e,t){const i=t&&t.body||st.EMPTY_STRING;let r;try{r=await fetch(e,{method:Nke.POST,headers:this.getFetchHeaders(t),body:i})}catch{throw window.navigator.onLine?qn(t7e):qn(Y7)}try{return{headers:this.getHeaderDict(r.headers),body:await r.json(),status:r.status}}catch{throw qn(Xie)}}getFetchHeaders(e){const t=new Headers;if(!(e&&e.headers))return t;const i=e.headers;return Object.keys(i).forEach(r=>{t.append(r,i[r])}),t}getHeaderDict(e){const t={};return e.forEach((i,r)=>{t[r]=i}),t}}/*! @azure/msal-browser v3.4.0 2023-10-30 */const PVt=6e4,Jie=6e3,MVt=3e4,FVt=2e3;function BVt({auth:n,cache:e,system:t,telemetry:i},r){const o={clientId:st.EMPTY_STRING,authority:`${st.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:st.EMPTY_STRING,authorityMetadata:st.EMPTY_STRING,redirectUri:st.EMPTY_STRING,postLogoutRedirectUri:st.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:Ky.AAD,OIDCOptions:{serverResponseType:U3.FRAGMENT,defaultScopes:[st.OPENID_SCOPE,st.PROFILE_SCOPE,st.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:Oge.None,tenant:st.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1},s={cacheLocation:ru.SessionStorage,temporaryCacheLocation:ru.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===ru.LocalStorage),claimsBasedCachingEnabled:!1},a={loggerCallback:()=>{},logLevel:Qc.Info,piiLoggingEnabled:!1},c={...{...A9e,loggerOptions:a,networkClient:r?new OVt:vVt,navigationClient:new Q7,loadFrameTimeout:0,windowHashTimeout:(t==null?void 0:t.loadFrameTimeout)||PVt,iframeHashTimeout:(t==null?void 0:t.loadFrameTimeout)||Jie,navigateFrameWait:0,redirectNavigationTimeout:MVt,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(t==null?void 0:t.nativeBrokerHandshakeTimeout)||FVt,pollIntervalMilliseconds:zm.DEFAULT_POLL_INTERVAL_MS},...t,loggerOptions:(t==null?void 0:t.loggerOptions)||a},u={application:{appName:st.EMPTY_STRING,appVersion:st.EMPTY_STRING},client:new yVt};if((n==null?void 0:n.protocolMode)!==Ky.OIDC&&(n!=null&&n.OIDCOptions)&&new bx(c.loggerOptions).warning(JSON.stringify(qs(k9e))),n!=null&&n.protocolMode&&n.protocolMode!==Ky.AAD&&(c!=null&&c.allowNativeBroker))throw qs(T9e);return{auth:{...o,...n,OIDCOptions:{...o.OIDCOptions,...n==null?void 0:n.OIDCOptions}},cache:{...s,...e},system:c,telemetry:{...u,...i}}}/*! @azure/msal-browser v3.4.0 2023-10-30 */const $Vt="@azure/msal-browser",Xge="3.4.0";/*! @azure/msal-browser v3.4.0 2023-10-30 */class VVt{constructor(e){this.browserEnvironment=typeof window<"u",this.config=BVt(e,this.browserEnvironment),this.logger=new bx(this.config.system.loggerOptions,$Vt,Xge),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class Sx extends VVt{getModuleName(){return Sx.MODULE_NAME}getId(){return Sx.ID}async initialize(){return this.available=typeof window<"u",this.available}}Sx.MODULE_NAME="";Sx.ID="StandardOperatingContext";async function HVt(n){const e=new Sx(n);return await e.initialize(),await(await X(()=>Promise.resolve().then(()=>IHt),void 0)).StandardController.createController(e)}/*! @azure/msal-browser v3.4.0 2023-10-30 */function lX(n){return encodeURIComponent(Zge(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function X7(n){return g7e(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Zge(n){return g7e(new TextEncoder().encode(n))}function g7e(n){const e=Array.from(n,t=>String.fromCodePoint(t)).join("");return btoa(e)}/*! @azure/msal-browser v3.4.0 2023-10-30 */function yC(n){return new TextDecoder().decode(WVt(n))}function WVt(n){let e=n.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw qn(d7e)}const t=atob(e);return Uint8Array.from(t,i=>i.codePointAt(0)||0)}/*! @azure/msal-browser v3.4.0 2023-10-30 */const zVt="RSASSA-PKCS1-v1_5",p7e="SHA-256",jVt=2048,UVt=new Uint8Array([1,0,1]),Jge={name:zVt,hash:p7e,modulusLength:jVt,publicExponent:UVt};function qVt(n){if("crypto"in window)n.verbose("BrowserCrypto: modern crypto interface available");else throw n.error("BrowserCrypto: crypto interface is unavailable"),qn(B9e)}async function m7e(n,e,t){e==null||e.addQueueMeasurement(ut.Sha256Digest,t);const r=new TextEncoder().encode(n);return window.crypto.subtle.digest(p7e,r)}function KVt(n){return window.crypto.getRandomValues(n)}function tw(){return window.crypto.randomUUID()}async function GVt(n,e){return window.crypto.subtle.generateKey(Jge,n,e)}async function cX(n){return window.crypto.subtle.exportKey(h7e,n)}async function YVt(n,e,t){return window.crypto.subtle.importKey(h7e,n,Jge,e,t)}async function QVt(n,e){return window.crypto.subtle.sign(Jge,n,e)}/*! @azure/msal-browser v3.4.0 2023-10-30 */class XVt{constructor(){this.dbName=Zie,this.version=xVt,this.tableName=kVt,this.dbOpen=!1}async open(){return new Promise((e,t)=>{const i=window.indexedDB.open(this.dbName,this.version);i.addEventListener("upgradeneeded",r=>{r.target.result.createObjectStore(this.tableName)}),i.addEventListener("success",r=>{const o=r;this.db=o.target.result,this.dbOpen=!0,e()}),i.addEventListener("error",()=>t(qn(Yge)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return await this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((t,i)=>{if(!this.db)return i(qn(JT));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);s.addEventListener("success",a=>{const l=a;this.closeConnection(),t(l.target.result)}),s.addEventListener("error",a=>{this.closeConnection(),i(a)})})}async setItem(e,t){return await this.validateDbIsOpen(),new Promise((i,r)=>{if(!this.db)return r(qn(JT));const a=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);a.addEventListener("success",()=>{this.closeConnection(),i()}),a.addEventListener("error",l=>{this.closeConnection(),r(l)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((t,i)=>{if(!this.db)return i(qn(JT));const s=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);s.addEventListener("success",()=>{this.closeConnection(),t()}),s.addEventListener("error",a=>{this.closeConnection(),i(a)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,t)=>{if(!this.db)return t(qn(JT));const o=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();o.addEventListener("success",s=>{const a=s;this.closeConnection(),e(a.target.result)}),o.addEventListener("error",s=>{this.closeConnection(),t(s)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((t,i)=>{if(!this.db)return i(qn(JT));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);s.addEventListener("success",a=>{const l=a;this.closeConnection(),t(l.target.result===1)}),s.addEventListener("error",a=>{this.closeConnection(),i(a)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,t)=>{const i=window.indexedDB.deleteDatabase(Zie);i.addEventListener("success",()=>e(!0)),i.addEventListener("blocked",()=>e(!0)),i.addEventListener("error",()=>t(!1))})}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class ere{constructor(){this.cache=new Map}getItem(e){return this.cache.get(e)||null}setItem(e,t){this.cache.set(e,t)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((t,i)=>{e.push(i)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class Mke{constructor(e,t){this.inMemoryCache=new ere,this.indexedDBCache=new XVt,this.logger=e,this.storeName=t}handleDatabaseAccessError(e){if(e instanceof G3&&e.errorCode===Yge)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}async getItem(e){const t=this.inMemoryCache.getItem(e);if(!t)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(i){this.handleDatabaseAccessError(i)}return t}async setItem(e,t){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(i){this.handleDatabaseAccessError(i)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(t){this.handleDatabaseAccessError(t)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(t){this.handleDatabaseAccessError(t)}return e}async containsKey(e){const t=this.inMemoryCache.containsKey(e);if(!t)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(i){this.handleDatabaseAccessError(i)}return t}clearInMemory(){this.logger.verbose(`Deleting in-memory keystore ${this.storeName}`),this.inMemoryCache.clear(),this.logger.verbose(`In-memory keystore ${this.storeName} deleted`)}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}/*! @azure/msal-browser v3.4.0 2023-10-30 */const Fke={asymmetricKeys:"asymmetricKeys",symmetricKeys:"symmetricKeys"};class ZVt{constructor(e){this.logger=e,this.asymmetricKeys=new Mke(this.logger,Fke.asymmetricKeys),this.symmetricKeys=new Mke(this.logger,Fke.symmetricKeys)}async clear(){this.asymmetricKeys.clearInMemory(),this.symmetricKeys.clearInMemory();try{return await this.asymmetricKeys.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class RD{constructor(e,t){this.logger=e,qVt(e),this.cache=new ZVt(this.logger),this.performanceClient=t}createNewGuid(){return tw()}base64Encode(e){return Zge(e)}base64Decode(e){return yC(e)}async getPublicKeyThumbprint(e){var u;const t=(u=this.performanceClient)==null?void 0:u.startMeasurement(ut.CryptoOptsGetPublicKeyThumbprint,e.correlationId),i=await GVt(RD.EXTRACTABLE,RD.POP_KEY_USAGES),r=await cX(i.publicKey),o={e:r.e,kty:r.kty,n:r.n},s=Bke(o),a=await this.hashString(s),l=await cX(i.privateKey),c=await YVt(l,!1,["sign"]);return await this.cache.asymmetricKeys.setItem(a,{privateKey:c,publicKey:i.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),t&&t.end({success:!0}),a}async removeTokenBindingKey(e){return await this.cache.asymmetricKeys.removeItem(e),!await this.cache.asymmetricKeys.containsKey(e)}async clearKeystore(){return await this.cache.clear()}async signJwt(e,t,i){var b;const r=(b=this.performanceClient)==null?void 0:b.startMeasurement(ut.CryptoOptsSignJwt,i),o=await this.cache.asymmetricKeys.getItem(t);if(!o)throw qn(Gge);const s=await cX(o.publicKey),a=Bke(s),l=lX(JSON.stringify({kid:t})),c=jge.getShrHeaderString({kid:l,alg:s.alg}),u=lX(c);e.cnf={jwk:JSON.parse(a)};const d=lX(JSON.stringify(e)),h=`${u}.${d}`,p=new TextEncoder().encode(h),m=await QVt(o.privateKey,p),_=X7(new Uint8Array(m)),v=`${h}.${_}`;return r&&r.end({success:!0}),v}async hashString(e){const t=await m7e(e),i=new Uint8Array(t);return X7(i)}}RD.POP_KEY_USAGES=["sign","verify"];RD.EXTRACTABLE=!0;function Bke(n){return JSON.stringify(n,Object.keys(n).sort())}/*! @azure/msal-browser v3.4.0 2023-10-30 */const _7e="storage_not_supported",JVt="stubbed_public_client_application_called",v7e="in_mem_redirect_unavailable";/*! @azure/msal-browser v3.4.0 2023-10-30 */const eHt={[_7e]:"Given storage configuration option was not supported.",[JVt]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[v7e]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};class epe extends il{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,epe.prototype)}}function b7e(n){return new epe(n,eHt[n])}/*! @azure/msal-browser v3.4.0 2023-10-30 */class $ke{constructor(e){this.validateWindowStorage(e),this.windowStorage=window[e]}validateWindowStorage(e){if(e!==ru.LocalStorage&&e!==ru.SessionStorage||!window[e])throw b7e(_7e)}getItem(e){return this.windowStorage.getItem(e)}setItem(e,t){this.windowStorage.setItem(e,t)}removeItem(e){this.windowStorage.removeItem(e)}getKeys(){return Object.keys(this.windowStorage)}containsKey(e){return this.windowStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class y7e{static extractBrowserRequestState(e,t){if(!t)return null;try{return u_.parseRequestState(e,t).libraryState.meta}catch{throw dn(LD)}}static parseServerResponseFromHash(e){if(!e)return{};const t=new tr(e);return tr.getDeserializedHash(t.getHash())}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class tre extends C1{constructor(e,t,i,r,o){super(e,i,r,o),this.COOKIE_LIFE_MULTIPLIER=24*60*60*1e3,this.cacheConfig=t,this.logger=r,this.internalStorage=new ere,this.browserStorage=this.setupBrowserStorage(this.cacheConfig.cacheLocation),this.temporaryCacheStorage=this.setupTemporaryCacheStorage(this.cacheConfig.temporaryCacheLocation,this.cacheConfig.cacheLocation),t.cacheMigrationEnabled&&(this.migrateCacheEntries(),this.createKeyMaps())}setupBrowserStorage(e){switch(e){case ru.LocalStorage:case ru.SessionStorage:try{return new $ke(e)}catch(t){this.logger.verbose(t);break}}return this.cacheConfig.cacheLocation=ru.MemoryStorage,new ere}setupTemporaryCacheStorage(e,t){switch(t){case ru.LocalStorage:case ru.SessionStorage:try{return new $ke(e||ru.SessionStorage)}catch(i){return this.logger.verbose(i),this.internalStorage}case ru.MemoryStorage:default:return this.internalStorage}}migrateCacheEntries(){const e=`${st.CACHE_PREFIX}.${bu.ID_TOKEN}`,t=`${st.CACHE_PREFIX}.${bu.CLIENT_INFO}`,i=`${st.CACHE_PREFIX}.${bu.ERROR}`,r=`${st.CACHE_PREFIX}.${bu.ERROR_DESC}`,o=this.browserStorage.getItem(e),s=this.browserStorage.getItem(t),a=this.browserStorage.getItem(i),l=this.browserStorage.getItem(r),c=[o,s,a,l];[bu.ID_TOKEN,bu.CLIENT_INFO,bu.ERROR,bu.ERROR_DESC].forEach((d,h)=>this.migrateCacheEntry(d,c[h]))}migrateCacheEntry(e,t){t&&this.setTemporaryCache(e,t,!0)}createKeyMaps(){this.logger.trace("BrowserCacheManager - createKeyMaps called.");const e=this.getItem(Q0.ACCOUNT_KEYS),t=this.getItem(`${Q0.TOKEN_KEYS}.${this.clientId}`);if(e&&t){this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");return}this.browserStorage.getKeys().forEach(r=>{if(this.isCredentialKey(r)){const o=this.getItem(r);if(o){const s=this.validateAndParseJson(o);if(s&&s.hasOwnProperty("credentialType"))switch(s.credentialType){case dr.ID_TOKEN:if(Eke(s)){this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${r} found, saving key to token key map`);const a=s,l=this.updateCredentialCacheKey(r,a);this.addTokenKey(l,dr.ID_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed idToken validation on key: ${r}`);break;case dr.ACCESS_TOKEN:case dr.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(Ske(s)){this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${r} found, saving key to token key map`);const a=s,l=this.updateCredentialCacheKey(r,a);this.addTokenKey(l,dr.ACCESS_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed accessToken validation on key: ${r}`);break;case dr.REFRESH_TOKEN:if(xke(s)){this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${r} found, saving key to token key map`);const a=s,l=this.updateCredentialCacheKey(r,a);this.addTokenKey(l,dr.REFRESH_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: ${r}`);break}}}if(this.isAccountKey(r)){const o=this.getItem(r);if(o){const s=this.validateAndParseJson(o);s&&Kl.isAccountEntity(s)&&(this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${r} found, saving key to account key map`),this.addAccountKeyToMap(r))}}})}validateAndParseJson(e){try{const t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{return null}}getItem(e){return this.browserStorage.getItem(e)}setItem(e,t){this.browserStorage.setItem(e,t)}getAccount(e){this.logger.trace("BrowserCacheManager.getAccount called");const t=this.getItem(e);if(!t)return this.removeAccountKeyFromMap(e),null;const i=this.validateAndParseJson(t);return!i||!Kl.isAccountEntity(i)?(this.removeAccountKeyFromMap(e),null):C1.toObject(new Kl,i)}setAccount(e){this.logger.trace("BrowserCacheManager.setAccount called");const t=e.generateAccountKey();this.setItem(t,JSON.stringify(e)),this.addAccountKeyToMap(t)}getAccountKeys(){this.logger.trace("BrowserCacheManager.getAccountKeys called");const e=this.getItem(Q0.ACCOUNT_KEYS);return e?JSON.parse(e):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])}addAccountKeyToMap(e){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const t=this.getAccountKeys();t.indexOf(e)===-1?(t.push(e),this.setItem(Q0.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")}removeAccountKeyFromMap(e){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const t=this.getAccountKeys(),i=t.indexOf(e);i>-1?(t.splice(i,1),this.setItem(Q0.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")):this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}async removeAccount(e){super.removeAccount(e),this.removeAccountKeyFromMap(e)}removeIdToken(e){super.removeIdToken(e),this.removeTokenKey(e,dr.ID_TOKEN)}async removeAccessToken(e){super.removeAccessToken(e),this.removeTokenKey(e,dr.ACCESS_TOKEN)}removeRefreshToken(e){super.removeRefreshToken(e),this.removeTokenKey(e,dr.REFRESH_TOKEN)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${Q0.TOKEN_KEYS}.${this.clientId}`);if(e){const t=this.validateAndParseJson(e);if(t&&t.hasOwnProperty("idToken")&&t.hasOwnProperty("accessToken")&&t.hasOwnProperty("refreshToken"))return t;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}}addTokenKey(e,t){this.logger.trace("BrowserCacheManager addTokenKey called");const i=this.getTokenKeys();switch(t){case dr.ID_TOKEN:i.idToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),i.idToken.push(e));break;case dr.ACCESS_TOKEN:i.accessToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),i.accessToken.push(e));break;case dr.REFRESH_TOKEN:i.refreshToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),i.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${t}`),dn(qie)}this.setItem(`${Q0.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(i))}removeTokenKey(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");const i=this.getTokenKeys();switch(t){case dr.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const r=i.idToken.indexOf(e);r>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),i.idToken.splice(r,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case dr.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const o=i.accessToken.indexOf(e);o>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),i.accessToken.splice(o,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case dr.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const s=i.refreshToken.indexOf(e);s>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),i.refreshToken.splice(s,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:throw this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${t}`),dn(qie)}this.setItem(`${Q0.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(i))}getIdTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,dr.ID_TOKEN),null;const i=this.validateAndParseJson(t);return!i||!Eke(i)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,dr.ID_TOKEN),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),i)}setIdTokenCredential(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const t=TI(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,dr.ID_TOKEN)}getAccessTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,dr.ACCESS_TOKEN),null;const i=this.validateAndParseJson(t);return!i||!Ske(i)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,dr.ACCESS_TOKEN),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),i)}setAccessTokenCredential(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const t=TI(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,dr.ACCESS_TOKEN)}getRefreshTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,dr.REFRESH_TOKEN),null;const i=this.validateAndParseJson(t);return!i||!xke(i)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,dr.REFRESH_TOKEN),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),i)}setRefreshTokenCredential(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const t=TI(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,dr.REFRESH_TOKEN)}getAppMetadata(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const i=this.validateAndParseJson(t);return!i||!AD.isAppMetadataEntity(e,i)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),C1.toObject(new AD,i))}setAppMetadata(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");const t=e.generateAppMetadataKey();this.setItem(t,JSON.stringify(e))}getServerTelemetry(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const i=this.validateAndParseJson(t);return!i||!K7.isServerTelemetryEntity(e,i)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),C1.toObject(new K7,i))}setServerTelemetry(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))}getAuthorityMetadata(e){const t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const i=this.validateAndParseJson(t);return i&&Yie.isAuthorityMetadataEntity(e,i)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),C1.toObject(new Yie,i)):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(t=>this.isAuthorityMetadata(t))}setWrapperMetadata(e,t){this.internalStorage.setItem(U6.WRAPPER_SKU,e),this.internalStorage.setItem(U6.WRAPPER_VER,t)}getWrapperMetadata(){const e=this.internalStorage.getItem(U6.WRAPPER_SKU)||st.EMPTY_STRING,t=this.internalStorage.getItem(U6.WRAPPER_VER)||st.EMPTY_STRING;return[e,t]}setAuthorityMetadata(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(){const e=this.generateCacheKey(bu.ACTIVE_ACCOUNT_FILTERS),t=this.getItem(e);if(!t){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");const r=this.generateCacheKey(bu.ACTIVE_ACCOUNT),o=this.getItem(r);if(!o)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;const s=this.getAccountInfoFilteredBy({localAccountId:o});return s?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(s),s):null}const i=this.validateAndParseJson(t);return i?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:i.homeAccountId,localAccountId:i.localAccountId})):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e){const t=this.generateCacheKey(bu.ACTIVE_ACCOUNT_FILTERS),i=this.generateCacheKey(bu.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");const r={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId};this.browserStorage.setItem(t,JSON.stringify(r)),this.browserStorage.setItem(i,e.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t),this.browserStorage.removeItem(i)}getThrottlingCache(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const i=this.validateAndParseJson(t);return!i||!Dke.isThrottlingEntity(e,i)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),C1.toObject(new Dke,i))}setThrottlingCache(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))}getTemporaryCache(e,t){const i=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const o=this.getItemCookie(i);if(o)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),o}const r=this.temporaryCacheStorage.getItem(i);if(!r){if(this.cacheConfig.cacheLocation===ru.LocalStorage){const o=this.browserStorage.getItem(i);if(o)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),o}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),r}setTemporaryCache(e,t,i){const r=i?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(r,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.setItemCookie(r,t))}removeItem(e){this.browserStorage.removeItem(e),this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.clearItemCookie(e))}containsKey(e){return this.browserStorage.containsKey(e)||this.temporaryCacheStorage.containsKey(e)}getKeys(){return[...this.browserStorage.getKeys(),...this.temporaryCacheStorage.getKeys()]}async clear(){await this.removeAllAccounts(),this.removeAppMetadata(),this.getKeys().forEach(e=>{(this.browserStorage.containsKey(e)||this.temporaryCacheStorage.containsKey(e))&&(e.indexOf(st.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.removeItem(e)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e){e.addQueueMeasurement(ut.ClearTokensAndKeysWithClaims);const t=this.getTokenKeys(),i=[];t.accessToken.forEach(r=>{const o=this.getAccessTokenCredential(r);o!=null&&o.requestedClaimsHash&&r.includes(o.requestedClaimsHash.toLowerCase())&&i.push(this.removeAccessToken(r))}),await Promise.all(i),i.length>0&&this.logger.warning(`${i.length} access tokens with claims in the cache keys have been removed from the cache.`)}setItemCookie(e,t,i){let r=`${encodeURIComponent(e)}=${encodeURIComponent(t)};path=/;SameSite=Lax;`;if(i){const o=this.getCookieExpirationTime(i);r+=`expires=${o};`}this.cacheConfig.secureCookies&&(r+="Secure;"),document.cookie=r}getItemCookie(e){const t=`${encodeURIComponent(e)}=`,i=document.cookie.split(";");for(let r=0;r<i.length;r++){let o=i[r];for(;o.charAt(0)===" ";)o=o.substring(1);if(o.indexOf(t)===0)return decodeURIComponent(o.substring(t.length,o.length))}return st.EMPTY_STRING}clearMsalCookies(){const e=`${st.CACHE_PREFIX}.${this.clientId}`;document.cookie.split(";").forEach(i=>{for(;i.charAt(0)===" ";)i=i.substring(1);if(i.indexOf(e)===0){const r=i.split("=")[0];this.clearItemCookie(r)}})}clearItemCookie(e){this.setItemCookie(e,st.EMPTY_STRING,-1)}getCookieExpirationTime(e){const t=new Date;return new Date(t.getTime()+e*this.COOKIE_LIFE_MULTIPLIER).toUTCString()}getCache(){return this.browserStorage}setCache(){}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):qf.startsWith(e,st.CACHE_PREFIX)||qf.startsWith(e,bu.ADAL_ID_TOKEN)?e:`${st.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:t}}=u_.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${as.AUTHORITY}.${t}`)}generateNonceKey(e){const{libraryState:{id:t}}=u_.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${as.NONCE_IDTOKEN}.${t}`)}generateStateKey(e){const{libraryState:{id:t}}=u_.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${as.REQUEST_STATE}.${t}`)}getCachedAuthority(e){const t=this.generateStateKey(e),i=this.getTemporaryCache(t);if(!i)return null;const r=this.generateAuthorityKey(i);return this.getTemporaryCache(r)}updateCacheEntries(e,t,i,r,o){this.logger.trace("BrowserCacheManager.updateCacheEntries called");const s=this.generateStateKey(e);this.setTemporaryCache(s,e,!1);const a=this.generateNonceKey(e);this.setTemporaryCache(a,t,!1);const l=this.generateAuthorityKey(e);if(this.setTemporaryCache(l,i,!1),o){const c={credential:o.homeAccountId,type:ng.HOME_ACCOUNT_ID};this.setTemporaryCache(as.CCS_CREDENTIAL,JSON.stringify(c),!0)}else if(r){const c={credential:r,type:ng.UPN};this.setTemporaryCache(as.CCS_CREDENTIAL,JSON.stringify(c),!0)}}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called"),e&&(this.getKeys().forEach(t=>{t.indexOf(e)!==-1&&this.removeItem(t)}),this.removeItem(this.generateStateKey(e)),this.removeItem(this.generateNonceKey(e)),this.removeItem(this.generateAuthorityKey(e))),this.removeItem(this.generateCacheKey(as.REQUEST_PARAMS)),this.removeItem(this.generateCacheKey(as.ORIGIN_URI)),this.removeItem(this.generateCacheKey(as.URL_HASH)),this.removeItem(this.generateCacheKey(as.CORRELATION_ID)),this.removeItem(this.generateCacheKey(as.CCS_CREDENTIAL)),this.removeItem(this.generateCacheKey(as.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cleanRequestByState(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){const t=this.generateStateKey(e),i=this.temporaryCacheStorage.getItem(t);this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${i}`),this.resetRequestCache(i||st.EMPTY_STRING)}this.clearMsalCookies()}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.getKeys().forEach(t=>{if(t.indexOf(as.REQUEST_STATE)===-1)return;const i=this.temporaryCacheStorage.getItem(t);if(!i)return;const r=y7e.extractBrowserRequestState(this.cryptoImpl,i);r&&r.interactionType===e&&(this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${i}`),this.resetRequestCache(i))}),this.clearMsalCookies(),this.setInteractionInProgress(!1)}cacheCodeRequest(e){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");const t=Zge(JSON.stringify(e));this.setTemporaryCache(as.REQUEST_PARAMS,t,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const t=this.getTemporaryCache(as.REQUEST_PARAMS,!0);if(!t)throw qn(Z9e);let i;try{i=JSON.parse(yC(t))}catch(r){throw this.logger.errorPii(`Attempted to parse: ${t}`),this.logger.error(`Parsing cached token request threw with error: ${r}`),qn(J9e)}if(this.removeItem(this.generateCacheKey(as.REQUEST_PARAMS)),!i.authority){const r=this.generateAuthorityKey(e),o=this.getTemporaryCache(r);if(!o)throw qn(Kge);i.authority=o}return i}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(as.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const t=this.validateAndParseJson(e);return t||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){const t=this.getInteractionInProgress();return e?t===this.clientId:!!t}getInteractionInProgress(){const e=`${st.CACHE_PREFIX}.${as.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const t=`${st.CACHE_PREFIX}.${as.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw qn(W9e);this.setTemporaryCache(t,this.clientId,!1)}else!e&&this.getInteractionInProgress()===this.clientId&&this.removeItem(t)}getLegacyLoginHint(){const e=this.getTemporaryCache(bu.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(bu.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));const t=this.getTemporaryCache(bu.ID_TOKEN,!0);t&&(this.removeItem(this.generateCacheKey(bu.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const i=t||e;if(i){const r=JC(i,yC);if(r.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),r.preferred_username;if(r.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),r.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null}updateCredentialCacheKey(e,t){const i=TI(t);if(e!==i){const r=this.getItem(e);if(r)return this.removeItem(e),this.setItem(i,r),this.logger.verbose(`Updated an outdated ${t.credentialType} cache key`),i;this.logger.error(`Attempted to update an outdated ${t.credentialType} cache key but no item matching the outdated key was found in storage`)}return e}getRedirectRequestContext(){return this.getTemporaryCache(as.REDIRECT_CONTEXT,!0)}setRedirectRequestContext(e){this.setTemporaryCache(as.REDIRECT_CONTEXT,e,!0)}async hydrateCache(e,t){var a,l,c,u,d;const i=Dj((a=e.account)==null?void 0:a.homeAccountId,(l=e.account)==null?void 0:l.environment,e.idToken,this.clientId,e.tenantId);let r;t.claims&&(r=await this.cryptoImpl.hashString(t.claims));const o=Aj((c=e.account)==null?void 0:c.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),((u=e.expiresOn)==null?void 0:u.getTime())||0,((d=e.extExpiresOn)==null?void 0:d.getTime())||0,yC,void 0,e.tokenType,void 0,t.sshKid,t.claims,r),s=new vL(void 0,i,o);return this.saveCacheRecord(s)}}const tHt=(n,e)=>{const t={cacheLocation:ru.MemoryStorage,temporaryCacheLocation:ru.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new tre(n,t,j7,e)};/*! @azure/msal-browser v3.4.0 2023-10-30 */const _r={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache"};/*! @azure/msal-browser v3.4.0 2023-10-30 */class nHt{constructor(e,t){this.eventCallbacks=new Map,this.logger=e,this.browserCrypto=t,this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}addEventCallback(e){if(typeof window<"u"){const t=tw();return this.eventCallbacks.set(t,e),this.logger.verbose(`Event callback registered with id: ${t}`),t}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}enableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))}disableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))}emitEvent(e,t,i,r){if(typeof window<"u"){const o={eventType:e,interactionType:t||null,payload:i||null,error:r||null,timestamp:Date.now()};this.logger.info(`Emitting event: ${e}`),this.eventCallbacks.forEach((s,a)=>{this.logger.verbose(`Emitting event to callback ${a}: ${e}`),s.apply(null,[o])})}}handleAccountCacheChange(e){try{const t=e.newValue||e.oldValue;if(!t)return;const i=JSON.parse(t);if(typeof i!="object"||!Kl.isAccountEntity(i))return;const o=C1.toObject(new Kl,i).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(_r.ACCOUNT_ADDED,void 0,o)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(_r.ACCOUNT_REMOVED,void 0,o))}catch{return}}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class C7e{constructor(e,t,i,r,o,s,a,l,c){this.config=e,this.browserStorage=t,this.browserCrypto=i,this.networkClient=this.config.system.networkClient,this.eventHandler=o,this.navigationClient=s,this.nativeMessageHandler=l,this.correlationId=c||tw(),this.logger=r.clone(zm.MSAL_SKU,Xge,this.correlationId),this.performanceClient=a}async clearCacheOnLogout(e){if(e){Kl.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null));try{await this.browserStorage.removeAccount(Kl.generateAccountCacheKey(e)),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),await this.browserStorage.clear(),await this.browserCrypto.clearKeystore()}catch{this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}async initializeBaseRequest(e,t){this.performanceClient.addQueueMeasurement(ut.InitializeBaseRequest,e.correlationId);const i=e.authority||this.config.auth.authority;t&&await this.validateRequestAuthority(i,t);const r=[...e&&e.scopes||[]],o={...e,correlationId:this.correlationId,authority:i,scopes:r};if(!o.authenticationScheme)o.authenticationScheme=Us.BEARER,this.logger.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(o.authenticationScheme===Us.SSH){if(!e.sshJwk)throw qs(Rj);if(!e.sshKid)throw qs(x9e)}this.logger.verbose(`Authentication Scheme set to "${o.authenticationScheme}" as configured in Auth request`)}return this.config.cache.claimsBasedCachingEnabled&&e.claims&&!qf.isEmptyObj(e.claims)&&(o.requestedClaimsHash=await this.browserCrypto.hashString(e.claims)),o}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const t=e||this.config.auth.redirectUri||Ry();return tr.getAbsoluteUrl(t,Ry())}async validateRequestAuthority(e,t){if(!(await this.getDiscoveredAuthority(e)).isAlias(t.environment))throw qs(I9e)}initializeServerTelemetryManager(e,t){this.logger.verbose("initializeServerTelemetryManager called");const i={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new G7(i,this.browserStorage)}async getDiscoveredAuthority(e){this.logger.verbose("getDiscoveredAuthority called");const t={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata};return e?(this.logger.verbose("Creating discovered authority with request authority"),await yx.createDiscoveredInstance(e,this.config.system.networkClient,this.browserStorage,t,this.logger)):(this.logger.verbose("Creating discovered authority with configured authority"),await yx.createDiscoveredInstance(this.config.auth.authority,this.config.system.networkClient,this.browserStorage,t,this.logger))}}/*! @azure/msal-browser v3.4.0 2023-10-30 */const iHt=32;async function rHt(n,e,t){n.addQueueMeasurement(ut.GeneratePkceCodes,t);const i=q3(oHt,ut.GenerateCodeVerifier,e,n,t)(n,e,t),r=await Mn(sHt,ut.GenerateCodeChallengeFromVerifier,e,n,t)(i,n,e,t);return{verifier:i,challenge:r}}function oHt(n,e,t){try{const i=new Uint8Array(iHt);return q3(KVt,ut.GetRandomValues,e,n,t)(i),X7(i)}catch{throw qn(Uge)}}async function sHt(n,e,t,i){e.addQueueMeasurement(ut.GenerateCodeChallengeFromVerifier,i);try{const r=await Mn(m7e,ut.Sha256Digest,t,e,i)(n,e,i);return X7(new Uint8Array(r))}catch{throw qn(Uge)}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class aA extends C7e{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(ut.StandardInteractionClientInitializeAuthorizationCodeRequest,e.correlationId);const t=await Mn(rHt,ut.GeneratePkceCodes,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),i={...e,redirectUri:e.redirectUri,code:st.EMPTY_STRING,codeVerifier:t.verifier};return e.codeChallenge=t.challenge,e.codeChallengeMethod=st.S256_CODE_CHALLENGE_METHOD,i}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const t={correlationId:this.correlationId||tw(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const i=this.getLogoutHintFromIdTokenClaims(e.account);i&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=i)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=tr.getAbsoluteUrl(e.postLogoutRedirectUri,Ry())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",t.correlationId),t.postLogoutRedirectUri=tr.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,Ry())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=tr.getAbsoluteUrl(Ry(),Ry())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId),t}getLogoutHintFromIdTokenClaims(e){const t=e.idTokenClaims;if(t){if(t.login_hint)return t.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e,t,i){this.performanceClient.addQueueMeasurement(ut.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const r=await Mn(this.getClientConfiguration.bind(this),ut.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e,t,i);return new P9e(r,this.performanceClient)}async getClientConfiguration(e,t,i){this.performanceClient.addQueueMeasurement(ut.StandardInteractionClientGetClientConfiguration,this.correlationId);const r=await Mn(this.getDiscoveredAuthority.bind(this),ut.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)(t,i),o=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:r,clientCapabilities:this.config.auth.clientCapabilities},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:o.loggerCallback,piiLoggingEnabled:o.piiLoggingEnabled,logLevel:o.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:e,libraryInfo:{sku:zm.MSAL_SKU,version:Xge,cpu:st.EMPTY_STRING,os:st.EMPTY_STRING},telemetry:this.config.telemetry}}validateAndExtractStateFromHash(e,t,i){if(this.logger.verbose("validateAndExtractStateFromHash called",i),!e.state)throw qn($9e);const r=y7e.extractBrowserRequestState(this.browserCrypto,e.state);if(!r)throw qn(V9e);if(r.interactionType!==t)throw qn(H9e);return this.logger.verbose("Returning state from hash",i),e.state}async getDiscoveredAuthority(e,t){this.performanceClient.addQueueMeasurement(ut.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const i={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},r=e||this.config.auth.authority,o=md.generateAuthority(r,t||this.config.auth.azureCloudOptions);return await Mn(yx.createDiscoveredInstance.bind(yx),ut.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(o,this.config.system.networkClient,this.browserStorage,i,this.logger,this.performanceClient,this.correlationId)}async initializeAuthorizationRequest(e,t){this.performanceClient.addQueueMeasurement(ut.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const i=this.getRedirectUri(e.redirectUri),r={interactionType:t},o=u_.setRequestState(this.browserCrypto,e&&e.state||st.EMPTY_STRING,r),a={...await Mn(this.initializeBaseRequest.bind(this),ut.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)(e),redirectUri:i,state:o,nonce:e.nonce||tw(),responseMode:this.config.auth.OIDCOptions.serverResponseType},l=e.account||this.browserStorage.getActiveAccount();if(l&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${l.homeAccountId}`,this.correlationId),a.account=l),!a.loginHint&&!l){const c=this.browserStorage.getLegacyLoginHint();c&&(a.loginHint=c)}return a}}/*! @azure/msal-browser v3.4.0 2023-10-30 */const aHt="ContentError",w7e="user_switch";/*! @azure/msal-browser v3.4.0 2023-10-30 */const lHt="USER_INTERACTION_REQUIRED",cHt="USER_CANCEL",uHt="NO_NETWORK",dHt="PERSISTENT_ERROR",hHt="DISABLED",fHt="ACCOUNT_UNAVAILABLE";/*! @azure/msal-browser v3.4.0 2023-10-30 */const gHt=-2147186943,pHt={[w7e]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class yy extends il{constructor(e,t,i){super(e,t),Object.setPrototypeOf(this,yy.prototype),this.name="NativeAuthError",this.ext=i}}function eI(n){if(n.ext&&n.ext.status&&(n.ext.status===dHt||n.ext.status===hHt)||n.ext&&n.ext.error&&n.ext.error===gHt)return!0;switch(n.errorCode){case aHt:return!0;default:return!1}}function nre(n,e,t){if(t&&t.status)switch(t.status){case fHt:return O9e(N9e);case lHt:return new Gv(n,e);case cHt:return qn(wx);case uHt:return qn(Y7)}return new yy(n,pHt[n]||e,t)}/*! @azure/msal-browser v3.4.0 2023-10-30 */class S7e extends aA{async acquireToken(e){this.performanceClient.addQueueMeasurement(ut.SilentCacheClientAcquireToken,e.correlationId);const t=this.initializeServerTelemetryManager(Da.acquireTokenSilent_silentFlow),i=await this.createSilentFlowClient(t,e.authority,e.azureCloudOptions);this.logger.verbose("Silent auth client created");try{const o=(await Mn(i.acquireCachedToken.bind(i),ut.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),o}catch(r){throw r instanceof G3&&r.errorCode===Gge&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),r}}logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(t==null?void 0:t.account)}async createSilentFlowClient(e,t,i){const r=await Mn(this.getClientConfiguration.bind(this),ut.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e,t,i);return new _Vt(r,this.performanceClient)}async initializeSilentRequest(e,t){this.performanceClient.addQueueMeasurement(ut.InitializeSilentRequest,this.correlationId);const i=await Mn(this.initializeBaseRequest.bind(this),ut.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)(e,t);return{...e,...i,account:t,forceRefresh:e.forceRefresh||!1}}}/*! @azure/msal-browser v3.4.0 2023-10-30 */const uX={BROKER_CLIENT_ID:"brk_client_id",BROKER_REDIRECT_URI:"brk_redirect_uri"};class bL extends C7e{constructor(e,t,i,r,o,s,a,l,c,u,d,h){super(e,t,i,r,o,s,l,c,h),this.apiId=a,this.accountId=u,this.nativeMessageHandler=c,this.nativeStorageManager=d,this.silentCacheClient=new S7e(e,this.nativeStorageManager,i,r,o,s,l,c,h)}async acquireToken(e){this.performanceClient.addQueueMeasurement(ut.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const t=this.performanceClient.startMeasurement(ut.NativeInteractionClientAcquireToken,e.correlationId),i=th.nowSeconds(),r=await this.initializeNativeRequest(e);try{const l=await this.acquireTokensFromCache(this.accountId,r);return t.end({success:!0,isNativeBroker:!1,fromCache:!0}),l}catch{this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const o={method:EE.GetToken,request:r},s=await this.nativeMessageHandler.sendMessage(o),a=this.validateNativeResponse(s);return this.handleNativeResponse(a,r,i).then(l=>(t.end({success:!0,isNativeBroker:!0,requestId:l.requestId}),l)).catch(l=>{throw t.end({success:!1,errorCode:l.errorCode,subErrorCode:l.subError,isNativeBroker:!0}),l})}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:cc.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),dn(jie);const i=this.browserStorage.getBaseAccountInfo({nativeAccountId:e});if(!i)throw dn(jie);try{const r=this.createSilentCacheRequest(t,i),o=await this.silentCacheClient.acquireToken(r),s={...i,idTokenClaims:o==null?void 0:o.idTokenClaims};return{...o,account:s}}catch(r){throw r}}async acquireTokenRedirect(e){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const t=await this.initializeNativeRequest(e),i={method:EE.GetToken,request:t};try{const s=await this.nativeMessageHandler.sendMessage(i);this.validateNativeResponse(s)}catch(s){if(s instanceof yy&&eI(s))throw s}this.browserStorage.setTemporaryCache(as.NATIVE_REQUEST,JSON.stringify(t),!0);const r={apiId:Da.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},o=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);await this.navigationClient.navigateExternal(o,r)}async handleRedirectPromise(){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const e=this.browserStorage.getCachedNativeRequest();if(!e)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),null;const{prompt:t,...i}=e;t&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(as.NATIVE_REQUEST));const r={method:EE.GetToken,request:i},o=th.nowSeconds();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const s=await this.nativeMessageHandler.sendMessage(r);this.validateNativeResponse(s);const a=this.handleNativeResponse(s,i,o);return this.browserStorage.setInteractionInProgress(!1),a}catch(s){throw this.browserStorage.setInteractionInProgress(!1),s}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,i){if(this.logger.trace("NativeInteractionClient - handleNativeResponse called."),e.account.id!==t.accountId)throw nre(w7e);const r=await this.getDiscoveredAuthority(t.authority),o=JC(e.id_token,yC),s=this.createHomeAccountIdentifier(e,o),a=Kl.createAccount({homeAccountId:s,idTokenClaims:o,clientInfo:e.client_info,nativeAccountId:e.account.id},r),l=await this.generateAuthenticationResult(e,t,o,a,r.canonicalAuthority,i);return this.cacheAccount(a),this.cacheNativeTokens(e,t,s,o,l.accessToken,l.tenantId,i),l}createHomeAccountIdentifier(e,t){return Kl.generateHomeAccountId(e.client_info||st.EMPTY_STRING,Pm.Default,this.logger,this.browserCrypto,t)}generateScopes(e,t){return e.scope?cc.fromString(e.scope):cc.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===Us.POP){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const i=new DD(this.browserCrypto),r={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw dn(Rge);return await i.signPopToken(e.access_token,t.keyId,r)}else return e.access_token}async generateAuthenticationResult(e,t,i,r,o,s){const a=this.addTelemetryFromNativeResponse(e),l=e.scope?cc.fromString(e.scope):cc.fromString(t.scope),c=e.account.properties||{},u=c.UID||i.oid||i.sub||st.EMPTY_STRING,d=c.TenantId||i.tid||st.EMPTY_STRING,g=(i?Object.assign(new Kl,{...r,idTokenClaims:i}):r).getAccountInfo(),p=await this.generatePopAccessToken(e,t),m=t.tokenType===Us.POP?Us.POP:Us.BEARER;return{authority:o,uniqueId:u,tenantId:d,scopes:l.asArray(),account:g,idToken:e.id_token,idTokenClaims:i,accessToken:p,fromCache:a?this.isResponseFromCache(a):!1,expiresOn:new Date(Number(s+e.expires_in)*1e3),tokenType:m,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}cacheAccount(e){this.browserStorage.setAccount(e),this.browserStorage.removeAccountContext(e).catch(t=>{this.logger.error(`Error occurred while removing account context from browser storage. ${t}`)})}cacheNativeTokens(e,t,i,r,o,s,a){const l=Dj(i,t.authority,e.id_token||"",t.clientId,r.tid||""),c=t.tokenType===Us.POP?st.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,u=a+c,d=this.generateScopes(e,t),h=Aj(i,t.authority,o,t.clientId,r.tid||s,d.printScopes(),u,0,yC),g=new vL(void 0,l,h);this.nativeStorageManager.saveCacheRecord(g,t.storeInCache)}addTelemetryFromNativeResponse(e){const t=this.getMATSFromResponse(e);return t?(this.performanceClient.addFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t.broker_version,matsAccountJoinOnStart:t.account_join_on_start,matsAccountJoinOnEnd:t.account_join_on_end,matsDeviceJoin:t.device_join,matsPromptBehavior:t.prompt_behavior,matsApiErrorCode:t.api_error_code,matsUiVisible:t.ui_visible,matsSilentCode:t.silent_code,matsSilentBiSubCode:t.silent_bi_sub_code,matsSilentMessage:t.silent_message,matsSilentStatus:t.silent_status,matsHttpStatus:t.http_status,matsHttpEventCount:t.http_event_count},this.correlationId),t):null}validateNativeResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw Q8e(kge,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const t=e.authority||this.config.auth.authority;e.account&&await this.validateRequestAuthority(t,e.account);const i=new tr(t);i.validateAsUri();const{scopes:r,...o}=e,s=new cc(r||[]);s.appendScopes(j3);const a=()=>{switch(this.apiId){case Da.ssoSilent:case Da.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),Ed.NONE}if(!e.prompt){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e.prompt){case Ed.NONE:case Ed.CONSENT:case Ed.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e.prompt;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e.prompt} is not compatible with native flow`),qn(u7e)}},l={...o,accountId:this.accountId,clientId:this.config.auth.clientId,authority:i.urlString,scope:s.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:a(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1};if(this.handleExtraBrokerParams(l),l.extraParameters=l.extraParameters||{},l.extraParameters.telemetry=yN.MATS_TELEMETRY,e.authenticationScheme===Us.POP){const c={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},u=new DD(this.browserCrypto),d=await Mn(u.generateCnf.bind(u),ut.PopTokenGenerateCnf,this.logger,this.performanceClient,this.correlationId)(c,this.logger);l.reqCnf=d.reqCnfHash,l.keyId=d.kid}return l}handleExtraBrokerParams(e){if(e.extraParameters&&e.extraParameters.hasOwnProperty(uX.BROKER_CLIENT_ID)&&e.extraParameters.hasOwnProperty(uX.BROKER_REDIRECT_URI)&&e.extraParameters.hasOwnProperty(mr.CLIENT_ID)){const t=e.extraParameters[mr.CLIENT_ID],i=e.redirectUri,r=e.extraParameters[uX.BROKER_REDIRECT_URI];e.extraParameters={child_client_id:t,child_redirect_uri:i},e.redirectUri=r}}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class Dv{constructor(e,t,i,r){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=r,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=i,this.handshakeEvent=i.startMeasurement(ut.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:yN.CHANNEL_ID,extensionId:this.extensionId,responseId:tw(),body:e};return this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(t)}`),this.messageChannel.port1.postMessage(t),new Promise((i,r)=>{this.resolvers.set(t.responseId,{resolve:i,reject:r})})}static async createProvider(e,t,i){e.trace("NativeMessageHandler - createProvider called.");try{const r=new Dv(e,t,i,yN.PREFERRED_EXTENSION_ID);return await r.sendHandshakeRequest(),r}catch{const o=new Dv(e,t,i);return await o.sendHandshakeRequest(),o}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:yN.CHANNEL_ID,extensionId:this.extensionId,responseId:tw(),body:{method:EE.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=t=>{this.onChannelMessage(t)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((t,i)=>{this.handshakeResolvers.set(e.responseId,{resolve:t,reject:i}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),i(qn(a7e)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window)return;const t=e.data;if(!(!t.channel||t.channel!==yN.CHANNEL_ID)&&!(t.extensionId&&t.extensionId!==this.extensionId)&&t.body.method===EE.HandshakeRequest){const i=this.handshakeResolvers.get(t.responseId);if(!i){this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${t.responseId}`);return}this.logger.verbose(t.extensionId?`Extension with id: ${t.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),i.reject(qn(l7e))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const t=e.data,i=this.resolvers.get(t.responseId),r=this.handshakeResolvers.get(t.responseId);try{const o=t.body.method;if(o===EE.Response){if(!i)return;const s=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(s)}`),s.status!=="Success")i.reject(nre(s.code,s.description,s.ext));else if(s.result)s.result.code&&s.result.description?i.reject(nre(s.result.code,s.result.description,s.result.ext)):i.resolve(s.result);else throw Q8e(kge,"Event does not contain result.");this.resolvers.delete(t.responseId)}else if(o===EE.HandshakeResponse){if(!r){this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${t.responseId}`);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),r.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(o){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${o}`),this.logger.errorPii(`Unable to parse ${e}`),i?i.reject(o):r&&r.reject(o)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isNativeAvailable(e,t,i,r){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!i)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(r)switch(r){case Us.BEARER:case Us.POP:return t.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class tpe{constructor(e,t,i,r,o){this.authModule=e,this.browserStorage=t,this.authCodeRequest=i,this.logger=r,this.performanceClient=o}async handleCodeResponseFromHash(e,t){if(this.performanceClient.addQueueMeasurement(ut.HandleCodeResponseFromHash,t.correlationId),!e)throw qn(Pj);let i;try{i=this.authModule.handleFragmentResponse(e,t.state)}catch(r){throw r instanceof ew&&r.subError===wx?qn(wx):r}return Mn(this.handleCodeResponseFromServer.bind(this),ut.HandleCodeResponseFromServer,this.logger,this.performanceClient,t.correlationId)(i,t)}async handleCodeResponseFromServer(e,t,i=!0){if(this.performanceClient.addQueueMeasurement(ut.HandleCodeResponseFromServer,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await Mn(this.authModule.updateAuthority.bind(this.authModule),ut.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,t.correlationId)(e.cloud_instance_host_name,t.correlationId),i&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const o=this.createCcsCredentials(t);o&&(this.authCodeRequest.ccsCredential=o)}return await Mn(this.authModule.acquireToken.bind(this.authModule),ut.AuthClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:ng.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:ng.UPN}:null}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class mHt extends aA{constructor(e,t,i,r,o,s,a,l,c,u){super(e,t,i,r,o,s,a,c,u),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=l}acquireToken(e){try{const t=this.generatePopupName(e.scopes||j3,e.authority||this.config.auth.authority),i=e.popupWindowAttributes||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,t,i);{this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");const r=this.openSizedPopup("about:blank",t,i);return this.acquireTokenPopupAsync(e,t,i,r)}}catch(t){return Promise.reject(t)}}logout(e){try{this.logger.verbose("logoutPopup called");const t=this.initializeLogoutRequest(e),i=this.generateLogoutPopupName(t),r=e&&e.authority,o=e&&e.mainWindowRedirectUri,s=(e==null?void 0:e.popupWindowAttributes)||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,i,s,r,void 0,o);{this.logger.verbose("asyncPopup set to false, opening popup");const a=this.openSizedPopup("about:blank",i,s);return this.logoutPopupAsync(t,i,s,r,a,o)}}catch(t){return Promise.reject(t)}}async acquireTokenPopupAsync(e,t,i,r){this.logger.verbose("acquireTokenPopupAsync called");const o=this.initializeServerTelemetryManager(Da.acquireTokenPopup),s=await Mn(this.initializeAuthorizationRequest.bind(this),ut.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,pi.Popup);f7e(s.authority);try{const a=await Mn(this.initializeAuthorizationCodeRequest.bind(this),ut.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(s),l=await Mn(this.createAuthCodeClient.bind(this),ut.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)(o,s.authority,s.azureCloudOptions),c=Dv.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);let u;c&&(u=this.performanceClient.startMeasurement(ut.FetchAccountIdWithNativeBroker,e.correlationId));const d=await l.getAuthCodeUrl({...s,nativeBroker:c}),h=new tpe(l,this.browserStorage,a,this.logger,this.performanceClient),g={popup:r,popupName:t,popupWindowAttributes:i},p=this.initiateAuthRequest(d,g);this.eventHandler.emitEvent(_r.POPUP_OPENED,pi.Popup,{popupWindow:p},null);const m=await this.monitorPopupForHash(p),_=tr.getDeserializedHash(m);if(mv.removeThrottle(this.browserStorage,this.config.auth.clientId,a),_.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),u&&u.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw qn(K3);const b=new bL(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Da.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,_.accountId,this.nativeStorage,s.correlationId),{userRequestState:y}=u_.parseRequestState(this.browserCrypto,s.state);return b.acquireToken({...s,state:y,prompt:void 0})}return await h.handleCodeResponseFromHash(m,s)}catch(a){throw r&&r.close(),a instanceof il&&(a.setCorrelationId(this.correlationId),o.cacheFailedRequest(a)),a}}async logoutPopupAsync(e,t,i,r,o,s){var l,c;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(_r.LOGOUT_START,pi.Popup,e);const a=this.initializeServerTelemetryManager(Da.logoutPopup);try{await this.clearCacheOnLogout(e.account);const u=await Mn(this.createAuthCodeClient.bind(this),ut.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)(a,r);try{u.authority.endSessionEndpoint}catch{if((l=e.account)!=null&&l.homeAccountId&&e.postLogoutRedirectUri&&u.authority.protocolMode===Ky.OIDC){if(this.browserStorage.removeAccount((c=e.account)==null?void 0:c.homeAccountId),this.eventHandler.emitEvent(_r.LOGOUT_SUCCESS,pi.Popup,e),s){const g={apiId:Da.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},p=tr.getAbsoluteUrl(s,Ry());await this.navigationClient.navigateInternal(p,g)}o&&o.close();return}}const d=u.getLogoutUri(e);this.eventHandler.emitEvent(_r.LOGOUT_SUCCESS,pi.Popup,e);const h=this.openPopup(d,{popupName:t,popupWindowAttributes:i,popup:o});if(this.eventHandler.emitEvent(_r.POPUP_OPENED,pi.Popup,{popupWindow:h},null),await this.waitForLogoutPopup(h),s){const g={apiId:Da.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},p=tr.getAbsoluteUrl(s,Ry());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${p}`),await this.navigationClient.navigateInternal(p,g)}else this.logger.verbose("No main window navigation requested")}catch(u){throw o&&o.close(),u instanceof il&&(u.setCorrelationId(this.correlationId),a.cacheFailedRequest(u)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(_r.LOGOUT_FAILURE,pi.Popup,null,u),this.eventHandler.emitEvent(_r.LOGOUT_END,pi.Popup),u}this.eventHandler.emitEvent(_r.LOGOUT_END,pi.Popup)}initiateAuthRequest(e,t){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,t);throw this.logger.error("Navigate url is empty"),qn(Oj)}monitorPopupForHash(e){return new Promise((t,i)=>{const r=this.config.system.windowHashTimeout/this.config.system.pollIntervalMilliseconds;let o=0;this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const s=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),this.cleanPopup(),clearInterval(s),i(qn(wx));return}let a=st.EMPTY_STRING,l=st.EMPTY_STRING;try{a=e.location.href,l=this.extractServerResponseStringFromPopup(e,a)}catch{}!a||a==="about:blank"||(this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),o++,l?(this.logger.verbose("PopupHandler.monitorPopupForHash - found hash in url"),clearInterval(s),this.cleanPopup(e),tr.hashContainsKnownProperties(l)?(this.logger.verbose("PopupHandler.monitorPopupForHash - hash contains known properties, returning."),t(l)):(this.logger.error("PopupHandler.monitorPopupForHash - found hash in url but it does not contain known properties. Check that your router is not changing the hash prematurely."),this.logger.errorPii(`PopupHandler.monitorPopupForHash - hash found: ${l}`),i(qn(qge)))):o>r&&(this.logger.error("PopupHandler.monitorPopupForHash - unable to find hash in url, timing out"),clearInterval(s),i(qn(U9e))))},this.config.system.pollIntervalMilliseconds)})}waitForLogoutPopup(e){return new Promise(t=>{this.logger.verbose("PopupHandler.waitForLogoutPopup - polling started");const i=setInterval(()=>{e.closed&&(this.logger.error("PopupHandler.waitForLogoutPopup - window closed"),this.cleanPopup(),clearInterval(i),t());let r=st.EMPTY_STRING;try{r=e.location.href}catch{}!r||r==="about:blank"||(this.logger.verbose("PopupHandler.waitForLogoutPopup - popup window is on same origin as caller, closing."),clearInterval(i),this.cleanPopup(e),t())},this.config.system.pollIntervalMilliseconds)})}openPopup(e,t){try{let i;if(t.popup?(i=t.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),i.location.assign(e)):typeof t.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),i=this.openSizedPopup(e,t.popupName,t.popupWindowAttributes)),!i)throw qn(j9e);return i.focus&&i.focus(),this.currentWindow=i,window.addEventListener("beforeunload",this.unloadWindow),i}catch(i){throw this.logger.error("error opening popup "+i.message),this.browserStorage.setInteractionInProgress(!1),qn(z9e)}}openSizedPopup(e,t,i){var h,g,p,m;const r=window.screenLeft?window.screenLeft:window.screenX,o=window.screenTop?window.screenTop:window.screenY,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let l=(h=i.popupSize)==null?void 0:h.width,c=(g=i.popupSize)==null?void 0:g.height,u=(p=i.popupPosition)==null?void 0:p.top,d=(m=i.popupPosition)==null?void 0:m.left;return(!l||l<0||l>s)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),l=zm.POPUP_WIDTH),(!c||c<0||c>a)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),c=zm.POPUP_HEIGHT),(!u||u<0||u>a)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),u=Math.max(0,a/2-zm.POPUP_HEIGHT/2+o)),(!d||d<0||d>s)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),d=Math.max(0,s/2-zm.POPUP_WIDTH/2+r)),window.open(e,t,`width=${l}, height=${c}, top=${u}, left=${d}, scrollbars=yes`)}unloadWindow(e){this.browserStorage.cleanRequestByInteractionType(pi.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e){e&&e.close(),window.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)}generatePopupName(e,t){return`${zm.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${zm.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${t}.${this.correlationId}`}extractServerResponseStringFromPopup(e,t){var r;let i;return((r=this.config.auth.OIDCOptions)==null?void 0:r.serverResponseType)===U3.QUERY?i=tr.parseQueryServerResponse(t):i=e.location.hash,i}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class Vke{constructor(e,t,i,r,o){this.authModule=e,this.browserStorage=t,this.authCodeRequest=i,this.logger=r,this.performanceClient=o}async initiateAuthRequest(e,t){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){t.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(as.ORIGIN_URI,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(as.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const i={apiId:Da.acquireTokenRedirect,timeout:t.redirectTimeout,noHistory:!1};if(typeof t.onRedirectNavigate=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),t.onRedirectNavigate(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await t.navigationClient.navigateExternal(e,i);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await t.navigationClient.navigateExternal(e,i);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),qn(Oj)}async handleCodeResponseFromHash(e,t){if(this.logger.verbose("RedirectHandler.handleCodeResponse called"),!e)throw qn(Pj);this.browserStorage.setInteractionInProgress(!1);const i=this.browserStorage.generateStateKey(t),r=this.browserStorage.getTemporaryCache(i);if(!r)throw dn(z7,"Cached State");let o;try{o=this.authModule.handleFragmentResponse(e,r)}catch(c){throw c instanceof ew&&c.subError===wx?qn(wx):c}const s=this.browserStorage.generateNonceKey(r),a=this.browserStorage.getTemporaryCache(s);if(this.authCodeRequest.code=o.code,o.cloud_instance_host_name&&await Mn(this.authModule.updateAuthority.bind(this.authModule),ut.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,this.authCodeRequest.correlationId)(o.cloud_instance_host_name,this.authCodeRequest.correlationId),o.nonce=a||void 0,o.state=r,o.client_info)this.authCodeRequest.clientInfo=o.client_info;else{const c=this.checkCcsCredentials();c&&(this.authCodeRequest.ccsCredential=c)}const l=await this.authModule.acquireToken(this.authCodeRequest,o);return this.browserStorage.cleanRequestByState(t),l}checkCcsCredentials(){const e=this.browserStorage.getTemporaryCache(as.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch{this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii(`Cache credential could not be parsed: ${e}`)}return null}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class _Ht extends aA{constructor(e,t,i,r,o,s,a,l,c,u){super(e,t,i,r,o,s,a,c,u),this.nativeStorage=l}async acquireToken(e){const t=await Mn(this.initializeAuthorizationRequest.bind(this),ut.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,pi.Redirect);this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||"",t.account||null);const i=this.initializeServerTelemetryManager(Da.acquireTokenRedirect),r=o=>{o.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.cleanRequestByState(t.state),this.eventHandler.emitEvent(_r.RESTORE_FROM_BFCACHE,pi.Redirect))};try{const o=await Mn(this.initializeAuthorizationCodeRequest.bind(this),ut.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(t),s=await Mn(this.createAuthCodeClient.bind(this),ut.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)(i,t.authority,t.azureCloudOptions),a=new Vke(s,this.browserStorage,o,this.logger,this.performanceClient),l=await s.getAuthCodeUrl({...t,nativeBroker:Dv.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme)}),c=this.getRedirectStartPage(e.redirectStartPage);return this.logger.verbosePii(`Redirect start page: ${c}`),window.addEventListener("pageshow",r),await a.initiateAuthRequest(l,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:c,onRedirectNavigate:e.onRedirectNavigate})}catch(o){throw o instanceof il&&(o.setCorrelationId(this.correlationId),i.cacheFailedRequest(o)),window.removeEventListener("pageshow",r),this.browserStorage.cleanRequestByState(t.state),o}}async handleRedirectPromise(e){const t=this.initializeServerTelemetryManager(Da.handleRedirectPromise);try{if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const i=this.getRedirectResponseHash(e||window.location.hash);if(!i)return this.logger.info("handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(pi.Redirect),null;let r;try{const l=tr.getDeserializedHash(i);r=this.validateAndExtractStateFromHash(l,pi.Redirect),this.logger.verbose("State extracted from hash")}catch(l){return this.logger.info(`handleRedirectPromise was unable to extract state due to: ${l}`),this.browserStorage.cleanRequestByInteractionType(pi.Redirect),null}const o=this.browserStorage.getTemporaryCache(as.ORIGIN_URI,!0)||st.EMPTY_STRING,s=tr.removeHashFromUrl(o),a=tr.removeHashFromUrl(window.location.href);if(s===a&&this.config.auth.navigateToLoginRequestUrl){this.logger.verbose("Current page is loginRequestUrl, handling hash");const l=await this.handleHash(i,r,t);return o.indexOf("#")>-1&&IVt(o),l}else if(this.config.auth.navigateToLoginRequestUrl){if(!Qge()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(as.URL_HASH,i,!0);const l={apiId:Da.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let c=!0;if(!o||o==="null"){const u=DVt();this.browserStorage.setTemporaryCache(as.ORIGIN_URI,u,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),c=await this.navigationClient.navigateInternal(u,l)}else this.logger.verbose(`Navigating to loginRequestUrl: ${o}`),c=await this.navigationClient.navigateInternal(o,l);if(!c)return this.handleHash(i,r,t)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling hash"),this.handleHash(i,r,t);return null}catch(i){throw i instanceof il&&(i.setCorrelationId(this.correlationId),t.cacheFailedRequest(i)),this.browserStorage.cleanRequestByInteractionType(pi.Redirect),i}}getRedirectResponseHash(e){if(this.logger.verbose("getRedirectResponseHash called"),tr.hashContainsKnownProperties(e))return TVt(window),this.logger.verbose("Hash contains known properties, returning response hash"),e;const i=this.browserStorage.getTemporaryCache(as.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(as.URL_HASH)),this.logger.verbose("Hash does not contain known properties, returning cached hash"),i}async handleHash(e,t,i){const r=this.browserStorage.getCachedRequest(t);this.logger.verbose("handleHash called, retrieved cached request");const o=tr.getDeserializedHash(e);if(o.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw qn(K3);const c=new bL(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Da.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,o.accountId,this.nativeStorage,r.correlationId),{userRequestState:u}=u_.parseRequestState(this.browserCrypto,t);return c.acquireToken({...r,state:u,prompt:void 0}).finally(()=>{this.browserStorage.cleanRequestByState(t)})}const s=this.browserStorage.getCachedAuthority(t);if(!s)throw qn(Kge);const a=await Mn(this.createAuthCodeClient.bind(this),ut.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)(i,s);return mv.removeThrottle(this.browserStorage,this.config.auth.clientId,r),await new Vke(a,this.browserStorage,r,this.logger,this.performanceClient).handleCodeResponseFromHash(e,t)}async logout(e){var r,o;this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e),i=this.initializeServerTelemetryManager(Da.logout);try{this.eventHandler.emitEvent(_r.LOGOUT_START,pi.Redirect,e),await this.clearCacheOnLogout(t.account);const s={apiId:Da.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=await Mn(this.createAuthCodeClient.bind(this),ut.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)(i,e&&e.authority);if(a.authority.protocolMode===Ky.OIDC)try{a.authority.endSessionEndpoint}catch{if((r=t.account)!=null&&r.homeAccountId){this.browserStorage.removeAccount((o=t.account)==null?void 0:o.homeAccountId),this.eventHandler.emitEvent(_r.LOGOUT_SUCCESS,pi.Redirect,t);return}}const l=a.getLogoutUri(t);if(this.eventHandler.emitEvent(_r.LOGOUT_SUCCESS,pi.Redirect,t),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(l)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(l,s);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(l,s);return}}catch(s){throw s instanceof il&&(s.setCorrelationId(this.correlationId),i.cacheFailedRequest(s)),this.eventHandler.emitEvent(_r.LOGOUT_FAILURE,pi.Redirect,null,s),this.eventHandler.emitEvent(_r.LOGOUT_END,pi.Redirect),s}this.eventHandler.emitEvent(_r.LOGOUT_END,pi.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return tr.getAbsoluteUrl(t,Ry())}}/*! @azure/msal-browser v3.4.0 2023-10-30 */async function vHt(n,e,t,i,r){if(e.addQueueMeasurement(ut.SilentHandlerInitiateAuthRequest,i),!n)throw t.info("Navigate url is empty"),qn(Oj);return r?await Mn(yHt,ut.SilentHandlerLoadFrame,t,e,i)(n,r,e,i):q3(CHt,ut.SilentHandlerLoadFrameSync,t,e,i)(n)}async function bHt(n,e,t,i,r,o){return i.addQueueMeasurement(ut.SilentHandlerMonitorIframeForHash,o),new Promise((s,a)=>{e<Jie&&r.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${e}ms) than the default (${Jie}ms). This may result in timeouts.`);const l=window.setTimeout(()=>{window.clearInterval(c),a(qn(q9e))},e),c=window.setInterval(()=>{let u="";const d=n.contentWindow;try{u=d?d.location.href:""}catch{}if(!u||u==="about:blank")return;const h=d?d.location.hash:"";window.clearTimeout(l),window.clearInterval(c),s(h)},t)}).finally(()=>{q3(wHt,ut.RemoveHiddenIframe,r,i,o)(n)})}function yHt(n,e,t,i){return t.addQueueMeasurement(ut.SilentHandlerLoadFrame,i),new Promise((r,o)=>{const s=E7e();window.setTimeout(()=>{if(!s){o("Unable to load iframe");return}s.src=n,r(s)},e)})}function CHt(n){const e=E7e();return e.src=n,e}function E7e(){const n=document.createElement("iframe");return n.style.visibility="hidden",n.style.position="absolute",n.style.width=n.style.height="0",n.style.border="0",n.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.getElementsByTagName("body")[0].appendChild(n),n}function wHt(n){document.body===n.parentNode&&document.body.removeChild(n)}/*! @azure/msal-browser v3.4.0 2023-10-30 */class SHt extends aA{constructor(e,t,i,r,o,s,a,l,c,u,d){super(e,t,i,r,o,s,l,u,d),this.apiId=a,this.nativeStorage=c}async acquireToken(e){if(this.performanceClient.addQueueMeasurement(ut.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),e.prompt&&e.prompt!==Ed.NONE&&e.prompt!==Ed.NO_SESSION)throw qn(X9e);const t=await Mn(this.initializeAuthorizationRequest.bind(this),ut.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)({...e,prompt:e.prompt||Ed.NONE},pi.Silent);f7e(t.authority);const i=this.initializeServerTelemetryManager(this.apiId);try{const r=await Mn(this.createAuthCodeClient.bind(this),ut.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)(i,t.authority,t.azureCloudOptions);return await Mn(this.silentTokenHelper.bind(this),ut.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(r,t)}catch(r){throw r instanceof il&&(r.setCorrelationId(this.correlationId),i.cacheFailedRequest(r)),r}}logout(){return Promise.reject(qn(Mj))}async silentTokenHelper(e,t){const i=t.correlationId;this.performanceClient.addQueueMeasurement(ut.SilentIframeClientTokenHelper,i);const r=await Mn(this.initializeAuthorizationCodeRequest.bind(this),ut.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,i)(t),o=await Mn(e.getAuthCodeUrl.bind(e),ut.GetAuthCodeUrl,this.logger,this.performanceClient,i)({...t,nativeBroker:Dv.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}),s=new tpe(e,this.browserStorage,r,this.logger,this.performanceClient),a=await Mn(vHt,ut.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,i)(o,this.performanceClient,this.logger,i,this.config.system.navigateFrameWait),l=await Mn(bHt,ut.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,i)(a,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,i);if(l){if(!tr.hashContainsKnownProperties(l))throw this.logger.error("A hash is present in the iframe but it does not contain known properties. It's likely that the hash has been replaced by code running on the redirectUri page."),this.logger.errorPii(`The hash detected in the iframe is: ${l}`),qn(qge)}else throw this.logger.error("The request has returned to the redirectUri but a hash is not present in the iframe. It's likely that the hash has been removed or the page has been redirected by code running on the redirectUri page."),qn(Pj);const c=tr.getDeserializedHash(l);if(c.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw qn(K3);const u=new bL(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,c.accountId,this.browserStorage,i),{userRequestState:d}=u_.parseRequestState(this.browserCrypto,t.state);return Mn(u.acquireToken.bind(u),ut.NativeInteractionClientAcquireToken,this.logger,this.performanceClient,i)({...t,state:d,prompt:t.prompt||Ed.NONE})}return Mn(s.handleCodeResponseFromHash.bind(s),ut.HandleCodeResponseFromHash,this.logger,this.performanceClient,i)(l,t)}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class EHt extends aA{async acquireToken(e){this.performanceClient.addQueueMeasurement(ut.SilentRefreshClientAcquireToken,e.correlationId);const t=await Mn(this.initializeBaseRequest.bind(this),ut.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,e.account),i={...e,...t},r=this.initializeServerTelemetryManager(Da.acquireTokenSilent_silentFlow),o=await this.createRefreshTokenClient(r,i.authority,i.azureCloudOptions);return Mn(o.acquireTokenByRefreshToken.bind(o),ut.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(i).catch(s=>{throw s.setCorrelationId(this.correlationId),r.cacheFailedRequest(s),s})}logout(){return Promise.reject(qn(Mj))}async createRefreshTokenClient(e,t,i){const r=await Mn(this.getClientConfiguration.bind(this),ut.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e,t,i);return new Qie(r,this.performanceClient)}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class xHt{constructor(e,t,i,r){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=t,this.logger=i,this.cryptoObj=r}loadExternalTokens(e,t,i){if(this.logger.info("TokenCache - loadExternalTokens called"),!t.id_token)throw qn(wm);const r=JC(t.id_token,yC);let o,s,a;if(e.account)a=Kl.createFromAccountInfo(e.account),o=new vL(a,this.loadIdToken(t.id_token,a.homeAccountId,e.account.environment,e.account.tenantId),this.loadAccessToken(e,t,a.homeAccountId,e.account.environment,e.account.tenantId,i),this.loadRefreshToken(e,t,a.homeAccountId,e.account.environment));else if(e.authority){const l=md.generateAuthority(e.authority,e.azureCloudOptions),c={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache};if(s=new md(l,this.config.system.networkClient,this.storage,c,this.logger),i.clientInfo)this.logger.trace("TokenCache - homeAccountId from options"),a=this.loadAccount(r,s,i.clientInfo),o=new vL(a,this.loadIdToken(t.id_token,a.homeAccountId,s.hostnameAndPort,s.tenant),this.loadAccessToken(e,t,a.homeAccountId,s.hostnameAndPort,s.tenant,i),this.loadRefreshToken(e,t,a.homeAccountId,s.hostnameAndPort));else if(t.client_info)this.logger.trace("TokenCache - homeAccountId from response"),a=this.loadAccount(r,s,t.client_info),o=new vL(a,this.loadIdToken(t.id_token,a.homeAccountId,s.hostnameAndPort,s.tenant),this.loadAccessToken(e,t,a.homeAccountId,s.hostnameAndPort,s.tenant,i),this.loadRefreshToken(e,t,a.homeAccountId,s.hostnameAndPort));else throw qn(wm)}else throw qn(wm);return this.generateAuthenticationResult(e,r,o,a,s)}loadAccount(e,t,i,r){let o;if(r?o=r:t.authorityType!==void 0&&i&&(o=Kl.generateHomeAccountId(i,t.authorityType,this.logger,this.cryptoObj,e)),!o)throw qn(wm);const s=Kl.createAccount({homeAccountId:o,idTokenClaims:e,clientInfo:i,environment:t.hostnameAndPort},t);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading account"),this.storage.setAccount(s),s;throw qn(wm)}loadIdToken(e,t,i,r){const o=Dj(t,i,e,this.config.auth.clientId,r);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading id token"),this.storage.setIdTokenCredential(o),o;throw qn(wm)}loadAccessToken(e,t,i,r,o,s){if(!t.access_token)return this.logger.verbose("TokenCache - No access token provided for caching"),null;if(!t.expires_in||!s.extendedExpiresOn)throw qn(wm);const a=new cc(e.scopes).printScopes(),l=s.expiresOn||t.expires_in+new Date().getTime()/1e3,c=s.extendedExpiresOn,u=Aj(i,r,t.access_token,this.config.auth.clientId,o,a,l,c,yC);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading access token"),this.storage.setAccessTokenCredential(u),u;throw qn(wm)}loadRefreshToken(e,t,i,r){if(!t.refresh_token)return this.logger.verbose("TokenCache - No refresh token provided for caching"),null;const o=p9e(i,r,t.refresh_token,this.config.auth.clientId);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading refresh token"),this.storage.setRefreshTokenCredential(o),o;throw qn(wm)}generateAuthenticationResult(e,t,i,r,o){var h,g;let s=st.EMPTY_STRING,a=[],l=null,c;i!=null&&i.accessToken&&(s=i.accessToken.secret,a=cc.fromString(i.accessToken.target).asArray(),l=new Date(Number(i.accessToken.expiresOn)*1e3),c=new Date(Number(i.accessToken.extendedExpiresOn)*1e3));const u=t.oid||t.sub||st.EMPTY_STRING,d=t.tid||st.EMPTY_STRING;return{authority:o?o.canonicalAuthority:st.EMPTY_STRING,uniqueId:u,tenantId:d,scopes:a,account:r.getAccountInfo(),idToken:((h=i.idToken)==null?void 0:h.secret)||"",idTokenClaims:t||{},accessToken:s,fromCache:!0,expiresOn:l,correlationId:e.correlationId||st.EMPTY_STRING,requestId:st.EMPTY_STRING,extExpiresOn:c,familyId:st.EMPTY_STRING,tokenType:((g=i==null?void 0:i.accessToken)==null?void 0:g.tokenType)||st.EMPTY_STRING,state:st.EMPTY_STRING,cloudGraphHostName:r.cloudGraphHostName||st.EMPTY_STRING,msGraphHost:r.msGraphHost||st.EMPTY_STRING,code:void 0,fromNativeBroker:!1}}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class kHt extends P9e{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class THt extends aA{constructor(e,t,i,r,o,s,a,l,c,u){super(e,t,i,r,o,s,l,c,u),this.apiId=a}async acquireToken(e){if(!e.code)throw qn(i7e);const t=await Mn(this.initializeAuthorizationRequest.bind(this),ut.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,pi.Silent),i=this.initializeServerTelemetryManager(this.apiId);try{const r={...t,code:e.code},o=await Mn(this.getClientConfiguration.bind(this),ut.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)(i,t.authority),s=new kHt(o);this.logger.verbose("Auth code client created");const a=new tpe(s,this.browserStorage,r,this.logger,this.performanceClient);return Mn(a.handleCodeResponseFromServer.bind(a),ut.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t,!1)}catch(r){throw r instanceof il&&(r.setCorrelationId(this.correlationId),i.cacheFailedRequest(r)),r}}logout(){return Promise.reject(qn(Mj))}}/*! @azure/msal-browser v3.4.0 2023-10-30 */class Fj{constructor(e){this.atsAsyncMeasurement=void 0,this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new RD(this.logger,this.performanceClient):j7,this.eventHandler=new nHt(this.logger,this.browserCrypto),this.browserStorage=this.isBrowserEnvironment?new tre(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,cVt(this.config.auth)):tHt(this.config.auth.clientId,this.logger);const t={cacheLocation:ru.MemoryStorage,temporaryCacheLocation:ru.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new tre(this.config.auth.clientId,t,this.browserCrypto,this.logger),this.tokenCache=new xHt(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this)}static async createController(e){const t=new Fj(e);return await t.initialize(),t}trackPageVisibility(){this.atsAsyncMeasurement&&(this.logger.info("Perf: Visibility change detected"),this.atsAsyncMeasurement.increment({visibilityChangeCount:1}))}async initialize(){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}const e=this.config.system.allowNativeBroker,t=this.performanceClient.startMeasurement(ut.InitializeClientApplication);if(this.eventHandler.emitEvent(_r.INITIALIZE_START),e)try{this.nativeExtensionProvider=await Dv.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(i){this.logger.verbose(i)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await Mn(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),ut.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient)(this.performanceClient)),this.initialized=!0,this.eventHandler.emitEvent(_r.INITIALIZE_END),t.end({allowNativeBroker:e,success:!0})}async handleRedirectPromise(e){var r;this.logger.verbose("handleRedirectPromise called"),Pke(this.initialized);let t=e;if(((r=this.config.auth.OIDCOptions)==null?void 0:r.serverResponseType)===U3.QUERY){const o=window.location.href;t=tr.parseQueryServerResponse(o)}const i=this.getAllAccounts();if(this.isBrowserEnvironment){const o=t||st.EMPTY_STRING;let s=this.redirectResponse.get(o);if(typeof s>"u"){this.eventHandler.emitEvent(_r.HANDLE_REDIRECT_START,pi.Redirect),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise");const a=this.browserStorage.getCachedNativeRequest();let l;if(a&&Dv.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!t)this.logger.trace("handleRedirectPromise - acquiring token from native platform"),l=new bL(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Da.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,a.accountId,this.nativeInternalStorage,a.correlationId).handleRedirectPromise();else{this.logger.trace("handleRedirectPromise - acquiring token from web flow");const c=this.browserStorage.getTemporaryCache(as.CORRELATION_ID,!0)||st.EMPTY_STRING;l=this.createRedirectClient(c).handleRedirectPromise(t)}s=l.then(c=>(c&&(i.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(_r.LOGIN_SUCCESS,pi.Redirect,c),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(_r.ACQUIRE_TOKEN_SUCCESS,pi.Redirect,c),this.logger.verbose("handleRedirectResponse returned result, acquire token success"))),this.eventHandler.emitEvent(_r.HANDLE_REDIRECT_END,pi.Redirect),c)).catch(c=>{throw i.length>0?this.eventHandler.emitEvent(_r.ACQUIRE_TOKEN_FAILURE,pi.Redirect,null,c):this.eventHandler.emitEvent(_r.LOGIN_FAILURE,pi.Redirect,null,c),this.eventHandler.emitEvent(_r.HANDLE_REDIRECT_END,pi.Redirect),c}),this.redirectResponse.set(o,s)}else this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call");return s}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async acquireTokenRedirect(e){const t=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",t),this.preflightBrowserEnvironmentCheck(pi.Redirect);const i=this.getAllAccounts().length>0;i?this.eventHandler.emitEvent(_r.ACQUIRE_TOKEN_START,pi.Redirect,e):this.eventHandler.emitEvent(_r.LOGIN_START,pi.Redirect,e);let r;return this.nativeExtensionProvider&&this.canUseNative(e)?r=new bL(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Da.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireTokenRedirect(e).catch(s=>{if(s instanceof yy&&eI(s))return this.nativeExtensionProvider=void 0,this.createRedirectClient(e.correlationId).acquireToken(e);if(s instanceof Gv)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(e.correlationId).acquireToken(e);throw this.getBrowserStorage().setInteractionInProgress(!1),s}):r=this.createRedirectClient(e.correlationId).acquireToken(e),r.catch(o=>{throw i?this.eventHandler.emitEvent(_r.ACQUIRE_TOKEN_FAILURE,pi.Redirect,null,o):this.eventHandler.emitEvent(_r.LOGIN_FAILURE,pi.Redirect,null,o),o})}acquireTokenPopup(e){const t=this.getRequestCorrelationId(e),i=this.performanceClient.startMeasurement(ut.AcquireTokenPopup,t);try{this.logger.verbose("acquireTokenPopup called",t),this.preflightBrowserEnvironmentCheck(pi.Popup)}catch(s){return Promise.reject(s)}const r=this.getAllAccounts();r.length>0?this.eventHandler.emitEvent(_r.ACQUIRE_TOKEN_START,pi.Popup,e):this.eventHandler.emitEvent(_r.LOGIN_START,pi.Popup,e);let o;return this.canUseNative(e)?o=this.acquireTokenNative(e,Da.acquireTokenPopup).then(s=>(this.getBrowserStorage().setInteractionInProgress(!1),i.end({success:!0,isNativeBroker:!0,requestId:s.requestId}),s)).catch(s=>{if(s instanceof yy&&eI(s))return this.nativeExtensionProvider=void 0,this.createPopupClient(e.correlationId).acquireToken(e);if(s instanceof Gv)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(e.correlationId).acquireToken(e);throw this.getBrowserStorage().setInteractionInProgress(!1),s}):o=this.createPopupClient(e.correlationId).acquireToken(e),o.then(s=>(r.length<this.getAllAccounts().length?this.eventHandler.emitEvent(_r.LOGIN_SUCCESS,pi.Popup,s):this.eventHandler.emitEvent(_r.ACQUIRE_TOKEN_SUCCESS,pi.Popup,s),i.add({accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length}),i.end({success:!0,requestId:s.requestId}),s)).catch(s=>(r.length>0?this.eventHandler.emitEvent(_r.ACQUIRE_TOKEN_FAILURE,pi.Popup,null,s):this.eventHandler.emitEvent(_r.LOGIN_FAILURE,pi.Popup,null,s),i.end({errorCode:s.errorCode,subErrorCode:s.subError,success:!1}),Promise.reject(s)))}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){var o;const t=this.getRequestCorrelationId(e),i={...e,prompt:e.prompt,correlationId:t};this.preflightBrowserEnvironmentCheck(pi.Silent),this.ssoSilentMeasurement=this.performanceClient.startMeasurement(ut.SsoSilent,t),(o=this.ssoSilentMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(_r.SSO_SILENT_START,pi.Silent,i);let r;return this.canUseNative(i)?r=this.acquireTokenNative(i,Da.ssoSilent).catch(s=>{if(s instanceof yy&&eI(s))return this.nativeExtensionProvider=void 0,this.createSilentIframeClient(i.correlationId).acquireToken(i);throw s}):r=this.createSilentIframeClient(i.correlationId).acquireToken(i),r.then(s=>{var a,l;return this.eventHandler.emitEvent(_r.SSO_SILENT_SUCCESS,pi.Silent,s),(a=this.ssoSilentMeasurement)==null||a.add({accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length}),(l=this.ssoSilentMeasurement)==null||l.end({success:!0,isNativeBroker:s.fromNativeBroker,requestId:s.requestId}),s}).catch(s=>{var a;throw this.eventHandler.emitEvent(_r.SSO_SILENT_FAILURE,pi.Silent,null,s),(a=this.ssoSilentMeasurement)==null||a.end({errorCode:s.errorCode,subErrorCode:s.subError,success:!1}),s}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const t=this.getRequestCorrelationId(e);this.preflightBrowserEnvironmentCheck(pi.Silent),this.logger.trace("acquireTokenByCode called",t),this.eventHandler.emitEvent(_r.ACQUIRE_TOKEN_BY_CODE_START,pi.Silent,e);const i=this.performanceClient.startMeasurement(ut.AcquireTokenByCode,e.correlationId);try{if(e.code&&e.nativeAccountId)throw qn(o7e);if(e.code){const r=e.code;let o=this.hybridAuthCodeResponses.get(r);return o?(this.logger.verbose("Existing acquireTokenByCode request found",e.correlationId),i.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),o=this.acquireTokenByCodeAsync({...e,correlationId:t}).then(s=>(this.eventHandler.emitEvent(_r.ACQUIRE_TOKEN_BY_CODE_SUCCESS,pi.Silent,s),this.hybridAuthCodeResponses.delete(r),i.add({accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length}),i.end({success:!0,isNativeBroker:s.fromNativeBroker,requestId:s.requestId}),s)).catch(s=>{throw this.hybridAuthCodeResponses.delete(r),this.eventHandler.emitEvent(_r.ACQUIRE_TOKEN_BY_CODE_FAILURE,pi.Silent,null,s),i.end({errorCode:s.errorCode,subErrorCode:s.subError,success:!1}),s}),this.hybridAuthCodeResponses.set(r,o)),o}else if(e.nativeAccountId){if(this.canUseNative(e,e.nativeAccountId))return this.acquireTokenNative(e,Da.acquireTokenByCode,e.nativeAccountId).catch(r=>{throw r instanceof yy&&eI(r)&&(this.nativeExtensionProvider=void 0),r});throw qn(s7e)}else throw qn(r7e)}catch(r){throw this.eventHandler.emitEvent(_r.ACQUIRE_TOKEN_BY_CODE_FAILURE,pi.Silent,null,r),i.end({errorCode:r instanceof il&&r.errorCode||void 0,subErrorCode:r instanceof il&&r.subError||void 0,success:!1}),r}}async acquireTokenByCodeAsync(e){var r;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(ut.AcquireTokenByCodeAsync,e.correlationId),(r=this.acquireTokenByCodeAsyncMeasurement)==null||r.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(o=>{var s;return(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({success:!0,fromCache:o.fromCache,isNativeBroker:o.fromNativeBroker,requestId:o.requestId}),o}).catch(o=>{var s;throw(s=this.acquireTokenByCodeAsyncMeasurement)==null||s.end({errorCode:o.errorCode,subErrorCode:o.subError,success:!1}),o}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,t,i){switch(this.performanceClient.addQueueMeasurement(ut.AcquireTokenFromCache,t.correlationId),i){case Jg.Default:case Jg.AccessToken:case Jg.AccessTokenAndRefreshToken:return Mn(e.acquireToken.bind(e),ut.SilentCacheClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(t);default:throw dn(U1)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(ut.AcquireTokenByRefreshToken,e.correlationId),t){case Jg.Default:case Jg.AccessTokenAndRefreshToken:case Jg.RefreshToken:case Jg.RefreshTokenAndNetwork:const i=this.createSilentRefreshClient(e.correlationId);return Mn(i.acquireToken.bind(i),ut.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw dn(U1)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(ut.AcquireTokenBySilentIframe,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return Mn(t.acquireToken.bind(t),ut.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const t=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),this.logoutRedirect({correlationId:t,...e})}async logoutRedirect(e){const t=this.getRequestCorrelationId(e);return this.preflightBrowserEnvironmentCheck(pi.Redirect),this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);return this.preflightBrowserEnvironmentCheck(pi.Popup),this.createPopupClient(t).logout(e)}catch(t){return Promise.reject(t)}}async clearCache(e){const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){return this.logger.verbose("getAllAccounts called"),this.isBrowserEnvironment?this.browserStorage.getAllAccounts(e):[]}getAccount(e){if(this.logger.trace("getAccount called"),Object.keys(e).length===0)return this.logger.warning("getAccount: No accountFilter provided"),null;const t=this.browserStorage.getAccountInfoFilteredBy(e);return t?(this.logger.verbose("getAccount: Account matching provided filter found, returning"),t):(this.logger.verbose("getAccount: No matching account found, returning null"),null)}getAccountByUsername(e){if(this.logger.trace("getAccountByUsername called"),!e)return this.logger.warning("getAccountByUsername: No username provided"),null;const t=this.browserStorage.getAccountInfoFilteredBy({username:e});return t?(this.logger.verbose("getAccountByUsername: Account matching username found, returning"),this.logger.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${e}`),t):(this.logger.verbose("getAccountByUsername: No matching account found, returning null"),null)}getAccountByHomeId(e){if(this.logger.trace("getAccountByHomeId called"),!e)return this.logger.warning("getAccountByHomeId: No homeAccountId provided"),null;const t=this.browserStorage.getAccountInfoFilteredBy({homeAccountId:e});return t?(this.logger.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),this.logger.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${e}`),t):(this.logger.verbose("getAccountByHomeId: No matching account found, returning null"),null)}getAccountByLocalId(e){if(this.logger.trace("getAccountByLocalId called"),!e)return this.logger.warning("getAccountByLocalId: No localAccountId provided"),null;const t=this.browserStorage.getAccountInfoFilteredBy({localAccountId:e});return t?(this.logger.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),this.logger.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${e}`),t):(this.logger.verbose("getAccountByLocalId: No matching account found, returning null"),null)}setActiveAccount(e){this.browserStorage.setActiveAccount(e)}getActiveAccount(){return this.browserStorage.getActiveAccount()}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const i=Kl.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return this.browserStorage.setAccount(i),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,t)):this.browserStorage.hydrateCache(e,t)}preflightBrowserEnvironmentCheck(e,t=!1){if(this.logger.verbose("preflightBrowserEnvironmentCheck started"),NVt(this.isBrowserEnvironment),AVt(e,this.config.system.allowRedirectInIframe),aX(),RVt(),Pke(this.initialized),e===pi.Redirect&&this.config.cache.cacheLocation===ru.MemoryStorage&&!this.config.cache.storeAuthStateInCookie)throw b7e(v7e);(e===pi.Redirect||e===pi.Popup)&&this.preflightInteractiveRequest(!t)}preflightInteractiveRequest(e){this.logger.verbose("preflightInteractiveRequest called, validating app environment"),aX(),e&&this.getBrowserStorage().setInteractionInProgress(!0)}async acquireTokenNative(e,t,i){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw qn(K3);return new bL(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,i||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)}canUseNative(e,t){if(this.logger.trace("canUseNative called"),!Dv.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case Ed.NONE:case Ed.CONSENT:case Ed.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace(`canUseNative: prompt = ${e.prompt} is not compatible with native flow, returning false`),!1}return!t&&!this.getNativeAccountId(e)?(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1):!0}getNativeAccountId(e){const t=e.account||this.browserStorage.getAccountInfoFilteredBy({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new mHt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new _Ht(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new SHt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Da.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new S7e(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new EHt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new THt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Da.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e){return this.eventHandler.addEventCallback(e)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){this.eventHandler.enableAccountStorageEvents()}disableAccountStorageEvents(){this.eventHandler.disableAccountStorageEvents()}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}getBrowserStorage(){return this.browserStorage}isBrowserEnv(){return this.isBrowserEnvironment}getEventHandler(){return this.eventHandler}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?tw():st.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||Oke})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||Oke})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),i=this.performanceClient.startMeasurement(ut.AcquireTokenSilent,t);i.add({cacheLookupPolicy:e.cacheLookupPolicy}),this.preflightBrowserEnvironmentCheck(pi.Silent),this.logger.verbose("acquireTokenSilent called",t);const r=e.account||this.getActiveAccount();if(!r)throw qn(Q9e);const o={clientId:this.config.auth.clientId,authority:e.authority||st.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:r.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},s=JSON.stringify(o),a=this.activeSilentTokenRequests.get(s);if(typeof a>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t);const l=Mn(this.acquireTokenSilentAsync.bind(this),ut.AcquireTokenSilentAsync,this.logger,this.performanceClient,t)({...e,correlationId:t},r).then(c=>(this.activeSilentTokenRequests.delete(s),i.add({accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length}),i.end({success:!0,fromCache:c.fromCache,isNativeBroker:c.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,requestId:c.requestId}),c)).catch(c=>{throw this.activeSilentTokenRequests.delete(s),i.end({errorCode:c.errorCode,subErrorCode:c.subError,success:!1}),c});return this.activeSilentTokenRequests.set(s,l),l}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),i.discard(),a}async acquireTokenSilentAsync(e,t){var r;this.performanceClient.addQueueMeasurement(ut.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(_r.ACQUIRE_TOKEN_START,pi.Silent,e),this.atsAsyncMeasurement=this.performanceClient.startMeasurement(ut.AcquireTokenSilentAsync,e.correlationId),(r=this.atsAsyncMeasurement)==null||r.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibility);let i;if(Dv.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&t.nativeAccountId){this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform");const o={...e,account:t};i=this.acquireTokenNative(o,Da.acquireTokenSilent_silentFlow).catch(async s=>{if(s instanceof yy&&eI(s))return this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,this.createSilentIframeClient(e.correlationId).acquireToken(e);throw s})}else{this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow");const o=this.createSilentCacheClient(e.correlationId),s=await Mn(o.initializeSilentRequest.bind(o),ut.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,t),a=e.cacheLookupPolicy||Jg.Default;i=Mn(this.acquireTokenFromCache.bind(this),ut.AcquireTokenFromCache,this.logger,this.performanceClient,s.correlationId)(o,s,a).catch(l=>{if(e.cacheLookupPolicy===Jg.AccessToken)throw l;return aX(),this.eventHandler.emitEvent(_r.ACQUIRE_TOKEN_NETWORK_START,pi.Silent,s),Mn(this.acquireTokenByRefreshToken.bind(this),ut.AcquireTokenByRefreshToken,this.logger,this.performanceClient,s.correlationId)(s,a).catch(c=>{const u=!(c instanceof Gv)&&(c.errorCode===zm.INVALID_GRANT_ERROR||c.errorCode===U1)||c.errorCode===q7,d=a===Jg.Default||a===Jg.Skip||a===Jg.RefreshTokenAndNetwork;if(u&&d)return this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",e.correlationId),Mn(this.acquireTokenBySilentIframe.bind(this),ut.AcquireTokenBySilentIframe,this.logger,this.performanceClient,s.correlationId)(s);throw c})})}return i.then(o=>{var s;return this.eventHandler.emitEvent(_r.ACQUIRE_TOKEN_SUCCESS,pi.Silent,o),(s=this.atsAsyncMeasurement)==null||s.end({success:!0,fromCache:o.fromCache,isNativeBroker:o.fromNativeBroker,requestId:o.requestId}),o}).catch(o=>{var s;throw this.eventHandler.emitEvent(_r.ACQUIRE_TOKEN_FAILURE,pi.Silent,null,o),(s=this.atsAsyncMeasurement)==null||s.end({errorCode:o.errorCode,subErrorCode:o.subError,success:!1}),o}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibility)})}}const IHt=Object.freeze(Object.defineProperty({__proto__:null,StandardController:Fj},Symbol.toStringTag,{value:"Module"}));/*! @azure/msal-browser v3.4.0 2023-10-30 */class npe{static async createPublicClientApplication(e){const t=await HVt(e);return new npe(e,t)}constructor(e,t){if(t)this.controller=t;else{const i=new Sx(e);this.controller=new Fj(i)}}async initialize(){return this.controller.initialize()}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e){return this.controller.addEventCallback(e)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}}const XP=new npe({auth:{clientId:"",redirectUri:{}.VITE_MICROSOFT_REDIRECT_URI}});XP.initialize();function x7e(n){return f("button",{disabled:n.disabled,onClick:n.onClick,className:"rounded px-4 py-2 bg-white border border-gray-200 flex justify-center items-center space-x-2 text-center hover:bg-gray-50 cursor-pointer text-sm disabled:cursor-not-allowed",children:n.children})}function LHt(){const n=Ci(),e=r=>{localStorage.removeItem("X-CURRENT-INDEX");let o=0;const s=r.data.data,a=s[0].account.default_company_id;o=s.findIndex(l=>l.company.id===a)||0,n(h3({type:W2.TOKEN,user:r.data.data[o].user,token:r.data.data[o].token.token})),n(yb(r.data.data)),n(Ez(o))},t=r=>{Te("POST",ye("/api/v1/oauth_login?provider=google&id_token=:token&create=true",{token:r})).then(o=>e(o))},i=r=>{Te("POST",ye("/api/v1/oauth_login?provider=microsoft"),{accessToken:r}).then(o=>e(o))};return f("div",{className:"grid grid-cols-3 text-sm mt-4",children:N("div",{className:"col-span-3 flex flex-col items-center space-y-3",children:[f(G8e,{onSuccess:r=>r.credential&&t(r.credential),onError:()=>ie.error()}),N(x7e,{onClick:async()=>{await XP.handleRedirectPromise(),XP.loginPopup({scopes:["user.read"]}).then(r=>i(r.accessToken))},children:[N("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 23 23",children:[f("path",{fill:"#f3f3f3",d:"M0 0h23v23H0z"}),f("path",{fill:"#f35325",d:"M1 1h10v10H1z"}),f("path",{fill:"#81bc06",d:"M12 1h10v10H12z"}),f("path",{fill:"#05a6f0",d:"M1 12h10v10H1z"}),f("path",{fill:"#ffba08",d:"M12 12h10v10H12z"})]}),f("p",{children:"Log in with Microsoft"})]})]})})}function DHt(){const[n]=ue(),e=Ci(),t=x0(),i=vi(),[r,o]=Mo(k7e),[s,a]=w.useState(!1),l=()=>{a(!1),o("false")},c=()=>{const u=(t==null?void 0:t.oauth_provider_id)==="google";ie.processing(),Te("PUT",ye("/api/v1/companies/:id",{id:i==null?void 0:i.id}),{...i,settings:{...i.settings,email_sending_method:u?"gmail":"office365",gmail_sending_user_id:t==null?void 0:t.id}}).then(d=>{e(Pw({object:"company",data:d.data.data})),ie.success("updated_settings"),l()})};return w.useEffect(()=>{((t==null?void 0:t.oauth_provider_id)==="microsoft"||(t==null?void 0:t.oauth_provider_id)==="google")&&(t!=null&&t.oauth_user_token)&&r==="true"&&a(!0)},[t,r]),N(cr,{title:n("email_provider"),visible:s,onClose:l,children:[f("span",{className:"text-base font-medium",children:Ds("select_email_provider",{provider:(t==null?void 0:t.oauth_provider_id)==="google"?"Gmail":"Outlook"})}),f(Ut,{className:"self-end",behavior:"button",type:"primary",onClick:c,children:n("yes")})]})}const k7e=Hde("connectMailer","false");function AHt(){const[n]=ue(),e=ha(),t=Ri(k7e),i=l=>{ie.processing(),window.location.href=ye("/auth/:mailer?react=true",{mailer:l}),t("true")},r=()=>{ie.processing(),Te("POST",ye("/api/v1/users/:id/disconnect_mailer",{id:e.id}),{}).then(l=>{hn(["users"]),ie.success(l.data.message),window.location.reload()}).finally(()=>t("false"))},o=()=>{ie.processing(),Te("POST",ye("/api/v1/users/:id/disconnect_oauth",{id:e.id})).then(l=>{hn(["users"]),ie.success(l.data.message),window.location.reload()}).finally(()=>t("false"))},s=l=>{Te("POST",ye("/api/v1/connected_account?include=company_user&provider=microsoft"),{accessToken:l}).then(()=>{window.location.reload()}).finally(()=>t("false"))},a=l=>{Te("POST",ye("/api/v1/connected_account?include=company_user&provider=google&id_token=:token",{token:l})).then(()=>{window.location.reload()}).finally(()=>t("false"))};return N(_t,{children:[f(DHt,{}),N(Ot,{title:n("oneclick_login"),children:[!(e!=null&&e.oauth_provider_id)&&Yo()&&N(_t,{children:[f("div",{className:"grid grid-cols-3 text-sm mt-4",children:f(U,{leftSide:"Google",children:f(G8e,{onSuccess:l=>l.credential&&a(l.credential),onError:()=>ie.error()})})}),f("div",{className:St("grid grid-cols-3 text-sm",{"mt-4":Yo()}),children:f(U,{leftSide:"Microsoft",children:N(x7e,{onClick:async()=>{await XP.handleRedirectPromise(),XP.loginPopup({scopes:["user.read"]}).then(l=>s(l.accessToken))},children:[N("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 23 23",children:[f("path",{fill:"#f3f3f3",d:"M0 0h23v23H0z"}),f("path",{fill:"#f35325",d:"M1 1h10v10H1z"}),f("path",{fill:"#81bc06",d:"M12 1h10v10H12z"}),f("path",{fill:"#05a6f0",d:"M1 12h10v10H1z"}),f("path",{fill:"#ffba08",d:"M12 12h10v10H12z"})]}),f("p",{style:{color:"#000"},children:"Log in with Microsoft"})]})})})]}),(e==null?void 0:e.oauth_provider_id)==="google"&&N(_t,{children:[f(U,{leftSide:"Google",children:f(Ut,{type:"minimal",behavior:"button",onClick:o,children:n("disconnect_google")})}),f(U,{leftSide:"Gmail",children:e!=null&&e.oauth_user_token?f(Ut,{type:"minimal",behavior:"button",onClick:r,children:n("disconnect_gmail")}):f(Ut,{type:"minimal",behavior:"button",onClick:()=>i("google"),children:n("connect_gmail")})})]}),(e==null?void 0:e.oauth_provider_id)==="microsoft"&&N(_t,{children:[f(U,{leftSide:"Microsoft",children:f(Ut,{type:"minimal",behavior:"button",onClick:o,children:n("disconnect_microsoft")})}),f(U,{leftSide:"Email",children:e!=null&&e.oauth_user_token?f(Ut,{type:"minimal",behavior:"button",onClick:r,children:n("disconnect_email")}):f(Ut,{type:"minimal",behavior:"button",onClick:()=>i("microsoft"),children:n("connect_email")})})]})]})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function ipe(){const{isAdmin:n}=ao();return!((Wp()||ql())&&n)}var D1=(n=>(n.SingleLineText="single_line_text",n.MultiLineText="multi_line_text",n.Switch="switch",n.Dropdown="dropdown",n.Date="date",n))(D1||{});function uf(n){const[e]=ue(),[t,i]=w.useState(""),[r,o]=w.useState(""),s=ipe(),[a,l]=w.useState("single_line_text"),c=["single_line_text","multi_line_text","switch","dropdown","date"],u=w.useRef(),d=w.useRef(),h=w.useRef();w.useEffect(()=>{if(n.initialValue){const p=n.initialValue.split("|");c.includes(p[1])?l(p[1]):(l("dropdown"),o(p[1])),i(p[0])}},[]);const g=()=>{var m,_,v,b,y;const p=((m=h.current)==null?void 0:m.value)==="dropdown"?(_=d.current)==null?void 0:_.value.split(",").map(C=>C.trim()).join(","):(v=h.current)==null?void 0:v.value;n.onChange&&n.onChange(`${((b=u.current)==null?void 0:b.value)||""}|${p}`,n.field,(y=h.current)==null?void 0:y.value)};return N(_t,{children:[f(U,{noExternalPadding:n.noExternalPadding,leftSide:f(ke,{innerRef:u,id:n.field,placeholder:n.placeholder,onChange:g,value:t,disabled:s}),children:N(nn,{innerRef:h,onChange:p=>{l(p.target.value),g()},value:a,children:[f("option",{value:"single_line_text",children:e("single_line_text")}),f("option",{value:"multi_line_text",children:e("multi_line_text")}),f("option",{value:"switch",children:e("switch")}),f("option",{value:"dropdown",children:e("dropdown")}),f("option",{value:"date",children:e("date")})]})}),a==="dropdown"&&f(Sb,{children:f(ke,{innerRef:d,id:"multi_line_text",placeholder:e("comma_sparated_list"),onChange:g,value:r})})]})}function Hke(n){const[e,t]=w.useState("single_line_text"),i=Vn();return w.useEffect(()=>{const[,r]=n.value.includes("|")?n.value.split("|"):[n.value,"multi_line_text"];t(r)},[n.field]),N(_t,{children:[e===D1.SingleLineText&&f(ke,{style:{color:i.$3,colorScheme:i.$0},type:"text",id:n.field,onValueChange:n.onValueChange,value:n.defaultValue||""}),e===D1.MultiLineText&&f(ke,{style:{color:i.$3,colorScheme:i.$0},element:"textarea",id:n.field,onValueChange:n.onValueChange,value:n.defaultValue||""}),e===D1.Switch&&f(gt,{style:{color:i.$3,colorScheme:i.$0},onChange:n.onValueChange,checked:typeof n.defaultValue=="string"?n.defaultValue==="true"||n.defaultValue==="1":n.defaultValue}),e===D1.Date&&f(ke,{style:{color:i.$3,colorScheme:i.$0},type:"date",id:n.field,onValueChange:n.onValueChange,value:n.defaultValue||""}),!Object.values(D1).includes(e)&&N(nn,{style:{color:i.$3,colorScheme:i.$0},value:n.defaultValue||"",onChange:r=>n.onValueChange(r.target.value),children:[f("option",{value:""}),e.split(",").map((r,o)=>f("option",{value:r,children:r},o))]})]})}function Z7(n){const[e,t]=n.includes("|")?n.split("|"):[n,""];return{label:()=>e,type:()=>t}}function mhr(){const n=vi();return e=>n&&n.custom_fields[e]?Z7(n.custom_fields[e]):Z7("")}function Do(n){const[e,t]=w.useState("");return w.useEffect(()=>{const[i]=n.value.includes("|")?n.value.split("|"):[n.value,""];t(i||"")},[]),n.fieldOnly?f(Hke,{...n}):f(U,{leftSide:e,noExternalPadding:n.noExternalPadding,children:f(Hke,{...n})})}const RHt=n=>te.isValidElement(n)&&n.type==="option";function Bj({children:n,value:e,errorMessage:t,disabled:i,onValueChange:r,label:o,dismissable:s,clearAfterSelection:a}){if(te.Children.toArray(n).every(RHt)===!1)throw new Error("SearchableSelect must have only <option> elements as children.");const c=te.Children.map(n,p=>w.isValidElement(p)&&{id:xj(),label:Array.isArray(p.props.children)?p.props.children.join(""):p.props.children,value:p.props.value,resource:null,eventType:"external",searchable:`${p.props.children??""} ${p.props.value??""}`}),u=te.Children.map(n,p=>w.isValidElement(p)&&{label:Array.isArray(p.props.children)?p.props.children.join(""):p.props.children,value:p.props.value}),d=a?"":c==null?void 0:c.find(p=>p.value===e),h=Vn();return N("div",{className:"space-y-2",children:[o?f($p,{children:o}):null,f(b_,{options:u,value:d,onChange:p=>r(p===null?"":p.value),isDisabled:i,isClearable:s,styles:{input:p=>({...p,color:h.$3}),singleValue:p=>({...p,color:h.$3}),menu:p=>({...p,width:"max-content",minWidth:"100%",backgroundColor:h.$4,borderColor:h.$4}),control:(p,{isDisabled:m})=>({...p,borderRadius:"3px",backgroundColor:h.$1,color:h.$3,borderColor:h.$5,cursor:m?"not-allowed":"pointer",pointerEvents:m?"auto":"unset"}),option:(p,{isSelected:m,isFocused:_})=>({...p,color:h.$3,backgroundColor:m||_?h.$7:h.$1,":hover":{backgroundColor:h.$7}})}}),t&&f(bs,{className:"mt-2",type:"danger",children:t})]})}function Y3(n){const e=gz();return f(Bj,{value:n.value,onValueChange:n.onChange,label:n.label,errorMessage:n.errorMessage,dismissable:n.dismissable,children:e.map((t,i)=>f("option",{value:t.id,children:t.name},i))})}function NHt(){var l,c,u,d,h,g,p,m,_;const[n]=ue(),e=$4e(),t=ha(),i=Ci(),r=vi(),[,o]=Mo(Tj),s=Tl(v=>v.user.changes),a=(v,b)=>{i(gk({property:v,value:b}))};return f(_t,{children:s&&N(Ot,{title:n("details"),children:[f(U,{leftSide:n("first_name"),children:f(ke,{value:(s==null?void 0:s.first_name)||(t==null?void 0:t.first_name)||"",onValueChange:v=>a("first_name",v),errorMessage:(((l=e==null?void 0:e.errors)==null?void 0:l.first_name)??[])[0]})}),f(U,{leftSide:n("last_name"),children:f(ke,{value:(s==null?void 0:s.last_name)||(t==null?void 0:t.last_name)||"",onValueChange:v=>a("last_name",v),errorMessage:(((c=e==null?void 0:e.errors)==null?void 0:c.last_name)??[])[0]})}),f(U,{leftSide:n("email"),children:f(ke,{value:(s==null?void 0:s.email)||(t==null?void 0:t.email)||"",type:"email",onValueChange:v=>a("email",v),errorMessage:(((u=e==null?void 0:e.errors)==null?void 0:u.email)??[])[0]})}),f(U,{leftSide:n("language"),children:f(Y3,{value:(s==null?void 0:s.language_id)||"",onChange:v=>{o(!0),a("language_id",v)},errorMessage:(((d=e==null?void 0:e.errors)==null?void 0:d.language_id)??[])[0],dismissable:!0})}),f(U,{leftSide:n("phone"),children:f(ke,{value:(s==null?void 0:s.phone)||(t==null?void 0:t.phone)||"",onValueChange:v=>a("phone",v),errorMessage:(((h=e==null?void 0:e.errors)==null?void 0:h.phone)??[])[0]})}),((g=r==null?void 0:r.custom_fields)==null?void 0:g.user1)&&f(Do,{field:"user1",defaultValue:s.custom_value1,value:r.custom_fields.user1,onValueChange:v=>a("custom_value1",v)}),((p=r==null?void 0:r.custom_fields)==null?void 0:p.user2)&&f(Do,{field:"user2",defaultValue:s.custom_value2,value:r.custom_fields.user2,onValueChange:v=>a("custom_value2",v)}),((m=r==null?void 0:r.custom_fields)==null?void 0:m.user3)&&f(Do,{field:"user3",defaultValue:s.custom_value3,value:r.custom_fields.user3,onValueChange:v=>a("custom_value3",v)}),((_=r==null?void 0:r.custom_fields)==null?void 0:_.user4)&&f(Do,{field:"user4",defaultValue:s.custom_value4,value:r.custom_fields.user4,onValueChange:v=>a("custom_value4",v)})]})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function OHt(){const[n]=ue();return[{key:"invoice_created",label:n("invoice_created")},{key:"invoice_sent",label:Ds("invoice_sent",{count:""})},{key:"invoice_viewed",label:n("invoice_viewed")},{key:"invoice_late",label:n("invoice_late")},{key:"inventory_threshold",label:n("inventory_threshold")},{key:"payment_success",label:n("payment_success")},{key:"payment_failure",label:n("payment_failure")},{key:"payment_manual",label:n("manual_payment")},{key:"purchase_order_created",label:n("purchase_order_created")},{key:"purchase_order_sent",label:n("purchase_order_sent")},{key:"purchase_order_viewed",label:n("purchase_order_viewed")},{key:"purchase_order_accepted",label:n("purchase_order_accepted")},{key:"quote_created",label:n("quote_created")},{key:"quote_sent",label:n("quote_sent")},{key:"quote_viewed",label:n("quote_viewed")},{key:"quote_approved",label:n("quote_approved")},{key:"quote_expired",label:n("quote_expired")},{key:"credit_created",label:n("credit_created")},{key:"credit_sent",label:n("credit_sent")},{key:"credit_viewed",label:n("credit_viewed")}]}function PHt(){var d,h,g;const[n]=ue(),e=Ci(),t=OHt(),i=Tl(p=>p.user.changes),r=L3(),[o,s]=w.useState(""),a=p=>{s(p);const m=Bn.cloneDeep(i),_=p==="custom"?[]:[p];Bn.set(m,"company_user.notifications.email",_),e(UY(m))},l=p=>{var m,_,v;return o==="all_notifications"?`${p}_all`:o==="all_user_notifications"?`${p}_user`:((v=(_=(m=i==null?void 0:i.company_user)==null?void 0:m.notifications)==null?void 0:_.email)==null?void 0:v.find(b=>b.startsWith(p)))||"none"},c=(p,m)=>{var C,x;const _=(x=(C=i==null?void 0:i.company_user)==null?void 0:C.notifications)==null?void 0:x.email,v=_.findIndex(k=>k.startsWith(p));let b=[..._];v>-1?m!=="none"?b=_.map((k,I)=>v===I?m:k):b=_.filter((k,I)=>v!==I):b=[...b,m];const y=Bn.cloneDeep(i);Bn.set(y,"company_user.notifications.email",b),e(UY(y))},u=p=>{var b,y;let _=[...(y=(b=i==null?void 0:i.company_user)==null?void 0:b.notifications)==null?void 0:y.email];p?_.find(x=>x==="task_assigned")||(_=[..._,"task_assigned"]):_=_.filter(C=>C!=="task_assigned");const v=Bn.cloneDeep(i);Bn.set(v,"company_user.notifications.email",_),e(UY(v))};return w.useEffect(()=>{var m,_;const p=(_=(m=i==null?void 0:i.company_user)==null?void 0:m.notifications)==null?void 0:_.email;p&&!o&&(p.includes("all_notifications")||p.includes("all_user_notifications")?s(p[0]):s("custom"))},[i]),N(Ot,{title:n("notifications"),children:[f(U,{leftSide:n("login_notification"),leftSideHelp:n("login_notification_help"),children:f(gt,{checked:i==null?void 0:i.user_logged_in_notification,onChange:p=>r("user_logged_in_notification",p)})}),f(U,{className:"mb-4",leftSide:n("task_assigned_notification"),leftSideHelp:n("task_assigned_notification_help"),children:f(gt,{checked:!!((g=(h=(d=i==null?void 0:i.company_user)==null?void 0:d.notifications)==null?void 0:h.email)!=null&&g.find(p=>p==="task_assigned")),onChange:p=>u(p)})}),f(Jn,{withoutPadding:!0}),f(U,{className:"my-4",leftSide:n("all_events"),children:N(nn,{value:o,onValueChange:p=>a(p),children:[f("option",{value:"all_notifications",children:n("all_records")}),f("option",{value:"all_user_notifications",children:n("owned_by_user")}),f("option",{value:"custom",children:n("custom")})]})}),f(Jn,{withoutPadding:!0}),f("div",{className:"flex flex-col",children:t.map((p,m)=>f(U,{className:"mt-0",leftSide:p.label,children:N(nn,{value:l(p.key),onValueChange:_=>c(p.key,_),disabled:!!o&&o!=="custom",children:[f("option",{value:`${p.key}_all`,children:n("all_records")}),f("option",{value:`${p.key}_user`,children:n("owned_by_user")}),f("option",{value:"none",children:n("none")})]})},m))})]})}function MHt(){var s;const[n]=ue(),e=Ci(),t=$4e(),i=Tl(a=>a.user.changes),[r,o]=w.useState(!1);return w.useEffect(()=>{r&&window.addEventListener("user.updated",()=>e(fpt()))},[r]),f(Ot,{title:n("password"),children:f(U,{leftSide:n("new_password"),children:f(ke,{type:"password",value:i.password||"",onValueChange:a=>{e(gk({property:"password",value:a})),!r&&o(!0)},errorMessage:(s=t==null?void 0:t.errors)==null?void 0:s.password})})})}var $j={},T7e={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},FHt=T7e;function I7e(n){this.mode=FHt.MODE_8BIT_BYTE,this.data=n}I7e.prototype={getLength:function(n){return this.data.length},write:function(n){for(var e=0;e<this.data.length;e++)n.put(this.data.charCodeAt(e),8)}};var BHt=I7e,L7e={L:1,M:0,Q:3,H:2},q6=L7e;function _v(n,e){this.totalCount=n,this.dataCount=e}_v.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];_v.getRSBlocks=function(n,e){var t=_v.getRsBlockTable(n,e);if(t==null)throw new Error("bad rs block @ typeNumber:"+n+"/errorCorrectLevel:"+e);for(var i=t.length/3,r=new Array,o=0;o<i;o++)for(var s=t[o*3+0],a=t[o*3+1],l=t[o*3+2],c=0;c<s;c++)r.push(new _v(a,l));return r};_v.getRsBlockTable=function(n,e){switch(e){case q6.L:return _v.RS_BLOCK_TABLE[(n-1)*4+0];case q6.M:return _v.RS_BLOCK_TABLE[(n-1)*4+1];case q6.Q:return _v.RS_BLOCK_TABLE[(n-1)*4+2];case q6.H:return _v.RS_BLOCK_TABLE[(n-1)*4+3];default:return}};var $Ht=_v;function D7e(){this.buffer=new Array,this.length=0}D7e.prototype={get:function(n){var e=Math.floor(n/8);return(this.buffer[e]>>>7-n%8&1)==1},put:function(n,e){for(var t=0;t<e;t++)this.putBit((n>>>e-t-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(n){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),n&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var VHt=D7e,Ym={glog:function(n){if(n<1)throw new Error("glog("+n+")");return Ym.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return Ym.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Iu=0;Iu<8;Iu++)Ym.EXP_TABLE[Iu]=1<<Iu;for(var Iu=8;Iu<256;Iu++)Ym.EXP_TABLE[Iu]=Ym.EXP_TABLE[Iu-4]^Ym.EXP_TABLE[Iu-5]^Ym.EXP_TABLE[Iu-6]^Ym.EXP_TABLE[Iu-8];for(var Iu=0;Iu<255;Iu++)Ym.LOG_TABLE[Ym.EXP_TABLE[Iu]]=Iu;var A7e=Ym,wS=A7e;function p8(n,e){if(n.length==null)throw new Error(n.length+"/"+e);for(var t=0;t<n.length&&n[t]==0;)t++;this.num=new Array(n.length-t+e);for(var i=0;i<n.length-t;i++)this.num[i]=n[i+t]}p8.prototype={get:function(n){return this.num[n]},getLength:function(){return this.num.length},multiply:function(n){for(var e=new Array(this.getLength()+n.getLength()-1),t=0;t<this.getLength();t++)for(var i=0;i<n.getLength();i++)e[t+i]^=wS.gexp(wS.glog(this.get(t))+wS.glog(n.get(i)));return new p8(e,0)},mod:function(n){if(this.getLength()-n.getLength()<0)return this;for(var e=wS.glog(this.get(0))-wS.glog(n.get(0)),t=new Array(this.getLength()),i=0;i<this.getLength();i++)t[i]=this.get(i);for(var i=0;i<n.getLength();i++)t[i]^=wS.gexp(wS.glog(n.get(i))+e);return new p8(t,0).mod(n)}};var R7e=p8,ep=T7e,Wke=R7e,HHt=A7e,X0={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},wu={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(n){for(var e=n<<10;wu.getBCHDigit(e)-wu.getBCHDigit(wu.G15)>=0;)e^=wu.G15<<wu.getBCHDigit(e)-wu.getBCHDigit(wu.G15);return(n<<10|e)^wu.G15_MASK},getBCHTypeNumber:function(n){for(var e=n<<12;wu.getBCHDigit(e)-wu.getBCHDigit(wu.G18)>=0;)e^=wu.G18<<wu.getBCHDigit(e)-wu.getBCHDigit(wu.G18);return n<<12|e},getBCHDigit:function(n){for(var e=0;n!=0;)e++,n>>>=1;return e},getPatternPosition:function(n){return wu.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,e,t){switch(n){case X0.PATTERN000:return(e+t)%2==0;case X0.PATTERN001:return e%2==0;case X0.PATTERN010:return t%3==0;case X0.PATTERN011:return(e+t)%3==0;case X0.PATTERN100:return(Math.floor(e/2)+Math.floor(t/3))%2==0;case X0.PATTERN101:return e*t%2+e*t%3==0;case X0.PATTERN110:return(e*t%2+e*t%3)%2==0;case X0.PATTERN111:return(e*t%3+(e+t)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){for(var e=new Wke([1],0),t=0;t<n;t++)e=e.multiply(new Wke([1,HHt.gexp(t)],0));return e},getLengthInBits:function(n,e){if(1<=e&&e<10)switch(n){case ep.MODE_NUMBER:return 10;case ep.MODE_ALPHA_NUM:return 9;case ep.MODE_8BIT_BYTE:return 8;case ep.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(e<27)switch(n){case ep.MODE_NUMBER:return 12;case ep.MODE_ALPHA_NUM:return 11;case ep.MODE_8BIT_BYTE:return 16;case ep.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(e<41)switch(n){case ep.MODE_NUMBER:return 14;case ep.MODE_ALPHA_NUM:return 13;case ep.MODE_8BIT_BYTE:return 16;case ep.MODE_KANJI:return 12;default:throw new Error("mode:"+n)}else throw new Error("type:"+e)},getLostPoint:function(n){for(var e=n.getModuleCount(),t=0,i=0;i<e;i++)for(var r=0;r<e;r++){for(var o=0,s=n.isDark(i,r),a=-1;a<=1;a++)if(!(i+a<0||e<=i+a))for(var l=-1;l<=1;l++)r+l<0||e<=r+l||a==0&&l==0||s==n.isDark(i+a,r+l)&&o++;o>5&&(t+=3+o-5)}for(var i=0;i<e-1;i++)for(var r=0;r<e-1;r++){var c=0;n.isDark(i,r)&&c++,n.isDark(i+1,r)&&c++,n.isDark(i,r+1)&&c++,n.isDark(i+1,r+1)&&c++,(c==0||c==4)&&(t+=3)}for(var i=0;i<e;i++)for(var r=0;r<e-6;r++)n.isDark(i,r)&&!n.isDark(i,r+1)&&n.isDark(i,r+2)&&n.isDark(i,r+3)&&n.isDark(i,r+4)&&!n.isDark(i,r+5)&&n.isDark(i,r+6)&&(t+=40);for(var r=0;r<e;r++)for(var i=0;i<e-6;i++)n.isDark(i,r)&&!n.isDark(i+1,r)&&n.isDark(i+2,r)&&n.isDark(i+3,r)&&n.isDark(i+4,r)&&!n.isDark(i+5,r)&&n.isDark(i+6,r)&&(t+=40);for(var u=0,r=0;r<e;r++)for(var i=0;i<e;i++)n.isDark(i,r)&&u++;var d=Math.abs(100*u/e/e-50)/5;return t+=d*10,t}},WHt=wu,zHt=BHt,N7e=$Ht,O7e=VHt,Hw=WHt,jHt=R7e;function Av(n,e){this.typeNumber=n,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var Og=Av.prototype;Og.addData=function(n){var e=new zHt(n);this.dataList.push(e),this.dataCache=null};Og.isDark=function(n,e){if(n<0||this.moduleCount<=n||e<0||this.moduleCount<=e)throw new Error(n+","+e);return this.modules[n][e]};Og.getModuleCount=function(){return this.moduleCount};Og.make=function(){if(this.typeNumber<1){var n=1;for(n=1;n<40;n++){for(var e=N7e.getRSBlocks(n,this.errorCorrectLevel),t=new O7e,i=0,r=0;r<e.length;r++)i+=e[r].dataCount;for(var r=0;r<this.dataList.length;r++){var o=this.dataList[r];t.put(o.mode,4),t.put(o.getLength(),Hw.getLengthInBits(o.mode,n)),o.write(t)}if(t.getLengthInBits()<=i*8)break}this.typeNumber=n}this.makeImpl(!1,this.getBestMaskPattern())};Og.makeImpl=function(n,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var t=0;t<this.moduleCount;t++){this.modules[t]=new Array(this.moduleCount);for(var i=0;i<this.moduleCount;i++)this.modules[t][i]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(n,e),this.typeNumber>=7&&this.setupTypeNumber(n),this.dataCache==null&&(this.dataCache=Av.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)};Og.setupPositionProbePattern=function(n,e){for(var t=-1;t<=7;t++)if(!(n+t<=-1||this.moduleCount<=n+t))for(var i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=t&&t<=6&&(i==0||i==6)||0<=i&&i<=6&&(t==0||t==6)||2<=t&&t<=4&&2<=i&&i<=4?this.modules[n+t][e+i]=!0:this.modules[n+t][e+i]=!1)};Og.getBestMaskPattern=function(){for(var n=0,e=0,t=0;t<8;t++){this.makeImpl(!0,t);var i=Hw.getLostPoint(this);(t==0||n>i)&&(n=i,e=t)}return e};Og.createMovieClip=function(n,e,t){var i=n.createEmptyMovieClip(e,t),r=1;this.make();for(var o=0;o<this.modules.length;o++)for(var s=o*r,a=0;a<this.modules[o].length;a++){var l=a*r,c=this.modules[o][a];c&&(i.beginFill(0,100),i.moveTo(l,s),i.lineTo(l+r,s),i.lineTo(l+r,s+r),i.lineTo(l,s+r),i.endFill())}return i};Og.setupTimingPattern=function(){for(var n=8;n<this.moduleCount-8;n++)this.modules[n][6]==null&&(this.modules[n][6]=n%2==0);for(var e=8;e<this.moduleCount-8;e++)this.modules[6][e]==null&&(this.modules[6][e]=e%2==0)};Og.setupPositionAdjustPattern=function(){for(var n=Hw.getPatternPosition(this.typeNumber),e=0;e<n.length;e++)for(var t=0;t<n.length;t++){var i=n[e],r=n[t];if(this.modules[i][r]==null)for(var o=-2;o<=2;o++)for(var s=-2;s<=2;s++)o==-2||o==2||s==-2||s==2||o==0&&s==0?this.modules[i+o][r+s]=!0:this.modules[i+o][r+s]=!1}};Og.setupTypeNumber=function(n){for(var e=Hw.getBCHTypeNumber(this.typeNumber),t=0;t<18;t++){var i=!n&&(e>>t&1)==1;this.modules[Math.floor(t/3)][t%3+this.moduleCount-8-3]=i}for(var t=0;t<18;t++){var i=!n&&(e>>t&1)==1;this.modules[t%3+this.moduleCount-8-3][Math.floor(t/3)]=i}};Og.setupTypeInfo=function(n,e){for(var t=this.errorCorrectLevel<<3|e,i=Hw.getBCHTypeInfo(t),r=0;r<15;r++){var o=!n&&(i>>r&1)==1;r<6?this.modules[r][8]=o:r<8?this.modules[r+1][8]=o:this.modules[this.moduleCount-15+r][8]=o}for(var r=0;r<15;r++){var o=!n&&(i>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=o:r<9?this.modules[8][15-r-1+1]=o:this.modules[8][15-r-1]=o}this.modules[this.moduleCount-8][8]=!n};Og.mapData=function(n,e){for(var t=-1,i=this.moduleCount-1,r=7,o=0,s=this.moduleCount-1;s>0;s-=2)for(s==6&&s--;;){for(var a=0;a<2;a++)if(this.modules[i][s-a]==null){var l=!1;o<n.length&&(l=(n[o]>>>r&1)==1);var c=Hw.getMask(e,i,s-a);c&&(l=!l),this.modules[i][s-a]=l,r--,r==-1&&(o++,r=7)}if(i+=t,i<0||this.moduleCount<=i){i-=t,t=-t;break}}};Av.PAD0=236;Av.PAD1=17;Av.createData=function(n,e,t){for(var i=N7e.getRSBlocks(n,e),r=new O7e,o=0;o<t.length;o++){var s=t[o];r.put(s.mode,4),r.put(s.getLength(),Hw.getLengthInBits(s.mode,n)),s.write(r)}for(var a=0,o=0;o<i.length;o++)a+=i[o].dataCount;if(r.getLengthInBits()>a*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+a*8+")");for(r.getLengthInBits()+4<=a*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=a*8||(r.put(Av.PAD0,8),r.getLengthInBits()>=a*8));)r.put(Av.PAD1,8);return Av.createBytes(r,i)};Av.createBytes=function(n,e){for(var t=0,i=0,r=0,o=new Array(e.length),s=new Array(e.length),a=0;a<e.length;a++){var l=e[a].dataCount,c=e[a].totalCount-l;i=Math.max(i,l),r=Math.max(r,c),o[a]=new Array(l);for(var u=0;u<o[a].length;u++)o[a][u]=255&n.buffer[u+t];t+=l;var d=Hw.getErrorCorrectPolynomial(c),h=new jHt(o[a],d.getLength()-1),g=h.mod(d);s[a]=new Array(d.getLength()-1);for(var u=0;u<s[a].length;u++){var p=u+g.getLength()-s[a].length;s[a][u]=p>=0?g.get(p):0}}for(var m=0,u=0;u<e.length;u++)m+=e[u].totalCount;for(var _=new Array(m),v=0,u=0;u<i;u++)for(var a=0;a<e.length;a++)u<o[a].length&&(_[v++]=o[a][u]);for(var u=0;u<r;u++)for(var a=0;a<e.length;a++)u<s[a].length&&(_[v++]=s[a][u]);return _};var UHt=Av,rpe={};Object.defineProperty(rpe,"__esModule",{value:!0});var qHt=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},KHt=qt,tp=M7e(KHt),P7e=w,K6=M7e(P7e);function M7e(n){return n&&n.__esModule?n:{default:n}}function GHt(n,e){var t={};for(var i in n)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t}var YHt={bgColor:tp.default.oneOfType([tp.default.object,tp.default.string]).isRequired,bgD:tp.default.string.isRequired,fgColor:tp.default.oneOfType([tp.default.object,tp.default.string]).isRequired,fgD:tp.default.string.isRequired,size:tp.default.number.isRequired,title:tp.default.string,viewBoxSize:tp.default.number.isRequired,xmlns:tp.default.string},QHt={title:void 0,xmlns:"http://www.w3.org/2000/svg"},Vj=(0,P7e.forwardRef)(function(n,e){var t=n.bgColor,i=n.bgD,r=n.fgD,o=n.fgColor,s=n.size,a=n.title,l=n.viewBoxSize,c=GHt(n,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize"]);return K6.default.createElement("svg",qHt({},c,{height:s,ref:e,viewBox:"0 0 "+l+" "+l,width:s}),a?K6.default.createElement("title",null,a):null,K6.default.createElement("path",{d:i,fill:t}),K6.default.createElement("path",{d:r,fill:o}))});Vj.displayName="QRCodeSvg";Vj.propTypes=YHt;Vj.defaultProps=QHt;rpe.default=Vj;Object.defineProperty($j,"__esModule",{value:!0});$j.QRCode=void 0;var XHt=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},ZHt=UHt,JHt=Q3(ZHt),eWt=L7e,tWt=Q3(eWt),nWt=qt,Kb=Q3(nWt),F7e=w,iWt=Q3(F7e),rWt=rpe,oWt=Q3(rWt);function Q3(n){return n&&n.__esModule?n:{default:n}}function sWt(n,e){var t={};for(var i in n)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t}var aWt={bgColor:Kb.default.oneOfType([Kb.default.object,Kb.default.string]),fgColor:Kb.default.oneOfType([Kb.default.object,Kb.default.string]),level:Kb.default.string,size:Kb.default.number,value:Kb.default.string.isRequired},lWt={bgColor:"#FFFFFF",fgColor:"#000000",level:"L",size:256},X3=(0,F7e.forwardRef)(function(n,e){var t=n.bgColor,i=n.fgColor,r=n.level,o=n.size,s=n.value,a=sWt(n,["bgColor","fgColor","level","size","value"]),l=new JHt.default(-1,tWt.default[r]);l.addData(s),l.make();var c=l.modules;return iWt.default.createElement(oWt.default,XHt({},a,{bgColor:t,bgD:c.map(function(u,d){return u.map(function(h,g){return h?"":"M "+g+" "+d+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:i,fgD:c.map(function(u,d){return u.map(function(h,g){return h?"M "+g+" "+d+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:e,size:o,viewBoxSize:c.length}))});$j.QRCode=X3;X3.displayName="QRCode";X3.propTypes=aWt;X3.defaultProps=lWt;var cWt=$j.default=X3;function uWt(n){const[e]=ue(),{resendSmsCode:t,verifyPhoneNumber:i,setVisible:r}=n,[o,s]=w.useState("");return f(cr,{title:e("sms_code"),visible:n.visible,onClose:()=>{r(!1),s("")},children:N("div",{children:[f("div",{className:"flex justify-end mb-1",children:f(Ut,{behavior:"button",type:"minimal",onClick:()=>s(""),children:e("clear")})}),f("div",{className:"flex justify-center",children:f(k8e,{value:o,onChange:s})}),N("div",{className:"flex justify-between mt-8",children:[f(Ut,{behavior:"button",type:"minimal",onClick:()=>{t(),s("")},children:e("resend_code")}),f(Ut,{behavior:"button",onClick:()=>i(o),disableWithoutIcon:!0,disabled:o.length!==6,children:e("verify")})]})]})})}function B7e(n){const[e]=ue(),t=ha(),i=Ci(),{checkVerification:r,setCheckVerification:o,isDisableModalOpen:s,setIsDisableModalOpen:a,checkOnlyPhoneNumberVerification:l}=n,[c,u]=w.useState(!1),[d,h]=w.useState(!1),[g,p]=w.useState(""),[m,_]=w.useState(""),[v,b]=w.useState(""),[y,C]=w.useState(!1),[x,k]=w.useState(),I=()=>{ie.processing(),Te("GET",ye("/api/v1/settings/enable_two_factor")).then(B=>{ie.dismiss(),p(B.data.data.qrCode),_(B.data.data.secret),u(!0)})},L=()=>{ie.processing(),k(void 0),Te("POST",ye("/api/v1/settings/enable_two_factor"),{secret:m,one_time_password:v}).then(B=>{ie.success(B.data.message),i(Uy(Bn.merge({},t,{google_2fa_secret:!0}))),u(!1)}).catch(B=>{var F;((F=B.response)==null?void 0:F.status)===422&&(k(B.response.data),ie.dismiss())}).finally(()=>C(!1))},D=()=>{ie.processing(),Te("POST",ye("/api/v1/settings/disable_two_factor")).then(()=>{ie.success("disabled_two_factor"),i(Uy(Bn.merge({},t,{google_2fa_secret:!1}))),a==null||a(!1)})},R=()=>{ie.processing(),Te("POST",ye("/api/v1/sms_reset"),{email:t.email}).then(()=>{ie.success("code_was_sent")})},P=B=>{ie.processing(),Te("POST",ye("/api/v1/sms_reset/confirm?validate_only=true"),{code:B,email:t.email}).then(()=>{ie.success("verified_phone_number"),i(Uy(Bn.merge({},t,{verified_phone_number:!0}))),h(!1),l||(I(),u(!0))})},M=()=>{I(),u(!0)};w.useEffect(()=>{r&&M()},[r]),w.useEffect(()=>{(!d||!c)&&o(!1)},[d,c]);const O=Vn();return N(_t,{children:[f(uWt,{visible:d,setVisible:h,resendSmsCode:R,verifyPhoneNumber:P}),N(cr,{title:e("enable_two_factor"),visible:c,onClose:u,children:[N("div",{className:"flex flex-col items-center pb-8 space-y-4",children:[f(cWt,{size:156,value:g}),f("p",{className:"font-semibold",style:{backgroundColor:O.$2,color:O.$3,colorScheme:O.$0},children:m})]}),f(ke,{id:"one_time_password",type:"text",label:e("one_time_password"),onValueChange:B=>b(B),errorMessage:x==null?void 0:x.errors.one_time_password}),f(Ut,{behavior:"button",disabled:y,onClick:L,children:e("continue")}),f(Ii,{external:!0,to:"https://github.com/antonioribeiro/google2fa#google-authenticator-apps",children:e("learn_more")})]}),a&&typeof s=="boolean"&&f(cr,{title:e("disable_two_factor"),visible:s,onClose:a,children:f(Ut,{behavior:"button",disabled:y,onClick:D,children:e("confirm")})})]})}function dWt(){const[n]=ue(),e=ha(),[t,i]=w.useState(!1),[r,o]=w.useState(!1);return N(_t,{children:[f(B7e,{checkVerification:r,setCheckVerification:o,isDisableModalOpen:t,setIsDisableModalOpen:i}),f(Ot,{title:n("enable_two_factor"),children:N(U,{leftSide:"2FA",children:[!(e!=null&&e.google_2fa_secret)&&f(Ut,{behavior:"button",type:"minimal",onClick:()=>o(!0),children:n("enable")}),(e==null?void 0:e.google_2fa_secret)&&f(Ut,{behavior:"button",type:"minimal",onClick:()=>i(!0),children:n("disable")})]})})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function em(){const n=bc({overwrite:!1}),e=Ci();return(t,i)=>{const[r]=i.split("|");if(r===""){const o=Bn.cloneDeep(n);return o&&delete o.custom_fields[t],e(gx({object:"company",data:o}))}e(Vr({object:"company",property:`custom_fields.${t}`,value:i}))}}function ope(n){const[e]=ue(),t=ha(),i=ipe(),{isAdmin:r}=ao();return f(_t,{children:i&&N("div",{className:n.className,children:[!r&&f(bs,{className:"mb-4",type:"warning",disableClosing:!0,children:N("div",{className:"flex items-center space-x-1",children:[f(yD,{fontSize:18}),N("span",{children:[e("not_allowed"),"."]})]})}),r&&f(bs,{className:"mb-4",type:"warning",disableClosing:!0,children:N("div",{className:"flex items-center justify-between",children:[N("p",{className:"inline-flex items-center space-x-1",children:[f(yD,{fontSize:18}),N("span",{children:[e("upgrade_to_paid_plan"),"."]})]}),(t==null?void 0:t.company_user)&&f(Ii,{to:t.company_user.ninja_portal_url||dt("/settings/account_management"),className:"ml-10",external:!0,children:e("plan_change")})]})})]})})}function hWt(){const[n]=ue(),e=vi(),t=em();return N(_t,{children:[f(ope,{}),f(Ot,{title:n("custom_fields"),children:e&&["user1","user2","user3","user4"].map(i=>f(uf,{initialValue:e.custom_fields[i],field:i,placeholder:n("user_field"),onChange:r=>t(i,r)},i))})]})}function fWt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"17 1 21 5 17 9"}},{tag:"path",attr:{d:"M3 11V9a4 4 0 0 1 4-4h14"}},{tag:"polyline",attr:{points:"7 23 3 19 7 15"}},{tag:"path",attr:{d:"M21 13v2a4 4 0 0 1-4 4H3"}}]})(n)}function gWt(n){return bn({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"}},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"}}]})(n)}function Ww(){const n=x0(),[e]=ue(),[t,i]=w.useState(!1),[r,o]=w.useState(null),s=Ci(),a=(h,g)=>s(gk({property:`company_user.react_settings.${h}`,value:g})),{getState:l}=jMe(),c=async({silent:h})=>{!h&&ie.processing(),Te("PUT",ye(`/api/v1/company_users/${n==null?void 0:n.id}/preferences?include=company_user`),{react_settings:l().user.changes.company_user.react_settings}).then(g=>{!h&&ie.success("updated_user"),hn(["company_users"]),s(Uy(g.data.data)),s($de()),i(!1)}).catch(g=>{var p;h&&ie.dismiss(),((p=g.response)==null?void 0:p.status)===412&&o(g.response.data)})},u=w.useMemo(()=>({children:h})=>N(_t,{children:[N(cr,{visible:t,onClose:i,title:e("preferences"),children:[h,f(Ut,{onClick:c,children:e("save")})]}),f(Ut,{type:"minimal",onClick:()=>i(!0),noBackgroundColor:!0,children:f(gWt,{})})]}),[t,r]),d=sl();return{Preferences:u,update:a,preferences:d.preferences,save:c}}function ZP({children:n,className:e}){return f("div",{className:St("inline-flex items-center space-x-2",e),children:n})}function pWt(){const[n]=ue(),e=Ci(),t=sl(),i=(r,o)=>{e(gk({property:r,value:o}))};return N("div",{className:"space-y-4",children:[N(Ot,{title:n("preferences"),children:[f(U,{leftSide:n("show_pdf_preview"),children:f(gt,{checked:typeof t.show_pdf_preview=="boolean"?t.show_pdf_preview:!0,onValueChange:r=>i("company_user.react_settings.show_pdf_preview",r)})}),f(U,{leftSide:n("show_document_preview"),children:f(gt,{checked:!!t.show_document_preview,onValueChange:r=>i("company_user.react_settings.show_document_preview",r)})}),f(U,{leftSide:n("react_notification_link"),leftSideHelp:n("react_notification_link_help"),children:f(gt,{checked:t.react_notification_link,onValueChange:r=>i("company_user.react_settings.react_notification_link",r)})}),f(U,{leftSide:n("number_precision"),leftSideHelp:n("number_precision_help"),children:f(ke,{value:t==null?void 0:t.number_precision,onValueChange:r=>i("company_user.react_settings.number_precision",r),type:"number",placeholder:n("number_precision")})}),f(U,{leftSide:n("dark_mode"),children:f(gt,{checked:!!(t!=null&&t.dark_mode),onChange:r=>i("company_user.react_settings.dark_mode",r)})}),f(U,{leftSide:n("show_table_footer"),leftSideHelp:n("show_table_footer_help"),children:f(gt,{checked:!!(t!=null&&t.show_table_footer),onValueChange:r=>i("company_user.react_settings.show_table_footer",r)})}),f(U,{leftSide:n("auto_expand_product_table_notes"),leftSideHelp:n("auto_expand_product_table_notes_help"),children:f(gt,{checked:!!t.preferences.auto_expand_product_table_notes,onValueChange:r=>i("company_user.react_settings.preferences.auto_expand_product_table_notes",r)})}),f(oAt,{})]}),N(dX,{title:`${n("dashboard")} ${n("charts")}`,path:"dashboard_charts",children:[f(ER,{path:"dashboard_charts.default_view"}),f(ER,{path:"dashboard_charts.currency"}),f(ER,{path:"dashboard_charts.range"})]}),f(dX,{title:n("datatable"),path:"datatables",children:f(ER,{path:"datatables.clients.sort"})}),f(dX,{title:n("reports"),path:"reports",children:f(ER,{path:"reports.columns"})})]})}function dX({title:n,children:e,path:t}){const{preferences:i}=Ww();return JSON.stringify(Bn.get(n7,t))===JSON.stringify(Bn.get(i,t))?null:f(Ot,{title:n,children:e})}function ER({path:n}){const{preferences:e,update:t}=Ww(),{t:i}=ue(),r={"dashboard_charts.default_view":`${i("default")} ${i("view")}`,"dashboard_charts.currency":i("currency"),"dashboard_charts.range":i("range"),"datatables.clients.sort":`${i("clients")} ${i("sort")}`,"reports.columns":i("columns")};return Bn.get(n7,n)===Bn.get(e,n)?null:f(Ja,{onClick:()=>t(`preferences.${n}`,Bn.get(n7,n)),children:N(ZP,{className:"space-x-2",children:[f("div",{children:r[n]}),f(L_,{size:18})]})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function mWt(){const{t:n}=ue();return[{name:n("details"),href:"/settings/user_details"},{name:n("password"),href:"/settings/user_details/password"},{name:n("oauth_mail"),href:"/settings/user_details/connect"},{name:n("enable_two_factor"),href:"/settings/user_details/enable_two_factor"},{name:n("accent_color"),href:"/settings/user_details/accent_color"},{name:n("notifications"),href:"/settings/user_details/notifications"},{name:n("custom_fields"),href:"/settings/user_details/custom_fields"},{name:n("preferences"),href:"/settings/user_details/preferences"}]}function _Wt(){gi("user_details");const[n]=ue(),e=mWt(),[t,i]=w.useState(),[r,o]=w.useState(!1),s=[{name:n("settings"),href:"/settings"},{name:n("user_details"),href:"/settings/user_details"}],[a,l]=Mo(Tj),c=ha(),u=Ci(),d=bc(),h=Ri(_f),[g,p]=w.useState(!1),m=Tl(y=>y.user),{isAdmin:_}=ao(),{save:v}=Ww(),b=(y,C)=>{ie.processing(),i(void 0);const x=[Te("PUT",ye("/api/v1/users/:id?include=company_user",{id:c.id}),m.changes,{headers:{"X-Api-Password":y}})];_&&x.push(Te("PUT",ye("/api/v1/companies/:id",{id:d==null?void 0:d.id}),d)),p4e.all(x).then(k=>{ie.success("updated_settings"),hn(["users"]),a&&(hn(["statics"]),l(!1)),k[0].data.data.phone!==(c==null?void 0:c.phone)&&(c!=null&&c.google_2fa_secret)&&!k[0].data.data.verified_phone_number&&o(!0),u(Uy(k[0].data.data)),window.dispatchEvent(new CustomEvent("user.updated")),_&&u(Pw({object:"company",data:k[1].data.data}))}).catch(k=>{var I,L;((I=k.response)==null?void 0:I.status)===412&&(ie.error("password_error_incorrect"),h(0)),((L=k.response)==null?void 0:L.status)==422&&(ie.dismiss(),i(k.response.data))}),v({silent:!0})};return w.useEffect(()=>{u($de())},[c]),N(_t,{children:[N($i,{onSaveClick:()=>p(!0),onCancelClick:()=>u(dpt()),title:n("user_details"),breadcrumbs:s,docsLink:"en/basic-settings/#user_details",children:[f(Rg,{show:g,onClose:p,onSave:b}),f(Vw,{tabs:e,className:"mt-6"}),f("div",{className:"my-4",children:f(ah,{context:t})})]}),f(B7e,{checkVerification:r,setCheckVerification:o,checkOnlyPhoneNumberVerification:!0})]})}function vWt(){var p,m;const[n]=ue(),e=Ti(),t=Ci(),[i,r]=w.useState(!1),[o,s]=w.useState(""),a=[{property:"amount",translation:n("amount")},{property:"address2",translation:n("address2")},{property:"balance",translation:n("balance")},{property:"country",translation:n("country")},{property:"credit",translation:n("credit")},{property:"credit_card",translation:n("credit_card")},{property:"date",translation:n("date")},{property:"description",translation:n("description")},{property:"details",translation:n("details")},{property:"discount",translation:n("discount")},{property:"due_date",translation:n("due_date")},{property:"email",translation:n("email")},{property:"from",translation:n("from")},{property:"hours",translation:n("hours")},{property:"id_number",translation:n("id_number")},{property:"invoice",translation:n("invoice")},{property:"item",translation:n("item")},{property:"line_total",translation:n("line_total")},{property:"po_number",translation:n("po_number")},{property:"paid_to_date",translation:n("paid_to_date")},{property:"partial_due",translation:n("partial_due")},{property:"payment_date",translation:n("payment_date")},{property:"phone",translation:n("phone")},{property:"quantity",translation:n("quantity")},{property:"quote",translation:n("quote")},{property:"rate",translation:n("rate")},{property:"service",translation:n("service")},{property:"statement",translation:n("statement")},{property:"address1",translation:n("address1")},{property:"subtotal",translation:n("subtotal")},{property:"surcharge",translation:n("surcharge")},{property:"tax",translation:n("tax")},{property:"taxes",translation:n("taxes")},{property:"terms",translation:n("terms")},{property:"to",translation:n("to")},{property:"total",translation:n("total")},{property:"unit_cost",translation:n("unit_cost")},{property:"vat_number",translation:n("vat_number")},{property:"valid_until",translation:n("valid_until")},{property:"website",translation:n("website")}],[l,c]=w.useState(a);w.useEffect(()=>{var v;const _=Object.keys(((v=e==null?void 0:e.settings)==null?void 0:v.translations)??[]);c(a.filter(b=>!_.includes(b.property)))},[e]);const u=_=>{const v=a.find(b=>b.property===_);return v?v.translation:n(_)},d=_=>{var b;const v=Bn.cloneDeep(e);(((b=v.settings.translations)==null?void 0:b.length)<=1||!v.settings.translations)&&(v.settings.translations={}),v.settings.translations[_]="",t(gx({object:"company",data:v}))},h=_=>t(Vr({object:"company",property:_.target.id,value:_.target.value})),g=_=>{var b;const v=Bn.cloneDeep(e);(b=v==null?void 0:v.settings)==null||delete b.translations[_],t(gx({object:"company",data:v}))};return N(_t,{children:[N(cr,{title:n("add_custom"),visible:i,onClose:r,children:[f(ke,{onChange:_=>s(_.target.value),id:"custom_field",label:n("custom_field")}),f(Ut,{onClick:()=>{d(o),s(""),r(!1)},children:n("submit")}),f(Ii,{external:!0,to:"https://github.com/invoiceninja/invoiceninja/blob/master/resources/lang/en/texts.php",children:n("labels")})]}),N(Ot,{title:n("custom_labels"),onFormSubmit:_=>_.preventDefault(),children:[f(U,{leftSide:N(nn,{onChange:_=>d(_.target.value),defaultValue:"",children:[f("option",{value:""}),l.map(_=>f("option",{value:_.property,children:_.translation},_.property))]}),children:f(Ut,{behavior:"button",type:"minimal",onClick:()=>r(!0),children:n("add_custom")})}),Object.keys(((p=e==null?void 0:e.settings)==null?void 0:p.translations)??[]).length>0&&f(Jn,{}),Object.keys(((m=e==null?void 0:e.settings)==null?void 0:m.translations)??[]).map(_=>{var v;return f(U,{leftSide:u(_),children:N("div",{className:"flex items-center space-x-4",children:[f(ke,{value:((v=e==null?void 0:e.settings)==null?void 0:v.translations[_])||"",onChange:h,id:`settings.translations.${_}`}),f(L_,{className:"cursor-pointer",onClick:()=>g(_)})]})},_)})]})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function $7e(){const n=Ci();return e=>{n(Vr({object:"company",property:e.target.id,value:e.target.value}))}}function Fo(){const n=Ci();return(e,t)=>{n(Vr({object:"company",property:e,value:t}))}}function bt(n){const{propertyKey:e,defaultValue:t="",onCheckboxChange:i}=n,{isCompanySettingsActive:r}=Ms(),o=Ti(),s=Fo(),[a,l]=w.useState(typeof(o==null?void 0:o.settings[e])<"u"),c=u=>{l(u);const d=Bn.cloneDeep(o==null?void 0:o.settings);d&&(u&&!Object.hasOwn(o==null?void 0:o.settings,e)&&(d[e]=t),!u&&Object.hasOwn(o==null?void 0:o.settings,e)&&delete d[e],s("settings",d))};return w.useEffect(()=>{c(a)},[a]),w.useEffect(()=>{o&&Object.hasOwn(o.settings,e)&&c(!0)},[e]),w.useEffect(()=>{typeof n.checked=="boolean"&&l(n.checked)},[n.checked]),N("div",{className:"flex items-center",children:[!r&&f(Nh,{checked:a,onValueChange:(u,d)=>{l(!!d),i==null||i(!!d)}}),f("div",{className:St({"opacity-75":!a&&!r,"cursor-pointer":!r}),onClick:()=>{!r&&l(u=>!u),!r&&(i==null||i(!a))},children:n.labelElement})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Zs(){const n=Ti(),{isCompanySettingsActive:e}=Ms();return t=>n&&typeof n.settings[t]>"u"&&!e}function yt(n){const{label:e,helpLabel:t,required:i}=n,r=Vn();return N("div",{className:"flex flex-col text-sm",children:[N("span",{className:"font-medium",style:{color:r.$3},children:[e,i&&f("span",{className:"ml-1 text-red-600",children:"*"})]}),t&&f("span",{className:"text-xs",dangerouslySetInnerHTML:{__html:t},style:{color:r.$3,opacity:.8}})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function spe(){const{data:n}=Nd(),[e,t]=w.useState([]);return w.useEffect(()=>{n!=null&&n.currencies&&t(n.currencies)},[n]),e}function ND(n){const e=spe();return f(Bj,{value:n.value,onValueChange:n.onChange,label:n.label,errorMessage:n.errorMessage,dismissable:n.dismissable,children:e.map((t,i)=>N("option",{value:t.id,children:[t.name," (",t.code,")"]},i))})}function bWt(){var d,h,g,p,m,_,v;const[n]=ue(),{data:e}=Nd(),t=Zs(),{isCompanySettingsActive:i}=Ms(),r=Ci(),o=bc(),s=ki(Ss),a=$7e(),l=Fo(),[,c]=Mo(Tj),u=[{id:"symbol",title:`${n("currency_symbol")}: $1,000.00`,value:"false"},{id:"code",title:`${n("currency_code")}: 1,000.00 USD`,value:"true"}];return f(_t,{children:N(Ot,{title:n("settings"),children:[f(U,{leftSide:f(bt,{propertyKey:"currency_id",labelElement:f(yt,{label:n("currency")}),defaultValue:"1"}),children:f(ND,{value:(o==null?void 0:o.settings.currency_id)||"",onChange:b=>l("settings.currency_id",b),disabled:t("currency_id"),errorMessage:s==null?void 0:s.errors["settings.currency_id"]})}),f(U,{leftSide:f(bt,{propertyKey:"show_currency_code",labelElement:f(yt,{label:n("currency_format")}),defaultValue:"false"}),children:f(kFe,{onValueChange:b=>r(Vr({object:"company",property:"settings.show_currency_code",value:b==="true"})),name:"show_currency_code",options:u,defaultSelected:((h=(d=o==null?void 0:o.settings)==null?void 0:d.show_currency_code)==null?void 0:h.toString())??"false",disabled:t("show_currency_code")})}),!u0()&&f(U,{leftSide:f(bt,{propertyKey:"language_id",labelElement:f(yt,{label:n("language")}),defaultValue:"1"}),children:f(Y3,{onChange:b=>{c(!0),l("settings.language_id",b)},value:((g=o==null?void 0:o.settings)==null?void 0:g.language_id)||"",disabled:t("language_id"),errorMessage:s==null?void 0:s.errors["settings.language_id"]})}),f(U,{leftSide:f(bt,{propertyKey:"timezone_id",labelElement:f(yt,{label:n("timezone")}),defaultValue:"1"}),children:f(Bj,{value:((p=o==null?void 0:o.settings)==null?void 0:p.timezone_id)||"1",disabled:t("timezone_id"),errorMessage:s==null?void 0:s.errors["settings.timezone_id"],onValueChange:b=>l("settings.timezone_id",b),children:e==null?void 0:e.timezones.sort((b,y)=>b.name.localeCompare(y.name)).map(b=>f("option",{value:b.id,children:b.name},b.id))})}),f(U,{leftSide:f(bt,{propertyKey:"date_format_id",labelElement:f(yt,{label:n("date_format")}),defaultValue:"1"}),children:f(nn,{onChange:a,id:"settings.date_format_id",value:((m=o==null?void 0:o.settings)==null?void 0:m.date_format_id)||"1",disabled:t("date_format_id"),errorMessage:s==null?void 0:s.errors["settings.date_format_id"],children:e==null?void 0:e.date_formats.map(b=>f("option",{value:b.id,children:Cn().format(b.format_moment)},b.id))})}),f(U,{leftSide:f(bt,{propertyKey:"military_time",labelElement:f(yt,{label:n("military_time")}),defaultValue:!1}),children:f(gt,{checked:!!((_=o==null?void 0:o.settings)!=null&&_.military_time),onChange:b=>r(Vr({object:"company",property:"settings.military_time",value:b})),disabled:t("military_time"),cypressRef:"militaryTimeToggle"})}),f(U,{leftSide:f(bt,{propertyKey:"enable_rappen_rounding",labelElement:f(yt,{label:n("rappen_rounding")}),defaultValue:!1}),children:f(gt,{checked:!!((v=o==null?void 0:o.settings)!=null&&v.enable_rappen_rounding),onChange:b=>r(Vr({object:"company",property:"settings.enable_rappen_rounding",value:b})),disabled:t("enable_rappen_rounding")})}),i&&f(Jn,{}),i&&f(U,{leftSide:n("first_month_of_the_year"),children:N(nn,{id:"first_month_of_year",value:(o==null?void 0:o.first_month_of_year)||"1",onChange:a,errorMessage:s==null?void 0:s.errors["settings.first_month_of_year"],children:[f("option",{value:"1",children:n("january")}),f("option",{value:"2",children:n("february")}),f("option",{value:"3",children:n("march")}),f("option",{value:"4",children:n("april")}),f("option",{value:"5",children:n("may")}),f("option",{value:"6",children:n("june")}),f("option",{value:"7",children:n("july")}),f("option",{value:"8",children:n("august")}),f("option",{value:"9",children:n("september")}),f("option",{value:"10",children:n("october")}),f("option",{value:"11",children:n("november")}),f("option",{value:"12",children:n("december")})]})})]})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function yWt(){const[n]=ue(),{isGroupSettingsActive:e,isClientSettingsActive:t}=Ms();let i=[{name:n("settings"),href:"/settings/localization"},{name:n("custom_labels"),href:"/settings/localization/custom_labels"}];return(e||t)&&(i=i.filter(r=>n(r.name)!==n("custom_labels"))),i}function CWt(){const[n]=ue();gi("localization");const e=yWt(),t=[{name:n("settings"),href:"/settings"},{name:n("localization"),href:"/settings/localization"}],i=pu(),r=vf();return N($i,{onSaveClick:i,onCancelClick:r,title:n("localization"),breadcrumbs:t,docsLink:"en/basic-settings/#localization",children:[f(Vw,{tabs:e,className:"mt-6"}),f("div",{className:"my-4",children:f(ah,{})})]})}const wWt={variant:"generic"};function Gi(n){n={...wWt,...n};const e=ys(),t={...n.style};return n.variant==="primary"&&(t.backgroundColor=t.backgroundColor||e,t.color="white"),f("span",{style:t,className:St("text-xs px-2 py-1 rounded",{"bg-gray-500 text-white":n.variant==="generic","bg-white border text-gray-900 hover:bg-white":n.variant==="white","bg-yellow-600 text-white":n.variant==="yellow","bg-red-600 text-white":n.variant==="red","bg-blue-300 text-white":n.variant==="light-blue","bg-blue-400 text-white":n.variant==="blue","bg-blue-700 text-white":n.variant==="dark-blue","bg-orange-500 text-white":n.variant==="orange","bg-green-500 text-white":n.variant==="green","bg-black text-white":n.variant==="black","bg-purple text-white":n.variant==="purple"}),children:n.children})}function zp(n){const[e]=ue(),t=nr(n.entity);return t===Di.Active?f(Gi,{variant:"primary",children:e("active")}):t===Di.Archived?f(Gi,{variant:"yellow",children:e("archived")}):t===Di.Deleted?f(Gi,{variant:"red",children:e("deleted")}):f(_t,{})}const SWt={totalPages:1,currentPage:1,currentPerPage:"10",onPageChange:n=>n,onRowsChange:n=>n,totalRecords:0};function V7e(n){n={...SWt,...n};const[e]=ue(),t=r=>{r>=1&&r<=n.totalPages&&n.onPageChange(r)},i=Vn();return N("div",{className:"flex items-center justify-between space-x-2 my-3 overflow-y-auto pb-2",children:[f("div",{className:"flex justify-center md:justify-start items-center space-x-4",children:N("div",{className:"flex items-center space-x-2 flex-wrap",children:[N(nn,{value:n.currentPerPage,onValueChange:r=>n.onRowsChange(r),children:[f("option",{value:"10",children:"10"}),f("option",{value:"50",children:"50"}),f("option",{value:"100",children:"100"})]}),f("label",{htmlFor:"location",className:"block text-sm font-medium",style:{color:i.$3},children:e("rows")})]})}),N("p",{className:"hidden lg:block text-sm font-medium",style:{color:i.$3},children:[Ds("pdf_page_info",{current:n.currentPage,total:n.totalPages}),".",n.totalRecords&&N("span",{className:"ml-1",children:[e("total_results"),": ",n.totalRecords]})]}),N("nav",{className:"flex justify-center md:justify-end my-4 md:my-0 items-center",style:{color:i.$3},children:[n.leftSideChevrons,f("button",{onClick:()=>t(1),className:"py-1.5 px-2 border rounded-l",style:{backgroundColor:i.$1,borderColor:i.$5},children:f(gmt,{})}),f("button",{onClick:()=>t(n.currentPage-1),className:"py-1.5 px-2 bg-white border-b border-t border-r hover:bg-gray-50",style:{backgroundColor:i.$1,borderColor:i.$5},children:f(q3e,{})}),f("button",{"data-cy":"dataTableChevronRight",onClick:()=>t(n.currentPage+1),className:"py-1.5 px-2 bg-white border-b border-t border-r hover:bg-gray-50",style:{backgroundColor:i.$1,borderColor:i.$5},children:f(nhe,{})}),f("button",{onClick:()=>t(n.totalPages),className:"py-1.5 px-2 bg-white border-b border-t border-r hover:bg-gray-50 rounded-r",style:{backgroundColor:i.$1,borderColor:i.$5},children:f(op,{})})]})]})}function zw(n){var g,p;const{onVerticalOverflowChange:e}=n,[t,i]=w.useState(),[r,o]=w.useState(),[s,a]=w.useState((g=n.style)==null?void 0:g.height),[l,c]=w.useState(!0),u=m=>{m&&e&&i(m.clientHeight)},d=m=>{m&&e&&o(m.clientHeight)};w.useEffect(()=>{typeof r=="number"&&typeof t=="number"&&!n.isDataLoading&&e&&(r>t?(e(!0),c(!0)):(e(!1),c(!1)))},[n.isDataLoading,r,t]),w.useEffect(()=>{var m;(m=n.style)!=null&&m.height&&a(n.style.height)},[(p=n.style)==null?void 0:p.height]),w.useEffect(()=>{!l&&e&&a("auto")},[l]);const h=Vn();return f("div",{className:St("flex flex-col",{"mt-2":!n.withoutPadding}),children:f("div",{className:St("align-middle inline-block min-w-full",{"py-1.5":!n.withoutPadding}),children:f("div",{className:St("overflow-hidden border rounded border-b border-t",{"border-b-0":n.withoutBottomBorder,"border-t-0":n.withoutTopBorder,"border-l-0":n.withoutLeftBorder,"border-r-0":n.withoutRightBorder}),style:{backgroundColor:h.$1,color:h.$3,borderColor:h.$4},children:f("div",{ref:u,className:`overflow-y-auto rounded ${n.className}`,style:{...n.style,height:s},children:f("table",{ref:d,className:"min-w-full table-auto",children:n.children})})})})})}function jw(n){const[e]=ue();return N("tbody",{style:n.style,ref:n.innerRef,children:[!n.data&&n.showHelperPlaceholders&&f(zl,{children:f(eo,{colSpan:20,children:f(Vo,{})})}),n.data&&n.showHelperPlaceholders&&n.data.data.meta.pagination.total===0&&f(zl,{children:f(eo,{colSpan:20,children:f("p",{children:e("empty_table")})})}),n.children]})}function eo(n){const{customizeTextColor:e}=n,t=oj(),i=Vn(),r=ys(),{red:o,green:s,blue:a,hex:l}=R3(r),c=rj(o,s,a)?-220:220;return f("td",{width:n.width,colSpan:n.colSpan,rowSpan:n.rowSpan,onClick:n.onClick,className:`px-2 lg:px-2.5 xl:px-4 py-2 whitespace-nowrap text-sm ${n.className}`,style:{color:e?t(l,c):i.$3},children:n.children})}const EWt={isCurrentlyUsed:!1};function la(n){n={...EWt,...n};const[e,t]=w.useState("asc");function i(){n.onColumnClick&&(t(e==="desc"?"asc":"desc"),n.onColumnClick({sort:`${n.id}|${e}`,field:n.id}))}const r=Vn();return f("th",{style:{color:n.textColor||r.$9,borderColor:r.$4},onClick:i,className:St(`px-2 lg:px-2.5 xl:px-4 py-2.5 text-left text-xs font-medium tracking-wider whitespace-nowrap ${n.className}`,{"cursor-pointer":n.onColumnClick,uppercase:!n.disableUppercase}),children:N("div",{className:`flex items-center space-x-1 ${n.childrenClassName}`,children:[f("span",{children:n.children}),n.onColumnClick&&N("div",{className:"flex items-center",children:[f(K3e,{className:St("opacity-25",{"opacity-100":e==="asc"&&n.isCurrentlyUsed}),size:16}),f(z2,{className:St("opacity-25",{"opacity-100":e==="desc"&&n.isCurrentlyUsed}),size:16})]})]})})}function Uw(n){const{backgroundColor:e}=n,t=ys();return f("thead",{style:{backgroundColor:e||t},children:f("tr",{children:n.children})})}function zl(n){const{onClick:e,innerRef:t,backgroundColor:i,...r}=n,o=Vn();return f("tr",{style:{backgroundColor:i||o.$1},onClick:s=>{var a;return n.onClick&&((a=s.target)==null?void 0:a.nodeName)==="TD"?n.onClick():null},ref:t,...r,className:St(`${n.className}`,{"cursor-pointer":e}),tabIndex:n.tabIndex,children:n.children})}function xWt(n,e){if(n.length!==e.length)return!1;for(var t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function H7e(n,e){var t=w.useState(function(){return{inputs:e,result:n()}})[0],i=w.useRef(!0),r=w.useRef(t),o=i.current||!!(e&&r.current.inputs&&xWt(e,r.current.inputs)),s=o?r.current:{inputs:e,result:n()};return w.useEffect(function(){i.current=!1,r.current=s},[s]),s.result}function kWt(n,e){return H7e(function(){return n},e)}var Ao=H7e,Li=kWt,TWt="Invariant failed";function IWt(n,e){if(!n)throw new Error(TWt)}var n_=function(e){var t=e.top,i=e.right,r=e.bottom,o=e.left,s=i-o,a=r-t,l={top:t,right:i,bottom:r,left:o,width:s,height:a,x:o,y:t,center:{x:(i+o)/2,y:(r+t)/2}};return l},ape=function(e,t){return{top:e.top-t.top,left:e.left-t.left,bottom:e.bottom+t.bottom,right:e.right+t.right}},zke=function(e,t){return{top:e.top+t.top,left:e.left+t.left,bottom:e.bottom-t.bottom,right:e.right-t.right}},LWt=function(e,t){return{top:e.top+t.y,left:e.left+t.x,bottom:e.bottom+t.y,right:e.right+t.x}},hX={top:0,right:0,bottom:0,left:0},lpe=function(e){var t=e.borderBox,i=e.margin,r=i===void 0?hX:i,o=e.border,s=o===void 0?hX:o,a=e.padding,l=a===void 0?hX:a,c=n_(ape(t,r)),u=n_(zke(t,s)),d=n_(zke(u,l));return{marginBox:c,borderBox:n_(t),paddingBox:u,contentBox:d,margin:r,border:s,padding:l}},np=function(e){var t=e.slice(0,-2),i=e.slice(-2);if(i!=="px")return 0;var r=Number(t);return isNaN(r)&&IWt(!1),r},DWt=function(){return{x:window.pageXOffset,y:window.pageYOffset}},J7=function(e,t){var i=e.borderBox,r=e.border,o=e.margin,s=e.padding,a=LWt(i,t);return lpe({borderBox:a,border:r,margin:o,padding:s})},eV=function(e,t){return t===void 0&&(t=DWt()),J7(e,t)},W7e=function(e,t){var i={top:np(t.marginTop),right:np(t.marginRight),bottom:np(t.marginBottom),left:np(t.marginLeft)},r={top:np(t.paddingTop),right:np(t.paddingRight),bottom:np(t.paddingBottom),left:np(t.paddingLeft)},o={top:np(t.borderTopWidth),right:np(t.borderRightWidth),bottom:np(t.borderBottomWidth),left:np(t.borderLeftWidth)};return lpe({borderBox:e,margin:i,padding:r,border:o})},z7e=function(e){var t=e.getBoundingClientRect(),i=window.getComputedStyle(e);return W7e(t,i)},AWt=function(e){var t=[],i=null,r=function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];t=a,!i&&(i=requestAnimationFrame(function(){i=null,e.apply(void 0,t)}))};return r.cancel=function(){i&&(cancelAnimationFrame(i),i=null)},r};const JP=AWt;function j7e(n,e){}j7e.bind(null,"warn");j7e.bind(null,"error");function CC(){}function RWt(n,e){return{...n,...e}}function mp(n,e,t){const i=e.map(r=>{const o=RWt(t,r.options);return n.addEventListener(r.eventName,r.fn,o),function(){n.removeEventListener(r.eventName,r.fn,o)}});return function(){i.forEach(o=>{o()})}}const NWt="Invariant failed";class tV extends Error{}tV.prototype.toString=function(){return this.message};function kn(n,e){if(!n)throw new tV(NWt)}class OWt extends te.Component{constructor(){super(...arguments),this.callbacks=null,this.unbind=CC,this.onWindowError=e=>{const t=this.getCallbacks();t.isDragging()&&t.tryAbort(),e.error instanceof tV&&e.preventDefault()},this.getCallbacks=()=>{if(!this.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return this.callbacks},this.setCallbacks=e=>{this.callbacks=e}}componentDidMount(){this.unbind=mp(window,[{eventName:"error",fn:this.onWindowError}])}componentDidCatch(e){if(e instanceof tV){this.setState({});return}throw e}componentWillUnmount(){this.unbind()}render(){return this.props.children(this.setCallbacks)}}const PWt=`
Press space bar to start a drag.
When dragging you can use the arrow keys to move the item around and escape to cancel.
Some screen readers may require you to be in focus mode or to use your pass through key
`,nV=n=>n+1,MWt=n=>`
You have lifted an item in position ${nV(n.source.index)}
`,U7e=(n,e)=>{const t=n.droppableId===e.droppableId,i=nV(n.index),r=nV(e.index);return t?`
You have moved the item from position ${i}
to position ${r}
`:`
You have moved the item from position ${i}
in list ${n.droppableId}
to list ${e.droppableId}
in position ${r}
`},q7e=(n,e,t)=>e.droppableId===t.droppableId?`
The item ${n}
has been combined with ${t.draggableId}`:`
The item ${n}
in list ${e.droppableId}
has been combined with ${t.draggableId}
in list ${t.droppableId}
`,FWt=n=>{const e=n.destination;if(e)return U7e(n.source,e);const t=n.combine;return t?q7e(n.draggableId,n.source,t):"You are over an area that cannot be dropped on"},jke=n=>`
The item has returned to its starting position
of ${nV(n.index)}
`,BWt=n=>{if(n.reason==="CANCEL")return`
Movement cancelled.
${jke(n.source)}
`;const e=n.destination,t=n.combine;return e?`
You have dropped the item.
${U7e(n.source,e)}
`:t?`
You have dropped the item.
${q7e(n.draggableId,n.source,t)}
`:`
The item has been dropped while not over a drop area.
${jke(n.source)}
`},$Wt={dragHandleUsageInstructions:PWt,onDragStart:MWt,onDragUpdate:FWt,onDragEnd:BWt};var m8=$Wt;const hu={x:0,y:0},Bu=(n,e)=>({x:n.x+e.x,y:n.y+e.y}),ig=(n,e)=>({x:n.x-e.x,y:n.y-e.y}),wC=(n,e)=>n.x===e.x&&n.y===e.y,lA=n=>({x:n.x!==0?-n.x:0,y:n.y!==0?-n.y:0}),Ex=function(n,e,t){return t===void 0&&(t=0),n==="x"?{x:e,y:t}:{x:t,y:e}},eM=(n,e)=>Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2),Uke=(n,e)=>Math.min(...e.map(t=>eM(n,t))),K7e=n=>e=>({x:n(e.x),y:n(e.y)});var VWt=(n,e)=>{const t=n_({top:Math.max(e.top,n.top),right:Math.min(e.right,n.right),bottom:Math.min(e.bottom,n.bottom),left:Math.max(e.left,n.left)});return t.width<=0||t.height<=0?null:t};const Z3=(n,e)=>({top:n.top+e.y,left:n.left+e.x,bottom:n.bottom+e.y,right:n.right+e.x}),qke=n=>[{x:n.left,y:n.top},{x:n.right,y:n.top},{x:n.left,y:n.bottom},{x:n.right,y:n.bottom}],HWt={top:0,right:0,bottom:0,left:0},WWt=(n,e)=>e?Z3(n,e.scroll.diff.displacement):n,zWt=(n,e,t)=>t&&t.increasedBy?{...n,[e.end]:n[e.end]+t.increasedBy[e.line]}:n,jWt=(n,e)=>e&&e.shouldClipSubject?VWt(e.pageMarginBox,n):n_(n);var OD=n=>{let{page:e,withPlaceholder:t,axis:i,frame:r}=n;const o=WWt(e.marginBox,r),s=zWt(o,i,t),a=jWt(s,r);return{page:e,withPlaceholder:t,active:a}},cpe=(n,e)=>{n.frame||kn(!1);const t=n.frame,i=ig(e,t.scroll.initial),r=lA(i),o={...t,scroll:{initial:t.scroll.initial,current:e,diff:{value:i,displacement:r},max:t.scroll.max}},s=OD({page:n.subject.page,withPlaceholder:n.subject.withPlaceholder,axis:n.axis,frame:o});return{...n,frame:o,subject:s}};const G7e=Mc(n=>n.reduce((e,t)=>(e[t.descriptor.id]=t,e),{})),Y7e=Mc(n=>n.reduce((e,t)=>(e[t.descriptor.id]=t,e),{})),Hj=Mc(n=>Object.values(n)),UWt=Mc(n=>Object.values(n));var cA=Mc((n,e)=>UWt(e).filter(i=>n===i.descriptor.droppableId).sort((i,r)=>i.descriptor.index-r.descriptor.index));function upe(n){return n.at&&n.at.type==="REORDER"?n.at.destination:null}function Wj(n){return n.at&&n.at.type==="COMBINE"?n.at.combine:null}var zj=Mc((n,e)=>e.filter(t=>t.descriptor.id!==n.descriptor.id)),qWt=n=>{let{isMovingForward:e,draggable:t,destination:i,insideDestination:r,previousImpact:o}=n;if(!i.isCombineEnabled||!upe(o))return null;function a(p){const m={type:"COMBINE",combine:{draggableId:p,droppableId:i.descriptor.id}};return{...o,at:m}}const l=o.displaced.all,c=l.length?l[0]:null;if(e)return c?a(c):null;const u=zj(t,r);if(!c){if(!u.length)return null;const p=u[u.length-1];return a(p.descriptor.id)}const d=u.findIndex(p=>p.descriptor.id===c);d===-1&&kn(!1);const h=d-1;if(h<0)return null;const g=u[h];return a(g.descriptor.id)},uA=(n,e)=>n.descriptor.droppableId===e.descriptor.id;const Q7e={point:hu,value:0},tM={invisible:{},visible:{},all:[]},KWt={displaced:tM,displacedBy:Q7e,at:null};var GWt=KWt,kp=(n,e)=>t=>n<=t&&t<=e,X7e=n=>{const e=kp(n.top,n.bottom),t=kp(n.left,n.right);return i=>{if(e(i.top)&&e(i.bottom)&&t(i.left)&&t(i.right))return!0;const o=e(i.top)||e(i.bottom),s=t(i.left)||t(i.right);if(o&&s)return!0;const l=i.top<n.top&&i.bottom>n.bottom,c=i.left<n.left&&i.right>n.right;return l&&c?!0:l&&s||c&&o}},YWt=n=>{const e=kp(n.top,n.bottom),t=kp(n.left,n.right);return i=>e(i.top)&&e(i.bottom)&&t(i.left)&&t(i.right)};const dpe={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},Z7e={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"};var QWt=n=>e=>{const t=kp(e.top,e.bottom),i=kp(e.left,e.right);return r=>n===dpe?t(r.top)&&t(r.bottom):i(r.left)&&i(r.right)};const XWt=(n,e)=>{const t=e.frame?e.frame.scroll.diff.displacement:hu;return Z3(n,t)},ZWt=(n,e,t)=>e.subject.active?t(e.subject.active)(n):!1,JWt=(n,e,t)=>t(e)(n),hpe=n=>{let{target:e,destination:t,viewport:i,withDroppableDisplacement:r,isVisibleThroughFrameFn:o}=n;const s=r?XWt(e,t):e;return ZWt(s,t,o)&&JWt(s,i,o)},ezt=n=>hpe({...n,isVisibleThroughFrameFn:X7e}),J7e=n=>hpe({...n,isVisibleThroughFrameFn:YWt}),tzt=n=>hpe({...n,isVisibleThroughFrameFn:QWt(n.destination.axis)}),nzt=(n,e,t)=>{if(typeof t=="boolean")return t;if(!e)return!0;const{invisible:i,visible:r}=e;if(i[n])return!1;const o=r[n];return o?o.shouldAnimate:!0};function izt(n,e){const t=n.page.marginBox,i={top:e.point.y,right:0,bottom:0,left:e.point.x};return n_(ape(t,i))}function nM(n){let{afterDragging:e,destination:t,displacedBy:i,viewport:r,forceShouldAnimate:o,last:s}=n;return e.reduce(function(l,c){const u=izt(c,i),d=c.descriptor.id;if(l.all.push(d),!ezt({target:u,destination:t,viewport:r,withDroppableDisplacement:!0}))return l.invisible[c.descriptor.id]=!0,l;const g=nzt(d,s,o),p={draggableId:d,shouldAnimate:g};return l.visible[d]=p,l},{all:[],visible:{},invisible:{}})}function rzt(n,e){if(!n.length)return 0;const t=n[n.length-1].descriptor.index;return e.inHomeList?t:t+1}function Kke(n){let{insideDestination:e,inHomeList:t,displacedBy:i,destination:r}=n;const o=rzt(e,{inHomeList:t});return{displaced:tM,displacedBy:i,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:o}}}}function iV(n){let{draggable:e,insideDestination:t,destination:i,viewport:r,displacedBy:o,last:s,index:a,forceShouldAnimate:l}=n;const c=uA(e,i);if(a==null)return Kke({insideDestination:t,inHomeList:c,displacedBy:o,destination:i});const u=t.find(m=>m.descriptor.index===a);if(!u)return Kke({insideDestination:t,inHomeList:c,displacedBy:o,destination:i});const d=zj(e,t),h=t.indexOf(u),g=d.slice(h);return{displaced:nM({afterDragging:g,destination:i,displacedBy:o,last:s,viewport:r.frame,forceShouldAnimate:l}),displacedBy:o,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:a}}}}function nw(n,e){return!!e.effected[n]}var ozt=n=>{let{isMovingForward:e,destination:t,draggables:i,combine:r,afterCritical:o}=n;if(!t.isCombineEnabled)return null;const s=r.draggableId,l=i[s].descriptor.index;return nw(s,o)?e?l:l-1:e?l+1:l},szt=n=>{let{isMovingForward:e,isInHomeList:t,insideDestination:i,location:r}=n;if(!i.length)return null;const o=r.index,s=e?o+1:o-1,a=i[0].descriptor.index,l=i[i.length-1].descriptor.index,c=t?l:l+1;return s<a||s>c?null:s},azt=n=>{let{isMovingForward:e,isInHomeList:t,draggable:i,draggables:r,destination:o,insideDestination:s,previousImpact:a,viewport:l,afterCritical:c}=n;const u=a.at;if(u||kn(!1),u.type==="REORDER"){const h=szt({isMovingForward:e,isInHomeList:t,location:u.destination,insideDestination:s});return h==null?null:iV({draggable:i,insideDestination:s,destination:o,viewport:l,last:a.displaced,displacedBy:a.displacedBy,index:h})}const d=ozt({isMovingForward:e,destination:o,displaced:a.displaced,draggables:r,combine:u.combine,afterCritical:c});return d==null?null:iV({draggable:i,insideDestination:s,destination:o,viewport:l,last:a.displaced,displacedBy:a.displacedBy,index:d})},lzt=n=>{let{displaced:e,afterCritical:t,combineWith:i,displacedBy:r}=n;const o=!!(e.visible[i]||e.invisible[i]);return nw(i,t)?o?hu:lA(r.point):o?r.point:hu},czt=n=>{let{afterCritical:e,impact:t,draggables:i}=n;const r=Wj(t);r||kn(!1);const o=r.draggableId,s=i[o].page.borderBox.center,a=lzt({displaced:t.displaced,afterCritical:e,combineWith:o,displacedBy:t.displacedBy});return Bu(s,a)};const eVe=(n,e)=>e.margin[n.start]+e.borderBox[n.size]/2,uzt=(n,e)=>e.margin[n.end]+e.borderBox[n.size]/2,fpe=(n,e,t)=>e[n.crossAxisStart]+t.margin[n.crossAxisStart]+t.borderBox[n.crossAxisSize]/2,Gke=n=>{let{axis:e,moveRelativeTo:t,isMoving:i}=n;return Ex(e.line,t.marginBox[e.end]+eVe(e,i),fpe(e,t.marginBox,i))},Yke=n=>{let{axis:e,moveRelativeTo:t,isMoving:i}=n;return Ex(e.line,t.marginBox[e.start]-uzt(e,i),fpe(e,t.marginBox,i))},dzt=n=>{let{axis:e,moveInto:t,isMoving:i}=n;return Ex(e.line,t.contentBox[e.start]+eVe(e,i),fpe(e,t.contentBox,i))};var hzt=n=>{let{impact:e,draggable:t,draggables:i,droppable:r,afterCritical:o}=n;const s=cA(r.descriptor.id,i),a=t.page,l=r.axis;if(!s.length)return dzt({axis:l,moveInto:r.page,isMoving:a});const{displaced:c,displacedBy:u}=e,d=c.all[0];if(d){const g=i[d];if(nw(d,o))return Yke({axis:l,moveRelativeTo:g.page,isMoving:a});const p=J7(g.page,u.point);return Yke({axis:l,moveRelativeTo:p,isMoving:a})}const h=s[s.length-1];if(h.descriptor.id===t.descriptor.id)return a.borderBox.center;if(nw(h.descriptor.id,o)){const g=J7(h.page,lA(o.displacedBy.point));return Gke({axis:l,moveRelativeTo:g,isMoving:a})}return Gke({axis:l,moveRelativeTo:h.page,isMoving:a})},ire=(n,e)=>{const t=n.frame;return t?Bu(e,t.scroll.diff.displacement):e};const fzt=n=>{let{impact:e,draggable:t,droppable:i,draggables:r,afterCritical:o}=n;const s=t.page.borderBox.center,a=e.at;return!i||!a?s:a.type==="REORDER"?hzt({impact:e,draggable:t,draggables:r,droppable:i,afterCritical:o}):czt({impact:e,draggables:r,afterCritical:o})};var jj=n=>{const e=fzt(n),t=n.droppable;return t?ire(t,e):e},tVe=(n,e)=>{const t=ig(e,n.scroll.initial),i=lA(t);return{frame:n_({top:e.y,bottom:e.y+n.frame.height,left:e.x,right:e.x+n.frame.width}),scroll:{initial:n.scroll.initial,max:n.scroll.max,current:e,diff:{value:t,displacement:i}}}};function Qke(n,e){return n.map(t=>e[t])}function gzt(n,e){for(let t=0;t<e.length;t++){const i=e[t].visible[n];if(i)return i}return null}var pzt=n=>{let{impact:e,viewport:t,destination:i,draggables:r,maxScrollChange:o}=n;const s=tVe(t,Bu(t.scroll.current,o)),a=i.frame?cpe(i,Bu(i.frame.scroll.current,o)):i,l=e.displaced,c=nM({afterDragging:Qke(l.all,r),destination:i,displacedBy:e.displacedBy,viewport:s.frame,last:l,forceShouldAnimate:!1}),u=nM({afterDragging:Qke(l.all,r),destination:a,displacedBy:e.displacedBy,viewport:t.frame,last:l,forceShouldAnimate:!1}),d={},h={},g=[l,c,u];return l.all.forEach(m=>{const _=gzt(m,g);if(_){h[m]=_;return}d[m]=!0}),{...e,displaced:{all:l.all,invisible:d,visible:h}}},mzt=(n,e)=>Bu(n.scroll.diff.displacement,e),gpe=n=>{let{pageBorderBoxCenter:e,draggable:t,viewport:i}=n;const r=mzt(i,e),o=ig(r,t.page.borderBox.center);return Bu(t.client.borderBox.center,o)},nVe=n=>{let{draggable:e,destination:t,newPageBorderBoxCenter:i,viewport:r,withDroppableDisplacement:o,onlyOnMainAxis:s=!1}=n;const a=ig(i,e.page.borderBox.center),c={target:Z3(e.page.borderBox,a),destination:t,withDroppableDisplacement:o,viewport:r};return s?tzt(c):J7e(c)},_zt=n=>{let{isMovingForward:e,draggable:t,destination:i,draggables:r,previousImpact:o,viewport:s,previousPageBorderBoxCenter:a,previousClientSelection:l,afterCritical:c}=n;if(!i.isEnabled)return null;const u=cA(i.descriptor.id,r),d=uA(t,i),h=qWt({isMovingForward:e,draggable:t,destination:i,insideDestination:u,previousImpact:o})||azt({isMovingForward:e,isInHomeList:d,draggable:t,draggables:r,destination:i,insideDestination:u,previousImpact:o,viewport:s,afterCritical:c});if(!h)return null;const g=jj({impact:h,draggable:t,droppable:i,draggables:r,afterCritical:c});if(nVe({draggable:t,destination:i,newPageBorderBoxCenter:g,viewport:s.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0}))return{clientSelection:gpe({pageBorderBoxCenter:g,draggable:t,viewport:s}),impact:h,scrollJumpRequest:null};const m=ig(g,a),_=pzt({impact:h,viewport:s,destination:i,draggables:r,maxScrollChange:m});return{clientSelection:l,impact:_,scrollJumpRequest:m}};const Vd=n=>{const e=n.subject.active;return e||kn(!1),e};var vzt=n=>{let{isMovingForward:e,pageBorderBoxCenter:t,source:i,droppables:r,viewport:o}=n;const s=i.subject.active;if(!s)return null;const a=i.axis,l=kp(s[a.start],s[a.end]),c=Hj(r).filter(d=>d!==i).filter(d=>d.isEnabled).filter(d=>!!d.subject.active).filter(d=>X7e(o.frame)(Vd(d))).filter(d=>{const h=Vd(d);return e?s[a.crossAxisEnd]<h[a.crossAxisEnd]:h[a.crossAxisStart]<s[a.crossAxisStart]}).filter(d=>{const h=Vd(d),g=kp(h[a.start],h[a.end]);return l(h[a.start])||l(h[a.end])||g(s[a.start])||g(s[a.end])}).sort((d,h)=>{const g=Vd(d)[a.crossAxisStart],p=Vd(h)[a.crossAxisStart];return e?g-p:p-g}).filter((d,h,g)=>Vd(d)[a.crossAxisStart]===Vd(g[0])[a.crossAxisStart]);if(!c.length)return null;if(c.length===1)return c[0];const u=c.filter(d=>kp(Vd(d)[a.start],Vd(d)[a.end])(t[a.line]));return u.length===1?u[0]:u.length>1?u.sort((d,h)=>Vd(d)[a.start]-Vd(h)[a.start])[0]:c.sort((d,h)=>{const g=Uke(t,qke(Vd(d))),p=Uke(t,qke(Vd(h)));return g!==p?g-p:Vd(d)[a.start]-Vd(h)[a.start]})[0]};const Xke=(n,e)=>{const t=n.page.borderBox.center;return nw(n.descriptor.id,e)?ig(t,e.displacedBy.point):t},bzt=(n,e)=>{const t=n.page.borderBox;return nw(n.descriptor.id,e)?Z3(t,lA(e.displacedBy.point)):t};var yzt=n=>{let{pageBorderBoxCenter:e,viewport:t,destination:i,insideDestination:r,afterCritical:o}=n;return r.filter(a=>J7e({target:bzt(a,o),destination:i,viewport:t.frame,withDroppableDisplacement:!0})).sort((a,l)=>{const c=eM(e,ire(i,Xke(a,o))),u=eM(e,ire(i,Xke(l,o)));return c<u?-1:u<c?1:a.descriptor.index-l.descriptor.index})[0]||null},J3=Mc(function(e,t){const i=t[e.line];return{value:i,point:Ex(e.line,i)}});const Czt=(n,e,t)=>{const i=n.axis;if(n.descriptor.mode==="virtual")return Ex(i.line,e[i.line]);const r=n.subject.page.contentBox[i.size],l=cA(n.descriptor.id,t).reduce((c,u)=>c+u.client.marginBox[i.size],0)+e[i.line]-r;return l<=0?null:Ex(i.line,l)},iVe=(n,e)=>({...n,scroll:{...n.scroll,max:e}}),rVe=(n,e,t)=>{const i=n.frame;uA(e,n)&&kn(!1),n.subject.withPlaceholder&&kn(!1);const r=J3(n.axis,e.displaceBy).point,o=Czt(n,r,t),s={placeholderSize:r,increasedBy:o,oldFrameMaxScroll:n.frame?n.frame.scroll.max:null};if(!i){const u=OD({page:n.subject.page,withPlaceholder:s,axis:n.axis,frame:n.frame});return{...n,subject:u}}const a=o?Bu(i.scroll.max,o):i.scroll.max,l=iVe(i,a),c=OD({page:n.subject.page,withPlaceholder:s,axis:n.axis,frame:l});return{...n,subject:c,frame:l}},wzt=n=>{const e=n.subject.withPlaceholder;e||kn(!1);const t=n.frame;if(!t){const s=OD({page:n.subject.page,axis:n.axis,frame:null,withPlaceholder:null});return{...n,subject:s}}const i=e.oldFrameMaxScroll;i||kn(!1);const r=iVe(t,i),o=OD({page:n.subject.page,axis:n.axis,frame:r,withPlaceholder:null});return{...n,subject:o,frame:r}};var Szt=n=>{let{previousPageBorderBoxCenter:e,moveRelativeTo:t,insideDestination:i,draggable:r,draggables:o,destination:s,viewport:a,afterCritical:l}=n;if(!t){if(i.length)return null;const h={displaced:tM,displacedBy:Q7e,at:{type:"REORDER",destination:{droppableId:s.descriptor.id,index:0}}},g=jj({impact:h,draggable:r,droppable:s,draggables:o,afterCritical:l}),p=uA(r,s)?s:rVe(s,r,o);return nVe({draggable:r,destination:p,newPageBorderBoxCenter:g,viewport:a.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0})?h:null}const c=e[s.axis.line]<=t.page.borderBox.center[s.axis.line],u=(()=>{const h=t.descriptor.index;return t.descriptor.id===r.descriptor.id||c?h:h+1})(),d=J3(s.axis,r.displaceBy);return iV({draggable:r,insideDestination:i,destination:s,viewport:a,displacedBy:d,last:tM,index:u})},Ezt=n=>{let{isMovingForward:e,previousPageBorderBoxCenter:t,draggable:i,isOver:r,draggables:o,droppables:s,viewport:a,afterCritical:l}=n;const c=vzt({isMovingForward:e,pageBorderBoxCenter:t,source:r,droppables:s,viewport:a});if(!c)return null;const u=cA(c.descriptor.id,o),d=yzt({pageBorderBoxCenter:t,viewport:a,destination:c,insideDestination:u,afterCritical:l}),h=Szt({previousPageBorderBoxCenter:t,destination:c,draggable:i,draggables:o,moveRelativeTo:d,insideDestination:u,viewport:a,afterCritical:l});if(!h)return null;const g=jj({impact:h,draggable:i,droppable:c,draggables:o,afterCritical:l});return{clientSelection:gpe({pageBorderBoxCenter:g,draggable:i,viewport:a}),impact:h,scrollJumpRequest:null}},dg=n=>{const e=n.at;return e?e.type==="REORDER"?e.destination.droppableId:e.combine.droppableId:null};const xzt=(n,e)=>{const t=dg(n);return t?e[t]:null};var kzt=n=>{let{state:e,type:t}=n;const i=xzt(e.impact,e.dimensions.droppables),r=!!i,o=e.dimensions.droppables[e.critical.droppable.id],s=i||o,a=s.axis.direction,l=a==="vertical"&&(t==="MOVE_UP"||t==="MOVE_DOWN")||a==="horizontal"&&(t==="MOVE_LEFT"||t==="MOVE_RIGHT");if(l&&!r)return null;const c=t==="MOVE_DOWN"||t==="MOVE_RIGHT",u=e.dimensions.draggables[e.critical.draggable.id],d=e.current.page.borderBoxCenter,{draggables:h,droppables:g}=e.dimensions;return l?_zt({isMovingForward:c,previousPageBorderBoxCenter:d,draggable:u,destination:s,draggables:h,viewport:e.viewport,previousClientSelection:e.current.client.selection,previousImpact:e.impact,afterCritical:e.afterCritical}):Ezt({isMovingForward:c,previousPageBorderBoxCenter:d,draggable:u,isOver:s,draggables:h,droppables:g,viewport:e.viewport,afterCritical:e.afterCritical})};function zS(n){return n.phase==="DRAGGING"||n.phase==="COLLECTING"}function oVe(n){const e=kp(n.top,n.bottom),t=kp(n.left,n.right);return function(r){return e(r.y)&&t(r.x)}}function Tzt(n,e){return n.left<e.right&&n.right>e.left&&n.top<e.bottom&&n.bottom>e.top}function Izt(n){let{pageBorderBox:e,draggable:t,candidates:i}=n;const r=t.page.borderBox.center,o=i.map(s=>{const a=s.axis,l=Ex(s.axis.line,e.center[a.line],s.page.borderBox.center[a.crossAxisLine]);return{id:s.descriptor.id,distance:eM(r,l)}}).sort((s,a)=>a.distance-s.distance);return o[0]?o[0].id:null}function Lzt(n){let{pageBorderBox:e,draggable:t,droppables:i}=n;const r=Hj(i).filter(o=>{if(!o.isEnabled)return!1;const s=o.subject.active;if(!s||!Tzt(e,s))return!1;if(oVe(s)(e.center))return!0;const a=o.axis,l=s.center[a.crossAxisLine],c=e[a.crossAxisStart],u=e[a.crossAxisEnd],d=kp(s[a.crossAxisStart],s[a.crossAxisEnd]),h=d(c),g=d(u);return!h&&!g?!0:h?c<l:u>l});return r.length?r.length===1?r[0].descriptor.id:Izt({pageBorderBox:e,draggable:t,candidates:r}):null}const sVe=(n,e)=>n_(Z3(n,e));var Dzt=(n,e)=>{const t=n.frame;return t?sVe(e,t.scroll.diff.value):e};function aVe(n){let{displaced:e,id:t}=n;return!!(e.visible[t]||e.invisible[t])}function Azt(n){let{draggable:e,closest:t,inHomeList:i}=n;return t?i&&t.descriptor.index>e.descriptor.index?t.descriptor.index-1:t.descriptor.index:null}var Rzt=n=>{let{pageBorderBoxWithDroppableScroll:e,draggable:t,destination:i,insideDestination:r,last:o,viewport:s,afterCritical:a}=n;const l=i.axis,c=J3(i.axis,t.displaceBy),u=c.value,d=e[l.start],h=e[l.end],p=zj(t,r).find(_=>{const v=_.descriptor.id,b=_.page.borderBox.center[l.line],y=nw(v,a),C=aVe({displaced:o,id:v});return y?C?h<=b:d<b-u:C?h<=b+u:d<b})||null,m=Azt({draggable:t,closest:p,inHomeList:uA(t,i)});return iV({draggable:t,insideDestination:r,destination:i,viewport:s,last:o,displacedBy:c,index:m})};const Nzt=4;var Ozt=n=>{let{draggable:e,pageBorderBoxWithDroppableScroll:t,previousImpact:i,destination:r,insideDestination:o,afterCritical:s}=n;if(!r.isCombineEnabled)return null;const a=r.axis,l=J3(r.axis,e.displaceBy),c=l.value,u=t[a.start],d=t[a.end],g=zj(e,o).find(m=>{const _=m.descriptor.id,v=m.page.borderBox,y=v[a.size]/Nzt,C=nw(_,s),x=aVe({displaced:i.displaced,id:_});return C?x?d>v[a.start]+y&&d<v[a.end]-y:u>v[a.start]-c+y&&u<v[a.end]-c-y:x?d>v[a.start]+c+y&&d<v[a.end]+c-y:u>v[a.start]+y&&u<v[a.end]-y});return g?{displacedBy:l,displaced:i.displaced,at:{type:"COMBINE",combine:{draggableId:g.descriptor.id,droppableId:r.descriptor.id}}}:null},lVe=n=>{let{pageOffset:e,draggable:t,draggables:i,droppables:r,previousImpact:o,viewport:s,afterCritical:a}=n;const l=sVe(t.page.borderBox,e),c=Lzt({pageBorderBox:l,draggable:t,droppables:r});if(!c)return GWt;const u=r[c],d=cA(u.descriptor.id,i),h=Dzt(u,l);return Ozt({pageBorderBoxWithDroppableScroll:h,draggable:t,previousImpact:o,destination:u,insideDestination:d,afterCritical:a})||Rzt({pageBorderBoxWithDroppableScroll:h,draggable:t,destination:u,insideDestination:d,last:o.displaced,viewport:s,afterCritical:a})},ppe=(n,e)=>({...n,[e.descriptor.id]:e});const Pzt=n=>{let{previousImpact:e,impact:t,droppables:i}=n;const r=dg(e),o=dg(t);if(!r||r===o)return i;const s=i[r];if(!s.subject.withPlaceholder)return i;const a=wzt(s);return ppe(i,a)};var Mzt=n=>{let{draggable:e,draggables:t,droppables:i,previousImpact:r,impact:o}=n;const s=Pzt({previousImpact:r,impact:o,droppables:i}),a=dg(o);if(!a)return s;const l=i[a];if(uA(e,l)||l.subject.withPlaceholder)return s;const c=rVe(l,e,t);return ppe(s,c)},wO=n=>{let{state:e,clientSelection:t,dimensions:i,viewport:r,impact:o,scrollJumpRequest:s}=n;const a=r||e.viewport,l=i||e.dimensions,c=t||e.current.client.selection,u=ig(c,e.initial.client.selection),d={offset:u,selection:c,borderBoxCenter:Bu(e.initial.client.borderBoxCenter,u)},h={selection:Bu(d.selection,a.scroll.current),borderBoxCenter:Bu(d.borderBoxCenter,a.scroll.current),offset:Bu(d.offset,a.scroll.diff.value)},g={client:d,page:h};if(e.phase==="COLLECTING")return{...e,dimensions:l,viewport:a,current:g};const p=l.draggables[e.critical.draggable.id],m=o||lVe({pageOffset:h.offset,draggable:p,draggables:l.draggables,droppables:l.droppables,previousImpact:e.impact,viewport:a,afterCritical:e.afterCritical}),_=Mzt({draggable:p,impact:m,previousImpact:e.impact,draggables:l.draggables,droppables:l.droppables});return{...e,current:g,dimensions:{draggables:l.draggables,droppables:_},impact:m,viewport:a,scrollJumpRequest:s||null,forceShouldAnimate:s?!1:null}};function Fzt(n,e){return n.map(t=>e[t])}var cVe=n=>{let{impact:e,viewport:t,draggables:i,destination:r,forceShouldAnimate:o}=n;const s=e.displaced,a=Fzt(s.all,i),l=nM({afterDragging:a,destination:r,displacedBy:e.displacedBy,viewport:t.frame,forceShouldAnimate:o,last:s});return{...e,displaced:l}},uVe=n=>{let{impact:e,draggable:t,droppable:i,draggables:r,viewport:o,afterCritical:s}=n;const a=jj({impact:e,draggable:t,draggables:r,droppable:i,afterCritical:s});return gpe({pageBorderBoxCenter:a,draggable:t,viewport:o})},dVe=n=>{let{state:e,dimensions:t,viewport:i}=n;e.movementMode!=="SNAP"&&kn(!1);const r=e.impact,o=i||e.viewport,s=t||e.dimensions,{draggables:a,droppables:l}=s,c=a[e.critical.draggable.id],u=dg(r);u||kn(!1);const d=l[u],h=cVe({impact:r,viewport:o,destination:d,draggables:a}),g=uVe({impact:h,draggable:c,droppable:d,draggables:a,viewport:o,afterCritical:e.afterCritical});return wO({impact:h,clientSelection:g,state:e,dimensions:s,viewport:o})},Bzt=n=>({index:n.index,droppableId:n.droppableId}),hVe=n=>{let{draggable:e,home:t,draggables:i,viewport:r}=n;const o=J3(t.axis,e.displaceBy),s=cA(t.descriptor.id,i),a=s.indexOf(e);a===-1&&kn(!1);const l=s.slice(a+1),c=l.reduce((g,p)=>(g[p.descriptor.id]=!0,g),{}),u={inVirtualList:t.descriptor.mode==="virtual",displacedBy:o,effected:c};return{impact:{displaced:nM({afterDragging:l,destination:t,displacedBy:o,last:null,viewport:r.frame,forceShouldAnimate:!1}),displacedBy:o,at:{type:"REORDER",destination:Bzt(e.descriptor)}},afterCritical:u}},$zt=(n,e)=>({draggables:n.draggables,droppables:ppe(n.droppables,e)}),Vzt=n=>{let{draggable:e,offset:t,initialWindowScroll:i}=n;const r=J7(e.client,t),o=eV(r,i);return{...e,placeholder:{...e.placeholder,client:r},client:r,page:o}},Hzt=n=>{const e=n.frame;return e||kn(!1),e},Wzt=n=>{let{additions:e,updatedDroppables:t,viewport:i}=n;const r=i.scroll.diff.value;return e.map(o=>{const s=o.descriptor.droppableId,a=t[s],c=Hzt(a).scroll.diff.value,u=Bu(r,c);return Vzt({draggable:o,offset:u,initialWindowScroll:i.scroll.initial})})},zzt=n=>{let{state:e,published:t}=n;const i=t.modified.map(b=>{const y=e.dimensions.droppables[b.droppableId];return cpe(y,b.scroll)}),r={...e.dimensions.droppables,...G7e(i)},o=Y7e(Wzt({additions:t.additions,updatedDroppables:r,viewport:e.viewport})),s={...e.dimensions.draggables,...o};t.removals.forEach(b=>{delete s[b]});const a={droppables:r,draggables:s},l=dg(e.impact),c=l?a.droppables[l]:null,u=a.draggables[e.critical.draggable.id],d=a.droppables[e.critical.droppable.id],{impact:h,afterCritical:g}=hVe({draggable:u,home:d,draggables:s,viewport:e.viewport}),p=c&&c.isCombineEnabled?e.impact:h,m=lVe({pageOffset:e.current.page.offset,draggable:a.draggables[e.critical.draggable.id],draggables:a.draggables,droppables:a.droppables,previousImpact:p,viewport:e.viewport,afterCritical:g}),_={...e,phase:"DRAGGING",impact:m,onLiftImpact:h,dimensions:a,afterCritical:g,forceShouldAnimate:!1};return e.phase==="COLLECTING"?_:{..._,phase:"DROP_PENDING",reason:e.reason,isWaiting:!1}};const rre=n=>n.movementMode==="SNAP",fX=(n,e,t)=>{const i=$zt(n.dimensions,e);return!rre(n)||t?wO({state:n,dimensions:i}):dVe({state:n,dimensions:i})};function gX(n){return n.isDragging&&n.movementMode==="SNAP"?{...n,scrollJumpRequest:null}:n}const Zke={phase:"IDLE",completed:null,shouldFlush:!1};var jzt=function(n,e){if(n===void 0&&(n=Zke),e.type==="FLUSH")return{...Zke,shouldFlush:!0};if(e.type==="INITIAL_PUBLISH"){n.phase!=="IDLE"&&kn(!1);const{critical:t,clientSelection:i,viewport:r,dimensions:o,movementMode:s}=e.payload,a=o.draggables[t.draggable.id],l=o.droppables[t.droppable.id],c={selection:i,borderBoxCenter:a.client.borderBox.center,offset:hu},u={client:c,page:{selection:Bu(c.selection,r.scroll.initial),borderBoxCenter:Bu(c.selection,r.scroll.initial),offset:Bu(c.selection,r.scroll.diff.value)}},d=Hj(o.droppables).every(m=>!m.isFixedOnPage),{impact:h,afterCritical:g}=hVe({draggable:a,home:l,draggables:o.draggables,viewport:r});return{phase:"DRAGGING",isDragging:!0,critical:t,movementMode:s,dimensions:o,initial:u,current:u,isWindowScrollAllowed:d,impact:h,afterCritical:g,onLiftImpact:h,viewport:r,scrollJumpRequest:null,forceShouldAnimate:null}}if(e.type==="COLLECTION_STARTING")return n.phase==="COLLECTING"||n.phase==="DROP_PENDING"?n:(n.phase!=="DRAGGING"&&kn(!1),{...n,phase:"COLLECTING"});if(e.type==="PUBLISH_WHILE_DRAGGING")return n.phase==="COLLECTING"||n.phase==="DROP_PENDING"||kn(!1),zzt({state:n,published:e.payload});if(e.type==="MOVE"){if(n.phase==="DROP_PENDING")return n;zS(n)||kn(!1);const{client:t}=e.payload;return wC(t,n.current.client.selection)?n:wO({state:n,clientSelection:t,impact:rre(n)?n.impact:null})}if(e.type==="UPDATE_DROPPABLE_SCROLL"){if(n.phase==="DROP_PENDING"||n.phase==="COLLECTING")return gX(n);zS(n)||kn(!1);const{id:t,newScroll:i}=e.payload,r=n.dimensions.droppables[t];if(!r)return n;const o=cpe(r,i);return fX(n,o,!1)}if(e.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(n.phase==="DROP_PENDING")return n;zS(n)||kn(!1);const{id:t,isEnabled:i}=e.payload,r=n.dimensions.droppables[t];r||kn(!1),r.isEnabled===i&&kn(!1);const o={...r,isEnabled:i};return fX(n,o,!0)}if(e.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(n.phase==="DROP_PENDING")return n;zS(n)||kn(!1);const{id:t,isCombineEnabled:i}=e.payload,r=n.dimensions.droppables[t];r||kn(!1),r.isCombineEnabled===i&&kn(!1);const o={...r,isCombineEnabled:i};return fX(n,o,!0)}if(e.type==="MOVE_BY_WINDOW_SCROLL"){if(n.phase==="DROP_PENDING"||n.phase==="DROP_ANIMATING")return n;zS(n)||kn(!1),n.isWindowScrollAllowed||kn(!1);const t=e.payload.newScroll;if(wC(n.viewport.scroll.current,t))return gX(n);const i=tVe(n.viewport,t);return rre(n)?dVe({state:n,viewport:i}):wO({state:n,viewport:i})}if(e.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!zS(n))return n;const t=e.payload.maxScroll;if(wC(t,n.viewport.scroll.max))return n;const i={...n.viewport,scroll:{...n.viewport.scroll,max:t}};return{...n,viewport:i}}if(e.type==="MOVE_UP"||e.type==="MOVE_DOWN"||e.type==="MOVE_LEFT"||e.type==="MOVE_RIGHT"){if(n.phase==="COLLECTING"||n.phase==="DROP_PENDING")return n;n.phase!=="DRAGGING"&&kn(!1);const t=kzt({state:n,type:e.type});return t?wO({state:n,impact:t.impact,clientSelection:t.clientSelection,scrollJumpRequest:t.scrollJumpRequest}):n}if(e.type==="DROP_PENDING"){const t=e.payload.reason;return n.phase!=="COLLECTING"&&kn(!1),{...n,phase:"DROP_PENDING",isWaiting:!0,reason:t}}if(e.type==="DROP_ANIMATE"){const{completed:t,dropDuration:i,newHomeClientOffset:r}=e.payload;return n.phase==="DRAGGING"||n.phase==="DROP_PENDING"||kn(!1),{phase:"DROP_ANIMATING",completed:t,dropDuration:i,newHomeClientOffset:r,dimensions:n.dimensions}}if(e.type==="DROP_COMPLETE"){const{completed:t}=e.payload;return{phase:"IDLE",completed:t,shouldFlush:!1}}return n};const Uzt=n=>({type:"BEFORE_INITIAL_CAPTURE",payload:n}),qzt=n=>({type:"LIFT",payload:n}),Kzt=n=>({type:"INITIAL_PUBLISH",payload:n}),Gzt=n=>({type:"PUBLISH_WHILE_DRAGGING",payload:n}),Yzt=()=>({type:"COLLECTION_STARTING",payload:null}),Qzt=n=>({type:"UPDATE_DROPPABLE_SCROLL",payload:n}),Xzt=n=>({type:"UPDATE_DROPPABLE_IS_ENABLED",payload:n}),Zzt=n=>({type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:n}),fVe=n=>({type:"MOVE",payload:n}),Jzt=n=>({type:"MOVE_BY_WINDOW_SCROLL",payload:n}),ejt=n=>({type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:n}),tjt=()=>({type:"MOVE_UP",payload:null}),njt=()=>({type:"MOVE_DOWN",payload:null}),ijt=()=>({type:"MOVE_RIGHT",payload:null}),rjt=()=>({type:"MOVE_LEFT",payload:null}),mpe=()=>({type:"FLUSH",payload:null}),ojt=n=>({type:"DROP_ANIMATE",payload:n}),_pe=n=>({type:"DROP_COMPLETE",payload:n}),gVe=n=>({type:"DROP",payload:n}),sjt=n=>({type:"DROP_PENDING",payload:n}),pVe=()=>({type:"DROP_ANIMATION_FINISHED",payload:null});var ajt=n=>e=>{let{getState:t,dispatch:i}=e;return r=>o=>{if(o.type!=="LIFT"){r(o);return}const{id:s,clientSelection:a,movementMode:l}=o.payload,c=t();c.phase==="DROP_ANIMATING"&&i(_pe({completed:c.completed})),t().phase!=="IDLE"&&kn(!1),i(mpe()),i(Uzt({draggableId:s,movementMode:l}));const d={draggableId:s,scrollOptions:{shouldPublishImmediately:l==="SNAP"}},{critical:h,dimensions:g,viewport:p}=n.startPublishing(d);i(Kzt({critical:h,dimensions:g,clientSelection:a,movementMode:l,viewport:p}))}},ljt=n=>()=>e=>t=>{t.type==="INITIAL_PUBLISH"&&n.dragging(),t.type==="DROP_ANIMATE"&&n.dropping(t.payload.completed.result.reason),(t.type==="FLUSH"||t.type==="DROP_COMPLETE")&&n.resting(),e(t)};const vpe={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},iM={opacity:{drop:0,combining:.7},scale:{drop:.75}},mVe={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},SS=`${mVe.outOfTheWay}s ${vpe.outOfTheWay}`,SO={fluid:`opacity ${SS}`,snap:`transform ${SS}, opacity ${SS}`,drop:n=>{const e=`${n}s ${vpe.drop}`;return`transform ${e}, opacity ${e}`},outOfTheWay:`transform ${SS}`,placeholder:`height ${SS}, width ${SS}, margin ${SS}`},Jke=n=>wC(n,hu)?void 0:`translate(${n.x}px, ${n.y}px)`,ore={moveTo:Jke,drop:(n,e)=>{const t=Jke(n);if(t)return e?`${t} scale(${iM.scale.drop})`:t}},{minDropTime:sre,maxDropTime:_Ve}=mVe,cjt=_Ve-sre,eTe=1500,ujt=.6;var djt=n=>{let{current:e,destination:t,reason:i}=n;const r=eM(e,t);if(r<=0)return sre;if(r>=eTe)return _Ve;const o=r/eTe,s=sre+cjt*o,a=i==="CANCEL"?s*ujt:s;return Number(a.toFixed(2))},hjt=n=>{let{impact:e,draggable:t,dimensions:i,viewport:r,afterCritical:o}=n;const{draggables:s,droppables:a}=i,l=dg(e),c=l?a[l]:null,u=a[t.descriptor.droppableId],d=uVe({impact:e,draggable:t,draggables:s,afterCritical:o,droppable:c||u,viewport:r});return ig(d,t.client.borderBox.center)},fjt=n=>{let{draggables:e,reason:t,lastImpact:i,home:r,viewport:o,onLiftImpact:s}=n;return!i.at||t!=="DROP"?{impact:cVe({draggables:e,impact:s,destination:r,viewport:o,forceShouldAnimate:!0}),didDropInsideDroppable:!1}:i.at.type==="REORDER"?{impact:i,didDropInsideDroppable:!0}:{impact:{...i,displaced:tM},didDropInsideDroppable:!0}};const gjt=n=>{let{getState:e,dispatch:t}=n;return i=>r=>{if(r.type!=="DROP"){i(r);return}const o=e(),s=r.payload.reason;if(o.phase==="COLLECTING"){t(sjt({reason:s}));return}if(o.phase==="IDLE")return;o.phase==="DROP_PENDING"&&o.isWaiting&&kn(!1),o.phase==="DRAGGING"||o.phase==="DROP_PENDING"||kn(!1);const l=o.critical,c=o.dimensions,u=c.draggables[o.critical.draggable.id],{impact:d,didDropInsideDroppable:h}=fjt({reason:s,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),g=h?upe(d):null,p=h?Wj(d):null,m={index:l.draggable.index,droppableId:l.droppable.id},_={draggableId:u.descriptor.id,type:u.descriptor.type,source:m,reason:s,mode:o.movementMode,destination:g,combine:p},v=hjt({impact:d,draggable:u,dimensions:c,viewport:o.viewport,afterCritical:o.afterCritical}),b={critical:o.critical,afterCritical:o.afterCritical,result:_,impact:d};if(!(!wC(o.current.client.offset,v)||!!_.combine)){t(_pe({completed:b}));return}const C=djt({current:o.current.client.offset,destination:v,reason:s});t(ojt({newHomeClientOffset:v,dropDuration:C,completed:b}))}};var pjt=gjt,vVe=()=>({x:window.pageXOffset,y:window.pageYOffset});function mjt(n){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:e=>{e.target!==window&&e.target!==window.document||n()}}}function _jt(n){let{onWindowScroll:e}=n;function t(){e(vVe())}const i=JP(t),r=mjt(i);let o=CC;function s(){return o!==CC}function a(){s()&&kn(!1),o=mp(window,[r])}function l(){s()||kn(!1),i.cancel(),o(),o=CC}return{start:a,stop:l,isActive:s}}const vjt=n=>n.type==="DROP_COMPLETE"||n.type==="DROP_ANIMATE"||n.type==="FLUSH",bjt=n=>{const e=_jt({onWindowScroll:t=>{n.dispatch(Jzt({newScroll:t}))}});return t=>i=>{!e.isActive()&&i.type==="INITIAL_PUBLISH"&&e.start(),e.isActive()&&vjt(i)&&e.stop(),t(i)}};var yjt=bjt,Cjt=n=>{let e=!1,t=!1;const i=setTimeout(()=>{t=!0}),r=o=>{e||t||(e=!0,n(o),clearTimeout(i))};return r.wasCalled=()=>e,r},wjt=()=>{const n=[],e=r=>{const o=n.findIndex(a=>a.timerId===r);o===-1&&kn(!1);const[s]=n.splice(o,1);s.callback()};return{add:r=>{const o=setTimeout(()=>e(o)),s={timerId:o,callback:r};n.push(s)},flush:()=>{if(!n.length)return;const r=[...n];n.length=0,r.forEach(o=>{clearTimeout(o.timerId),o.callback()})}}};const Sjt=(n,e)=>n==null&&e==null?!0:n==null||e==null?!1:n.droppableId===e.droppableId&&n.index===e.index,Ejt=(n,e)=>n==null&&e==null?!0:n==null||e==null?!1:n.draggableId===e.draggableId&&n.droppableId===e.droppableId,xjt=(n,e)=>{if(n===e)return!0;const t=n.draggable.id===e.draggable.id&&n.draggable.droppableId===e.draggable.droppableId&&n.draggable.type===e.draggable.type&&n.draggable.index===e.draggable.index,i=n.droppable.id===e.droppable.id&&n.droppable.type===e.droppable.type;return t&&i},xR=(n,e)=>{e()},G6=(n,e)=>({draggableId:n.draggable.id,type:n.droppable.type,source:{droppableId:n.droppable.id,index:n.draggable.index},mode:e});function pX(n,e,t,i){if(!n){t(i(e));return}const r=Cjt(t);n(e,{announce:r}),r.wasCalled()||t(i(e))}var kjt=(n,e)=>{const t=wjt();let i=null;const r=(d,h)=>{i&&kn(!1),xR("onBeforeCapture",()=>{const g=n().onBeforeCapture;g&&g({draggableId:d,mode:h})})},o=(d,h)=>{i&&kn(!1),xR("onBeforeDragStart",()=>{const g=n().onBeforeDragStart;g&&g(G6(d,h))})},s=(d,h)=>{i&&kn(!1);const g=G6(d,h);i={mode:h,lastCritical:d,lastLocation:g.source,lastCombine:null},t.add(()=>{xR("onDragStart",()=>pX(n().onDragStart,g,e,m8.onDragStart))})},a=(d,h)=>{const g=upe(h),p=Wj(h);i||kn(!1);const m=!xjt(d,i.lastCritical);m&&(i.lastCritical=d);const _=!Sjt(i.lastLocation,g);_&&(i.lastLocation=g);const v=!Ejt(i.lastCombine,p);if(v&&(i.lastCombine=p),!m&&!_&&!v)return;const b={...G6(d,i.mode),combine:p,destination:g};t.add(()=>{xR("onDragUpdate",()=>pX(n().onDragUpdate,b,e,m8.onDragUpdate))})},l=()=>{i||kn(!1),t.flush()},c=d=>{i||kn(!1),i=null,xR("onDragEnd",()=>pX(n().onDragEnd,d,e,m8.onDragEnd))};return{beforeCapture:r,beforeStart:o,start:s,update:a,flush:l,drop:c,abort:()=>{if(!i)return;const d={...G6(i.lastCritical,i.mode),combine:null,destination:null,reason:"CANCEL"};c(d)}}},Tjt=(n,e)=>{const t=kjt(n,e);return i=>r=>o=>{if(o.type==="BEFORE_INITIAL_CAPTURE"){t.beforeCapture(o.payload.draggableId,o.payload.movementMode);return}if(o.type==="INITIAL_PUBLISH"){const a=o.payload.critical;t.beforeStart(a,o.payload.movementMode),r(o),t.start(a,o.payload.movementMode);return}if(o.type==="DROP_COMPLETE"){const a=o.payload.completed.result;t.flush(),r(o),t.drop(a);return}if(r(o),o.type==="FLUSH"){t.abort();return}const s=i.getState();s.phase==="DRAGGING"&&t.update(s.critical,s.impact)}};const Ijt=n=>e=>t=>{if(t.type!=="DROP_ANIMATION_FINISHED"){e(t);return}const i=n.getState();i.phase!=="DROP_ANIMATING"&&kn(!1),n.dispatch(_pe({completed:i.completed}))};var Ljt=Ijt;const Djt=n=>{let e=null,t=null;function i(){t&&(cancelAnimationFrame(t),t=null),e&&(e(),e=null)}return r=>o=>{if((o.type==="FLUSH"||o.type==="DROP_COMPLETE"||o.type==="DROP_ANIMATION_FINISHED")&&i(),r(o),o.type!=="DROP_ANIMATE")return;const s={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){n.getState().phase==="DROP_ANIMATING"&&n.dispatch(pVe())}};t=requestAnimationFrame(()=>{t=null,e=mp(window,[s])})}};var Ajt=Djt,Rjt=n=>()=>e=>t=>{(t.type==="DROP_COMPLETE"||t.type==="FLUSH"||t.type==="DROP_ANIMATE")&&n.stopPublishing(),e(t)},Njt=n=>{let e=!1;return()=>t=>i=>{if(i.type==="INITIAL_PUBLISH"){e=!0,n.tryRecordFocus(i.payload.critical.draggable.id),t(i),n.tryRestoreFocusRecorded();return}if(t(i),!!e){if(i.type==="FLUSH"){e=!1,n.tryRestoreFocusRecorded();return}if(i.type==="DROP_COMPLETE"){e=!1;const r=i.payload.completed.result;r.combine&&n.tryShiftRecord(r.draggableId,r.combine.draggableId),n.tryRestoreFocusRecorded()}}}};const Ojt=n=>n.type==="DROP_COMPLETE"||n.type==="DROP_ANIMATE"||n.type==="FLUSH";var Pjt=n=>e=>t=>i=>{if(Ojt(i)){n.stop(),t(i);return}if(i.type==="INITIAL_PUBLISH"){t(i);const r=e.getState();r.phase!=="DRAGGING"&&kn(!1),n.start(r);return}t(i),n.scroll(e.getState())};const Mjt=n=>e=>t=>{if(e(t),t.type!=="PUBLISH_WHILE_DRAGGING")return;const i=n.getState();i.phase==="DROP_PENDING"&&(i.isWaiting||n.dispatch(gVe({reason:i.reason})))};var Fjt=Mjt;const Bjt=cD;var $jt=n=>{let{dimensionMarshal:e,focusMarshal:t,styleMarshal:i,getResponders:r,announce:o,autoScroller:s}=n;return o3(jzt,Bjt(Rde(ljt(i),Rjt(e),ajt(e),pjt,Ljt,Ajt,Fjt,Pjt(s),yjt,Njt(t),Tjt(r,o))))};const mX=()=>({additions:{},removals:{},modified:{}});function Vjt(n){let{registry:e,callbacks:t}=n,i=mX(),r=null;const o=()=>{r||(t.collectionStarting(),r=requestAnimationFrame(()=>{r=null;const{additions:c,removals:u,modified:d}=i,h=Object.keys(c).map(m=>e.draggable.getById(m).getDimension(hu)).sort((m,_)=>m.descriptor.index-_.descriptor.index),g=Object.keys(d).map(m=>{const v=e.droppable.getById(m).callbacks.getScrollWhileDragging();return{droppableId:m,scroll:v}}),p={additions:h,removals:Object.keys(u),modified:g};i=mX(),t.publish(p)}))};return{add:c=>{const u=c.descriptor.id;i.additions[u]=c,i.modified[c.descriptor.droppableId]=!0,i.removals[u]&&delete i.removals[u],o()},remove:c=>{const u=c.descriptor;i.removals[u.id]=!0,i.modified[u.droppableId]=!0,i.additions[u.id]&&delete i.additions[u.id],o()},stop:()=>{r&&(cancelAnimationFrame(r),r=null,i=mX())}}}var bVe=n=>{let{scrollHeight:e,scrollWidth:t,height:i,width:r}=n;const o=ig({x:t,y:e},{x:r,y:i});return{x:Math.max(0,o.x),y:Math.max(0,o.y)}},yVe=()=>{const n=document.documentElement;return n||kn(!1),n},CVe=()=>{const n=yVe();return bVe({scrollHeight:n.scrollHeight,scrollWidth:n.scrollWidth,width:n.clientWidth,height:n.clientHeight})},Hjt=()=>{const n=vVe(),e=CVe(),t=n.y,i=n.x,r=yVe(),o=r.clientWidth,s=r.clientHeight,a=i+o,l=t+s;return{frame:n_({top:t,left:i,right:a,bottom:l}),scroll:{initial:n,current:n,max:e,diff:{value:hu,displacement:hu}}}},Wjt=n=>{let{critical:e,scrollOptions:t,registry:i}=n;const r=Hjt(),o=r.scroll.current,s=e.droppable,a=i.droppable.getAllByType(s.type).map(d=>d.callbacks.getDimensionAndWatchScroll(o,t)),l=i.draggable.getAllByType(e.draggable.type).map(d=>d.getDimension(o));return{dimensions:{draggables:Y7e(l),droppables:G7e(a)},critical:e,viewport:r}};function tTe(n,e,t){return!(t.descriptor.id===e.id||t.descriptor.type!==e.type||n.droppable.getById(t.descriptor.droppableId).descriptor.mode!=="virtual")}var zjt=(n,e)=>{let t=null;const i=Vjt({callbacks:{publish:e.publishWhileDragging,collectionStarting:e.collectionStarting},registry:n}),r=(h,g)=>{n.droppable.exists(h)||kn(!1),t&&e.updateDroppableIsEnabled({id:h,isEnabled:g})},o=(h,g)=>{t&&(n.droppable.exists(h)||kn(!1),e.updateDroppableIsCombineEnabled({id:h,isCombineEnabled:g}))},s=(h,g)=>{t&&(n.droppable.exists(h)||kn(!1),e.updateDroppableScroll({id:h,newScroll:g}))},a=(h,g)=>{t&&n.droppable.getById(h).callbacks.scroll(g)},l=()=>{if(!t)return;i.stop();const h=t.critical.droppable;n.droppable.getAllByType(h.type).forEach(g=>g.callbacks.dragStopped()),t.unsubscribe(),t=null},c=h=>{t||kn(!1);const g=t.critical.draggable;h.type==="ADDITION"&&tTe(n,g,h.value)&&i.add(h.value),h.type==="REMOVAL"&&tTe(n,g,h.value)&&i.remove(h.value)};return{updateDroppableIsEnabled:r,updateDroppableIsCombineEnabled:o,scrollDroppable:a,updateDroppableScroll:s,startPublishing:h=>{t&&kn(!1);const g=n.draggable.getById(h.draggableId),p=n.droppable.getById(g.descriptor.droppableId),m={draggable:g.descriptor,droppable:p.descriptor},_=n.subscribe(c);return t={critical:m,unsubscribe:_},Wjt({critical:m,registry:n,scrollOptions:h.scrollOptions})},stopPublishing:l}},wVe=(n,e)=>n.phase==="IDLE"?!0:n.phase!=="DROP_ANIMATING"||n.completed.result.draggableId===e?!1:n.completed.result.reason==="DROP",jjt=n=>{window.scrollBy(n.x,n.y)};const Ujt=Mc(n=>Hj(n).filter(e=>!(!e.isEnabled||!e.frame))),qjt=(n,e)=>Ujt(e).find(i=>(i.frame||kn(!1),oVe(i.frame.pageMarginBox)(n)))||null;var Kjt=n=>{let{center:e,destination:t,droppables:i}=n;if(t){const o=i[t];return o.frame?o:null}return qjt(e,i)};const rM={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:n=>n**2,durationDampening:{stopDampeningAt:1200,accelerateAt:360},disabled:!1};var Gjt=function(n,e,t){t===void 0&&(t=()=>rM);const i=t(),r=n[e.size]*i.startFromPercentage,o=n[e.size]*i.maxScrollAtPercentage;return{startScrollingFrom:r,maxScrollValueAt:o}},SVe=n=>{let{startOfRange:e,endOfRange:t,current:i}=n;const r=t-e;return r===0?0:(i-e)/r},bpe=1,Yjt=function(n,e,t){t===void 0&&(t=()=>rM);const i=t();if(n>e.startScrollingFrom)return 0;if(n<=e.maxScrollValueAt)return i.maxPixelScroll;if(n===e.startScrollingFrom)return bpe;const o=1-SVe({startOfRange:e.maxScrollValueAt,endOfRange:e.startScrollingFrom,current:n}),s=i.maxPixelScroll*i.ease(o);return Math.ceil(s)},Qjt=(n,e,t)=>{const i=t(),r=i.durationDampening.accelerateAt,o=i.durationDampening.stopDampeningAt,s=e,a=o,c=Date.now()-s;if(c>=o)return n;if(c<r)return bpe;const u=SVe({startOfRange:r,endOfRange:a,current:c}),d=n*i.ease(u);return Math.ceil(d)},nTe=n=>{let{distanceToEdge:e,thresholds:t,dragStartTime:i,shouldUseTimeDampening:r,getAutoScrollerOptions:o}=n;const s=Yjt(e,t,o);return s===0?0:r?Math.max(Qjt(s,i,o),bpe):s},iTe=n=>{let{container:e,distanceToEdges:t,dragStartTime:i,axis:r,shouldUseTimeDampening:o,getAutoScrollerOptions:s}=n;const a=Gjt(e,r,s);return t[r.end]<t[r.start]?nTe({distanceToEdge:t[r.end],thresholds:a,dragStartTime:i,shouldUseTimeDampening:o,getAutoScrollerOptions:s}):-1*nTe({distanceToEdge:t[r.start],thresholds:a,dragStartTime:i,shouldUseTimeDampening:o,getAutoScrollerOptions:s})},Xjt=n=>{let{container:e,subject:t,proposedScroll:i}=n;const r=t.height>e.height,o=t.width>e.width;return!o&&!r?i:o&&r?null:{x:o?0:i.x,y:r?0:i.y}};const Zjt=K7e(n=>n===0?0:n);var EVe=n=>{let{dragStartTime:e,container:t,subject:i,center:r,shouldUseTimeDampening:o,getAutoScrollerOptions:s}=n;const a={top:r.y-t.top,right:t.right-r.x,bottom:t.bottom-r.y,left:r.x-t.left},l=iTe({container:t,distanceToEdges:a,dragStartTime:e,axis:dpe,shouldUseTimeDampening:o,getAutoScrollerOptions:s}),c=iTe({container:t,distanceToEdges:a,dragStartTime:e,axis:Z7e,shouldUseTimeDampening:o,getAutoScrollerOptions:s}),u=Zjt({x:c,y:l});if(wC(u,hu))return null;const d=Xjt({container:t,subject:i,proposedScroll:u});return d?wC(d,hu)?null:d:null};const Jjt=K7e(n=>n===0?0:n>0?1:-1),ype=(()=>{const n=(e,t)=>e<0?e:e>t?e-t:0;return e=>{let{current:t,max:i,change:r}=e;const o=Bu(t,r),s={x:n(o.x,i.x),y:n(o.y,i.y)};return wC(s,hu)?null:s}})(),xVe=n=>{let{max:e,current:t,change:i}=n;const r={x:Math.max(t.x,e.x),y:Math.max(t.y,e.y)},o=Jjt(i),s=ype({max:r,current:t,change:o});return!s||o.x!==0&&s.x===0||o.y!==0&&s.y===0},Cpe=(n,e)=>xVe({current:n.scroll.current,max:n.scroll.max,change:e}),eUt=(n,e)=>{if(!Cpe(n,e))return null;const t=n.scroll.max,i=n.scroll.current;return ype({current:i,max:t,change:e})},wpe=(n,e)=>{const t=n.frame;return t?xVe({current:t.scroll.current,max:t.scroll.max,change:e}):!1},tUt=(n,e)=>{const t=n.frame;return!t||!wpe(n,e)?null:ype({current:t.scroll.current,max:t.scroll.max,change:e})};var nUt=n=>{let{viewport:e,subject:t,center:i,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:s}=n;const a=EVe({dragStartTime:r,container:e.frame,subject:t,center:i,shouldUseTimeDampening:o,getAutoScrollerOptions:s});return a&&Cpe(e,a)?a:null},iUt=n=>{let{droppable:e,subject:t,center:i,dragStartTime:r,shouldUseTimeDampening:o,getAutoScrollerOptions:s}=n;const a=e.frame;if(!a)return null;const l=EVe({dragStartTime:r,container:a.pageMarginBox,subject:t,center:i,shouldUseTimeDampening:o,getAutoScrollerOptions:s});return l&&wpe(e,l)?l:null},rTe=n=>{let{state:e,dragStartTime:t,shouldUseTimeDampening:i,scrollWindow:r,scrollDroppable:o,getAutoScrollerOptions:s}=n;const a=e.current.page.borderBoxCenter,c=e.dimensions.draggables[e.critical.draggable.id].page.marginBox;if(e.isWindowScrollAllowed){const h=e.viewport,g=nUt({dragStartTime:t,viewport:h,subject:c,center:a,shouldUseTimeDampening:i,getAutoScrollerOptions:s});if(g){r(g);return}}const u=Kjt({center:a,destination:dg(e.impact),droppables:e.dimensions.droppables});if(!u)return;const d=iUt({dragStartTime:t,droppable:u,subject:c,center:a,shouldUseTimeDampening:i,getAutoScrollerOptions:s});d&&o(u.descriptor.id,d)},rUt=n=>{let{scrollWindow:e,scrollDroppable:t,getAutoScrollerOptions:i=()=>rM}=n;const r=JP(e),o=JP(t);let s=null;const a=u=>{s||kn(!1);const{shouldUseTimeDampening:d,dragStartTime:h}=s;rTe({state:u,scrollWindow:r,scrollDroppable:o,dragStartTime:h,shouldUseTimeDampening:d,getAutoScrollerOptions:i})};return{start:u=>{s&&kn(!1);const d=Date.now();let h=!1;const g=()=>{h=!0};rTe({state:u,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:g,scrollDroppable:g,getAutoScrollerOptions:i}),s={dragStartTime:d,shouldUseTimeDampening:h},h&&a(u)},stop:()=>{s&&(r.cancel(),o.cancel(),s=null)},scroll:a}},oUt=n=>{let{move:e,scrollDroppable:t,scrollWindow:i}=n;const r=(l,c)=>{const u=Bu(l.current.client.selection,c);e({client:u})},o=(l,c)=>{if(!wpe(l,c))return c;const u=tUt(l,c);if(!u)return t(l.descriptor.id,c),null;const d=ig(c,u);return t(l.descriptor.id,d),ig(c,d)},s=(l,c,u)=>{if(!l||!Cpe(c,u))return u;const d=eUt(c,u);if(!d)return i(u),null;const h=ig(u,d);return i(h),ig(u,h)};return l=>{const c=l.scrollJumpRequest;if(!c)return;const u=dg(l.impact);u||kn(!1);const d=o(l.dimensions.droppables[u],c);if(!d)return;const h=l.viewport,g=s(l.isWindowScrollAllowed,h,d);g&&r(l,g)}},sUt=n=>{let{scrollDroppable:e,scrollWindow:t,move:i,getAutoScrollerOptions:r}=n;const o=rUt({scrollWindow:t,scrollDroppable:e,getAutoScrollerOptions:r}),s=oUt({move:i,scrollWindow:t,scrollDroppable:e});return{scroll:c=>{if(!(r().disabled||c.phase!=="DRAGGING")){if(c.movementMode==="FLUID"){o.scroll(c);return}c.scrollJumpRequest&&s(c)}},start:o.start,stop:o.stop}};const PD="data-rfd",MD=(()=>{const n=`${PD}-drag-handle`;return{base:n,draggableId:`${n}-draggable-id`,contextId:`${n}-context-id`}})(),are=(()=>{const n=`${PD}-draggable`;return{base:n,contextId:`${n}-context-id`,id:`${n}-id`}})(),aUt=(()=>{const n=`${PD}-droppable`;return{base:n,contextId:`${n}-context-id`,id:`${n}-id`}})(),oTe={contextId:`${PD}-scroll-container-context-id`},lUt=n=>e=>`[${e}="${n}"]`,kR=(n,e)=>n.map(t=>{const i=t.styles[e];return i?`${t.selector} { ${i} }`:""}).join(" "),cUt="pointer-events: none;";var uUt=n=>{const e=lUt(n),t=(()=>{const a=`
cursor: -webkit-grab;
cursor: grab;
`;return{selector:e(MD.contextId),styles:{always:`
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
touch-action: manipulation;
`,resting:a,dragging:cUt,dropAnimating:a}}})(),i=(()=>{const a=`
transition: ${SO.outOfTheWay};
`;return{selector:e(are.contextId),styles:{dragging:a,dropAnimating:a,userCancel:a}}})(),r={selector:e(aUt.contextId),styles:{always:"overflow-anchor: none;"}},s=[i,t,r,{selector:"body",styles:{dragging:`
cursor: grabbing;
cursor: -webkit-grabbing;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
overflow-anchor: none;
`}}];return{always:kR(s,"always"),resting:kR(s,"resting"),dragging:kR(s,"dragging"),dropAnimating:kR(s,"dropAnimating"),userCancel:kR(s,"userCancel")}};const dUt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?w.useLayoutEffect:w.useEffect;var hg=dUt;const _X=()=>{const n=document.querySelector("head");return n||kn(!1),n},sTe=n=>{const e=document.createElement("style");return n&&e.setAttribute("nonce",n),e.type="text/css",e};function hUt(n,e){const t=Ao(()=>uUt(n),[n]),i=w.useRef(null),r=w.useRef(null),o=Li(Mc(d=>{const h=r.current;h||kn(!1),h.textContent=d}),[]),s=Li(d=>{const h=i.current;h||kn(!1),h.textContent=d},[]);hg(()=>{!i.current&&!r.current||kn(!1);const d=sTe(e),h=sTe(e);return i.current=d,r.current=h,d.setAttribute(`${PD}-always`,n),h.setAttribute(`${PD}-dynamic`,n),_X().appendChild(d),_X().appendChild(h),s(t.always),o(t.resting),()=>{const g=p=>{const m=p.current;m||kn(!1),_X().removeChild(m),p.current=null};g(i),g(r)}},[e,s,o,t.always,t.resting,n]);const a=Li(()=>o(t.dragging),[o,t.dragging]),l=Li(d=>{if(d==="DROP"){o(t.dropAnimating);return}o(t.userCancel)},[o,t.dropAnimating,t.userCancel]),c=Li(()=>{r.current&&o(t.resting)},[o,t.resting]);return Ao(()=>({dragging:a,dropping:l,resting:c}),[a,l,c])}function kVe(n,e){return Array.from(n.querySelectorAll(e))}var TVe=n=>{var e;return((e=n==null?void 0:n.ownerDocument)==null?void 0:e.defaultView)||window};function Uj(n){return n instanceof TVe(n).HTMLElement}function fUt(n,e){const t=`[${MD.contextId}="${n}"]`,i=kVe(document,t);if(!i.length)return null;const r=i.find(o=>o.getAttribute(MD.draggableId)===e);return!r||!Uj(r)?null:r}function gUt(n){const e=w.useRef({}),t=w.useRef(null),i=w.useRef(null),r=w.useRef(!1),o=Li(function(h,g){const p={id:h,focus:g};return e.current[h]=p,function(){const _=e.current;_[h]!==p&&delete _[h]}},[]),s=Li(function(h){const g=fUt(n,h);g&&g!==document.activeElement&&g.focus()},[n]),a=Li(function(h,g){t.current===h&&(t.current=g)},[]),l=Li(function(){i.current||r.current&&(i.current=requestAnimationFrame(()=>{i.current=null;const h=t.current;h&&s(h)}))},[s]),c=Li(function(h){t.current=null;const g=document.activeElement;g&&g.getAttribute(MD.draggableId)===h&&(t.current=h)},[]);return hg(()=>(r.current=!0,function(){r.current=!1;const h=i.current;h&&cancelAnimationFrame(h)}),[]),Ao(()=>({register:o,tryRecordFocus:c,tryRestoreFocusRecorded:l,tryShiftRecord:a}),[o,c,l,a])}function pUt(){const n={draggables:{},droppables:{}},e=[];function t(d){return e.push(d),function(){const g=e.indexOf(d);g!==-1&&e.splice(g,1)}}function i(d){e.length&&e.forEach(h=>h(d))}function r(d){return n.draggables[d]||null}function o(d){const h=r(d);return h||kn(!1),h}const s={register:d=>{n.draggables[d.descriptor.id]=d,i({type:"ADDITION",value:d})},update:(d,h)=>{const g=n.draggables[h.descriptor.id];g&&g.uniqueId===d.uniqueId&&(delete n.draggables[h.descriptor.id],n.draggables[d.descriptor.id]=d)},unregister:d=>{const h=d.descriptor.id,g=r(h);g&&d.uniqueId===g.uniqueId&&(delete n.draggables[h],n.droppables[d.descriptor.droppableId]&&i({type:"REMOVAL",value:d}))},getById:o,findById:r,exists:d=>!!r(d),getAllByType:d=>Object.values(n.draggables).filter(h=>h.descriptor.type===d)};function a(d){return n.droppables[d]||null}function l(d){const h=a(d);return h||kn(!1),h}const c={register:d=>{n.droppables[d.descriptor.id]=d},unregister:d=>{const h=a(d.descriptor.id);h&&d.uniqueId===h.uniqueId&&delete n.droppables[d.descriptor.id]},getById:l,findById:a,exists:d=>!!a(d),getAllByType:d=>Object.values(n.droppables).filter(h=>h.descriptor.type===d)};function u(){n.draggables={},n.droppables={},e.length=0}return{draggable:s,droppable:c,subscribe:t,clean:u}}function mUt(){const n=Ao(pUt,[]);return w.useEffect(()=>function(){te.version.startsWith("16")||te.version.startsWith("17")?requestAnimationFrame(n.clean):n.clean()},[n]),n}var Spe=te.createContext(null),rV=()=>{const n=document.body;return n||kn(!1),n};const _Ut={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"};var vUt=_Ut;const bUt=n=>`rfd-announcement-${n}`;function yUt(n){const e=Ao(()=>bUt(n),[n]),t=w.useRef(null);return w.useEffect(function(){const o=document.createElement("div");return t.current=o,o.id=e,o.setAttribute("aria-live","assertive"),o.setAttribute("aria-atomic","true"),rt(o.style,vUt),rV().appendChild(o),function(){setTimeout(function(){const l=rV();l.contains(o)&&l.removeChild(o),o===t.current&&(t.current=null)})}},[e]),Li(r=>{const o=t.current;if(o){o.textContent=r;return}},[])}let CUt=0;const IVe={separator:"::"};function wUt(n,e){return e===void 0&&(e=IVe),Ao(()=>`${n}${e.separator}${CUt++}`,[e.separator,n])}function SUt(n,e){e===void 0&&(e=IVe);const t=te.useId();return Ao(()=>`${n}${e.separator}${t}`,[e.separator,n,t])}var Epe="useId"in te?SUt:wUt;function EUt(n){let{contextId:e,uniqueId:t}=n;return`rfd-hidden-text-${e}-${t}`}function xUt(n){let{contextId:e,text:t}=n;const i=Epe("hidden-text",{separator:"-"}),r=Ao(()=>EUt({contextId:e,uniqueId:i}),[i,e]);return w.useEffect(function(){const s=document.createElement("div");return s.id=r,s.textContent=t,s.style.display="none",rV().appendChild(s),function(){const l=rV();l.contains(s)&&l.removeChild(s)}},[r,t]),r}var qj=te.createContext(null);function LVe(n){const e=w.useRef(n);return w.useEffect(()=>{e.current=n}),e}function kUt(){let n=null;function e(){return!!n}function t(s){return s===n}function i(s){n&&kn(!1);const a={abandon:s};return n=a,a}function r(){n||kn(!1),n=null}function o(){n&&(n.abandon(),r())}return{isClaimed:e,isActive:t,claim:i,release:r,tryAbandon:o}}function oM(n){return n.phase==="IDLE"||n.phase==="DROP_ANIMATING"?!1:n.isDragging}const TUt=9,IUt=13,xpe=27,DVe=32,LUt=33,DUt=34,AUt=35,RUt=36,NUt=37,OUt=38,PUt=39,MUt=40,FUt={[IUt]:!0,[TUt]:!0};var AVe=n=>{FUt[n.keyCode]&&n.preventDefault()};const BUt=(()=>{const n="visibilitychange";return typeof document>"u"?n:[n,`ms${n}`,`webkit${n}`,`moz${n}`,`o${n}`].find(i=>`on${i}`in document)||n})();var Kj=BUt;const RVe=0,aTe=5;function $Ut(n,e){return Math.abs(e.x-n.x)>=aTe||Math.abs(e.y-n.y)>=aTe}const lTe={type:"IDLE"};function VUt(n){let{cancel:e,completed:t,getPhase:i,setPhase:r}=n;return[{eventName:"mousemove",fn:o=>{const{button:s,clientX:a,clientY:l}=o;if(s!==RVe)return;const c={x:a,y:l},u=i();if(u.type==="DRAGGING"){o.preventDefault(),u.actions.move(c);return}u.type!=="PENDING"&&kn(!1);const d=u.point;if(!$Ut(d,c))return;o.preventDefault();const h=u.actions.fluidLift(c);r({type:"DRAGGING",actions:h})}},{eventName:"mouseup",fn:o=>{const s=i();if(s.type!=="DRAGGING"){e();return}o.preventDefault(),s.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"mousedown",fn:o=>{i().type==="DRAGGING"&&o.preventDefault(),e()}},{eventName:"keydown",fn:o=>{if(i().type==="PENDING"){e();return}if(o.keyCode===xpe){o.preventDefault(),e();return}AVe(o)}},{eventName:"resize",fn:e},{eventName:"scroll",options:{passive:!0,capture:!1},fn:()=>{i().type==="PENDING"&&e()}},{eventName:"webkitmouseforcedown",fn:o=>{const s=i();if(s.type==="IDLE"&&kn(!1),s.actions.shouldRespectForcePress()){e();return}o.preventDefault()}},{eventName:Kj,fn:e}]}function HUt(n){const e=w.useRef(lTe),t=w.useRef(CC),i=Ao(()=>({eventName:"mousedown",fn:function(d){if(d.defaultPrevented||d.button!==RVe||d.ctrlKey||d.metaKey||d.shiftKey||d.altKey)return;const h=n.findClosestDraggableId(d);if(!h)return;const g=n.tryGetLock(h,s,{sourceEvent:d});if(!g)return;d.preventDefault();const p={x:d.clientX,y:d.clientY};t.current(),c(g,p)}}),[n]),r=Ao(()=>({eventName:"webkitmouseforcewillbegin",fn:u=>{if(u.defaultPrevented)return;const d=n.findClosestDraggableId(u);if(!d)return;const h=n.findOptionsForDraggable(d);h&&(h.shouldRespectForcePress||n.canGetLock(d)&&u.preventDefault())}}),[n]),o=Li(function(){const d={passive:!1,capture:!0};t.current=mp(window,[r,i],d)},[r,i]),s=Li(()=>{e.current.type!=="IDLE"&&(e.current=lTe,t.current(),o())},[o]),a=Li(()=>{const u=e.current;s(),u.type==="DRAGGING"&&u.actions.cancel({shouldBlockNextClick:!0}),u.type==="PENDING"&&u.actions.abort()},[s]),l=Li(function(){const d={capture:!0,passive:!1},h=VUt({cancel:a,completed:s,getPhase:()=>e.current,setPhase:g=>{e.current=g}});t.current=mp(window,h,d)},[a,s]),c=Li(function(d,h){e.current.type!=="IDLE"&&kn(!1),e.current={type:"PENDING",point:h,actions:d},l()},[l]);hg(function(){return o(),function(){t.current()}},[o])}function WUt(){}const zUt={[DUt]:!0,[LUt]:!0,[RUt]:!0,[AUt]:!0};function jUt(n,e){function t(){e(),n.cancel()}function i(){e(),n.drop()}return[{eventName:"keydown",fn:r=>{if(r.keyCode===xpe){r.preventDefault(),t();return}if(r.keyCode===DVe){r.preventDefault(),i();return}if(r.keyCode===MUt){r.preventDefault(),n.moveDown();return}if(r.keyCode===OUt){r.preventDefault(),n.moveUp();return}if(r.keyCode===PUt){r.preventDefault(),n.moveRight();return}if(r.keyCode===NUt){r.preventDefault(),n.moveLeft();return}if(zUt[r.keyCode]){r.preventDefault();return}AVe(r)}},{eventName:"mousedown",fn:t},{eventName:"mouseup",fn:t},{eventName:"click",fn:t},{eventName:"touchstart",fn:t},{eventName:"resize",fn:t},{eventName:"wheel",fn:t,options:{passive:!0}},{eventName:Kj,fn:t}]}function UUt(n){const e=w.useRef(WUt),t=Ao(()=>({eventName:"keydown",fn:function(o){if(o.defaultPrevented||o.keyCode!==DVe)return;const s=n.findClosestDraggableId(o);if(!s)return;const a=n.tryGetLock(s,u,{sourceEvent:o});if(!a)return;o.preventDefault();let l=!0;const c=a.snapLift();e.current();function u(){l||kn(!1),l=!1,e.current(),i()}e.current=mp(window,jUt(c,u),{capture:!0,passive:!1})}}),[n]),i=Li(function(){const o={passive:!1,capture:!0};e.current=mp(window,[t],o)},[t]);hg(function(){return i(),function(){e.current()}},[i])}const vX={type:"IDLE"},qUt=120,KUt=.15;function GUt(n){let{cancel:e,getPhase:t}=n;return[{eventName:"orientationchange",fn:e},{eventName:"resize",fn:e},{eventName:"contextmenu",fn:i=>{i.preventDefault()}},{eventName:"keydown",fn:i=>{if(t().type!=="DRAGGING"){e();return}i.keyCode===xpe&&i.preventDefault(),e()}},{eventName:Kj,fn:e}]}function YUt(n){let{cancel:e,completed:t,getPhase:i}=n;return[{eventName:"touchmove",options:{capture:!1},fn:r=>{const o=i();if(o.type!=="DRAGGING"){e();return}o.hasMoved=!0;const{clientX:s,clientY:a}=r.touches[0],l={x:s,y:a};r.preventDefault(),o.actions.move(l)}},{eventName:"touchend",fn:r=>{const o=i();if(o.type!=="DRAGGING"){e();return}r.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),t()}},{eventName:"touchcancel",fn:r=>{if(i().type!=="DRAGGING"){e();return}r.preventDefault(),e()}},{eventName:"touchforcechange",fn:r=>{const o=i();o.type==="IDLE"&&kn(!1);const s=r.touches[0];if(!s||!(s.force>=KUt))return;const l=o.actions.shouldRespectForcePress();if(o.type==="PENDING"){l&&e();return}if(l){if(o.hasMoved){r.preventDefault();return}e();return}r.preventDefault()}},{eventName:Kj,fn:e}]}function QUt(n){const e=w.useRef(vX),t=w.useRef(CC),i=Li(function(){return e.current},[]),r=Li(function(g){e.current=g},[]),o=Ao(()=>({eventName:"touchstart",fn:function(g){if(g.defaultPrevented)return;const p=n.findClosestDraggableId(g);if(!p)return;const m=n.tryGetLock(p,a,{sourceEvent:g});if(!m)return;const _=g.touches[0],{clientX:v,clientY:b}=_,y={x:v,y:b};t.current(),d(m,y)}}),[n]),s=Li(function(){const g={capture:!0,passive:!1};t.current=mp(window,[o],g)},[o]),a=Li(()=>{const h=e.current;h.type!=="IDLE"&&(h.type==="PENDING"&&clearTimeout(h.longPressTimerId),r(vX),t.current(),s())},[s,r]),l=Li(()=>{const h=e.current;a(),h.type==="DRAGGING"&&h.actions.cancel({shouldBlockNextClick:!0}),h.type==="PENDING"&&h.actions.abort()},[a]),c=Li(function(){const g={capture:!0,passive:!1},p={cancel:l,completed:a,getPhase:i},m=mp(window,YUt(p),g),_=mp(window,GUt(p),g);t.current=function(){m(),_()}},[l,i,a]),u=Li(function(){const g=i();g.type!=="PENDING"&&kn(!1);const p=g.actions.fluidLift(g.point);r({type:"DRAGGING",actions:p,hasMoved:!1})},[i,r]),d=Li(function(g,p){i().type!=="IDLE"&&kn(!1);const m=setTimeout(u,qUt);r({type:"PENDING",point:p,actions:g,longPressTimerId:m}),c()},[c,i,r,u]);hg(function(){return s(),function(){t.current();const p=i();p.type==="PENDING"&&(clearTimeout(p.longPressTimerId),r(vX))}},[i,s,r]),hg(function(){return mp(window,[{eventName:"touchmove",fn:()=>{},options:{capture:!1,passive:!1}}])},[])}const XUt=["input","button","textarea","select","option","optgroup","video","audio"];function NVe(n,e){if(e==null)return!1;if(XUt.includes(e.tagName.toLowerCase()))return!0;const i=e.getAttribute("contenteditable");return i==="true"||i===""?!0:e===n?!1:NVe(n,e.parentElement)}function ZUt(n,e){const t=e.target;return Uj(t)?NVe(n,t):!1}var JUt=n=>n_(n.getBoundingClientRect()).center;function eqt(n){return n instanceof TVe(n).Element}const tqt=(()=>{const n="matches";return typeof document>"u"?n:[n,"msMatchesSelector","webkitMatchesSelector"].find(i=>i in Element.prototype)||n})();function OVe(n,e){return n==null?null:n[tqt](e)?n:OVe(n.parentElement,e)}function nqt(n,e){return n.closest?n.closest(e):OVe(n,e)}function iqt(n){return`[${MD.contextId}="${n}"]`}function rqt(n,e){const t=e.target;if(!eqt(t))return null;const i=iqt(n),r=nqt(t,i);return!r||!Uj(r)?null:r}function oqt(n,e){const t=rqt(n,e);return t?t.getAttribute(MD.draggableId):null}function sqt(n,e){const t=`[${are.contextId}="${n}"]`,r=kVe(document,t).find(o=>o.getAttribute(are.id)===e);return!r||!Uj(r)?null:r}function aqt(n){n.preventDefault()}function Y6(n){let{expected:e,phase:t,isLockActive:i,shouldWarn:r}=n;return!(!i()||e!==t)}function PVe(n){let{lockAPI:e,store:t,registry:i,draggableId:r}=n;if(e.isClaimed())return!1;const o=i.draggable.findById(r);return!(!o||!o.options.isEnabled||!wVe(t.getState(),r))}function lqt(n){let{lockAPI:e,contextId:t,store:i,registry:r,draggableId:o,forceSensorStop:s,sourceEvent:a}=n;if(!PVe({lockAPI:e,store:i,registry:r,draggableId:o}))return null;const c=r.draggable.getById(o),u=sqt(t,c.descriptor.id);if(!u||a&&!c.options.canDragInteractiveElements&&ZUt(u,a))return null;const d=e.claim(s||CC);let h="PRE_DRAG";function g(){return c.options.shouldRespectForcePress}function p(){return e.isActive(d)}function m(k,I){Y6({expected:k,phase:h,isLockActive:p,shouldWarn:!0})&&i.dispatch(I())}const _=m.bind(null,"DRAGGING");function v(k){function I(){e.release(),h="COMPLETED"}h!=="PRE_DRAG"&&(I(),kn(!1)),i.dispatch(qzt(k.liftActionArgs)),h="DRAGGING";function L(D,R){if(R===void 0&&(R={shouldBlockNextClick:!1}),k.cleanup(),R.shouldBlockNextClick){const P=mp(window,[{eventName:"click",fn:aqt,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(P)}I(),i.dispatch(gVe({reason:D}))}return{isActive:()=>Y6({expected:"DRAGGING",phase:h,isLockActive:p,shouldWarn:!1}),shouldRespectForcePress:g,drop:D=>L("DROP",D),cancel:D=>L("CANCEL",D),...k.actions}}function b(k){const I=JP(D=>{_(()=>fVe({client:D}))});return{...v({liftActionArgs:{id:o,clientSelection:k,movementMode:"FLUID"},cleanup:()=>I.cancel(),actions:{move:I}}),move:I}}function y(){const k={moveUp:()=>_(tjt),moveRight:()=>_(ijt),moveDown:()=>_(njt),moveLeft:()=>_(rjt)};return v({liftActionArgs:{id:o,clientSelection:JUt(u),movementMode:"SNAP"},cleanup:CC,actions:k})}function C(){Y6({expected:"PRE_DRAG",phase:h,isLockActive:p,shouldWarn:!0})&&e.release()}return{isActive:()=>Y6({expected:"PRE_DRAG",phase:h,isLockActive:p,shouldWarn:!1}),shouldRespectForcePress:g,fluidLift:b,snapLift:y,abort:C}}const cqt=[HUt,UUt,QUt];function uqt(n){let{contextId:e,store:t,registry:i,customSensors:r,enableDefaultSensors:o}=n;const s=[...o?cqt:[],...r||[]],a=w.useState(()=>kUt())[0],l=Li(function(v,b){oM(v)&&!oM(b)&&a.tryAbandon()},[a]);hg(function(){let v=t.getState();return t.subscribe(()=>{const y=t.getState();l(v,y),v=y})},[a,t,l]),hg(()=>a.tryAbandon,[a.tryAbandon]);const c=Li(_=>PVe({lockAPI:a,registry:i,store:t,draggableId:_}),[a,i,t]),u=Li((_,v,b)=>lqt({lockAPI:a,registry:i,contextId:e,store:t,draggableId:_,forceSensorStop:v||null,sourceEvent:b&&b.sourceEvent?b.sourceEvent:null}),[e,a,i,t]),d=Li(_=>oqt(e,_),[e]),h=Li(_=>{const v=i.draggable.findById(_);return v?v.options:null},[i.draggable]),g=Li(function(){a.isClaimed()&&(a.tryAbandon(),t.getState().phase!=="IDLE"&&t.dispatch(mpe()))},[a,t]),p=Li(()=>a.isClaimed(),[a]),m=Ao(()=>({canGetLock:c,tryGetLock:u,findClosestDraggableId:d,findOptionsForDraggable:h,tryReleaseLock:g,isLockClaimed:p}),[c,u,d,h,g,p]);for(let _=0;_<s.length;_++)s[_](m)}const dqt=n=>({onBeforeCapture:e=>{const t=()=>{n.onBeforeCapture&&n.onBeforeCapture(e)};te.version.startsWith("16")||te.version.startsWith("17")?t():Yp.flushSync(t)},onBeforeDragStart:n.onBeforeDragStart,onDragStart:n.onDragStart,onDragEnd:n.onDragEnd,onDragUpdate:n.onDragUpdate}),hqt=n=>({...rM,...n.autoScrollerOptions,durationDampening:{...rM.durationDampening,...n.autoScrollerOptions}});function TR(n){return n.current||kn(!1),n.current}function fqt(n){const{contextId:e,setCallbacks:t,sensors:i,nonce:r,dragHandleUsageInstructions:o}=n,s=w.useRef(null),a=LVe(n),l=Li(()=>dqt(a.current),[a]),c=Li(()=>hqt(a.current),[a]),u=yUt(e),d=xUt({contextId:e,text:o}),h=hUt(e,r),g=Li(R=>{TR(s).dispatch(R)},[]),p=Ao(()=>rte({publishWhileDragging:Gzt,updateDroppableScroll:Qzt,updateDroppableIsEnabled:Xzt,updateDroppableIsCombineEnabled:Zzt,collectionStarting:Yzt},g),[g]),m=mUt(),_=Ao(()=>zjt(m,p),[m,p]),v=Ao(()=>sUt({scrollWindow:jjt,scrollDroppable:_.scrollDroppable,getAutoScrollerOptions:c,...rte({move:fVe},g)}),[_.scrollDroppable,g,c]),b=gUt(e),y=Ao(()=>$jt({announce:u,autoScroller:v,dimensionMarshal:_,focusMarshal:b,getResponders:l,styleMarshal:h}),[u,v,_,b,l,h]);s.current=y;const C=Li(()=>{const R=TR(s);R.getState().phase!=="IDLE"&&R.dispatch(mpe())},[]),x=Li(()=>{const R=TR(s).getState();return R.phase==="DROP_ANIMATING"?!0:R.phase==="IDLE"?!1:R.isDragging},[]),k=Ao(()=>({isDragging:x,tryAbort:C}),[x,C]);t(k);const I=Li(R=>wVe(TR(s).getState(),R),[]),L=Li(()=>zS(TR(s).getState()),[]),D=Ao(()=>({marshal:_,focus:b,contextId:e,canLift:I,isMovementAllowed:L,dragHandleUsageInstructionsId:d,registry:m}),[e,_,d,b,I,L,m]);return uqt({contextId:e,store:y,registry:m,customSensors:i||null,enableDefaultSensors:n.enableDefaultSensors!==!1}),w.useEffect(()=>C,[C]),te.createElement(qj.Provider,{value:D},te.createElement(WMe,{context:Spe,store:y},n.children))}let gqt=0;function pqt(){return Ao(()=>`${gqt++}`,[])}function mqt(){return te.useId()}var _qt="useId"in te?mqt:pqt;function Gj(n){const e=_qt(),t=n.dragHandleUsageInstructions||m8.dragHandleUsageInstructions;return te.createElement(OWt,null,i=>te.createElement(fqt,{nonce:n.nonce,contextId:e,setCallbacks:i,dragHandleUsageInstructions:t,enableDefaultSensors:n.enableDefaultSensors,sensors:n.sensors,onBeforeCapture:n.onBeforeCapture,onBeforeDragStart:n.onBeforeDragStart,onDragStart:n.onDragStart,onDragUpdate:n.onDragUpdate,onDragEnd:n.onDragEnd,autoScrollerOptions:n.autoScrollerOptions},n.children))}const cTe={dragging:5e3,dropAnimating:4500},vqt=(n,e)=>e?SO.drop(e.duration):n?SO.snap:SO.fluid,bqt=(n,e)=>{if(n)return e?iM.opacity.drop:iM.opacity.combining},yqt=n=>n.forceShouldAnimate!=null?n.forceShouldAnimate:n.mode==="SNAP";function Cqt(n){const t=n.dimension.client,{offset:i,combineWith:r,dropping:o}=n,s=!!r,a=yqt(n),l=!!o,c=l?ore.drop(i,s):ore.moveTo(i);return{position:"fixed",top:t.marginBox.top,left:t.marginBox.left,boxSizing:"border-box",width:t.borderBox.width,height:t.borderBox.height,transition:vqt(a,o),transform:c,opacity:bqt(s,l),zIndex:l?cTe.dropAnimating:cTe.dragging,pointerEvents:"none"}}function wqt(n){return{transform:ore.moveTo(n.offset),transition:n.shouldAnimateDisplacement?void 0:"none"}}function Sqt(n){return n.type==="DRAGGING"?Cqt(n):wqt(n)}function Eqt(n,e,t){t===void 0&&(t=hu);const i=window.getComputedStyle(e),r=e.getBoundingClientRect(),o=W7e(r,i),s=eV(o,t),a={client:o,tagName:e.tagName.toLowerCase(),display:i.display},l={x:o.marginBox.width,y:o.marginBox.height};return{descriptor:n,placeholder:a,displaceBy:l,client:o,page:s}}function xqt(n){const e=Epe("draggable"),{descriptor:t,registry:i,getDraggableRef:r,canDragInteractiveElements:o,shouldRespectForcePress:s,isEnabled:a}=n,l=Ao(()=>({canDragInteractiveElements:o,shouldRespectForcePress:s,isEnabled:a}),[o,a,s]),c=Li(g=>{const p=r();return p||kn(!1),Eqt(t,p,g)},[t,r]),u=Ao(()=>({uniqueId:e,descriptor:t,options:l,getDimension:c}),[t,c,l,e]),d=w.useRef(u),h=w.useRef(!0);hg(()=>(i.draggable.register(d.current),()=>i.draggable.unregister(d.current)),[i.draggable]),hg(()=>{if(h.current){h.current=!1;return}const g=d.current;d.current=u,i.draggable.update(u,g)},[u,i.draggable])}var kpe=te.createContext(null);function oV(n){const e=w.useContext(n);return e||kn(!1),e}function kqt(n){n.preventDefault()}const Tqt=n=>{const e=w.useRef(null),t=Li(function(k){k===void 0&&(k=null),e.current=k},[]),i=Li(()=>e.current,[]),{contextId:r,dragHandleUsageInstructionsId:o,registry:s}=oV(qj),{type:a,droppableId:l}=oV(kpe),c=Ao(()=>({id:n.draggableId,index:n.index,type:a,droppableId:l}),[n.draggableId,n.index,a,l]),{children:u,draggableId:d,isEnabled:h,shouldRespectForcePress:g,canDragInteractiveElements:p,isClone:m,mapped:_,dropAnimationFinished:v}=n;if(!m){const k=Ao(()=>({descriptor:c,registry:s,getDraggableRef:i,canDragInteractiveElements:p,shouldRespectForcePress:g,isEnabled:h}),[c,s,i,p,g,h]);xqt(k)}const b=Ao(()=>h?{tabIndex:0,role:"button","aria-describedby":o,"data-rfd-drag-handle-draggable-id":d,"data-rfd-drag-handle-context-id":r,draggable:!1,onDragStart:kqt}:null,[r,o,d,h]),y=Li(k=>{_.type==="DRAGGING"&&_.dropping&&k.propertyName==="transform"&&(te.version.startsWith("16")||te.version.startsWith("17")?v():Yp.flushSync(v))},[v,_]),C=Ao(()=>{const k=Sqt(_),I=_.type==="DRAGGING"&&_.dropping?y:void 0;return{innerRef:t,draggableProps:{"data-rfd-draggable-context-id":r,"data-rfd-draggable-id":d,style:k,onTransitionEnd:I},dragHandleProps:b}},[r,b,d,_,y,t]),x=Ao(()=>({draggableId:c.id,type:c.type,source:{index:c.index,droppableId:c.droppableId}}),[c.droppableId,c.id,c.index,c.type]);return te.createElement(te.Fragment,null,u(C,_.snapshot,x))};var Iqt=Tqt,MVe=(n,e)=>n===e,FVe=n=>{const{combine:e,destination:t}=n;return t?t.droppableId:e?e.droppableId:null};const Lqt=n=>n.combine?n.combine.draggableId:null,Dqt=n=>n.at&&n.at.type==="COMBINE"?n.at.combine.draggableId:null;function Aqt(){const n=Mc((r,o)=>({x:r,y:o})),e=Mc(function(r,o,s,a,l){return s===void 0&&(s=null),a===void 0&&(a=null),l===void 0&&(l=null),{isDragging:!0,isClone:o,isDropAnimating:!!l,dropAnimation:l,mode:r,draggingOver:s,combineWith:a,combineTargetFor:null}}),t=Mc(function(r,o,s,a,l,c,u){return l===void 0&&(l=null),c===void 0&&(c=null),u===void 0&&(u=null),{mapped:{type:"DRAGGING",dropping:null,draggingOver:l,combineWith:c,mode:o,offset:r,dimension:s,forceShouldAnimate:u,snapshot:e(o,a,l,c,null)}}});return(r,o)=>{if(oM(r)){if(r.critical.draggable.id!==o.draggableId)return null;const s=r.current.client.offset,a=r.dimensions.draggables[o.draggableId],l=dg(r.impact),c=Dqt(r.impact),u=r.forceShouldAnimate;return t(n(s.x,s.y),r.movementMode,a,o.isClone,l,c,u)}if(r.phase==="DROP_ANIMATING"){const s=r.completed;if(s.result.draggableId!==o.draggableId)return null;const a=o.isClone,l=r.dimensions.draggables[o.draggableId],c=s.result,u=c.mode,d=FVe(c),h=Lqt(c),p={duration:r.dropDuration,curve:vpe.drop,moveTo:r.newHomeClientOffset,opacity:h?iM.opacity.drop:null,scale:h?iM.scale.drop:null};return{mapped:{type:"DRAGGING",offset:r.newHomeClientOffset,dimension:l,dropping:p,draggingOver:d,combineWith:h,mode:u,forceShouldAnimate:null,snapshot:e(u,a,d,h,p)}}}return null}}function BVe(n){return n===void 0&&(n=null),{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:n,combineWith:null}}const Rqt={mapped:{type:"SECONDARY",offset:hu,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:BVe(null)}};function Nqt(){const n=Mc((s,a)=>({x:s,y:a})),e=Mc(BVe),t=Mc(function(s,a,l){return a===void 0&&(a=null),{mapped:{type:"SECONDARY",offset:s,combineTargetFor:a,shouldAnimateDisplacement:l,snapshot:e(a)}}}),i=s=>s?t(hu,s,!0):null,r=(s,a,l,c)=>{const u=l.displaced.visible[s],d=!!(c.inVirtualList&&c.effected[s]),h=Wj(l),g=h&&h.draggableId===s?a:null;if(!u){if(!d)return i(g);if(l.displaced.invisible[s])return null;const _=lA(c.displacedBy.point),v=n(_.x,_.y);return t(v,g,!0)}if(d)return i(g);const p=l.displacedBy.point,m=n(p.x,p.y);return t(m,g,u.shouldAnimate)};return(s,a)=>{if(oM(s))return s.critical.draggable.id===a.draggableId?null:r(a.draggableId,s.critical.draggable.id,s.impact,s.afterCritical);if(s.phase==="DROP_ANIMATING"){const l=s.completed;return l.result.draggableId===a.draggableId?null:r(a.draggableId,l.result.draggableId,l.impact,l.afterCritical)}return null}}const Oqt=()=>{const n=Aqt(),e=Nqt();return(i,r)=>n(i,r)||e(i,r)||Rqt},Pqt={dropAnimationFinished:pVe},Mqt=HMe(Oqt,Pqt,null,{context:Spe,areStatePropsEqual:MVe})(Iqt);var Fqt=Mqt;function $Ve(n){return oV(kpe).isUsingCloneFor===n.draggableId&&!n.isClone?null:te.createElement(Fqt,n)}function Yj(n){const e=typeof n.isDragDisabled=="boolean"?!n.isDragDisabled:!0,t=!!n.disableInteractiveElementBlocking,i=!!n.shouldRespectForcePress;return te.createElement($Ve,rt({},n,{isClone:!1,isEnabled:e,canDragInteractiveElements:t,shouldRespectForcePress:i}))}const VVe=n=>e=>n===e,Bqt=VVe("scroll"),$qt=VVe("auto"),uTe=(n,e)=>e(n.overflowX)||e(n.overflowY),Vqt=n=>{const e=window.getComputedStyle(n),t={overflowX:e.overflowX,overflowY:e.overflowY};return uTe(t,Bqt)||uTe(t,$qt)},Hqt=()=>!1,HVe=n=>n==null?null:n===document.body?Hqt()?n:null:n===document.documentElement?null:Vqt(n)?n:HVe(n.parentElement);var Wqt=HVe,lre=n=>({x:n.scrollLeft,y:n.scrollTop});const WVe=n=>n?window.getComputedStyle(n).position==="fixed"?!0:WVe(n.parentElement):!1;var zqt=n=>{const e=Wqt(n),t=WVe(n);return{closestScrollable:e,isFixedOnPage:t}},jqt=n=>{let{descriptor:e,isEnabled:t,isCombineEnabled:i,isFixedOnPage:r,direction:o,client:s,page:a,closest:l}=n;const c=(()=>{if(!l)return null;const{scrollSize:g,client:p}=l,m=bVe({scrollHeight:g.scrollHeight,scrollWidth:g.scrollWidth,height:p.paddingBox.height,width:p.paddingBox.width});return{pageMarginBox:l.page.marginBox,frameClient:p,scrollSize:g,shouldClipSubject:l.shouldClipSubject,scroll:{initial:l.scroll,current:l.scroll,max:m,diff:{value:hu,displacement:hu}}}})(),u=o==="vertical"?dpe:Z7e,d=OD({page:a,withPlaceholder:null,axis:u,frame:c});return{descriptor:e,isCombineEnabled:i,isFixedOnPage:r,axis:u,isEnabled:t,client:s,page:a,frame:c,subject:d}};const Uqt=(n,e)=>{const t=z7e(n);if(!e||n!==e)return t;const i=t.paddingBox.top-e.scrollTop,r=t.paddingBox.left-e.scrollLeft,o=i+e.scrollHeight,s=r+e.scrollWidth,l=ape({top:i,right:s,bottom:o,left:r},t.border);return lpe({borderBox:l,margin:t.margin,border:t.border,padding:t.padding})};var qqt=n=>{let{ref:e,descriptor:t,env:i,windowScroll:r,direction:o,isDropDisabled:s,isCombineEnabled:a,shouldClipSubject:l}=n;const c=i.closestScrollable,u=Uqt(e,c),d=eV(u,r),h=(()=>{if(!c)return null;const p=z7e(c),m={scrollHeight:c.scrollHeight,scrollWidth:c.scrollWidth};return{client:p,page:eV(p,r),scroll:lre(c),scrollSize:m,shouldClipSubject:l}})();return jqt({descriptor:t,isEnabled:!s,isCombineEnabled:a,isFixedOnPage:i.isFixedOnPage,direction:o,client:u,page:d,closest:h})};const Kqt={passive:!1},Gqt={passive:!0};var dTe=n=>n.shouldPublishImmediately?Kqt:Gqt;const Q6=n=>n&&n.env.closestScrollable||null;function Yqt(n){const e=w.useRef(null),t=oV(qj),i=Epe("droppable"),{registry:r,marshal:o}=t,s=LVe(n),a=Ao(()=>({id:n.droppableId,type:n.type,mode:n.mode}),[n.droppableId,n.mode,n.type]),l=w.useRef(a),c=Ao(()=>Mc((C,x)=>{e.current||kn(!1);const k={x:C,y:x};o.updateDroppableScroll(a.id,k)}),[a.id,o]),u=Li(()=>{const C=e.current;return!C||!C.env.closestScrollable?hu:lre(C.env.closestScrollable)},[]),d=Li(()=>{const C=u();c(C.x,C.y)},[u,c]),h=Ao(()=>JP(d),[d]),g=Li(()=>{const C=e.current,x=Q6(C);if(C&&x||kn(!1),C.scrollOptions.shouldPublishImmediately){d();return}h()},[h,d]),p=Li((C,x)=>{e.current&&kn(!1);const k=s.current,I=k.getDroppableRef();I||kn(!1);const L=zqt(I),D={ref:I,descriptor:a,env:L,scrollOptions:x};e.current=D;const R=qqt({ref:I,descriptor:a,env:L,windowScroll:C,direction:k.direction,isDropDisabled:k.isDropDisabled,isCombineEnabled:k.isCombineEnabled,shouldClipSubject:!k.ignoreContainerClipping}),P=L.closestScrollable;return P&&(P.setAttribute(oTe.contextId,t.contextId),P.addEventListener("scroll",g,dTe(D.scrollOptions))),R},[t.contextId,a,g,s]),m=Li(()=>{const C=e.current,x=Q6(C);return C&&x||kn(!1),lre(x)},[]),_=Li(()=>{const C=e.current;C||kn(!1);const x=Q6(C);e.current=null,x&&(h.cancel(),x.removeAttribute(oTe.contextId),x.removeEventListener("scroll",g,dTe(C.scrollOptions)))},[g,h]),v=Li(C=>{const x=e.current;x||kn(!1);const k=Q6(x);k||kn(!1),k.scrollTop+=C.y,k.scrollLeft+=C.x},[]),b=Ao(()=>({getDimensionAndWatchScroll:p,getScrollWhileDragging:m,dragStopped:_,scroll:v}),[_,p,m,v]),y=Ao(()=>({uniqueId:i,descriptor:a,callbacks:b}),[b,a,i]);hg(()=>(l.current=y.descriptor,r.droppable.register(y),()=>{e.current&&_(),r.droppable.unregister(y)}),[b,a,_,y,o,r.droppable]),hg(()=>{e.current&&o.updateDroppableIsEnabled(l.current.id,!n.isDropDisabled)},[n.isDropDisabled,o]),hg(()=>{e.current&&o.updateDroppableIsCombineEnabled(l.current.id,n.isCombineEnabled)},[n.isCombineEnabled,o])}function bX(){}const hTe={width:0,height:0,margin:HWt},Qqt=n=>{let{isAnimatingOpenOnMount:e,placeholder:t,animate:i}=n;return e||i==="close"?hTe:{height:t.client.borderBox.height,width:t.client.borderBox.width,margin:t.client.margin}},Xqt=n=>{let{isAnimatingOpenOnMount:e,placeholder:t,animate:i}=n;const r=Qqt({isAnimatingOpenOnMount:e,placeholder:t,animate:i});return{display:t.display,boxSizing:"border-box",width:r.width,height:r.height,marginTop:r.margin.top,marginRight:r.margin.right,marginBottom:r.margin.bottom,marginLeft:r.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:i!=="none"?SO.placeholder:null}},Zqt=n=>{const e=w.useRef(null),t=Li(()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),{animate:i,onTransitionEnd:r,onClose:o,contextId:s}=n,[a,l]=w.useState(n.animate==="open");w.useEffect(()=>a?i!=="open"?(t(),l(!1),bX):e.current?bX:(e.current=setTimeout(()=>{e.current=null,l(!1)}),t):bX,[i,a,t]);const c=Li(d=>{d.propertyName==="height"&&(r(),i==="close"&&o())},[i,o,r]),u=Xqt({isAnimatingOpenOnMount:a,animate:n.animate,placeholder:n.placeholder});return te.createElement(n.placeholder.tagName,{style:u,"data-rfd-placeholder-context-id":s,onTransitionEnd:c,ref:n.innerRef})};var Jqt=te.memo(Zqt);class eKt extends te.PureComponent{constructor(){super(...arguments),this.state={isVisible:!!this.props.on,data:this.props.on,animate:this.props.shouldAnimate&&this.props.on?"open":"none"},this.onClose=()=>{this.state.animate==="close"&&this.setState({isVisible:!1})}}static getDerivedStateFromProps(e,t){return e.shouldAnimate?e.on?{isVisible:!0,data:e.on,animate:"open"}:t.isVisible?{isVisible:!0,data:t.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!e.on,data:e.on,animate:"none"}}render(){if(!this.state.isVisible)return null;const e={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(e)}}const tKt=n=>{const e=w.useContext(qj);e||kn(!1);const{contextId:t,isMovementAllowed:i}=e,r=w.useRef(null),o=w.useRef(null),{children:s,droppableId:a,type:l,mode:c,direction:u,ignoreContainerClipping:d,isDropDisabled:h,isCombineEnabled:g,snapshot:p,useClone:m,updateViewportMaxScroll:_,getContainerForClone:v}=n,b=Li(()=>r.current,[]),y=Li(function(P){P===void 0&&(P=null),r.current=P},[]);Li(()=>o.current,[]);const C=Li(function(P){P===void 0&&(P=null),o.current=P},[]),x=Li(()=>{i()&&_({maxScroll:CVe()})},[i,_]);Yqt({droppableId:a,type:l,mode:c,direction:u,isDropDisabled:h,isCombineEnabled:g,ignoreContainerClipping:d,getDroppableRef:b});const k=Ao(()=>te.createElement(eKt,{on:n.placeholder,shouldAnimate:n.shouldAnimatePlaceholder},P=>{let{onClose:M,data:O,animate:B}=P;return te.createElement(Jqt,{placeholder:O,onClose:M,innerRef:C,animate:B,contextId:t,onTransitionEnd:x})}),[t,x,n.placeholder,n.shouldAnimatePlaceholder,C]),I=Ao(()=>({innerRef:y,placeholder:k,droppableProps:{"data-rfd-droppable-id":a,"data-rfd-droppable-context-id":t}}),[t,a,k,y]),L=m?m.dragging.draggableId:null,D=Ao(()=>({droppableId:a,type:l,isUsingCloneFor:L}),[a,L,l]);function R(){if(!m)return null;const{dragging:P,render:M}=m,O=te.createElement($Ve,{draggableId:P.draggableId,index:P.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},(B,F)=>M(B,F,P));return VW.createPortal(O,v())}return te.createElement(kpe.Provider,{value:D},s(I,p),R())};var nKt=tKt;function iKt(){return document.body||kn(!1),document.body}const fTe={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:iKt},zVe=n=>{let e={...n},t;for(t in fTe)n[t]===void 0&&(e={...e,[t]:fTe[t]});return e},yX=(n,e)=>n===e.droppable.type,gTe=(n,e)=>e.draggables[n.draggable.id],rKt=()=>{const n={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},e={...n,shouldAnimatePlaceholder:!1},t=Mc(o=>({draggableId:o.id,type:o.type,source:{index:o.index,droppableId:o.droppableId}})),i=Mc((o,s,a,l,c,u)=>{const d=c.descriptor.id;if(c.descriptor.droppableId===o){const p=u?{render:u,dragging:t(c.descriptor)}:null,m={isDraggingOver:a,draggingOverWith:a?d:null,draggingFromThisWith:d,isUsingPlaceholder:!0};return{placeholder:c.placeholder,shouldAnimatePlaceholder:!1,snapshot:m,useClone:p}}if(!s)return e;if(!l)return n;const g={isDraggingOver:a,draggingOverWith:d,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:c.placeholder,shouldAnimatePlaceholder:!0,snapshot:g,useClone:null}});return(o,s)=>{const a=zVe(s),l=a.droppableId,c=a.type,u=!a.isDropDisabled,d=a.renderClone;if(oM(o)){const h=o.critical;if(!yX(c,h))return e;const g=gTe(h,o.dimensions),p=dg(o.impact)===l;return i(l,u,p,p,g,d)}if(o.phase==="DROP_ANIMATING"){const h=o.completed;if(!yX(c,h.critical))return e;const g=gTe(h.critical,o.dimensions);return i(l,u,FVe(h.result)===l,dg(h.impact)===l,g,d)}if(o.phase==="IDLE"&&o.completed&&!o.shouldFlush){const h=o.completed;if(!yX(c,h.critical))return e;const g=dg(h.impact)===l,p=!!(h.impact.at&&h.impact.at.type==="COMBINE"),m=h.critical.droppable.id===l;return g?p?n:e:m?n:e}return e}},oKt={updateViewportMaxScroll:ejt},sKt=HMe(rKt,oKt,(n,e,t)=>({...zVe(t),...n,...e}),{context:Spe,areStatePropsEqual:MVe})(nKt);var Qj=sKt;function aKt(n,e,t){const i=e<0?n.length+e:e;if(i>=0&&i<n.length){const r=t<0?n.length+t:t,[o]=n.splice(e,1);n.splice(r,0,o)}}function Tpe(n,e,t){return n=[...n],aKt(n,e,t),n}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function lKt(n){const{isCompanySettingsActive:e}=Ms(),{currentGateways:t,setCurrentGateways:i}=n,r=Ti(),o=Fo(),[s,a]=w.useState([]),[l,c]=w.useState("active"),{data:u}=v8e({status:l}),d=m=>{const _=m.map(v=>v.value);c(_.join(","))},h=m=>{const _=t.filter(({id:v})=>v!==m);i(_),_.length?o("settings.company_gateway_ids",_.map(({id:v})=>v).join(",")):o("settings.company_gateway_ids","0")},g=()=>{const m=(u==null?void 0:u.data.data)||[];m&&(i(m),o("settings.company_gateway_ids",m.map(({id:_})=>_).join(",")))},p=m=>{const _={};return m.forEach(v=>{_[v.id]||(_[v.id]=v)}),Object.values(_)};return w.useEffect(()=>{if(u)if((r==null?void 0:r.settings.company_gateway_ids)!=="0")if(r!=null&&r.settings.company_gateway_ids){let m=r.settings.company_gateway_ids.split(",").map(_=>u.data.data.find(v=>v.id===_));m=m.filter(_=>_),e&&u.data.data.forEach(_=>{m.some(b=>b.id===_.id)||m.push(_)}),a(p(m))}else a(p(u.data.data));else a([])},[u]),{gateways:s,handleRemoveGateway:h,handleReset:g,onStatusChange:d}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Ik(){const n=Vn();return{multiValue:(t,{data:i})=>({...t,backgroundColor:i.backgroundColor,color:i.color,borderRadius:"3px"}),multiValueLabel:(t,{data:i})=>({...t,color:i.color}),multiValueRemove:t=>({...t,":hover":{color:"white"},color:"#999999"}),menu:t=>({...t,width:"max-content",minWidth:"100%",backgroundColor:n.$4,borderColor:n.$4}),control:t=>({...t,borderRadius:"3px",backgroundColor:n.$1,color:n.$3,borderColor:n.$5}),option:t=>({...t,backgroundColor:n.$1,":hover":{backgroundColor:n.$7}})}}function cKt(n){return bn({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8.186 1.113a.5.5 0 0 0-.372 0L1.846 3.5 8 5.961 14.154 3.5 8.186 1.113zM15 4.239l-6.5 2.6v7.922l6.5-2.6V4.24zM7.5 14.762V6.838L1 4.239v7.923l6.5 2.6zM7.443.184a1.5 1.5 0 0 1 1.114 0l7.129 2.852A.5.5 0 0 1 16 3.5v8.662a1 1 0 0 1-.629.928l-7.185 2.874a.5.5 0 0 1-.372 0L.63 13.09a1 1 0 0 1-.63-.928V3.5a.5.5 0 0 1 .314-.464L7.443.184z"}}]})(n)}function _hr(n){return bn({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M13.5 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h11zm-11-1a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2h-11z"}},{tag:"path",attr:{d:"M6.5 3a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1V3zm-4 0a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1V3zm8 0a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-1a1 1 0 0 1-1-1V3z"}}]})(n)}function uKt(n){return bn({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}},{tag:"path",attr:{d:"M5.255 5.786a.237.237 0 0 0 .241.247h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286zm1.557 5.763c0 .533.425.927 1.01.927.609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94z"}}]})(n)}function vhr(n){return bn({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm15 2h-4v3h4V4zm0 4h-4v3h4V8zm0 4h-4v3h3a1 1 0 0 0 1-1v-2zm-5 3v-3H6v3h4zm-5 0v-3H1v2a1 1 0 0 0 1 1h3zm-4-4h4V8H1v3zm0-4h4V4H1v3zm5-3v3h4V4H6zm4 4H6v3h4V8z"}}]})(n)}function dKt(n){const[e]=ue(),t=Ik(),{isCompanySettingsActive:i}=Ms(),r=Fo(),{includeRemoveAction:o,includeResetAction:s}=n,a=b8e(),l=Ti(),c=pu(),u=w.useRef(null),[d,h]=w.useState([]),[g,p]=w.useState(!1),[m,_]=w.useState([]),[v,b]=w.useState([]),{gateways:y,handleRemoveGateway:C,handleReset:x,onStatusChange:k}=lKt({currentGateways:d,setCurrentGateways:h}),I=()=>{_([]),u.current&&(u.current.checked=!1)},L=()=>v.every(O=>nr(O)!==Di.Active),D=O=>{var F;const B=Tpe(d,O.source.index,(F=O.destination)==null?void 0:F.index);r("settings.company_gateway_ids",B.map(({id:H})=>H).join(",")),h(B)},R=O=>{const B=JSON.parse(O.config);return hKt===O.gateway_key&&!B.account_id},P=O=>{l!=null&&l.settings.company_gateway_ids&&((l==null?void 0:l.settings).company_gateway_ids.split(",").length>1||i?r("settings.company_gateway_ids",d.filter(({id:F})=>!O.includes(F)).map(({id:F})=>F).join(",")):r("settings.company_gateway_ids","0"),p(!0))},M=[{value:"active",label:e("active"),color:"black",backgroundColor:"#e4e4e4"},{value:"archived",label:e("archived"),color:"white",backgroundColor:"#e6b05c"},{value:"deleted",label:e("deleted"),color:"white",backgroundColor:"#c95f53"}];return w.useEffect(()=>{g&&(c(g),p(!1))},[g]),w.useEffect(()=>{y&&h(y.filter(O=>O))},[y]),w.useEffect(()=>{if(y){const O=y.filter(B=>B&&m.includes(B.id));b(O)}},[m]),N("div",{className:"flex flex-col",children:[N("div",{className:"flex justify-between",children:[N("div",{className:"flex flex-col space-y-2 mt-2 lg:mt-0 lg:flex-row lg:items-center lg:space-x-4 lg:space-y-0",children:[N(Hp,{label:e("more_actions"),disabled:!m.length,children:[f(et,{onClick:()=>{a(m,"archive").then(()=>P(m)),I()},icon:f(Ve,{element:Xl}),children:e("archive")}),f(et,{onClick:()=>{a(m,"delete").then(()=>P(m)),I()},icon:f(Ve,{element:Pa}),children:e("delete")}),L()&&f(et,{onClick:()=>{a(m,"restore"),I()},icon:f(Ve,{element:Ql}),children:e("restore")})]}),f(b_,{styles:t,defaultValue:M[0],onChange:O=>k(O),placeholder:e("status"),options:M,isMulti:!0})]}),N("div",{className:"flex space-x-5",children:[s&&f(Ut,{behavior:"button",type:"secondary",onClick:x,children:e("reset")}),f(Ut,{to:"/settings/gateways/create",children:e("add_gateway")})]})]}),N(zw,{children:[N(Uw,{children:[f(la,{children:f(Nh,{innerRef:u,onChange:O=>{Array.from(document.querySelectorAll(".child-checkbox")).forEach(B=>{B.checked=O.target.checked,O.target.checked?_(F=>[...F,B.id]):_(F=>F.filter(H=>H!==B.id))})}})}),f(la,{children:e("status")}),f(la,{children:e("label")}),f(la,{children:e("test_mode")}),f(la,{disableUppercase:!0,children:f(du,{placement:"top",message:e("priority"),width:"auto",children:f(Ve,{element:uKt,color:"white",size:20})})})]}),f(Gj,{onDragEnd:D,children:f(Qj,{droppableId:"gateways-table",children:O=>N(jw,{...O.droppableProps,innerRef:O.innerRef,children:[d.map((B,F)=>f(Yj,{draggableId:F.toString(),index:F,children:H=>w.createElement(zl,{...H.draggableProps,...H.dragHandleProps,innerRef:H.innerRef,key:F},f(eo,{width:"10%",children:f(Nh,{checked:m.includes(B.id),className:"child-checkbox",value:B.id,id:B.id,onValueChange:V=>m.includes(V)?_($=>$.filter(j=>j!==V)):_($=>[...$,V])})}),f(eo,{width:"30%",children:f(zp,{entity:B})}),f(eo,{width:o?"30%":"35%",children:N("div",{className:"flex items-center space-x-2",children:[f(Ii,{to:dt("/settings/gateways/:id/edit?tab=:tab",{id:B.id,tab:R(B)?1:0}),children:B.label}),R(B)&&f(du,{message:e("stripe_connect_migration_title"),width:"auto",placement:"top",children:N("div",{className:"flex space-x-2",children:[f(V1,{color:"red",size:22}),f(V1,{color:"red",size:22})]})})]})}),f(eo,{width:o?"20%":"25%",children:B.test_mode?f(Zde,{size:20}):""}),f(eo,{width:"25%",children:N("div",{className:"flex items-center space-x-7 py-1",children:[o&&f(Ut,{behavior:"button",type:"minimal",onClick:()=>C(B.id),children:e("remove")}),f(Ve,{element:R5e,size:25})]})}))},F)),d.length?f(w.Fragment,{}):f(zl,{children:N(eo,{colSpan:100,children:[e("no_records_found"),"."]})}),O.placeholder]})})})]})]})}const hKt="d14dd26a47cecc30fdd65700bfb67b34";function fKt(){const{isGroupSettingsActive:n,isClientSettingsActive:e}=Ms();return f(dKt,{includeRemoveAction:n||e,includeResetAction:n||e})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function jVe(n){return ai(["/api/v1/payment_terms",n],()=>Te("GET",ye("/api/v1/payment_terms?per_page=:perPage&page=:currentPage&sort=:sort",{perPage:n.perPage??1e3,currentPage:n.currentPage,sort:n.sort??"id|asc"})),{staleTime:1/0})}function gKt(n){return ai(["/api/v1/payment_terms",n],()=>Te("GET",ye("/api/v1/payment_terms/:id",n),{headers:fx()}),{staleTime:1/0})}function Ipe(n,e){return Te("POST",ye("/api/v1/payment_terms/bulk"),{action:e,ids:n})}function pKt(){const{isAdmin:n}=ao();return ai(["/api/v1/payment_terms/create"],()=>Te("GET",ye("/api/v1/payment_terms/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function mKt(){var _,v,b,y,C;gi("online_payments");const[n]=ue(),e=Ci(),t=Zs(),{isCompanySettingsActive:i}=Ms(),{data:r}=Nd(),o=[{name:n("settings"),href:"/settings"},{name:n("online_payments"),href:"/settings/online_payments"}],[s,a]=w.useState(),{data:l}=jVe({}),c=ki(Ss),u=bc(),d=$7e(),h=Fo(),g=pu(),p=vf(),m=(x,k)=>{e(Vr({object:"company",property:x,value:k}))};return w.useEffect(()=>{l&&a(l.data.data)},[l]),N($i,{title:n("online_payments"),breadcrumbs:o,docsLink:"en/basic-settings/#online_payments",onSaveClick:g,onCancelClick:p,children:[f(fKt,{}),N(Ot,{title:n("settings"),children:[f(U,{leftSide:f(bt,{propertyKey:"auto_bill_standard_invoices",labelElement:f(yt,{label:n("auto_bill_standard_invoices"),helpLabel:n("auto_bill_standard_invoices_help")}),defaultValue:!1}),children:f(gt,{checked:!!((_=u==null?void 0:u.settings)!=null&&_.auto_bill_standard_invoices),onChange:x=>h("settings.auto_bill_standard_invoices",x),disabled:t("auto_bill_standard_invoices")})}),f(U,{leftSide:f(bt,{propertyKey:"auto_bill",labelElement:f(yt,{label:`${n("auto_bill")} ${n("recurring_invoices")}`}),defaultValue:"off"}),children:N(nn,{value:(u==null?void 0:u.settings.auto_bill)||"off",onChange:d,id:"settings.auto_bill",disabled:t("auto_bill"),errorMessage:c==null?void 0:c.errors["settings.auto_bill"],children:[N("option",{value:"always",children:[n("enabled")," (",n("auto_bill_help_always"),")"]}),N("option",{value:"optout",children:[n("optout")," (",n("auto_bill_help_optout"),")"]}),N("option",{value:"optin",children:[n("optin")," (",n("auto_bill_help_optin"),")"]}),N("option",{value:"off",children:[n("disabled")," (",n("auto_bill_help_off"),")"]})]})}),f(U,{leftSide:f(bt,{propertyKey:"auto_bill_date",labelElement:f(yt,{label:n("auto_bill_on"),helpLabel:n("auto_bill_on_help")}),defaultValue:"on_send_date"}),children:N(nn,{id:"settings.auto_bill_date",value:(u==null?void 0:u.settings.auto_bill_date)||"on_send_date",onChange:d,disabled:t("auto_bill_date"),errorMessage:c==null?void 0:c.errors["settings.auto_bill_date"],children:[f("option",{value:"on_send_date",children:n("send_date")}),f("option",{value:"on_due_date",children:n("due_date")})]})}),f(U,{leftSide:f(bt,{propertyKey:"use_credits_payment",labelElement:f(yt,{label:n("use_available_credits"),helpLabel:n("use_available_credits_help")}),defaultValue:"off"}),children:N(nn,{value:(u==null?void 0:u.settings.use_credits_payment)||"off",id:"settings.use_credits_payment",onChange:d,disabled:t("use_credits_payment"),errorMessage:c==null?void 0:c.errors["settings.use_credits_payment"],children:[f("option",{value:"always",children:n("enabled")}),f("option",{value:"option",children:n("show_option")}),f("option",{value:"off",children:n("off")})]})}),f(U,{leftSide:f(bt,{propertyKey:"use_unapplied_payment",labelElement:f(yt,{label:n("use_unapplied_payments"),helpLabel:n("use_unapplied_payments_help")}),defaultValue:"off"}),children:N(nn,{value:(u==null?void 0:u.settings.use_unapplied_payment)||"off",id:"settings.use_unapplied_payment",onChange:d,disabled:t("use_unapplied_payment"),errorMessage:c==null?void 0:c.errors["settings.use_unapplied_payment"],children:[f("option",{value:"always",children:n("enabled")}),f("option",{value:"option",children:n("show_option")}),f("option",{value:"off",children:n("off")})]})}),s&&N(_t,{children:[f(U,{leftSide:f(bt,{propertyKey:"payment_terms",labelElement:f(yt,{label:n("payment_terms"),helpLabel:n("payment_terms_help")})}),children:N(nn,{value:((v=u==null?void 0:u.settings)==null?void 0:v.payment_terms)||"",id:"settings.payment_terms",onChange:d,disabled:t("payment_terms"),errorMessage:c==null?void 0:c.errors["settings.payment_terms"],children:[f("option",{value:""}),s.map(x=>f("option",{value:x.num_days,children:x.name},x.id))]})}),f(U,{className:"py-0 sm:py-0",children:f(Ii,{to:"/settings/payment_terms",children:n("configure_payment_terms")})})]}),f(U,{leftSide:f(bt,{propertyKey:"payment_type_id",labelElement:f(yt,{label:n("payment_type"),helpLabel:n("payment_type_help")})}),children:f(nn,{value:((b=u==null?void 0:u.settings)==null?void 0:b.payment_type_id)||"0",onChange:d,id:"settings.payment_type_id",blankOptionValue:"0",disabled:t("payment_type_id"),withBlank:!0,errorMessage:c==null?void 0:c.errors["settings.payment_type_id"],children:r==null?void 0:r.payment_types.map(x=>f("option",{value:x.id,children:x.name},x.id))})}),f(U,{leftSide:f(bt,{propertyKey:"valid_until",labelElement:f(yt,{label:n("quote_valid_until"),helpLabel:n("quote_valid_until_help")})}),children:f(nn,{value:((y=u==null?void 0:u.settings)==null?void 0:y.valid_until)||"",id:"settings.valid_until",onChange:d,disabled:t("valid_until"),withBlank:!0,errorMessage:c==null?void 0:c.errors["settings.valid_until"],children:s==null?void 0:s.map(x=>f("option",{value:x.num_days,children:x.name},x.id))})}),f(U,{leftSide:f(bt,{propertyKey:"default_expense_payment_type_id",labelElement:f(yt,{label:n("expense_payment_type"),helpLabel:n("expense_payment_type_help")})}),children:f(nn,{value:((C=u==null?void 0:u.settings)==null?void 0:C.default_expense_payment_type_id)||"",onChange:d,disabled:t("default_expense_payment_type_id"),id:"settings.default_expense_payment_type_id",blankOptionValue:"0",withBlank:!0,errorMessage:c==null?void 0:c.errors["settings.default_expense_payment_type_id"],children:r==null?void 0:r.payment_types.map(x=>f("option",{value:x.id,children:x.name},x.id))})}),f(U,{leftSideHelp:n("manual_payment_email_help"),leftSide:f(bt,{propertyKey:"client_manual_payment_notification",labelElement:f(yt,{label:n("manual_payment_email")}),defaultValue:!1}),children:f(gt,{checked:!!(u!=null&&u.settings.client_manual_payment_notification),onChange:x=>m("settings.client_manual_payment_notification",x),disabled:t("client_manual_payment_notification")})}),f(U,{leftSideHelp:n("online_payment_email_help"),leftSide:f(bt,{propertyKey:"client_online_payment_notification",labelElement:f(yt,{label:n("online_payment_email")}),defaultValue:!1}),children:f(gt,{checked:!!(u!=null&&u.settings.client_online_payment_notification),onChange:x=>m("settings.client_online_payment_notification",x),disabled:t("client_online_payment_notification")})}),f(U,{leftSide:f(bt,{propertyKey:"send_email_on_mark_paid",labelElement:f(yt,{label:n("mark_paid_payment_email"),helpLabel:n("mark_paid_payment_email_help")}),defaultValue:!1}),children:f(gt,{checked:!!(u!=null&&u.settings.send_email_on_mark_paid),onChange:x=>m("settings.send_email_on_mark_paid",x),disabled:t("send_email_on_mark_paid")})}),i&&f(U,{leftSide:n("enable_applying_payments"),leftSideHelp:n("enable_applying_payments_help"),children:f(gt,{id:"allow_over_payment",checked:!!(u!=null&&u.enable_applying_payments),onChange:x=>h("enable_applying_payments",x)})}),f(U,{leftSide:f(bt,{propertyKey:"client_portal_allow_over_payment",labelElement:f(yt,{label:n("allow_over_payment")}),defaultValue:!1}),leftSideHelp:n("allow_over_payment_help"),children:f(gt,{id:"allow_over_payment",checked:!!(u!=null&&u.settings.client_portal_allow_over_payment),onChange:x=>h("settings.client_portal_allow_over_payment",x),disabled:t("client_portal_allow_over_payment")})}),f(U,{leftSide:f(bt,{propertyKey:"client_portal_allow_under_payment",labelElement:f(yt,{label:n("allow_under_payment")}),defaultValue:!1}),leftSideHelp:n("allow_under_payment_help"),children:f(gt,{id:"allow_under_payment",checked:!!(u!=null&&u.settings.client_portal_allow_under_payment),onChange:x=>h("settings.client_portal_allow_under_payment",x),disabled:t("client_portal_allow_under_payment")})}),(u==null?void 0:u.settings.client_portal_allow_under_payment)&&f(U,{leftSide:f(bt,{propertyKey:"client_portal_under_payment_minimum",labelElement:f(yt,{label:n("minimum_under_payment_amount")})}),children:f(ke,{type:"number",value:(u==null?void 0:u.settings.client_portal_under_payment_minimum)||"",onValueChange:x=>h("settings.client_portal_under_payment_minimum",parseFloat(x)||0),disabled:t("client_portal_under_payment_minimum"),errorMessage:c==null?void 0:c.errors["settings.client_portal_under_payment_minimum"]})}),f(U,{leftSide:f(bt,{propertyKey:"client_initiated_payments",labelElement:f(yt,{label:n("client_initiated_payments")}),defaultValue:!1}),leftSideHelp:n("client_initiated_payments_help"),children:f(gt,{id:"client_initiated_payments",checked:!!(u!=null&&u.settings.client_initiated_payments),onChange:x=>h("settings.client_initiated_payments",x),disabled:t("client_initiated_payments")})}),(u==null?void 0:u.settings.client_initiated_payments)&&f(U,{leftSide:f(bt,{propertyKey:"client_initiated_payments_minimum",labelElement:f(yt,{label:n("minimum_payment_amount")})}),children:f(ke,{type:"number",value:(u==null?void 0:u.settings.client_initiated_payments_minimum)||"",onValueChange:x=>h("settings.client_initiated_payments_minimum",parseFloat(x)),disabled:t("client_initiated_payments_minimum"),errorMessage:c==null?void 0:c.errors["settings.client_initiated_payments_minimum"]})}),f(U,{leftSide:f(bt,{propertyKey:"payment_email_all_contacts",labelElement:f(yt,{label:n("payment_email_all_contacts")}),defaultValue:!1}),leftSideHelp:n("payment_email_all_contacts_help"),children:f(gt,{id:"payment_email_all_contacts",checked:!!(u!=null&&u.settings.payment_email_all_contacts),onChange:x=>h("settings.payment_email_all_contacts",x),disabled:t("payment_email_all_contacts")})})]})]})}function pTe(n){var u,d,h;const[e]=ue(),t=Ti(),i=Fo(),r=Zs(),{title:o}=n,s=ki(Ss),{data:a}=w8e({perPage:100,status:["active"]}),l=g=>{const p=g.target.options[g.target.selectedIndex];i(g.target.id,parseFloat(p.dataset.rate||"0")),i(p.dataset.rateName,g.target.value)},c=g=>{const p=Bn.cloneDeep(t==null?void 0:t.settings);delete p[g],i("settings",p)};return f(_t,{children:(t==null?void 0:t.enabled_tax_rates)>0&&N(Ot,{title:o?e(o):void 0,children:[(t==null?void 0:t.enabled_tax_rates)>0&&f(U,{leftSide:f(bt,{propertyKey:"tax_name1",labelElement:f(yt,{label:e("default_tax_rate")}),onCheckboxChange:g=>{g?i("settings.tax_rate1",0):c("tax_rate1")}}),children:N(nn,{id:"settings.tax_rate1",onChange:l,value:((u=t==null?void 0:t.settings)==null?void 0:u.tax_name1)||0,disabled:r("tax_name1"),errorMessage:s==null?void 0:s.errors["settings.tax_rate1"],children:[f("option",{"data-rate":0,"data-rate-name":"settings.tax_name1",value:"0"}),a&&a.data.data.map(g=>N("option",{"data-rate":g.rate,"data-rate-name":"settings.tax_name1",value:g.name,children:[g.rate,"% — ",g.name]},g.id))]})}),(t==null?void 0:t.enabled_tax_rates)>1&&f(U,{leftSide:f(bt,{propertyKey:"tax_name2",labelElement:f(yt,{label:e("default_tax_rate")}),onCheckboxChange:g=>{g?i("settings.tax_rate2",0):c("tax_rate2")}}),children:N(nn,{id:"settings.tax_rate2",onChange:l,value:((d=t==null?void 0:t.settings)==null?void 0:d.tax_name2)||0,disabled:r("tax_name2"),errorMessage:s==null?void 0:s.errors["settings.tax_rate2"],children:[f("option",{"data-rate":0,"data-rate-name":"settings.tax_name2",value:"0"}),a&&a.data.data.map(g=>N("option",{"data-rate":g.rate,"data-rate-name":"settings.tax_name2",value:g.name,children:[g.rate,"% — ",g.name]},g.id))]})}),(t==null?void 0:t.enabled_tax_rates)>2&&f(U,{leftSide:f(bt,{propertyKey:"tax_name3",labelElement:f(yt,{label:e("default_tax_rate")}),onCheckboxChange:g=>{g?i("settings.tax_rate3",0):c("tax_rate3")}}),children:N(nn,{id:"settings.tax_rate3",onChange:l,value:((h=t==null?void 0:t.settings)==null?void 0:h.tax_name3)||0,disabled:r("tax_name3"),errorMessage:s==null?void 0:s.errors["settings.tax_rate3"],children:[f("option",{"data-rate":0,"data-rate-name":"settings.tax_name3",value:"0"}),a&&a.data.data.map(g=>N("option",{"data-rate":g.rate,"data-rate-name":"settings.tax_name3",value:g.name,children:[g.rate,"% — ",g.name]},g.id))]})})]})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function _Kt(){const n=vk();return new Date(n==null?void 0:n.plan_expires)>new Date&&(ql()||Wp()),t3()}function Lpe(n){const[e]=ue(),{visible:t,setVisible:i,region:r,subregion:o,taxSetting:s}=n,a=Fo(),l=()=>{i(!1)};return N(cr,{title:`${r} - ${o}`,visible:t,onClose:l,children:[f(ke,{label:e("tax_name"),value:s.tax_name,onValueChange:c=>a(`tax_data.regions.${r}.subregions.${o}.tax_name`,c)}),f(ke,{type:"number",label:e("tax_rate"),value:s.tax_rate,onValueChange:c=>a(`tax_data.regions.${r}.subregions.${o}.tax_rate`,parseFloat(c))}),f(ke,{type:"number",label:e("reduced_rate"),value:s.reduced_tax_rate,onValueChange:c=>a(`tax_data.regions.${r}.subregions.${o}.reduced_tax_rate`,parseFloat(c))}),f(Ut,{className:"self-end",behavior:"button",onClick:l,disableWithoutIcon:!0,children:e("save")})]})}function vKt(){const[n]=ue(),e=Fo(),t=Ti(),[i,r]=w.useState(!1),[o,s]=w.useState(!1),a=Object.entries(t.tax_data.regions.AU.subregions),[l,c]=w.useState(a[0][1]),[u,d]=w.useState(a[0][0]),h=w.useMemo(()=>a.filter(([,m])=>m.apply_tax).length,[a]),g=(m,_)=>{e(m,_),r(!_)},p=m=>{const _=document.getElementById(m.replace(".apply_tax",""));_==null||_.click()};return N(_t,{children:[f(U,{leftSide:"Australia",children:N("div",{className:"grid grid-cols-5 gap-4",children:[f("div",{className:"col-span-4",children:N(nn,{id:"tax_data.regions.AU.tax_all_subregions",className:"",value:t.tax_data.regions.AU.tax_all_subregions,onValueChange:m=>g("tax_data.regions.AU.tax_all_subregions",m==="true"),children:[f("option",{value:"true",children:n("tax_all")}),N("option",{value:"false",children:[n("tax_selected")," - [ ",h," ",n("selected")," ]"]})]})}),!t.tax_data.regions.AU.tax_all_subregions&&f("div",{className:"flex col-span-1 col-start-5 col-end-6 justify-end",children:f(Ut,{type:"primary",className:"",onClick:m=>{m.preventDefault(),r(_=>!_)},children:n(i?"hide":"show")})})]})},"AU"),i&&(a==null?void 0:a.map((m,_)=>N("div",{className:"border py-4 sm:py-3 sm:grid sm:grid-cols-3 sm:gap-10 flex flex-col lg:flex-row undefined px-5 sm:px-6 lg:items-center",children:[N("div",{className:"flex col-span-1 items-center justify-start pl-5",onClick:()=>p(`tax_data.regions.AU.subregions.${m[0]}.apply_tax`),children:[f(Nh,{id:`tax_data.regions.AU.subregions.${m[0]}`,value:`tax_data.regions.AU.subregions.${m[0]}.apply_tax`,checked:!!m[1].apply_tax,className:"flex justify-end h-6 w-6 rounded-half shadow",disabled:t.tax_data.regions.AU.tax_all_subregions,onValueChange:(v,b)=>e(v,b)}),f("div",{className:"",children:m[0]})]}),N("div",{onClick:()=>p(`tax_data.regions.AU.subregions.${m[0]}.apply_tax`),children:[m[1].tax_name," ",m[1].tax_rate,"%"," ",m[1].reduced_tax_rate?` :: ${n("reduced_rate")} ${m[1].reduced_tax_rate}%`:""]}),f("div",{className:"flex justify-end",children:f(Ut,{type:"primary",className:"",disableWithoutIcon:!0,disabled:t.tax_data.regions.AU.tax_all_subregions,onClick:v=>{v.preventDefault(),c(m[1]),d(m[0]),s(!0)},children:n("edit")})})]},_))),f(Lpe,{visible:o,setVisible:s,region:"AU",subregion:u,taxSetting:l})]})}function bKt(){const[n]=ue(),e=Fo(),t=Ti(),[i,r]=w.useState(!1),[o,s]=w.useState(!1),a=Object.entries(t.tax_data.regions.EU.subregions),[l,c]=w.useState(a[0][1]),[u,d]=w.useState(a[0][0]),h=_=>!!_,g=w.useMemo(()=>a.filter(([,_])=>h(_.apply_tax)).length,[a]),p=(_,v)=>{e(_,v),r(!v)},m=_=>{const v=document.getElementById(_.replace(".apply_tax",""));v==null||v.click()};return N(_t,{children:[f(U,{leftSide:"Europe",children:N("div",{className:"grid grid-cols-5 gap-4",children:[f("div",{className:"col-span-4",children:N(nn,{id:"tax_data.regions.EU.tax_all_subregions",className:"",value:t.tax_data.regions.EU.tax_all_subregions,onValueChange:_=>p("tax_data.regions.EU.tax_all_subregions",_==="true"),children:[f("option",{value:"true",children:n("tax_all")}),N("option",{value:"false",children:[n("tax_selected")," - [ ",g," ",n("selected")," ]"]})]})}),!t.tax_data.regions.EU.tax_all_subregions&&f("div",{className:"flex col-span-1 col-start-5 col-end-6 justify-end",children:f(Ut,{type:"primary",className:"",onClick:_=>{_.preventDefault(),r(v=>!v)},children:n(i?"hide":"show")})})]})},"EU"),i&&(a==null?void 0:a.map((_,v)=>N("div",{className:"border py-4 sm:py-3 sm:grid sm:grid-cols-3 sm:gap-10 flex flex-col lg:flex-row undefined px-5 sm:px-6 lg:items-center",children:[N("div",{className:"flex col-span-1 items-center justify-start pl-5",onClick:()=>m(`tax_data.regions.EU.subregions.${_[0]}.apply_tax`),children:[f(Nh,{id:`tax_data.regions.EU.subregions.${_[0]}`,value:`tax_data.regions.EU.subregions.${_[0]}.apply_tax`,checked:!!_[1].apply_tax,className:"flex justify-end h-6 w-6 rounded-half shadow",disabled:t.tax_data.regions.EU.tax_all_subregions,onValueChange:(b,y)=>e(b,y)}),f("div",{className:"",children:_[0]})]}),N("div",{onClick:()=>m(`tax_data.regions.EU.subregions.${_[0]}.apply_tax`),children:[_[1].tax_name," ",_[1].tax_rate,"%"," ",_[1].reduced_tax_rate?` :: ${n("reduced_rate")} ${_[1].reduced_tax_rate}%`:""]}),f("div",{className:"flex justify-end",children:f(Ut,{type:"primary",className:"",disableWithoutIcon:!0,disabled:t.tax_data.regions.EU.tax_all_subregions,onClick:b=>{b.preventDefault(),c(_[1]),d(_[0]),s(!0)},children:n("edit")})})]},v))),f(Lpe,{visible:o,setVisible:s,region:"EU",subregion:u,taxSetting:l})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const yKt={AL:"Alabama",AK:"Alaska",AZ:"Arizona",AR:"Arkansas",CA:"California",CO:"Colorado",CT:"Connecticut",DE:"Delaware",DC:"District Of Columbia",FL:"Florida",GA:"Georgia",HI:"Hawaii",ID:"Idaho",IL:"Illinois",IN:"Indiana",IA:"Iowa",KS:"Kansas",KY:"Kentucky",LA:"Louisiana",ME:"Maine",MD:"Maryland",MA:"Massachusetts",MI:"Michigan",MN:"Minnesota",MS:"Mississippi",MO:"Missouri",MT:"Montana",NE:"Nebraska",NV:"Nevada",NH:"New Hampshire",NJ:"New Jersey",NM:"New Mexico",NY:"New York",NC:"North Carolina",ND:"North Dakota",OH:"Ohio",OK:"Oklahoma",OR:"Oregon",PA:"Pennsylvania",RI:"Rhode Island",SC:"South Carolina",SD:"South Dakota",TN:"Tennessee",TX:"Texas",UT:"Utah",VT:"Vermont",VA:"Virginia",WA:"Washington",WV:"West Virginia",WI:"Wisconsin",WY:"Wyoming"};function CKt(n){return f(nn,{value:n.value,onValueChange:n.onChange,label:n.label,withBlank:!0,children:Object.entries(yKt).map((e,t)=>f("option",{value:e[0],children:e[1]},t))})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Dpe(){const{data:n}=Nd(),[e,t]=w.useState([]);return w.useEffect(()=>{n!=null&&n.countries&&t(n.countries)},[n]),e}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function dA(){const n=Dpe();return e=>n.find(t=>t.id==e)}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const UVe={AT:"Austria",BE:"Belgium",BG:"Bulgaria",HR:"Croatia",CY:"Cyprus",CZ:"Czech Republic",DK:"Denmark",EE:"Estonia",FI:"Finland",FR:"France",DE:"Germany",GR:"Greece",HU:"Hungary",IE:"Ireland",IT:"Italy",LV:"Latvia",LT:"Lithuania",LU:"Luxembourg",MT:"Malta",NL:"Netherlands",PL:"Poland",PT:"Portugal",RO:"Romania",SK:"Slovakia",SI:"Slovenia",ES:"Spain",SE:"Sweden"};function wKt(n){return f(nn,{value:n.value,onValueChange:n.onChange,label:n.label,withBlank:!0,children:Object.entries(UVe).map((e,t)=>f("option",{value:e[0],children:e[1]},t))})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function SKt(){const n=Dpe();return e=>{const t=n.find(i=>i.id===e);return!!(t&&UVe[t.iso_3166_2])}}function EKt(){var o,s,a,l,c,u;const[n]=ue(),e=Ti(),t=Fo(),i=dA(),r=SKt();return w.useEffect(()=>{(e==null?void 0:e.settings.country_id)==="36"&&t("tax_data.seller_subregion","AU")},[e==null?void 0:e.settings.country_id,e.tax_data.seller_subregion]),N(U,{leftSide:n("seller_subregion"),children:[((o=i(e==null?void 0:e.settings.country_id))==null?void 0:o.iso_3166_2)==="US"&&f(CKt,{value:(s=e.tax_data)==null?void 0:s.seller_subregion,onChange:d=>t("tax_data.seller_subregion",d)}),r(e==null?void 0:e.settings.country_id)&&f(wKt,{value:(a=e.tax_data)!=null&&a.seller_subregion?(l=e.tax_data)==null?void 0:l.seller_subregion:(c=i(e==null?void 0:e.settings.country_id))==null?void 0:c.iso_3166_2,onChange:d=>t("tax_data.seller_subregion",d)}),((u=i(e==null?void 0:e.settings.country_id))==null?void 0:u.iso_3166_2)==="AU"&&f(ke,{type:"text",disabled:!0,name:"tax_data.seller_subregion",value:"AU"})]})}function xKt(){const[n]=ue(),e=Fo(),t=Ti(),[i,r]=w.useState(!1),[o,s]=w.useState(!1),a=Object.entries(t.tax_data.regions.US.subregions),[l,c]=w.useState(a[0][1]),[u,d]=w.useState(a[0][0]),h=_=>!!_,g=w.useMemo(()=>a.filter(([,_])=>h(_.apply_tax)).length,[a]),p=(_,v)=>{e(_,v),r(!v)},m=_=>{const v=document.getElementById(_.replace(".apply_tax",""));v==null||v.click()};return N(_t,{children:[f(U,{leftSide:n("united_states"),children:N("div",{className:"grid grid-cols-5 gap-4",children:[f("div",{className:"col-span-4",children:N(nn,{id:"tax_data.regions.US.tax_all_subregions",className:"",value:t.tax_data.regions.US.tax_all_subregions,onValueChange:_=>p("tax_data.regions.US.tax_all_subregions",_==="true"),children:[f("option",{value:"true",children:n("tax_all")}),N("option",{value:"false",children:[n("tax_selected")," - [ ",g," ",n("selected")," ]"]})]})}),!t.tax_data.regions.US.tax_all_subregions&&f("div",{className:"flex col-span-1 col-start-5 col-end-6 justify-end",children:f(Ut,{type:"primary",className:"",onClick:_=>{_.preventDefault(),r(v=>!v)},children:n(i?"hide":"show")})})]})},"US"),i&&(a==null?void 0:a.map((_,v)=>N("div",{className:"border py-4 sm:py-3 sm:grid sm:grid-cols-3 sm:gap-10 flex flex-col lg:flex-row undefined px-5 sm:px-6 lg:items-center",children:[N("div",{className:"flex col-span-1 items-center justify-start pl-5",onClick:()=>m(`tax_data.regions.US.subregions.${_[0]}.apply_tax`),children:[f(Nh,{id:`tax_data.regions.US.subregions.${_[0]}`,value:`tax_data.regions.US.subregions.${_[0]}.apply_tax`,checked:!!_[1].apply_tax,className:"flex justify-end h-6 w-6 rounded-half shadow",disabled:t.tax_data.regions.US.tax_all_subregions,onValueChange:(b,y)=>e(b,y)}),f("div",{className:"",children:_[0]})]}),N("div",{onClick:()=>m(`tax_data.regions.US.subregions.${_[0]}.apply_tax`),children:[_[1].tax_name," ",_[1].tax_rate,"%"," ",_[1].reduced_tax_rate?` :: ${n("reduced_rate")} ${_[1].reduced_tax_rate}%`:""]}),f("div",{className:"flex justify-end",children:f(Ut,{type:"primary",className:"",disableWithoutIcon:!0,disabled:t.tax_data.regions.US.tax_all_subregions,onClick:b=>{b.preventDefault(),c(_[1]),d(_[0]),s(!0)},children:n("edit")})})]},v))),f(Lpe,{visible:o,setVisible:s,region:"US",subregion:u,taxSetting:l})]})}function kKt(){return N(_t,{children:[f(EKt,{}),f(xKt,{}),f(bKt,{}),f(vKt,{})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function TKt(){const n=["AU","US","AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GR","HR","HU","IE","IT","LT","LU","LV","MT","NL","PL","PT","RO","SE","SI","SK"],e=dA();return t=>{var i;return n.includes(((i=e(t))==null?void 0:i.iso_3166_2)||"")}}function IKt(){var g;const[n]=ue(),e=[{name:n("settings"),href:"/settings"},{name:n("tax_settings"),href:"/settings/tax_settings"}];bc(),gi("tax_settings"),_Kt();const t=TKt(),{isCompanySettingsActive:i,isGroupSettingsActive:r,isClientSettingsActive:o}=Ms(),s=ki(Ss),a=Ci(),l=Ti(),c=p=>{a(Vr({object:"company",property:p.target.id,value:p.target.value}))},u=(p,m)=>{a(Vr({object:"company",property:p,value:m}))},d=pu(),h=vf();return N($i,{onSaveClick:d,onCancelClick:h,title:n("tax_settings"),breadcrumbs:e,docsLink:"en/basic-settings/#tax_settings",children:[i&&N(_t,{children:[N(Ot,{title:n("tax_settings"),children:[f(U,{leftSide:n("invoice_tax_rates"),children:N(nn,{id:"enabled_tax_rates",onChange:c,value:(l==null?void 0:l.enabled_tax_rates)||0,errorMessage:s==null?void 0:s.errors.enabled_tax_rates,children:[f("option",{value:"0",children:n("disabled")}),f("option",{value:"1",children:n("one_tax_rate")}),f("option",{value:"2",children:n("two_tax_rates")}),f("option",{value:"3",children:n("three_tax_rates")})]})}),f(U,{leftSide:n("line_item_tax_rates"),children:N(nn,{id:"enabled_item_tax_rates",onChange:c,value:(l==null?void 0:l.enabled_item_tax_rates)||0,errorMessage:s==null?void 0:s.errors.enabled_item_tax_rates,children:[f("option",{value:"0",children:n("disabled")}),f("option",{value:"1",children:n("one_tax_rate")}),f("option",{value:"2",children:n("two_tax_rates")}),f("option",{value:"3",children:n("three_tax_rates")})]})}),f(U,{leftSide:n("expense_tax_rates"),children:N(nn,{id:"enabled_expense_tax_rates",onChange:c,value:(l==null?void 0:l.enabled_expense_tax_rates)||0,errorMessage:s==null?void 0:s.errors.enabled_expense_tax_rates,children:[f("option",{value:"0",children:n("disabled")}),f("option",{value:"1",children:n("one_tax_rate")}),f("option",{value:"2",children:n("two_tax_rates")}),f("option",{value:"3",children:n("three_tax_rates")})]})}),f(U,{leftSide:n("inclusive_taxes"),children:N("div",{className:"flex items-center space-x-7",children:[f(gt,{onChange:p=>u("settings.inclusive_taxes",p),checked:!!(l!=null&&l.settings.inclusive_taxes),cypressRef:"inclusiveTaxToggle"}),l!=null&&l.settings.inclusive_taxes?N("span",{children:[n("inclusive"),": 100 + 10% = 90.91 + 9.09"]}):N("span",{children:[n("exclusive"),": 100 + 10% = 100 + 10"]})]})}),t((g=l==null?void 0:l.settings)==null?void 0:g.country_id)&&N(_t,{children:[f(Jn,{}),f(U,{leftSide:n("calculate_taxes"),leftSideHelp:n("calculate_taxes_help"),children:f(gt,{checked:!!(l!=null&&l.calculate_taxes),onChange:p=>u("calculate_taxes",p)})}),l.calculate_taxes&&f(kKt,{})]})]}),f(pTe,{})]}),(r||o)&&f(pTe,{title:"tax_settings"}),f(nrn,{})]})}function LKt(){const[n]=ue(),e=[{name:n("settings"),href:"/settings"},{name:n("product_settings"),href:"/settings/product_settings"}];bc(),gi("product_settings");const t=ki(Ss),i=Ci(),r=Ti(),o=(c,u)=>{i(Vr({object:"company",property:c,value:u}))},s=Fo(),a=pu(),l=vf();return f($i,{onSaveClick:a,onCancelClick:l,title:n("product_settings"),breadcrumbs:e,docsLink:"en/basic-settings/#product_settings",children:N(Ot,{title:n("Settings"),children:[f(U,{leftSide:n("track_inventory"),leftSideHelp:n("track_inventory_help"),children:f(gt,{checked:r==null?void 0:r.track_inventory,onChange:c=>o("track_inventory",c)})}),f(U,{leftSide:n("stock_notifications"),leftSideHelp:n("stock_notifications_help"),children:f(gt,{checked:r==null?void 0:r.stock_notification,onChange:c=>o("stock_notification",c)})}),(r==null?void 0:r.stock_notification)===!0?f(_t,{children:f(U,{leftSide:n("notification_threshold"),children:f(ke,{type:"number",onValueChange:c=>s("inventory_notification_threshold",parseFloat(c)),value:(r==null?void 0:r.inventory_notification_threshold)||"",errorMessage:t==null?void 0:t.errors.inventory_notification_threshold})})}):"",f(Jn,{}),f(U,{leftSide:n("show_product_discount"),leftSideHelp:n("show_product_discount_help"),children:f(gt,{checked:r==null?void 0:r.enable_product_discount,onChange:c=>o("enable_product_discount",c)})}),f(U,{leftSide:n("show_product_cost"),leftSideHelp:n("show_cost_help"),children:f(gt,{checked:r==null?void 0:r.enable_product_cost,onChange:c=>o("enable_product_cost",c)})}),f(U,{leftSide:n("show_product_quantity"),leftSideHelp:n("show_product_quantity_help"),children:f(gt,{checked:r==null?void 0:r.enable_product_quantity,onChange:c=>o("enable_product_quantity",c)})}),f(U,{leftSide:n("default_quantity"),leftSideHelp:n("default_quantity_help"),children:f(gt,{checked:r==null?void 0:r.default_quantity,onChange:c=>o("default_quantity",c)})}),f(Jn,{}),f(U,{leftSide:n("fill_products"),leftSideHelp:n("fill_products_help"),children:f(gt,{checked:r==null?void 0:r.fill_products,onChange:c=>o("fill_products",c)})}),f(U,{leftSide:n("update_products"),leftSideHelp:n("update_products_help"),children:f(gt,{checked:r==null?void 0:r.update_products,onChange:c=>o("update_products",c)})}),f(U,{leftSide:n("convert_products"),leftSideHelp:n("convert_products_help"),children:f(gt,{checked:r==null?void 0:r.convert_products,onChange:c=>o("convert_products",c)})})]})})}function DKt(){var g,p,m,_,v,b,y,C;gi("task_settings");const[n]=ue();bc();const e=Ci(),t=vf(),i=pu(),r=Zs(),o=Fo(),s=Ti(),a=ki(Ss),{isCompanySettingsActive:l}=Ms(),c=[{name:n("settings"),href:"/settings"},{name:n("task_settings"),href:"/settings/task_settings"}],u=()=>{var x;return((x=s==null?void 0:s.settings)==null?void 0:x.task_round_to_nearest)===-1||![1,60,300,900,1800,3600,86400].find(k=>{var I;return k===((I=s==null?void 0:s.settings)==null?void 0:I.task_round_to_nearest)})},d=x=>e(Vr({object:"company",property:x.target.id,value:x.target.value})),h=(x,k)=>e(Vr({object:"company",property:x,value:k}));return N($i,{onSaveClick:i,onCancelClick:t,title:n("task_settings"),breadcrumbs:c,docsLink:"en/basic-settings/#task_settings",children:[N(Ot,{title:n("settings"),children:[f(U,{leftSide:f(bt,{propertyKey:"default_task_rate",labelElement:f(yt,{label:n("default_task_rate")})}),children:f(ke,{type:"number",id:"settings.default_task_rate",onChange:d,value:((g=s==null?void 0:s.settings)==null?void 0:g.default_task_rate)||"",disabled:r("default_task_rate"),errorMessage:a==null?void 0:a.errors["settings.default_task_rate"]})}),l&&f(U,{leftSide:n("auto_start_tasks"),leftSideHelp:n("auto_start_tasks_help"),children:f(gt,{checked:!!(s!=null&&s.auto_start_tasks),onChange:x=>h("auto_start_tasks",x)})}),l&&f(U,{leftSide:n("show_task_end_date"),leftSideHelp:n("show_task_end_date_help"),children:f(gt,{checked:!!(s!=null&&s.show_task_end_date),onChange:x=>h("show_task_end_date",x)})}),l&&f(U,{leftSide:n("show_task_item_description"),leftSideHelp:n("show_task_item_description_help"),children:f(gt,{checked:!!(s!=null&&s.settings.show_task_item_description),onChange:x=>h("settings.show_task_item_description",x)})}),l&&f(U,{leftSide:n("allow_billable_task_items"),leftSideHelp:n("allow_billable_task_items_help"),children:f(gt,{checked:!!(s!=null&&s.settings.allow_billable_task_items),onChange:x=>h("settings.allow_billable_task_items",x)})}),l&&f(Jn,{}),l&&f(U,{leftSide:n("show_tasks_table"),leftSideHelp:n("show_tasks_table_help"),children:f(gt,{checked:!!(s!=null&&s.show_tasks_table),onChange:x=>h("show_tasks_table",x)})}),l&&f(U,{leftSide:n("invoice_task_datelog"),leftSideHelp:n("invoice_task_datelog_help"),children:f(gt,{checked:!!(s!=null&&s.invoice_task_datelog),onChange:x=>h("invoice_task_datelog",x)})}),l&&f(U,{leftSide:n("invoice_task_timelog"),leftSideHelp:n("invoice_task_timelog_help"),children:f(gt,{checked:!!(s!=null&&s.invoice_task_timelog),onChange:x=>h("invoice_task_timelog",x)})}),l&&f(U,{leftSide:n("invoice_task_hours"),leftSideHelp:n("invoice_task_hours_help"),children:f(gt,{checked:!!(s!=null&&s.invoice_task_hours),onChange:x=>h("invoice_task_hours",x)})}),l&&f(U,{leftSide:n("invoice_task_project"),leftSideHelp:n("invoice_task_project_help"),children:f(gt,{checked:!!(s!=null&&s.invoice_task_project),onChange:x=>h("invoice_task_project",x)})}),l&&f(U,{leftSide:n("invoice_task_item_description"),leftSideHelp:n("invoice_task_item_description_help"),children:f(gt,{checked:!!(s!=null&&s.invoice_task_item_description),onChange:x=>h("invoice_task_item_description",x)})}),l&&f(U,{leftSide:n("lock_invoiced_tasks"),leftSideHelp:n("lock_invoiced_tasks_help"),children:f(gt,{checked:!!(s!=null&&s.invoice_task_lock),onChange:x=>h("invoice_task_lock",x)})}),l&&f(U,{leftSide:n("add_documents_to_invoice"),leftSideHelp:n("add_documents_to_invoice_help"),children:f(gt,{checked:!!(s!=null&&s.invoice_task_documents),onChange:x=>h("invoice_task_documents",x)})}),f(Jn,{}),f(U,{leftSide:f(bt,{propertyKey:"enable_client_portal_tasks",labelElement:f(yt,{label:n("show_tasks_in_client_portal")}),defaultValue:!1}),children:f(gt,{checked:!!((p=s==null?void 0:s.settings)!=null&&p.enable_client_portal_tasks),onChange:x=>h("settings.enable_client_portal_tasks",x),disabled:r("enable_client_portal_tasks")})}),f(U,{leftSide:f(bt,{propertyKey:"show_all_tasks_client_portal",labelElement:f(yt,{label:n("tasks_shown_in_portal")}),defaultValue:"invoiced"}),children:N(nn,{id:"settings.show_all_tasks_client_portal",onChange:d,disabled:!((m=s==null?void 0:s.settings)!=null&&m.enable_client_portal_tasks)||r("show_all_tasks_client_portal"),value:((v=(_=s==null?void 0:s.settings)==null?void 0:_.show_all_tasks_client_portal)==null?void 0:v.toString())||"invoiced",errorMessage:a==null?void 0:a.errors["settings.show_all_tasks_client_portal"],children:[f("option",{value:"invoiced",children:n("invoiced")}),f("option",{value:"uninvoiced",children:n("uninvoiced")}),f("option",{value:"all",children:n("all")})]})}),f(U,{leftSide:f(bt,{propertyKey:"task_round_up",labelElement:f(yt,{label:n("round_tasks"),helpLabel:n("round_tasks_help")}),defaultValue:!0}),children:N("div",{className:"flex items-center space-x-7",children:[f(gt,{checked:!!(((b=s==null?void 0:s.settings)==null?void 0:b.task_round_up)??!0),onChange:x=>h("settings.task_round_up",x),disabled:r("task_round_up")}),s!=null&&s.settings.task_round_up?f("span",{children:n("round_up")}):f("span",{children:n("round_down")})]})}),f(U,{leftSideHelp:n("task_round_to_nearest_help"),leftSide:f(bt,{propertyKey:"task_round_to_nearest",labelElement:f(yt,{label:n("task_round_to_nearest")}),defaultValue:1}),children:N(nn,{value:typeof((y=s==null?void 0:s.settings)==null?void 0:y.task_round_to_nearest)<"u"?u()?"-1":s.settings.task_round_to_nearest.toString():"1",onValueChange:x=>o("settings.task_round_to_nearest",parseFloat(x)),disabled:r("task_round_to_nearest"),children:[N("option",{value:"1",children:[n("1_second")," (",n("disabled"),")"]}),f("option",{value:"60",children:n("1_minute")}),f("option",{value:"300",children:Ds("count_minutes",{count:5})}),f("option",{value:"900",children:Ds("count_minutes",{count:15})}),f("option",{value:"1800",children:Ds("count_minutes",{count:30})}),f("option",{value:"3600",children:n("1_hour")}),f("option",{value:"86400",children:n("1_day")}),f("option",{value:"-1",children:n("custom")})]})}),u()&&f(U,{leftSide:n("task_round_to_nearest"),children:f(ke,{type:"number",value:((C=s==null?void 0:s.settings)==null?void 0:C.task_round_to_nearest)||-1,onValueChange:x=>o("settings.task_round_to_nearest",parseFloat(x)),disabled:r("task_round_to_nearest")})})]}),l&&f(hrn,{})]})}function AKt(n){const[e]=ue(),{customFilter:t}=n,i=n.customFilters?Wa(n.customFilters).pluck("dropdownKey").unique().toArray().map(l=>l??"0"):[],r=l=>{if(n.onStatusChange){const c=[];return l.map(u=>c.push(u.value)),n.onStatusChange(c)}},o=(l,c)=>{var u;if(n.onCustomFilterChange&&i.length===1){const d=[];return l.map(h=>d.push(h.value)),n.onCustomFilterChange(d)}else if(n.onCustomFilterChange&&i.length>1){const d=[];if(l.map(h=>d.push(h.value)),t!=null&&t.length){const h=((u=n.customFilters)==null?void 0:u.filter(g=>g.dropdownKey!==c&&t.some(p=>p===g.value)))||[];return n.onCustomFilterChange([...h.map(g=>g.value),...d])}else return n.onCustomFilterChange(d)}},s=Vn(),a={multiValue:(l,{data:c})=>({...l,backgroundColor:c.backgroundColor,color:c.color,borderRadius:"3px"}),multiValueLabel:(l,{data:c})=>({...l,color:c.color}),multiValueRemove:l=>({...l,":hover":{color:"white"},color:"#999999"}),menu:l=>({...l,width:"max-content",minWidth:"100%",backgroundColor:s.$4,borderColor:s.$4}),control:l=>({...l,borderRadius:"3px",backgroundColor:s.$1,color:s.$3,borderColor:s.$5}),option:l=>({...l,backgroundColor:s.$1,":hover":{backgroundColor:s.$7}})};return N("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between",style:{color:s.$3,colorScheme:s.$0,backgroundColor:s.$2,borderColor:s.$4},children:[N("div",{className:"flex flex-col space-y-2 mt-2 lg:mt-0 lg:flex-row lg:items-center lg:space-x-4 lg:space-y-0",style:{color:s.$3,colorScheme:s.$0,backgroundColor:s.$1,borderColor:s.$4},children:[n.children,n.options&&n.defaultOptions&&!n.withoutStatusFilter&&f(b_,{styles:a,defaultValue:n.defaultOptions,onChange:l=>r(l),placeholder:e("status"),options:n.options,isMulti:n.optionsMultiSelect}),i.map((l,c)=>{var u;return n.customFilters&&n.customFilterPlaceholder&&n.defaultCustomFilterOptions&&f(b_,{styles:a,defaultValue:n.defaultCustomFilterOptions.filter(d=>(d.dropdownKey??"0")===l),onChange:d=>o(d,l),placeholder:e(((u=n.customFilters.filter(d=>d.dropdownKey===l)[0])==null?void 0:u.placeHolder)??n.customFilterPlaceholder),options:n.customFilters.filter(d=>(d.dropdownKey??"0")===l),isMulti:n.optionsMultiSelect},c)})]}),N("div",{className:"flex flex-col space-y-2 mt-2 lg:mt-0 lg:flex-row lg:items-center lg:space-x-4 lg:space-y-0",children:[n.beforeFilter,f(ke,{id:"filter",changeOverride:!0,placeholder:e("filter"),value:n.filter,onValueChange:l=>n.onFilterChange&&n.onFilterChange(l),debounceTimeout:800}),n.rightSide]})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function qVe(){const[n]=ue();return[{value:"active",label:n("active"),color:"black",backgroundColor:"#e4e4e4"},{value:"archived",label:n("archived"),color:"white",backgroundColor:"#e6b05c"},{value:"deleted",label:n("deleted"),color:"white",backgroundColor:"#c95f53"}]}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const RKt=B3e(()=>sessionStorage),KVe=Hde("dataTableFilters",{},RKt);function NKt(n){const{tableKey:e}=n,t=Ri(KVe);return(i,r)=>{t(o=>({...o,[e]:{filter:i,currentPage:r}}))}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function GVe(n){const e=f3(),{tableKey:t}=n,i=ki(KVe);return r=>{var s,a,l;if(r==="filter"||r==="currentPage")return(s=i==null?void 0:i[t])!=null&&s[r]?i[t][r]:"";const o=(a=e==null?void 0:e.company_user)==null?void 0:a.react_settings.table_filters;return(l=o==null?void 0:o[t])!=null&&l[r]?o[t][r]:""}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function OKt(n){const e=qVe(),{isInitialConfiguration:t,tableKey:i,customFilters:r,apiEndpoint:o,customFilter:s}=n,a=GVe({tableKey:i}),l=()=>{if(!t){const d=a("status"),h=d!=null&&d.length?d:["active"];return e.filter(({value:g})=>h.includes(g))||[e[0]]}},c=()=>{if(!t&&r){const d=a("customFilter"),h=d!=null&&d.length?d:[];return r.filter(({value:g})=>h.includes(g))||[r[0]]}},u=()=>{r&&Wa(r).pluck("queryKey").unique().toArray().forEach(h=>{const g=h||"client_status",p=[];r.forEach((m,_)=>{(m.queryKey||null)===h&&(s!=null&&s.includes(m.value))&&p.push(m.value),_===r.length-1&&o.searchParams.set(g,p.join(","))})})};return{defaultOptions:l(),defaultCustomFilterOptions:c(),handleChangingCustomFilters:u}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function PKt(n){const e=f3(),t=Ci(),{apiEndpoint:i,customFilters:r,tableKey:o,isInitialConfiguration:s,customFilter:a,setFilter:l,setCustomFilter:c,setCurrentPage:u,setSort:d,setSortedBy:h,setStatus:g,setPerPage:p,withoutStoringPerPage:m}=n,_=GVe({tableKey:o}),v=NKt({tableKey:o}),b=C=>{Te("PUT",ye("/api/v1/company_users/:id",{id:C.id}),C).then(x=>{Bn.set(C,"company_user",x.data.data),hn(["company_users"]),t(Uy(C))})},y=(C,x,k,I,L,D)=>{var B,F;if(!a)return;const R=(F=(B=e==null?void 0:e.company_user)==null?void 0:B.react_settings.table_filters)==null?void 0:F[o],P={...r&&{customFilter:[]},sort:i.searchParams.get("sort")||"id|asc",status:["active"],...!m&&{perPage:"10"}},M={...x&&{sortedBy:x},...r&&{customFilter:a},sort:k,status:L,...!m&&{perPage:D}};if(R&&m&&delete R.perPage,v(C,I),Bn.isEqual(P,M)&&!R||Bn.isEqual(R,M)&&R)return;const O=Bn.cloneDeep(e);O&&(Bn.set(O,`company_user.react_settings.table_filters.${o}`,M),b(O))};return w.useEffect(()=>{!s&&!a&&(l(_("filter")||""),r?_("customFilter").length?c(_("customFilter")):c([]):c([]),!m&&p(_("perPage")||"10"),u(_("currentPage")||1),d(_("sort")||"id|asc"),h(_("sortedBy")||void 0),_("status").length?g(_("status")):g(["active"]))},[s]),{handleUpdateTableFilters:y}}const Ape=po(null);function bhr(n){const[e]=ue(),[t,i]=w.useState(!1),{RangePicker:r}=_8e,[o,s]=w.useState(),[a,l]=w.useState(),{dateFormat:c}=Il(),u=ki(Ape);w.useEffect(()=>{s(n.startDate),l(n.endDate)},[n.startDate,n.endDate]);const d=g=>{if(Cn.extend(dge),g[0]===""||g[1]==="")return;const p=["DD. MMM. YYYY","ddd MMM D, YYYY"];n.handleDateChange(Cn(g[0],p.includes(c)?void 0:c,u==null?void 0:u.locale).format("YYYY-MM-DD")+","+Cn(g[1],p.includes(c)?void 0:c,u==null?void 0:u.locale).format("YYYY-MM-DD"))},h=ys();return N("div",{className:"flex justify-end items-center",children:[f(U3e,{style:{color:h},className:"mx-2"}),N(nn,{value:n.value,className:"appearance-none block px-3 py-1.5 text-base font-normal text-gray-700 bg-white bg-clip-padding bg-no-repeat border border-solid border-gray-300 rounded transition ease-in-out m-0 focus:text-gray-700 focus:bg-white focus:border-blue-600 focus:outline-none",onValueChange:g=>{i(g==="custom"),n.handleDateRangeChange(g)},style:{width:"9.7rem"},children:[f("option",{value:"last7_days",children:e("last_7_days")}),f("option",{value:"last30_days",children:e("last_30_days")}),f("option",{value:"this_month",children:e("this_month")}),f("option",{value:"last_month",children:e("last_month")}),f("option",{value:"this_quarter",children:e("current_quarter")}),f("option",{value:"last_quarter",children:e("last_quarter")}),f("option",{value:"this_year",children:e("this_year")}),f("option",{value:"last_year",children:e("last_year")}),f("option",{value:"last365_days",children:`${e("last365_days")}`}),f("option",{value:"custom",children:`${e("custom")}`})]}),t&&f("div",{className:"flex flex-row space-x-2",children:f(tge,{locale:u==null?void 0:u.default,children:f(r,{size:"large",defaultValue:[Cn(o),Cn(a)],format:c,onChange:(g,p)=>d(p)})})})]})}function MKt(n){const e=w.useRef(null),{RangePicker:t}=_8e,i=Vn(),{setDateRange:r,onClick:o}=n,[s,a]=w.useState(!1),[l,c]=w.useState(!1),[u,d]=w.useState(""),h=ki(Ape),{dateFormat:g}=Il();Bw(e,()=>{s&&!l&&a(!1)});const p=_=>{Cn.extend(dge);const v=["DD. MMM. YYYY","ddd MMM D, YYYY"],b=_[0]?Cn(_[0],v.includes(g)?void 0:g,h==null?void 0:h.locale).format("YYYY-MM-DD"):"",y=_[1]?Cn(_[1],v.includes(g)?void 0:g,h==null?void 0:h.locale).format("YYYY-MM-DD"):"";d(b||y?[b,y].join(","):""),r(b||y?[b,y].join(","):"")},m=()=>{var b,y;const _=(b=u==null?void 0:u.split(","))==null?void 0:b[0],v=(y=u==null?void 0:u.split(","))==null?void 0:y[1];return!!(_&&v)};return w.useEffect(()=>{var _,v;if(s){const b=(_=u==null?void 0:u.split(","))==null?void 0:_[0],y=(v=u==null?void 0:u.split(","))==null?void 0:v[1];r((u==null?void 0:u.length)>1?[b,y].join(","):"")}},[s]),f("div",{ref:e,children:f(A3,{visible:s,placement:"bottom",interactive:!0,render:()=>{var _,v;return f("div",{className:"flex flex-col p-3",style:{backgroundColor:i.$2,border:`1px solid ${i.$5}`},onClick:b=>b.stopPropagation(),children:f(tge,{locale:h==null?void 0:h.default,children:f(t,{size:"large",value:[(_=u==null?void 0:u.split(","))!=null&&_[0]?Cn(u.split(",")[0]):null,(v=u==null?void 0:u.split(","))!=null&&v[1]?Cn(u.split(",")[1]):null],format:g,onCalendarChange:(b,y)=>p(y),onOpenChange:b=>c(b)})})})},children:f("div",{className:"cursor-pointer",onClick:_=>{_.stopPropagation(),o(),a(v=>!v)},children:f(Ve,{element:U3e,color:m()?"lightgreen":"white",style:{width:"1.4rem",height:"1.4rem"}})})})})}function FKt(n){const{children:e}=n,t=ys();return f("tfoot",{style:{backgroundColor:t},children:f("tr",{children:e})})}function Pg(n){var Nt,Yt;const[e]=ue(),t=ol(),i=qVe(),r=sl(),o=Wfe(),[s,a]=w.useState(!1),[l,c]=w.useState(new URL(ye(n.endpoint))),u=`${t.pathname}${n.endpoint.replace(".","")}`,d=Ri(Hc),{styleOptions:h,customFilters:g,onBulkActionCall:p,hideEditableOptions:m=!1,dateRangeColumns:_=[],excludeColumns:v=[],methodType:b="GET",queryIdentificator:y,disableQuery:C,footerColumns:x=[],bottomActionsKeys:k=[],withoutPerPageAsPreference:I=!1,withoutSortQueryParameter:L=!1,showRestoreBulk:D}=n,R=w.useRef(void 0),[P,M]=w.useState(""),[O,B]=w.useState(void 0),[F,H]=w.useState(1),[V,$]=w.useState(l.searchParams.get("per_page")||"10"),[j,Y]=w.useState(l.searchParams.get("sort")||"id|asc"),[ne,se]=w.useState(void 0),[he,xe]=w.useState(["active"]),[_e,Ie]=w.useState(""),[Re,Ye]=w.useState(""),[Ze,tt]=w.useState([]),[Be,kt]=w.useState([]),[Vt,xt]=w.useState(!0),Kt=w.useRef(null),{handleUpdateTableFilters:cn}=PKt({apiEndpoint:l,isInitialConfiguration:Vt,customFilter:O,setCurrentPage:H,setCustomFilter:B,setFilter:M,setPerPage:$,setSort:Y,setSortedBy:se,setStatus:xe,tableKey:u,customFilters:g,withoutStoringPerPage:I}),{defaultOptions:wn,defaultCustomFilterOptions:on,handleChangingCustomFilters:Zt}=OKt({apiEndpoint:l,isInitialConfiguration:Vt,tableKey:u,customFilter:O,customFilters:g});w.useEffect(()=>{if(!Vt){clearTimeout(R.current);const He=setTimeout(()=>cn(P,ne,j,F,he,V),1500);R.current=He}if(l.searchParams.set("per_page",V),l.searchParams.set("page",F.toString()),l.searchParams.set("filter",P),Zt(),(!L||L&&j!=="id|asc")&&l.searchParams.set("sort",j),l.searchParams.set("status",he),_.length&&Re){const He=_e==null?void 0:_e.split(",")[0],Dt=_e==null?void 0:_e.split(",")[1];l.searchParams.set(Re,He&&Dt?_e:"")}return c(l),Vt&&xt(!1),()=>{d(void 0)}},[V,F,P,j,he,O,_e,Re]);const{data:pe,isLoading:me,isError:Z}=ai([...y?[y]:[],l.pathname,n.endpoint,V,F,P,j,he,O,_e,Re],()=>Te(b,l.href),{staleTime:n.staleTime??1/0,enabled:!C}),G=()=>Be.every(He=>nr(He)!==Di.Active),K=(He,Dt)=>{ie.processing(),Te("POST",ye(n.bulkRoute??`${n.endpoint}/bulk`),{action:He,ids:Dt?[Dt]:Array.from(Ze)}).then(ae=>{var Se;ie.success(`${He}d_${n.resource}`),(Se=n.onBulkActionSuccess)==null||Se.call(n,ae.data.data,He),Kt.current.checked=!1,window.dispatchEvent(new CustomEvent("invalidate.combobox.queries",{detail:{url:ye(n.endpoint)}}))}).finally(()=>{Lht([n.endpoint,l.pathname]),tt([])})},oe=w.useMemo(()=>n.customBulkActions?n.customBulkActions.some(He=>te.isValidElement(He({selectedIds:Ze,selectedResources:Be,setSelected:tt}))):!1,[n.customBulkActions,Ze,Be]),le=He=>n.customActions?n.customActions.some(Dt=>te.isValidElement(Dt(He))):!1,we=He=>{var Se,Xe;const Dt=(Se=_.find(wt=>Re===wt.column))==null?void 0:Se.column,ae=(Xe=_.find(wt=>He===wt.column))==null?void 0:Xe.queryParameterKey;Dt!==He&&ae&&Ye(ae)},Me=He=>x.find(Dt=>Dt.id===He),ft=He=>pe==null?void 0:pe.data.data.map(Dt=>Dt[He]);return w.useEffect(()=>{d(l.pathname)},[l.pathname]),w.useEffect(()=>{if(pe){const He=pe.data.data.filter(ae=>Ze.includes(ae.id));kt(He),pe.data.data.some(ae=>!Ze.includes(ae.id))&&Kt.current?Kt.current.checked=!1:Kt.current&&(Kt.current.checked=!0)}},[Ze]),w.useEffect(()=>{pe&&!pe.data.data.length&&H(1)},[pe]),w.useEffect(()=>{pe&&(Number(V)<Ze.length||Number(V)===Ze.length?tt(pe.data.data.map(He=>He.id).filter(He=>Ze.includes(He))):Number(V)>Ze.length&&Kt.current&&(Kt.current.checked=!1))},[V]),w.useEffect(()=>{rue.on("bulk.completed",()=>tt([]))},[]),N("div",{"data-cy":"dataTable",children:[!n.withoutActions&&f(AKt,{filter:P,onFilterChange:M,optionsMultiSelect:!0,options:i,defaultOptions:wn,defaultCustomFilterOptions:on,onStatusChange:xe,customFilters:n.customFilters,customFilterPlaceholder:n.customFilterPlaceholder,onCustomFilterChange:B,customFilter:O,rightSide:N(_t,{children:[n.rightSide,n.linkToCreate&&f(vn,{type:"component",guards:n.linkToCreateGuards||[],component:f(Ut,{to:n.linkToCreate,children:f("span",{children:e(`new_${n.resource}`)})})})]}),beforeFilter:n.beforeFilter,withoutStatusFilter:n.withoutStatusFilter,children:!m&&N(Hp,{label:e("more_actions"),disabled:!Ze.length,cypressRef:"bulkActionsDropdown",children:[n.customBulkActions&&n.customBulkActions.map((He,Dt)=>f("div",{children:He({selectedIds:Ze,selectedResources:Be,setSelected:tt})},Dt)),n.customBulkActions&&oe&&f(Jn,{withoutPadding:!0}),!n.withoutDefaultBulkActions&&N(_t,{children:[f(et,{onClick:()=>{p?p(Ze,"archive"):K("archive")},icon:f(Ve,{element:Xl}),children:e("archive")}),f(et,{onClick:()=>{p?p(Ze,"delete"):K("delete")},icon:f(Ve,{element:Pa}),children:e("delete")}),(D?D(Be):G())&&f(et,{onClick:()=>{p?p(Ze,"restore"):K("restore")},icon:f(Ve,{element:Ql}),children:e("restore")})]})]})}),N(zw,{className:St(n.className,{"pr-0":!s}),withoutPadding:n.withoutPadding,withoutBottomBorder:h==null?void 0:h.withoutBottomBorder,withoutTopBorder:h==null?void 0:h.withoutTopBorder,withoutLeftBorder:h==null?void 0:h.withoutLeftBorder,withoutRightBorder:h==null?void 0:h.withoutRightBorder,onVerticalOverflowChange:He=>a(He),isDataLoading:me,style:n.style,children:[N(Uw,{backgroundColor:h==null?void 0:h.headerBackgroundColor,children:[!n.withoutActions&&!m&&f(la,{className:h==null?void 0:h.thClassName,children:f(Nh,{innerRef:Kt,onChange:He=>{Array.from(document.querySelectorAll(".child-checkbox")).forEach(Dt=>{Dt.checked=He.target.checked,He.target.checked?Ze.find(Se=>Se===Dt.id)||tt(Se=>[...Se,Dt.id]):tt([])})},cypressRef:"dataTableCheckbox"})}),n.columns.map((He,Dt)=>!v.includes(He.id)&&f(la,{id:He.id,className:h==null?void 0:h.thClassName,isCurrentlyUsed:ne===He.id,onColumnClick:ae=>{se(ae.field),Y(ae.sort)},childrenClassName:h==null?void 0:h.thChildrenClassName,children:N("div",{className:"flex items-center space-x-3",children:[_.some(ae=>He.id===ae.column)&&f(MKt,{setDateRange:Ie,onClick:()=>we(He.id)}),f("span",{children:He.label})]})},Dt)),n.withResourcefulActions&&!m&&f(la,{})]}),N(jw,{style:h==null?void 0:h.tBodyStyle,children:[me&&f(zl,{className:St({"border-b border-gray-200":h==null?void 0:h.addRowSeparator,"last:border-b-0":s}),children:f(eo,{colSpan:100,children:f(Vo,{})})}),Z&&f(zl,{className:St({"border-b border-gray-200":h==null?void 0:h.addRowSeparator,"last:border-b-0":s}),children:f(eo,{className:"text-center",colSpan:100,children:e("error_refresh_page")})}),pe&&pe.data.data.length===0&&f(zl,{className:St({"border-b border-gray-200":h==null?void 0:h.addRowSeparator,"last:border-b-0":s}),children:f(eo,{className:h==null?void 0:h.tdClassName,colSpan:100,children:e("no_records_found")})}),pe&&((Yt=(Nt=pe==null?void 0:pe.data)==null?void 0:Nt.data)==null?void 0:Yt.map((He,Dt)=>{var ae,Se,Xe,wt,Tt,zt;return N(zl,{className:St({"border-b border-gray-200":h==null?void 0:h.addRowSeparator,"last:border-b-0":s}),backgroundColor:Dt%2===0?o.$7:"",children:[!n.withoutActions&&!m&&f(eo,{className:"cursor-pointer",onClick:()=>Ze.includes(He.id)?tt(Mt=>Mt.filter(On=>On!==He.id)):tt(Mt=>[...Mt,He.id]),children:f(Nh,{checked:Ze.includes(He.id),className:"child-checkbox",value:He.id,id:He.id,cypressRef:"dataTableCheckbox"})}),n.columns.map((Mt,On)=>!v.includes(Mt.id)&&f(eo,{className:St({"cursor-pointer":On<3,"py-4":m},h==null?void 0:h.tdClassName),onClick:()=>{var Ni;On<3&&(n.onTableRowClick?n.onTableRowClick(He):(Ni=document.getElementById(He.id))==null||Ni.click())},children:Mt.format?Mt.format(He[Mt.id],He):He[Mt.id]},On)),n.withResourcefulActions&&!m&&f(eo,{children:N(Hp,{label:e("more_actions"),children:[n.linkToEdit&&(((ae=n.showEdit)==null?void 0:ae.call(n,He))||!n.showEdit)&&f(et,{to:dt(n.linkToEdit,{id:He==null?void 0:He.id}),icon:f(Ve,{element:_3}),children:e("edit")}),n.linkToEdit&&n.customActions&&le(He)&&(((Se=n.showEdit)==null?void 0:Se.call(n,He))||!n.showEdit)&&f(Jn,{withoutPadding:!0}),n.customActions&&n.customActions.map((Mt,On)=>{var Ni;return!k.includes(((Ni=Mt(He))==null?void 0:Ni.key)||"")&&f("div",{children:Mt(He)},On)}),n.customActions&&(((Xe=n.showRestore)==null?void 0:Xe.call(n,He))||!n.showRestore)&&f(Jn,{withoutPadding:!0}),(He==null?void 0:He.archived_at)===0&&(((wt=n.showArchive)==null?void 0:wt.call(n,He))||!n.showArchive)&&f(et,{onClick:()=>K("archive",He.id),icon:f(Ve,{element:Xl}),children:e("archive")}),(He==null?void 0:He.archived_at)>0&&(((Tt=n.showRestore)==null?void 0:Tt.call(n,He))||!n.showRestore)&&f(et,{onClick:()=>K("restore",He.id),icon:f(Ve,{element:Ql}),children:e("restore")}),!(He!=null&&He.is_deleted)&&(((zt=n.showDelete)==null?void 0:zt.call(n,He))||!n.showDelete)&&f(et,{onClick:()=>K("delete",He.id),icon:f(Ve,{element:Pa}),children:e("delete")}),n.customActions&&n.customActions.map((Mt,On)=>{var Ni;return k.includes(((Ni=Mt(He))==null?void 0:Ni.key)||"")&&f("div",{children:Mt(He)},On)})]})})]},Dt)}))]}),!!x.length&&!!(pe!=null&&pe.data.data.length)&&!!r.show_table_footer&&N(FKt,{children:[!n.withoutActions&&!m&&f(la,{}),n.columns.map((He,Dt)=>{var ae;return!v.includes(He.id)&&f(eo,{customizeTextColor:!0,children:Me(He.id)?f("div",{className:"flex items-center space-x-3",children:((ae=Me(He.id))==null?void 0:ae.format(ft(He.id)||[],(pe==null?void 0:pe.data.data)||[]))??"-/-"}):f(_t,{})},Dt)}),n.withResourcefulActions&&!m&&f(la,{})]})]}),pe&&!n.withoutPagination&&f(V7e,{currentPerPage:V,currentPage:F,onPageChange:H,onRowsChange:$,totalPages:pe.data.meta.pagination.total_pages,totalRecords:pe.data.meta.pagination.total,leftSideChevrons:n.leftSideChevrons})]})}function BKt(){return f(Pg,{endpoint:"/api/v1/expense_categories?sort=id|desc",bulkRoute:"/api/v1/expense_categories/bulk",resource:"expense_category",columns:[{id:"category",label:"name",format:(e,t)=>f(Ii,{to:dt("/settings/expense_categories/:id/edit",{id:t.id}),children:t.name})},{id:"color",label:"color",format:e=>f("div",{style:{backgroundColor:e},className:"p-1 h-4 w-10"})}],linkToCreate:"/settings/expense_categories/create",linkToEdit:"/settings/expense_categories/:id/edit",withResourcefulActions:!0})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function YVe(n){return ai(["/api/v1/expense_categories",n],()=>{var e;return Te("GET",ye("/api/v1/expense_categories?per_page=:perPage&page=:currentPage&sort=:sort&filter=:filter&status=:status",{perPage:n.perPage??"100",currentPage:n.currentPage??"1",sort:n.sort??"name|asc",filter:n.filter??"",status:((e=n.status)==null?void 0:e.join(","))??""})).then(t=>t.data.data)},{enabled:n.enabled??!0,staleTime:1/0})}function $Kt(n){return ai(["/api/v1/expense_categories",n.id],()=>Te("GET",ye("/api/v1/expense_categories/:id",{id:n.id})),{enabled:n.enabled??!0,staleTime:1/0})}function VKt(){return(n,e)=>{ie.processing(),Te("POST",ye("/api/v1/expense_categories/bulk"),{action:e,ids:[n]}).then(()=>{ie.success(`${e}d_expense_category`),hn(["expense_categories"])})}}function QVe(){const{isAdmin:n}=ao();return ai("/api/v1/expense_categories/create",()=>Te("GET",ye("/api/v1/expense_categories/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function XVe(n){const[e]=ue(),{errors:t,setErrors:i,setExpenseCategory:r,expenseCategory:o,nameFieldRef:s}=n,a=Vn(),l=(c,u)=>{i(void 0),r(d=>d&&{...d,[c]:u})};return N(Sb,{children:[f(ke,{innerRef:s,style:{color:a.$3,colorScheme:a.$0,backgroundColor:a.$1,borderColor:a.$4},required:!0,label:e("name"),value:o==null?void 0:o.name,onValueChange:c=>l("name",c),errorMessage:t==null?void 0:t.errors.name,cypressRef:"expenseCategoryNameField"}),f($p,{children:e("color")}),f(Tk,{value:o==null?void 0:o.color,onValueChange:c=>l("color",c)})]})}function HKt(){gi("new_expense_category");const[n]=ue(),e=ri(),t=ys(),i=w.useRef(null),{data:r}=QVe(),[o,s]=w.useState(),[a,l]=w.useState(!1),[c,u]=w.useState(),d=[{name:n("settings"),href:"/settings"},{name:n("expense_settings"),href:"/settings/expense_settings"},{name:n("new_expense_category"),href:"/settings/expense_categories/create"}],h=()=>{i.current&&i.current.focus()},g=m=>{a||(l(!0),ie.processing(),Te("POST",ye("/api/v1/expense_categories"),c).then(_=>{ie.success("created_expense_category"),hn(["expense_categories"]),m==="save"?e(dt("/settings/expense_categories/:id/edit",{id:_.data.data.id})):r&&(u({...r,color:t}),h())}).catch(_=>{var v;((v=_.response)==null?void 0:v.status)===422&&(ie.dismiss(),s(_.response.data))}).finally(()=>l(!1)))},p=[{onClick:()=>g("create"),text:`${n("save")} / ${n("create")}`,icon:f(Ve,{element:eg})}];return w.useEffect(()=>{r&&u({...r,color:t})},[r]),w.useEffect(()=>{h()},[i]),f($i,{title:n("expense_categories"),breadcrumbs:d,children:f(Ot,{title:n("create_expense_category"),withSaveButton:!0,disableSubmitButton:a,onSaveClick:()=>g("save"),additionalSaveOptions:p,children:f(XVe,{nameFieldRef:i,expenseCategory:c,setExpenseCategory:u,errors:o,setErrors:s})})})}function WKt(){const[n]=ue(),e=VKt();return[i=>i.archived_at===0&&f(et,{onClick:()=>e(i.id,"archive"),icon:f(Ve,{element:Xl}),children:n("archive")}),i=>i.archived_at>0&&f(et,{onClick:()=>e(i.id,"restore"),icon:f(Ve,{element:Ql}),children:n("restore")}),i=>!i.is_deleted&&f(et,{onClick:()=>e(i.id,"delete"),icon:f(Ve,{element:Pa}),children:n("delete")})]}function I0(n){const[e]=ue(),{onSaveClick:t,disableSaveButton:i,label:r,saveButtonLabel:o}=n;return N(_t,{children:[t&&N("div",{className:"flex",children:[f(Ut,{behavior:"button",className:"rounded-br-none rounded-tr-none px-3",onClick:t,disabled:i,disableWithoutIcon:!0,children:o??e("save")}),f(Hp,{className:"rounded-bl-none rounded-tl-none h-full border-l-1 border-y-0 border-r-0",cardActions:!0,disabled:i,cypressRef:n.cypressRef,children:n.actions.map((s,a)=>f(w.Fragment,{children:s(n.resource)},a))})]}),!t&&r&&f(Hp,{label:n.label,cypressRef:n.cypressRef,children:n.actions.map((s,a)=>f(w.Fragment,{children:s(n.resource)},a))})]})}function zKt(){const{setDocumentTitle:n}=gi("edit_expense_category"),[e]=ue(),{id:t}=Fa(),i=WKt(),{data:r}=$Kt({id:t}),o=[{name:e("settings"),href:"/settings"},{name:e("expense_settings"),href:"/settings/expense_settings"},{name:e("edit_expense_category"),href:dt("/settings/expense_categories/:id/edit",{id:t})}],[s,a]=w.useState(),[l,c]=w.useState(!1),[u,d]=w.useState({name:"",color:""}),h=(p,m)=>{a(void 0),d(_=>({..._,[p]:m}))},g=p=>{p.preventDefault(),l||(c(!0),a(void 0),ie.processing(),Te("PUT",ye("/api/v1/expense_categories/:id",{id:t}),u).then(()=>{ie.success("updated_expense_category"),hn(["expense_categories"])}).catch(m=>{var _;((_=m.response)==null?void 0:_.status)===422&&(a(m.response.data),ie.dismiss())}).finally(()=>c(!1)))};return w.useEffect(()=>{n(r==null?void 0:r.data.data.name),d(r==null?void 0:r.data.data)},[r]),N($i,{title:e("expense_categories"),breadcrumbs:o,navigationTopRight:u&&f(I0,{label:e("more_actions"),resource:u,actions:i}),children:[!r&&f("div",{className:"flex justify-center",children:f(Vo,{})}),r&&N(Ot,{withSaveButton:!0,disableSubmitButton:l,onFormSubmit:g,title:u==null?void 0:u.name,children:[N(U,{leftSide:e("status"),children:[!r.data.data.is_deleted&&!r.data.data.archived_at&&f(Gi,{variant:"primary",children:e("active")}),r.data.data.archived_at&&!r.data.data.is_deleted?f(Gi,{variant:"yellow",children:e("archived")}):null,r.data.data.is_deleted&&f(Gi,{variant:"red",children:e("deleted")})]}),N(Sb,{children:[f(ke,{label:e("name"),onValueChange:p=>h("name",p),value:u==null?void 0:u.name,errorMessage:s==null?void 0:s.errors.name,required:!0}),f($p,{children:e("color")}),f(Tk,{value:u==null?void 0:u.color,onValueChange:p=>h("color",p)})]})]})]})}function jKt(){const[n]=ue(),e=[{name:n("settings"),href:"/settings"},{name:n("expense_settings"),href:"/settings/expense_settings"}],t=Ci();gi("expense_settings"),bc();const i=Ti(),r=(a,l)=>t(Vr({object:"company",property:a,value:l})),o=pu(),s=vf();return N($i,{onSaveClick:o,onCancelClick:s,title:n("expense_settings"),breadcrumbs:e,docsLink:"en/basic-settings/#expense_settings",children:[N(Ot,{title:n("settings"),children:[f(U,{leftSide:n("should_be_invoiced"),leftSideHelp:n("should_be_invoiced_help"),children:f(gt,{checked:i==null?void 0:i.mark_expenses_invoiceable,onChange:a=>r("mark_expenses_invoiceable",a),cypressRef:"shouldBeInvoicedToggle"})}),f(U,{leftSide:n("mark_paid"),leftSideHelp:n("mark_paid_help"),children:f(gt,{checked:i==null?void 0:i.mark_expenses_paid,onChange:a=>r("mark_expenses_paid",a),cypressRef:"markPaidToggle"})}),f(U,{leftSide:n("convert_currency"),leftSideHelp:n("convert_expense_currency_help"),children:f(gt,{checked:i==null?void 0:i.convert_expense_currency,onChange:a=>r("convert_expense_currency",a),cypressRef:"convertCurrencyToggle"})}),f(U,{leftSide:n("add_documents_to_invoice"),leftSideHelp:n("add_documents_to_invoice_help"),children:f(gt,{checked:i==null?void 0:i.invoice_expense_documents,onChange:a=>r("invoice_expense_documents",a),cypressRef:"addDocumentsToInvoiceToggle"})}),f(U,{leftSide:n("notify_vendor_when_paid"),leftSideHelp:n("notify_vendor_when_paid_help"),children:f(gt,{onChange:a=>r("notify_vendor_when_paid",a),checked:(i==null?void 0:i.notify_vendor_when_paid)||!1})}),f(Jn,{}),f(U,{leftSide:n("enter_taxes"),children:f(kFe,{onValueChange:a=>t(Vr({object:"company",property:"calculate_expense_tax_by_amount",value:a==="true"})),options:[{id:"by_rate",title:n("by_rate"),value:"false"},{id:"by_amount",title:n("by_amount"),value:"true"}],name:"calculate_expense_tax_by_amount",defaultSelected:i==null?void 0:i.calculate_expense_tax_by_amount.toString(),cypressRef:"taxByRadio"})}),f(U,{leftSide:n("inclusive_taxes"),leftSideHelp:N("span",{className:"flex flex-col",children:[N("span",{children:[n("exclusive"),": 100 + 10% = 100 + 10"]}),N("span",{children:[n("inclusive"),": 100 + 10% = 90.91 + 9.09"]})]}),children:f(gt,{onChange:a=>r("expense_inclusive_taxes",a),checked:(i==null?void 0:i.expense_inclusive_taxes)||!1,cypressRef:"inclusiveTaxesToggle"})})]}),f(BKt,{})]})}function D_(n){const e=Vn(),t=ys(),{withoutVerticalMargin:i}=n,[r,o]=w.useState(n.defaultTabIndex||0),s=a=>{var l;o(a),(l=n.onTabChange)==null||l.call(n,a)};return w.useEffect(()=>{o(n.defaultTabIndex||0)},[n.defaultTabIndex]),N("div",{className:n.className,"data-cy":"tabs",children:[f("div",{className:"-mb-px flex space-x-8 overflow-x-auto border-b",style:{borderColor:e.$5},children:n.tabs.map((a,l)=>{var c;return f("div",{className:St({"w-full":n.width==="full"}),children:f("button",{type:"button",onClick:()=>s(l),style:{borderColor:r===l?t:"transparent",color:r===l?t:e.$3},className:St("whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm",{"w-full":n.width==="full"}),children:((c=n.formatTabLabel)==null?void 0:c.call(n,l))||a})},l)})}),f("div",{className:St(n.childrenClassName,{"flex flex-1":n.height==="full","my-4":n.height!=="full"&&!i,"overflow-y-scroll px-[5px]":n.withScrollableContent}),children:[...n.children].map((a,l)=>{var c;return te.isValidElement(a)&&te.cloneElement(a,{key:l,className:St((c=a.props)==null?void 0:c.className,{"flex flex-col flex-1":n.height==="full","block my-4":n.height!=="full"&&!i,hidden:r!==l})})})})]})}function UKt(){var a,l,c,u;const[n]=ue(),e=Ci(),t=Ti(),i=Zs(),{isCompanySettingsActive:r}=Ms(),o=ki(Ss),s=(d,h)=>e(Vr({object:"company",property:d,value:h}));return N(Ot,{title:n("invoices"),children:[f(U,{leftSide:f(bt,{propertyKey:"auto_email_invoice",labelElement:f(yt,{label:n("auto_email_invoice"),helpLabel:n("auto_email_invoice_help")}),defaultValue:!1}),children:f(gt,{checked:!!((a=t==null?void 0:t.settings)!=null&&a.auto_email_invoice),onChange:d=>s("settings.auto_email_invoice",d),disabled:i("auto_email_invoice")})}),r&&f(U,{leftSide:n("stop_on_unpaid"),leftSideHelp:n("stop_on_unpaid_help"),children:f(gt,{checked:!!(t!=null&&t.stop_on_unpaid_recurring),onChange:d=>s("stop_on_unpaid_recurring",d)})}),f(Jn,{}),f(U,{leftSide:f(bt,{propertyKey:"auto_archive_invoice",labelElement:f(yt,{label:n("auto_archive_invoice"),helpLabel:n("auto_archive_invoice_help")}),defaultValue:!1}),children:f(gt,{checked:!!((l=t==null?void 0:t.settings)!=null&&l.auto_archive_invoice),onChange:d=>s("settings.auto_archive_invoice",d),disabled:i("auto_archive_invoice")})}),f(U,{leftSide:f(bt,{propertyKey:"auto_archive_invoice_cancelled",labelElement:f(yt,{label:n("auto_archive_invoice_cancelled"),helpLabel:n("auto_archive_invoice_cancelled_help")}),defaultValue:!1}),children:f(gt,{checked:!!((c=t==null?void 0:t.settings)!=null&&c.auto_archive_invoice_cancelled),onChange:d=>s("settings.auto_archive_invoice_cancelled",d),disabled:i("auto_archive_invoice_cancelled")})}),f(Jn,{}),f(U,{leftSide:f(bt,{propertyKey:"lock_invoices",labelElement:f(yt,{label:n("lock_invoices")}),defaultValue:"off"}),children:N(nn,{onChange:d=>s("settings.lock_invoices",d.target.value),value:((u=t==null?void 0:t.settings)==null?void 0:u.lock_invoices)||"off",disabled:i("lock_invoices"),errorMessage:o==null?void 0:o.errors["settings.lock_invoices"],children:[f("option",{value:"off",children:n("off")}),f("option",{value:"when_sent",children:n("when_sent")}),f("option",{value:"when_paid",children:n("when_paid")}),f("option",{value:"end_of_month",children:n("end_of_month")})]})})]})}function qKt(){var s,a;const[n]=ue(),e=Ci(),t=Ti(),{isCompanySettingsActive:i}=Ms(),r=Zs(),o=(l,c)=>e(Vr({object:"company",property:l,value:c}));return N(Ot,{title:n("quotes"),children:[f(U,{leftSide:f(bt,{propertyKey:"auto_convert_quote",labelElement:f(yt,{label:n("auto_convert_quote"),helpLabel:n("auto_convert_quote_help")}),defaultValue:!1}),children:f(gt,{checked:!!((s=t==null?void 0:t.settings)!=null&&s.auto_convert_quote),onChange:l=>o("settings.auto_convert_quote",l),disabled:r("auto_convert_quote")})}),f(U,{leftSide:f(bt,{propertyKey:"auto_archive_quote",labelElement:f(yt,{label:n("auto_archive_quote"),helpLabel:n("auto_archive_quote_help")}),defaultValue:!1}),children:f(gt,{checked:!!((a=t==null?void 0:t.settings)!=null&&a.auto_archive_quote),onChange:l=>o("settings.auto_archive_quote",l),disabled:r("auto_archive_quote")})}),i&&f(U,{leftSide:n("use_quote_terms"),leftSideHelp:n("use_quote_terms_help"),children:f(gt,{checked:!!(t!=null&&t.use_quote_terms_on_conversion),onChange:l=>o("use_quote_terms_on_conversion",l)})})]})}function KKt(){const[n]=ue(),e=[{name:n("settings"),href:"/settings"},{name:n("workflow_settings"),href:"/settings/workflow_settings"}];gi("workflow_settings"),bc();const t=pu(),i=vf(),r=[n("invoices"),n("quotes")];return f($i,{onSaveClick:t,onCancelClick:i,title:n("workflow_settings"),breadcrumbs:e,docsLink:"en/advanced-settings/#workflow_settings",children:N(D_,{tabs:r,children:[f("div",{children:f(UKt,{})}),f("div",{children:f(qKt,{})})]})})}const CX={activities:[],clients:["created_at"],client_contacts:["created_at"],invoices:["date","due_date","partial_due_date"],invoice_items:["date","due_date","partial_due_date"],quotes:["date","due_date","partial_due_date"],quote_items:["date","due_date","partial_due_date"],credits:["date","due_date","partial_due_date"],documents:["created_at"],expenses:["date","payment_date"],purchase_orders:[],purchase_order_items:[],recurring_invoices:["date","due_date","partial_due_date"],payments:["date"],products:["created_at"],vendors:[],tasks:["created_at"]},GKt=[{identifier:"last7",label:"last_7_days"},{identifier:"last30",label:"last_30_days"},{identifier:"this_month",label:"this_month"},{identifier:"last_month",label:"last_month"},{identifier:"this_quarter",label:"this_quarter"},{identifier:"last_quarter",label:"last_quarter"},{identifier:"this_year",label:"this_year"},{identifier:"custom",label:"custom"}],mTe={date_key:"",date_range:"",end_date:"",report_keys:[],send_email:!0,start_date:""};function YKt(){const[n]=ue(),[e,t]=w.useState(),[i,r]=w.useState(!1),[o,s]=w.useState("activities"),[a,l]=w.useState(mTe),c=(d,h)=>{l(h==="date_key"?g=>({...g,date_key:d,date_range:d?"last7":""}):h==="date_range"?g=>({...g,date_range:d,start_date:d==="custom"?g.start_date:"",end_date:d==="custom"?g.end_date:""}):g=>({...g,[h]:d}))},u=()=>{i||(ie.processing(),r(!0),Te("POST",ye(`/api/v1/reports/${o}`),a).then(()=>ie.success("exported_data")).catch(d=>{var h;((h=d.response)==null?void 0:h.status)===422&&(ie.dismiss(),t(d.response.data))}).finally(()=>r(!1)))};return w.useEffect(()=>{l(mTe)},[o]),N(Ot,{title:n("export"),saveButtonLabel:n("export"),withSaveButton:!0,onSaveClick:d=>{d.preventDefault(),u()},disableSubmitButton:i,disableWithoutIcon:!0,children:[f(U,{leftSide:n("export"),children:n("csv")}),f(U,{leftSide:n("export_type"),children:f(nn,{value:o,onValueChange:d=>s(d),children:Object.keys(CX).map((d,h)=>f("option",{value:d,children:n(d)},h))})}),!!CX[o].length&&f(U,{leftSide:n("date"),children:f(nn,{value:a.date_key,onValueChange:d=>c(d,"date_key"),withBlank:!0,errorMessage:e==null?void 0:e.errors.date_key,children:CX[o].map((d,h)=>f("option",{value:d,children:n(d)},h))})}),a.date_key&&f(U,{leftSide:n("date_range"),children:f(nn,{value:a.date_range,onValueChange:d=>c(d,"date_range"),errorMessage:e==null?void 0:e.errors.date_range,children:GKt.map(({identifier:d,label:h},g)=>f("option",{value:d,children:n(h)},g))})}),a.date_range==="custom"&&N(_t,{children:[f(U,{leftSide:n("start_date"),children:f(ke,{type:"date",value:a.start_date,onValueChange:d=>c(d,"start_date"),errorMessage:e==null?void 0:e.errors.start_date})}),f(U,{leftSide:n("end_date"),children:f(ke,{type:"date",value:a.end_date,onValueChange:d=>c(d,"end_date"),errorMessage:e==null?void 0:e.errors.end_date})})]})]})}var QKt=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function e5(n,e){var t=XKt(n);if(typeof t.path!="string"){var i=n.webkitRelativePath;Object.defineProperty(t,"path",{value:typeof e=="string"?e:typeof i=="string"&&i.length>0?i:n.name,writable:!1,configurable:!1,enumerable:!0})}return t}function XKt(n){var e=n.name,t=e&&e.lastIndexOf(".")!==-1;if(t&&!n.type){var i=e.split(".").pop().toLowerCase(),r=QKt.get(i);r&&Object.defineProperty(n,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return n}var ZKt=[".DS_Store","Thumbs.db"];function JKt(n){return j2(this,void 0,void 0,function(){return U2(this,function(e){return sV(n)&&eGt(n.dataTransfer)?[2,rGt(n.dataTransfer,n.type)]:tGt(n)?[2,nGt(n)]:Array.isArray(n)&&n.every(function(t){return"getFile"in t&&typeof t.getFile=="function"})?[2,iGt(n)]:[2,[]]})})}function eGt(n){return sV(n)}function tGt(n){return sV(n)&&sV(n.target)}function sV(n){return typeof n=="object"&&n!==null}function nGt(n){return cre(n.target.files).map(function(e){return e5(e)})}function iGt(n){return j2(this,void 0,void 0,function(){var e;return U2(this,function(t){switch(t.label){case 0:return[4,Promise.all(n.map(function(i){return i.getFile()}))];case 1:return e=t.sent(),[2,e.map(function(i){return e5(i)})]}})})}function rGt(n,e){return j2(this,void 0,void 0,function(){var t,i;return U2(this,function(r){switch(r.label){case 0:return n.items?(t=cre(n.items).filter(function(o){return o.kind==="file"}),e!=="drop"?[2,t]:[4,Promise.all(t.map(oGt))]):[3,2];case 1:return i=r.sent(),[2,_Te(ZVe(i))];case 2:return[2,_Te(cre(n.files).map(function(o){return e5(o)}))]}})})}function _Te(n){return n.filter(function(e){return ZKt.indexOf(e.name)===-1})}function cre(n){if(n===null)return[];for(var e=[],t=0;t<n.length;t++){var i=n[t];e.push(i)}return e}function oGt(n){if(typeof n.webkitGetAsEntry!="function")return vTe(n);var e=n.webkitGetAsEntry();return e&&e.isDirectory?JVe(e):vTe(n)}function ZVe(n){return n.reduce(function(e,t){return uD(uD([],ywe(e),!1),ywe(Array.isArray(t)?ZVe(t):[t]),!1)},[])}function vTe(n){var e=n.getAsFile();if(!e)return Promise.reject("".concat(n," is not a File"));var t=e5(e);return Promise.resolve(t)}function sGt(n){return j2(this,void 0,void 0,function(){return U2(this,function(e){return[2,n.isDirectory?JVe(n):aGt(n)]})})}function JVe(n){var e=n.createReader();return new Promise(function(t,i){var r=[];function o(){var s=this;e.readEntries(function(a){return j2(s,void 0,void 0,function(){var l,c,u;return U2(this,function(d){switch(d.label){case 0:if(a.length)return[3,5];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,Promise.all(r)];case 2:return l=d.sent(),t(l),[3,4];case 3:return c=d.sent(),i(c),[3,4];case 4:return[3,6];case 5:u=Promise.all(a.map(sGt)),r.push(u),o(),d.label=6;case 6:return[2]}})})},function(a){i(a)})}o()})}function aGt(n){return j2(this,void 0,void 0,function(){return U2(this,function(e){return[2,new Promise(function(t,i){n.file(function(r){var o=e5(r,n.fullPath);t(o)},function(r){i(r)})})]})})}var lGt=function(n,e){if(n&&e){var t=Array.isArray(e)?e:e.split(","),i=n.name||"",r=(n.type||"").toLowerCase(),o=r.replace(/\/.*$/,"");return t.some(function(s){var a=s.trim().toLowerCase();return a.charAt(0)==="."?i.toLowerCase().endsWith(a):a.endsWith("/*")?o===a.replace(/\/.*$/,""):r===a})}return!0};function bTe(n){return dGt(n)||uGt(n)||tHe(n)||cGt()}function cGt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uGt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function dGt(n){if(Array.isArray(n))return ure(n)}function yTe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function CTe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?yTe(Object(t),!0).forEach(function(i){eHe(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):yTe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function eHe(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sM(n,e){return gGt(n)||fGt(n,e)||tHe(n,e)||hGt()}function hGt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tHe(n,e){if(n){if(typeof n=="string")return ure(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ure(n,e)}}function ure(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function fGt(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i=[],r=!0,o=!1,s,a;try{for(t=t.call(n);!(r=(s=t.next()).done)&&(i.push(s.value),!(e&&i.length===e));r=!0);}catch(l){o=!0,a=l}finally{try{!r&&t.return!=null&&t.return()}finally{if(o)throw a}}return i}}function gGt(n){if(Array.isArray(n))return n}var pGt="file-invalid-type",mGt="file-too-large",_Gt="file-too-small",vGt="too-many-files",bGt=function(e){e=Array.isArray(e)&&e.length===1?e[0]:e;var t=Array.isArray(e)?"one of ".concat(e.join(", ")):e;return{code:pGt,message:"File type must be ".concat(t)}},wTe=function(e){return{code:mGt,message:"File is larger than ".concat(e," ").concat(e===1?"byte":"bytes")}},STe=function(e){return{code:_Gt,message:"File is smaller than ".concat(e," ").concat(e===1?"byte":"bytes")}},yGt={code:vGt,message:"Too many files"};function nHe(n,e){var t=n.type==="application/x-moz-file"||lGt(n,e);return[t,t?null:bGt(e)]}function iHe(n,e,t){if(nE(n.size))if(nE(e)&&nE(t)){if(n.size>t)return[!1,wTe(t)];if(n.size<e)return[!1,STe(e)]}else{if(nE(e)&&n.size<e)return[!1,STe(e)];if(nE(t)&&n.size>t)return[!1,wTe(t)]}return[!0,null]}function nE(n){return n!=null}function CGt(n){var e=n.files,t=n.accept,i=n.minSize,r=n.maxSize,o=n.multiple,s=n.maxFiles,a=n.validator;return!o&&e.length>1||o&&s>=1&&e.length>s?!1:e.every(function(l){var c=nHe(l,t),u=sM(c,1),d=u[0],h=iHe(l,i,r),g=sM(h,1),p=g[0],m=a?a(l):null;return d&&p&&!m})}function aV(n){return typeof n.isPropagationStopped=="function"?n.isPropagationStopped():typeof n.cancelBubble<"u"?n.cancelBubble:!1}function X6(n){return n.dataTransfer?Array.prototype.some.call(n.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!n.target&&!!n.target.files}function ETe(n){n.preventDefault()}function wGt(n){return n.indexOf("MSIE")!==-1||n.indexOf("Trident/")!==-1}function SGt(n){return n.indexOf("Edge/")!==-1}function EGt(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return wGt(n)||SGt(n)}function q_(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return function(i){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return e.some(function(a){return!aV(i)&&a&&a.apply(void 0,[i].concat(o)),aV(i)})}}function xGt(){return"showOpenFilePicker"in window}function kGt(n){if(nE(n)){var e=Object.entries(n).filter(function(t){var i=sM(t,2),r=i[0],o=i[1],s=!0;return rHe(r)||(console.warn('Skipped "'.concat(r,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),s=!1),(!Array.isArray(o)||!o.every(oHe))&&(console.warn('Skipped "'.concat(r,'" because an invalid file extension was provided.')),s=!1),s}).reduce(function(t,i){var r=sM(i,2),o=r[0],s=r[1];return CTe(CTe({},t),{},eHe({},o,s))},{});return[{description:"Files",accept:e}]}return n}function TGt(n){if(nE(n))return Object.entries(n).reduce(function(e,t){var i=sM(t,2),r=i[0],o=i[1];return[].concat(bTe(e),[r],bTe(o))},[]).filter(function(e){return rHe(e)||oHe(e)}).join(",")}function IGt(n){return n instanceof DOMException&&(n.name==="AbortError"||n.code===n.ABORT_ERR)}function LGt(n){return n instanceof DOMException&&(n.name==="SecurityError"||n.code===n.SECURITY_ERR)}function rHe(n){return n==="audio/*"||n==="video/*"||n==="image/*"||n==="text/*"||/\w+\/[-+.\w]+/g.test(n)}function oHe(n){return/^.*\.[\w]+$/.test(n)}var DGt=["children"],AGt=["open"],RGt=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],NGt=["refKey","onChange","onClick"];function OGt(n){return FGt(n)||MGt(n)||sHe(n)||PGt()}function PGt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MGt(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function FGt(n){if(Array.isArray(n))return dre(n)}function wX(n,e){return VGt(n)||$Gt(n,e)||sHe(n,e)||BGt()}function BGt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sHe(n,e){if(n){if(typeof n=="string")return dre(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return dre(n,e)}}function dre(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function $Gt(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var i=[],r=!0,o=!1,s,a;try{for(t=t.call(n);!(r=(s=t.next()).done)&&(i.push(s.value),!(e&&i.length===e));r=!0);}catch(l){o=!0,a=l}finally{try{!r&&t.return!=null&&t.return()}finally{if(o)throw a}}return i}}function VGt(n){if(Array.isArray(n))return n}function xTe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Qa(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xTe(Object(t),!0).forEach(function(i){hre(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xTe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function hre(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lV(n,e){if(n==null)return{};var t=HGt(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function HGt(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}var Rpe=w.forwardRef(function(n,e){var t=n.children,i=lV(n,DGt),r=hA(i),o=r.open,s=lV(r,AGt);return w.useImperativeHandle(e,function(){return{open:o}},[o]),te.createElement(w.Fragment,null,t(Qa(Qa({},s),{},{open:o})))});Rpe.displayName="Dropzone";var aHe={disabled:!1,getFilesFromEvent:JKt,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Rpe.defaultProps=aHe;Rpe.propTypes={children:Pe.func,accept:Pe.objectOf(Pe.arrayOf(Pe.string)),multiple:Pe.bool,preventDropOnDocument:Pe.bool,noClick:Pe.bool,noKeyboard:Pe.bool,noDrag:Pe.bool,noDragEventsBubbling:Pe.bool,minSize:Pe.number,maxSize:Pe.number,maxFiles:Pe.number,disabled:Pe.bool,getFilesFromEvent:Pe.func,onFileDialogCancel:Pe.func,onFileDialogOpen:Pe.func,useFsAccessApi:Pe.bool,autoFocus:Pe.bool,onDragEnter:Pe.func,onDragLeave:Pe.func,onDragOver:Pe.func,onDrop:Pe.func,onDropAccepted:Pe.func,onDropRejected:Pe.func,onError:Pe.func,validator:Pe.func};var fre={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function hA(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=Qa(Qa({},aHe),n),t=e.accept,i=e.disabled,r=e.getFilesFromEvent,o=e.maxSize,s=e.minSize,a=e.multiple,l=e.maxFiles,c=e.onDragEnter,u=e.onDragLeave,d=e.onDragOver,h=e.onDrop,g=e.onDropAccepted,p=e.onDropRejected,m=e.onFileDialogCancel,_=e.onFileDialogOpen,v=e.useFsAccessApi,b=e.autoFocus,y=e.preventDropOnDocument,C=e.noClick,x=e.noKeyboard,k=e.noDrag,I=e.noDragEventsBubbling,L=e.onError,D=e.validator,R=w.useMemo(function(){return TGt(t)},[t]),P=w.useMemo(function(){return kGt(t)},[t]),M=w.useMemo(function(){return typeof _=="function"?_:kTe},[_]),O=w.useMemo(function(){return typeof m=="function"?m:kTe},[m]),B=w.useRef(null),F=w.useRef(null),H=w.useReducer(WGt,fre),V=wX(H,2),$=V[0],j=V[1],Y=$.isFocused,ne=$.isFileDialogActive,se=w.useRef(typeof window<"u"&&window.isSecureContext&&v&&xGt()),he=function(){!se.current&&ne&&setTimeout(function(){if(F.current){var oe=F.current.files;oe.length||(j({type:"closeDialog"}),O())}},300)};w.useEffect(function(){return window.addEventListener("focus",he,!1),function(){window.removeEventListener("focus",he,!1)}},[F,ne,O,se]);var xe=w.useRef([]),_e=function(oe){B.current&&B.current.contains(oe.target)||(oe.preventDefault(),xe.current=[])};w.useEffect(function(){return y&&(document.addEventListener("dragover",ETe,!1),document.addEventListener("drop",_e,!1)),function(){y&&(document.removeEventListener("dragover",ETe),document.removeEventListener("drop",_e))}},[B,y]),w.useEffect(function(){return!i&&b&&B.current&&B.current.focus(),function(){}},[B,b,i]);var Ie=w.useCallback(function(K){L?L(K):console.error(K)},[L]),Re=w.useCallback(function(K){K.preventDefault(),K.persist(),pe(K),xe.current=[].concat(OGt(xe.current),[K.target]),X6(K)&&Promise.resolve(r(K)).then(function(oe){if(!(aV(K)&&!I)){var le=oe.length,we=le>0&&CGt({files:oe,accept:R,minSize:s,maxSize:o,multiple:a,maxFiles:l,validator:D}),Me=le>0&&!we;j({isDragAccept:we,isDragReject:Me,isDragActive:!0,type:"setDraggedFiles"}),c&&c(K)}}).catch(function(oe){return Ie(oe)})},[r,c,Ie,I,R,s,o,a,l,D]),Ye=w.useCallback(function(K){K.preventDefault(),K.persist(),pe(K);var oe=X6(K);if(oe&&K.dataTransfer)try{K.dataTransfer.dropEffect="copy"}catch{}return oe&&d&&d(K),!1},[d,I]),Ze=w.useCallback(function(K){K.preventDefault(),K.persist(),pe(K);var oe=xe.current.filter(function(we){return B.current&&B.current.contains(we)}),le=oe.indexOf(K.target);le!==-1&&oe.splice(le,1),xe.current=oe,!(oe.length>0)&&(j({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),X6(K)&&u&&u(K))},[B,u,I]),tt=w.useCallback(function(K,oe){var le=[],we=[];K.forEach(function(Me){var ft=nHe(Me,R),Nt=wX(ft,2),Yt=Nt[0],He=Nt[1],Dt=iHe(Me,s,o),ae=wX(Dt,2),Se=ae[0],Xe=ae[1],wt=D?D(Me):null;if(Yt&&Se&&!wt)le.push(Me);else{var Tt=[He,Xe];wt&&(Tt=Tt.concat(wt)),we.push({file:Me,errors:Tt.filter(function(zt){return zt})})}}),(!a&&le.length>1||a&&l>=1&&le.length>l)&&(le.forEach(function(Me){we.push({file:Me,errors:[yGt]})}),le.splice(0)),j({acceptedFiles:le,fileRejections:we,type:"setFiles"}),h&&h(le,we,oe),we.length>0&&p&&p(we,oe),le.length>0&&g&&g(le,oe)},[j,a,R,s,o,l,h,g,p,D]),Be=w.useCallback(function(K){K.preventDefault(),K.persist(),pe(K),xe.current=[],X6(K)&&Promise.resolve(r(K)).then(function(oe){aV(K)&&!I||tt(oe,K)}).catch(function(oe){return Ie(oe)}),j({type:"reset"})},[r,tt,Ie,I]),kt=w.useCallback(function(){if(se.current){j({type:"openDialog"}),M();var K={multiple:a,types:P};window.showOpenFilePicker(K).then(function(oe){return r(oe)}).then(function(oe){tt(oe,null),j({type:"closeDialog"})}).catch(function(oe){IGt(oe)?(O(oe),j({type:"closeDialog"})):LGt(oe)?(se.current=!1,F.current?(F.current.value=null,F.current.click()):Ie(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):Ie(oe)});return}F.current&&(j({type:"openDialog"}),M(),F.current.value=null,F.current.click())},[j,M,O,v,tt,Ie,P,a]),Vt=w.useCallback(function(K){!B.current||!B.current.isEqualNode(K.target)||(K.key===" "||K.key==="Enter"||K.keyCode===32||K.keyCode===13)&&(K.preventDefault(),kt())},[B,kt]),xt=w.useCallback(function(){j({type:"focus"})},[]),Kt=w.useCallback(function(){j({type:"blur"})},[]),cn=w.useCallback(function(){C||(EGt()?setTimeout(kt,0):kt())},[C,kt]),wn=function(oe){return i?null:oe},on=function(oe){return x?null:wn(oe)},Zt=function(oe){return k?null:wn(oe)},pe=function(oe){I&&oe.stopPropagation()},me=w.useMemo(function(){return function(){var K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},oe=K.refKey,le=oe===void 0?"ref":oe,we=K.role,Me=K.onKeyDown,ft=K.onFocus,Nt=K.onBlur,Yt=K.onClick,He=K.onDragEnter,Dt=K.onDragOver,ae=K.onDragLeave,Se=K.onDrop,Xe=lV(K,RGt);return Qa(Qa(hre({onKeyDown:on(q_(Me,Vt)),onFocus:on(q_(ft,xt)),onBlur:on(q_(Nt,Kt)),onClick:wn(q_(Yt,cn)),onDragEnter:Zt(q_(He,Re)),onDragOver:Zt(q_(Dt,Ye)),onDragLeave:Zt(q_(ae,Ze)),onDrop:Zt(q_(Se,Be)),role:typeof we=="string"&&we!==""?we:"presentation"},le,B),!i&&!x?{tabIndex:0}:{}),Xe)}},[B,Vt,xt,Kt,cn,Re,Ye,Ze,Be,x,k,i]),Z=w.useCallback(function(K){K.stopPropagation()},[]),G=w.useMemo(function(){return function(){var K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},oe=K.refKey,le=oe===void 0?"ref":oe,we=K.onChange,Me=K.onClick,ft=lV(K,NGt),Nt=hre({accept:R,multiple:a,type:"file",style:{display:"none"},onChange:wn(q_(we,Be)),onClick:wn(q_(Me,Z)),tabIndex:-1},le,F);return Qa(Qa({},Nt),ft)}},[F,t,a,Be,i]);return Qa(Qa({},$),{},{isFocused:Y&&!i,getRootProps:me,getInputProps:G,rootRef:B,inputRef:F,open:wn(kt)})}function WGt(n,e){switch(e.type){case"focus":return Qa(Qa({},n),{},{isFocused:!0});case"blur":return Qa(Qa({},n),{},{isFocused:!1});case"openDialog":return Qa(Qa({},fre),{},{isFileDialogActive:!0});case"closeDialog":return Qa(Qa({},n),{},{isFileDialogActive:!1});case"setDraggedFiles":return Qa(Qa({},n),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return Qa(Qa({},n),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections});case"reset":return Qa({},fre);default:return n}}function kTe(){}function zGt(n){const[e]=ue(),t=Vn(),{group:i,files:r,setFiles:o}=n,[s,a]=w.useState([]),l=p=>{o(m=>m.filter(({file:_})=>_!==p))},c=p=>new Promise(m=>{try{const _=new FileReader;_.onload=v=>{var C;const y=(((C=v.target)==null?void 0:C.result)||"").split(`
`);!y.length||y.length===1||y.length===2&&!y[1]?m(!1):m(!0)},_.readAsText(p)}catch{m(!1)}}),u=async p=>{for(let m=0;m<p.length;m++)if(!await c(p[m]))return!1;return!0},{getRootProps:d,getInputProps:h,isDragActive:g}=hA({accept:{"text/*":[".csv"]},onDrop:async p=>{await u(p)?p.forEach(_=>{o(v=>[...v,{group:i,file:_}])}):ie.error("csv_rows_length")}});return w.useEffect(()=>{a(r.filter(({group:p})=>p===i).map(({file:p})=>p))},[r]),f(U,{leftSide:e(i),children:s.length?f("ul",{className:"grid xs:grid-rows-6 lg:grid-cols-2",children:s.map((p,m)=>N("li",{className:"flex items-center hover:bg-gray-50 cursor-pointer p-2",children:[p.name," - ",(p.size/1024).toPrecision(2)," KB"," ",f(f0,{fontSize:15,className:"cursor-pointer ml-3",onClick:()=>l(p)})]},m))}):f("div",{...d(),className:"flex flex-col md:flex-row md:items-center",children:N("div",{className:"relative block w-full border-2 border-gray-300 border-dashed rounded-lg p-12 text-center hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:[f("input",{...h()}),f(px,{className:"mx-auto h-12 w-12",style:{color:t.$3,colorScheme:t.$0}}),f("span",{className:"mt-2 block text-sm font-medium",style:{color:t.$3,colorScheme:t.$0},children:e(g?"drop_file_here":"dropzone_default_message")})]})})})}const jGt={clients:"client",invoices:"invoice",accounting:"invoice",contacts:"client"},TTe={freshbooks:["clients","invoices"],invoice2go:["invoices"],invoicely:["clients","invoices"],waveaccounting:["clients","accounting"],zoho:["contacts","invoices"]};function UGt(){const[n]=ue(),[e,t]=w.useState("freshbooks"),[i,r]=w.useState([]),[o,s]=w.useState(),[a,l]=w.useState(!1),c=()=>{if(!a){ie.processing(),l(!0);const d=new FormData;d.append("import_type",e),i.forEach(({file:h,group:g})=>{d.append(`files[${jGt[g]}]`,h)}),Te("POST",ye("/api/v1/import"),d).then(h=>ie.success(h.data.message)).catch(h=>{var g;((g=h.response)==null?void 0:g.status)===422&&(ie.dismiss(),s(h.response.data))}).finally(()=>{l(!1),r([])})}},u=()=>TTe[e].some(d=>!i.filter(({group:h})=>h===d).length);return w.useEffect(()=>{s(void 0),r([])},[e]),N(Ot,{title:n("import"),saveButtonLabel:n("import"),onSaveClick:d=>{d.preventDefault(),c()},disableSubmitButton:u()||a,withSaveButton:!0,disableWithoutIcon:!0,children:[f(U,{leftSide:n("import_type"),children:N(nn,{value:e,onValueChange:d=>t(d),errorMessage:o==null?void 0:o.errors.import_type,children:[f("option",{value:"freshbooks",children:n("freshbooks")}),f("option",{value:"invoice2go",children:n("invoice2go")}),f("option",{value:"invoicely",children:n("invoicely")}),f("option",{value:"waveaccounting",children:n("waveaccounting")}),f("option",{value:"zoho",children:n("zoho")})]})}),TTe[e].map(d=>f(zGt,{group:d,files:i,setFiles:r},d)),f(U,{children:o&&Object.keys(o.errors).map((d,h)=>d!=="import_type"&&f(bs,{type:"danger",children:o.errors[d]},h))})]})}function qGt(){gi("import_export");const[n]=ue(),e=[{name:n("settings"),href:"/settings"},{name:n("import_export"),href:"/settings/import_export"}];return N($i,{title:n("import_export"),breadcrumbs:e,docsLink:"en/basic-settings/#import_export",children:[f(UGt,{}),f(YKt,{})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function KGt(){const[n]=ue();let e=[{name:n("plan"),href:"/settings/account_management"},{name:n("overview"),href:"/settings/account_management/overview"},{name:n("enabled_modules"),href:"/settings/account_management/enabled_modules"},{name:n("integrations"),href:"/settings/account_management/integrations"},{name:n("security_settings"),href:"/settings/account_management/security_settings"}];return e=e,u0()?e:[...e,{name:n("danger_zone"),href:"/settings/account_management/danger_zone"}]}function GGt(){const[n]=ue(),e=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"}];gi("account_management"),bc();const t=pu(),i=vf(),r=KGt();return N($i,{onSaveClick:t,onCancelClick:i,title:n("account_management"),breadcrumbs:e,docsLink:"en/basic-settings/#account_management",children:[f(Vw,{tabs:r,className:"mt-6"}),f("div",{className:"my-4",children:f(ah,{})})]})}function YGt(){gi("custom_fields");const[n]=ue(),e=[{name:n("settings"),href:"/settings"},{name:n("custom_fields"),href:"/settings/custom_fields"}],t=[{name:n("company"),href:"/settings/custom_fields/company"},{name:n("clients"),href:"/settings/custom_fields/clients"},{name:n("products"),href:"/settings/custom_fields/products"},{name:n("invoices"),href:"/settings/custom_fields/invoices"},{name:n("payments"),href:"/settings/custom_fields/payments"},{name:n("projects"),href:"/settings/custom_fields/projects"},{name:n("tasks"),href:"/settings/custom_fields/tasks"},{name:n("vendors"),href:"/settings/custom_fields/vendors"},{name:n("expenses"),href:"/settings/custom_fields/expenses"},{name:n("users"),href:"/settings/custom_fields/users"}],i=ol(),r=pu(),o=vf();return N($i,{title:n("custom_fields"),breadcrumbs:e,docsLink:"en/advanced-settings/#custom_fields",onSaveClick:r,onCancelClick:o,children:[i.pathname.endsWith("custom_fields")&&f(aD,{to:"/settings/custom_fields/company"}),f(Vw,{tabs:t}),f(ope,{}),f(ah,{})]})}function QGt(){gi("custom_fields");const[n]=ue(),e=`${n("custom_fields")}: ${n("company")}`,t=Ti(),i=em();return t?f(Ot,{title:e,children:["company1","company2","company3","company4"].map(r=>f(uf,{field:r,placeholder:n("company_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}):null}function XGt(){gi("custom_fields");const[n]=ue(),e=`${n("custom_fields")}: ${n("clients")}`,t=Ti(),i=em();return t?N(_t,{children:[f(Ot,{title:e,children:["client1","client2","client3","client4"].map(r=>f(uf,{field:r,placeholder:n("client_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}),f(Ot,{title:`${n("custom_fields")}: ${n("contacts")}`,children:["contact1","contact2","contact3","contact4"].map(r=>f(uf,{field:r,placeholder:n("contact_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))})]}):null}function ZGt(){gi("custom_fields");const[n]=ue(),e=`${n("custom_fields")}: ${n("products")}`,t=Ti(),i=em();return t?f(Ot,{title:e,children:["product1","product2","product3","product4"].map(r=>f(uf,{field:r,placeholder:n("product_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}):null}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function JGt(){const n=bc(),e=Ci();return(t,i)=>{if(i===""){const r=Bn.cloneDeep(n);return r&&delete r.custom_fields[t],e(gx({object:"company",data:r}))}e(Vr({object:"company",property:`custom_fields.${t}`,value:i}))}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function eYt(){const n=Ci(),e=vi();return t=>{switch(t){case 0:n(Vr({object:"company",property:"custom_surcharge_taxes1",value:!(e!=null&&e.custom_surcharge_taxes1)}));break;case 1:n(Vr({object:"company",property:"custom_surcharge_taxes2",value:!(e!=null&&e.custom_surcharge_taxes2)}));break;case 2:n(Vr({object:"company",property:"custom_surcharge_taxes3",value:!(e!=null&&e.custom_surcharge_taxes3)}));break;case 3:n(Vr({object:"company",property:"custom_surcharge_taxes4",value:!(e!=null&&e.custom_surcharge_taxes4)}));break}}}function tYt(){const[n]=ue(),e=ipe(),t=Ti(),i=em(),r=JGt(),o=a=>{switch(a){case 0:return t==null?void 0:t.custom_surcharge_taxes1;case 1:return t==null?void 0:t.custom_surcharge_taxes2;case 2:return t==null?void 0:t.custom_surcharge_taxes3;case 3:return t==null?void 0:t.custom_surcharge_taxes4}},s=eYt();return t?N(Ot,{title:`${n("custom_fields")}: ${n("invoices")}`,children:[["invoice1","invoice2","invoice3","invoice4"].map(a=>f(uf,{field:a,placeholder:n("invoice_field"),onChange:l=>i(a,l),initialValue:t.custom_fields[a]},a)),f(Jn,{}),t&&["surcharge1","surcharge2","surcharge3","surcharge4"].map((a,l)=>f(U,{leftSide:f(ke,{id:a,value:t.custom_fields[a],placeholder:n("surcharge_field"),onValueChange:c=>r(a,c),disabled:e}),children:f(gt,{label:n("charge_taxes"),checked:o(l),onChange:()=>s(l)})},l))]}):null}function nYt(){gi("custom_fields");const[n]=ue(),e=`${n("custom_fields")}: ${n("payments")}`,t=Ti(),i=em();return t?f(Ot,{title:e,children:["payment1","payment2","payment3","payment4"].map(r=>f(uf,{field:r,placeholder:n("payment_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}):null}function iYt(){gi("custom_fields");const[n]=ue(),e=`${n("custom_fields")}: ${n("projects")}`,t=Ti(),i=em();return t?f(Ot,{title:e,children:["project1","project2","project3","project4"].map(r=>f(uf,{field:r,placeholder:n("project_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}):null}function rYt(){gi("custom_fields");const[n]=ue(),e=`${n("custom_fields")}: ${n("tasks")}`,t=Ti(),i=em();return t?f(Ot,{title:e,children:["task1","task2","task3","task4"].map(r=>f(uf,{field:r,placeholder:n("task_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}):null}function oYt(){gi("custom_fields");const[n]=ue(),e=`${n("custom_fields")}: ${n("vendors")}`,t=Ti(),i=em();return t?N(_t,{children:[f(Ot,{title:e,children:["vendor1","vendor2","vendor3","vendor4"].map(r=>f(uf,{field:r,placeholder:n("vendor_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}),f(Ot,{title:`${n("custom_fields")}: ${n("contacts")}`,children:["vendor_contact1","vendor_contact2","vendor_contact3","vendor_contact4"].map(r=>f(uf,{field:r,placeholder:n("contact_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))})]}):null}function sYt(){gi("custom_fields");const[n]=ue(),e=`${n("custom_fields")}: ${n("expenses")}`,t=Ti(),i=em();return t?f(Ot,{title:e,children:["expense1","expense2","expense3","expense4"].map(r=>f(uf,{field:r,placeholder:n("expense_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}):null}function aYt(){gi("custom_fields");const[n]=ue(),e=`${n("custom_fields")}: ${n("users")}`,t=Ti(),i=em();return t?f(Ot,{title:e,children:["user1","user2","user3","user4"].map(r=>f(uf,{field:r,placeholder:n("user_field"),onChange:o=>i(r,o),initialValue:t.custom_fields[r]},r))}):null}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function L0(){return!Wp()&&!ql()&&Yo()}function xb(n){const[e]=ue(),t=ha();return f(_t,{children:f("div",{className:n.className,children:f(bs,{className:"mb-4",type:"warning",disableClosing:!0,children:N("div",{className:"flex items-center",children:[f(yD,{className:"mr-2",fontSize:20}),n.message?n.message:e("start_free_trial_message"),(t==null?void 0:t.company_user)&&f(Ii,{className:"ml-10",external:!0,to:t.company_user.ninja_portal_url,children:e("plan_change")})]})})})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function lYt(){const{t:n}=ue();return[{name:n("settings"),href:dt("/settings/generated_numbers")},{name:n("clients"),href:dt("/settings/generated_numbers/clients")},{name:n("invoices"),href:dt("/settings/generated_numbers/invoices")},{name:n("recurring_invoices"),href:dt("/settings/generated_numbers/recurring_invoices")},{name:n("payments"),href:dt("/settings/generated_numbers/payments")},{name:n("quotes"),href:dt("/settings/generated_numbers/quotes")},{name:n("credits"),href:dt("/settings/generated_numbers/credits")},{name:n("projects"),href:dt("/settings/generated_numbers/projects")},{name:n("tasks"),href:dt("/settings/generated_numbers/tasks")},{name:n("vendors"),href:dt("/settings/generated_numbers/vendors")},{name:n("purchase_orders"),href:dt("/settings/generated_numbers/purchase_orders")},{name:n("expenses"),href:dt("/settings/generated_numbers/expenses")},{name:n("recurring_expenses"),href:dt("/settings/generated_numbers/recurring_expenses")}]}function cYt(){gi("generated_numbers");const[n]=ue(),e=[{name:n("settings"),href:"/settings"},{name:n("generated_numbers"),href:"/settings/generated_numbers"}];bc();const t=lYt(),i=pu(),r=vf(),o=L0();return N($i,{title:n("generated_numbers"),docsLink:"en/advanced-settings/#generated_numbers",breadcrumbs:e,onSaveClick:i,onCancelClick:r,disableSaveButton:o,children:[f(Vw,{tabs:t,className:"mt-6"}),o&&f(xb,{}),f("div",{className:"my-4",children:f(ah,{})})]})}function tm(){const[n]=ue();return f(Ii,{className:"pl-6",to:"https://invoiceninja.github.io/en/custom-fields/#custom-fields",external:!0,children:n("click_to_variables")})}function uYt(){var l,c;const[n]=ue(),[e,t]=w.useState(""),i=Ti(),r=Zs(),o=ki(Ss),s=Fo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Ot,{title:n("clients"),children:[f(U,{leftSide:f(bt,{propertyKey:"client_number_pattern",labelElement:f(yt,{label:n("number_pattern")})}),children:f(ke,{value:((l=i==null?void 0:i.settings)==null?void 0:l.client_number_pattern)||"",onValueChange:u=>s("settings.client_number_pattern",u),disabled:r("client_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.client_number_pattern"]})}),f(U,{leftSide:f(bt,{propertyKey:"client_number_counter",labelElement:f(yt,{label:n("number_counter")})}),children:f(ke,{type:"number",value:((c=i==null?void 0:i.settings)==null?void 0:c.client_number_counter)||"",onValueChange:u=>s("settings.client_number_counter",parseFloat(u)||0),disabled:r("client_number_counter"),errorMessage:o==null?void 0:o.errors["settings.client_number_counter"]})}),f(Jn,{}),a.map((u,d)=>f(Ja,{onClick:()=>t(e+u),children:f(ec,{text:u})},d)),f(Jn,{}),f(tm,{})]})}function dYt(){var l,c;const[n]=ue(),[e,t]=w.useState(""),i=Ti(),r=Zs(),o=ki(Ss),s=Fo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Ot,{title:n("invoices"),children:[f(U,{leftSide:f(bt,{propertyKey:"invoice_number_pattern",labelElement:f(yt,{label:n("number_pattern")})}),children:f(ke,{value:((l=i==null?void 0:i.settings)==null?void 0:l.invoice_number_pattern)||"",onValueChange:u=>s("settings.invoice_number_pattern",u),disabled:r("invoice_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.invoice_number_pattern"]})}),f(U,{leftSide:f(bt,{propertyKey:"invoice_number_counter",labelElement:f(yt,{label:n("number_counter")})}),children:f(ke,{type:"number",value:((c=i==null?void 0:i.settings)==null?void 0:c.invoice_number_counter)||"",onValueChange:u=>s("settings.invoice_number_counter",parseFloat(u)||0),disabled:r("invoice_number_counter"),errorMessage:o==null?void 0:o.errors["settings.invoice_number_counter"]})}),f(Jn,{}),a.map((u,d)=>f(Ja,{onClick:()=>t(e+u),children:f(ec,{text:u})},d)),f(Jn,{}),f(tm,{})]})}function hYt(){var l,c;const[n]=ue(),[e,t]=w.useState(""),i=Ti(),r=Zs(),o=ki(Ss),s=Fo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Ot,{title:n("recurring_invoices"),children:[f(U,{leftSide:f(bt,{propertyKey:"recurring_invoice_number_pattern",labelElement:f(yt,{label:n("number_pattern")})}),children:f(ke,{value:((l=i==null?void 0:i.settings)==null?void 0:l.recurring_invoice_number_pattern)||"",onValueChange:u=>s("settings.recurring_invoice_number_pattern",u),disabled:r("recurring_invoice_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.recurring_invoice_number_pattern"]})}),f(U,{leftSide:f(bt,{propertyKey:"recurring_invoice_number_counter",labelElement:f(yt,{label:n("number_counter")})}),children:f(ke,{type:"number",value:((c=i==null?void 0:i.settings)==null?void 0:c.recurring_invoice_number_counter)||"",onValueChange:u=>s("settings.recurring_invoice_number_counter",parseFloat(u)||0),disabled:r("recurring_invoice_number_counter"),errorMessage:o==null?void 0:o.errors["settings.recurring_invoice_number_counter"]})}),f(Jn,{}),a.map((u,d)=>f(Ja,{onClick:()=>t(e+u),children:f(ec,{text:u})},d)),f(Jn,{}),f(tm,{})]})}function fYt(){var l,c;const[n]=ue(),[e,t]=w.useState(""),i=Ti(),r=Zs(),o=ki(Ss),s=Fo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Ot,{title:n("payments"),children:[f(U,{leftSide:f(bt,{propertyKey:"payment_number_pattern",labelElement:f(yt,{label:n("number_pattern")})}),children:f(ke,{value:((l=i==null?void 0:i.settings)==null?void 0:l.payment_number_pattern)||"",onValueChange:u=>s("settings.payment_number_pattern",u),disabled:r("payment_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.payment_number_pattern"]})}),f(U,{leftSide:f(bt,{propertyKey:"payment_number_counter",labelElement:f(yt,{label:n("number_counter")})}),children:f(ke,{type:"number",value:((c=i==null?void 0:i.settings)==null?void 0:c.payment_number_counter)||"",onValueChange:u=>s("settings.payment_number_counter",parseFloat(u)||0),disabled:r("payment_number_counter"),errorMessage:o==null?void 0:o.errors["settings.payment_number_counter"]})}),f(Jn,{}),a.map((u,d)=>f(Ja,{onClick:()=>t(e+u),children:f(ec,{text:u})},d)),f(Jn,{}),f(tm,{})]})}function gYt(){var l,c;const[n]=ue(),[e,t]=w.useState(""),i=Ti(),r=Zs(),o=ki(Ss),s=Fo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Ot,{title:n("quotes"),children:[f(U,{leftSide:f(bt,{propertyKey:"quote_number_pattern",labelElement:f(yt,{label:n("number_pattern")})}),children:f(ke,{value:((l=i==null?void 0:i.settings)==null?void 0:l.quote_number_pattern)||"",onValueChange:u=>s("settings.quote_number_pattern",u),disabled:r("quote_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.quote_number_pattern"]})}),f(U,{leftSide:f(bt,{propertyKey:"quote_number_counter",labelElement:f(yt,{label:n("number_counter")})}),children:f(ke,{type:"number",value:((c=i==null?void 0:i.settings)==null?void 0:c.quote_number_counter)||"",onValueChange:u=>s("settings.quote_number_counter",parseFloat(u)||0),disabled:r("quote_number_counter"),errorMessage:o==null?void 0:o.errors["settings.quote_number_counter"]})}),f(Jn,{}),a.map((u,d)=>f(Ja,{onClick:()=>t(e+u),children:f(ec,{text:u})},d)),f(Jn,{}),f(tm,{})]})}function pYt(){var l,c;const[n]=ue(),[e,t]=w.useState(""),i=Ti(),r=Zs(),o=ki(Ss),s=Fo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Ot,{title:n("credits"),children:[f(U,{leftSide:f(bt,{propertyKey:"credit_number_pattern",labelElement:f(yt,{label:n("number_pattern")})}),children:f(ke,{value:((l=i==null?void 0:i.settings)==null?void 0:l.credit_number_pattern)||"",onValueChange:u=>s("settings.credit_number_pattern",u),disabled:r("credit_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.credit_number_pattern"]})}),f(U,{leftSide:f(bt,{propertyKey:"credit_number_counter",labelElement:f(yt,{label:n("number_counter")})}),children:f(ke,{type:"number",value:((c=i==null?void 0:i.settings)==null?void 0:c.credit_number_counter)||"",onValueChange:u=>s("settings.credit_number_counter",parseFloat(u)||0),disabled:r("credit_number_counter"),errorMessage:o==null?void 0:o.errors["settings.credit_number_counter"]})}),f(Jn,{}),a.map((u,d)=>f(Ja,{onClick:()=>t(e+u),children:f(ec,{text:u})},d)),f(Jn,{}),f(tm,{})]})}function mYt(){var l,c;const[n]=ue(),[e,t]=w.useState(""),i=Ti(),r=Zs(),o=ki(Ss),s=Fo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Ot,{title:n("projects"),children:[f(U,{leftSide:f(bt,{propertyKey:"project_number_pattern",labelElement:f(yt,{label:n("number_pattern")})}),children:f(ke,{value:((l=i==null?void 0:i.settings)==null?void 0:l.project_number_pattern)||"",onValueChange:u=>s("settings.project_number_pattern",u),disabled:r("project_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.project_number_pattern"]})}),f(U,{leftSide:f(bt,{propertyKey:"project_number_counter",labelElement:f(yt,{label:n("number_counter")})}),children:f(ke,{type:"number",value:((c=i==null?void 0:i.settings)==null?void 0:c.project_number_counter)||"",onValueChange:u=>s("settings.project_number_counter",parseFloat(u)||0),disabled:r("project_number_counter"),errorMessage:o==null?void 0:o.errors["settings.project_number_counter"]})}),f(Jn,{}),a.map((u,d)=>f(Ja,{onClick:()=>t(e+u),children:f(ec,{text:u})},d)),f(Jn,{}),f(tm,{})]})}function _Yt(){var l,c;const[n]=ue(),[e,t]=w.useState(""),i=Ti(),r=Zs(),o=ki(Ss),s=Fo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Ot,{title:n("tasks"),children:[f(U,{leftSide:f(bt,{propertyKey:"task_number_pattern",labelElement:f(yt,{label:n("number_pattern")})}),children:f(ke,{value:((l=i==null?void 0:i.settings)==null?void 0:l.task_number_pattern)||"",onValueChange:u=>s("settings.task_number_pattern",u),disabled:r("task_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.task_number_pattern"]})}),f(U,{leftSide:f(bt,{propertyKey:"task_number_counter",labelElement:f(yt,{label:n("number_counter")})}),children:f(ke,{type:"number",value:((c=i==null?void 0:i.settings)==null?void 0:c.task_number_counter)||"",onValueChange:u=>s("settings.task_number_counter",parseFloat(u)||0),disabled:r("task_number_counter"),errorMessage:o==null?void 0:o.errors["settings.task_number_counter"]})}),f(Jn,{}),a.map((u,d)=>f(Ja,{onClick:()=>t(e+u),children:f(ec,{text:u})},d)),f(Jn,{}),f(tm,{})]})}function vYt(){var l,c;const[n]=ue(),[e,t]=w.useState(""),i=Ti(),r=Zs(),o=ki(Ss),s=Fo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Ot,{title:n("vendors"),children:[f(U,{leftSide:f(bt,{propertyKey:"vendor_number_pattern",labelElement:f(yt,{label:n("number_pattern")})}),children:f(ke,{value:((l=i==null?void 0:i.settings)==null?void 0:l.vendor_number_pattern)||"",onValueChange:u=>s("settings.vendor_number_pattern",u),disabled:r("vendor_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.vendor_number_pattern"]})}),f(U,{leftSide:f(bt,{propertyKey:"vendor_number_counter",labelElement:f(yt,{label:n("number_counter")})}),children:f(ke,{type:"number",value:((c=i==null?void 0:i.settings)==null?void 0:c.vendor_number_counter)||"",onValueChange:u=>s("settings.vendor_number_counter",parseFloat(u)||0),disabled:r("vendor_number_counter"),errorMessage:o==null?void 0:o.errors["settings.vendor_number_counter"]})}),f(Jn,{}),a.map((u,d)=>f(Ja,{onClick:()=>t(e+u),children:f(ec,{text:u})},d)),f(Jn,{}),f(tm,{})]})}function bYt(){var l,c;const[n]=ue(),[e,t]=w.useState(""),i=Ti(),r=Zs(),o=ki(Ss),s=Fo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Ot,{title:n("purchase_orders"),children:[f(U,{leftSide:f(bt,{propertyKey:"purchase_order_number_pattern",labelElement:f(yt,{label:n("number_pattern")})}),children:f(ke,{value:((l=i==null?void 0:i.settings)==null?void 0:l.purchase_order_number_pattern)||"",onValueChange:u=>s("settings.purchase_order_number_pattern",u),disabled:r("purchase_order_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.purchase_order_number_pattern"]})}),f(U,{leftSide:f(bt,{propertyKey:"purchase_order_number_counter",labelElement:f(yt,{label:n("number_counter")})}),children:f(ke,{type:"number",value:((c=i==null?void 0:i.settings)==null?void 0:c.purchase_order_number_counter)||"",onValueChange:u=>s("settings.purchase_order_number_counter",parseFloat(u)||0),disabled:r("purchase_order_number_counter"),errorMessage:o==null?void 0:o.errors["settings.purchase_order_number_counter"]})}),f(Jn,{}),a.map((u,d)=>f(Ja,{onClick:()=>t(e+u),children:f(ec,{text:u})},d)),f(Jn,{}),f(tm,{})]})}function yYt(){var l,c;const[n]=ue(),[e,t]=w.useState(""),i=Ti(),r=Zs(),o=ki(Ss),s=Fo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Ot,{title:n("expenses"),children:[f(U,{leftSide:f(bt,{propertyKey:"expense_number_pattern",labelElement:f(yt,{label:n("number_pattern")})}),children:f(ke,{value:((l=i==null?void 0:i.settings)==null?void 0:l.expense_number_pattern)||"",onValueChange:u=>s("settings.expense_number_pattern",u),disabled:r("expense_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.expense_number_pattern"]})}),f(U,{leftSide:f(bt,{propertyKey:"expense_number_counter",labelElement:f(yt,{label:n("number_counter")})}),children:f(ke,{type:"number",value:((c=i==null?void 0:i.settings)==null?void 0:c.expense_number_counter)||"",onValueChange:u=>s("settings.expense_number_counter",parseFloat(u)||0),disabled:r("expense_number_counter"),errorMessage:o==null?void 0:o.errors["settings.expense_number_counter"]})}),f(Jn,{}),a.map((u,d)=>f(Ja,{onClick:()=>t(e+u),children:f(ec,{text:u})},d)),f(Jn,{}),f(tm,{})]})}function CYt(){var l,c;const[n]=ue(),[e,t]=w.useState(""),i=Ti(),r=Zs(),o=ki(Ss),s=Fo(),a=["{$counter}","{$year}","{$date:Y-m-d}","{$user_id}","{$user_custom1}","{$user_custom2}","{$user_custom3}","{$user_custom4}"];return N(Ot,{title:n("recurring_expenses"),children:[f(U,{leftSide:f(bt,{propertyKey:"recurring_expense_number_pattern",labelElement:f(yt,{label:n("number_pattern")})}),children:f(ke,{value:((l=i==null?void 0:i.settings)==null?void 0:l.recurring_expense_number_pattern)||"",onValueChange:u=>s("settings.recurring_expense_number_pattern",u),disabled:r("recurring_expense_number_pattern"),errorMessage:o==null?void 0:o.errors["settings.recurring_expense_number_pattern"]})}),f(U,{leftSide:f(bt,{propertyKey:"recurring_expense_number_counter",labelElement:f(yt,{label:n("number_counter")})}),children:f(ke,{type:"number",value:((c=i==null?void 0:i.settings)==null?void 0:c.recurring_expense_number_counter)||"",onValueChange:u=>s("settings.recurring_expense_number_counter",parseFloat(u)||0),disabled:r("recurring_expense_number_counter"),errorMessage:o==null?void 0:o.errors["settings.recurring_expense_number_counter"]})}),f(Jn,{}),a.map((u,d)=>f(Ja,{onClick:()=>t(e+u),children:f(ec,{text:u})},d)),f(Jn,{}),f(tm,{})]})}const wYt=["1","01","001","0001","00001","000001","0000001","00000001","000000001","0000000001"],SYt=["never","freq_daily","freq_weekly","freq_two_weeks","freq_four_weeks","freq_monthly","freq_two_months","freq_three_months","freq_four_months","freq_six_months","freq_annually","freq_two_years","freq_three_years"];function EYt(){var o,s,a,l,c,u,d,h;const[n]=ue(),e=Zs(),t=bc(),i=Fo(),r=ki(Ss);return N(Ot,{title:n("settings"),children:[f(U,{leftSide:f(bt,{propertyKey:"counter_padding",labelElement:f(yt,{label:n("number_padding")}),defaultValue:"1"}),children:f(nn,{id:"settings.counter_padding",value:((o=t==null?void 0:t.settings)==null?void 0:o.counter_padding)||"1",onValueChange:g=>i("settings.counter_padding",g),disabled:e("counter_padding"),errorMessage:r==null?void 0:r.errors["settings.counter_padding"],children:wYt.map((g,p)=>f("option",{value:p+1,children:g},p))})}),f(U,{leftSide:f(bt,{propertyKey:"counter_number_applied",labelElement:f(yt,{label:n("generate_number")}),defaultValue:"when_saved"}),children:N(nn,{id:"settings.counter_number_applied",value:((s=t==null?void 0:t.settings)==null?void 0:s.counter_number_applied)||"when_saved",onValueChange:g=>i("settings.counter_number_applied",g),disabled:e("counter_number_applied"),errorMessage:r==null?void 0:r.errors["settings.counter_number_applied"],children:[f("option",{value:"when_saved",children:n("when_saved")}),f("option",{value:"when_sent",children:n("when_sent")})]})}),f(U,{leftSide:f(bt,{propertyKey:"recurring_number_prefix",labelElement:f(yt,{label:n("recurring_prefix")})}),children:f(ke,{value:((a=t==null?void 0:t.settings)==null?void 0:a.recurring_number_prefix)||"",onValueChange:g=>i("settings.recurring_number_prefix",g),disabled:e("recurring_number_prefix"),errorMessage:r==null?void 0:r.errors["settings.recurring_number_prefix"]})}),f(U,{leftSide:f(bt,{propertyKey:"shared_invoice_quote_counter",labelElement:f(yt,{label:n("shared_invoice_quote_counter")}),defaultValue:!1}),children:f(gt,{onChange:g=>i("settings.shared_invoice_quote_counter",g),checked:!!((l=t==null?void 0:t.settings)!=null&&l.shared_invoice_quote_counter),disabled:e("shared_invoice_quote_counter")})}),f(U,{leftSide:f(bt,{propertyKey:"shared_invoice_credit_counter",labelElement:f(yt,{label:n("shared_invoice_credit_counter")}),defaultValue:!1}),children:f(gt,{onChange:g=>i("settings.shared_invoice_credit_counter",g),checked:!!((c=t==null?void 0:t.settings)!=null&&c.shared_invoice_credit_counter),disabled:e("shared_invoice_credit_counter")})}),f(U,{leftSide:f(bt,{propertyKey:"reset_counter_frequency_id",labelElement:f(yt,{label:n("reset_counter")}),defaultValue:"0"}),children:f(nn,{value:((u=t==null?void 0:t.settings)==null?void 0:u.reset_counter_frequency_id)||"0",onValueChange:g=>i("settings.reset_counter_frequency_id",parseInt(g)),disabled:e("reset_counter_frequency_id"),errorMessage:r==null?void 0:r.errors["settings.reset_counter_frequency_id"],children:SYt.map((g,p)=>f("option",{value:p,children:n(g)},p))})}),(t==null?void 0:t.settings)&&((d=t==null?void 0:t.settings)==null?void 0:d.reset_counter_frequency_id)>0&&f(U,{leftSide:f(bt,{propertyKey:"reset_counter_date",labelElement:f(yt,{label:n("next_reset")})}),children:f(ke,{type:"date",value:((h=t==null?void 0:t.settings)==null?void 0:h.reset_counter_date)||"",onValueChange:g=>i("settings.reset_counter_date",g),disabled:e("reset_counter_date"),errorMessage:r==null?void 0:r.errors["settings.reset_counter_date"]})})]})}var gre=globalThis&&globalThis.__assign||function(){return gre=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},gre.apply(this,arguments)},lHe={onActivate:qt.func,onAddUndo:qt.func,onBeforeAddUndo:qt.func,onBeforeExecCommand:qt.func,onBeforeGetContent:qt.func,onBeforeRenderUI:qt.func,onBeforeSetContent:qt.func,onBeforePaste:qt.func,onBlur:qt.func,onChange:qt.func,onClearUndos:qt.func,onClick:qt.func,onContextMenu:qt.func,onCommentChange:qt.func,onCompositionEnd:qt.func,onCompositionStart:qt.func,onCompositionUpdate:qt.func,onCopy:qt.func,onCut:qt.func,onDblclick:qt.func,onDeactivate:qt.func,onDirty:qt.func,onDrag:qt.func,onDragDrop:qt.func,onDragEnd:qt.func,onDragGesture:qt.func,onDragOver:qt.func,onDrop:qt.func,onExecCommand:qt.func,onFocus:qt.func,onFocusIn:qt.func,onFocusOut:qt.func,onGetContent:qt.func,onHide:qt.func,onInit:qt.func,onInput:qt.func,onKeyDown:qt.func,onKeyPress:qt.func,onKeyUp:qt.func,onLoadContent:qt.func,onMouseDown:qt.func,onMouseEnter:qt.func,onMouseLeave:qt.func,onMouseMove:qt.func,onMouseOut:qt.func,onMouseOver:qt.func,onMouseUp:qt.func,onNodeChange:qt.func,onObjectResizeStart:qt.func,onObjectResized:qt.func,onObjectSelected:qt.func,onPaste:qt.func,onPostProcess:qt.func,onPostRender:qt.func,onPreProcess:qt.func,onProgressState:qt.func,onRedo:qt.func,onRemove:qt.func,onReset:qt.func,onSaveContent:qt.func,onSelectionChange:qt.func,onSetAttrib:qt.func,onSetContent:qt.func,onShow:qt.func,onSubmit:qt.func,onUndo:qt.func,onVisualAid:qt.func,onSkinLoadError:qt.func,onThemeLoadError:qt.func,onModelLoadError:qt.func,onPluginLoadError:qt.func,onIconsLoadError:qt.func,onLanguageLoadError:qt.func,onScriptsLoad:qt.func,onScriptsLoadError:qt.func},xYt=gre({apiKey:qt.string,licenseKey:qt.string,id:qt.string,inline:qt.bool,init:qt.object,initialValue:qt.string,onEditorChange:qt.func,value:qt.string,tagName:qt.string,cloudChannel:qt.string,plugins:qt.oneOfType([qt.string,qt.array]),toolbar:qt.oneOfType([qt.string,qt.array]),disabled:qt.bool,textareaName:qt.string,tinymceScriptSrc:qt.oneOfType([qt.string,qt.arrayOf(qt.string),qt.arrayOf(qt.shape({src:qt.string,async:qt.bool,defer:qt.bool}))]),rollback:qt.oneOfType([qt.number,qt.oneOf([!1])]),scriptLoading:qt.shape({async:qt.bool,defer:qt.bool,delay:qt.number})},lHe),SX=function(n){return typeof n=="function"},ITe=function(n){return n in lHe},LTe=function(n){return n.substr(2)},kYt=function(n,e,t,i,r,o,s){var a=Object.keys(r).filter(ITe),l=Object.keys(o).filter(ITe),c=a.filter(function(d){return o[d]===void 0}),u=l.filter(function(d){return r[d]===void 0});c.forEach(function(d){var h=LTe(d),g=s[h];t(h,g),delete s[h]}),u.forEach(function(d){var h=i(n,d),g=LTe(d);s[g]=h,e(g,h)})},TYt=function(n,e,t,i,r){return kYt(r,n.on.bind(n),n.off.bind(n),function(o,s){return function(a){var l;return(l=o(s))===null||l===void 0?void 0:l(a,n)}},e,t,i)},DTe=0,cHe=function(n){var e=Date.now(),t=Math.floor(Math.random()*1e9);return DTe++,n+"_"+t+DTe+String(e)},ATe=function(n){return n!==null&&(n.tagName.toLowerCase()==="textarea"||n.tagName.toLowerCase()==="input")},RTe=function(n){return typeof n>"u"||n===""?[]:Array.isArray(n)?n:n.split(" ")},IYt=function(n,e){return RTe(n).concat(RTe(e))},LYt=function(){return window.InputEvent&&typeof InputEvent.prototype.getTargetRanges=="function"},DYt=function(n){if(!("isConnected"in Node.prototype)){for(var e=n,t=n.parentNode;t!=null;)e=t,t=e.parentNode;return e===n.ownerDocument}return n.isConnected},NTe=function(n,e){n!==void 0&&(n.mode!=null&&typeof n.mode=="object"&&typeof n.mode.set=="function"?n.mode.set(e):n.setMode(e))},pre=globalThis&&globalThis.__assign||function(){return pre=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},pre.apply(this,arguments)},AYt=function(n,e,t){var i,r,o=n.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.id=e.id,o.src=e.src,o.async=(i=e.async)!==null&&i!==void 0?i:!1,o.defer=(r=e.defer)!==null&&r!==void 0?r:!1;var s=function(){o.removeEventListener("load",s),o.removeEventListener("error",a),t(e.src)},a=function(l){o.removeEventListener("load",s),o.removeEventListener("error",a),t(e.src,l)};o.addEventListener("load",s),o.addEventListener("error",a),n.head&&n.head.appendChild(o)},RYt=function(n){var e={},t=function(s,a){var l=e[s];l.done=!0,l.error=a;for(var c=0,u=l.handlers;c<u.length;c++){var d=u[c];d(s,a)}l.handlers=[]},i=function(s,a,l){var c=function(b){return l!==void 0?l(b):console.error(b)};if(s.length===0){c(new Error("At least one script must be provided"));return}for(var u=0,d=!1,h=function(b,y){d||(y?(d=!0,c(y)):++u===s.length&&a())},g=0,p=s;g<p.length;g++){var m=p[g],_=e[m.src];if(_)_.done?h(m.src,_.error):_.handlers.push(h);else{var v=cHe("tiny-");e[m.src]={id:v,src:m.src,done:!1,error:null,handlers:[h]},AYt(n,pre({id:v},m),t)}}},r=function(){for(var s,a=0,l=Object.values(e);a<l.length;a++){var c=l[a],u=n.getElementById(c.id);u!=null&&u.tagName==="SCRIPT"&&((s=u.parentNode)===null||s===void 0||s.removeChild(u))}e={}},o=function(){return n};return{loadScripts:i,deleteScripts:r,getDocument:o}},NYt=function(){var n=[],e=function(r){var o=n.find(function(s){return s.getDocument()===r});return o===void 0&&(o=RYt(r),n.push(o)),o},t=function(r,o,s,a,l){var c=function(){return e(r).loadScripts(o,a,l)};s>0?setTimeout(c,s):c()},i=function(){for(var r=n.pop();r!=null;r=n.pop())r.deleteScripts()};return{loadList:t,reinitialize:i}},OYt=NYt(),EX=function(n){var e=n;return e&&e.tinymce?e.tinymce:null},PYt=globalThis&&globalThis.__extends||function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),LI=globalThis&&globalThis.__assign||function(){return LI=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r])}return n},LI.apply(this,arguments)},MYt=function(n){PYt(e,n);function e(t){var i,r,o,s=n.call(this,t)||this;return s.rollbackTimer=void 0,s.valueCursor=void 0,s.rollbackChange=function(){var a=s.editor,l=s.props.value;a&&l&&l!==s.currentContent&&a.undoManager.ignore(function(){if(a.setContent(l),s.valueCursor&&(!s.inline||a.hasFocus()))try{a.selection.moveToBookmark(s.valueCursor)}catch{}}),s.rollbackTimer=void 0},s.handleBeforeInput=function(a){if(s.props.value!==void 0&&s.props.value===s.currentContent&&s.editor&&(!s.inline||s.editor.hasFocus()))try{s.valueCursor=s.editor.selection.getBookmark(3)}catch{}},s.handleBeforeInputSpecial=function(a){(a.key==="Enter"||a.key==="Backspace"||a.key==="Delete")&&s.handleBeforeInput(a)},s.handleEditorChange=function(a){var l=s.editor;if(l&&l.initialized){var c=l.getContent();s.props.value!==void 0&&s.props.value!==c&&s.props.rollback!==!1&&(s.rollbackTimer||(s.rollbackTimer=window.setTimeout(s.rollbackChange,typeof s.props.rollback=="number"?s.props.rollback:200))),c!==s.currentContent&&(s.currentContent=c,SX(s.props.onEditorChange)&&s.props.onEditorChange(c,l))}},s.handleEditorChangeSpecial=function(a){(a.key==="Backspace"||a.key==="Delete")&&s.handleEditorChange(a)},s.initialise=function(a){var l,c,u;a===void 0&&(a=0);var d=s.elementRef.current;if(d){if(!DYt(d)){if(a===0)setTimeout(function(){return s.initialise(1)},1);else if(a<100)setTimeout(function(){return s.initialise(a+1)},100);else throw new Error("tinymce can only be initialised when in a document");return}var h=EX(s.view);if(!h)throw new Error("tinymce should have been loaded into global scope");var g=LI(LI(LI(LI({},s.props.init),{selector:void 0,target:d,readonly:s.props.disabled,inline:s.inline,plugins:IYt((l=s.props.init)===null||l===void 0?void 0:l.plugins,s.props.plugins),toolbar:(c=s.props.toolbar)!==null&&c!==void 0?c:(u=s.props.init)===null||u===void 0?void 0:u.toolbar}),s.props.licenseKey?{license_key:s.props.licenseKey}:{}),{setup:function(p){s.editor=p,s.bindHandlers({}),s.inline&&!ATe(d)&&p.once("PostRender",function(m){p.setContent(s.getInitialValue(),{no_events:!0})}),s.props.init&&SX(s.props.init.setup)&&s.props.init.setup(p)},init_instance_callback:function(p){var m,_,v=s.getInitialValue();s.currentContent=(m=s.currentContent)!==null&&m!==void 0?m:p.getContent(),s.currentContent!==v&&(s.currentContent=v,p.setContent(v),p.undoManager.clear(),p.undoManager.add(),p.setDirty(!1));var b=(_=s.props.disabled)!==null&&_!==void 0?_:!1;NTe(s.editor,b?"readonly":"design"),s.props.init&&SX(s.props.init.init_instance_callback)&&s.props.init.init_instance_callback(p)}});s.inline||(d.style.visibility=""),ATe(d)&&(d.value=s.getInitialValue()),h.init(g)}},s.id=s.props.id||cHe("tiny-react"),s.elementRef=w.createRef(),s.inline=(o=(i=s.props.inline)!==null&&i!==void 0?i:(r=s.props.init)===null||r===void 0?void 0:r.inline)!==null&&o!==void 0?o:!1,s.boundHandlers={},s}return Object.defineProperty(e.prototype,"view",{get:function(){var t,i;return(i=(t=this.elementRef.current)===null||t===void 0?void 0:t.ownerDocument.defaultView)!==null&&i!==void 0?i:window},enumerable:!1,configurable:!0}),e.prototype.componentDidUpdate=function(t){var i=this,r,o;if(this.rollbackTimer&&(clearTimeout(this.rollbackTimer),this.rollbackTimer=void 0),this.editor&&(this.bindHandlers(t),this.editor.initialized)){if(this.currentContent=(r=this.currentContent)!==null&&r!==void 0?r:this.editor.getContent(),typeof this.props.initialValue=="string"&&this.props.initialValue!==t.initialValue)this.editor.setContent(this.props.initialValue),this.editor.undoManager.clear(),this.editor.undoManager.add(),this.editor.setDirty(!1);else if(typeof this.props.value=="string"&&this.props.value!==this.currentContent){var s=this.editor;s.undoManager.transact(function(){var l;if(!i.inline||s.hasFocus())try{l=s.selection.getBookmark(3)}catch{}var c=i.valueCursor;if(s.setContent(i.props.value),!i.inline||s.hasFocus())for(var u=0,d=[l,c];u<d.length;u++){var h=d[u];if(h)try{s.selection.moveToBookmark(h),i.valueCursor=h;break}catch{}}})}if(this.props.disabled!==t.disabled){var a=(o=this.props.disabled)!==null&&o!==void 0?o:!1;NTe(this.editor,a?"readonly":"design")}}},e.prototype.componentDidMount=function(){var t=this,i,r,o,s,a;if(EX(this.view)!==null)this.initialise();else if(Array.isArray(this.props.tinymceScriptSrc)&&this.props.tinymceScriptSrc.length===0)(r=(i=this.props).onScriptsLoadError)===null||r===void 0||r.call(i,new Error("No `tinymce` global is present but the `tinymceScriptSrc` prop was an empty array."));else if(!((o=this.elementRef.current)===null||o===void 0)&&o.ownerDocument){var l=function(){var u,d;(d=(u=t.props).onScriptsLoad)===null||d===void 0||d.call(u),t.initialise()},c=function(u){var d,h;(h=(d=t.props).onScriptsLoadError)===null||h===void 0||h.call(d,u)};OYt.loadList(this.elementRef.current.ownerDocument,this.getScriptSources(),(a=(s=this.props.scriptLoading)===null||s===void 0?void 0:s.delay)!==null&&a!==void 0?a:0,l,c)}},e.prototype.componentWillUnmount=function(){var t=this,i=this.editor;i&&(i.off(this.changeEvents(),this.handleEditorChange),i.off(this.beforeInputEvent(),this.handleBeforeInput),i.off("keypress",this.handleEditorChangeSpecial),i.off("keydown",this.handleBeforeInputSpecial),i.off("NewBlock",this.handleEditorChange),Object.keys(this.boundHandlers).forEach(function(r){i.off(r,t.boundHandlers[r])}),this.boundHandlers={},i.remove(),this.editor=void 0)},e.prototype.render=function(){return this.inline?this.renderInline():this.renderIframe()},e.prototype.changeEvents=function(){var t,i,r,o=(r=(i=(t=EX(this.view))===null||t===void 0?void 0:t.Env)===null||i===void 0?void 0:i.browser)===null||r===void 0?void 0:r.isIE();return o?"change keyup compositionend setcontent CommentChange":"change input compositionend setcontent CommentChange"},e.prototype.beforeInputEvent=function(){return LYt()?"beforeinput SelectionChange":"SelectionChange"},e.prototype.renderInline=function(){var t=this.props.tagName,i=t===void 0?"div":t;return w.createElement(i,{ref:this.elementRef,id:this.id})},e.prototype.renderIframe=function(){return w.createElement("textarea",{ref:this.elementRef,style:{visibility:"hidden"},name:this.props.textareaName,id:this.id})},e.prototype.getScriptSources=function(){var t,i,r=(t=this.props.scriptLoading)===null||t===void 0?void 0:t.async,o=(i=this.props.scriptLoading)===null||i===void 0?void 0:i.defer;if(this.props.tinymceScriptSrc!==void 0)return typeof this.props.tinymceScriptSrc=="string"?[{src:this.props.tinymceScriptSrc,async:r,defer:o}]:this.props.tinymceScriptSrc.map(function(c){return typeof c=="string"?{src:c,async:r,defer:o}:c});var s=this.props.cloudChannel,a=this.props.apiKey?this.props.apiKey:"no-api-key",l="https://cdn.tiny.cloud/1/".concat(a,"/tinymce/").concat(s,"/tinymce.min.js");return[{src:l,async:r,defer:o}]},e.prototype.getInitialValue=function(){return typeof this.props.initialValue=="string"?this.props.initialValue:typeof this.props.value=="string"?this.props.value:""},e.prototype.bindHandlers=function(t){var i=this;if(this.editor!==void 0){TYt(this.editor,t,this.props,this.boundHandlers,function(a){return i.props[a]});var r=function(a){return a.onEditorChange!==void 0||a.value!==void 0},o=r(t),s=r(this.props);!o&&s?(this.editor.on(this.changeEvents(),this.handleEditorChange),this.editor.on(this.beforeInputEvent(),this.handleBeforeInput),this.editor.on("keydown",this.handleBeforeInputSpecial),this.editor.on("keyup",this.handleEditorChangeSpecial),this.editor.on("NewBlock",this.handleEditorChange)):o&&!s&&(this.editor.off(this.changeEvents(),this.handleEditorChange),this.editor.off(this.beforeInputEvent(),this.handleBeforeInput),this.editor.off("keydown",this.handleBeforeInputSpecial),this.editor.off("keyup",this.handleEditorChangeSpecial),this.editor.off("NewBlock",this.handleEditorChange))}},e.propTypes=xYt,e.defaultProps={cloudChannel:"7"},e}(w.Component);function vd(n){const[e,t]=w.useState(),i=w.useRef(null);w.useEffect(()=>{t(n.value)},[n.value]);const r=l=>{n.onChange(l)},o=w.useRef(Bn.debounce(l=>r(l),500)).current,s=l=>{t(l||""),o(l||"")},a=Vn();return N("div",{className:"space-y-4",style:{zIndex:0},children:[n.label&&f($p,{children:n.label}),f(MYt,{tinymceScriptSrc:"/tinymce_6.4.2/tinymce/js/tinymce/tinymce.min.js",ref:i,value:e,init:{height:300,entity_encoding:"raw",menubar:!1,plugins:["advlist","autolink","lists","link","image","charmap","anchor","searchreplace","visualblocks","code","fullscreen","insertdatetime","media","table","preview","help","wordcount","mceCodeEditor"],toolbar:"undo redo | blocks | link bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | code | help",content_style:"body { font-family:Helvetica,Arial,sans-serif; font-size:14px }",contextmenu:"",content_css:a.$0==="dark"?"dark":"/tinymce_6.4.2/tinymce/content.css",body_class:"h-screen",skin:a.$0==="dark"?"oxide-dark":"oxide",paste_data_images:!1,newline_behavior:"invert",browser_spellcheck:!0,convert_urls:!1},onEditorChange:s,disabled:n.disabled})]})}const FYt=Ea(Hm.Option)`
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`,uHe=Ea.button`
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`,BYt=Ea.li`
background-color: ${n=>n.theme.backgroundColor};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function $Yt({inputOptions:n,entries:e,readonly:t,nullable:i,initiallyVisible:r=!1,exclude:o=[],includeOnly:s=[],includeByLabel:a,action:l,onChange:c,onDismiss:u,entryOptions:d,errorMessage:h,clearInputAfterSelection:g,onEmptyValues:p,onFocus:m}){const[_,v]=w.useState(String(n.value??"")),[b,y]=w.useState(r),[C,x]=w.useState(null),[k,I]=w.useState(-1),L=w.useRef(null),D=w.useRef(null);let R=_===""?e:e.filter(F=>{var H,V,$,j,Y;return((V=(H=F.label)==null?void 0:H.toLowerCase())==null?void 0:V.includes(_==null?void 0:_.toLowerCase()))||((Y=(j=($=F.value)==null?void 0:$.toString())==null?void 0:j.toLowerCase())==null?void 0:Y.includes(_==null?void 0:_.toLowerCase()))||F.searchable.toLowerCase().includes(_==null?void 0:_.toLowerCase())});R=R.filter(F=>o.length>0?!o.includes(F.value):!0),R=R.filter(F=>s.length>0?s.includes(F[a?"label":"value"]):!0),w.useEffect(()=>{const F=e.findIndex(H=>H.value===n.value||H.label===n.value);if(F>=0){x(e[F]),I(F);return}if(i){x({id:-1,label:n.value?n.value.toString():"",value:n.value?n.value.toString():"",resource:null,eventType:"internal",searchable:d.searchable||d.value});return}},[e]);const P=F=>{v(F),x(null),y(!0),I(-1)},M=F=>{C&&C.value===F.value||(x(F),v(F.label),c(F),g&&(v(""),x(null)),setTimeout(()=>y(!1),100))},O=F=>{if(F.key==="ArrowDown"&&k<R.length-1){F.preventDefault(),I(k+1);return}if(F.key==="ArrowUp"&&k>0){F.preventDefault(),I(k-1);return}if(F.key==="Enter"){if(y(!1),k>=0){M(R[k]);return}k===-1&&i&&M({id:Date.now(),label:_,value:_,resource:null,eventType:"internal",searchable:_.toLowerCase()});return}if(F.key==="Escape"){y(!1);return}if(F.key==="Tab"&&i){y(!1),M({id:Date.now(),label:_,value:_,resource:null,eventType:"internal",searchable:_.toLowerCase()});return}};Bw(L,()=>{if(y(!1),C&&C.value||_==="")return;const F={id:Date.now(),label:_,value:_,resource:null,eventType:"internal",searchable:_.toLowerCase()};M(F),c(F)}),Hfe(()=>{if(_===""&&R.length>0||R.length<=3)return p(_)},600,[_,R]),w.useEffect(()=>{const F=document.querySelector(`[data-combobox-element-id="${k+1}"]`);F&&F.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})},[k]);const B=Vn();return N("div",{ref:L,className:"w-full",tabIndex:-1,children:[n.label?f("p",{className:"text-sm font-medium block",children:n.label}):null,f("div",{className:"relative mt-1",children:N("div",{className:"relative w-full cursor-default overflow-hidden rounded border text-left sm:text-sm",style:{borderColor:B.$5},children:[f("input",{type:"text",onChange:F=>P(F.target.value),onKeyDown:O,onFocus:()=>{y(!0),m&&m()},placeholder:n.placeholder,disabled:t,defaultValue:C?C.label:_==null?void 0:_.toString(),className:"w-full border-0 rounded py-1.5 pl-3 pr-10 shadow-sm sm:text-sm sm:leading-6",ref:D,style:{backgroundColor:B.$1,borderColor:B.$5,color:B.$3},tabIndex:-1}),!t&&f("button",{tabIndex:-1,type:"button",onClick:F=>{if(u)return F.preventDefault(),y(!1),u()},className:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",children:u&&C?f(L_,{className:"h-5 w-5","aria-hidden":"true","data-testid":"combobox-clear-icon",style:{color:B.$3}}):f(z2,{className:"h-5 w-5","aria-hidden":"true","data-testid":"combobox-chevrondown-icon",style:{color:B.$3}})})]})}),b&&N("ul",{className:"border absolute z-10 mt-1 max-h-60 overflow-auto rounded-md py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",style:{backgroundColor:B.$1,borderColor:B.$4},tabIndex:-1,children:[l&&l.visible&&f(uHe,{theme:{hoverColor:B.$2},"data-testid":"combobox-action-button",type:"button",onClick:l.onClick,className:"min-w-[19rem] relative cursor-pointer select-none py-2 pl-3 pr-9",tabIndex:-1,style:{color:B.$3},children:l.label}),R.map((F,H)=>f(BYt,{theme:{backgroundColor:k===H?B.$2:B.$1},className:St("min-w-[19rem] relative cursor-pointer select-none py-2 pl-3 pr-9 hover:font-semibold",{"font-medium":k===H}),onClick:()=>M(F),"data-combobox-element-id":H,tabIndex:-1,children:F.resource&&typeof d.dropdownLabelFn<"u"?d.dropdownLabelFn(F.resource):F.label},F.id))]}),h&&f(bs,{className:"mt-2",type:"danger",children:h})]})}function dHe({inputOptions:n,entries:e,readonly:t,nullable:i,initiallyVisible:r=!1,exclude:o=[],includeOnly:s=[],includeByLabel:a,action:l,onEmptyValues:c,onChange:u,onDismiss:d,entryOptions:h,errorMessage:g,clearInputAfterSelection:p,isDataLoading:m}){const[_]=ue(),[v,b]=w.useState(null),[y,C]=w.useState(""),[x,k]=w.useState(r);let I=y===""?e:e.filter(M=>{var O,B,F,H,V;return((B=(O=M.label)==null?void 0:O.toLowerCase())==null?void 0:B.includes(y==null?void 0:y.toLowerCase()))||((V=(H=(F=M.value)==null?void 0:F.toString())==null?void 0:H.toLowerCase())==null?void 0:V.includes(y==null?void 0:y.toLowerCase()))||M.searchable.toLowerCase().includes(y==null?void 0:y.toLowerCase())});I=I.filter(M=>o.length>0?!o.includes(M.value):!0),I=I.filter(M=>s.length>0?s.includes(M[a?"label":"value"]):!0);const L=w.useRef(null),D=w.useRef(null);Bw(L,()=>{k(!1)}),Hfe(()=>{if(y===""&&I.length>0||I.length<=3)return c(y)},600,[I]);const R=M=>{M&&(v&&M.value===v.value?d&&d():b(()=>({...M,eventType:"internal"})))};w.useEffect(()=>{v&&v.eventType==="internal"&&u(v),p&&(b(null),C("")),k(!1),D!=null&&D.current&&D.current.blur()},[v]),w.useEffect(()=>{const M=e.find(O=>O.value===n.value||O.label===n.value);b(M||(i?{id:-1,label:n.value?n.value.toString():"",value:n.value?n.value.toString():"",resource:null,eventType:"external",searchable:h.searchable||h.value}:null))},[e,n.value]),w.useEffect(()=>(r&&k(!0),()=>{k(!1)}),[r]);const P=Vn();return N("div",{className:"w-full",children:[N(Hm,{as:"div",value:v,onChange:M=>R(M),disabled:t,ref:L,children:[n.label&&f(Hm.Label,{className:"text-sm font-medium block",style:{color:P.$3},children:n.label}),f("div",{className:"relative mt-1",children:N("div",{className:"relative w-full cursor-default overflow-hidden rounded border text-left sm:text-sm",style:{borderColor:P.$5},children:[f(Hm.Input,{"data-testid":"combobox-input-field",ref:D,className:"w-full border-0 rounded py-1.5 pl-3 pr-10 shadow-sm sm:text-sm sm:leading-6",onChange:M=>C(M.target.value),displayValue:M=>{var O;return((O=h.inputLabelFn)==null?void 0:O.call(h,M==null?void 0:M.resource))??((M==null?void 0:M.label)||y)},onClick:()=>k(!0),placeholder:n.placeholder,style:{backgroundColor:P.$1,borderColor:P.$5,color:P.$3}}),!t&&f(Hm.Button,{onClick:M=>{if(d)return M.preventDefault(),C(""),v&&k(!1),!v&&k(O=>!O),d();k(O=>!O)},className:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",children:d&&v?f(L_,{className:"h-5 w-5","aria-hidden":"true","data-testid":"combobox-clear-icon",style:{color:P.$3}}):f(z2,{className:"h-5 w-5","aria-hidden":"true","data-testid":"combobox-chevrondown-icon",style:{color:P.$3}})})]})}),x&&N(Hm.Options,{static:!0,className:"border absolute z-10 mt-1 max-h-60 overflow-auto rounded-md py-1 text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm",style:{backgroundColor:P.$1,borderColor:P.$4},children:[l&&l.visible&&f(uHe,{theme:{hoverColor:P.$2},"data-testid":"combobox-action-button",type:"button",onClick:l.onClick,className:"min-w-[19rem] relative cursor-pointer select-none py-2 pl-3 pr-9",tabIndex:-1,style:{color:P.$3},children:l.label}),!!m&&f("div",{className:"min-w-[19rem] relative cursor-default select-none py-2 pl-3 pr-9",children:f(Vo,{})}),!m&&!I.length&&f("div",{className:"min-w-[19rem] relative cursor-default select-none py-2 pl-3 pr-9",children:_("no_records_found")}),i&&y.length>0&&!m&&f(Hm.Option,{className:"min-w-[19rem] relative cursor-default select-none py-2 pl-3 pr-9",value:{id:-1,label:i?y:null,value:i?y:null,resource:null},children:({active:M})=>N("span",{className:St("block truncate space-x-1",M&&"font-semibold"),children:[f("span",{children:_("Select")}),f("q",{className:"font-semibold",children:y})]})},"combobox-not-found"),I.length>0&&!m&&I.map(M=>f(FYt,{theme:{hoverColor:P.$2},value:M,className:"min-w-[19rem] relative cursor-default select-none py-2 pl-3 pr-9",style:{color:P.$3},children:({selected:O,active:B})=>N(_t,{children:[f("span",{className:St("block truncate",O&&"font-semibold",B&&"font-semibold"),children:M.resource&&typeof h.dropdownLabelFn<"u"?h.dropdownLabelFn(M.resource):M.label}),O&&f("span",{className:"absolute inset-y-0 right-0 flex items-center pr-4",style:{color:P.$3},children:f(Zde,{className:"h-5 w-5","aria-hidden":"true"})})]})},M.id))]})]}),g&&f(bs,{className:"mt-2",type:"danger",children:g})]})}function Qd({endpoint:n,inputOptions:e,entryOptions:t,readonly:i,staleTime:r,initiallyVisible:o,sortBy:s="created_at|desc",exclude:a,includeOnly:l,includeByLabel:c,action:u,nullable:d,onChange:h,onDismiss:g,disableWithQueryParameter:p,errorMessage:m,clearInputAfterSelection:_}){const[v,b]=w.useState([]),[y,C]=w.useState(n),[x,k]=w.useState(!1);w.useEffect(()=>{C(n)},[n]);const I=w.useRef(void 0),L=()=>v.length?!!v.find(O=>O.value===e.value||O.label===e.value):!0,{data:D,isLoading:R}=ai([new URL(y).pathname,new URL(y).pathname+new URL(y).search],()=>Te("GET",new URL(y).href).then(M=>{const O=[];return M.data.data.map(B=>{var F;return O.push({id:B[t.id],label:B[t.label],value:B[t.value],resource:B,eventType:"external",searchable:((F=t.customSearchableValue)==null?void 0:F.call(t,B))||B[t.searchable||t.id]})}),O}),{staleTime:r??1/0,enabled:x});w.useEffect(()=>{if(!y.includes("/api/v1/products")&&!x){clearTimeout(I.current);const M=setTimeout(()=>k(!0),100);I.current=M}},[e.value]),w.useEffect(()=>{x&&e.value&&!p&&!L()&&C(M=>{const O=new URL(M);return e.value&&e.value.toString().length>0&&(O.searchParams.set("with",e.value.toString()),O.searchParams.get("sort")&&O.searchParams.delete("sort")),O.href}),x&&!e.value&&C(M=>{const O=new URL(M);return O.searchParams.get("with")&&O.searchParams.delete("with"),s&&O.searchParams.set("sort",s),O.href})},[v,x,e.value]),w.useEffect(()=>{D&&b([...D])},[D]),w.useEffect(()=>(C(M=>{const O=new URL(M);return s&&O.searchParams.set("sort",s),O.searchParams.set("status","active"),O.searchParams.set("filter",""),O.href}),()=>{b([]),k(!1),I.current=void 0}),[]);const P=M=>{C(O=>{const B=new URL(O);return B.searchParams.set("filter",M),B.href})};return y.includes("/api/v1/products")?f($Yt,{entries:v,inputOptions:e,readonly:i,onChange:h,onEmptyValues:P,onDismiss:g,initiallyVisible:o,exclude:a,includeOnly:l,includeByLabel:c,action:u,nullable:d,entryOptions:t,errorMessage:m,clearInputAfterSelection:_,isDataLoading:R,onFocus:()=>k(!0)}):f(dHe,{entries:v,inputOptions:e,readonly:i,onChange:h,onEmptyValues:P,onDismiss:g,initiallyVisible:o,exclude:a,includeOnly:l,includeByLabel:c,action:u,nullable:d,entryOptions:t,errorMessage:m,clearInputAfterSelection:_,isDataLoading:R})}function Npe(n){var s;const[e]=ue(),t=ri(),i=Y2(),{isAdmin:r,isOwner:o}=ao();return f(Qd,{inputOptions:{label:(s=n.inputLabel)==null?void 0:s.toString(),value:n.value??null},endpoint:ye(n.endpoint||"/api/v1/users?status=active"),entryOptions:{id:"id",value:"id",label:"first_name",inputLabelFn:a=>a?`${a.first_name} ${a.last_name}`:"",dropdownLabelFn:a=>`${a.first_name} ${a.last_name}`},readonly:n.readonly,onDismiss:n.onClearButtonClick,action:{label:e("new_user"),onClick:()=>i({fn:()=>t("/settings/users")}),visible:(r||o)&&!n.withoutAction},onChange:a=>a.resource?n.onChange(a.resource):null,staleTime:n.staleTime||1/0})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function VYt(){const[n]=ue(),{isCompanySettingsActive:e}=Ms(),t=!0;return`${n("default")}`,(Wp()||ql())&&t&&e&&u0(),[{value:"default",label:n("default"),enabled:!0},{value:"client_postmark",label:"Postmark",enabled:!0},{value:"client_mailgun",label:"Mailgun",enabled:!0},{value:"client_brevo",label:"Brevo",enabled:!0},{value:"smtp",label:"SMTP",enabled:e&&!u0()}]}function HYt(){const[n]=ue(),e=Ti(),t=Fo(),[i,r]=w.useState(!1),o=()=>{i||(ie.processing(),r(!0),Te("POST",ye("/api/v1/smtp/check"),{smtp_host:(e==null?void 0:e.smtp_host)||"",smtp_port:(e==null?void 0:e.smtp_port)||"",smtp_encryption:(e==null?void 0:e.smtp_encryption)||"",smtp_username:(e==null?void 0:e.smtp_username)||"",smtp_password:(e==null?void 0:e.smtp_password)||"",smtp_local_domain:(e==null?void 0:e.smtp_local_domain)||"",smtp_verify_peer:(e==null?void 0:e.smtp_verify_peer)??!0}).then(s=>ie.success(s.data.message)).finally(()=>r(!1)))};return N(_t,{children:[f(U,{leftSide:n("host"),leftSideHelp:n("host_help"),children:f(ke,{value:(e==null?void 0:e.smtp_host)||"",onValueChange:s=>t("smtp_host",s),disabled:i})}),f(U,{leftSide:n("port"),leftSideHelp:n("port_help"),children:f(ke,{value:(e==null?void 0:e.smtp_port)||"",onValueChange:s=>t("smtp_port",s),disabled:i})}),f(U,{leftSide:n("encryption"),children:N(nn,{value:(e==null?void 0:e.smtp_encryption)||"",onValueChange:s=>t("smtp_encryption",s),withBlank:!0,disabled:i,children:[f("option",{value:"tls",children:"STARTTLS"}),f("option",{value:"ssl",children:"SSL/TLS"})]})}),f(U,{leftSide:n("username"),children:f(ke,{value:(e==null?void 0:e.smtp_username)||"",onValueChange:s=>t("smtp_username",s),disabled:i})}),f(U,{leftSide:n("password"),children:f(ke,{value:(e==null?void 0:e.smtp_password)||"",onValueChange:s=>t("smtp_password",s),disabled:i})}),f(U,{leftSide:n("local_domain"),leftSideHelp:n("local_domain_help"),children:f(ke,{value:(e==null?void 0:e.smtp_local_domain)||"",onValueChange:s=>t("smtp_local_domain",s),disabled:i})}),f(U,{leftSide:n("bcc_email"),leftSideHelp:n("comma_sparated_list"),children:f(ke,{value:(e==null?void 0:e.settings.bcc_email)||"",onValueChange:s=>t("settings.bcc_email",s)})}),f(U,{leftSide:n("send_time"),children:f(nn,{value:(e==null?void 0:e.settings.entity_send_time)||"",onValueChange:s=>t("settings.entity_send_time",s.length>0?s:6),withBlank:!0,children:[...Array(24).keys()].map((s,a)=>f("option",{value:s+1,children:Cn().startOf("day").add(s+1,"hour").format("h:ss A")},a))})}),f(U,{leftSide:n("verify_peer"),children:f(gt,{checked:(e==null?void 0:e.smtp_verify_peer)??!0,onValueChange:s=>t("smtp_verify_peer",s),disabled:i})}),f(U,{pushContentToRight:!0,children:f(Ut,{behavior:"button",onClick:o,disableWithoutIcon:!0,disabled:i,children:n("send_test_email")})})]})}function WYt(){var x;gi("email_settings");const[n]=ue(),{isCompanySettingsActive:e}=Ms(),t=[{name:n("settings"),href:"/settings"},{name:n("email_settings"),href:"/settings/email_settings"}],i=VYt(),r=bc(),o=vi(),s=Zs(),[a,l]=Mo(Ss),c=Fo(),u=pu(),d=vf(),h=L0(),g=Ci(),[p,m]=w.useState(new FormData),_=Xp({enableReinitialize:!0,initialValues:p,onSubmit:()=>{ie.processing(),l(void 0),Te("POST",ye("/api/v1/companies/:id",{id:o.id}),p,{headers:{"Content-Type":"multipart/form-data"}}).then(k=>{g(Pw({object:"company",data:k.data.data})),ie.success("uploaded_document")}).catch(k=>{var I;((I=k.response)==null?void 0:I.status)===422&&(l(k.response.data),ie.dismiss())}).finally(()=>m(new FormData))}}),v=w.useCallback(k=>{if(k.length===0){ie.error("invalid_file");return}p.append("e_invoice_certificate",k[0]),p.append("_method","PUT"),m(p),_.submitForm()},[p]),{getRootProps:b,getInputProps:y,isDragActive:C}=hA({onDrop:v,multiple:!1,maxFiles:1,accept:{"application/*":[".p12",".pfx",".pem",".cer",".crt",".der",".txt",".p7b",".spc",".bin"]}});return N($i,{title:n("email_settings"),docsLink:"en/advanced-settings/#email_settings",breadcrumbs:t,onSaveClick:u,onCancelClick:d,disableSaveButton:h,children:[h&&f(xb,{}),N(Ot,{title:n("settings"),children:[f(U,{leftSide:f(bt,{propertyKey:"show_email_footer",labelElement:f(yt,{label:n("show_email_footer")})}),children:f(gt,{checked:!!(r!=null&&r.settings.show_email_footer),onValueChange:k=>c("settings.show_email_footer",k),disabled:s("show_email_footer")})}),f(U,{leftSide:f(bt,{propertyKey:"pdf_email_attachment",labelElement:f(yt,{label:n("attach_pdf")})}),children:f(gt,{checked:!!(r!=null&&r.settings.pdf_email_attachment),onValueChange:k=>c("settings.pdf_email_attachment",k),disabled:s("pdf_email_attachment")})}),f(U,{leftSide:f(bt,{propertyKey:"document_email_attachment",labelElement:f(yt,{label:n("attach_documents")})}),children:f(gt,{checked:!!(r!=null&&r.settings.document_email_attachment),onValueChange:k=>c("settings.document_email_attachment",k),disabled:s("document_email_attachment")})}),f(U,{leftSide:f(bt,{propertyKey:"ubl_email_attachment",labelElement:f(yt,{label:n("attach_ubl")})}),children:f(gt,{checked:!!(r!=null&&r.settings.ubl_email_attachment),onValueChange:k=>c("settings.ubl_email_attachment",k),disabled:s("ubl_email_attachment")})}),f(U,{leftSide:f(bt,{propertyKey:"enable_e_invoice",labelElement:f(yt,{label:n("enable_e_invoice")})}),children:f(gt,{checked:!!(r!=null&&r.settings.enable_e_invoice),onValueChange:k=>c("settings.enable_e_invoice",k),disabled:s("enable_e_invoice")})}),r!=null&&r.settings.enable_e_invoice?N(_t,{children:[f(U,{leftSide:f(bt,{propertyKey:"merge_e_invoice_to_pdf",labelElement:f(yt,{label:n("merge_e_invoice_to_pdf")})}),children:f(gt,{checked:!!(r!=null&&r.settings.merge_e_invoice_to_pdf),onValueChange:k=>c("settings.merge_e_invoice_to_pdf",k),disabled:s("merge_e_invoice_to_pdf")})}),e&&f(U,{leftSide:n("upload_certificate"),leftSideHelp:r!=null&&r.has_e_invoice_certificate?n("certificate_set"):n("certificate_not_set"),children:f("div",{...b(),className:"flex flex-col md:flex-row md:items-center",children:N("div",{className:"relative block w-full border-2 border-gray-300 border-dashed rounded-lg p-12 text-center hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:[f("input",{...y()}),f(px,{className:"mx-auto h-12 w-12 text-gray-400"}),f("span",{className:"mt-2 block text-sm font-medium text-gray-900",children:C?"drop_your_logo_here":n("dropzone_default_message")})]})})}),e&&f(U,{leftSide:n("certificate_passphrase"),leftSideHelp:r!=null&&r.has_e_invoice_certificate_passphrase?n("passphrase_set"):n("passphrase_not_set"),children:f(ke,{value:"",id:"password",type:"password",onValueChange:k=>c("has_e_invoice_certificate_passphrase",k),errorMessage:a==null?void 0:a.errors.has_e_invoice_certificate_passphrase})}),f(U,{leftSide:f(bt,{propertyKey:"e_invoice_type",labelElement:f(yt,{label:n("e_invoice_type")}),defaultValue:"EN16931"}),children:N(nn,{value:(r==null?void 0:r.settings.e_invoice_type)||"EN16931",onValueChange:k=>c("settings.e_invoice_type",k),disabled:s("e_invoice_type"),errorMessage:a==null?void 0:a.errors["settings.e_invoice_type"],children:[f("option",{value:"FACT1",children:"FACT1"}),f("option",{value:"EN16931",children:"EN16931"}),f("option",{value:"XInvoice_3_0",children:"XInvoice_3.0"}),f("option",{value:"XInvoice_2_3",children:"XInvoice_2.3"}),f("option",{value:"XInvoice_2_2",children:"XInvoice_2.2"}),f("option",{value:"XInvoice_2_1",children:"XInvoice_2.1"}),f("option",{value:"XInvoice_2_0",children:"XInvoice_2.0"}),f("option",{value:"XInvoice_1_0",children:"XInvoice_1.0"}),f("option",{value:"XInvoice-Extended",children:"XInvoice-Extended"}),f("option",{value:"XInvoice-BasicWL",children:"XInvoice-BasicWL"}),f("option",{value:"XInvoice-Basic",children:"XInvoice-Basic"}),f("option",{value:"Facturae_3.2.2",children:"Facturae_3.2.2"}),f("option",{value:"Facturae_3.2.1",children:"Facturae_3.2.1"}),f("option",{value:"Facturae_3.2",children:"Facturae_3.2"}),f("option",{value:"FatturaPA",children:"FatturaPA"})]})}),f(U,{leftSide:f(bt,{propertyKey:"e_quote_type",labelElement:f(yt,{label:n("e_quote_type")}),defaultValue:"OrderX_Comfort"}),children:N(nn,{value:(r==null?void 0:r.settings.e_quote_type)||"OrderX_Comfort",onValueChange:k=>c("settings.e_quote_type",k),disabled:s("e_quote_type"),children:[f("option",{value:"OrderX_Comfort",children:"OrderX_Comfort"}),f("option",{value:"OrderX_Basic",children:"OrderX_Basic"}),f("option",{value:"OrderX_Extended",children:"OrderX_Extended"})]})})]}):null,f(Jn,{}),f(U,{leftSide:f(bt,{propertyKey:"email_sending_method",labelElement:f(yt,{label:n("email_provider")}),defaultValue:"default"}),children:f(nn,{value:(r==null?void 0:r.settings.email_sending_method)||"default",onValueChange:k=>c("settings.email_sending_method",k),disabled:s("email_sending_method")||!Wp()&&!ql(),errorMessage:a==null?void 0:a.errors["settings.email_sending_method"],children:i.map(({value:k,label:I,enabled:L})=>L&&f("option",{value:k,children:I},k))})}),((r==null?void 0:r.settings.email_sending_method)==="office365"||(r==null?void 0:r.settings.email_sending_method)==="microsoft"||(r==null?void 0:r.settings.email_sending_method)==="gmail")&&Yo()&&f(U,{leftSide:f(bt,{propertyKey:"gmail_sending_user_id",labelElement:f(yt,{label:`Gmail / Microsoft ${n("user")}`})}),children:f(Npe,{endpoint:"/api/v1/users?sending_users=true",value:(x=r==null?void 0:r.settings)==null?void 0:x.gmail_sending_user_id,onChange:k=>c("settings.gmail_sending_user_id",k.id),onClearButtonClick:()=>c("settings.gmail_sending_user_id","0"),readonly:s("gmail_sending_user_id"),withoutAction:!0,errorMessage:a==null?void 0:a.errors["settings.gmail_sending_user_id"]})}),(r==null?void 0:r.settings.email_sending_method)==="client_postmark"&&f(U,{leftSide:f(bt,{propertyKey:"postmark_secret",labelElement:f(yt,{label:n("secret")})}),children:f(ke,{value:(r==null?void 0:r.settings.postmark_secret)||"",onValueChange:k=>c("settings.postmark_secret",k),disabled:s("postmark_secret"),errorMessage:a==null?void 0:a.errors["settings.postmark_secret"]})}),(r==null?void 0:r.settings.email_sending_method)==="client_mailgun"&&N(_t,{children:[f(U,{leftSide:f(bt,{propertyKey:"mailgun_secret",labelElement:f(yt,{label:n("secret")})}),children:f(ke,{value:(r==null?void 0:r.settings.mailgun_secret)||"",onValueChange:k=>c("settings.mailgun_secret",k),disabled:s("mailgun_secret"),errorMessage:a==null?void 0:a.errors["settings.mailgun_secret"]})}),f(U,{leftSide:f(bt,{propertyKey:"mailgun_domain",labelElement:f(yt,{label:n("domain")})}),children:f(ke,{value:(r==null?void 0:r.settings.mailgun_domain)||"",onValueChange:k=>c("settings.mailgun_domain",k),disabled:s("mailgun_domain"),errorMessage:a==null?void 0:a.errors["settings.mailgun_domain"]})}),f(U,{leftSide:f(bt,{propertyKey:"mailgun_endpoint",labelElement:f(yt,{label:n("endpoint")}),defaultValue:"api.mailgun.net"}),children:N(nn,{value:(r==null?void 0:r.settings.mailgun_endpoint)||"api.mailgun.net",onValueChange:k=>c("settings.mailgun_endpoint",k),disabled:s("mailgun_endpoint"),errorMessage:a==null?void 0:a.errors["settings.mailgun_endpoint"],children:[f("option",{value:"api.mailgun.net",defaultChecked:!0,children:"api.mailgun.net"}),f("option",{value:"api.eu.mailgun.net",children:"api.eu.mailgun.net"})]})})]}),(r==null?void 0:r.settings.email_sending_method)==="client_brevo"&&f(U,{leftSide:f(bt,{propertyKey:"brevo_secret",labelElement:f(yt,{label:n("secret")})}),children:f(ke,{value:(r==null?void 0:r.settings.brevo_secret)||"",onValueChange:k=>c("settings.brevo_secret",k),disabled:s("brevo_secret"),errorMessage:a==null?void 0:a.errors["settings.brevo_secret"]})}),((r==null?void 0:r.settings.email_sending_method)==="client_mailgun"||(r==null?void 0:r.settings.email_sending_method)==="client_postmark"||(r==null?void 0:r.settings.email_sending_method)==="smtp"||(r==null?void 0:r.settings.email_sending_method)==="client_brevo")&&f(U,{leftSide:f(bt,{propertyKey:"custom_sending_email",labelElement:f(yt,{label:n("from_email")})}),children:f(ke,{value:(r==null?void 0:r.settings.custom_sending_email)||"",onValueChange:k=>c("settings.custom_sending_email",k),disabled:s("custom_sending_email"),errorMessage:a==null?void 0:a.errors["settings.custom_sending_email"]})}),f(U,{leftSide:f(bt,{propertyKey:"email_from_name",labelElement:f(yt,{label:n("from_name")})}),children:f(ke,{value:(r==null?void 0:r.settings.email_from_name)||"",onValueChange:k=>c("settings.email_from_name",k),disabled:s("email_from_name"),errorMessage:a==null?void 0:a.errors["settings.email_from_name"]})}),f(U,{leftSide:f(bt,{propertyKey:"reply_to_name",labelElement:f(yt,{label:n("reply_to_name")})}),children:f(ke,{value:(r==null?void 0:r.settings.reply_to_name)||"",onValueChange:k=>c("settings.reply_to_name",k),disabled:s("reply_to_name"),errorMessage:a==null?void 0:a.errors["settings.reply_to_name"]})}),f(U,{leftSide:f(bt,{propertyKey:"reply_to_email",labelElement:f(yt,{label:n("reply_to_email")})}),children:f(ke,{value:(r==null?void 0:r.settings.reply_to_email)||"",onValueChange:k=>c("settings.reply_to_email",k),disabled:s("reply_to_email"),errorMessage:a==null?void 0:a.errors["settings.reply_to_email"]})}),(r==null?void 0:r.settings.email_sending_method)!=="smtp"&&f(U,{leftSide:f(bt,{propertyKey:"bcc_email",labelElement:f(yt,{label:n("bcc_email"),helpLabel:n("comma_sparated_list")})}),children:f(ke,{value:(r==null?void 0:r.settings.bcc_email)||"",onValueChange:k=>c("settings.bcc_email",k),disabled:s("bcc_email"),errorMessage:a==null?void 0:a.errors["settings.bcc_email"]})}),(r==null?void 0:r.settings.email_sending_method)!=="smtp"&&f(U,{leftSide:f(bt,{propertyKey:"entity_send_time",labelElement:f(yt,{label:n("send_time")})}),children:f(nn,{value:(r==null?void 0:r.settings.entity_send_time)||"",onValueChange:k=>c("settings.entity_send_time",k.length>0?k:6),withBlank:!0,disabled:s("entity_send_time"),errorMessage:a==null?void 0:a.errors["settings.entity_send_time"],children:[...Array(24).keys()].map((k,I)=>f("option",{value:k+1,children:Cn().startOf("day").add(k+1,"hour").format("h:ss A")},I))})}),(r==null?void 0:r.settings.email_sending_method)==="smtp"&&f(HYt,{}),f(Jn,{}),f(U,{leftSide:f(bt,{propertyKey:"email_style",labelElement:f(yt,{label:n("email_design")}),defaultValue:"plain"}),children:N(nn,{value:(r==null?void 0:r.settings.email_style)||"plain",onValueChange:k=>c("settings.email_style",k),disabled:s("email_style"),errorMessage:a==null?void 0:a.errors["settings.email_style"],children:[f("option",{value:"plain",children:n("plain")}),f("option",{value:"light",children:n("light")}),f("option",{value:"dark",children:n("dark")}),f("option",{value:"custom",children:n("custom")})]})}),(r==null?void 0:r.settings.email_style)==="custom"&&f(U,{leftSide:f(bt,{propertyKey:"email_style_custom",labelElement:f(yt,{label:n("custom")})}),children:f(ke,{element:"textarea",value:(r==null?void 0:r.settings.email_style_custom)||"",onValueChange:k=>k.includes("$body")?c("settings.email_style_custom",k):ie.error(Ds("body_variable_missing",{body:"$body"})),disabled:s("email_style_custom"),errorMessage:a==null?void 0:a.errors["settings.email_style_custom"]})}),f(U,{leftSide:f(bt,{propertyKey:"email_signature",labelElement:f(yt,{label:n("signature")})}),children:f(vd,{value:(r==null?void 0:r.settings.email_signature)||"",onChange:k=>c("settings.email_signature",k),disabled:s("email_signature")})})]})]})}function zYt(){var a,l;const[n]=ue();bc();const{isCompanySettingsActive:e}=Ms(),t=Ti(),i=Zs(),r=Fo(),[o,s]=Mo(Ss);return w.useState(""),N(Ot,{title:n("settings"),children:[Yo(),e&&f(U,{leftSide:n("domain_url"),children:f(ke,{value:(t==null?void 0:t.portal_domain)||"",onValueChange:c=>r("portal_domain",c),errorMessage:o==null?void 0:o.errors.portal_domain})}),e&&f(U,{leftSide:N("span",{children:[n("login")," ",n("url")]}),children:N("div",{className:"flex flex-col space-y-1",children:[f(ec,{text:`${t==null?void 0:t.portal_domain}/client/login?company_key=${t==null?void 0:t.company_key}`}),Yo(),Yo(),Yo()]})}),e&&f(Jn,{}),f(U,{className:St({"mt-4":e}),leftSide:f(bt,{propertyKey:"enable_client_portal",labelElement:f(yt,{label:n("client_portal")}),defaultValue:!1}),children:f(gt,{checked:!!(t!=null&&t.settings.enable_client_portal),onValueChange:c=>r("settings.enable_client_portal",c),disabled:i("enable_client_portal")})}),f(U,{leftSide:f(bt,{propertyKey:"client_portal_enable_uploads",labelElement:f(yt,{label:n("client_document_upload"),helpLabel:n("document_upload_help")}),defaultValue:!1}),children:f(gt,{checked:!!(t!=null&&t.settings.client_portal_enable_uploads),onValueChange:c=>r("settings.client_portal_enable_uploads",c),disabled:i("client_portal_enable_uploads")})}),f(U,{leftSide:f(bt,{propertyKey:"vendor_portal_enable_uploads",labelElement:f(yt,{label:n("vendor_document_upload"),helpLabel:n("vendor_document_upload_help")}),defaultValue:!1}),children:f(gt,{checked:!!(t!=null&&t.settings.vendor_portal_enable_uploads),onValueChange:c=>r("settings.vendor_portal_enable_uploads",c),disabled:i("vendor_portal_enable_uploads")})}),f(U,{leftSide:f(bt,{propertyKey:"accept_client_input_quote_approval",labelElement:f(yt,{label:n("accept_purchase_order_number"),helpLabel:n("accept_purchase_order_number_help")}),defaultValue:!1}),children:f(gt,{checked:!!(t!=null&&t.settings.accept_client_input_quote_approval),onValueChange:c=>r("settings.accept_client_input_quote_approval",c),disabled:i("accept_client_input_quote_approval")})}),f(U,{leftSide:f(bt,{propertyKey:"show_pdfhtml_on_mobile",labelElement:f(yt,{label:n("show_pdfhtml_on_mobile"),helpLabel:n("show_pdfhtml_on_mobile_help")}),defaultValue:!1}),children:f(gt,{checked:!!((a=t==null?void 0:t.settings)!=null&&a.show_pdfhtml_on_mobile),onValueChange:c=>r("settings.show_pdfhtml_on_mobile",c),disabled:i("show_pdfhtml_on_mobile")})}),f(U,{leftSide:n("enable_client_portal_dashboard"),leftSideHelp:n("enable_client_portal_dashboard_help"),children:f(gt,{checked:!!((l=t==null?void 0:t.settings)!=null&&l.enable_client_portal_dashboard),onValueChange:c=>r("settings.enable_client_portal_dashboard",c)})}),f(Jn,{}),f(U,{className:"mt-4",leftSide:f(bt,{propertyKey:"client_portal_terms",labelElement:f(yt,{label:n("terms_of_service")})}),children:f(ke,{element:"textarea",onValueChange:c=>r("settings.client_portal_terms",c),value:(t==null?void 0:t.settings.client_portal_terms)||"",disabled:i("client_portal_terms"),errorMessage:o==null?void 0:o.errors["settings.client_portal_terms"]})}),f(U,{leftSide:f(bt,{propertyKey:"client_portal_privacy_policy",labelElement:f(yt,{label:n("privacy_policy")})}),children:f(ke,{element:"textarea",onValueChange:c=>r("settings.client_portal_privacy_policy",c),value:(t==null?void 0:t.settings.client_portal_privacy_policy)||"",disabled:i("client_portal_privacy_policy"),errorMessage:o==null?void 0:o.errors["settings.client_portal_privacy_policy"]})})]})}function jYt(){const[n]=ue(),e=Ti(),t=Fo(),i=Zs();return N(Ot,{title:n("authorization"),children:[f(U,{leftSide:f(bt,{propertyKey:"enable_client_portal_password",labelElement:f(yt,{label:n("enable_portal_password"),helpLabel:n("enable_portal_password_help")}),defaultValue:!1}),children:f(gt,{checked:!!(e!=null&&e.settings.enable_client_portal_password),onValueChange:r=>t("settings.enable_client_portal_password",r),disabled:i("enable_client_portal_password")})}),f(U,{leftSide:f(bt,{propertyKey:"show_accept_invoice_terms",labelElement:f(yt,{label:n("show_accept_invoice_terms"),helpLabel:n("show_accept_invoice_terms_help")}),defaultValue:!1}),children:f(gt,{checked:!!(e!=null&&e.settings.show_accept_invoice_terms),onValueChange:r=>t("settings.show_accept_invoice_terms",r),disabled:i("show_accept_invoice_terms")})}),f(U,{leftSide:f(bt,{propertyKey:"show_accept_quote_terms",labelElement:f(yt,{label:n("show_accept_quote_terms"),helpLabel:n("show_accept_quote_terms_help")}),defaultValue:!1}),children:f(gt,{checked:!!(e!=null&&e.settings.show_accept_quote_terms),onValueChange:r=>t("settings.show_accept_quote_terms",r),disabled:i("show_accept_quote_terms")})}),f(Jn,{}),f(U,{leftSide:f(bt,{propertyKey:"require_invoice_signature",labelElement:f(yt,{label:n("require_invoice_signature"),helpLabel:n("require_invoice_signature_help")}),defaultValue:!1}),children:f(gt,{checked:!!(e!=null&&e.settings.require_invoice_signature),onValueChange:r=>t("settings.require_invoice_signature",r),disabled:i("require_invoice_signature")})}),f(U,{leftSide:f(bt,{propertyKey:"require_quote_signature",labelElement:f(yt,{label:n("require_quote_signature"),helpLabel:n("require_quote_signature_help")}),defaultValue:!1}),children:f(gt,{checked:!!(e!=null&&e.settings.require_quote_signature),onValueChange:r=>t("settings.require_quote_signature",r),disabled:i("require_quote_signature")})}),f(U,{leftSide:f(bt,{propertyKey:"require_purchase_order_signature",labelElement:f(yt,{label:n("require_purchase_order_signature"),helpLabel:n("require_purchase_order_signature_help")}),defaultValue:!1}),children:f(gt,{checked:!!(e!=null&&e.settings.require_purchase_order_signature),onValueChange:r=>t("settings.require_purchase_order_signature",r),disabled:i("require_purchase_order_signature")})}),f(U,{leftSide:f(bt,{propertyKey:"signature_on_pdf",labelElement:f(yt,{label:n("signature_on_pdf"),helpLabel:n("signature_on_pdf_help")}),defaultValue:!1}),children:f(gt,{checked:!!(e!=null&&e.settings.signature_on_pdf),onValueChange:r=>t("settings.signature_on_pdf",r),disabled:i("signature_on_pdf")})})]})}function UYt(){const[n]=ue(),e=Ti(),t=Fo(),i=Zs(),r=ki(Ss);return N(Ot,{title:n("customize"),children:[f(U,{leftSide:f(bt,{propertyKey:"portal_custom_head",labelElement:f(yt,{label:n("header")})}),children:f(ke,{element:"textarea",value:(e==null?void 0:e.settings.portal_custom_head)||"",onValueChange:o=>t("settings.portal_custom_head",o),disabled:i("portal_custom_head"),errorMessage:r==null?void 0:r.errors["settings.portal_custom_head"]})}),f(U,{leftSide:f(bt,{propertyKey:"portal_custom_footer",labelElement:f(yt,{label:n("footer")})}),children:f(ke,{element:"textarea",value:(e==null?void 0:e.settings.portal_custom_footer)||"",onValueChange:o=>t("settings.portal_custom_footer",o),disabled:i("portal_custom_footer"),errorMessage:r==null?void 0:r.errors["settings.portal_custom_footer"]})}),N(_t,{children:[f(U,{leftSide:f(bt,{propertyKey:"portal_custom_css",labelElement:f(yt,{label:n("custom_css")})}),children:f(ke,{element:"textarea",value:(e==null?void 0:e.settings.portal_custom_css)||"",onValueChange:o=>t("settings.portal_custom_css",o),disabled:i("portal_custom_css"),errorMessage:r==null?void 0:r.errors["settings.portal_custom_css"]})}),f(U,{leftSide:f(bt,{propertyKey:"portal_custom_js",labelElement:f(yt,{label:n("custom_javascript")})}),children:f(ke,{element:"textarea",value:(e==null?void 0:e.settings.portal_custom_js)||"",onValueChange:o=>t("settings.portal_custom_js",o),disabled:i("portal_custom_js"),errorMessage:r==null?void 0:r.errors["settings.portal_custom_js"]})})]})]})}function qYt(){const[n]=ue(),e=Ti(),t=Fo(),i=Zs(),{isCompanySettingsActive:r}=Ms(),o=ki(Ss);return N(Ot,{title:n("messages"),children:[r&&f(U,{leftSide:n("dashboard"),children:f(ke,{element:"textarea",value:(e==null?void 0:e.settings.custom_message_dashboard)||"",onValueChange:s=>t("settings.custom_message_dashboard",s),errorMessage:o==null?void 0:o.errors["settings.custom_message_dashboard"]})}),f(U,{leftSide:f(bt,{propertyKey:"custom_message_unpaid_invoice",labelElement:f(yt,{label:n("unpaid_invoice")})}),children:f(ke,{element:"textarea",value:(e==null?void 0:e.settings.custom_message_unpaid_invoice)||"",onValueChange:s=>t("settings.custom_message_unpaid_invoice",s),disabled:i("custom_message_unpaid_invoice"),errorMessage:o==null?void 0:o.errors["settings.custom_message_unpaid_invoice"]})}),f(U,{leftSide:f(bt,{propertyKey:"custom_message_paid_invoice",labelElement:f(yt,{label:n("paid_invoice")})}),children:f(ke,{element:"textarea",value:(e==null?void 0:e.settings.custom_message_paid_invoice)||"",onValueChange:s=>t("settings.custom_message_paid_invoice",s),disabled:i("custom_message_paid_invoice"),errorMessage:o==null?void 0:o.errors["settings.custom_message_paid_invoice"]})}),f(U,{leftSide:f(bt,{propertyKey:"custom_message_unapproved_quote",labelElement:f(yt,{label:n("unapproved_quote")})}),children:f(ke,{element:"textarea",value:(e==null?void 0:e.settings.custom_message_unapproved_quote)||"",onValueChange:s=>t("settings.custom_message_unapproved_quote",s),disabled:i("custom_message_unapproved_quote"),errorMessage:o==null?void 0:o.errors["settings.custom_message_unapproved_quote"]})})]})}function KYt(){const[n]=ue(),e=Ti(),t=Fo(),i=[{field:"first_name",label:n("first_name")},{field:"last_name",label:n("last_name")},{field:"email",label:n("email")},{field:"phone",label:n("phone")},{field:"password",label:n("password")},{field:"name",label:n("name")},{field:"website",label:n("website")},{field:"address1",label:n("address1")},{field:"address2",label:n("address2")},{field:"city",label:n("city")},{field:"state",label:n("state")},{field:"postal_code",label:n("postal_code")},{field:"country_id",label:n("country")},{field:"currency_id",label:n("currency")},{field:"custom_value1",label:n("custom1")},{field:"custom_value2",label:n("custom2")},{field:"custom_value3",label:n("custom3")},{field:"custom_value4",label:n("custom4")},{field:"public_notes",label:n("public_notes")},{field:"vat_number",label:n("vat_number")}],r=s=>{const l=Bn.cloneDeep((e==null?void 0:e.client_registration_fields)||[]).find(u=>u.key===s);let c="hidden";return l!=null&&l.required&&(l!=null&&l.visible)&&(c="required"),!(l!=null&&l.required)&&(l!=null&&l.visible)&&(c="optional"),c},o=(s,a)=>{let l=Bn.cloneDeep((e==null?void 0:e.client_registration_fields)||[]);const c=l.some(d=>d.key===s),u=i.findIndex(d=>d.field===s);if(u>=0){let d={visible:!1,required:!1};if(a==="optional"&&(d={...d,visible:!0}),a==="required"&&(d={visible:!0,required:!0}),c){const h=l.map(g=>({...g,required:g.key===s?d.required:g.required,visible:g.key===s?d.visible:g.visible}));t("client_registration_fields",h)}else{const h=i[u];l=[...l,{key:h.field,...d}],t("client_registration_fields",l)}}};return N(Ot,{title:n("registration"),children:[f(U,{leftSide:n("client_registration"),leftSideHelp:n("client_registration_help"),children:f(gt,{checked:!!(e!=null&&e.client_can_register),onValueChange:s=>t("client_can_register",s)})}),(e==null?void 0:e.client_can_register)&&f(U,{leftSide:n("registration_url"),children:f(ec,{text:`${e==null?void 0:e.portal_domain}/client/register?company_key=${e==null?void 0:e.company_key}`})}),f("div",{className:"pt-4 border-b"}),i.map(s=>f(U,{leftSide:s.label,children:N(nn,{value:r(s.field),onValueChange:a=>o(s.field,a),children:[f("option",{value:"hidden",defaultChecked:!0,children:n("hidden")}),f("option",{value:"optional",children:n("optional")}),f("option",{value:"required",children:n("required")})]})},s.field))]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function GYt(){const[n]=ue(),{isGroupSettingsActive:e,isClientSettingsActive:t}=Ms();let i=[{name:n("settings"),href:dt("/settings/client_portal")},{name:n("authorization"),href:dt("/settings/client_portal/authorization")},{name:n("registration"),href:dt("/settings/client_portal/registration")},{name:n("messages"),href:dt("/settings/client_portal/messages")},{name:n("customize"),href:dt("/settings/client_portal/customize")}];return(e||t)&&(i=i.filter(r=>r.name!==n("registration"))),i}function YYt(){gi("client_portal"),bc();const[n]=ue(),e=[{name:n("settings"),href:"/settings"},{name:n("client_portal"),href:"/settings/client_portal"}],t=pu(),i=vf(),r=L0(),o=GYt();return N($i,{title:n("client_portal"),docsLink:"en/advanced-settings/#client_portal",breadcrumbs:e,onSaveClick:t,onCancelClick:i,disableSaveButton:r,children:[r&&f(xb,{}),f(Vw,{tabs:o,className:"mt-6"}),f("div",{className:"my-4",children:f(ah,{})})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function QYt(n,e){return e.replace("$body",n)}function Z6(n){const e=Vn();return f("span",{style:{color:e.$3,colorScheme:e.$0,backgroundColor:e.$1,borderColor:e.$4},className:"px-2 py-1 rounded m-1 inline-flex items-center space-x-2 hover:cursor-pointer",onClick:()=>{navigator.clipboard.writeText(n.children),Xdt.success(Ds("copied_to_clipboard",{value:n.children}))},children:n.children})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const XYt={invoice:["$amount","$balance","$date","$due_date","$footer","$number","$payment_url","$po_number","$terms","$view_url","$assigned_to_user","$created_by_user","$discount","$exchange_rate","$invoices","$payment_button","$payments","$public_notes","$view_button"],client:["$client_address1","$client.city","$client.credit_balance","$client.name","$client.postal_code","$client.shipping_address1","$client.shipping_city","$client.shipping_postal_code","$client.state","$client.address2","$client.country","$client.id_number","$client.phone","$client.public_notes","$client.shipping_address2","$client.shipping_country","$client.shipping_state","$client.vat_number"],contact:["$contact.email","$contact.first_name","$contact.last_name","$contact.phone"],company:["$company.address1","$company.address2","$company.country","$company.email","$company.id_number","$company.name","$company.phone","$company.state","$company.vat_number","$company.website"]};/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const ZYt={invoice:["$assigned_to_user","$invoice","$invoices","$invoices.balance","$invoices.po_number","$payment_button","$view_button","$created_by_user","$invoice_references","$invoices.amount","$invoices.due_date","$payment.status","$payment_url","$view_url"],client:["$client_address1","$client.city","$client.credit_balance","$client.name","$client.postal_code","$client.shipping_address1","$client.shipping_city","$client.shipping_postal_code","$client.state","$client.address2","$client.country","$client.id_number","$client.phone","$client.public_notes","$client.shipping_address2","$client.shipping_country","$client.shipping_state","$client.vat_number"],contact:["$contact.email","$contact.first_name","$contact.last_name","$contact.phone"],company:["$company.address1","$company.address2","$company.country","$company.email","$company.id_number","$company.name","$company.phone","$company.state","$company.vat_number","$company.website"]};/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/var gd=(n=>(n.Daily="1",n.Weekly="2",n.TwoWeeks="3",n.FourWeeks="4",n.Monthly="5",n.TwoMonths="6",n.ThreeMonths="7",n.FourMonths="8",n.SixMonths="9",n.Annually="10",n.TwoYears="11",n.ThreeYears="12",n))(gd||{});/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const xx={[gd.Daily]:"freq_daily",[gd.Weekly]:"freq_weekly",[gd.TwoWeeks]:"freq_two_weeks",[gd.FourWeeks]:"freq_four_weeks",[gd.Monthly]:"freq_monthly",[gd.TwoMonths]:"freq_two_months",[gd.ThreeMonths]:"freq_three_months",[gd.FourMonths]:"freq_four_months",[gd.SixMonths]:"freq_six_months",[gd.Annually]:"freq_annually",[gd.TwoYears]:"freq_two_years",[gd.ThreeYears]:"freq_three_years"},Z0=["reminder1","reminder2","reminder3"];function JYt(){gi("templates_and_reminders");const[n]=ue(),e=[{name:n("settings"),href:"/settings"},{name:n("templates_and_reminders"),href:"/settings/templates_and_reminders"}],t=bc(),i=Fo(),r=pu(),o=vf();ha();const s=Zs(),{isCompanySettingsActive:a}=Ms(),{data:l}=Nd(),[c,u]=w.useState(a||t!=null&&t.settings.email_template_invoice?"invoice":""),[d,h]=w.useState(),[g,p]=w.useState(),[m,_]=w.useState(-1),[v,b]=w.useState(!0),[y,C]=w.useState(!1),x=L0(),k=c==="quote_reminder1"?"email_quote_subject_reminder1":`email_subject_${c||"invoice"}`,I=c==="quote_reminder1"?"email_quote_template_reminder1":`email_template_${c||"invoice"}`,L=$=>c==="quote_reminder1"?"quote_num_days_reminder1":`num_days_reminder${$}`,D=$=>c==="quote_reminder1"?"quote_schedule_reminder1":`schedule_reminder${$}`,R=$=>c==="quote_reminder1"?"enable_quote_reminder1":`enable_reminder${$}`,P=$=>c==="quote_reminder1"?"quote_late_fee_amount1":`late_fee_amount${$}`,M=$=>c==="quote_reminder1"?"quote_late_fee_percent1":`late_fee_percent${$}`,O=()=>{var $,j;if(l!=null&&l.templates&&t&&c){const Y={subject:t.settings[k],body:t.settings[I]};if((($=Y.subject)==null?void 0:$.length)>0||((j=Y.body)==null?void 0:j.length)>0)h({...Y});else{const ne=l.templates[c]||{subject:t.settings[k]||"",body:t.settings[I]||""};h({...ne})}}},B=$=>{const j=Bn.cloneDeep(t==null?void 0:t.settings);j&&($?(j[L($)]=0,j[D($)]="disabled",j[R($)]=!1,j[P($)]=0,j[M($)]=0):(j.enable_reminder_endless=!1,j.endless_reminder_frequency_id=""),i("settings",j))},F=($,j)=>{const Y=Bn.cloneDeep(j||(t==null?void 0:t.settings));Y&&($?(delete Y[L($)],delete Y[D($)],delete Y[R($)],delete Y[P($)],delete Y[M($)]):(delete Y.enable_reminder_endless,delete Y.endless_reminder_frequency_id),i("settings",Y))},H=$=>{if(!$){const j=Bn.cloneDeep(t==null?void 0:t.settings);if(j){const Y=m>-1?`reminder${m}`:"";delete j[c==="quote_reminder1"?"email_quote_subject_reminder1":`email_subject_${Y||c}`],Z0.includes(c)||c==="reminder_endless"?F(Z0.indexOf(c)+1,j):i("settings",j),h(void 0)}}$&&!c&&u("invoice"),$&&c&&(O(),s(I)&&Z0.includes(c)&&B(Z0.indexOf(c)+1),c==="reminder_endless"&&s("email_template_reminder_endless")&&B())};w.useEffect(()=>{if(l!=null&&l.templates&&t&&c){Z0.includes(c)?_(Z0.indexOf(c)+1):_(-1);const $=t==null?void 0:t.settings[I];(a||$&&!a||c==="invoice"&&!$&&!a&&v)&&O(),v&&b(!1)}},[l,c]),w.useEffect(()=>{c&&d&&(i(`settings.${k}`,d==null?void 0:d.subject),i(`settings.${I}`,d==null?void 0:d.body),C(!0),Te("POST",ye("/api/v1/templates"),{body:d==null?void 0:d.body,subject:d==null?void 0:d.subject,entity:"",entity_id:"",template:I}).then($=>p($.data)).finally(()=>C(!1)))},[d]);const V=c==="payment"?ZYt:XYt;return N($i,{title:n("templates_and_reminders"),docsLink:"en/advanced-settings/#templates_and_reminders",breadcrumbs:e,onSaveClick:r,onCancelClick:o,disableSaveButton:x,children:[x&&f(xb,{}),N(Ot,{title:n("edit"),children:[f(U,{leftSide:f(bt,{checked:typeof(t==null?void 0:t.settings[I])<"u",propertyKey:I,labelElement:f(yt,{label:n("template")}),defaultValue:c||"invoice",onCheckboxChange:$=>H($)}),children:N(nn,{value:c,onValueChange:$=>{u($),!a&&h(void 0)},cypressRef:"templateSelector",children:[l&&Object.keys(l.templates).map(($,j)=>f("option",{value:$,children:n($)},j)),f("option",{value:"custom1",children:n("first_custom")}),f("option",{value:"custom2",children:n("second_custom")}),f("option",{value:"custom3",children:n("third_custom")})]})}),f(U,{leftSide:n("subject"),disabledLabels:s(I),children:f(ke,{id:"subject",value:(d==null?void 0:d.subject)||"",onValueChange:$=>h(j=>j&&{...j,subject:$}),disabled:s(I)})}),f(U,{leftSide:n("body"),disabledLabels:s(I),children:f(vd,{value:(d==null?void 0:d.body)||"",onChange:$=>h(j=>j&&{...j,body:$}),disabled:s(I)})})]}),(Z0.includes(c)||c==="reminder_endless"||c==="quote_reminder1")&&!s(I)&&f(Ot,{children:Z0.includes(c)||c==="quote_reminder1"?N(_t,{children:[f(U,{leftSide:n("days"),children:f(ke,{value:(t==null?void 0:t.settings[L(m)])||0,onValueChange:$=>i(`settings.${L(m)}`,parseFloat($)||0),type:"number"})}),f(U,{leftSide:n("schedule"),children:N(nn,{value:(t==null?void 0:t.settings[D(m)])||"disabled",onValueChange:$=>i(`settings.${D(m)}`,$),children:[f("option",{value:"disabled",defaultChecked:!0,children:n("disabled")}),f("option",{value:c==="quote_reminder1"?"after_quote_date":"after_invoice_date",children:n(c==="quote_reminder1"?"after_quote_date":"after_invoice_date")}),f("option",{value:c==="quote_reminder1"?"before_valid_until_date":"before_due_date",children:n(c==="quote_reminder1"?"before_valid_until_date":"before_due_date")}),f("option",{value:c==="quote_reminder1"?"after_valid_until_date":"after_due_date",children:n(c==="quote_reminder1"?"after_valid_until_date":"after_due_date")})]})}),f(U,{leftSide:n("send_email"),children:f(gt,{checked:!!(t!=null&&t.settings[R(m)])||!1,onValueChange:$=>i(`settings.${R(m)}`,$)})}),f(U,{leftSide:n("late_fee_amount"),children:f(ke,{type:"number",value:(t==null?void 0:t.settings[P(m)])||0,onValueChange:$=>i(`settings.${P(m)}`,parseFloat($)||0)})}),f(U,{leftSide:n("late_fee_percent"),children:f(ke,{type:"number",value:(t==null?void 0:t.settings[M(m)])||0,onValueChange:$=>i(`settings.${M(m)}`,parseFloat($)||0)})})]}):N(_t,{children:[f(U,{leftSide:n("send_email"),children:f(gt,{checked:!!(t!=null&&t.settings.enable_reminder_endless),onValueChange:$=>i("settings.enable_reminder_endless",$)})}),f(U,{leftSide:n("frequency"),children:f(nn,{value:(t==null?void 0:t.settings.endless_reminder_frequency_id)||"",onValueChange:$=>i("settings.endless_reminder_frequency_id",$),withBlank:!0,children:Object.keys(xx).map(($,j)=>f("option",{value:$,children:n(xx[$])},j))})})]})}),g&&f(Ot,{className:"scale-y-100",title:g.subject,children:y?f("div",{className:"flex justify-center items-center",style:{height:800},children:f(Vo,{})}):f("iframe",{srcDoc:QYt(g.body,g.wrapper),frameBorder:"0",width:"100%",height:800})}),N(Ot,{title:n("variables"),children:[f(U,{leftSide:n("invoice"),className:"flex-wrap",children:f("div",{className:"flex flex-wrap",children:V.invoice.map(($,j)=>f(Z6,{children:$},j))})}),f(U,{leftSide:n("client"),className:"flex-wrap",children:f("div",{className:"flex flex-wrap",children:V.client.map(($,j)=>f(Z6,{children:$},j))})}),f(U,{leftSide:n("contact"),className:"flex-wrap",children:f("div",{className:"flex flex-wrap",children:V.contact.map(($,j)=>f(Z6,{children:$},j))})}),f(U,{leftSide:n("company"),className:"flex-wrap",children:f("div",{className:"flex flex-wrap",children:V.company.map(($,j)=>f(Z6,{children:$},j))})})]})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function mre(n,e=0,t=".",i=","){const r=typeof n=="string"?parseFloat(n):n,o=parseFloat(r.toString()).toFixed(e).toString().split("."),s=[];for(let a=o[0].length;a>0;a-=3)s.unshift(o[0].substring(Math.max(0,a-3),a));return(r>=1e3||r<=-1e3)&&(o[0]=s.join(i)),o.join(t)}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/let Ope=class{static formatValue(e,t){const i=t.thousand_separator,r=t.decimal_separator,o=t.precision;return mre(e,o,r,i)}static formatMoney(e,t,i,r){var h,g;let o=t.thousand_separator,s=t.decimal_separator,a=t.swap_currency_symbol;const l=t.precision,c=t.code;((h=i.thousand_separator)==null?void 0:h.length)>=1&&(o=i.thousand_separator),((g=i.decimal_separator)==null?void 0:g.length)>=1&&(s=i.decimal_separator),i.swap_currency_symbol&&(a=i.swap_currency_symbol);const u=mre(e,l,s,o),d=t.symbol;return r!=null&&r.showCurrencyCode&&t.code==="CHF"?`${c} ${u}`:r!=null&&r.showCurrencyCode?`${u} ${c}`:a?`${u} ${d.trim()}`:r!=null&&r.showCurrencyCode?this.formatValue(u,t):`${d} ${u}`}};/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function qw(n){const e=spe(),{resolveBy:t}=n||{};return t==="code"?i=>e.find(r=>r.code===i):i=>e.find(r=>r.id==i)}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function bf(){const n=dA(),e=qw(),t=vi();return(i,r,o,s)=>{const a=r||(t==null?void 0:t.settings.country_id),l=o&&o!=="999"?o:t==null?void 0:t.settings.currency_id,c=n(a),u=e(l);return c&&u?Ope.formatMoney(isNaN(Number(i))?0:i,u,c,{showCurrencyCode:t.settings.show_currency_code}):s?Number(i).toFixed(s):i}}const eQt=()=>{const{t:n}=ue(),e=vi(),t=bf(),i=qw({resolveBy:"code"}),r=s=>{Te("POST",ye("/api/v1/one_time_token"),{context:"nordigen",platform:"react",institution_id:s}).then(a=>{var l;window.open(ye("/nordigen/connect/:hash",{hash:(l=a==null?void 0:a.data)==null?void 0:l.hash}))})};return[{id:"bank_account_name",label:n("name"),format:(s,a)=>N("div",{className:"flex items-center space-x-3",children:[f(Ii,{to:dt("/settings/bank_accounts/:id/details",{id:a==null?void 0:a.id}),children:a==null?void 0:a.bank_account_name}),a.integration_type==="NORDIGEN"&&a.disabled_upstream&&f(du,{message:n("reconnect"),width:"auto",placement:"top",children:f("div",{className:"cursor-pointer",onClick:l=>{l.stopPropagation(),r(a.nordigen_institution_id)},children:f(V1,{color:"red",size:22})})})]})},{id:"bank_account_type",label:n("type")},{id:"balance",label:n("balance"),format:(s,a)=>{var l,c;return t(s,(l=e==null?void 0:e.settings)==null?void 0:l.country_id,(c=i(a.currency))==null?void 0:c.id)}}]},tQt="/dap-logos/yodlee.svg",nQt="/dap-logos/goCardless.png";function iQt(){const[n]=ue(),e=ys(),t=Vn(),i=w.useRef(null),[r,o]=w.useState(),[s,a]=w.useState(!1);Bw(i,()=>{o(void 0)});const l=()=>{a(!1),o(void 0)},c=()=>{Te("POST",ye("/api/v1/one_time_token"),{context:"yodlee",platform:"react"}).then(h=>{var g;l(),window.open(dt("https://invoicing.co/yodlee/onboard/:hash",{hash:(g=h==null?void 0:h.data)==null?void 0:g.hash}))})},u=()=>{Te("POST",ye("/api/v1/one_time_token"),{context:"nordigen",platform:"react"}).then(h=>{var g;l(),window.open(ye("/nordigen/connect/:hash",{hash:(g=h==null?void 0:h.data)==null?void 0:g.hash}))})},d=()=>{r==="yodlee"&&c(),r==="nordigen"&&u()};return N(_t,{children:[N(Ut,{type:"secondary",onClick:()=>u(),children:[f("span",{className:"mr-2",children:f(Ve,{element:cyt,size:20})}),n("connect_accounts")]}),f(cr,{title:n("connect_accounts"),visible:s,onClose:l,children:N("div",{ref:i,className:"flex flex-col space-y-6",children:[ql()&&f("div",{className:"flex cursor-pointer h-44 border-4",style:{borderColor:r==="yodlee"?e:t.$5},onClick:()=>o("yodlee"),children:f("img",{className:"flex-1",src:tQt})}),ql()&&f("div",{"data-cy":"nordigenBox",className:"flex cursor-pointer py-14 px-12 h-44 border-4",style:{borderColor:r==="nordigen"?e:t.$5},onClick:()=>o("nordigen"),children:f("img",{className:"flex-1",src:nQt})}),f(Ut,{onClick:d,disableWithoutIcon:!0,disabled:!r,children:n("connect")})]})})]})}function rQt(){gi("bank_accounts");const[n]=ue(),e=eQt(),t=ri(),i=[{name:n("settings"),href:"/settings"},{name:n("bank_accounts"),href:"/settings/bank_accounts"}];return N($i,{title:n("bank_accounts"),breadcrumbs:i,docsLink:"/docs/advanced-settings/#bank_accounts",children:[!ql()&&Yo()&&f(xb,{message:n("upgrade_to_connect_bank_account")}),f(Pg,{resource:"bank_account",columns:e,endpoint:"/api/v1/bank_integrations?sort=id|desc",bulkRoute:"/api/v1/bank_integrations/bulk",linkToCreate:"/settings/bank_accounts/create",linkToEdit:"/settings/bank_accounts/:id/edit",withResourcefulActions:!0,rightSide:N("div",{className:"flex space-x-2",children:[f(iQt,{}),Yo(),N(Ut,{type:"secondary",onClick:()=>t("/settings/bank_accounts/transaction_rules"),children:[f("span",{className:"mr-2",children:f(Ve,{element:fyt,size:20})}),n("rules")]})]})})]})}function oQt(){gi("edit_bank_account");const[n]=ue(),e=ri(),{id:t}=Fa(),{data:i}=y8e({id:t}),[r,o]=w.useState(!1),[s,a]=w.useState(),[l,c]=w.useState(),u=[{name:n("settings"),href:"/settings"},{name:n("bank_accounts"),href:"/settings/bank_accounts"},{name:n("edit_bank_account"),href:dt("/bank_accounts/:id/edit",{id:t})}],d=(g,p)=>{c(m=>m&&{...m,[g]:p})},h=async g=>{r||(g.preventDefault(),ie.processing(),a(void 0),o(!0),Te("PUT",ye("/api/v1/bank_integrations/:id",{id:t}),l).then(()=>{ie.success("updated_bank_account"),hn(["bank_integrations"]),e("/settings/bank_accounts")}).catch(p=>{var m;((m=p.response)==null?void 0:m.status)===422&&(a(p.response.data),ie.dismiss())}).finally(()=>o(!1)))};return w.useEffect(()=>{i&&c(i)},[i]),f($i,{title:n("edit_bank_account"),breadcrumbs:u,docsLink:"en/basic-settings/#edit_bank_account",onSaveClick:h,children:N(Ot,{onFormSubmit:h,title:n("edit_bank_account"),children:[f(U,{leftSide:n("account_name"),children:f(ke,{value:l==null?void 0:l.bank_account_name,onValueChange:g=>d("bank_account_name",g),errorMessage:s==null?void 0:s.errors.bank_account_name})}),f(U,{leftSide:n("sync_from"),children:f(ke,{type:"date",value:l==null?void 0:l.from_date,onValueChange:g=>d("from_date",g),errorMessage:s==null?void 0:s.errors.from_date})}),f(U,{leftSide:n("auto_sync"),children:f(gt,{checked:(l==null?void 0:l.auto_sync)||!1,onValueChange:g=>d("auto_sync",g)})})]})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function hHe(n,e,t,i,r,o){const s=ri();return a=>{a.preventDefault(),!i&&n&&(ie.processing(),e(void 0),t(!0),Te("POST",ye("/api/v1/bank_integrations"),n).then(l=>{ie.success("created_bank_account"),hn(["bank_integrations"]),r?(hn(["bank_integrations"]),o&&o(l.data.data),r(!1)):s("/settings/bank_accounts")}).catch(l=>{var c;((c=l.response)==null?void 0:c.status)===422&&(ie.dismiss(),e(l.response.data))}).finally(()=>t(!1)))}}function sQt(){const[n]=ue();gi("new_bank_account");const{data:e}=C8e(),t=[{name:n("settings"),href:"/settings"},{name:n("bank_accounts"),href:"/settings/bank_accounts"},{name:n("new_bank_account"),href:"/settings/bank_accounts/create"}],[i,r]=w.useState(!1),[o,s]=w.useState(),[a,l]=w.useState(),c=hHe(a,s,r,i),u=(d,h)=>{l(g=>g&&{...g,[d]:h})};return w.useEffect(()=>{e&&l(e)},[e]),f($i,{title:n("new_bank_account"),breadcrumbs:t,docsLink:"en/basic-settings/#create_bank_account",disableSaveButton:!ql()&&!Wp()&&Yo(),onSaveClick:c,children:f(Ot,{onFormSubmit:c,title:n("new_bank_account"),children:f(U,{leftSide:n("account_name"),children:f(ke,{value:a==null?void 0:a.bank_account_name,onValueChange:d=>u("bank_account_name",d),errorMessage:o==null?void 0:o.errors.bank_account_name})})})})}function aQt(n){var u;const{balance:e,bank_account_type:t,provider_name:i,bank_account_status:r,currency:o=""}=(n==null?void 0:n.accountDetails)||{},[s]=ue(),a=vi(),l=bf(),c=qw({resolveBy:"code"});return N(Ot,{title:s("details"),children:[f(U,{leftSide:s("balance"),children:l(e||0,a.settings.country_id,(u=c(o))==null?void 0:u.id)}),f(U,{leftSide:s("type"),children:t}),f(U,{leftSide:s("provider"),children:i}),f(U,{leftSide:s("status"),children:r})]})}function lQt(){gi("bank_account");const{id:n}=Fa(),[e]=ue(),t=[{name:e("settings"),href:"/settings"},{name:e("bank_accounts"),href:"/settings/bank_accounts"},{name:e("bank_account"),href:dt("/settings/bank_accounts/:id/details",{id:n})}],{data:i}=y8e({id:n}),[r,o]=w.useState();return w.useEffect(()=>{o(i)},[i]),f($i,{title:e("bank_account"),breadcrumbs:t,docsLink:"en/basic-settings/#bank_account_details",children:f(aQt,{accountDetails:r})})}function cQt(){const[n]=ue();return[{id:"name",label:n("name"),format:(t,i)=>f(Ii,{to:dt("/settings/bank_accounts/transaction_rules/:id/edit",{id:i.id}),children:i.name})},{id:"vendor_id",label:n("vendor"),format:(t,i)=>{var r;return f(Ii,{to:dt("/vendors/:id/edit",{id:i.vendor_id}),children:(r=i.vendor)==null?void 0:r.name})}},{id:"category_id",label:n("category"),format:(t,i)=>{var r;return f(Ii,{to:dt("/settings/expense_categories/:id/edit",{id:i.category_id}),children:(r=i.expense_category)==null?void 0:r.name})}},{id:"applies_to",label:n("applies_to")}]}function uQt(){const{documentTitle:n}=gi("transaction_rules"),[e]=ue(),t=cQt(),i=[{name:e("settings"),href:"/settings"},{name:e("bank_accounts"),href:"/settings/bank_accounts"},{name:e("transaction_rules"),href:"/settings/bank_accounts/transaction_rules"}];return f($i,{title:n,breadcrumbs:i,docsLink:"/docs/advanced-settings/#bank_transaction_rules",children:f(Pg,{resource:"transaction_rule",columns:t,endpoint:"/api/v1/bank_transaction_rules?include=vendor,expense_category&sort=id|desc",bulkRoute:"/api/v1/bank_transaction_rules/bulk",linkToCreate:"/settings/bank_accounts/transaction_rules/create",linkToEdit:"/settings/bank_accounts/transaction_rules/:id/edit",withResourcefulActions:!0})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function dQt(){const{isAdmin:n}=ao();return ai(["/api/v1/bank_transaction_rules","create"],()=>Te("GET",ye("/api/v1/bank_transaction_rules/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function hQt(n){return ai(["/api/v1/bank_transaction_rules",n.id],()=>Te("GET",ye("/api/v1/bank_transaction_rules/:id",{id:n.id})).then(e=>e.data.data),{enabled:n.enabled??!0,staleTime:1/0})}function fHe(n){const[e]=ue(),t=ys(),{data:i}=QVe(),[r,o]=w.useState(),[s,a]=w.useState(!1),[l,c]=w.useState(),u=()=>{s||(ie.processing(),a(!0),Te("POST",ye("/api/v1/expense_categories"),l).then(d=>{ie.success("created_expense_category"),hn(["expense_categories"]),window.dispatchEvent(new CustomEvent("invalidate.combobox.queries",{detail:{url:ye("/api/v1/expense_categories")}})),n.setSelectedIds&&n.setSelectedIds([d.data.data.id]),n.onCreatedCategory&&n.onCreatedCategory(d.data.data),i&&c({...i,color:t}),n.setVisible(!1)}).catch(d=>{var h;((h=d.response)==null?void 0:h.status)===422&&(o(d.response.data),ie.dismiss())}).finally(()=>a(!1)))};return w.useEffect(()=>{i&&c({...i,color:t})},[i]),f(cr,{title:e("create_expense_category"),visible:n.visible,onClose:()=>n.setVisible(!1),stopPropagationInHeader:!0,children:N("div",{onClick:d=>d.stopPropagation(),children:[f(XVe,{expenseCategory:l,setExpenseCategory:c,errors:r,setErrors:o}),f("div",{className:"flex justify-end space-x-4 mt-5",children:f(Ut,{behavior:"button",onClick:u,children:e("save")})})]})})}function fQt(n){var s;const[e]=ue(),[t,i]=w.useState(!1),r=zo(),o="&per_page=1";return N(_t,{children:[f(fHe,{visible:n.initiallyVisible||t,setVisible:n.setVisible||i,setSelectedIds:n.setSelectedIds,onCreatedCategory:a=>n.onChange(a)}),!n.setSelectedIds&&f(Qd,{endpoint:ye(`/api/v1/expense_categories?status=active${o}`),onChange:a=>a.resource&&n.onChange(a.resource),inputOptions:{label:(s=n.inputLabel)==null?void 0:s.toString(),value:n.value||null},entryOptions:{id:"id",label:"name",value:"id"},action:{label:e("new_expense_category"),onClick:()=>i(!0),visible:r("create_expense")},readonly:n.readonly,onDismiss:n.onClearButtonClick,initiallyVisible:n.initiallyVisible,sortBy:"name|asc",staleTime:n.staleTime,errorMessage:n.errorMessage})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Chr(n){return ai(["/api/v1/vendors",n.id],()=>Te("GET",ye("/api/v1/vendors/:id",{id:n.id})).then(e=>e.data.data),{enabled:n.enabled??!0,staleTime:1/0})}function gQt(){const n=zo();return ai(["/api/v1/vendors","create"],()=>Te("GET",ye("/api/v1/vendors/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n("create_vendor")})}function pQt(n){return ai(["/api/v1/vendors",n],()=>Te("GET",ye("/api/v1/vendors?filter=:filter&per_page=:per_page&status=:status&page=:page",{per_page:n.perPage??"100",page:n.currentPage??"1",status:n.status??"active",filter:n.filter??""})).then(e=>e.data.data),{enabled:n.enabled??!0,staleTime:1/0})}function whr(){return(n,e)=>{ie.processing(),Te("POST",ye("/api/v1/vendors/bulk"),{action:e,ids:[n]}).then(()=>{ie.success(`${e}d_vendor`),hn(["vendors"])})}}function Xj(n){const e=Dpe();return f(Bj,{onValueChange:n.onChange,value:n.value,label:n.label,errorMessage:n.errorMessage,dismissable:n.dismissable,disabled:n.disabled,children:e.map((t,i)=>N("option",{value:t.id,children:[t.name," (",t.iso_3166_3,")"]},i))})}function mQt(n){var v,b,y,C,x;const[e]=ue(),{vendor:t,setVendor:i,errors:r,page:o,setContacts:s,contacts:a,fundamentalConceptVisible:l}=n,c=vi(),{isAdmin:u,isOwner:d}=ao(),h=(k,I)=>{i(L=>L&&{...L,[k]:I})},g=(k,I,L)=>{Bn.set(a[L],k,I),s([...a])},p=k=>{let I=[...a];I=I.filter((L,D)=>k!==D),s(I)},m=()=>{const k=[...a];k.push({id:"",first_name:"",last_name:"",email:"",send_email:!1,created_at:0,updated_at:0,archived_at:0,is_primary:!1,phone:"",custom_value1:"",custom_value2:"",custom_value3:"",custom_value4:"",link:"",last_login:0}),s(k)},_=gz();return f(_t,{children:l?N("div",{className:"flex flex-col space-y-3",children:[f(ke,{label:e("name"),value:(t==null?void 0:t.name)||"",onValueChange:k=>h("name",k),errorMessage:r==null?void 0:r.errors.name}),f(ke,{label:`${e("contact")} ${e("first_name")}`,value:a[0].first_name,onValueChange:k=>g("first_name",k,0),errorMessage:r==null?void 0:r.errors["contacts.0.first_name"]}),f(ke,{label:`${e("contact")} ${e("last_name")}`,value:a[0].last_name,onValueChange:k=>g("last_name",k,0),errorMessage:r==null?void 0:r.errors["contacts.0.last_name"]}),f(ke,{label:`${e("contact")} ${e("email")}`,value:a[0].email,onValueChange:k=>g("email",k,0),errorMessage:r==null?void 0:r.errors["contacts.0.email"]}),f(ke,{label:`${e("contact")} ${e("phone")}`,value:a[0].phone,onValueChange:k=>g("phone",k,0),errorMessage:r==null?void 0:r.errors["contacts.0.phone"]}),f(ND,{label:e("currency"),value:(t==null?void 0:t.currency_id)||"",onChange:k=>h("currency_id",k),errorMessage:r==null?void 0:r.errors.currency_id,dismissable:!0})]}):N("div",{className:"grid grid-cols-12 gap-4",children:[N("div",{className:"col-span-12 xl:col-span-6 space-y-4",children:[N(Ot,{title:e("details"),children:[o==="edit"&&f(U,{leftSide:e("status"),children:f(zp,{entity:t})}),f(U,{leftSide:e("name"),children:f(ke,{id:"name",value:t.name||"",onValueChange:k=>h("name",k),errorMessage:r==null?void 0:r.errors.name})}),f(U,{leftSide:e("number"),children:f(ke,{value:t.number||"",onValueChange:k=>h("number",k),errorMessage:r==null?void 0:r.errors.number})}),f(U,{leftSide:e("user"),children:f(Npe,{value:t.assigned_user_id,onChange:k=>h("assigned_user_id",k.id),onClearButtonClick:()=>h("assigned_user_id",""),clearButton:!0,errorMessage:r==null?void 0:r.errors.assigned_user_id})}),f(U,{leftSide:e("id_number"),children:f(ke,{value:t.id_number||"",onValueChange:k=>h("id_number",k),errorMessage:r==null?void 0:r.errors.id_number})}),f(U,{leftSide:e("vat_number"),children:f(ke,{value:t.vat_number||"",onValueChange:k=>h("vat_number",k),errorMessage:r==null?void 0:r.errors.vat_number})}),f(U,{leftSide:e("website"),children:f(ke,{value:t.website||"",onValueChange:k=>h("website",k),errorMessage:r==null?void 0:r.errors.website})}),f(U,{leftSide:e("phone"),children:f(ke,{value:t.phone||"",onValueChange:k=>h("phone",k),errorMessage:r==null?void 0:r.errors.phone})}),f(U,{leftSide:e("routing_id"),children:f(ke,{value:t.routing_id||"",onValueChange:k=>h("routing_id",k),errorMessage:(v=n.errors)==null?void 0:v.errors.routing_id})}),f(U,{leftSide:e("classification"),children:N(nn,{id:"classification",defaultValue:t.classification??"",onValueChange:k=>h("classification",k),errorMessage:r==null?void 0:r.errors.classification,withBlank:!0,children:[f("option",{value:"individual",children:e("individual")}),f("option",{value:"business",children:e("business")}),f("option",{value:"company",children:e("company")}),f("option",{value:"partnership",children:e("partnership")}),f("option",{value:"trust",children:e("trust")}),f("option",{value:"charity",children:e("charity")}),f("option",{value:"government",children:e("government")}),f("option",{value:"other",children:e("other")})]})}),((b=c==null?void 0:c.custom_fields)==null?void 0:b.vendor1)&&f(Do,{field:"contact1",defaultValue:t.custom_value1,value:c.custom_fields.vendor1,onValueChange:k=>h("custom_value1",k)}),((y=c==null?void 0:c.custom_fields)==null?void 0:y.vendor2)&&f(Do,{field:"vendor2",defaultValue:t.custom_value2,value:c.custom_fields.vendor2,onValueChange:k=>h("custom_value2",k)}),((C=c==null?void 0:c.custom_fields)==null?void 0:C.vendor3)&&f(Do,{field:"vendor3",defaultValue:t.custom_value3,value:c.custom_fields.vendor3,onValueChange:k=>h("custom_value3",k)}),((x=c==null?void 0:c.custom_fields)==null?void 0:x.vendor4)&&f(Do,{field:"vendor4",defaultValue:t.custom_value4,value:c.custom_fields.vendor4,onValueChange:k=>h("custom_value4",k)})]}),N(Ot,{title:e("address"),children:[f(U,{leftSide:e("address1"),children:f(ke,{value:t.address1,onValueChange:k=>h("address1",k),errorMessage:r==null?void 0:r.errors.address1})}),f(U,{leftSide:e("address2"),children:f(ke,{value:t.address2,onValueChange:k=>h("address2",k),errorMessage:r==null?void 0:r.errors.address2})}),f(U,{leftSide:e("city"),children:f(ke,{value:t.city,onValueChange:k=>h("city",k),errorMessage:r==null?void 0:r.errors.city})}),f(U,{leftSide:e("state"),children:f(ke,{value:t.state,onValueChange:k=>h("state",k),errorMessage:r==null?void 0:r.errors.state})}),f(U,{leftSide:e("postal_code"),children:f(ke,{value:t.postal_code,onValueChange:k=>h("postal_code",k),errorMessage:r==null?void 0:r.errors.postal_code})}),f(U,{leftSide:e("country"),children:f(Xj,{value:t.country_id,onChange:k=>h("country_id",k),errorMessage:r==null?void 0:r.errors.country_id})})]})]}),N("div",{className:"col-span-12 xl:col-span-6 space-y-4",children:[f(Ot,{title:e("contacts"),children:a.map((k,I,{length:L})=>{var D,R,P,M,O,B,F,H;return N("div",{children:[f(U,{leftSide:e("first_name"),children:f(ke,{id:`first_name_${I}`,value:k.first_name,onValueChange:V=>g("first_name",V,I),errorMessage:(D=n.errors)==null?void 0:D.errors[`contacts.${I}.first_name`]})}),f(U,{leftSide:e("last_name"),children:f(ke,{id:`last_name_${I}`,value:k.last_name,onValueChange:V=>g("last_name",V,I),errorMessage:(R=n.errors)==null?void 0:R.errors[`contacts.${I}.last_name`]})}),f(U,{leftSide:e("email"),children:f(ke,{id:`email_${I}`,value:k.email,onValueChange:V=>g("email",V,I),errorMessage:(P=n.errors)==null?void 0:P.errors[`contacts.${I}.email`]})}),f(U,{leftSide:e("phone"),children:f(ke,{value:k.phone,onValueChange:V=>g("phone",V,I),errorMessage:(M=n.errors)==null?void 0:M.errors[`contacts.${I}.phone`]})}),f(U,{leftSide:e("send_email"),children:f(gt,{checked:k.send_email,onChange:V=>g("send_email",V,I)})}),((O=c==null?void 0:c.custom_fields)==null?void 0:O.vendor_contact1)&&f(Do,{field:"vendor_contact1",defaultValue:k.custom_value1||"",value:c.custom_fields.vendor_contact1,onValueChange:V=>g("custom_value1",V,I)}),((B=c==null?void 0:c.custom_fields)==null?void 0:B.vendor_contact2)&&f(Do,{field:"vendor_contact2",defaultValue:k.custom_value2||"",value:c.custom_fields.vendor_contact2,onValueChange:V=>g("custom_value2",V,I)}),((F=c==null?void 0:c.custom_fields)==null?void 0:F.vendor_contact3)&&f(Do,{field:"vendor_contact3",defaultValue:k.custom_value3||"",value:c.custom_fields.vendor_contact3,onValueChange:V=>g("custom_value3",V,I)}),((H=c==null?void 0:c.custom_fields)==null?void 0:H.vendor_contact4)&&f(Do,{field:"vendor_contact4",defaultValue:k.custom_value4||"",value:c.custom_fields.vendor_contact4,onValueChange:V=>g("custom_value4",V,I)}),f(U,{children:N("div",{className:"flex justify-between items-center",children:[t.contacts.length>=2&&f("button",{type:"button",className:"text-red-600",onClick:()=>p(I),children:e("remove_contact")}),I+1==L&&f(Ut,{type:"minimal",behavior:"button",onClick:m,children:e("add_contact")})]})}),f(Jn,{})]},I)})}),f(Ot,{title:e("additional_info"),children:N(D_,{className:"px-5",tabs:[e("settings"),...u||d?[e("custom_fields")]:[]],children:[N("div",{className:"flex flex-col space-y-4",children:[f(U,{leftSide:e("currency"),noExternalPadding:!0,children:f(ND,{value:t.currency_id,onChange:k=>h("currency_id",parseInt(k)),errorMessage:r==null?void 0:r.errors.currency_id})}),_.length>1&&f(U,{leftSide:e("language"),noExternalPadding:!0,children:f(Y3,{value:t.language_id,onChange:k=>h("language_id",k),errorMessage:r==null?void 0:r.errors.language_id,dismissable:!0})}),f(vd,{label:e("public_notes").toString(),onChange:k=>h("public_notes",k),value:t.public_notes}),f(vd,{label:e("private_notes").toString(),onChange:k=>h("private_notes",k),value:t.private_notes})]}),N("div",{children:[N("span",{className:"text-sm",children:[e("custom_fields"),"  "]}),f(Ii,{to:"/settings/custom_fields/vendors",className:"capitalize",children:e("click_here")})]})]})})]})]})})}function _Qt(n){const[e]=ue(),{fundamentalConceptVisible:t,setFundamentalConceptVisible:i}=n,{data:r}=gQt(),[o,s]=w.useState(),[a,l]=w.useState(),[c,u]=w.useState([{first_name:"",last_name:"",email:"",phone:"",send_email:!1}]);w.useEffect(()=>{r&&s({...r,country_id:""})},[r]);const d=pu(),h=async()=>{Bn.set(o,"contacts",c),ie.processing(),await d(!0),Te("POST",ye("/api/v1/vendors"),o).then(g=>{ie.success("created_vendor"),hn(["vendors"]),n.setSelectedIds&&n.setSelectedIds([g.data.data.id]),n.onVendorCreated&&n.onVendorCreated(g.data.data),s(r),n.setVisible(!1)}).catch(g=>{var p;((p=g.response)==null?void 0:p.status)===422&&(ie.dismiss(),l(g.response.data))})};return N(_t,{children:[o&&f(mQt,{vendor:o,setVendor:s,errors:a,setContacts:u,contacts:c,fundamentalConceptVisible:t}),N("div",{className:St("flex",{"justify-between":t,"justify-end space-x-5":!t}),children:[f(Ut,{behavior:"button",type:"secondary",onClick:()=>i(g=>!g),children:e(t?"more_fields":"less_fields")}),f(Ut,{behavior:"button",onClick:h,children:e("save")})]})]})}function vQt(n){const[e]=ue(),[t,i]=w.useState(!0);return f(cr,{title:e("create_vendor"),visible:n.visible,onClose:()=>n.setVisible(!1),size:t?"extraSmall":"large",renderTransitionChildAsFragment:!0,overflowVisible:!0,children:f(_Qt,{setSelectedIds:n.setSelectedIds,setVisible:n.setVisible,onVendorCreated:n.onVendorCreated,fundamentalConceptVisible:t,setFundamentalConceptVisible:i})})}function bQt(n){var o;const[e]=ue(),t=zo(),[i,r]=w.useState(!1);return N(_t,{children:[f(vQt,{visible:n.initiallyVisibleModal||i,setVisible:n.setVisible||r,setSelectedIds:n.setSelectedIds,onVendorCreated:s=>n.onChange(s)}),!n.setSelectedIds&&f(Qd,{endpoint:ye("/api/v1/vendors?status=active&per_page=500"),onChange:s=>s.resource&&n.onChange(s.resource),inputOptions:{label:(o=n.inputLabel)==null?void 0:o.toString(),value:n.value||null},entryOptions:{id:"id",label:"name",value:"id"},action:{label:e("new_vendor"),onClick:()=>r(!0),visible:t("create_vendor")},readonly:n.readonly,onDismiss:n.onClearButtonClick,initiallyVisible:n.initiallyVisible,sortBy:"name|asc",staleTime:n.staleTime||1/0,errorMessage:n.errorMessage})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function gHe(n){const{setErrors:e,setTransactionRule:t}=n;return(i,r)=>{e(void 0),t(o=>o&&{...o,[i]:r})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const yQt={search_key:"description",operator:"contains",value:""},CQt={description:[{value:"contains",label:"contains"},{value:"starts_with",label:"starts_with"},{value:"is",label:"is"},{value:"is_empty",label:"is_empty"}],amount:[{value:"<",label:"<"},{value:"<=",label:"<="},{value:"=",label:"="},{value:">",label:">"},{value:">=",label:">="}]};function wQt(n){const[e]=ue(),{visible:t,setVisible:i,transactionRule:r,ruleIndex:o,setTransactionRule:s,setErrors:a}=n,[l,c]=w.useState(),u=gHe({setTransactionRule:s,setErrors:a}),d=(p,m)=>{c(_=>_&&{..._,[p]:m})},h=p=>{d("search_key",p),p==="description"&&d("operator","contains"),p==="amount"&&d("operator","<")},g=()=>{if(l){const p=r.rules||[];o>-1?(p[o]=l,u("rules",p),i(!1)):(u("rules",[...p,l]),i(!1))}};return w.useEffect(()=>{r&&(o>-1?c(r.rules[o]):c(yQt))},[r,o]),N(cr,{title:o>-1?e("edit_rule"):e("add_rule"),visible:t,onClose:()=>i(!1),children:[N(nn,{required:!0,label:e("field"),value:l==null?void 0:l.search_key,onValueChange:p=>h(p),children:[f("option",{defaultChecked:!0,value:"description",children:e("description")}),f("option",{value:"amount",children:e("amount")})]}),f(nn,{required:!0,label:e("operator"),value:l==null?void 0:l.operator,onValueChange:p=>d("operator",p),children:(l==null?void 0:l.search_key)&&CQt[l.search_key].map((p,m)=>f("option",{value:p.value,children:e(p.label)},m))}),f(ke,{changeOverride:!0,required:!0,label:e("value"),value:l==null?void 0:l.value,onValueChange:p=>d("value",p)}),f(Ut,{className:"self-end",onClick:g,disableWithoutIcon:!0,disabled:!(l!=null&&l.value),children:e("save")})]})}function pHe(n){var p;const[e]=ue(),t=ys(),[i,r]=w.useState(!1),[o,s]=w.useState(-1),{transactionRule:a,setTransactionRule:l,errors:c,setErrors:u}=n,d=gHe({setErrors:u,setTransactionRule:l}),h=m=>{const _=a.rules.filter((v,b)=>b!==m);d("rules",_)},g=Vn();return N(_t,{children:[N(Ot,{title:n.page==="create"?e("new_transaction_rule"):e("edit_transaction_rule"),children:[f(U,{leftSide:e("name"),required:!0,children:f(ke,{style:{color:g.$3,colorScheme:g.$0,backgroundColor:g.$1,borderColor:g.$4},required:!0,value:a.name,onValueChange:m=>d("name",m),errorMessage:c==null?void 0:c.errors.name})}),f(U,{leftSide:e("match_all_rules"),leftSideHelp:e("match_all_rules_help"),children:f(gt,{style:{color:g.$3,colorScheme:g.$0,backgroundColor:g.$1,borderColor:g.$4},checked:a.matches_on_all||!1,onValueChange:m=>d("matches_on_all",m)})}),f(U,{leftSide:e("auto_convert"),leftSideHelp:e("auto_convert_help"),children:f(gt,{style:{color:g.$3,colorScheme:g.$0,backgroundColor:g.$1,borderColor:g.$4},checked:a.auto_convert||!1,onValueChange:m=>d("auto_convert",m)})}),f(U,{leftSide:e("vendor"),children:f(bQt,{value:a.vendor_id,onChange:m=>d("vendor_id",m.id),onClearButtonClick:()=>d("vendor_id",""),errorMessage:c==null?void 0:c.errors.vendor_id})}),f(U,{leftSide:e("expense_category"),children:f(fQt,{value:a.category_id,onChange:m=>d("category_id",m.id),onClearButtonClick:()=>d("category_id",""),errorMessage:c==null?void 0:c.errors.category_id})})]}),N(zw,{children:[N(Uw,{children:[f(la,{children:e("field")},"field"),f(la,{children:e("operator")},"operator"),f(la,{children:e("value")},"value")]}),N(jw,{children:[(p=a.rules)==null?void 0:p.map((m,_)=>N(zl,{className:"py-2",children:[f(eo,{width:"30%",style:{backgroundColor:g.$2,color:g.$3,colorScheme:g.$0},children:e(m.search_key)}),f(eo,{width:"30%",style:{color:g.$3,colorScheme:g.$0,backgroundColor:g.$1,borderColor:g.$4},children:e(m.operator)}),f(eo,{width:"40%",style:{color:g.$3,colorScheme:g.$0,backgroundColor:g.$1,borderColor:g.$4},children:N("div",{className:"flex justify-between",children:[f("span",{children:m.value}),N("div",{className:"flex space-x-8",style:{color:g.$3,colorScheme:g.$0,backgroundColor:g.$1,borderColor:g.$4},children:[f(_3,{className:"cursor-pointer",color:t,fontSize:22,onClick:()=>{s(_),r(!0)}}),f(Pa,{className:"cursor-pointer",color:t,fontSize:22,onClick:()=>h(_)})]})]})})]},_)),f(zl,{style:{color:g.$3,colorScheme:g.$0,backgroundColor:g.$1,borderColor:g.$4},children:f(eo,{colSpan:100,style:{color:g.$3,colorScheme:g.$0,backgroundColor:g.$1,borderColor:g.$4},children:N("button",{style:{color:g.$3,colorScheme:g.$0,backgroundColor:g.$1,borderColor:g.$4},onClick:()=>{s(-1),r(!0)},className:"w-full py-1 inline-flex justify-center items-center space-x-2",children:[f(ayt,{className:"cursor-pointer",color:t,fontSize:18}),f("span",{children:e("add_rule")})]})})})]})]}),f(wQt,{visible:i,setVisible:r,ruleIndex:o,setTransactionRule:l,setErrors:u,transactionRule:a})]})}function SQt(){const[n]=ue();gi("new_transaction_rule");const e=ri(),t=[{name:n("settings"),href:"/settings"},{name:n("bank_accounts"),href:"/settings/bank_accounts"},{name:n("transaction_rules"),href:"/settings/bank_accounts/transaction_rules"},{name:n("new_transaction_rule"),href:"/settings/bank_accounts/transaction_rules/create"}],{data:i}=dQt(),[r,o]=w.useState(),[s,a]=w.useState(!1),[l,c]=w.useState();w.useEffect(()=>{i&&o({...i,matches_on_all:!0,applies_to:"DEBIT"})},[i]);const u=d=>{d.preventDefault(),s||(ie.processing(),c(void 0),a(!0),Te("POST",ye("/api/v1/bank_transaction_rules"),r).then(h=>{ie.success("created_transaction_rule"),hn(["bank_transaction_rules"]),e(dt("/settings/bank_accounts/transaction_rules/:id/edit",{id:h.data.data.id}))}).catch(h=>{var g;((g=h.response)==null?void 0:g.status)===422&&(ie.dismiss(),c(h.response.data))}).finally(()=>a(!1)))};return f($i,{title:n("new_transaction_rule"),breadcrumbs:t,docsLink:"en/basic-settings/#create_transaction_rule",disableSaveButton:!r||s,onSaveClick:u,children:r?f(pHe,{page:"create",transactionRule:r,setTransactionRule:o,errors:l,setErrors:c}):f(Vo,{})})}function EQt(){const[n]=ue();gi("edit_transaction_rule");const{id:e}=Fa(),t=ri(),i=[{name:n("settings"),href:"/settings"},{name:n("bank_accounts"),href:"/settings/bank_accounts"},{name:n("transaction_rules"),href:"/settings/bank_accounts/transaction_rules"},{name:n("edit_transaction_rule"),href:dt("/settings/bank_accounts/transaction_rules/:id/edit",{id:e})}],{data:r}=hQt({id:e}),[o,s]=w.useState(),[a,l]=w.useState(!1),[c,u]=w.useState();w.useEffect(()=>{r&&s(r)},[r]);const d=h=>{h.preventDefault(),a||(ie.processing(),u(void 0),l(!0),Te("PUT",ye("/api/v1/bank_transaction_rules/:id",{id:e}),o).then(()=>{ie.success("updated_transaction_rule"),hn(["bank_transaction_rules"]),t("/settings/bank_accounts/transaction_rules")}).catch(g=>{var p;((p=g.response)==null?void 0:p.status)===422&&(ie.dismiss(),u(g.response.data))}).finally(()=>l(!1)))};return f($i,{title:n("edit_transaction_rule"),breadcrumbs:i,docsLink:"en/basic-settings/#edit_transaction_rule",disableSaveButton:!o||a,onSaveClick:d,children:o?f(pHe,{transactionRule:o,setTransactionRule:s,errors:c,setErrors:u}):f(Vo,{})})}function Ppe({text:n,className:e,secure:t,limit:i=0,stopPropagation:r}){const o=n||"",s=a=>{r&&a.stopPropagation(),navigator.clipboard.writeText(o),ie.success("copied_to_clipboard",{value:""})};return N("div",{className:`inline-flex space-x-2 ${e}`,children:[f("span",{children:t?n.split("").map(()=>"*"):o.length>i?o.substring(0,i).concat(" "):o}),o.length>0&&f("button",{type:"button",onClick:s,children:f(O5e,{size:18})})]})}const xQt=()=>{const[n]=ue(),e=bf(),t=vi();return[{id:"name",label:n("name")},{id:"price",label:n("price"),format:r=>e(r,t==null?void 0:t.settings.country_id,t==null?void 0:t.settings.currency_id)},{id:"purchase_page",label:n("purchase_page"),format:r=>N("div",{className:"flex space-x-2",onClick:o=>o.stopPropagation(),children:[f(Ii,{to:r,external:!0,children:n("purchase_page")}),f(Ppe,{text:r})]})}]};function kQt(){const{documentTitle:n}=gi("payment_links"),[e]=ue(),t=xQt(),i=[{name:e("settings"),href:"/settings"},{name:e("payment_links"),href:"/settings/subscriptions"}];return f($i,{title:n,docsLink:"en/advanced-settings/#subscriptions",breadcrumbs:i,children:f(Pg,{resource:"payment_link",endpoint:"/api/v1/subscriptions?sort=id|desc",bulkRoute:"/api/v1/subscriptions/bulk",columns:t,linkToCreate:"/settings/subscriptions/create",linkToEdit:"/settings/subscriptions/:id/edit",withResourcefulActions:!0})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function mHe(n){return ai(["/api/v1/products"],()=>Te("GET",ye("/api/v1/products?per_page=500&include=:include&status=:status",{include:(n==null?void 0:n.include)||"",status:(n==null?void 0:n.status)??"all"})).then(e=>e.data.data),{staleTime:1/0})}function Shr(n){return ai(["/api/v1/products",n.id],()=>Te("GET",ye("/api/v1/products/:id",{id:n.id})),{staleTime:1/0})}function TQt(n){const e=zo();return ai(["/api/v1/products/create"],()=>Te("GET",ye("/api/v1/products/create")).then(t=>t.data.data),{...n,staleTime:1/0,enabled:e("create_product")?(n==null?void 0:n.enabled)??!0:!1})}function IQt(n,e){return Te("POST",ye("/api/v1/products/bulk"),{action:e,ids:Array.from(n)})}function J6(n){const e=ys(),t=ri(),i=bf(),[r,o]=w.useState([]),[s,a]=w.useState(),l=u=>{const d=r.findIndex(({id:h})=>h===u);if(d>-1){const h=r.filter((p,m)=>m!==d);o(h);const g=h.map(({id:p})=>p);n.handleChange(n.type,g.join(","))}},c=u=>{var d,h;return u.product_key+" "+i(u.price,(d=u.company)==null?void 0:d.settings.country_id,(h=u.company)==null?void 0:h.settings.currency_id).toString()};return w.useEffect(()=>{if(n.products){let u=[];n.subscription[n.type].split(",").forEach(d=>{var h;u=u.concat(((h=n.products)==null?void 0:h.filter(({id:g})=>g===d))||[])}),o(u)}},[n.products]),w.useEffect(()=>{if(n.products&&s){const u=n.products.filter(({id:d})=>s===d);o(d=>[...d,...u]),a("")}},[s]),w.useEffect(()=>{if(n.products){const u=r.map(({id:d})=>d);n.handleChange(n.type,u.join(","))}},[r]),N(_t,{children:[n.products&&f(nn,{onValueChange:u=>a(u),value:s,withBlank:!0,children:n.products.map((u,d)=>f("option",{value:u.id,children:c(u)},d))}),f("div",{className:"flex justify-center",children:f("ul",{role:"list",className:"-mb-8 mt-3",children:r.map((u,d)=>{var h,g;return f("li",{children:N("div",{className:"relative pb-8",children:[d!==r.length-1&&f("span",{className:"absolute top-4 left-4 -ml-px h-full w-0.5 bg-gray-200","aria-hidden":"true"}),N("div",{className:"relative flex space-x-3",children:[f("span",{className:"h-8 w-8 rounded-full flex items-center justify-center ring-8 ring-white",style:{backgroundColor:e},children:f(cKt,{className:"h-4 w-4 text-white cursor-pointer","aria-hidden":"true",onClick:()=>t(dt("/products/:id/edit",{id:u.id}))})}),N("div",{className:"flex min-w-0 flex-1 justify-between space-x-4 pt-1.5",children:[N("div",{className:"flex flex-1 justify-between space-x-5",children:[f(Ii,{to:dt("/products/:id/edit",{id:u.id}),children:u.product_key}),f("span",{children:i(u.price,(h=u.company)==null?void 0:h.settings.country_id,(g=u.company)==null?void 0:g.settings.currency_id)})]}),f("div",{className:"whitespace-nowrap text-right text-sm text-gray-500",children:f(f0,{className:"cursor-pointer ml-10 xl:ml-20",color:e,fontSize:19,onClick:()=>l(u.id)})})]})]})]})},d)})})})]})}function _He(n){const[e]=ue(),{subscription:t,handleChange:i,errors:r,products:o,page:s}=n;return N(Ot,{title:e("overview"),children:[f(U,{leftSide:e("name"),required:!0,children:f(ke,{value:t.name,onValueChange:a=>i("name",a),errorMessage:r==null?void 0:r.errors.name})}),f(U,{leftSide:e("group"),children:f(Qd,{endpoint:ye("/api/v1/group_settings?status=active"),onChange:a=>a.resource&&i("group_id",a.resource.id),inputOptions:{value:t.group_id},entryOptions:{id:"id",label:"name",value:"id"},onDismiss:()=>i("group_id",""),errorMessage:r==null?void 0:r.errors.group_id})}),f(U,{leftSide:e("user"),children:f(Npe,{value:t.assigned_user_id,onChange:a=>i("assigned_user_id",a.id),onClearButtonClick:()=>i("assigned_user_id",""),clearButton:!0,errorMessage:r==null?void 0:r.errors.assigned_user_id})}),f(U,{leftSide:e("products"),children:f(J6,{type:"product_ids",handleChange:i,subscription:t,products:o})}),f(U,{leftSide:e("recurring_products"),children:f(J6,{type:"recurring_product_ids",handleChange:i,subscription:t,products:o})}),f(U,{leftSide:e("optional_products"),children:f(J6,{type:"optional_product_ids",handleChange:i,subscription:t,products:o})}),f(U,{leftSide:e("optional_recurring_products"),children:f(J6,{type:"optional_recurring_product_ids",handleChange:i,subscription:t,products:o})}),s!=="create"&&f(U,{leftSide:e("purchase_page"),children:f(ec,{className:"break-all",text:t.purchase_page})})]})}function vHe(n){const[e]=ue(),{subscription:t,handleChange:i,errors:r}=n;return w.useEffect(()=>{t.allow_cancellation||i("refund_period",0),t.trial_enabled||i("trial_duration",0)},[t.trial_enabled,t.allow_cancellation]),N(Ot,{title:e("settings"),children:[f(U,{leftSide:e("frequency"),children:N(nn,{value:t.frequency_id,errorMessage:r==null?void 0:r.errors.frequency_id,onValueChange:o=>i("frequency_id",o),children:[f("option",{value:"",children:e("once")}),Object.keys(xx).map((o,s)=>f("option",{value:o,children:e(xx[o])},s))]})}),f(U,{leftSide:e("auto_bill"),children:N(nn,{value:t.auto_bill,onValueChange:o=>i("auto_bill",o),errorMessage:r==null?void 0:r.errors.auto_bill,children:[f("option",{defaultChecked:!0}),f("option",{value:"always",children:e("enabled")}),f("option",{value:"optout",children:e("optout")}),f("option",{value:"optin",children:e("optin")}),f("option",{value:"off",children:e("disabled")})]})}),f(U,{leftSide:e("promo_code"),children:f(ke,{value:t.promo_code,onValueChange:o=>i("promo_code",o),errorMessage:r==null?void 0:r.errors.promo_code})}),f(U,{leftSide:e("promo_discount"),children:N(ZP,{children:[f("div",{className:"w-full lg:w-1/2",children:f(ke,{type:"number",value:t.promo_discount||"",onValueChange:o=>i("promo_discount",parseFloat(o)),errorMessage:r==null?void 0:r.errors.promo_discount})}),f("div",{className:"w-full lg:w-1/2",children:N(nn,{value:t.is_amount_discount.toString(),onValueChange:o=>i("is_amount_discount",JSON.parse(o)),errorMessage:r==null?void 0:r.errors.is_amount_discount,children:[f("option",{value:"true",children:e("amount")}),f("option",{value:"false",children:e("percent")})]})})]})}),f(U,{leftSide:e("registration_required"),leftSideHelp:e("registration_required_help"),children:f(gt,{checked:t.registration_required,onValueChange:o=>i("registration_required",o)})}),f(U,{leftSide:e("use_inventory_management"),leftSideHelp:e("use_inventory_management_help"),children:f(gt,{checked:t.use_inventory_management,onValueChange:o=>i("use_inventory_management",o)})}),f(U,{leftSide:e("return_url"),children:f(ke,{value:t.webhook_configuration.return_url,onValueChange:o=>i("webhook_configuration.return_url",o),errorMessage:r==null?void 0:r.errors["webhook_configuration.return_url"]})}),f(U,{leftSide:e("allow_query_overrides"),children:f(gt,{checked:t.allow_query_overrides,onValueChange:o=>i("allow_query_overrides",o)})}),f(U,{leftSide:e("allow_plan_changes"),children:f(gt,{checked:t.allow_plan_changes,onValueChange:o=>i("allow_plan_changes",o)})}),f(U,{leftSide:e("allow_cancellation"),children:f(gt,{checked:t.allow_cancellation,onValueChange:o=>i("allow_cancellation",o)})}),t.allow_cancellation&&f(U,{children:N(nn,{label:e("refund_period"),value:t.refund_period,onValueChange:o=>i("refund_period",parseFloat(o)||0),withBlank:!0,blankOptionValue:0,errorMessage:r==null?void 0:r.errors.refund_period,children:[f("option",{value:86400,children:e("count_day")}),f("option",{value:172800,children:Ds("count_days",{count:2})}),f("option",{value:259200,children:Ds("count_days",{count:3})}),f("option",{value:604800,children:Ds("count_days",{count:7})}),f("option",{value:1209600,children:Ds("count_days",{count:14})}),f("option",{value:2592e3,children:Ds("count_days",{count:30})}),f("option",{value:5184e3,children:Ds("count_days",{count:60})})]})}),f(U,{leftSide:e("trial_enabled"),children:f(gt,{checked:t.trial_enabled,onValueChange:o=>i("trial_enabled",o)})}),t.trial_enabled&&f(U,{children:N(nn,{label:e("trial_duration"),value:t.trial_duration,onValueChange:o=>i("trial_duration",parseFloat(o)||0),withBlank:!0,blankOptionValue:0,errorMessage:r==null?void 0:r.errors.trial_duration,children:[f("option",{value:86400,children:e("count_day")}),f("option",{value:172800,children:Ds("count_days",{count:2})}),f("option",{value:259200,children:Ds("count_days",{count:3})}),f("option",{value:604800,children:Ds("count_days",{count:7})}),f("option",{value:1209600,children:Ds("count_days",{count:14})}),f("option",{value:2592e3,children:Ds("count_days",{count:30})}),f("option",{value:5184e3,children:Ds("count_days",{count:60})})]})}),f(U,{leftSide:e("per_seat_enabled"),children:f(gt,{checked:t.per_seat_enabled,onValueChange:o=>i("per_seat_enabled",o)})}),t.per_seat_enabled&&f(U,{children:f(ke,{label:e("max_seats_limit"),value:t.max_seats_limit,onValueChange:o=>i("max_seats_limit",parseFloat(o)||0),errorMessage:r==null?void 0:r.errors.max_seats_limit})})]})}function bHe(n){const[e]=ue(),t=ys(),{subscription:i,handleChange:r,errors:o}=n,[s,a]=w.useState(""),[l,c]=w.useState(""),u=Object.entries(i.webhook_configuration.post_purchase_headers),d=()=>{r(`webhook_configuration.post_purchase_headers.${s}`,l),a(""),c("")},h=g=>{Object.hasOwn(i.webhook_configuration.post_purchase_headers,g)&&(delete i.webhook_configuration.post_purchase_headers[g],r("webhook_configuration",i.webhook_configuration))};return N(Ot,{title:e("webhook"),children:[f(U,{leftSide:e("webhook_url"),children:f(ke,{value:i.webhook_configuration.post_purchase_url,onValueChange:g=>r("webhook_configuration.post_purchase_url",g),errorMessage:o==null?void 0:o.errors["webhook_configuration.post_purchase_url"]})}),f(U,{leftSide:e("rest_method"),children:N(nn,{value:i.webhook_configuration.post_purchase_rest_method,onValueChange:g=>r("webhook_configuration.post_purchase_rest_method",g),errorMessage:o==null?void 0:o.errors["webhook_configuration.post_purchase_rest_method"],children:[f("option",{defaultChecked:!0}),f("option",{value:"post",children:e("post")}),f("option",{value:"put",children:e("put")})]})}),f(U,{leftSide:e("add_header"),children:N("div",{className:"flex flex-col",children:[N("div",{className:"flex flex-1 justify-between items-center",children:[f(ke,{label:e("header_key"),value:s,onValueChange:g=>a(g)}),f(ke,{label:e("header_value"),value:l,onValueChange:g=>c(g)}),f(eg,{className:"mt-7 text-gray-800 cursor-pointer",fontSize:25,onClick:()=>s&&l&&d()})]}),u==null?void 0:u.map(([g,p],m)=>N("div",{className:"flex flex-1 justify-between items-center space-x-2 mt-4",children:[f("span",{className:"flex-1 text-start",children:g}),f("span",{className:"flex-1 text-start",children:p}),f(f0,{className:"cursor-pointer",color:t,fontSize:22,onClick:()=>h(g)})]},m)),!u.length&&f("span",{className:"text-gray-500 self-center mt-6 text-xl",children:e("no_headers")})]})})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function yHe(n){return(e,t)=>{n.setErrors(void 0);const i=Bn.cloneDeep(n.subscription);n.setSubscription(Bn.set(i,e,t))}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function LQt(){const{isAdmin:n,isOwner:e}=ao();return ai(["/api/v1/subscriptions","create"],()=>Te("GET",ye("/api/v1/subscriptions/create")).then(t=>t.data.data),{staleTime:1/0,enabled:n||e})}function DQt(n){const{isAdmin:e,isOwner:t}=ao();return ai(["/api/v1/subscriptions",n.id],()=>Te("GET",ye("/api/v1/subscriptions/:id",{id:n.id})).then(i=>i.data.data),{staleTime:1/0,enabled:e||t})}function AQt(){const n=Kr(),e=ki(Hc);return async(t,i)=>(ie.processing(),Te("POST",ye("/api/v1/subscriptions/bulk"),{action:i,ids:t}).then(()=>{ie.success(`${i}d_subscription`),hn(["subscriptions"]),e&&n.invalidateQueries([e])}))}function CHe({subscription:n,handleChange:e,errors:t}){const{t:i}=ue(),r=n.steps?n.steps.split(","):[],[o,s]=w.useState([]),{data:a}=ai({initialData:{},queryKey:["subscriptions","dependencies"],queryFn:()=>Te("GET",ye("/api/v1/subscriptions/steps")).then(g=>g.data)}),l=a?Object.values(a).filter(g=>!r.includes(g.id)):[];function c(g){e("steps",r.filter(p=>p!==g).join(","))}function u(g){if(!g.destination||!a)return;const p=Array.from(r),[m]=p.splice(g.source.index,1);p.splice(g.destination.index,0,m),e("steps",p.join(",")),d(p.join(","))}function d(g){Te("POST",ye("/api/v1/subscriptions/steps/check"),{steps:g??r.join(",")}).then(()=>s([])).catch(p=>{var m;(m=p.response)!=null&&m.data.errors.steps&&s(p.response.data.errors.steps)})}w.useEffect(()=>{a&&d()},[r.length]);const h=l.filter(g=>g.id.startsWith("auth.")).filter(g=>r.some(p=>p.startsWith("auth."))?!g.id.startsWith("auth."):!0);return N(Ot,{title:i("steps"),children:[f(U,{leftSide:i("authentication"),children:f(nn,{value:"",onValueChange:g=>{e("steps",[...r,g].join(","))},withBlank:!0,children:h.map((g,p)=>f("option",{value:g.id,children:i(g.id)},p))})}),f(U,{leftSide:i("other_steps"),children:f(nn,{value:"",onValueChange:g=>{e("steps",[...r,g].join(","))},withBlank:!0,children:l.filter(g=>!g.id.startsWith("auth.")).map((g,p)=>f("option",{value:g.id,children:i(g.id)},p))})}),N(U,{leftSide:i("order"),leftSideHelp:i("steps_order_help"),children:[f(Gj,{onDragEnd:u,children:f(Qj,{droppableId:"columns",children:g=>N("div",{...g.droppableProps,ref:g.innerRef,children:[r.map((p,m)=>f(Yj,{draggableId:`item-${m}`,index:m,children:_=>N("div",{ref:_.innerRef,..._.draggableProps,className:"flex items-center justify-between py-2",children:[N("div",{className:"flex space-x-2 items-center",children:[f(Ve,{className:"cursor-pointer",element:f0,size:20,onClick:()=>c(p)}),f("p",{children:i(p)})]}),f("div",{..._.dragHandleProps,children:f(Ve,{element:R5e,size:23})})]})},m)),g.placeholder]})})}),t!=null&&t.errors.steps?f("div",{className:"text-red-500 mt-2",children:t.errors.steps}):o.length?f("div",{className:"text-red-500 mt-2",children:o.map((g,p)=>f("p",{children:g},p))}):null]})]})}function RQt(){const{documentTitle:n}=gi("new_payment_link"),[e]=ue(),t=ri(),{data:i}=LQt(),{data:r}=mHe({include:"company",status:["active"]}),o=L0(),s=[{name:e("settings"),href:"/settings"},{name:e("payment_links"),href:"/settings/subscriptions"},{name:e("new_payment_link"),href:"/settings/subscriptions/create"}],a=[e("overview"),e("settings"),e("webhook"),e("steps")],[l,c]=w.useState(),[u,d]=w.useState(),[h,g]=w.useState(),p=yHe({setErrors:g,setSubscription:c,subscription:l});return w.useEffect(()=>{i&&c({...i,frequency_id:gd.Monthly,webhook_configuration:{post_purchase_headers:{},post_purchase_body:"",post_purchase_rest_method:"",post_purchase_url:"",return_url:""}})},[i]),w.useEffect(()=>{r&&d(r)},[r]),N($i,{title:n,breadcrumbs:s,onSaveClick:_=>{_.preventDefault(),g(void 0),ie.processing(),Te("POST",ye("/api/v1/subscriptions"),l).then(v=>{ie.success("created_subscription"),hn(["subscriptions"]),t(dt("/settings/subscriptions/:id/edit",{id:v.data.data.id}))}).catch(v=>{var b;((b=v.response)==null?void 0:b.status)===422&&(g(v.response.data),ie.dismiss())})},disableSaveButton:!l||o,children:[o&&f(xb,{}),N(D_,{tabs:a,children:[f("div",{children:l&&f(_He,{subscription:l,handleChange:p,errors:h,products:u,page:"create"})}),f("div",{children:l&&f(vHe,{subscription:l,handleChange:p,errors:h})}),f("div",{children:l&&f(bHe,{subscription:l,handleChange:p,errors:h})}),f("div",{children:l&&f(CHe,{subscription:l,handleChange:p,errors:h})})]})]})}function NQt(){const[n]=ue(),e=AQt();return[i=>nr(i)===Di.Active&&f(et,{onClick:()=>e([i.id],"archive"),icon:f(Ve,{element:Xl}),children:n("archive")}),i=>(nr(i)===Di.Archived||nr(i)===Di.Deleted)&&f(et,{onClick:()=>e([i.id],"restore"),icon:f(Ve,{element:Ql}),children:n("restore")}),i=>(nr(i)===Di.Active||nr(i)===Di.Archived)&&f(et,{onClick:()=>e([i.id],"delete"),icon:f(Ve,{element:Pa}),children:n("delete")})]}function OQt(){const{documentTitle:n}=gi("edit_payment_link"),[e]=ue(),t=NQt(),{id:i}=Fa(),{data:r}=DQt({id:i}),{data:o}=mHe({status:["active"]}),s=[{name:e("settings"),href:"/settings"},{name:e("payment_links"),href:"/settings/subscriptions"},{name:e("edit_payment_link"),href:dt("/settings/subscriptions/:id/edit",{id:i})}],a=L0(),l=[e("overview"),e("settings"),e("webhook"),e("steps")],[c,u]=w.useState(),[d,h]=w.useState(),[g,p]=w.useState(),[m,_]=w.useState(!1),v=yHe({setErrors:p,setSubscription:h,subscription:d});return w.useEffect(()=>{if(r){const{post_purchase_headers:y,post_purchase_body:C,post_purchase_rest_method:x,post_purchase_url:k,return_url:I}=r.webhook_configuration;h({...r,webhook_configuration:{...r.webhook_configuration,post_purchase_headers:Array.isArray(y)?{}:y,post_purchase_body:C||"",post_purchase_rest_method:x||"",post_purchase_url:k||"",return_url:I||""}})}},[r]),w.useEffect(()=>{o&&u(o)},[o]),f($i,{title:n,breadcrumbs:s,navigationTopRight:d&&f(I0,{resource:d,onSaveClick:()=>{m||(p(void 0),_(!0),ie.processing(),Te("PUT",ye("/api/v1/subscriptions/:id",{id:i}),d).then(()=>{ie.success("updated_subscription"),hn(["subscriptions"])}).catch(y=>{var C;((C=y.response)==null?void 0:C.status)===422&&(p(y.response.data),ie.dismiss())}).finally(()=>_(!1)))},actions:t,disableSaveButton:!d||a||m}),children:N(D_,{tabs:l,children:[f("div",{children:d&&f(_He,{subscription:d,handleChange:v,errors:g,products:c})}),f("div",{children:d&&f(vHe,{subscription:d,handleChange:v,errors:g})}),f("div",{children:d&&f(bHe,{subscription:d,handleChange:v,errors:g})}),f("div",{children:d&&f(CHe,{subscription:d,handleChange:v,errors:g})})]})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function PQt(n){const e=zo();return ai("/api/v1/clients/create",()=>Te("GET",ye("/api/v1/clients/create")).then(t=>t.data.data),{refetchOnWindowFocus:!!n.refetchOnWindowFocus,staleTime:1/0,enabled:e("create_client")})}function wHe(n){return ai(["/api/v1/clients","per_page=500",n],()=>{var e;return Te("GET",ye("/api/v1/clients?per_page=500&status=:status",{status:((e=n.status)==null?void 0:e.join(","))??"all"})).then(t=>t.data.data)},{enabled:n.enabled??!0,staleTime:1/0})}function Ehr({id:n,enabled:e}){return ai(["/api/v1/clients",n],()=>Te("GET",ye("/api/v1/clients/:id?include=group_settings,activities.history",{id:n})).then(t=>t.data.data),{enabled:e,staleTime:1/0})}const MQt={assign_group:"updated_group",bulk_update:"updated_records"};function Mpe(){const n=Kr(),e=ki(Hc);return async(t,i,r)=>{const{groupSettingsId:o,column:s,newValue:a}=r||{};return ie.processing(),Te("POST",ye("/api/v1/clients/bulk"),{action:i,ids:t,...o&&{group_settings_id:o},...s&&{column:s},...i==="bulk_update"&&{new_value:a}}).then(()=>{const l=MQt[i]||`${i}d_client`;ie.success(l),e&&n.invalidateQueries([e]),hn(["clients"])})}}const FQt=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],BQt=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],$Qt=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],VQt=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],OTe=(n,e,t)=>{let i=n;return typeof e=="string"||Array.isArray(e)?i=n.toLocaleString(e,t):(e===!0||t!==void 0)&&(i=n.toLocaleString(void 0,t)),i};function SHe(n,e){if(!Number.isFinite(n))throw new TypeError(`Expected a finite number, got ${typeof n}: ${n}`);e={bits:!1,binary:!1,space:!0,...e};const t=e.bits?e.binary?VQt:$Qt:e.binary?BQt:FQt,i=e.space?" ":"";if(e.signed&&n===0)return` 0${i}${t[0]}`;const r=n<0,o=r?"-":e.signed?"+":"";r&&(n=-n);let s;if(e.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:e.minimumFractionDigits}),e.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:e.maximumFractionDigits,...s}),n<1){const u=OTe(n,e.locale,s);return o+u+i+t[0]}const a=Math.min(Math.floor(e.binary?Math.log(n)/Math.log(1024):Math.log10(n)/3),t.length-1);n/=(e.binary?1024:1e3)**a,s||(n=n.toPrecision(3));const l=OTe(Number(n),e.locale,s),c=t[a];return o+l+i+c}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function HQt(n){return N("svg",{...n,xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",enableBackground:"new 0 0 56 56",version:"1.1",viewBox:"0 0 56 56",xmlSpace:"preserve",children:[f("path",{fill:"#E9E9E0",d:"M36.985 0H7.963C7.155 0 6.5.655 6.5 1.926V55c0 .345.655 1 1.463 1h40.074c.808 0 1.463-.655 1.463-1V12.978c0-.696-.093-.92-.257-1.085L37.607.257A.884.884 0 0036.985 0z"}),f("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),f("path",{fill:"#C8BDB8",d:"M48.037 56H7.963A1.463 1.463 0 016.5 54.537V39h43v15.537c0 .808-.655 1.463-1.463 1.463z"}),f("circle",{cx:"18.5",cy:"47",r:"3",fill:"#FFF"}),f("circle",{cx:"28.5",cy:"47",r:"3",fill:"#FFF"}),f("circle",{cx:"38.5",cy:"47",r:"3",fill:"#FFF"})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function WQt(n){return N("svg",{...n,xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",enableBackground:"new 0 0 56 56",version:"1.1",viewBox:"0 0 56 56",xmlSpace:"preserve",children:[f("path",{fill:"#E9E9E0",d:"M36.985 0H7.963C7.155 0 6.5.655 6.5 1.926V55c0 .345.655 1 1.463 1h40.074c.808 0 1.463-.655 1.463-1V12.978c0-.696-.093-.92-.257-1.085L37.607.257A.884.884 0 0036.985 0z"}),f("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),f("circle",{cx:"18.931",cy:"14.431",r:"4.569",fill:"#F3D55B"}),f("path",{fill:"#26B99A",d:"M6.5 39L17.5 39 49.5 39 49.5 28 39.5 18.5 29 30 23.517 24.517z"}),f("path",{fill:"#14A085",d:"M48.037 56H7.963A1.463 1.463 0 016.5 54.537V39h43v15.537c0 .808-.655 1.463-1.463 1.463z"}),f("g",{fill:"#FFF",children:f("path",{d:"M21.426 42.65v7.848c0 .474-.087.873-.26 1.196a2.142 2.142 0 01-.697.779 2.778 2.778 0 01-1.005.41 5.78 5.78 0 01-1.169.117c-.201 0-.436-.021-.704-.062-.269-.041-.547-.104-.834-.191s-.563-.185-.827-.294a3.022 3.022 0 01-.67-.369l.697-1.107c.091.063.221.13.39.198.168.068.353.132.554.191.2.06.41.111.629.157s.424.068.615.068c.483 0 .868-.094 1.155-.28s.439-.504.458-.95V42.65h1.668zM25.514 52.932h-1.641V42.855h2.898c.428 0 .852.068 1.271.205.419.137.795.342 1.128.615.333.273.602.604.807.991s.308.822.308 1.306c0 .511-.087.973-.26 1.388a2.9 2.9 0 01-.725 1.046c-.31.282-.684.501-1.121.656s-.921.232-1.449.232h-1.217v3.638zm0-8.832v3.992h1.504c.2 0 .398-.034.595-.103.196-.068.376-.18.54-.335s.296-.371.396-.649c.1-.278.15-.622.15-1.032 0-.164-.023-.354-.068-.567a1.637 1.637 0 00-.28-.615 1.657 1.657 0 00-.595-.492c-.256-.133-.593-.199-1.012-.199h-1.23zM39.5 47.736v3.896c-.21.265-.444.48-.704.649s-.533.308-.82.417-.583.187-.889.232c-.306.048-.608.07-.909.07-.602 0-1.155-.109-1.661-.328s-.948-.542-1.326-.971c-.378-.429-.675-.966-.889-1.613-.214-.647-.321-1.395-.321-2.242s.107-1.593.321-2.235c.214-.643.51-1.178.889-1.606a3.78 3.78 0 011.333-.978 4.069 4.069 0 011.654-.335c.547 0 1.057.091 1.531.273.474.183.897.456 1.271.82l-1.135 1.012a1.951 1.951 0 00-.752-.574 2.252 2.252 0 00-.875-.178c-.337 0-.659.063-.964.191a2.065 2.065 0 00-.82.649c-.242.306-.431.699-.567 1.183s-.21 1.075-.219 1.777c.009.684.08 1.276.212 1.777.132.501.314.911.547 1.23s.497.556.793.711c.296.155.608.232.937.232.1 0 .234-.007.403-.021a4.91 4.91 0 00.506-.068 3.29 3.29 0 00.485-.13.695.695 0 00.342-.232v-2.488h-1.709v-1.121H39.5z"})})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function zQt(n){return N("svg",{...n,xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",enableBackground:"new 0 0 56 56",version:"1.1",viewBox:"0 0 56 56",xmlSpace:"preserve",children:[f("path",{fill:"#E9E9E0",d:"M36.985 0H7.963C7.155 0 6.5.655 6.5 1.926V55c0 .345.655 1 1.463 1h40.074c.808 0 1.463-.655 1.463-1V12.978c0-.696-.093-.92-.257-1.085L37.607.257A.884.884 0 0036.985 0z"}),f("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),f("path",{fill:"#CC4B4C",d:"M19.514 33.324c-.348 0-.682-.113-.967-.326-1.041-.781-1.181-1.65-1.115-2.242.182-1.628 2.195-3.332 5.985-5.068 1.504-3.296 2.935-7.357 3.788-10.75-.998-2.172-1.968-4.99-1.261-6.643.248-.579.557-1.023 1.134-1.215a4.91 4.91 0 011.016-.172c.504 0 .947.649 1.261 1.049.295.376.964 1.173-.373 6.802 1.348 2.784 3.258 5.62 5.088 7.562 1.311-.237 2.439-.358 3.358-.358 1.566 0 2.515.365 2.902 1.117.32.622.189 1.349-.39 2.16-.557.779-1.325 1.191-2.22 1.191-1.216 0-2.632-.768-4.211-2.285-2.837.593-6.15 1.651-8.828 2.822-.836 1.774-1.637 3.203-2.383 4.251-1.025 1.435-1.909 2.105-2.784 2.105zm2.662-5.126c-2.137 1.201-3.008 2.188-3.071 2.744-.01.092-.037.334.431.692.149-.047 1.019-.444 2.64-3.436zm13.637-4.442c.815.627 1.014.944 1.547.944.234 0 .901-.01 1.21-.441.149-.209.207-.343.23-.415-.123-.065-.286-.197-1.175-.197-.505.001-1.14.023-1.812.109zm-7.47-6.582a71.291 71.291 0 01-2.674 7.564 49.966 49.966 0 016.496-2.02c-1.35-1.568-2.699-3.526-3.822-5.544zm-.607-8.462c-.098.033-1.33 1.757.096 3.216.949-2.115-.053-3.23-.096-3.216zM48.037 56H7.963A1.463 1.463 0 016.5 54.537V39h43v15.537c0 .808-.655 1.463-1.463 1.463z"}),f("g",{fill:"#FFF",children:f("path",{d:"M17.385 53h-1.641V42.924h2.898c.428 0 .852.068 1.271.205.419.137.795.342 1.128.615.333.273.602.604.807.991s.308.822.308 1.306c0 .511-.087.973-.26 1.388a2.9 2.9 0 01-.725 1.046c-.31.282-.684.501-1.121.656s-.921.232-1.449.232h-1.217V53zm0-8.832v3.992h1.504c.2 0 .398-.034.595-.103.196-.068.376-.18.54-.335.164-.155.296-.371.396-.649.1-.278.15-.622.15-1.032 0-.164-.023-.354-.068-.567a1.637 1.637 0 00-.28-.615 1.657 1.657 0 00-.595-.492c-.255-.132-.593-.198-1.012-.198h-1.23zM32.219 47.682c0 .829-.089 1.538-.267 2.126s-.403 1.08-.677 1.477-.581.709-.923.937-.672.398-.991.513a4.094 4.094 0 01-.875.219c-.264.03-.46.046-.588.046h-3.814V42.924h3.035c.848 0 1.593.135 2.235.403s1.176.627 1.6 1.073.74.955.95 1.524c.21.57.315 1.156.315 1.758zm-4.867 4.115c1.112 0 1.914-.355 2.406-1.066s.738-1.741.738-3.09c0-.419-.05-.834-.15-1.244-.101-.41-.294-.781-.581-1.114s-.677-.602-1.169-.807-1.13-.308-1.914-.308h-.957v7.629h1.627zM36.266 44.168v3.172h4.211v1.121h-4.211V53h-1.668V42.924H40.9v1.244h-4.634z"})})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function jQt(n){return N("svg",{...n,xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",enableBackground:"new 0 0 56 56",version:"1.1",viewBox:"0 0 56 56",xmlSpace:"preserve",children:[f("path",{fill:"#E9E9E0",d:"M36.985 0H7.963C7.155 0 6.5.655 6.5 1.926V55c0 .345.655 1 1.463 1h40.074c.808 0 1.463-.655 1.463-1V12.978c0-.696-.093-.92-.257-1.085L37.607.257A.884.884 0 0036.985 0z"}),f("path",{fill:"#659C35",d:"M48.037 56H7.963A1.463 1.463 0 016.5 54.537V39h43v15.537c0 .808-.655 1.463-1.463 1.463z"}),f("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),f("g",{fill:"#FFF",children:f("path",{d:"M17.385 53h-1.641V42.924h2.898c.428 0 .852.068 1.271.205.419.137.795.342 1.128.615.333.273.602.604.807.991s.308.822.308 1.306c0 .511-.087.973-.26 1.388a2.9 2.9 0 01-.725 1.046c-.31.282-.684.501-1.121.656s-.921.232-1.449.232h-1.217V53zm0-8.832v3.992h1.504c.2 0 .398-.034.595-.103.196-.068.376-.18.54-.335.164-.155.296-.371.396-.649.1-.278.15-.622.15-1.032 0-.164-.023-.354-.068-.567a1.637 1.637 0 00-.28-.615 1.657 1.657 0 00-.595-.492c-.255-.132-.593-.198-1.012-.198h-1.23zM31.316 42.924V53h-1.668l-3.951-6.945V53h-1.668V42.924h1.668l3.951 6.945v-6.945h1.668zM41.16 47.805v3.896c-.21.265-.444.48-.704.649s-.533.308-.82.417-.584.187-.889.233a6.096 6.096 0 01-.909.068c-.602 0-1.155-.109-1.661-.328s-.948-.542-1.326-.971c-.378-.429-.675-.966-.889-1.613-.214-.647-.321-1.395-.321-2.242s.107-1.593.321-2.235c.214-.643.51-1.178.889-1.606a3.78 3.78 0 011.333-.978 4.069 4.069 0 011.654-.335c.547 0 1.057.091 1.531.273.474.183.897.456 1.271.82l-1.135 1.012a1.951 1.951 0 00-.752-.574 2.252 2.252 0 00-.875-.178c-.337 0-.659.063-.964.191a2.065 2.065 0 00-.82.649c-.242.306-.431.699-.567 1.183s-.21 1.075-.219 1.777c.009.684.08 1.276.212 1.777.132.501.314.911.547 1.23s.497.556.793.711c.296.155.608.232.937.232.1 0 .234-.007.403-.021a4.91 4.91 0 00.506-.068 3.29 3.29 0 00.485-.13.695.695 0 00.342-.232v-2.488h-1.709v-1.121h3.336z"})}),f("circle",{cx:"18.931",cy:"14.431",r:"4.569",fill:"#F3D55B"}),f("path",{fill:"#88C057",d:"M6.5 39L17.5 39 49.5 39 49.5 28 39.5 18.5 29 30 23.517 24.517z"})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function UQt(n){return N("svg",{...n,xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",enableBackground:"new 0 0 56 56",version:"1.1",viewBox:"0 0 56 56",xmlSpace:"preserve",children:[f("path",{fill:"#E9E9E0",d:"M36.985 0H7.963C7.155 0 6.5.655 6.5 1.926V55c0 .345.655 1 1.463 1h40.074c.808 0 1.463-.655 1.463-1V12.978c0-.696-.093-.92-.257-1.085L37.607.257A.884.884 0 0036.985 0z"}),f("path",{fill:"#D9D7CA",d:"M37.5 0.151L37.5 12 49.349 12z"}),f("path",{fill:"#E57E25",d:"M48.037 56H7.963A1.463 1.463 0 016.5 54.537V39h43v15.537c0 .808-.655 1.463-1.463 1.463z"}),f("g",{fill:"#FFF",children:f("path",{d:"M21.459 50.238c0 .364-.075.718-.226 1.06s-.362.643-.636.902-.61.467-1.012.622-.856.232-1.367.232c-.219 0-.444-.012-.677-.034s-.467-.062-.704-.116-.463-.13-.677-.226-.398-.212-.554-.349l.287-1.176c.128.073.289.144.485.212s.398.132.608.191.419.107.629.144.405.055.588.055c.556 0 .982-.13 1.278-.39.296-.26.444-.645.444-1.155 0-.31-.104-.574-.314-.793s-.472-.417-.786-.595-.654-.355-1.019-.533-.706-.388-1.025-.629-.583-.526-.793-.854-.314-.738-.314-1.23c0-.446.082-.843.246-1.189s.385-.641.663-.882.602-.426.971-.554.759-.191 1.169-.191c.419 0 .843.039 1.271.116s.774.203 1.039.376c-.055.118-.118.248-.191.39l-.205.396c-.063.123-.118.226-.164.308s-.073.128-.082.137c-.055-.027-.116-.063-.185-.109s-.166-.091-.294-.137-.296-.077-.506-.096-.479-.014-.807.014c-.183.019-.355.07-.52.157s-.31.193-.438.321-.228.271-.301.431-.109.313-.109.458c0 .364.104.658.314.882s.47.419.779.588.647.333 1.012.492.704.354 1.019.581.576.513.786.854.318.781.318 1.319zM25.861 53.055L22.73 42.924h1.873l2.338 8.695 2.475-8.695h1.859l-3.281 10.131h-2.133zM40.668 47.805v3.896c-.21.265-.444.48-.704.649s-.533.308-.82.417-.583.187-.889.233-.608.068-.909.068c-.602 0-1.155-.109-1.661-.328s-.948-.542-1.326-.971-.675-.966-.889-1.613-.321-1.395-.321-2.242.107-1.593.321-2.235.511-1.178.889-1.606.822-.754 1.333-.978 1.062-.335 1.654-.335c.547 0 1.058.091 1.531.273s.897.456 1.271.82l-1.135 1.012c-.219-.265-.47-.456-.752-.574s-.574-.178-.875-.178c-.337 0-.658.063-.964.191s-.579.344-.82.649-.431.699-.567 1.183-.21 1.075-.219 1.777c.009.684.08 1.276.212 1.777s.314.911.547 1.23.497.556.793.711.608.232.937.232c.101 0 .234-.007.403-.021s.337-.036.506-.068.33-.075.485-.13.269-.132.342-.232v-2.488h-1.709v-1.121h3.336z"})}),f("path",{fill:"#C8BDB8",d:"M45.5 22v-6h-6v2h-6v-4h-10v4h-6v-2h-6v6h6v-2h3.548c-4.566 2.636-7.548 7.588-7.548 13a1 1 0 102 0c0-5.246 3.229-9.999 8-11.995V24h10v-2.995c4.771 1.997 8 6.75 8 11.995a1 1 0 102 0c0-5.412-2.982-10.364-7.548-13H39.5v2h6zm-30-2h-2v-2h2v2zm16 2h-6v-6h6v6zm10-4h2v2h-2v-2z"})]})}function EHe(n){const e=["jpg","svg","png","pdf"],{size:t=26,type:i}=n;return N(_t,{children:[i==="jpg"&&f(WQt,{height:t}),i==="svg"&&f(UQt,{height:t}),i==="png"&&f(jQt,{height:t}),i==="pdf"&&f(zQt,{height:t}),!e.includes(i)&&f(HQt,{height:t})]})}function xHe(n){const[e]=ue(),t=sl(),{disableEditableOptions:i=!1}=n,r=j8e(),[o,s]=w.useState(!1),a=Ri(_f),[l,c]=w.useState(),[u,d]=w.useState([]),{dateFormat:h}=Il(),g=Kr(),p=v=>{var b;return(b=u.find(({documentId:y})=>y===v))==null?void 0:b.url},m=(v,b)=>{ie.processing(),g.fetchQuery(["/api/v1/documents",v.hash],()=>Te("GET",ye("/documents/:hash",{hash:v.hash}),{headers:fx()},{responseType:"arraybuffer"}),{staleTime:1/0}).then(y=>{const C=new Blob([y.data],{type:y.headers["content-type"]}),x=URL.createObjectURL(C);if(b){window.open(x);return}const k=document.createElement("a");k.download=v.name,k.href=x,k.target="_blank",document.body.appendChild(k),k.click(),document.body.removeChild(k),ie.dismiss()})},_=v=>{ie.processing(),Te("delete",ye("/api/v1/documents/:id",{id:l}),{},{headers:{"X-Api-Password":v}}).then(()=>{var b;ie.success("deleted_document"),(b=n.onDocumentDelete)==null||b.call(n)}).catch(b=>{var y;((y=b.response)==null?void 0:y.status)===412&&(ie.error("password_error_incorrect"),a(0))})};return w.useEffect(()=>{t.show_document_preview&&n.documents.forEach(async({id:v,hash:b,type:y})=>{if(!u.find(({documentId:x})=>x===v)&&(y==="png"||y==="jpg")){const x=await g.fetchQuery(["documents",b],()=>Te("GET",ye("/documents/:hash",{hash:b}),{headers:fx()},{responseType:"arraybuffer"}),{staleTime:1/0}),k=new Blob([x.data],{type:x.headers["content-type"]}),I=URL.createObjectURL(k);d(L=>[...L,{documentId:v,url:I}])}})},[t,n.documents]),N(_t,{children:[N(zw,{children:[N(Uw,{children:[f(la,{children:e("name")}),f(la,{children:e("date")}),f(la,{children:e("type")}),f(la,{children:e("size")}),!i&&f(la,{})]}),N(jw,{children:[!n.documents.length&&f(zl,{children:f(eo,{colSpan:5,children:e("no_records_found")})}),n.documents.map((v,b)=>N(zl,{children:[f(eo,{children:N("div",{className:"flex items-center space-x-10",style:{width:"max-content"},children:[N("div",{className:"flex items-center space-x-2",children:[f(EHe,{type:v.type}),f("span",{children:v.name}),v.is_public?f(Ve,{element:l7,size:27}):f(Ve,{element:a7,size:27})]}),t.show_document_preview&&(v.type==="png"||v.type==="jpg")&&f(_t,{children:p(v.id)?f("img",{src:p(v.id),style:{width:150,height:75}}):f(Vo,{})})]})}),f(eo,{children:Jr(v.updated_at,h)}),f(eo,{children:v.type}),f(eo,{children:SHe(v.size)}),!i&&f(eo,{children:N(Hp,{label:e("more_actions"),children:[f(et,{onClick:()=>{m(v,!0)},icon:f(Ve,{element:Xhe}),children:e("view")}),f(et,{onClick:()=>{m(v,!1)},icon:f(Ve,{element:XC}),children:e("download")}),v.is_public?f(et,{onClick:()=>{r(v.id,!1).then(()=>{var y;return(y=n.onDocumentDelete)==null?void 0:y.call(n)})},icon:f(Ve,{element:a7}),children:e("set_private")}):f(et,{onClick:()=>{r(v.id,!0).then(()=>{var y;return(y=n.onDocumentDelete)==null?void 0:y.call(n)})},icon:f(Ve,{element:l7}),children:e("set_public")}),f(et,{onClick:()=>{c(v.id),s(!0)},icon:f(Ve,{element:Pa}),children:e("delete")})]})})]},b))]})]}),f(Rg,{show:o,onClose:s,onSave:_})]})}function qQt(){const{t:n}=ue(),{dateFormat:e}=Il(),t=sl(),i=j8e(),r=Ri(_f),[o,s]=w.useState(1),[a,l]=w.useState("10"),[c,u]=w.useState(""),[d,h]=w.useState(!1),[g,p]=w.useState([]),{data:m,isLoading:_}=W8e({perPage:a,currentPage:o,companyDocuments:"true"}),v=Kr(),b=k=>{var I;return(I=g.find(({documentId:L})=>L===k))==null?void 0:I.url},y=()=>{hn(["documents"])},C=async(k,I)=>{ie.processing();const L=await v.fetchQuery(["/api/v1/documents",k.hash],()=>Te("GET",ye("/documents/:hash",{hash:k.hash}),{headers:fx()},{responseType:"arraybuffer"}),{staleTime:1/0});ie.dismiss();const D=new Blob([L.data],{type:L.headers["content-type"]}),R=URL.createObjectURL(D);if(I){window.open(R);return}const P=document.createElement("a");P.download=k.name,P.href=R,P.target="_blank",document.body.appendChild(P),P.click(),document.body.removeChild(P)},x=(k,I=!0)=>{ie.processing(),Te("delete",ye("/api/v1/documents/:id",{id:c}),{},{headers:{"X-Api-Password":k}}).then(()=>ie.success("deleted_document")).catch(L=>{var D;((D=L.response)==null?void 0:D.status)===412&&(ie.error("password_error_incorrect"),r(0))}).finally(()=>y())};return w.useEffect(()=>{t.show_document_preview&&m&&m.data.data.forEach(async({id:k,hash:I,type:L})=>{if(!g.find(({documentId:R})=>R===k)&&(L==="png"||L==="jpg")){const R=await v.fetchQuery(["/api/v1/documents",I],()=>Te("GET",ye("/documents/:hash",{hash:I}),{headers:fx()},{responseType:"arraybuffer"}),{staleTime:1/0}),P=new Blob([R.data],{type:R.headers["content-type"]}),M=URL.createObjectURL(P);p(O=>[...O,{documentId:k,url:M}])}})},[t,m==null?void 0:m.data.data]),N(_t,{children:[N(zw,{children:[N(Uw,{children:[f(la,{children:n("name")}),f(la,{children:n("date")}),f(la,{children:n("type")}),f(la,{children:n("size")}),f(la,{})]}),N(jw,{children:[_&&f(zl,{children:f(eo,{colSpan:5,children:f(Vo,{})})}),m&&m.data.data.map(k=>N(zl,{children:[f(eo,{children:N("div",{className:"flex items-center space-x-10",style:{width:"max-content"},children:[N("div",{className:"flex items-center space-x-2",children:[f(EHe,{type:k.type}),f("span",{children:k.name}),k.is_public?f(Ve,{element:l7,size:27}):f(Ve,{element:a7,size:27})]}),t.show_document_preview&&(k.type==="png"||k.type==="jpg")&&f(_t,{children:b(k.id)?f("img",{src:b(k.id),style:{width:150,height:75}}):f(Vo,{})})]})}),f(eo,{children:Jr(k.updated_at,e)}),f(eo,{children:k.type}),f(eo,{children:SHe(k.size)}),f(eo,{children:N(Hp,{label:n("more_actions"),children:[f(et,{onClick:()=>{C(k,!0)},icon:f(Ve,{element:Xhe}),children:n("view")}),f(et,{onClick:()=>{C(k,!1)},icon:f(Ve,{element:XC}),children:n("download")}),k.is_public?f(et,{onClick:()=>{i(k.id,!1).then(()=>y())},icon:f(Ve,{element:a7}),children:n("set_private")}):f(et,{onClick:()=>{i(k.id,!0).then(()=>y())},icon:f(Ve,{element:l7}),children:n("set_public")}),f(et,{onClick:()=>{u(k.id),h(!0)},icon:f(Ve,{element:Pa}),children:n("delete")})]})})]},k.id))]})]}),m&&f(V7e,{currentPage:o,onPageChange:s,onRowsChange:l,totalPages:m.data.meta.pagination.total_pages}),f(Rg,{show:d,onClose:h,onSave:x})]})}function Fpe(n){const[e]=ue(),{disableUpload:t=!1}=n,i=ha(),[r,o]=w.useState(new FormData),[s,a]=w.useState(),l=Xp({enableReinitialize:!0,initialValues:{},onSubmit:()=>{ie.processing(),a(void 0),Te("POST",n.endpoint,r,{headers:{"Content-Type":"multipart/form-data"}}).then(()=>{var g;ie.success("uploaded_document"),o(new FormData),(g=n.onSuccess)==null||g.call(n)}).catch(g=>{var p;((p=g.response)==null?void 0:p.status)===422&&(ie.dismiss(),a(g.response.data)),o(new FormData)})}}),{getRootProps:c,getInputProps:u,isDragActive:d}=hA({disabled:!ql()&&Yo()||t,onDrop:g=>{r.append("_method","PUT"),g.forEach(p=>r.append("documents[]",p)),o(r),l.submitForm()}}),h=Vn();return n.widgetOnly?N(_t,{children:[!ql()&&Yo()&&f(bs,{className:"mb-4",type:"warning",disableClosing:!0,children:N("div",{className:"flex items-center",children:[f(yD,{className:"mr-2",fontSize:20}),e("upgrade_to_upload_images"),(i==null?void 0:i.company_user)&&f(Ii,{className:"ml-10",external:!0,to:i.company_user.ninja_portal_url,children:e("plan_change")})]})}),f("div",{...c(),className:"flex flex-col md:flex-row md:items-center",children:N("div",{className:"relative block w-full border-2 border-gray-300 border-dashed rounded-lg p-12 text-center hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:[f("input",{...u()}),f(px,{className:"mx-auto h-12 w-12 text-gray-400"}),f("span",{className:"mt-2 block text-sm font-medium",style:{color:h.$3},children:e(d?"drop_file_here":"dropzone_default_message")})]})}),s&&Object.keys(s.errors).map((g,p)=>f(bs,{className:"mt-2",type:"danger",children:s.errors[g]},p))]}):N(_t,{children:[!ql()&&Yo()&&f(bs,{className:"mb-4",type:"warning",disableClosing:!0,children:N("div",{className:"flex items-center",children:[f(yD,{className:"mr-2",fontSize:20}),e("upgrade_to_upload_images"),(i==null?void 0:i.company_user)&&f(Ii,{className:"ml-10",external:!0,to:i.company_user.ninja_portal_url,children:e("plan_change")})]})}),f(Ot,{title:e("upload"),children:f(U,{leftSide:e("upload"),children:f("div",{...c(),className:"flex flex-col md:flex-row md:items-center",children:N("div",{className:"relative block w-full border-2 border-gray-300 border-dashed rounded-lg p-12 text-center hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:[f("input",{...u()}),f(px,{className:"mx-auto h-12 w-12 text-gray-400"}),f("span",{className:"mt-2 block text-sm font-medium",style:{color:h.$3},children:d?"drop_file_here":e("dropzone_default_message")})]})})})})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Zj(){const n=ha(),{isAdmin:e,isOwner:t}=ao();return(i,r)=>{if(r)return!!(n&&i&&i.user_id===n.id)||e||t;const o=n&&i&&"assigned_user_id"in i&&i.assigned_user_id===n.id;return!!(n&&i&&(i.user_id===n.id||o||e||t))}}function KQt({client:n,errors:e,setClient:t}){var m,_,v,b,y,C,x;const[i]=ue(),r=spe(),o=gz(),s=Zj(),{data:a}=jVe({}),{data:l}=Nd(),{id:c}=Fa(),u=(k,I)=>{t(L=>L&&{...L,[k]:I})},d=(k,I)=>{var D;const L=Bn.cloneDeep(n);k!=="currency_id"&&I===""?(D=L.settings)==null||delete D[k]:Bn.set(L,`settings.${k}`,I),t(L)},[h,g]=w.useState([i("settings"),i("notes"),i("classify"),i("documents")]);w.useEffect(()=>{c||g(k=>k.filter(I=>I!==i("documents")))},[]);const p=()=>{hn(["clients"])};return f(Ot,{title:i("additional_info"),children:N(D_,{className:"px-5",tabs:h,formatTabLabel:k=>{if(k===3)return f(Ege,{numberOfDocuments:n==null?void 0:n.documents.length})},children:[N("div",{className:"-mx-5",children:[r.length>1&&f(U,{leftSide:i("currency"),children:f(ND,{value:((m=n==null?void 0:n.settings)==null?void 0:m.currency_id)||"",onChange:k=>d("currency_id",k),errorMessage:e==null?void 0:e.errors["settings.currency_id"],dismissable:!0})}),o.length>1&&f(U,{leftSide:i("language"),children:f(Y3,{value:((_=n==null?void 0:n.settings)==null?void 0:_.language_id)||"",onChange:k=>d("language_id",k),errorMessage:e==null?void 0:e.errors["settings.language_id"],dismissable:!0})}),a&&f(U,{leftSide:i("payment_terms"),children:f(nn,{id:"settings.payment_terms",defaultValue:((v=n==null?void 0:n.settings)==null?void 0:v.payment_terms)||"",errorMessage:e==null?void 0:e.errors["settings.payment_terms"],onValueChange:k=>d("payment_terms",k),withBlank:!0,children:a.data.data.map((k,I)=>f("option",{value:k.num_days,children:k.name},I))})}),a&&f(U,{leftSide:i("quote_valid_until"),children:f(nn,{id:"settings.valid_until",defaultValue:((b=n==null?void 0:n.settings)==null?void 0:b.valid_until)||"",onValueChange:k=>d("valid_until",k),errorMessage:e==null?void 0:e.errors["settings.valid_until"],withBlank:!0,children:a.data.data.map((k,I)=>f("option",{value:k.num_days,children:k.name},I))})}),f(U,{leftSide:i("task_rate"),children:f(ke,{id:"settings.default_task_rate",type:"number",value:(y=n==null?void 0:n.settings)==null?void 0:y.default_task_rate,onValueChange:k=>d("default_task_rate",k),errorMessage:e==null?void 0:e.errors["settings.default_task_rate"]})}),f(U,{leftSide:i("send_reminders"),children:N(nn,{id:"settings.send_reminders",defaultValue:((C=n==null?void 0:n.settings)==null?void 0:C.send_reminders)===!0?"enabled":((x=n==null?void 0:n.settings)==null?void 0:x.send_reminders)===!1?"disabled":"",className:"appearance-none block px-3 py-1.5 text-base font-normal text-gray-700 bg-white bg-clip-padding bg-no-repeat border border-solid border-gray-300 rounded transition ease-in-out m-0 focus:text-gray-700 focus:bg-white focus:border-blue-600 focus:outline-none",onValueChange:k=>d("send_reminders",k==="enabled"?!0:k===""?"":!1),withBlank:!0,errorMessage:e==null?void 0:e.errors["settings.send_reminders"],children:[f("option",{value:"enabled",children:i("enabled")}),f("option",{value:"disabled",children:i("disabled")})]})})]}),N("div",{className:"-mx-5",children:[f(U,{leftSide:i("public_notes"),children:f(vd,{value:n==null?void 0:n.public_notes,onChange:k=>u("public_notes",k)})}),f(U,{leftSide:i("private_notes"),children:f(vd,{value:n==null?void 0:n.private_notes,onChange:k=>u("private_notes",k)})})]}),N("div",{className:"-mx-5",children:[l&&f(U,{leftSide:i("size_id"),children:f(nn,{id:"size_id",defaultValue:(n==null?void 0:n.size_id)||"",onValueChange:k=>u("size_id",k),errorMessage:e==null?void 0:e.errors.size_id,withBlank:!0,children:l==null?void 0:l.sizes.map((k,I)=>f("option",{value:k.id,children:k.name},I))})}),l&&f(U,{leftSide:i("industry"),children:f(nn,{id:"industry_id",defaultValue:(n==null?void 0:n.industry_id)||"",errorMessage:e==null?void 0:e.errors.industry_id,onValueChange:k=>u("industry_id",k),withBlank:!0,children:l==null?void 0:l.industries.map((k,I)=>f("option",{value:k.id,children:k.name},I))})})]}),c?f("div",{children:N("div",{className:"px-6",children:[f(Fpe,{widgetOnly:!0,endpoint:ye("/api/v1/clients/:id/upload",{id:c}),onSuccess:p}),f(xHe,{documents:(n==null?void 0:n.documents)||[],onDocumentDelete:p,disableEditableOptions:!s(n,!0)})]})}):f(_t,{})]})})}function GQt(n){var s,a,l,c,u,d;const[e]=ue(),{errors:t,setClient:i,setErrors:r}=n,o=h=>{r(void 0),i(g=>g&&Bn.set(g,h.target.id,h.target.value))};return N(_t,{children:[f(U,{leftSide:e("billing_address1"),children:f(ke,{id:"address1",value:((s=n.client)==null?void 0:s.address1)||"",onChange:o,errorMessage:t==null?void 0:t.errors.address1})}),f(U,{leftSide:e("address2"),children:f(ke,{id:"address2",value:((a=n.client)==null?void 0:a.address2)||"",onChange:o,errorMessage:t==null?void 0:t.errors.address2})}),f(U,{leftSide:e("city"),children:f(ke,{id:"city",value:((l=n.client)==null?void 0:l.city)||"",onChange:o,errorMessage:t==null?void 0:t.errors.city})}),f(U,{leftSide:e("state"),children:f(ke,{id:"state",value:((c=n.client)==null?void 0:c.state)||"",onChange:o,errorMessage:t==null?void 0:t.errors.state})}),f(U,{leftSide:e("postal_code"),children:f(ke,{id:"postal_code",value:((u=n.client)==null?void 0:u.postal_code)||"",onChange:o,errorMessage:t==null?void 0:t.errors.postal_code})}),f(U,{leftSide:e("country"),children:f(Xj,{value:((d=n.client)==null?void 0:d.country_id)||"",errorMessage:t==null?void 0:t.errors.country_id,onChange:h=>i(g=>g&&{...g,country_id:h}),dismissable:!0})})]})}function YQt(n){var a,l,c,u,d,h;const[e]=ue(),{errors:t,setErrors:i,setClient:r}=n,o=g=>{i(void 0),r(p=>p&&Bn.set(p,g.target.id,g.target.value))};return N(_t,{children:[f(Ut,{onClick:()=>{n.setClient(g=>g&&{...g,shipping_address1:g==null?void 0:g.address1,shipping_address2:g==null?void 0:g.address2,shipping_city:g==null?void 0:g.city,shipping_state:g==null?void 0:g.state,shipping_postal_code:g==null?void 0:g.postal_code,shipping_country_id:g==null?void 0:g.country_id})},type:"secondary",behavior:"button",className:"mx-4 rounded-md bg-grey h-6",children:e("copy_billing")}),f(U,{leftSide:e("shipping_address1"),children:f(ke,{id:"shipping_address1",value:((a=n.client)==null?void 0:a.shipping_address1)||"",onChange:o,errorMessage:t==null?void 0:t.errors.shipping_address1})}),f(U,{leftSide:e("address2"),children:f(ke,{id:"shipping_address2",value:((l=n.client)==null?void 0:l.shipping_address2)||"",onChange:o})}),f(U,{leftSide:e("city"),children:f(ke,{id:"shipping_city",value:((c=n.client)==null?void 0:c.shipping_city)||"",onChange:o,errorMessage:t==null?void 0:t.errors.shipping_city})}),f(U,{leftSide:e("state"),children:f(ke,{id:"shipping_state",value:((u=n.client)==null?void 0:u.shipping_state)||"",onChange:o,errorMessage:t==null?void 0:t.errors.shipping_state})}),f(U,{leftSide:e("postal_code"),children:f(ke,{id:"shipping_postal_code",value:((d=n.client)==null?void 0:d.shipping_postal_code)||"",onChange:o,errorMessage:t==null?void 0:t.errors.shipping_postal_code})}),f(U,{leftSide:e("country"),children:f(Xj,{onChange:g=>r(p=>p&&{...p,shipping_country_id:g}),value:((h=n.client)==null?void 0:h.shipping_country_id)||"",errorMessage:t==null?void 0:t.errors.shipping_country_id,dismissable:!0})})]})}function QQt(n){const[e]=ue();return f(Ot,{title:e("address"),children:N(D_,{className:"px-5",tabs:[e("billing_address"),e("shipping_address")],children:[f("div",{className:"-mx-5",children:f(GQt,{...n})}),f("div",{className:"-mx-5",children:f(YQt,{...n})})]})})}var XQt=function(n){return n instanceof RegExp},ZQt=function(e){var t=/[\\^$.*+?()[\]{}|]/g,i=RegExp(t.source);return e&&i.test(e)?e.replace(t,"\\$&"):e},kHe=function(n){return typeof n=="string"},JQt=function(n){var e=[];return n.forEach(function(t){Array.isArray(t)?e=e.concat(t):e.push(t)}),e};function eXt(n,e,t){var i=0,r=0;if(n==="")return n;if(!n||!kHe(n))throw new TypeError("First argument to react-string-replace#replaceString must be a string");var o=e;XQt(o)||(o=new RegExp("("+ZQt(o)+")","gi"));for(var s=n.split(o),a=1,l=s.length;a<l;a+=2){if(s[a]===void 0||s[a-1]===void 0){console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");continue}r=s[a].length,i+=s[a-1].length,s[a]=t(s[a],a,i),i+=r}return s}var tXt=function(e,t,i){return Array.isArray(e)||(e=[e]),JQt(e.map(function(r){return kHe(r)?eXt(r,t,i):r}))};const THe=ja(tXt);function nXt(n){const[e]=ue(),{size:t=22}=n||{};return f(du,{tooltipElement:THe(e("user_unsubscribed"),":link",()=>N(Ii,{className:"lowercase text-xs",to:"https://invoiceninja.github.io/en/hosted-mail/",external:!0,children:[e("link"),"."]})),width:"auto",placement:"top",children:f(V1,{color:"red",size:t})})}function iXt(n){const[e]=ue(),t=ys(),i=vi(),r=(l,c,u)=>{n.setErrors(void 0);const d=n.contacts.findIndex(h=>h.contact_key===u);Bn.set(n.contacts[d],c,l),n.setContacts([...n.contacts])},o=l=>{const c=[...n.contacts];c.splice(l,1),n.setContacts(c)},s=()=>{const l=[...n.contacts];l.push({contact_key:xj().replaceAll("-",""),first_name:"",last_name:"",email:"",password:"",phone:"",send_email:!1}),n.setContacts(l)},a=Vn();return f(Ot,{className:"mt-4 xl:mt-0",title:e("contacts"),children:n.contacts.map((l,c,u)=>{var d,h,g,p,m,_,v,b,y;return N("div",{className:"pb-4 mb-4 border-b",style:{borderColor:a.$5},children:[f(U,{leftSide:e("first_name"),children:f(ke,{id:`first_name_${c}`,value:l.first_name,onChange:C=>r(C.target.value,"first_name",l.contact_key),errorMessage:(d=n.errors)==null?void 0:d.errors.name})}),f(U,{leftSide:e("last_name"),children:f(ke,{id:`last_name_${c}`,value:l.last_name,onChange:C=>r(C.target.value,"last_name",l.contact_key),errorMessage:(h=n.errors)==null?void 0:h.errors.name})}),f(U,{leftSide:e("email"),children:f(ke,{id:`email_${c}`,value:l.email,onChange:C=>r(C.target.value,"email",l.contact_key),errorMessage:(g=n.errors)==null?void 0:g.errors[`contacts.${c}.email`]})}),(i==null?void 0:i.settings.enable_client_portal_password)&&f(U,{leftSide:e("password"),children:f(ke,{id:`password_${c}`,type:"password",value:l.password,onChange:C=>r(C.target.value,"password",l.contact_key),errorMessage:(p=n.errors)==null?void 0:p.errors[`contacts.${c}.password`]})}),f(U,{leftSide:e("phone"),children:f(ke,{id:`phone_${c}`,value:l.phone,onChange:C=>r(C.target.value,"phone",l.contact_key),errorMessage:(m=n.errors)==null?void 0:m.errors[`contacts.${c}.phone`]})}),f(U,{leftSide:e("add_to_invoices"),children:f(gt,{checked:!!(l!=null&&l.send_email),onChange:C=>r(C,"send_email",l.contact_key)})}),((_=i==null?void 0:i.custom_fields)==null?void 0:_.contact1)&&f(Do,{field:"contact1",defaultValue:l.custom_value1,value:i.custom_fields.contact1,onValueChange:C=>r(C,"custom_value1",l.contact_key)}),((v=i==null?void 0:i.custom_fields)==null?void 0:v.contact2)&&f(Do,{field:"contact2",defaultValue:l.custom_value2,value:i.custom_fields.contact2,onValueChange:C=>r(C,"custom_value2",l.contact_key)}),((b=i==null?void 0:i.custom_fields)==null?void 0:b.contact3)&&f(Do,{field:"contact3",defaultValue:l.custom_value3,value:i.custom_fields.contact3,onValueChange:C=>r(C,"custom_value3",l.contact_key)}),((y=i==null?void 0:i.custom_fields)==null?void 0:y.contact4)&&f(Do,{field:"contact4",defaultValue:l.custom_value4,value:i.custom_fields.contact4,onValueChange:C=>r(C,"custom_value4",l.contact_key)}),f(U,{...l.is_locked&&{leftSide:f("div",{className:"flex",children:f(nXt,{size:25})})},children:N("div",{className:"flex items-center",children:[f("div",{className:"flex items-center justify-between w-1/2",children:n.contacts.length>=2&&f("button",{type:"button",onClick:()=>o(c),className:"text-red-600",children:e("remove_contact")})}),f("div",{className:"w-1/2 flex justify-end",children:c+1===u.length&&f("button",{type:"button",onClick:s,style:{color:t},children:e("add_contact")})})]})})]},c)})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function rXt(n){return ai(["/api/v1/group_settings",n],()=>Te("GET",ye("/api/v1/group_settings?status=:status&per_page=:perPage",{status:(n==null?void 0:n.status)??"active",perPage:(n==null?void 0:n.perPage)??20})).then(e=>e.data.data),{staleTime:1/0})}function oXt(n){const{id:e}=n;return ai(["/api/v1/group_settings",e],()=>Te("GET",ye("/api/v1/group_settings/:id",{id:e})).then(t=>t.data.data),{staleTime:1/0})}function sXt(){return(n,e)=>{ie.processing(),Te("POST",ye("/api/v1/group_settings/bulk"),{action:e,ids:n}).then(()=>{ie.success(`${e}d_group`),hn(["group_settings"])})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function aXt(){return ai(["/api/v1/users"],()=>Te("GET",ye("/api/v1/users")),{staleTime:1/0})}function lXt(n){return ai(["/api/v1/users",n.id],()=>Te("GET",ye("/api/v1/users/:id?include=company_user",{id:n.id})),{enabled:n.enabled,staleTime:1/0})}function cXt(){const{isAdmin:n}=ao();return ai(["/api/v1/users/create"],()=>Te("GET",ye("/api/v1/users/create")),{staleTime:1/0,enabled:n})}function uXt(){const n=Ri(_f),e=T4e();return(t,i,r)=>{ie.processing(),Te("POST",ye("/api/v1/users/bulk"),{action:i,ids:t},{headers:{"X-Api-Password":r}}).then(()=>{ie.success(`${i}d_user`),e(["users"])}).catch(o=>{var s;((s=o.response)==null?void 0:s.status)===412&&(ie.error("password_error_incorrect"),n(0))})}}function dXt(n){var a,l,c,u,d,h,g,p,m,_,v,b,y,C,x,k,I,L,D,R,P,M,O,B,F,H,V,$,j;const[e]=ue(),{data:t}=aXt(),{data:i}=rXt(),r=Y=>{n.setErrors(void 0),n.setClient(ne=>ne&&Bn.set({...ne},Y.target.id,Y.target.value))},o=(Y,ne)=>{n.setClient(se=>se&&Bn.set({...se},Y,ne))},s=vi();return N(Ot,{title:e("company_details"),children:[n.client&&n.page==="edit"&&f(U,{leftSide:e("status"),children:f(zp,{entity:n.client})}),f(U,{leftSide:e("name"),children:f(ke,{id:"name",value:((a=n.client)==null?void 0:a.name)||"",onChange:r,errorMessage:(l=n.errors)==null?void 0:l.errors.name})}),f(U,{leftSide:e("number"),children:f(ke,{id:"number",value:((c=n.client)==null?void 0:c.number)||"",onChange:r,errorMessage:(u=n.errors)==null?void 0:u.errors.number})}),i&&f(U,{leftSide:e("group"),children:N(nn,{id:"group_settings_id",value:(d=n.client)==null?void 0:d.group_settings_id,onChange:r,errorMessage:(h=n.errors)==null?void 0:h.errors.group_settings_id,children:[f("option",{value:""}),i.map((Y,ne)=>f("option",{value:Y.id,children:Y.name},ne))]})}),t&&f(U,{leftSide:e("user"),children:N(nn,{id:"assigned_user_id",onChange:r,defaultValue:(g=n.client)==null?void 0:g.assigned_user_id,errorMessage:(p=n.errors)==null?void 0:p.errors.assigned_user_id,children:[f("option",{value:""}),t.data.data.map((Y,ne)=>N("option",{value:Y.id,children:[Y.first_name," ",Y.last_name]},ne))]})}),f(U,{leftSide:e("id_number"),children:f(ke,{id:"id_number",value:((m=n.client)==null?void 0:m.id_number)||"",onChange:r,errorMessage:(_=n.errors)==null?void 0:_.errors.id_number})}),f(U,{leftSide:e("vat_number"),children:f(ke,{id:"vat_number",value:((v=n.client)==null?void 0:v.vat_number)||"",onChange:r,errorMessage:(b=n.errors)==null?void 0:b.errors.vat_number})}),f(U,{leftSide:e("website"),children:f(ke,{id:"website",value:((y=n.client)==null?void 0:y.website)||"",onChange:r,errorMessage:(C=n.errors)==null?void 0:C.errors.website})}),f(U,{leftSide:e("phone"),children:f(ke,{id:"phone",value:((x=n.client)==null?void 0:x.phone)||"",onChange:r,errorMessage:(k=n.errors)==null?void 0:k.errors.phone})}),f(U,{leftSide:e("routing_id"),children:f(ke,{id:"routing_id",value:((I=n.client)==null?void 0:I.routing_id)||"",onChange:r,errorMessage:(L=n.errors)==null?void 0:L.errors.routing_id})}),f(U,{leftSide:e("valid_vat_number"),children:f(gt,{id:"has_valid_vat_number",checked:!!((D=n.client)!=null&&D.has_valid_vat_number),onValueChange:Y=>o("has_valid_vat_number",Y)})}),f(U,{leftSide:e("tax_exempt"),children:f(gt,{id:"is_tax_exempt",checked:!!((R=n.client)!=null&&R.is_tax_exempt),onValueChange:Y=>o("is_tax_exempt",Y)})}),f(U,{leftSide:e("classification"),children:N(nn,{id:"classification",defaultValue:((P=n.client)==null?void 0:P.classification)??"",onChange:r,withBlank:!0,children:[f("option",{value:"individual",children:e("individual")}),f("option",{value:"business",children:e("business")}),f("option",{value:"company",children:e("company")}),f("option",{value:"partnership",children:e("partnership")}),f("option",{value:"trust",children:e("trust")}),f("option",{value:"charity",children:e("charity")}),f("option",{value:"government",children:e("government")}),f("option",{value:"other",children:e("other")})]})}),((M=s==null?void 0:s.custom_fields)==null?void 0:M.client1)&&f(Do,{field:"client1",defaultValue:(O=n.client)==null?void 0:O.custom_value1,value:s.custom_fields.client1,onValueChange:Y=>o("custom_value1",Y)}),((B=s==null?void 0:s.custom_fields)==null?void 0:B.client2)&&f(Do,{field:"client2",defaultValue:(F=n.client)==null?void 0:F.custom_value2,value:s.custom_fields.client2,onValueChange:Y=>o("custom_value2",Y)}),((H=s==null?void 0:s.custom_fields)==null?void 0:H.client3)&&f(Do,{field:"client3",defaultValue:(V=n.client)==null?void 0:V.custom_value3,value:s.custom_fields.client3,onValueChange:Y=>o("custom_value3",Y)}),(($=s==null?void 0:s.custom_fields)==null?void 0:$.client4)&&f(Do,{field:"client4",defaultValue:(j=n.client)==null?void 0:j.custom_value4,value:s.custom_fields.client4,onValueChange:Y=>o("custom_value4",Y)})]})}function IHe({isModalOpen:n,setIsModalOpen:e,onClientCreated:t}){var v;const[i]=ue(),[r,o]=w.useState(),[s,a]=w.useState(),[l,c]=w.useState([{first_name:"",last_name:"",email:"",phone:"",send_email:!1}]),[u,d]=w.useState(!0),{data:h}=PQt({refetchOnWindowFocus:!1}),g=(b,y)=>{a(void 0),o(C=>C&&Bn.set({...C},b,y))},p=(b,y)=>{a(void 0);const C=l.findIndex(x=>x.contact_key===l[0].contact_key);Bn.set(l[C],y,b),c([...l])},m=b=>{d(!0),e(b),a(void 0),o(void 0),c(()=>[{first_name:"",last_name:"",email:"",phone:"",send_email:!1}])},_=()=>{if(Bn.set(r,"contacts",l),ie.processing(),a(void 0),!((r==null?void 0:r.name)!=""||l[0].first_name!=""||l[0].last_name!=""))return a({message:i("invalid_data //needs translation"),errors:{name:[i("please_enter_a_client_or_contact_name")]}}),ie.error(),_;Te("POST",ye("/api/v1/clients"),r).then(b=>{ie.success("created_client"),t&&t(b.data.data),hn(["clients"]),window.dispatchEvent(new CustomEvent("invalidate.combobox.queries",{detail:{url:ye("/api/v1/clients")}})),m(!1)}).catch(b=>{var y;((y=b.response)==null?void 0:y.status)===422&&(a(b.response.data),ie.dismiss())})};return w.useEffect(()=>{h&&n&&o({...h})},[n]),f(cr,{title:i("new_client"),visible:n,onClose:()=>m(!1),size:u?"extraSmall":"large",renderTransitionChildAsFragment:!0,overflowVisible:!0,children:N("div",{className:"flex flex-col space-y-7",children:[r?f(_t,{children:u?N("div",{className:"flex flex-col space-y-3",children:[f(ke,{label:i("name"),value:(r==null?void 0:r.name)||"",onValueChange:b=>g("name",b),errorMessage:s==null?void 0:s.errors.name}),f(ke,{label:`${i("contact")} ${i("first_name")}`,value:l[0].first_name,onValueChange:b=>p(b,"first_name"),errorMessage:s==null?void 0:s.errors.name}),f(ke,{label:`${i("contact")} ${i("last_name")}`,value:l[0].last_name,onValueChange:b=>p(b,"last_name"),errorMessage:s==null?void 0:s.errors.name}),f(ke,{label:`${i("contact")} ${i("email")}`,value:l[0].email,onValueChange:b=>p(b,"email"),errorMessage:s==null?void 0:s.errors["contacts.0.email"]}),f(ke,{label:`${i("contact")} ${i("phone")}`,value:l[0].phone,onValueChange:b=>p(b,"phone"),errorMessage:s==null?void 0:s.errors["contacts.0.phone"]}),f(ND,{label:i("currency"),value:((v=r==null?void 0:r.settings)==null?void 0:v.currency_id)||"",onChange:b=>{const y=Bn.cloneDeep(r);Bn.set(y,"settings.currency_id",b),o(y)},errorMessage:s==null?void 0:s.errors["settings.currency_id"],dismissable:!0})]}):N("div",{className:"flex flex-col xl:flex-row xl:gap-4",children:[N("div",{className:"w-full xl:w-1/2",children:[f(dXt,{client:r,setClient:o,setErrors:a,errors:s}),f("div",{className:"mt-5",children:f(QQt,{client:r,setClient:o,setErrors:a,errors:s})})]}),N("div",{className:"w-full xl:w-1/2",children:[f(iXt,{contacts:l,setContacts:c,setErrors:a,errors:s}),f("div",{className:"mt-5",children:f(KQt,{client:r,setClient:o,setErrors:a,errors:s})})]})]})}):f(Vo,{}),N("div",{className:St("flex",{"justify-between":u,"justify-end space-x-5":!u}),children:[f(Ut,{behavior:"button",type:"secondary",onClick:()=>d(b=>!b),children:i(u?"more_fields":"less_fields")}),f(Ut,{behavior:"button",onClick:_,children:i("save")})]})]})})}function Jj(n){var s;const[e]=ue(),[t,i]=w.useState(!1),r=zo(),{dropdownLabelFn:o}=n;return N(_t,{children:[f(IHe,{isModalOpen:t,setIsModalOpen:i,onClientCreated:a=>n.onChange(a)}),f(Qd,{inputOptions:{label:(s=n.inputLabel)==null?void 0:s.toString(),value:n.value||null},endpoint:ye("/api/v1/clients"),readonly:n.readonly,onDismiss:n.onClearButtonClick,querySpecificEntry:"/api/v1/clients/:id",initiallyVisible:n.initiallyVisible,entryOptions:{id:"id",label:"display_name",value:"id",customSearchableValue:a=>a.contacts.map(({email:l})=>l).join(","),dropdownLabelFn:o},onChange:a=>a.resource&&n.onChange(a.resource),staleTime:n.staleTime||1/0,sortBy:null,exclude:n.exclude,action:{label:e("new_client"),visible:!(n.withoutAction||!r("create_client")),onClick:()=>i(!0)},clearInputAfterSelection:n.clearInputAfterSelection},"client_selector"),n.errorMessage&&f(bs,{className:"mt-2",type:"danger",children:n.errorMessage})]})}const eU=po(void 0);function hXt(n){const[e]=ue(),t=ys(),i=ki(eU),{schedule:r,handleChange:o,errors:s,page:a}=n,{data:l}=wHe({enabled:a==="edit"||!!i}),[c,u]=w.useState([]),d=g=>{const p={...r.parameters};p.clients=g.map(({id:m})=>m),o("parameters",p)},h=g=>{const p=c.filter((m,_)=>_!==g);d(p),u(p)};return w.useEffect(()=>{if((a==="edit"||i)&&l){const g=l==null?void 0:l.filter(p=>{var m;return(m=r.parameters.clients)==null?void 0:m.includes(p.id)});u(g)}},[l]),N(_t,{children:[f(U,{leftSide:e("date_range"),children:N(nn,{value:r.parameters.date_range,onValueChange:g=>o("parameters.date_range",g),errorMessage:s==null?void 0:s.errors["parameters.date_range"],children:[f("option",{value:"last7_days",children:e("last7_days")}),f("option",{value:"last30_days",children:e("last30_days")}),f("option",{value:"last365_days",children:e("last365_days")}),f("option",{value:"this_month",children:e("this_month")}),f("option",{value:"last_month",children:e("last_month")}),f("option",{value:"this_quarter",children:e("this_quarter")}),f("option",{value:"last_quarter",children:e("last_quarter")}),f("option",{value:"this_year",children:e("this_year")}),f("option",{value:"last_year",children:e("last_year")}),f("option",{value:"all_time",children:e("all_time")})]})}),f(U,{leftSide:e("status"),children:N(nn,{value:r.parameters.status,onValueChange:g=>o("parameters.status",g),errorMessage:s==null?void 0:s.errors["parameters.status"],children:[f("option",{value:"all",children:e("all")}),f("option",{value:"paid",children:e("paid")}),f("option",{value:"unpaid",children:e("unpaid")})]})}),f(U,{leftSide:e("show_aging_table"),children:f(gt,{checked:r.parameters.show_aging_table,onValueChange:g=>o("parameters.show_aging_table",g)})}),f(U,{leftSide:e("show_payments_table"),children:f(gt,{checked:r.parameters.show_payments_table,onValueChange:g=>o("parameters.show_payments_table",g)})}),f(U,{leftSide:e("show_credits_table"),children:f(gt,{checked:r.parameters.show_credits_table,onValueChange:g=>o("parameters.show_credits_table",g)})}),f(U,{leftSide:e("only_clients_with_invoices"),children:f(gt,{checked:r.parameters.only_clients_with_invoices,onValueChange:g=>o("parameters.only_clients_with_invoices",g)})}),N(U,{leftSide:e("client"),children:[f(Jj,{onChange:g=>{u(p=>{const m=[...p,g];return d(m),m})},withoutAction:!0,clearInputAfterSelection:!0,exclude:r.parameters.clients}),N("div",{className:"flex justify-center",children:[f("div",{className:"flex flex-col space-y-2 pt-3",children:c==null?void 0:c.map((g,p)=>N("div",{className:"flex items-center justify-between",children:[f("span",{children:g.display_name}),f(f0,{className:"cursor-pointer ml-16",fontSize:20,color:t,onClick:()=>h(p)})]},g.id))}),!(c!=null&&c.length)&&f("span",{className:"text-gray-500 self-center text-xl mt-4",children:e("all_clients")})]})]})]})}function fXt(n){const[e]=ue(),t=bf(),{schedule:i,handleChange:r,errors:o}=n,s=a=>{var l,c;return`${a.number} (${t(a.amount,(l=a==null?void 0:a.client)==null?void 0:l.country_id,(c=a==null?void 0:a.client)==null?void 0:c.settings.currency_id)})`};return N(_t,{children:[f(U,{leftSide:e("type"),children:N(nn,{value:i.parameters.entity,onValueChange:a=>r("parameters.entity",a),errorMessage:o==null?void 0:o.errors["parameters.entity"],children:[f("option",{value:"invoice",defaultChecked:!0,children:e("invoice")}),f("option",{value:"quote",children:e("quote")}),f("option",{value:"credit",children:e("credit")}),f("option",{value:"purchase_order",children:e("purchase_order")})]})}),i.parameters.entity==="invoice"&&f(U,{leftSide:e("invoice"),children:f(Qd,{endpoint:ye("/api/v1/invoices?include=client.group_settings&filter_deleted_clients=true&status=active"),onChange:a=>a.resource&&r("parameters.entity_id",a.resource.id),inputOptions:{value:i.parameters.entity_id},entryOptions:{id:"id",label:"number",value:"id",dropdownLabelFn:a=>s(a),inputLabelFn:a=>a?s(a):""},onDismiss:()=>r("parameters.entity_id",""),errorMessage:o==null?void 0:o.errors["parameters.entity_id"]})}),i.parameters.entity==="quote"&&f(U,{leftSide:e("quote"),children:f(Qd,{endpoint:ye("/api/v1/quotes?include=client&filter_deleted_clients=true&status=active"),onChange:a=>a.resource&&r("parameters.entity_id",a.resource.id),inputOptions:{value:i.parameters.entity_id},entryOptions:{id:"id",label:"number",value:"id",dropdownLabelFn:a=>s(a),inputLabelFn:a=>a?s(a):""},onDismiss:()=>r("parameters.entity_id",""),errorMessage:o==null?void 0:o.errors["parameters.entity_id"]})}),i.parameters.entity==="credit"&&f(U,{leftSide:e("credit"),children:f(Qd,{endpoint:ye("/api/v1/credits?include=client&filter_deleted_clients=true&status=active"),onChange:a=>a.resource&&r("parameters.entity_id",a.resource.id),inputOptions:{value:i.parameters.entity_id},entryOptions:{id:"id",label:"number",value:"id",dropdownLabelFn:a=>s(a),inputLabelFn:a=>a?s(a):""},onDismiss:()=>r("parameters.entity_id",""),errorMessage:o==null?void 0:o.errors["parameters.entity_id"]})}),i.parameters.entity==="purchase_order"&&f(U,{leftSide:e("purchase_order"),children:f(Qd,{endpoint:ye("/api/v1/purchase_orders?include=vendor&status=active"),onChange:a=>a.resource&&r("parameters.entity_id",a.resource.id),inputOptions:{value:i.parameters.entity_id},entryOptions:{id:"id",label:"number",value:"id",dropdownLabelFn:a=>{var l,c;return`${a.number} (${t(a.amount,(l=a==null?void 0:a.vendor)==null?void 0:l.country_id,(c=a==null?void 0:a.vendor)==null?void 0:c.currency_id)})`},inputLabelFn:a=>{var l,c;return a?`${a.number} (${t(a.amount,(l=a==null?void 0:a.vendor)==null?void 0:l.country_id,(c=a==null?void 0:a.vendor)==null?void 0:c.currency_id)})`:""}},onDismiss:()=>r("parameters.entity_id",""),errorMessage:o==null?void 0:o.errors["parameters.entity_id"]})})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const gXt={email_statement:["template","next_run","frequency","remaining_cycles"],email_record:["template","next_run"],email_report:["template","next_run","frequency","remaining_cycles"]};function pXt(n){const{template:e}=n;return t=>gXt[e].includes(t)}function LHe(n){const[e]=ue(),t=Vn(),i=Kr(),r=Ik(),{value:o,onValueChange:s,errorMessage:a}=n,l=w.useRef(void 0),[c,u]=w.useState(""),[d,h]=w.useState(!!o),[g,p]=w.useState(),{data:m,isLoading:_}=ai({queryKey:["/api/v1/products","perPage=500","status=active",c],queryFn:()=>Te("GET",ye("/api/v1/products?per_page=:perPage&include=&status=active&filter=:filter",{filter:c,perPage:4})).then(b=>b.data.data),enabled:!d,staleTime:1/0});w.useEffect(()=>{m&&!d&&p(m.map(b=>({value:b.product_key,label:b.product_key,color:t.$3,backgroundColor:t.$1})))},[m,d]),w.useEffect(()=>{o&&d&&(async()=>{for(let b=0;b<o.split(",").length;b++){const y=o.split(",")[b],C=await i.fetchQuery(["/api/v1/products","perPage=500","status=active",y],()=>Te("GET",ye("/api/v1/products?per_page=:perPage&include=&status=active&filter=:filter",{filter:y,perPage:4})).then(x=>x.data.data),{staleTime:1/0});p(x=>{const k=x||[],I=k.find(({value:L})=>L===y)?[]:C.map(L=>({value:L.product_key,label:L.product_key,color:t.$3,backgroundColor:t.$1})).filter(L=>L.value===y);return I[0]?[...k,I[0]]:[...k]})}h(!1)})()},[o]);const v=b=>b.map(y=>y.value).join(",");return N(_t,{children:[g&&!d?f(U,{leftSide:e("products"),children:N("div",{className:"flex space-x-3",children:[f("div",{className:"flex-1",children:f(b_,{id:"productItemSelector",placeholder:e("products"),...o&&{defaultValue:g==null?void 0:g.filter(b=>o.split(",").find(y=>y===b.value))},onChange:b=>s(v(b)),options:g,onInputChange:b=>{clearTimeout(l.current);const y=setTimeout(()=>u(b),600);l.current=y},isMulti:!0,styles:r,isSearchable:!0})}),_&&f("div",{className:"flex justify-center items-center",children:f(Vo,{})})]})}):f("div",{className:"flex justify-center items-center",children:f(Vo,{})}),a&&f(bs,{className:"mt-2",type:"danger",children:a})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function mXt(){const[n]=ue(),e=Ng();return[{label:n("draft"),value:"draft",color:"white",backgroundColor:"#6B7280"},{label:n("paid"),value:"paid",color:"white",backgroundColor:e.$3||"#22C55E"},{label:n("unpaid"),value:"unpaid",color:"white",backgroundColor:"#F97316"},{label:n("past_due"),value:"overdue",color:"white",backgroundColor:e.$5||"#CA8A04"},{label:n("cancelled"),value:"cancelled",color:"white",backgroundColor:"#000000"}]}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function _Xt(){const[n]=ue(),e=Ng();return[{label:n("draft"),value:"draft",color:"white",backgroundColor:"#6B7280"},{label:n("sent"),value:"sent",color:"white",backgroundColor:e.$1||"#93C5FD"},{label:n("partial"),value:"partial",color:"white",backgroundColor:e.$2||"#1D4ED8"},{label:n("applied"),value:"applied",color:"white",backgroundColor:e.$3||"#22C55E"}]}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/var pr=(n=>(n.BANK_TRANSFER="1",n.CASH="2",n.CREDIT="32",n.ACH="4",n.VISA="5",n.MASTERCARD="6",n.AMERICAN_EXPRESS="7",n.DISCOVER="8",n.DINERS="9",n.EUROCARD="10",n.NOVA="11",n.CREDIT_CARD_OTHER="12",n.PAYPAL="13",n.CHECK="15",n.CARTE_BLANCHE="16",n.UNIONPAY="17",n.JCB="18",n.LASER="19",n.MAESTRO="20",n.SOLO="21",n.SWITCH="22",n.ALIPAY="27",n.SOFORT="28",n.SEPA="29",n.GOCARDLESS="30",n.CRYPTO="31",n.ZELLE="33",n.MOLLIE_BANK_TRANSFER="34",n.KBC="35",n.BANCONTACT="36",n.IDEAL="37",n.HOSTED_PAGE="38",n.GIROPAY="39",n.PRZELEWY24="40",n.EPS="41",n.DIRECT_DEBIT="42",n.BECS="43",n.ACSS="44",n.INSTANT_BANK_PAY="45",n.FPX="46",n.KLARNA="47",n.INTERAC="48",n.BACS="49",n.STRIPE_BANK_TRANSFER="50",n.CASH_APP="51",n.VENMO="25",n.IZETTLE="23",n))(pr||{});/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const vXt={[pr.ACH]:"payment_type_ACH",[pr.ACSS]:"payment_type_ACSS",[pr.ALIPAY]:"payment_type_Alipay",[pr.AMERICAN_EXPRESS]:"payment_type_American Express",[pr.BANCONTACT]:"bancontact",[pr.BACS]:"payment_type_BACS",[pr.BECS]:"becs",[pr.BANK_TRANSFER]:"payment_type_Bank Transfer",[pr.CARTE_BLANCHE]:"payment_type_Carte Blanche",[pr.CASH]:"payment_type_Cash",[pr.CASH_APP]:"payment_type_Cash App",[pr.CHECK]:"payment_type_Check",[pr.CREDIT]:"payment_type_Credit",[pr.CREDIT_CARD_OTHER]:"payment_type_Credit Card Other",[pr.CRYPTO]:"payment_type_Crypto",[pr.DINERS]:"payment_type_Diners Card",[pr.DIRECT_DEBIT]:"payment_type_direct_debit",[pr.DISCOVER]:"payment_type_Discover Card",[pr.EPS]:"eps",[pr.EUROCARD]:"payment_type_EuroCard",[pr.FPX]:"fpx",[pr.GIROPAY]:"giropay",[pr.GOCARDLESS]:"payment_type_GoCardless",[pr.HOSTED_PAGE]:"payment_type_Hosted Page",[pr.IDEAL]:"ideal",[pr.IZETTLE]:"payment_type_iZettle",[pr.INSTANT_BANK_PAY]:"instant_bank_pay",[pr.INTERAC]:"payment_type_Interac E-Transfer",[pr.JCB]:"payment_type_JCB",[pr.KBC]:"kbc_cbc",[pr.KLARNA]:"payment_type_Klarna",[pr.LASER]:"payment_type_Laser",[pr.MAESTRO]:"payment_type_Maestro",[pr.MASTERCARD]:"payment_type_MasterCard",[pr.MOLLIE_BANK_TRANSFER]:"payment_type_Bank Transfer",[pr.NOVA]:"payment_type_Nova",[pr.PAYPAL]:"payment_type_PayPal",[pr.PRZELEWY24]:"przelewy24",[pr.SEPA]:"payment_type_SEPA",[pr.SOFORT]:"payment_type_Sofort",[pr.SOLO]:"payment_type_Solo",[pr.SWITCH]:"payment_type_Switch",[pr.UNIONPAY]:"payment_type_UnionPay",[pr.VENMO]:"payment_type_Venmo",[pr.VISA]:"payment_type_Visa Card",[pr.ZELLE]:"payment_type_Zelle"};function aM(n){const[e]=ue();return f("span",{className:St({"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800":!n.headless}),style:n.style,onClick:n.onClick,children:e(n.for[n.code])||e(n.code.toString())})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const bXt=po(void 0);/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const yXt=po(void 0);function CXt(n){const[e]=ue(),{invoice_id:t,should_be_invoiced:i,payment_date:r,payment_type_id:o,transaction_reference:s,archived_at:a,is_deleted:l}=n.entity,c=Ng(),u=!!t,d=r||o||s;return l?f(Gi,{variant:"red",children:e("deleted")}):a?f(Gi,{variant:"orange",children:e("archived")}):u?f(Gi,{variant:"dark-blue",style:{backgroundColor:c.$3},children:e("invoiced")}):i?f(Gi,{variant:"light-blue",children:e("pending")}):d?f(Gi,{variant:"green",style:{backgroundColor:c.$1},children:e("paid")}):f(Gi,{variant:"generic",children:e("logged")})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function yf(n){const[e]=ue(),t=vi(),i=t==null?void 0:t.custom_fields,{entity:r}=n,o=[];if(i)for(let s=1;s<5;s++){const a=i[r+s.toString()]?Z7(i[r+s.toString()]).label():e(`custom${s.toString()}`);o.push(a)}return o}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function xhr(n){const e=zo();return ai(dt("/api/v1/expenses/create"),()=>Te("GET",ye("/api/v1/expenses/create")).then(t=>t.data.data),{enabled:e("create_expense")?n.enabled??!0:!1,staleTime:1/0})}function khr(n){return ai(["/api/v1/expenses",n.id],()=>Te("GET",ye("/api/v1/expenses/:id?include=category",{id:n.id})).then(e=>e.data.data),{enabled:n.enabled??!0,staleTime:1/0})}function Thr(n){return ai(["/api/v1/expenses",n],()=>Te("GET",ye("/api/v1/expenses?filter=:filter&per_page=:per_page&status=:status&page=:page&match_transactions=:match_transactions&include=:include",{per_page:n.perPage??"100",page:n.currentPage??"1",status:n.status??"active",filter:n.filter??"",match_transactions:n.matchTransactions??!1,includes:"category",include:n.include||""})).then(e=>e.data.data),{enabled:n.enabled??!0,staleTime:1/0})}function wXt(){const n=Kr(),e=ki(Hc);return(t,i,r)=>{ie.processing(),Te("POST",ye("/api/v1/expenses/bulk"),{action:i,ids:t,...r}).then(()=>{ie.success(`${i}d_expense`),e&&n.invalidateQueries([e]),hn(["expenses"])})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Ihr(n){return ai(["/api/v1/invoices",n.id],()=>Te("GET",ye("/api/v1/invoices/:id?include=client.group_settings",{id:n.id})).then(e=>e.data.data),{staleTime:1/0,enabled:!!n.id})}function tU(n){const e=zo();return ai(["/api/v1/invoices/create"],()=>Te("GET",ye("/api/v1/invoices/create")).then(t=>t.data.data),{...n,staleTime:1/0,enabled:e("create_invoice")?(n==null?void 0:n.enabled)??!0:!1})}const SXt={mark_sent:"marked_sent_invoices",email:"emailed_invoices",mark_paid:"marked_invoices_as_paid",download:"exported_data",cancel:"cancelled_invoices",auto_bill:"auto_billed_invoices"};function Lhr(n){const e=Kr(),t=ki(Hc);return(i,r,o)=>{ie.processing(),Te("POST",ye("/api/v1/invoices/bulk"),{action:r,ids:i,...o&&{email_type:o}}).then(()=>{var a;const s=SXt[r]||`${r}d_invoice`;ie.success(s),(a=n==null?void 0:n.onSuccess)==null||a.call(n),hn(["invoices"]),t&&e.invalidateQueries([t])})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const D0=po(void 0),Dhr=po(void 0);/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/var y_=(n=>(n.Product="1",n.Task="2",n.UnpaidFee="3",n.PaidFee="4",n.LateFee="5",n.Expense="6",n))(y_||{});/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const A0=()=>({_id:xj(),quantity:0,cost:0,product_key:"",product_cost:0,notes:"",discount:0,is_amount_discount:!1,tax_name1:"",tax_rate1:0,tax_name2:"",tax_rate2:0,tax_name3:"",tax_rate3:0,sort_id:0,line_total:0,tax_amount:0,gross_line_total:0,date:"",custom_value1:"",custom_value2:"",custom_value3:"",custom_value4:"",type_id:y_.Product,tax_id:"1"});/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function DHe(){const n=ri(),{data:e}=tU(),[,t]=Mo(D0),i=(o,s,a)=>o.calculate_tax_by_amount?o.uses_inclusive_taxes?Math.round(s/o.amount*100*1e3/10)/100:Math.round(s/o.amount*1e3/10)/1:a;return{create:o=>{var s;if(e){const a={...e};a.date=o.date,a.client_id=o.client_id,a.uses_inclusive_taxes=o.uses_inclusive_taxes,a.project_id=o.project_id,a.vendor_id=o.vendor_id;const l={...A0(),type_id:y_.Product,cost:(o==null?void 0:o.foreign_amount)>0?o.foreign_amount:o.amount,quantity:1,product_key:((s=o==null?void 0:o.category)==null?void 0:s.name)??"",notes:o.public_notes,line_total:Number(((o==null?void 0:o.foreign_amount)>0?o.foreign_amount:o.amount*1).toPrecision(2)),expense_id:o.id,tax_name1:o.tax_name1,tax_rate1:i(o,o.tax_amount1,o.tax_rate1),tax_name2:o.tax_name2,tax_rate2:i(o,o.tax_amount2,o.tax_rate2),tax_name3:o.tax_name3,tax_rate3:i(o,o.tax_amount3,o.tax_rate3)};a.line_items=[l],t(a),n(dt("/invoices/create?table=products&action=invoice_expense",{}))}},calculatedTaxRate:i}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Kw(n){const{entity:e,editPageTabs:t}=n,i=ol(),o=Fa().id||"",s=i.pathname.startsWith(`/${e}s`),a=o&&i.pathname.includes(o),l=i.pathname.endsWith("/edit"),c=t==null?void 0:t.some(g=>i.pathname.endsWith(`/${g}`)),u=s&&a&&(c||l),d=s&&a&&!l&&!c;return{isEditPage:u,isShowPage:d,isEditOrShowPage:u||d}}const EXt=Ea.div`
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function xXt(n){const[e]=ue(),t=ri(),i=bf(),r=zo(),o=Zj(),s=Vn(),a=Kr(),{calculatedTaxRate:l}=DHe(),{expense:c}=n,u=Ri(D0),[d,h]=w.useState([]),[g,p]=w.useState(!1),[m,_]=w.useState(!1),v=b=>{u(()=>{var y;return b&&{...b,line_items:[...b.line_items,{...A0(),type_id:y_.Product,cost:c.amount,quantity:1,product_key:((y=c==null?void 0:c.category)==null?void 0:y.name)??"",notes:c.public_notes,line_total:Number((c.amount*1).toPrecision(2)),expense_id:c.id,tax_name1:c.tax_name1,tax_rate1:l(c,c.tax_amount1,c.tax_rate1),tax_name2:c.tax_name2,tax_rate2:l(c,c.tax_amount2,c.tax_rate2),tax_name3:c.tax_name3,tax_rate3:l(c,c.tax_amount3,c.tax_rate3)}]}}),t(dt("/invoices/:id/edit?action=invoice_expense",{id:b.id}))};return w.useEffect(()=>{m&&(p(!0),a.fetchQuery(["/api/v1/invoices",`include=client&status_id=1,2,3&is_deleted=true&filter_deleted_clients=true&client_id=${c.client_id}`],()=>Te("GET",ye("/api/v1/invoices?include=client.group_settings&status_id=1,2,3&is_deleted=true&filter_deleted_clients=true&client_id=:clientId",{clientId:c.client_id||""})),{staleTime:1/0}).then(b=>{r("edit_invoice")?h(b.data.data):h(b.data.data.filter(y=>o(y)))}).finally(()=>p(!1))),m||h([])},[m]),N(_t,{children:[N(cr,{title:e("action_add_to_invoice"),onClose:()=>_(!1),visible:m,children:[f("div",{className:"flex flex-col space-y-1",children:d.map(b=>{var y,C;return N(EXt,{theme:{hoverColor:s.$5},onClick:()=>v(b),className:"flex items-center justify-between cursor-pointer rounded py-1 px-2",children:[f("p",{children:b==null?void 0:b.number}),f("p",{children:i(b.amount,(y=b.client)==null?void 0:y.country_id,(C=b.client)==null?void 0:C.settings.currency_id)})]},b.id)})}),g&&f("div",{className:"flex justify-center",children:f(Vo,{})}),!g&&!d.length&&f("div",{className:"flex justify-center font-medium text-lg",children:e("no_invoices_found")})]}),f(et,{onClick:()=>_(!0),icon:f(Ve,{element:mk}),children:e("action_add_to_invoice")})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function kXt(n){const{setErrors:e,isFormBusy:t,setIsFormBusy:i}=n;return r=>{t||(ie.processing(),e==null||e(void 0),i==null||i(!0),Te("PUT",ye("/api/v1/expenses/:id",{id:r.id}),r).then(()=>{ie.success("updated_expense"),hn(["expenses"])}).catch(o=>{var s;((s=o.response)==null?void 0:s.status)===422&&(e==null||e(o.response.data),ie.dismiss())}).finally(()=>i==null?void 0:i(!1)))}}function TXt(n){var y,C,x;const[e]=ue(),t=Vn(),i=zo(),r=oj(),{visible:o,isFormBusy:s,setIsFormBusy:a,expense:l,setVisible:c}=n,[u,d]=w.useState(!1),{data:h}=YVe({status:["active"]}),g=kXt({isFormBusy:s,setIsFormBusy:a}),{red:p,green:m,blue:_,hex:v}=R3(((y=l.category)==null?void 0:y.color)||""),b=rj(p,m,_)?-220:220;return N("div",{onClick:k=>k.stopPropagation(),children:[f(A3,{placement:"bottom",interactive:!0,render:()=>N("div",{className:"border box rounded-md shadow-lg focus:outline-none",style:{backgroundColor:t.$1,borderColor:t.$4,minWidth:"15rem",maxWidth:"20rem"},onClick:k=>k.stopPropagation(),children:[i("create_expense")&&f(et,{className:"font-medium text-center py-3",onClick:()=>{d(!0),c(!1)},cypressRef:"newExpenseCategoryAction",children:e("new_expense_category")}),f("div",{className:"flex flex-col max-h-80 overflow-y-auto",children:h==null?void 0:h.map((k,I)=>k.id!==l.category_id&&f(et,{onClick:()=>{c(!1),g({...l,category_id:k.id})},children:k.name},I))})]}),visible:o,children:f("div",{className:"cursor-pointer","data-cy":"expenseCategoryBadge",children:f(aM,{for:{},code:((C=l.category)==null?void 0:C.name)||e("uncategorized"),style:{color:r(v,b),backgroundColor:((x=l.category)==null?void 0:x.color)||""},onClick:()=>!s&&c(k=>!k)})})}),f(fHe,{visible:u,setVisible:d,onCreatedCategory:k=>g({...l,category_id:k.id})})]})}function IXt(n){const e=w.useRef(null),{expense:t}=n,[i,r]=w.useState(!1),[o,s]=w.useState(!1);return Bw(e,()=>{i&&r(!1)}),f("div",{ref:e,children:f(TXt,{visible:i,isFormBusy:o,setIsFormBusy:s,expense:t,setVisible:r})})}function Bpe({apiEndpoint:n,entityId:e,cacheEndpoint:t,component:i,preCheck:r}){const o=ha(),s=Kr(),[a,l]=w.useState(r??!1);return w.useEffect(()=>{o&&e&&!a&&(async()=>{const c=await s.fetchQuery([t,e],()=>Te("GET",ye(n,{id:e})).then(u=>u.data.data),{staleTime:1/0});c&&(c.user_id===o.id||c.assigned_user_id===o.id)&&l(!0)})()},[]),a?f(_t,{children:i}):f(_t,{})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Gw(){const n=zo(),e=Zj();return(t,i)=>!n(`view_${t}`)&&!n(`edit_${t}`)&&!e(i)}function jh(n){const e=ys(),{renderSpan:t}=n;return t?f("span",{className:n.className,children:n.children}):f(E0,{className:`text-sm hover:underline ${n.className}`,style:{color:e},to:n.to,children:n.children})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Lk(){const[n]=ue(),e=vi(),{dateFormat:t}=Il(),i=e==null?void 0:e.custom_fields;return(r,o)=>{if(i&&i[r]){const s=i[r];if((s==null?void 0:s.split("|")[1])===D1.Date&&o)return Jr(o,t);if((s==null?void 0:s.split("|")[1])===D1.Switch)return n(o?"yes":"no")}return o}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function LXt(){return n=>{if(n.uses_inclusive_taxes)return n.amount;if(n.calculate_tax_by_amount)return n.amount+n.tax_amount1+n.tax_amount2+n.tax_amount3;let e=n.amount;return n.tax_name1&&(e+=n.amount*(n.tax_rate1/100)),n.tax_name2&&(e+=n.amount*(n.tax_rate2/100)),n.tax_name3&&(e+=n.amount*(n.tax_rate3/100)),e}}/*! @license DOMPurify 3.1.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.3/LICENSE */const{entries:AHe,setPrototypeOf:PTe,isFrozen:DXt,getPrototypeOf:AXt,getOwnPropertyDescriptor:RXt}=Object;let{freeze:uh,seal:jp,create:RHe}=Object,{apply:_re,construct:vre}=typeof Reflect<"u"&&Reflect;uh||(uh=function(e){return e});jp||(jp=function(e){return e});_re||(_re=function(e,t,i){return e.apply(t,i)});vre||(vre=function(e,t){return new e(...t)});const eB=df(Array.prototype.forEach),MTe=df(Array.prototype.pop),IR=df(Array.prototype.push),_8=df(String.prototype.toLowerCase),xX=df(String.prototype.toString),FTe=df(String.prototype.match),LR=df(String.prototype.replace),NXt=df(String.prototype.indexOf),OXt=df(String.prototype.trim),Tm=df(Object.prototype.hasOwnProperty),Hd=df(RegExp.prototype.test),DR=PXt(TypeError),BTe=df(Number.isNaN);function df(n){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return _re(n,e,i)}}function PXt(n){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return vre(n,t)}}function uo(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_8;PTe&&PTe(n,null);let i=e.length;for(;i--;){let r=e[i];if(typeof r=="string"){const o=t(r);o!==r&&(DXt(e)||(e[i]=o),r=o)}n[r]=!0}return n}function MXt(n){for(let e=0;e<n.length;e++)Tm(n,e)||(n[e]=null);return n}function jS(n){const e=RHe(null);for(const[t,i]of AHe(n))Tm(n,t)&&(Array.isArray(i)?e[t]=MXt(i):i&&typeof i=="object"&&i.constructor===Object?e[t]=jS(i):e[t]=i);return e}function tB(n,e){for(;n!==null;){const i=RXt(n,e);if(i){if(i.get)return df(i.get);if(typeof i.value=="function")return df(i.value)}n=AXt(n)}function t(){return null}return t}const $Te=uh(["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"]),kX=uh(["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"]),TX=uh(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),FXt=uh(["animate","color-profile","cursor","discard","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"]),IX=uh(["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","mprescripts"]),BXt=uh(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),VTe=uh(["#text"]),HTe=uh(["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","nonce","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","wrap","xmlns","slot"]),LX=uh(["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","transform-origin","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"]),WTe=uh(["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"]),nB=uh(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$Xt=jp(/\{\{[\w\W]*|[\w\W]*\}\}/gm),VXt=jp(/<%[\w\W]*|[\w\W]*%>/gm),HXt=jp(/\${[\w\W]*}/gm),WXt=jp(/^data-[\-\w.\u00B7-\uFFFF]/),zXt=jp(/^aria-[\-\w]+$/),NHe=jp(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jXt=jp(/^(?:\w+script|data):/i),UXt=jp(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),OHe=jp(/^html$/i),qXt=jp(/^[a-z][.\w]*(-[.\w]+)+$/i);var zTe=Object.freeze({__proto__:null,MUSTACHE_EXPR:$Xt,ERB_EXPR:VXt,TMPLIT_EXPR:HXt,DATA_ATTR:WXt,ARIA_ATTR:zXt,IS_ALLOWED_URI:NHe,IS_SCRIPT_OR_DATA:jXt,ATTR_WHITESPACE:UXt,DOCTYPE_NAME:OHe,CUSTOM_ELEMENT:qXt});const ES={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},KXt=function(){return typeof window>"u"?null:window},GXt=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(i=t.getAttribute(r));const o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function PHe(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:KXt();const e=Le=>PHe(Le);if(e.version="3.1.3",e.removed=[],!n||!n.document||n.document.nodeType!==ES.document)return e.isSupported=!1,e;let{document:t}=n;const i=t,r=i.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:g}=n,p=l.prototype,m=tB(p,"cloneNode"),_=tB(p,"nextSibling"),v=tB(p,"childNodes"),b=tB(p,"parentNode");if(typeof s=="function"){const Le=t.createElement("template");Le.content&&Le.content.ownerDocument&&(t=Le.content.ownerDocument)}let y,C="";const{implementation:x,createNodeIterator:k,createDocumentFragment:I,getElementsByTagName:L}=t,{importNode:D}=i;let R={};e.isSupported=typeof AHe=="function"&&typeof b=="function"&&x&&x.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:P,ERB_EXPR:M,TMPLIT_EXPR:O,DATA_ATTR:B,ARIA_ATTR:F,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:V,CUSTOM_ELEMENT:$}=zTe;let{IS_ALLOWED_URI:j}=zTe,Y=null;const ne=uo({},[...$Te,...kX,...TX,...IX,...VTe]);let se=null;const he=uo({},[...HTe,...LX,...WTe,...nB]);let xe=Object.seal(RHe(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_e=null,Ie=null,Re=!0,Ye=!0,Ze=!1,tt=!0,Be=!1,kt=!0,Vt=!1,xt=!1,Kt=!1,cn=!1,wn=!1,on=!1,Zt=!0,pe=!1;const me="user-content-";let Z=!0,G=!1,K={},oe=null;const le=uo({},["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"]);let we=null;const Me=uo({},["audio","video","img","source","image","track"]);let ft=null;const Nt=uo({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Yt="http://www.w3.org/1998/Math/MathML",He="http://www.w3.org/2000/svg",Dt="http://www.w3.org/1999/xhtml";let ae=Dt,Se=!1,Xe=null;const wt=uo({},[Yt,He,Dt],xX);let Tt=null;const zt=["application/xhtml+xml","text/html"],Mt="text/html";let On=null,Ni=null;const xn=255,un=t.createElement("form"),ei=function(fe){return fe instanceof RegExp||fe instanceof Function},li=function(){let fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ni&&Ni===fe)){if((!fe||typeof fe!="object")&&(fe={}),fe=jS(fe),Tt=zt.indexOf(fe.PARSER_MEDIA_TYPE)===-1?Mt:fe.PARSER_MEDIA_TYPE,On=Tt==="application/xhtml+xml"?xX:_8,Y=Tm(fe,"ALLOWED_TAGS")?uo({},fe.ALLOWED_TAGS,On):ne,se=Tm(fe,"ALLOWED_ATTR")?uo({},fe.ALLOWED_ATTR,On):he,Xe=Tm(fe,"ALLOWED_NAMESPACES")?uo({},fe.ALLOWED_NAMESPACES,xX):wt,ft=Tm(fe,"ADD_URI_SAFE_ATTR")?uo(jS(Nt),fe.ADD_URI_SAFE_ATTR,On):Nt,we=Tm(fe,"ADD_DATA_URI_TAGS")?uo(jS(Me),fe.ADD_DATA_URI_TAGS,On):Me,oe=Tm(fe,"FORBID_CONTENTS")?uo({},fe.FORBID_CONTENTS,On):le,_e=Tm(fe,"FORBID_TAGS")?uo({},fe.FORBID_TAGS,On):{},Ie=Tm(fe,"FORBID_ATTR")?uo({},fe.FORBID_ATTR,On):{},K=Tm(fe,"USE_PROFILES")?fe.USE_PROFILES:!1,Re=fe.ALLOW_ARIA_ATTR!==!1,Ye=fe.ALLOW_DATA_ATTR!==!1,Ze=fe.ALLOW_UNKNOWN_PROTOCOLS||!1,tt=fe.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Be=fe.SAFE_FOR_TEMPLATES||!1,kt=fe.SAFE_FOR_XML!==!1,Vt=fe.WHOLE_DOCUMENT||!1,cn=fe.RETURN_DOM||!1,wn=fe.RETURN_DOM_FRAGMENT||!1,on=fe.RETURN_TRUSTED_TYPE||!1,Kt=fe.FORCE_BODY||!1,Zt=fe.SANITIZE_DOM!==!1,pe=fe.SANITIZE_NAMED_PROPS||!1,Z=fe.KEEP_CONTENT!==!1,G=fe.IN_PLACE||!1,j=fe.ALLOWED_URI_REGEXP||NHe,ae=fe.NAMESPACE||Dt,xe=fe.CUSTOM_ELEMENT_HANDLING||{},fe.CUSTOM_ELEMENT_HANDLING&&ei(fe.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(xe.tagNameCheck=fe.CUSTOM_ELEMENT_HANDLING.tagNameCheck),fe.CUSTOM_ELEMENT_HANDLING&&ei(fe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(xe.attributeNameCheck=fe.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),fe.CUSTOM_ELEMENT_HANDLING&&typeof fe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(xe.allowCustomizedBuiltInElements=fe.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Be&&(Ye=!1),wn&&(cn=!0),K&&(Y=uo({},VTe),se=[],K.html===!0&&(uo(Y,$Te),uo(se,HTe)),K.svg===!0&&(uo(Y,kX),uo(se,LX),uo(se,nB)),K.svgFilters===!0&&(uo(Y,TX),uo(se,LX),uo(se,nB)),K.mathMl===!0&&(uo(Y,IX),uo(se,WTe),uo(se,nB))),fe.ADD_TAGS&&(Y===ne&&(Y=jS(Y)),uo(Y,fe.ADD_TAGS,On)),fe.ADD_ATTR&&(se===he&&(se=jS(se)),uo(se,fe.ADD_ATTR,On)),fe.ADD_URI_SAFE_ATTR&&uo(ft,fe.ADD_URI_SAFE_ATTR,On),fe.FORBID_CONTENTS&&(oe===le&&(oe=jS(oe)),uo(oe,fe.FORBID_CONTENTS,On)),Z&&(Y["#text"]=!0),Vt&&uo(Y,["html","head","body"]),Y.table&&(uo(Y,["tbody"]),delete _e.tbody),fe.TRUSTED_TYPES_POLICY){if(typeof fe.TRUSTED_TYPES_POLICY.createHTML!="function")throw DR('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof fe.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw DR('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=fe.TRUSTED_TYPES_POLICY,C=y.createHTML("")}else y===void 0&&(y=GXt(g,r)),y!==null&&typeof C=="string"&&(C=y.createHTML(""));uh&&uh(fe),Ni=fe}},xi=uo({},["mi","mo","mn","ms","mtext"]),br=uo({},["foreignobject","annotation-xml"]),Wr=uo({},["title","style","font","a","script"]),ko=uo({},[...kX,...TX,...FXt]),oo=uo({},[...IX,...BXt]),ea=function(fe){let Fe=b(fe);(!Fe||!Fe.tagName)&&(Fe={namespaceURI:ae,tagName:"template"});const ot=_8(fe.tagName),Ue=_8(Fe.tagName);return Xe[fe.namespaceURI]?fe.namespaceURI===He?Fe.namespaceURI===Dt?ot==="svg":Fe.namespaceURI===Yt?ot==="svg"&&(Ue==="annotation-xml"||xi[Ue]):!!ko[ot]:fe.namespaceURI===Yt?Fe.namespaceURI===Dt?ot==="math":Fe.namespaceURI===He?ot==="math"&&br[Ue]:!!oo[ot]:fe.namespaceURI===Dt?Fe.namespaceURI===He&&!br[Ue]||Fe.namespaceURI===Yt&&!xi[Ue]?!1:!oo[ot]&&(Wr[ot]||!ko[ot]):!!(Tt==="application/xhtml+xml"&&Xe[fe.namespaceURI]):!1},xr=function(fe){IR(e.removed,{element:fe});try{fe.parentNode.removeChild(fe)}catch{fe.remove()}},Hi=function(fe,Fe){try{IR(e.removed,{attribute:Fe.getAttributeNode(fe),from:Fe})}catch{IR(e.removed,{attribute:null,from:Fe})}if(Fe.removeAttribute(fe),fe==="is"&&!se[fe])if(cn||wn)try{xr(Fe)}catch{}else try{Fe.setAttribute(fe,"")}catch{}},Ht=function(fe){let Fe=null,ot=null;if(Kt)fe="<remove></remove>"+fe;else{const gn=FTe(fe,/^[\r\n\t ]+/);ot=gn&&gn[0]}Tt==="application/xhtml+xml"&&ae===Dt&&(fe='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+fe+"</body></html>");const Ue=y?y.createHTML(fe):fe;if(ae===Dt)try{Fe=new h().parseFromString(Ue,Tt)}catch{}if(!Fe||!Fe.documentElement){Fe=x.createDocument(ae,"template",null);try{Fe.documentElement.innerHTML=Se?C:Ue}catch{}}const Qt=Fe.body||Fe.documentElement;return fe&&ot&&Qt.insertBefore(t.createTextNode(ot),Qt.childNodes[0]||null),ae===Dt?L.call(Fe,Vt?"html":"body")[0]:Vt?Fe.documentElement:Qt},Qn=function(fe){return k.call(fe.ownerDocument||fe,fe,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Fr=function(fe){return fe instanceof d&&(typeof fe.__depth<"u"&&typeof fe.__depth!="number"||typeof fe.__removalCount<"u"&&typeof fe.__removalCount!="number"||typeof fe.nodeName!="string"||typeof fe.textContent!="string"||typeof fe.removeChild!="function"||!(fe.attributes instanceof u)||typeof fe.removeAttribute!="function"||typeof fe.setAttribute!="function"||typeof fe.namespaceURI!="string"||typeof fe.insertBefore!="function"||typeof fe.hasChildNodes!="function")},Oe=function(fe){return typeof a=="function"&&fe instanceof a},lt=function(fe,Fe,ot){R[fe]&&eB(R[fe],Ue=>{Ue.call(e,Fe,ot,Ni)})},It=function(fe){let Fe=null;if(lt("beforeSanitizeElements",fe,null),Fr(fe))return xr(fe),!0;const ot=On(fe.nodeName);if(lt("uponSanitizeElement",fe,{tagName:ot,allowedTags:Y}),fe.hasChildNodes()&&!Oe(fe.firstElementChild)&&Hd(/<[/\w]/g,fe.innerHTML)&&Hd(/<[/\w]/g,fe.textContent)||fe.nodeType===ES.progressingInstruction||kt&&fe.nodeType===ES.comment&&Hd(/<[/\w]/g,fe.data))return xr(fe),!0;if(!Y[ot]||_e[ot]){if(!_e[ot]&&Je(ot)&&(xe.tagNameCheck instanceof RegExp&&Hd(xe.tagNameCheck,ot)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(ot)))return!1;if(Z&&!oe[ot]){const Ue=b(fe)||fe.parentNode,Qt=v(fe)||fe.childNodes;if(Qt&&Ue){const gn=Qt.length;for(let Pn=gn-1;Pn>=0;--Pn){const Zn=m(Qt[Pn],!0);Zn.__removalCount=(fe.__removalCount||0)+1,Ue.insertBefore(Zn,_(fe))}}}return xr(fe),!0}return fe instanceof l&&!ea(fe)||(ot==="noscript"||ot==="noembed"||ot==="noframes")&&Hd(/<\/no(script|embed|frames)/i,fe.innerHTML)?(xr(fe),!0):(Be&&fe.nodeType===ES.text&&(Fe=fe.textContent,eB([P,M,O],Ue=>{Fe=LR(Fe,Ue," ")}),fe.textContent!==Fe&&(IR(e.removed,{element:fe.cloneNode()}),fe.textContent=Fe)),lt("afterSanitizeElements",fe,null),!1)},tn=function(fe,Fe,ot){if(Zt&&(Fe==="id"||Fe==="name")&&(ot in t||ot in un||ot==="__depth"||ot==="__removalCount"))return!1;if(!(Ye&&!Ie[Fe]&&Hd(B,Fe))){if(!(Re&&Hd(F,Fe))){if(!se[Fe]||Ie[Fe]){if(!(Je(fe)&&(xe.tagNameCheck instanceof RegExp&&Hd(xe.tagNameCheck,fe)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(fe))&&(xe.attributeNameCheck instanceof RegExp&&Hd(xe.attributeNameCheck,Fe)||xe.attributeNameCheck instanceof Function&&xe.attributeNameCheck(Fe))||Fe==="is"&&xe.allowCustomizedBuiltInElements&&(xe.tagNameCheck instanceof RegExp&&Hd(xe.tagNameCheck,ot)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(ot))))return!1}else if(!ft[Fe]){if(!Hd(j,LR(ot,V,""))){if(!((Fe==="src"||Fe==="xlink:href"||Fe==="href")&&fe!=="script"&&NXt(ot,"data:")===0&&we[fe])){if(!(Ze&&!Hd(H,LR(ot,V,"")))){if(ot)return!1}}}}}}return!0},Je=function(fe){return fe!=="annotation-xml"&&FTe(fe,$)},ve=function(fe){lt("beforeSanitizeAttributes",fe,null);const{attributes:Fe}=fe;if(!Fe)return;const ot={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:se};let Ue=Fe.length;for(;Ue--;){const Qt=Fe[Ue],{name:gn,namespaceURI:Pn,value:Zn}=Qt,wi=On(gn);let Sn=gn==="value"?Zn:OXt(Zn);if(ot.attrName=wi,ot.attrValue=Sn,ot.keepAttr=!0,ot.forceKeepAttr=void 0,lt("uponSanitizeAttribute",fe,ot),Sn=ot.attrValue,ot.forceKeepAttr||(Hi(gn,fe),!ot.keepAttr))continue;if(!tt&&Hd(/\/>/i,Sn)){Hi(gn,fe);continue}if(kt&&Hd(/((--!?|])>)|<\/(style|title)/i,Sn)){Hi(gn,fe);continue}Be&&eB([P,M,O],ti=>{Sn=LR(Sn,ti," ")});const Xt=On(fe.nodeName);if(tn(Xt,wi,Sn)){if(pe&&(wi==="id"||wi==="name")&&(Hi(gn,fe),Sn=me+Sn),y&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Pn)switch(g.getAttributeType(Xt,wi)){case"TrustedHTML":{Sn=y.createHTML(Sn);break}case"TrustedScriptURL":{Sn=y.createScriptURL(Sn);break}}try{Pn?fe.setAttributeNS(Pn,gn,Sn):fe.setAttribute(gn,Sn),Fr(fe)?xr(fe):MTe(e.removed)}catch{}}}lt("afterSanitizeAttributes",fe,null)},je=function Le(fe){let Fe=null;const ot=Qn(fe);for(lt("beforeSanitizeShadowDOM",fe,null);Fe=ot.nextNode();){if(lt("uponSanitizeShadowNode",Fe,null),It(Fe))continue;const Ue=b(Fe);Fe.nodeType===ES.element&&(Ue&&Ue.__depth?Fe.__depth=(Fe.__removalCount||0)+Ue.__depth+1:Fe.__depth=1),(Fe.__depth>=xn||Fe.__depth<0||BTe(Fe.__depth))&&xr(Fe),Fe.content instanceof o&&(Fe.content.__depth=Fe.__depth,Le(Fe.content)),ve(Fe)}lt("afterSanitizeShadowDOM",fe,null)};return e.sanitize=function(Le){let fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Fe=null,ot=null,Ue=null,Qt=null;if(Se=!Le,Se&&(Le="<!-->"),typeof Le!="string"&&!Oe(Le))if(typeof Le.toString=="function"){if(Le=Le.toString(),typeof Le!="string")throw DR("dirty is not a string, aborting")}else throw DR("toString is not a function");if(!e.isSupported)return Le;if(xt||li(fe),e.removed=[],typeof Le=="string"&&(G=!1),G){if(Le.nodeName){const Zn=On(Le.nodeName);if(!Y[Zn]||_e[Zn])throw DR("root node is forbidden and cannot be sanitized in-place")}}else if(Le instanceof a)Fe=Ht("<!---->"),ot=Fe.ownerDocument.importNode(Le,!0),ot.nodeType===ES.element&&ot.nodeName==="BODY"||ot.nodeName==="HTML"?Fe=ot:Fe.appendChild(ot);else{if(!cn&&!Be&&!Vt&&Le.indexOf("<")===-1)return y&&on?y.createHTML(Le):Le;if(Fe=Ht(Le),!Fe)return cn?null:on?C:""}Fe&&Kt&&xr(Fe.firstChild);const gn=Qn(G?Le:Fe);for(;Ue=gn.nextNode();){if(It(Ue))continue;const Zn=b(Ue);Ue.nodeType===ES.element&&(Zn&&Zn.__depth?Ue.__depth=(Ue.__removalCount||0)+Zn.__depth+1:Ue.__depth=1),(Ue.__depth>=xn||Ue.__depth<0||BTe(Ue.__depth))&&xr(Ue),Ue.content instanceof o&&(Ue.content.__depth=Ue.__depth,je(Ue.content)),ve(Ue)}if(G)return Le;if(cn){if(wn)for(Qt=I.call(Fe.ownerDocument);Fe.firstChild;)Qt.appendChild(Fe.firstChild);else Qt=Fe;return(se.shadowroot||se.shadowrootmode)&&(Qt=D.call(i,Qt,!0)),Qt}let Pn=Vt?Fe.outerHTML:Fe.innerHTML;return Vt&&Y["!doctype"]&&Fe.ownerDocument&&Fe.ownerDocument.doctype&&Fe.ownerDocument.doctype.name&&Hd(OHe,Fe.ownerDocument.doctype.name)&&(Pn="<!DOCTYPE "+Fe.ownerDocument.doctype.name+`>
`+Pn),Be&&eB([P,M,O],Zn=>{Pn=LR(Pn,Zn," ")}),y&&on?y.createHTML(Pn):Pn},e.setConfig=function(){let Le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};li(Le),xt=!0},e.clearConfig=function(){Ni=null,xt=!1},e.isValidAttribute=function(Le,fe,Fe){Ni||li({});const ot=On(Le),Ue=On(fe);return tn(ot,Ue,Fe)},e.addHook=function(Le,fe){typeof fe=="function"&&(R[Le]=R[Le]||[],IR(R[Le],fe))},e.removeHook=function(Le){if(R[Le])return MTe(R[Le])},e.removeHooks=function(Le){R[Le]&&(R[Le]=[])},e.removeAllHooks=function(){R={}},e}var YXt=PHe();/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function ib(n){return new DOMParser().parseFromString(n,"text/html").documentElement.textContent||""}function pc(n){return YXt.sanitize(n,{USE_PROFILES:{html:!0}})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function fA(){const n=qw(),e=vi();return t=>{const i=n(e==null?void 0:e.settings.currency_id);return i?Ope.formatValue(isNaN(Number(t))?0:t,i):t}}function Ahr(){const[n]=ue(),e=zo(),t=ri(),i=wXt(),r=Ri(yXt),o=Ri(bXt),{isEditPage:s}=Kw({entity:"expense",editPageTabs:["documents"]}),{create:a}=DHe(),l=d=>{r({...d,id:"",documents:[],number:""}),t("/expenses/create?action=clone")},c=d=>{o({...d,id:"",documents:[],number:""}),t("/recurring_expenses/create?action=clone")};return[d=>d.should_be_invoiced===!0&&d.invoice_id.length===0&&e("create_invoice")&&f(et,{onClick:()=>a(d),icon:f(Ve,{element:mk}),children:n("invoice_expense")}),d=>d.should_be_invoiced===!0&&d.invoice_id.length===0&&f(xXt,{expense:d}),d=>e("create_expense")&&f(et,{onClick:()=>l(d),icon:f(Ve,{element:tb}),children:n("clone")}),d=>e("create_recurring_expense")&&f(et,{onClick:()=>c(d),icon:f(Ve,{element:tb}),children:n("clone_to_recurring")}),()=>s&&f(Jn,{withoutPadding:!0}),d=>nr(d)===Di.Active&&s&&f(et,{onClick:()=>i([d.id],"archive"),icon:f(Ve,{element:Xl}),children:n("archive")}),d=>(nr(d)===Di.Archived||nr(d)===Di.Deleted)&&s&&f(et,{onClick:()=>i([d.id],"restore"),icon:f(Ve,{element:Ql}),children:n("restore")}),d=>(nr(d)===Di.Active||nr(d)===Di.Archived)&&s&&f(et,{onClick:()=>i([d.id],"delete"),icon:f(Ve,{element:Pa}),children:n("delete")})]}const QXt=["status","number","client","vendor","date","amount","public_notes"];function XXt(){const[n,e,t,i]=yf({entity:"expense"});return["status","number","vendor","client","date","amount","public_notes","entity_state","archived_at","category","created_at",n,e,t,i,"documents","exchange_rate","is_deleted","net_amount","payment_date","payment_type","private_notes","should_be_invoiced","tax_name1","tax_name2","tax_name3","tax_rate1","tax_rate2","tax_rate3","transaction_reference","updated_at"]}function Rhr(){var _;const{t:n}=ue(),{dateFormat:e}=Il(),t=fA(),i=zo(),r=Gw(),o=ri(),s=bf(),a=sl(),l=Lk(),c=LXt();XXt();const[u,d,h,g]=yf({entity:"expense"}),p=[{column:"category",id:"category_id",label:n("category"),format:(v,b)=>b&&f(IXt,{expense:b})},{column:"status",id:"id",label:n("status"),format:(v,b)=>N("div",{className:"flex items-center space-x-2",children:[f(jh,{to:dt("/expenses/:id/edit",{id:b.id}),renderSpan:r("expense",b),children:f("span",{className:"inline-flex items-center space-x-4",children:f(CXt,{entity:b})})}),b.invoice_id&&f(Bpe,{entityId:b.invoice_id,cacheEndpoint:"/api/v1/invoices",apiEndpoint:"/api/v1/invoices/:id?include=client.group_settings",preCheck:i("view_invoice")||i("edit_invoice"),component:f(Ve,{element:mk,size:19,onClick:()=>o(dt("/invoices/:id/edit",{id:b.invoice_id}))})})]})},{column:"number",id:"number",label:n("number"),format:(v,b)=>f(jh,{to:dt("/expenses/:id/edit",{id:b.id}),renderSpan:r("expense",b),children:v})},{column:"vendor",id:"vendor_id",label:n("vendor"),format:(v,b)=>b.vendor&&f(jh,{to:dt("/vendors/:id",{id:v.toString()}),renderSpan:r("vendor",b.vendor),children:b.vendor.name})},{column:"client",id:"client_id",label:n("client"),format:(v,b)=>b.client&&f(jh,{to:dt("/clients/:id",{id:v.toString()}),renderSpan:r("client",b.client),children:b.client.display_name})},{column:"date",id:"date",label:n("date"),format:v=>Jr(v,e)},{column:"amount",id:"amount",label:n("amount"),format:(v,b)=>{var y,C;return s(c(b),(y=b.client)==null?void 0:y.country_id,b.currency_id||((C=b.client)==null?void 0:C.settings.currency_id))}},{column:"public_notes",id:"public_notes",label:n("public_notes"),format:v=>f(du,{width:"auto",tooltipElement:f("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:f("article",{className:St("prose prose-sm",{"prose-invert":a.dark_mode}),dangerouslySetInnerHTML:{__html:pc(v)}})}),children:f("span",{children:ib(pc(v)).slice(0,50)})})},{column:"entity_state",id:"id",label:n("entity_state"),format:(v,b)=>f(zp,{entity:b})},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:v=>Jr(v,e)},{column:"created_at",id:"created_at",label:n("created_at"),format:v=>Jr(v,e)},{column:u,id:"custom_value1",label:u,format:v=>l("expense1",v==null?void 0:v.toString())},{column:d,id:"custom_value2",label:d,format:v=>l("expense2",v==null?void 0:v.toString())},{column:h,id:"custom_value3",label:h,format:v=>l("expense3",v==null?void 0:v.toString())},{column:g,id:"custom_value4",label:g,format:v=>l("expense4",v==null?void 0:v.toString())},{column:"documents",id:"documents",label:n("documents"),format:(v,b)=>b.documents.length},{column:"exchange_rate",id:"exchange_rate",label:n("exchange_rate"),format:v=>t(v)},{column:"is_deleted",id:"is_deleted",label:n("is_deleted"),format:(v,b)=>b.is_deleted?n("yes"):n("no")},{column:"net_amount",id:"amount",label:n("net_amount"),format:(v,b)=>{var y,C;return s(v,(y=b.client)==null?void 0:y.country_id,b.currency_id||((C=b.client)==null?void 0:C.settings.currency_id))}},{column:"payment_date",id:"payment_date",label:n("payment_date"),format:v=>Jr(v,e)},{column:"payment_type",id:"payment_type_id",label:n("payment_type"),format:v=>f(aM,{for:vXt,code:v,headless:!0})},{column:"private_notes",id:"private_notes",label:n("private_notes"),format:v=>f(du,{width:"auto",tooltipElement:f("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:f("article",{className:St("prose prose-sm",{"prose-invert":a.dark_mode}),dangerouslySetInnerHTML:{__html:pc(v)}})}),children:f("span",{children:ib(pc(v)).slice(0,50)})})},{column:"should_be_invoiced",id:"should_be_invoiced",label:n("should_be_invoiced"),format:(v,b)=>b.should_be_invoiced?n("yes"):n("no")},{column:"tax_name1",id:"tax_name1",label:n("tax_name1")},{column:"tax_name2",id:"tax_name2",label:n("tax_name2")},{column:"tax_name3",id:"tax_name3",label:n("tax_name3")},{column:"tax_rate1",id:"tax_rate1",label:n("tax_rate1"),format:v=>t(v)},{column:"tax_rate2",id:"tax_rate2",label:n("tax_rate2"),format:v=>t(v)},{column:"tax_rate3",id:"tax_rate3",label:n("tax_rate3"),format:v=>t(v)},{column:"transaction_reference",id:"transaction_reference",label:n("transaction_reference")},{column:"updated_at",id:"updated_at",label:n("updated_at"),format:v=>Jr(v,e)}],m=((_=a==null?void 0:a.react_table_columns)==null?void 0:_.expense)||QXt;return p.filter(v=>m.includes(v.column)).sort((v,b)=>m.indexOf(v.column)-m.indexOf(b.column))}function Nhr(n){const{setExpense:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(o=>o&&{...o,[i]:r})}}function ZXt(){const[n]=ue(),e=Ng();return[{label:n("logged"),value:"logged",color:"white",backgroundColor:"#6B7280"},{label:n("pending"),value:"pending",color:"white",backgroundColor:"#93C5FD"},{label:n("invoiced"),value:"invoiced",color:"white",backgroundColor:e.$3||"#1D4ED8"},{label:n("paid"),value:"paid",color:"white",backgroundColor:e.$1||"#22C55E"},{label:n("unpaid"),value:"unpaid",color:"white",backgroundColor:e.$4||"#e6b05c"},{label:n("uncategorized"),value:"uncategorized",color:"white",backgroundColor:"#b5812c"}]}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/var q1=(n=>(n.Viewed="-1",n.Draft="1",n.Sent="2",n.Accepted="3",n.Received="4",n.Cancelled="5",n))(q1||{});/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function JXt(n){return e=>{if(e.invitations.length!==0){if(e.invitations.length>0&&n.resourceType==="purchase_order")return ye("/vendor/purchase_order/:invitation/download",{resource:n.resourceType,invitation:e.invitations[0].key});if(e.invitations.length>0)return ye("/client/:resource/:invitation/download_pdf",{resource:n.resourceType,invitation:e.invitations[0].key})}}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function MHe(n){const e=Kr(),t=JXt({resourceType:n.resource});return i=>{const r=t(i);r&&(ie.processing(),e.fetchQuery(r,()=>Te("GET",r,{},{responseType:"arraybuffer"}).then(o=>{const s=new Blob([o.data],{type:"application/pdf"}),a=URL.createObjectURL(s),[,l]=o.headers["content-disposition"].split("filename="),c=document.createElement("a");c.download=l,c.href=a,c.target="_blank",document.body.appendChild(c),c.click(),document.body.removeChild(c),ie.dismiss()})))}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const nU=po(void 0);/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function eZt(n){return n.invitations.length>0?`${n.invitations[0].link}?silent=true`:null}function FHe(n){var t;const e=eZt(n);e&&((t=window.open(e,"_blank"))==null||t.focus())}function tZt(n){const[e]=ue(),{status_id:t,archived_at:i,is_deleted:r,invitations:o}=n.entity,s=Ng(),a=()=>o.some(g=>g.viewed_date),l=t===q1.Draft,c=!l,u=a(),d=t===q1.Cancelled,h=t===q1.Accepted;return r?f(Gi,{variant:"red",children:e("deleted")}):i?f(Gi,{variant:"orange",children:e("archived")}):d?f(Gi,{variant:"black",style:{backgroundColor:s.$5},children:e("cancelled")}):t===q1.Received?f(Gi,{variant:"green",style:{backgroundColor:s.$3},children:e("received")}):h?f(Gi,{variant:"dark-blue",style:{backgroundColor:s.$2},children:e("accepted")}):c?f(Gi,{variant:"light-blue",style:{backgroundColor:s.$1},children:e("sent")}):l?f(Gi,{variant:"generic",children:e("draft")}):u&&!d&&!h?f(Gi,{variant:"yellow",style:{backgroundColor:s.$4},children:e("viewed")}):f(_t,{})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function BHe(){const{isAdmin:n,isOwner:e}=ao();return ai(["/api/v1/task_schedulers","create"],()=>Te("GET",ye("/api/v1/task_schedulers/create")).then(t=>t.data.data),{staleTime:1/0,enabled:n||e})}function nZt(n){const{isAdmin:e,isOwner:t}=ao();return ai(["/api/v1/task_schedulers",n.id],()=>Te("GET",ye("/api/v1/task_schedulers/:id",{id:n.id})).then(i=>i.data.data),{staleTime:1/0,enabled:e||t})}function iZt(){return(n,e)=>{ie.processing(),Te("POST",ye("/api/v1/task_schedulers/bulk"),{action:e,ids:n}).then(()=>{ie.success(`${e}d_schedule`),hn(["task_schedulers"])})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const lM={clients:[],date_range:"last7_days",show_aging_table:!1,show_credits_table:!1,show_payments_table:!1,only_clients_with_invoices:!1,status:"all",entity:"invoice",entity_id:"",report_name:"activity",start_date:"",end_date:"",product_key:"",send_email:!0,is_expense_billed:!1,is_income_billed:!1,include_tax:!1,document_email_attachment:!1,client_id:"",vendors:"",projects:"",categories:"",report_keys:[]};function $He(n){const{data:e}=BHe();return(t,i)=>{const{setErrors:r,setSchedule:o}=n;r(void 0);const s=Bn.cloneDeep(n.schedule);t==="template"&&e?o(()=>({...e,template:i,frequency_id:gd.Monthly,remaining_cycles:-1,parameters:{...lM}})):t==="parameters.report_name"&&e?o(a=>a&&{...a,parameters:{...lM,report_name:i}}):(t==="parameters.entity"&&o(Bn.set(s,"parameters.entity_id","")),o(Bn.set(s,t,i)))}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function VHe({entity:n}){const e=ri(),t=Ri(eU);return i=>{t({...lM,entity:n,entity_id:i}),e("/settings/schedules/create?template=email_record")}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const HHe=({entity:n})=>{const e=Kr(),t=i=>new Promise(r=>{const o=()=>{i.removeEventListener("load",o),r()};document.body.appendChild(i),i.addEventListener("load",o)});return i=>{i.length&&(ie.processing(),e.fetchQuery([`/api/v1/${n}s/bulk`],()=>Te("POST",ye(`/api/v1/${n}s/bulk`),{action:"bulk_print",ids:i},{responseType:"arraybuffer"}).then(async r=>{const o=new Blob([r.data],{type:"application/pdf"}),s=URL.createObjectURL(o),a=document.createElement("iframe");a.style.display="none",a.src=s,await t(a),a&&a.contentWindow&&(a.contentWindow.focus(),a.contentWindow.print()),ie.dismiss()})))}};/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const rZt={item:"product_key",service:"product_key",description:"notes",unit_cost:"cost",rate:"cost",hours:"quantity"};/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function WHe(n,e="."){const[t,i]=n.split(e);return{resource:t,property:i}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function zHe(n){const{property:e}=WHe(n);return rZt[e]||e}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function $pe(){const n=Kr();return{find:t=>n.fetchQuery({queryKey:["/api/v1/clients",t],queryFn:()=>Te("GET",ye("/api/v1/clients/:id?include=group_settings",{id:t})).then(i=>i.data.data),staleTime:1/0})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function oZt(n){const e=vi(),t=qw(),i=$pe(),r=n.resource;return async(o,s,a)=>{const l={...r.line_items[o]};if(l.product_key=(a==null?void 0:a.product_key)||s,!a)return n.onChange(o,l);const c=(a==null?void 0:a.cost)>0&&n.relationType==="vendor_id"?a==null?void 0:a.cost:(a==null?void 0:a.price)||0;return e.fill_products&&(e!=null&&e.enable_product_quantity?l.quantity=e!=null&&e.default_quantity?1:(a==null?void 0:a.quantity)??1:l.quantity=1,r.client_id?await i.find(r.client_id).then(u=>{const d=u.settings.currency_id;if(e.convert_products&&d!==e.settings.currency_id){const h=t(d),g=t(e.settings.currency_id);h&&g&&(l.cost=c*(h.exchange_rate/g.exchange_rate))}else l.cost=c}):l.cost=c),a||(l.notes=""),n.type=="product"&&(a!=null&&a.notes)&&e.fill_products&&(l.notes=a==null?void 0:a.notes),n.type=="task"&&(a!=null&&a.notes)&&!l.notes&&(l.notes=a.notes),l.tax_name1=(a==null?void 0:a.tax_name1)||"",l.tax_name2=(a==null?void 0:a.tax_name2)||"",l.tax_name3=(a==null?void 0:a.tax_name3)||"",l.tax_rate1=(a==null?void 0:a.tax_rate1)||0,l.tax_rate2=(a==null?void 0:a.tax_rate2)||0,l.tax_rate3=(a==null?void 0:a.tax_rate3)||0,l.custom_value1=(a==null?void 0:a.custom_value1)||"",l.custom_value2=(a==null?void 0:a.custom_value2)||"",l.custom_value3=(a==null?void 0:a.custom_value3)||"",l.custom_value4=(a==null?void 0:a.custom_value4)||"",l.tax_id=(a==null?void 0:a.tax_id)||"1",l.product_cost=a==null?void 0:a.cost,n.onChange(o,l)}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function jHe(){const n=Kr();return{find:t=>n.fetchQuery(["/api/v1/vendors",t],()=>Te("GET",ye("/api/v1/vendors/:id",{id:t})).then(i=>i.data.data),{staleTime:1/0})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function UHe(){const n=Nd();return{find:t=>{var i;return n?Promise.resolve((i=n.data)==null?void 0:i.currencies.find(r=>r.id===t)):Promise.resolve(void 0)}}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function sZt(){const n=Nd();return{find:t=>{var i;return n?Promise.resolve((i=n.data)==null?void 0:i.countries.find(r=>r.id===t)):Promise.resolve(void 0)}}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function aZt(n){const e=vi(),t=UHe(),i=sZt(),r=jHe(),o=$pe(),[s,a]=w.useState(""),[l,c]=w.useState(""),{resource:u,relationType:d}=n,[h,g]=w.useState(),[p,m]=w.useState(),[_,v]=w.useState();return w.useEffect(()=>{s&&d==="client_id"&&o.find(s).then(b=>v(b)),l&&d==="vendor_id"&&r.find(l).then(b=>v(b))},[s,l]),w.useEffect(()=>{u!=null&&u.vendor_id&&c(u.vendor_id),u!=null&&u.client_id&&a(u.client_id)},[u==null?void 0:u.client_id,u==null?void 0:u.vendor_id]),w.useEffect(()=>{if(d==="client_id"){const b=_;t.find((b==null?void 0:b.settings.currency_id)||(e==null?void 0:e.settings.currency_id)).then(y=>m(y)),i.find((b==null?void 0:b.country_id)||(e==null?void 0:e.settings.country_id)).then(y=>g(y))}if(d==="vendor_id"){const b=_;t.find((b==null?void 0:b.currency_id)||(e==null?void 0:e.settings.currency_id)).then(y=>m(y)),i.find((b==null?void 0:b.country_id)||(e==null?void 0:e.settings.country_id)).then(y=>g(y))}},[_]),b=>p&&h?Ope.formatMoney(isNaN(Number(b))?0:b,p,h):b}/*!
* currency.js - v2.0.4
* http://scurker.github.io/currency.js
*
* Copyright (c) 2021 Jason Wilson
* Released under MIT license
*/var lZt={symbol:"$",separator:",",decimal:".",errorOnInvalid:!1,precision:2,pattern:"!#",negativePattern:"-!#",format:hZt,fromCents:!1},qHe=function(e){return Math.round(e)},Vpe=function(e){return Math.pow(10,e)},cZt=function(e,t){return qHe(e/t)*t},uZt=/(\d)(?=(\d{3})+\b)/g,dZt=/(\d)(?=(\d\d)+\d\b)/g;function hp(n,e){var t=this;if(!(t instanceof hp))return new hp(n,e);var i=Object.assign({},lZt,e),r=Vpe(i.precision),o=v8(n,i);t.intValue=o,t.value=o/r,i.increment=i.increment||1/r,i.useVedic?i.groups=dZt:i.groups=uZt,this.s=i,this.p=r}function v8(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=0,r=e.decimal,o=e.errorOnInvalid,s=e.precision,a=e.fromCents,l=Vpe(s),c=typeof n=="number",u=n instanceof hp;if(u&&a)return n.intValue;if(c||u)i=u?n.value:n;else if(typeof n=="string"){var d=new RegExp("[^-\\d"+r+"]","g"),h=new RegExp("\\"+r,"g");i=n.replace(/\((.*)\)/,"-$1").replace(d,"").replace(h,"."),i=i||0}else{if(o)throw Error("Invalid Input");i=0}return a||(i*=l,i=i.toFixed(4)),t?qHe(i):i}function hZt(n,e){var t=e.pattern,i=e.negativePattern,r=e.symbol,o=e.separator,s=e.decimal,a=e.groups,l=(""+n).replace(/^-/,"").split("."),c=l[0],u=l[1];return(n.value>=0?t:i).replace("!",r).replace("#",c.replace(a,"$1"+o)+(u?s+u:""))}hp.prototype={add:function(e){var t=this.intValue,i=this.s,r=this.p;return hp((t+=v8(e,i))/(i.fromCents?1:r),i)},subtract:function(e){var t=this.intValue,i=this.s,r=this.p;return hp((t-=v8(e,i))/(i.fromCents?1:r),i)},multiply:function(e){var t=this.intValue,i=this.s;return hp((t*=e)/(i.fromCents?1:Vpe(i.precision)),i)},divide:function(e){var t=this.intValue,i=this.s;return hp(t/=v8(e,i,!1),i)},distribute:function(e){for(var t=this.intValue,i=this.p,r=this.s,o=[],s=Math[t>=0?"floor":"ceil"](t/e),a=Math.abs(t-s*e),l=r.fromCents?1:i;e!==0;e--){var c=hp(s/l,r);a-- >0&&(c=c[t>=0?"add":"subtract"](1/l)),o.push(c)}return o},dollars:function(){return~~this.value},cents:function(){var e=this.intValue,t=this.p;return~~(e%t)},format:function(e){var t=this.s;return typeof e=="function"?e(this,t):t.format(this,Object.assign({},t,e))},toString:function(){var e=this.intValue,t=this.p,i=this.s;return cZt(e/t,i.increment).toFixed(i.precision)},toJSON:function(){return this.value}};function fZt(n){var r,o,s;const[e,t]=w.useState(0);w.useEffect(()=>{typeof n.initialValue<"u"&&t(parseFloat(n.initialValue))},[]),w.useEffect(()=>{typeof n.initialValue<"u"&&t(parseFloat(n.initialValue))},[n.initialValue]);const i=Vn();return N("section",{children:[n.currency&&f(SFe.DebounceInput,{debounceTimeout:1200,id:n.id,type:"text",className:St(`w-full py-2 px-3 rounded text-sm disabled:bg-gray-100 disabled:cursor-not-allowed ${n.className}`,{"border border-gray-300":n.border!==!1}),onChange:a=>{var l,c;n.onChange&&n.onChange(String(hp(a.target.value,{separator:(l=n.currency)==null?void 0:l.thousandSeparator,decimal:(c=n.currency)==null?void 0:c.decimalSeparator,symbol:"",precision:n.precision}).value))},value:hp(e,{separator:(r=n.currency)==null?void 0:r.thousandSeparator,decimal:(o=n.currency)==null?void 0:o.decimalSeparator,symbol:"",precision:n.precision===6?((s=e.toString().split(".")[1])==null?void 0:s.length)||2:n.precision}).format(),onBlur:a=>{var l,c;return n.onBlurValue?n.onBlurValue(String(hp(a.target.value,{separator:(l=n.currency)==null?void 0:l.thousandSeparator,decimal:(c=n.currency)==null?void 0:c.decimalSeparator,symbol:"",precision:n.precision}).value)):null},style:{backgroundColor:i.$1,borderColor:i.$5,color:i.$3,colorScheme:i.$0}}),n.errorMessage&&f(bs,{className:"mt-2",type:"danger",children:n.errorMessage})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function gZt(n){const e=vi(),t=$pe(),i=jHe(),r=UHe(),o=dA();return(s,a)=>{var l;s.length>=1&&a==="client_id"?t.find(s).then(c=>{var u;return r.find(c.settings.currency_id||((u=e.settings)==null?void 0:u.currency_id)).then(d=>{const h=o(e.settings.country_id);d&&n({thousandSeparator:(h==null?void 0:h.thousand_separator)||d.thousand_separator,decimalSeparator:(h==null?void 0:h.decimal_separator)||d.decimal_separator,precision:d.precision})})}):s.length>=1&&a==="vendor_id"?i.find(s).then(c=>{var u;return r.find(c.currency_id||((u=e.settings)==null?void 0:u.currency_id)).then(d=>{const h=o(e.settings.country_id);d&&n({thousandSeparator:(h==null?void 0:h.thousand_separator)||d.thousand_separator,decimalSeparator:(h==null?void 0:h.decimal_separator)||d.decimal_separator,precision:d.precision})})}):r.find((l=e.settings)==null?void 0:l.currency_id).then(c=>{const u=o(e.settings.country_id);c&&n({thousandSeparator:(u==null?void 0:u.thousand_separator)||c.thousand_separator,decimalSeparator:(u==null?void 0:u.decimal_separator)||c.decimal_separator,precision:c.precision})})}}function pZt(n){var o,s;const[e,t]=w.useState(),[i]=ue(),r=Xp({initialValues:{name:"",rate:""},onSubmit:a=>{t(void 0),Te("POST",ye("/api/v1/tax_rates"),a).then(l=>{ie.success("created_tax_rate"),n.onClose(!1),hn(["tax_rates"]),n.onTaxCreated&&n.onTaxCreated(l.data.data)}).catch(l=>{var c;((c=l.response)==null?void 0:c.status)===422&&(t(l.response.data),ie.dismiss())}).finally(()=>r.setSubmitting(!1))}});return N(cr,{title:i("create_tax_rate"),visible:n.isVisible,onClose:n.onClose,children:[f(ke,{type:"text",id:"name",label:i("name"),errorMessage:(o=e==null?void 0:e.errors)==null?void 0:o.name,onChange:r.handleChange,required:!0}),f(ke,{type:"text",id:"rate",label:i("tax_rate"),errorMessage:(s=e==null?void 0:e.errors)==null?void 0:s.rate,onChange:r.handleChange,required:!0}),f(Ut,{behavior:"button",type:"primary",onClick:()=>{r.submitForm()},children:i("save")})]})}function SC(n){const[e]=ue(),[t,i]=w.useState(!1),{isAdmin:r,isOwner:o}=ao(),{resourceTaxName:s,resourceTaxRate:a}=n;return N(_t,{children:[f(Qd,{inputOptions:{value:n.defaultValue??null},endpoint:ye("/api/v1/tax_rates?status=active"),onChange:l=>n.onChange&&n.onChange(l),action:{label:e("create_tax_rate"),onClick:()=>i(!0),visible:r||o},entryOptions:{id:"id",value:"name",label:"name",inputLabelFn:l=>l?s===l.name?`${l.name} ${a}%`:`${l.name} ${l.rate}%`:"",dropdownLabelFn:l=>s===l.name?`${l.name} ${a}%`:`${l.name} ${l.rate}%`},sortBy:"name|asc",onDismiss:n.onClearButtonClick}),f(pZt,{isVisible:t,onClose:i,onTaxCreated:n.onTaxCreated})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const mZt=po(void 0);/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const _Zt=()=>{const n=ri(),{data:e}=tU(),t=Ri(D0);return i=>{if(e){const r=i.map(o=>({...A0(),type_id:y_.Product,cost:o.price,quantity:o.quantity,line_total:Number((o.price*o.quantity).toFixed(2)),product_key:o.product_key,notes:o.notes,tax_name1:o.tax_name1,tax_rate1:o.tax_rate1,tax_name2:o.tax_name2,tax_rate2:o.tax_rate2,tax_name3:o.tax_name3,tax_rate3:o.tax_rate3,tax_id:""}));t({...e,line_items:r}),n("/invoices/create?action=invoice_product")}}};/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function vZt(n){const e=zo();return ai(["/api/v1/purchase_orders","create"],()=>Te("GET",ye("/api/v1/purchase_orders/create")).then(t=>t.data.data),{...n,staleTime:1/0,enabled:e("create_purchase_order")?(n==null?void 0:n.enabled)??!0:!1})}function Ohr(n){return ai(["/api/v1/purchase_orders",n.id],()=>Te("GET",ye("/api/v1/purchase_orders/:id",{id:n.id})).then(e=>e.data.data),{staleTime:1/0})}const bZt={expense:"converted_to_expense",email:"emailed_purchase_orders",mark_sent:"marked_purchase_orders_as_sent",add_to_inventory:"added_purchase_orders_to_inventory"};function yZt(){const n=Kr(),e=ki(Hc);return(t,i)=>{ie.processing(),Te("POST",ye("/api/v1/purchase_orders/bulk"),{action:i,ids:t}).then(()=>{const r=bZt[i]||`${i}d_purchase_order`;ie.success(r),hn(["purchase_orders"]),e&&n.invalidateQueries([e])})}}function CZt(){const n=Kr(),e=ki(Hc);return t=>{ie.processing(),Te("PUT",ye("/api/v1/purchase_orders/:id?mark_sent=true",{id:t.id}),t).then(()=>{ie.success("marked_purchase_order_as_sent"),hn(["purchase_orders"]),e&&n.invalidateQueries([e])})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const wZt=()=>{const n=ri(),{data:e}=vZt(),t=Ri(nU);return i=>{if(e){const r=i.map(o=>({...A0(),type_id:y_.Product,cost:o.price,quantity:o.quantity,line_total:Number((o.price*o.quantity).toFixed(2)),product_key:o.id,notes:o.notes,tax_name1:o.tax_name1,tax_rate1:o.tax_rate1,tax_name2:o.tax_name2,tax_rate2:o.tax_rate2,tax_name3:o.tax_name3,tax_rate3:o.tax_rate3,tax_id:""}));t({...e,line_items:r}),n("/purchase_orders/create?action=purchase_order_product")}}},SZt=["product_key","description","price","quantity"];function EZt(){const[n,e,t,i]=yf({entity:"product"});return["product_key","description","price","quantity","archived_at","created_at",n,e,t,i,"documents","entity_state","is_deleted","notification_threshold","stock_quantity","tax_name1","tax_name2","tax_name3","tax_rate1","tax_rate2","tax_rate3","updated_at"]}function Phr(){var g;const{t:n}=ue();EZt();const{dateFormat:e}=Il(),t=bf(),i=fA(),r=sl(),o=Gw(),s=Lk(),[a,l,c,u]=yf({entity:"product"}),d=[{column:"product_key",id:"product_key",label:n("product"),format:(p,m)=>N("span",{className:"inline-flex items-center space-x-4",children:[f(zp,{entity:m}),f(jh,{to:dt("/products/:id/edit",{id:m.id}),renderSpan:o("product",m),children:p})]})},{column:"description",id:"notes",label:n("notes"),format:p=>f(du,{width:"auto",tooltipElement:f("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:f("article",{className:St("prose prose-sm",{"prose-invert":r.dark_mode}),dangerouslySetInnerHTML:{__html:pc(p)}})}),children:f("span",{children:ib(pc(p)).slice(0,50)})})},{column:"price",id:"price",label:n("price"),format:(p,m)=>{var _,v;return t(p,(_=m.company)==null?void 0:_.settings.country_id,(v=m.company)==null?void 0:v.settings.currency_id)}},{column:"quantity",id:"quantity",label:n("default_quantity"),format:p=>i(p)},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:p=>Jr(p,e)},{column:"created_at",id:"created_at",label:n("created_at"),format:p=>Jr(p,e)},{column:a,id:"custom_value1",label:a,format:p=>s("product1",p==null?void 0:p.toString())},{column:l,id:"custom_value2",label:l,format:p=>s("product2",p==null?void 0:p.toString())},{column:c,id:"custom_value3",label:c,format:p=>s("product3",p==null?void 0:p.toString())},{column:u,id:"custom_value4",label:u,format:p=>s("product4",p==null?void 0:p.toString())},{column:"documents",id:"documents",label:n("documents"),format:(p,m)=>m.documents.length},{column:"entity_state",id:"id",label:n("entity_state"),format:(p,m)=>f(zp,{entity:m})},{column:"is_deleted",id:"is_deleted",label:n("is_deleted"),format:(p,m)=>m.is_deleted?n("yes"):n("no")},{column:"notification_threshold",id:"stock_notification_threshold",label:n("notification_threshold")},{column:"stock_quantity",id:"in_stock_quantity",label:n("stock_quantity")},{column:"tax_name1",id:"tax_name1",label:n("tax_name1")},{column:"tax_name2",id:"tax_name2",label:n("tax_name2")},{column:"tax_name3",id:"tax_name3",label:n("tax_name3")},{column:"tax_rate1",id:"tax_rate1",label:n("tax_rate1"),format:p=>i(p)},{column:"tax_rate2",id:"tax_rate2",label:n("tax_rate2"),format:p=>i(p)},{column:"tax_rate3",id:"tax_rate3",label:n("tax_rate3"),format:p=>i(p)},{column:"updated_at",id:"updated_at",label:n("updated_at"),format:p=>Jr(p,e)}],h=((g=r==null?void 0:r.react_table_columns)==null?void 0:g.product)||SZt;return d.filter(p=>h.includes(p.column)).sort((p,m)=>h.indexOf(p.column)-h.indexOf(m.column))}function Mhr(){const[n]=ue(),e=ri(),t=zo(),i=Ri(mZt),r=_Zt(),o=wZt(),{isEditPage:s}=Kw({entity:"product",editPageTabs:["documents","product_fields"]}),a=u=>{i({...u,id:"",documents:[]}),e("/products/create?action=clone")},l=(u,d)=>{ie.processing(),IQt([d],u).then(()=>{ie.success(`${u}d_product`),hn(["products"])})};return[u=>!u.is_deleted&&t("create_invoice")&&f(et,{onClick:()=>r([u]),icon:f(Ve,{element:eg}),children:n("new_invoice")}),u=>!u.is_deleted&&t("create_purchase_order")&&f(et,{onClick:()=>o([u]),icon:f(Ve,{element:eg}),children:n("new_purchase_order")}),u=>!u.is_deleted&&t("create_product")&&f(et,{onClick:()=>a(u),icon:f(Ve,{element:tb}),children:n("clone")}),()=>s&&f(Jn,{withoutPadding:!0}),u=>nr(u)===Di.Active&&s&&f(et,{onClick:()=>l("archive",u.id),icon:f(Ve,{element:Xl}),children:n("archive")}),u=>(nr(u)===Di.Archived||nr(u)===Di.Deleted)&&s&&f(et,{onClick:()=>l("restore",u.id),icon:f(Ve,{element:Ql}),children:n("restore")}),u=>(nr(u)===Di.Active||nr(u)===Di.Archived)&&s&&f(et,{onClick:()=>l("delete",u.id),icon:f(Ve,{element:Pa}),children:n("delete")})]}function xZt(n){const{setErrors:e,setProduct:t}=n;return(i,r)=>{e(void 0),t(o=>o&&{...o,[i]:r})}}function KHe(){const[n]=ue();return[{id:"1",value:"1",label:n("physical_goods"),resource:null,eventType:"external",searchable:n("physical_goods")},{id:"2",value:"2",label:n("services"),resource:null,eventType:"external",searchable:n("services")},{id:"3",value:"3",label:n("digital_products"),resource:null,eventType:"external",searchable:n("digital_products")},{id:"4",value:"4",label:n("shipping"),resource:null,eventType:"external",searchable:n("shipping")},{id:"5",value:"5",label:n("tax_exempt"),resource:null,eventType:"external",searchable:n("tax_exempt")},{id:"6",value:"6",label:n("reduced_tax"),resource:null,eventType:"external",searchable:n("reduced_tax")},{id:"7",value:"7",label:n("override_tax"),resource:null,eventType:"external",searchable:n("override_tax")},{id:"8",value:"8",label:n("zero_rated"),resource:null,eventType:"external",searchable:n("zero_rated")},{id:"9",value:"9",label:n("reverse_tax"),resource:null,eventType:"external",searchable:n("reverse_tax")}]}function GHe({value:n,label:e,onChange:t}){const i=KHe();return f(dHe,{inputOptions:{value:n,label:e},entries:i,entryOptions:{id:"id",value:"id",label:"label"},onChange:t,onEmptyValues:()=>null})}function kZt(n){var l,c,u,d;const[e]=ue(),[,t]=i3(),i=vi(),{errors:r,handleChange:o,type:s,product:a}=n;return N(_t,{children:[s==="edit"&&f(U,{leftSide:e("status"),children:f(zp,{entity:a})}),f(U,{leftSide:e("item"),required:!0,children:f(ke,{required:!0,value:a.product_key,onValueChange:h=>o("product_key",h),errorMessage:r==null?void 0:r.errors.product_key})}),f(U,{leftSide:e("description"),children:f(ke,{element:"textarea",value:a.notes,onValueChange:h=>o("notes",h),errorMessage:r==null?void 0:r.errors.notes})}),f(U,{leftSide:e("price"),children:f(ke,{type:"number",value:a.price,onValueChange:h=>o("price",h),errorMessage:r==null?void 0:r.errors.price})}),(i==null?void 0:i.enable_product_cost)&&f(U,{leftSide:e("cost"),children:f(ke,{value:a.cost,onValueChange:h=>o("cost",h),errorMessage:r==null?void 0:r.errors.cost})}),(i==null?void 0:i.enable_product_quantity)&&f(U,{leftSide:e("default_quantity"),children:f(ke,{type:"number",value:a.quantity,onValueChange:h=>o("quantity",h),errorMessage:r==null?void 0:r.errors.quantity})}),f(U,{leftSide:e("max_quantity"),children:f(ke,{type:"number",value:a.max_quantity,onValueChange:h=>o("max_quantity",h),errorMessage:r==null?void 0:r.errors.max_quantity})}),N(U,{leftSide:e("tax_category"),children:[f(GHe,{value:a.tax_id,onChange:h=>o("tax_id",h.value)}),r!=null&&r.errors.tax_id?f(bs,{className:"mt-2",type:"danger",children:r.errors.tax_id}):null]}),f(U,{leftSide:e("image_url"),children:f(ke,{value:a.product_image,onValueChange:h=>o("product_image",h),errorMessage:r==null?void 0:r.errors.product_image})}),(i==null?void 0:i.track_inventory)&&N(_t,{children:[f(U,{leftSide:e("stock_quantity"),children:f(ke,{type:"number",value:a.in_stock_quantity,onValueChange:h=>{o("in_stock_quantity",Number(h)),s==="edit"&&t(g=>({...g,update_in_stock_quantity:"true"}))},errorMessage:r==null?void 0:r.errors.in_stock_quantity})}),f(U,{leftSide:e("stock_notifications"),children:f(gt,{checked:a.stock_notification,onValueChange:h=>o("stock_notification",h)})}),f(U,{leftSide:e("notification_threshold"),children:f(ke,{type:"number",value:a.stock_notification_threshold,onValueChange:h=>o("stock_notification_threshold",h),errorMessage:r==null?void 0:r.errors.stock_notification_threshold})})]}),i&&i.enabled_item_tax_rates>0&&f(U,{leftSide:e("tax"),children:f(SC,{onChange:h=>{var g,p;o("tax_rate1",(g=h.resource)==null?void 0:g.rate),o("tax_name1",(p=h.resource)==null?void 0:p.name)},defaultValue:a.tax_name1,onClearButtonClick:()=>{o("tax_rate1",0),o("tax_name1","")},onTaxCreated:h=>{o("tax_rate1",h.rate),o("tax_name1",h.name)}})}),i&&i.enabled_item_tax_rates>1&&f(U,{leftSide:e("tax"),children:f(SC,{onChange:h=>{var g,p;o("tax_rate2",(g=h.resource)==null?void 0:g.rate),o("tax_name2",(p=h.resource)==null?void 0:p.name)},defaultValue:a.tax_name2,onClearButtonClick:()=>{o("tax_rate2",0),o("tax_name2","")},onTaxCreated:h=>{o("tax_rate2",h.rate),o("tax_name2",h.name)}})}),i&&i.enabled_item_tax_rates>2&&f(U,{leftSide:e("tax"),children:f(SC,{onChange:h=>{var g,p;o("tax_rate3",(g=h.resource)==null?void 0:g.rate),o("tax_name3",(p=h.resource)==null?void 0:p.name)},defaultValue:a.tax_name3,onClearButtonClick:()=>{o("tax_rate3",0),o("tax_name3","")},onTaxCreated:h=>{o("tax_rate3",h.rate),o("tax_name3",h.name)}})}),((l=i==null?void 0:i.custom_fields)==null?void 0:l.product1)&&f(Do,{field:"custom_value1",defaultValue:a.custom_value1,value:i.custom_fields.product1,onValueChange:h=>o("custom_value1",h)}),((c=i==null?void 0:i.custom_fields)==null?void 0:c.product2)&&f(Do,{field:"custom_value2",defaultValue:a.custom_value2,value:i.custom_fields.product2,onValueChange:h=>o("custom_value2",h)}),((u=i==null?void 0:i.custom_fields)==null?void 0:u.product3)&&f(Do,{field:"custom_value3",defaultValue:a.custom_value3,value:i.custom_fields.product3,onValueChange:h=>o("custom_value3",h)}),((d=i==null?void 0:i.custom_fields)==null?void 0:d.product4)&&f(Do,{field:"custom_value4",defaultValue:a.custom_value4,value:i.custom_fields.product4,onValueChange:h=>o("custom_value4",h)})]})}function TZt(n){const[e]=ue(),{data:t}=TQt(),[i,r]=w.useState(),[o,s]=w.useState(!1),[a,l]=w.useState(),c=xZt({setErrors:r,setProduct:l}),u=()=>{o||(s(!0),Te("POST",ye("/api/v1/products"),a).then(d=>{ie.success("created_product"),hn(["products"]),setTimeout(()=>{var h;(h=n.onProductCreated)==null||h.call(n,d.data.data)},200),n.setIsModalOpen(!1)}).catch(d=>{var h;((h=d.response)==null?void 0:h.status)===422&&(r(d.response.data),ie.dismiss())}).finally(()=>s(!1)))};return w.useEffect(()=>{t&&l(t)},[t]),N(cr,{title:e("new_product"),visible:n.isModalOpen,onClose:n.setIsModalOpen,backgroundColor:"gray",size:"small",children:[a&&f(kZt,{product:a,errors:i,handleChange:c}),f(Ut,{type:"primary",behavior:"button",onClick:u,children:e("save")})]})}function IZt(n){const[e]=ue(),[t,i]=w.useState(!1),r=vi(),o=zo();return N(_t,{children:[f(TZt,{setIsModalOpen:i,isModalOpen:t,onProductCreated:n.onProductCreated}),f(Qd,{endpoint:ye("/api/v1/products?per_page=800"),inputOptions:{value:n.defaultValue??null},entryOptions:{id:"id",label:"product_key",value:"id",searchable:"notes",dropdownLabelFn:s=>N("div",{children:[N("div",{className:"flex space-x-1",children:[f("p",{className:"font-semibold",children:s.product_key}),(r==null?void 0:r.track_inventory)&&n.displayStockQuantity&&N("p",{className:St({"text-red-700":s.in_stock_quantity<=0}),children:["(",Ds("stock_quantity_number",{quantity:s.in_stock_quantity}),")"]})]}),f("p",{className:"text-sm truncate",children:s.notes.length>35?s.notes.substring(0,35).concat("..."):s.notes})]})},onChange:s=>n.onChange&&n.onChange(s),action:{label:e("new_product"),onClick:()=>i(!0),visible:o("create_product")},onDismiss:n.onClearButtonClick,sortBy:"product_key|asc",nullable:!0},"product_selector"),n.errorMessage&&f(bs,{type:"danger",className:"mt-2",children:n.errorMessage})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function LZt(n){const e=n.resource,t=Ri(Yw);return(i,r,o)=>{t(!1);const s={...e.line_items[r]};return s[i]=(o==null?void 0:o.rate)??0,s[i.replace("rate","name")]=(o==null?void 0:o.name)||"",n.onChange(r,s)}}const DZt=["discount","cost","unit_cost","quantity","rate","hours"],AZt=["tax_rate1","tax_rate2","tax_rate3"],RZt={decimalSeparator:".",precision:2,thousandSeparator:","},b8=n=>!Object.keys(n).some(t=>t!=="_id"&&t!=="type_id"&&t!=="is_amount_discount"&&n[t]);function NZt(n){const e=ol(),[t,i]=w.useState(),[r,o]=Mo(Yw),s=y=>y.filter((x,k)=>k!==y.length-1).some(x=>b8(x));w.useCallback(y=>{let C=y_.Product;n.type==="task"&&(C=y_.Task);const x=y.filter(({type_id:L})=>L===C),k=x.length,I=x[k-1];if(k>0&&(!s(x)&&!b8(I)&&n.createItem(),s(x)&&b8(I))){const L=y.indexOf(x[k-1]);L>-1&&n.deleteLineItem(L)}},[n.resource.line_items]);const a=oZt({relationType:n.relationType,resource:n.resource,type:n.type,onChange:n.onLineItemChange}),l=LZt({resource:n.resource,type:n.type,onChange:n.onLineItemChange}),c=async(y,C,x)=>{o(!1),await n.onLineItemPropertyChange(y,C,x)},u=vi(),d=sl(),h=n.resource,g=async(y,C,x)=>{o(!1);const k=Bn.cloneDeep(x);x&&u&&u.enabled_item_tax_rates===0&&(k.tax_name1="",k.tax_rate1=0,k.tax_name2="",k.tax_rate2=0,k.tax_name3="",k.tax_rate3=0),x&&u&&u.enabled_item_tax_rates===1&&(k.tax_name2="",k.tax_rate2=0,k.tax_name3="",k.tax_rate3=0),x&&u&&u.enabled_item_tax_rates===2&&(k.tax_name3="",k.tax_rate3=0),await a(y,C,k)},p=aZt({resource:n.resource,relationType:n.relationType}),m=gZt(i);w.useEffect(()=>{h[n.relationType]?m(h[n.relationType],n.relationType):i(RZt)},[h==null?void 0:h[n.relationType]]),w.useEffect(()=>{},[h==null?void 0:h.line_items,r]);const _=KHe(),{preferences:v}=Ww(),b=(y,C)=>{if(u.calculate_taxes){const x=h==null?void 0:h.line_items[C];return x.tax_id==="7"||x.tax_id===""?N(ZP,{children:[f(SC,{onChange:I=>I.resource&&l(y,C,I.resource),onTaxCreated:I=>l(y,C,I),defaultValue:h==null?void 0:h.line_items[C][y.replace("rate","name")],onClearButtonClick:()=>l(y,C)},`${y}${h==null?void 0:h.line_items[C][y]}`),y==="tax_rate1"?f("button",{type:"button",onClick:()=>c("tax_id","1",C),children:f(fWt,{})}):null]}):Wa(_).pluck("value").filter(I=>I!=="7").toArray().includes(x.tax_id)&&y==="tax_rate1"?f(ZP,{children:f(GHe,{value:x.tax_id,onChange:I=>c("tax_id",I.value,C)})}):null}return f(SC,{onChange:x=>x.resource&&l(y,C,x.resource),onTaxCreated:x=>l(y,C,x),defaultValue:h==null?void 0:h.line_items[C][y.replace("rate","name")],onClearButtonClick:()=>l(y,C)},`${y}${h==null?void 0:h.line_items[C][y]}`)};return(y,C)=>{var k,I,L,D;const x=zHe(y);if(x==="product_key")return f(IZt,{onChange:R=>g(C,R.label,R.resource),className:"w-auto",defaultValue:h==null?void 0:h.line_items[C][x],onProductCreated:R=>R&&g(C,R.product_key,R),clearButton:!0,onClearButtonClick:()=>a(C,"",null),displayStockQuantity:e.pathname.startsWith("/invoices")},`${x}${h==null?void 0:h.line_items[C][x]}`);if(x==="notes")return f(ke,{id:x,element:"textarea",value:h==null?void 0:h.line_items[C][x],onChange:R=>c(x,R.target.value,C),style:{marginTop:"4px"},textareaRows:v.auto_expand_product_table_notes?1:3},`${x}${C}`);if(DZt.includes(x))return t&&f(fZt,{precision:x==="quantity"?6:d!=null&&d.number_precision&&(d==null?void 0:d.number_precision)>0&&(d==null?void 0:d.number_precision)<=100?d.number_precision:(t==null?void 0:t.precision)||2,id:x,currency:t,initialValue:h==null?void 0:h.line_items[C][x],className:"auto",onBlurValue:R=>{c(x,isNaN(parseFloat(R))?0:parseFloat(R),C)}});if(x==="gross_line_total"||x==="tax_amount")return p((h==null?void 0:h.line_items[C][x])??0);if(AZt.includes(x))return b(x,C);if(["line_total"].includes(x))return p(h==null?void 0:h.line_items[C][x]);if(["product1","product2","product3","product4"].includes(x)){const R=x.replace("product","custom_value");return(k=u.custom_fields)!=null&&k[x]?f(Do,{field:x,defaultValue:h==null?void 0:h.line_items[C][R],value:(I=u.custom_fields)==null?void 0:I[x],onValueChange:P=>c(R,P,C),fieldOnly:!0}):f(ke,{id:x,value:h==null?void 0:h.line_items[C][x],onChange:P=>c(x,P.target.value,C)})}if(["task1","task2","task3","task4"].includes(x)){const R=x.replace("task","custom_value");return(L=u.custom_fields)!=null&&L[x]?f(Do,{field:x,defaultValue:h==null?void 0:h.line_items[C][R],value:(D=u.custom_fields)==null?void 0:D[x],onValueChange:P=>c(R,P,C),fieldOnly:!0}):f(ke,{id:x,value:h==null?void 0:h.line_items[C][x],onChange:P=>c(x,P.target.value,C)})}return f(ke,{id:x,value:h==null?void 0:h.line_items[C][x],onChange:R=>c(x,R.target.value,C)})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function OZt(n){const[e]=ue(),t=vi(),{type:i}=n||{},r=i==="product"||!i?["product1","product2","product3","product4"]:["task1","task2","task3","task4"],o={"$product.tax_rate1":e("tax_rate1"),"$product.tax_rate2":e("tax_rate2"),"$product.tax_rate3":e("tax_rate3")};return(s,a=".")=>{var c;if(Object.prototype.hasOwnProperty.call(o,s))return o[s];const{property:l}=WHe(s,a);if(r.includes(l)){const u=(c=t.custom_fields)==null?void 0:c[l];if(u)return u.split("|")[0]}return e(l||s)}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function PZt(n){const e=n.resource;return t=>{var r,o;if(t.source.index===((r=t.destination)==null?void 0:r.index))return;const i=e?Tpe(e.line_items,t.source.index,(o=t.destination)==null?void 0:o.index):[];return n.onSort(i)}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function MZt(n){const e=zHe(n);return{product_key:"15%",notes:"30%",cost:"10%",quantity:"10%",line_total:"5%",discount:"10%",tax_rate1:"12%"}[e]||""}const Yw=po(void 0);function Fhr(n){const[e]=ue(),t=Vn(),i=Wfe(),{resource:r,items:o,columns:s,relationType:a}=n,l=Ri(Yw),c=OZt({type:n.type}),u=NZt({type:n.type,resource:n.resource,onLineItemChange:n.onLineItemChange,onLineItemPropertyChange:n.onLineItemPropertyChange,relationType:a,createItem:n.onCreateItemClick,deleteLineItem:n.onDeleteRowClick}),d=PZt({resource:n.resource,onSort:n.onSort}),h=()=>o.some(p=>b8(p)),g=p=>r.line_items.indexOf(p);return N(zw,{children:[f(Uw,{backgroundColor:i.$5,children:s.map((p,m)=>f(la,{textColor:i.$6,children:c(p)},m))}),f(Gj,{onDragEnd:d,children:f(Qj,{droppableId:"product-table",children:p=>N(jw,{...p.droppableProps,innerRef:p.innerRef,children:[o.map((m,_)=>f(Yj,{draggableId:g(m).toString(),index:g(m),children:v=>f(zl,{innerRef:v.innerRef,tabIndex:_+1,...v.draggableProps,children:s.map((b,y,{length:C})=>N(eo,{width:MZt(b),children:[C-1!==y&&N("div",{className:St({"flex justify-between items-center space-x-3":y===0}),children:[y===0?f("button",{...v.dragHandleProps,children:f(Wpt,{size:18})}):null,u(b,g(m))]}),C-1===y&&N("div",{className:"flex justify-between items-center",children:[u(b,g(m)),r&&f("button",{style:{color:t.$3},className:"ml-2 text-gray-600 hover:text-red-600",onClick:()=>{l(!0),n.onDeleteRowClick(g(m))},children:f(T_t,{size:18})})]})]},y))},g(m))},g(m))),p.placeholder,f(zl,{className:"bg-slate-100 hover:bg-slate-200",children:f(eo,{colSpan:100,children:N("button",{onClick:()=>!h()&&n.onCreateItemClick(),className:"w-full py-2 inline-flex justify-center items-center space-x-2",children:[f(g_t,{size:18}),f("span",{children:n.type==="product"?e("add_item"):e("add_line")})]})})})]})})})]})}function _p(n){const{onClick:e,icon:t,label:i}=n;return N(Ut,{behavior:"button",type:"secondary",className:"w-3/4",onClick:e,children:[f(Ve,{element:t,style:{width:"1.1rem",height:"1.1rem"}}),f("span",{children:i})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const Hpe=po(void 0),Bhr=po(void 0);/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const iU=po(void 0),FZt=po(void 0);/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const rU=po(void 0),BZt=po(void 0);function $Zt(n){const[e]=ue(),t=ri(),{purchaseOrder:i}=n,r=zo(),o=Ri(iU),s=Ri(Hpe),a=Ri(D0),l=Ri(rU),c=Ti(),[u,d]=w.useState(!1),h=()=>{a({...i,id:"",number:"",documents:[],due_date:"",partial_due_date:"",date:Cn().format("YYYY-MM-DD"),total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",client_id:"",paid_to_date:0,po_number:i.number,design_id:c.settings.invoice_design_id}),t("/invoices/create?action=clone")},g=()=>{o({...i,id:"",number:"",documents:[],date:Cn().format("YYYY-MM-DD"),due_date:"",partial_due_date:"",total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",client_id:"",paid_to_date:0,po_number:i.number,design_id:c.settings.quote_design_id}),t("/quotes/create?action=clone")},p=()=>{l({...i,id:"",number:"",documents:[],frequency_id:"5",paid_to_date:0,total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",client_id:"",due_date:"",partial_due_date:"",po_number:i.number,design_id:c.settings.invoice_design_id}),t("/recurring_invoices/create?action=clone")},m=()=>{s({...i,id:"",number:"",documents:[],date:Cn().format("YYYY-MM-DD"),due_date:"",partial_due_date:"",total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",client_id:"",paid_to_date:0,po_number:i.number,design_id:c.settings.credit_design_id}),t("/credits/create?action=clone")};return N(_t,{children:[(r("create_invoice")||r("create_quote")||r("create_recurring_invoice")||r("create_credit"))&&f(et,{onClick:()=>d(!0),icon:f(Ve,{element:tb}),children:e("clone_to_other")}),f(cr,{title:e("clone_to"),visible:u,onClose:()=>d(!1),closeButtonCypressRef:"cloneOptionsModalXButton",children:f("div",{className:"flex justify-center",children:N("div",{className:"flex flex-1 flex-col items-center space-y-3",children:[r("create_invoice")&&f(_p,{label:e("invoice"),icon:QC,onClick:h}),r("create_quote")&&f(_p,{label:e("quote"),icon:fhe,onClick:g}),r("create_recurring_invoice")&&f(_p,{label:e("recurring_invoice"),icon:i7,onClick:p}),r("create_credit")&&f(_p,{label:e("credit"),icon:QC,onClick:m})]})})})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Wpe(){const n=Ci();return async()=>Te("POST",ye("/api/v1/refresh")).then(e=>{n(yb(e.data.data))})}po(!1);const VZt=po(null),HZt=po(!1),WZt=po([]),zZt=po(null);function $hr({entity:n,entities:e,visible:t,bulkUrl:i,setVisible:r,labelFn:o}){const[s]=ue(),[a,l]=w.useState(null),[c,u]=w.useState(!1),[d,h]=Mo(VZt),g=Kr(),p=w.useRef(null),m=()=>{const v=Wa(e).pluck("id").toArray();h(null),ie.processing(),Te("POST",ye(i),{ids:v,entity:n,template_id:a,send_email:c,action:"template"}).then(b=>{const y=b.data.message;if(rue.emit("bulk.completed"),c){r(!1),ie.success();return}p.current&&(p.current.disabled=!0),g.fetchQuery({queryKey:["reports",y],queryFn:()=>Te("POST",ye(`/api/v1/templates/preview/${y}`),{},{responseType:"arraybuffer"}).then(C=>C.data),retry:10,retryDelay:5e3}).then(C=>{const x=new Blob([C],{type:"application/pdf"}),k=URL.createObjectURL(x);h(k),ie.success(),rue.emit("bulk.completed")}).finally(()=>{p.current&&(p.current.disabled=!1)})})},_=v=>{const b=document.createElement("a");b.download="template.pdf",b.href=v,b.target="_blank",document.body.appendChild(b),b.click(),document.body.removeChild(b)};return N(cr,{title:s("load_template"),visible:t,onClose:r,size:"small",children:[f(U,{leftSide:s("design"),noExternalPadding:!0,children:f(Qd,{endpoint:ye(`/api/v1/designs?template=true&entities=${n}`),inputOptions:{value:a??"",label:""},entryOptions:{id:"id",label:"name",value:"id"},onChange:v=>v.resource?l(v.resource.id):null})}),N("p",{className:"capitalize",children:[s("entities"),":"]}),f("ul",{children:e.map((v,b)=>f("li",{children:o(v)},b))}),f(gt,{label:s("send_email"),checked:c,onChange:u}),f(Ut,{innerRef:p,behavior:"button",onClick:m,disabled:!a,disableWithoutIcon:!0,children:s("run_template")}),d?f(Ut,{type:"secondary",behavior:"button",onClick:()=>_(d),children:s("download_pdf")}):null]})}function gA(){const[n,e]=Mo(HZt),[t,i]=Mo(WZt),[r,o]=Mo(zZt);return{changeTemplateVisible:n,changeTemplateResources:t,changeTemplateEntityContext:r,setChangeTemplateVisible:e,setChangeTemplateResources:i,setChangeTemplateEntityContext:o}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function jZt(n){return e=>{if(e.invitations.length!==0&&e.invitations.length>0)return ye("/api/v1/:resource/:invitation/:downloadType",{resource:n.resourceType,invitation:e.invitations[0].key,downloadType:n.downloadType||"download_e_invoice"})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function YHe(n){const e=Kr(),t=jZt({resourceType:n.resource,downloadType:n.downloadType});return i=>{const r=t(i);r&&(ie.processing(),e.fetchQuery(r,()=>Te("GET",r,{},{responseType:"arraybuffer"}).then(o=>{const s=new Blob([o.data],{type:"application/xml"}),a=URL.createObjectURL(s),[,l]=o.headers["content-disposition"].split("filename="),c=document.createElement("a");c.download=l,c.href=a,c.target="_blank",document.body.appendChild(c),c.click(),document.body.removeChild(c),ie.dismiss()})))}}const UZt=Ea.div`
border-color: ${n=>n.theme.borderColor};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function Vhr(){const[n]=ue(),{dateFormat:e}=Il(),t=r=>{var u,d,h,g,p,m,_,v,b,y,C,x,k,I,L,D,R,P,M,O,B,F,H,V,$,j,Y,ne,se,he;let o=Ds(`activity_${r.activity_type_id}`,{});r.activity_type_id===10&&r.contact&&(o=Ds("activity_10_online",{})),r.activity_type_id===54&&r.contact&&(o=o.replace(":user",":contact"));const s=["invoice","quote","recurring_invoice","vendor","credit","payment","project","task","expense","recurring_expense","bank_transaction","purchase_order"],l=(()=>{const xe=Object.keys(r||{}).find(_e=>s.includes(_e));return!xe&&(r!=null&&r.client)?"client":xe||""})(),c={client:f(Ii,{to:dt("/clients/:id",{id:(u=r.client)==null?void 0:u.hashed_id}),children:(d=r.client)==null?void 0:d.label}),contact:f(Ii,{to:dt(`/${(h=r==null?void 0:r.contact)==null?void 0:h.contact_entity}/:id`,{id:(g=r.contact)==null?void 0:g.hashed_id}),children:(p=r.contact)==null?void 0:p.label}),quote:f(Ii,{to:dt("/quotes/:id/edit",{id:(m=r.quote)==null?void 0:m.hashed_id}),children:(_=r.quote)==null?void 0:_.label}),user:((v=r.user)==null?void 0:v.label)??n("system"),expense:f(Ii,{to:dt("/expenses/:id/edit",{id:(b=r.expense)==null?void 0:b.hashed_id}),children:(y=r==null?void 0:r.expense)==null?void 0:y.label}),recurring_invoice:f(Ii,{to:dt("/recurring_invoices/:id/edit",{id:(C=r.recurring_invoice)==null?void 0:C.hashed_id}),children:(x=r==null?void 0:r.recurring_invoice)==null?void 0:x.label}),recurring_expense:f(Ii,{to:dt("/recurring_expenses/:id/edit",{id:(k=r.recurring_expense)==null?void 0:k.hashed_id}),children:(I=r==null?void 0:r.recurring_expense)==null?void 0:I.label}),purchase_order:f(Ii,{to:dt("/purchase_orders/:id/edit",{id:(L=r.purchase_order)==null?void 0:L.hashed_id}),children:(D=r==null?void 0:r.purchase_order)==null?void 0:D.label}),invoice:f(Ii,{to:dt("/invoices/:id/edit",{id:(R=r.invoice)==null?void 0:R.hashed_id}),children:(P=r==null?void 0:r.invoice)==null?void 0:P.label}),payment_amount:(M=r==null?void 0:r.payment_amount)==null?void 0:M.label,payment:f(Ii,{to:dt("/payments/:id/edit",{id:(O=r.payment)==null?void 0:O.hashed_id}),children:(B=r==null?void 0:r.payment)==null?void 0:B.label}),credit:f(Ii,{to:dt("/credits/:id/edit",{id:(F=r.credit)==null?void 0:F.hashed_id}),children:(H=r==null?void 0:r.credit)==null?void 0:H.label}),task:f(Ii,{to:dt("/tasks/:id/edit",{id:(V=r.task)==null?void 0:V.hashed_id}),children:($=r==null?void 0:r.task)==null?void 0:$.label}),vendor:f(Ii,{to:dt("/vendors/:id/edit",{id:(j=r.vendor)==null?void 0:j.hashed_id}),children:(Y=r==null?void 0:r.vendor)==null?void 0:Y.label}),subscription:f(Ii,{to:dt("/settings/subscriptions/:id/edit",{id:(ne=r.subscription)==null?void 0:ne.hashed_id}),children:(se=r==null?void 0:r.subscription)==null?void 0:se.label}),adjustment:(he=r==null?void 0:r.adjustment)==null?void 0:he.label,notes:!!(l&&r[l])&&N(_t,{children:[f("br",{}),f(Ii,{to:dt(`/${l}s/${r[l].hashed_id}/edit`),children:r==null?void 0:r.notes})]})};for(const[xe,_e]of Object.entries(c))o=THe(o,`:${xe}`,()=>_e);return o},i=Vn();return r=>f(UZt,{theme:{borderColor:i.$4,hoverColor:i.$2},className:"flex flex-col py-2 border border-t-0 border-x-0 last:border-b-0",children:N("div",{className:"flex flex-col space-y-2",children:[f("span",{className:"text-sm",children:t(r)}),N("div",{className:"flex space-x-3",children:[f("span",{className:"dark:text-white text-sm",children:Jr(r.created_at,e+" HH:mm")}),f("span",{className:"text-gray-500 text-sm",children:r.ip})]})]})})}function oU(n){const[e]=ue(),{entity:t,entityId:i,label:r,labelElement:o}=n,[s,a]=w.useState(!1),[l,c]=w.useState(!1),[u,d]=w.useState(""),h=()=>{c(!1),d("")},g=()=>{s||(a(!0),ie.processing(),Te("POST",ye("/api/v1/activities/notes"),{entity:`${t}s`,entity_id:i,notes:u}).then(()=>{ie.success("saved_comment"),hn(["activities"])}).finally(()=>{a(!1),h()}))};return N(_t,{children:[i&&f("div",{className:"cursor-pointer",onClick:()=>c(!0),children:o||f(Ut,{behavior:"button",type:"secondary",onClick:()=>{},children:e("add_comment")})}),N(cr,{size:"regular",title:`${e("comment")} | ${e(t)} | ${r}`,visible:l,onClose:h,children:[f(ke,{element:"textarea",value:u,onValueChange:p=>d(p),changeOverride:!0}),f("div",{className:"flex self-end",children:f(Ut,{behavior:"button",onClick:g,disabled:s||!u,disableWithoutIcon:!0,children:e("add")})})]})]})}function Hhr(n){const{setErrors:e,isDefaultTerms:t,isDefaultFooter:i}=n,r=ri(),o=Wpe(),s=Ri(Yw);return a=>{ie.processing(),e(void 0);let l="/api/v1/purchase_orders?";t?(l+="save_default_terms=true",i&&(l+="&save_default_footer=true")):i&&(l+="save_default_footer=true"),Te("POST",ye(l),a).then(async c=>{(t||i)&&await o(),ie.success("created_purchase_order"),hn(["purchase_orders"]),r(dt("/purchase_orders/:id/edit",{id:c.data.data.id}))}).catch(c=>{var u;if(((u=c.response)==null?void 0:u.status)===422){const d=c.response.data;d.errors.amount?ie.error(d.errors.amount[0]):ie.dismiss(),e(d)}}).finally(()=>s(void 0))}}const qZt=["status","number","vendor","expense","amount","date","due_date"];function KZt(){const[n,e,t,i]=yf({entity:"invoice"});return["status","number","vendor","expense","amount","date","due_date","archived_at","contact_email","contact_name","created_at",n,e,t,i,"discount","documents","entity_state","exchange_rate"]}function Whr(){var g;const{t:n}=ue(),{dateFormat:e}=Il(),t=bf(),i=fA(),r=sl(),o=Gw(),s=Lk();KZt();const[a,l,c,u]=yf({entity:"invoice"}),d=[{column:"status",id:"status_id",label:n("status"),format:(p,m)=>f(Ii,{to:dt("/purchase_orders/:id/edit",{id:m.id}),children:f(tZt,{entity:m})})},{column:"number",id:"number",label:n("number"),format:(p,m)=>N("div",{className:"flex space-x-2",children:[f(jh,{to:dt("/purchase_orders/:id/edit",{id:m.id}),renderSpan:o("purchase_order",m),children:p}),f(Ppe,{text:m.number,stopPropagation:!0})]})},{column:"vendor",id:"vendor_id",label:n("vendor"),format:(p,m)=>m.vendor&&f(Ii,{to:dt("/vendors/:id",{id:m.vendor.id}),children:m.vendor.name})},{column:"expense",id:"expense_id",label:n("expense"),format:(p,m)=>m.expense&&f(Ii,{to:dt("/expenses/:id/edit",{id:m.expense.id}),children:m.expense.number})},{column:"amount",id:"amount",label:n("amount"),format:(p,m)=>{var _,v;return t(p,(_=m.vendor)==null?void 0:_.country_id,(v=m.vendor)==null?void 0:v.currency_id)}},{column:"date",id:"date",label:n("date"),format:p=>Jr(p,e)},{column:"due_date",id:"due_date",label:n("due_date"),format:p=>Jr(p,e)},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:p=>Jr(p,e)},{column:"contact_name",id:"id",label:n("contact_name"),format:(p,m)=>{var _,v;return m.vendor&&((v=(_=m.vendor)==null?void 0:_.contacts)==null?void 0:v.length)>0&&N(Ii,{to:dt("/vendors/:id",{id:m.id}),children:[m.vendor.contacts[0].first_name," ",m.vendor.contacts[0].last_name]})}},{column:"contact_email",id:"id",label:n("contact_name"),format:(p,m)=>m.vendor&&f(ec,{text:m.vendor.contacts[0].email})},{column:"created_at",id:"created_at",label:n("created_at"),format:p=>Jr(p,e)},{column:a,id:"custom_value1",label:a,format:p=>s("invoice1",p==null?void 0:p.toString())},{column:l,id:"custom_value2",label:l,format:p=>s("invoice2",p==null?void 0:p.toString())},{column:c,id:"custom_value3",label:c,format:p=>s("invoice3",p==null?void 0:p.toString())},{column:u,id:"custom_value4",label:u,format:p=>s("invoice4",p==null?void 0:p.toString())},{column:"discount",id:"discount",label:n("discount"),format:(p,m)=>{var _,v;return m.is_amount_discount?t(p,(_=m.vendor)==null?void 0:_.country_id,(v=m.vendor)==null?void 0:v.currency_id):`${i(p)} %`}},{column:"documents",id:"documents",label:n("documents"),format:(p,m)=>m.documents.length},{column:"entity_state",id:"id",label:n("entity_state"),format:(p,m)=>f(zp,{entity:m})},{column:"exchange_rate",id:"exchange_rate",label:n("exchange_rate"),format:p=>i(p)}],h=((g=r==null?void 0:r.react_table_columns)==null?void 0:g.purchaseOrder)||qZt;return d.filter(p=>h.includes(p.column)).sort((p,m)=>h.indexOf(p.column)-h.indexOf(m.column))}function GZt(){const[n]=ue(),e=Ng();return[{label:n("draft"),value:"draft",color:"white",backgroundColor:"#6B7280"},{label:n("sent"),value:"sent",color:"white",backgroundColor:e.$1||"#93C5FD"},{label:n("accepted"),value:"accepted",color:"white",backgroundColor:e.$2||"#1D4ED8"},{label:n("cancelled"),value:"cancelled",color:"white",backgroundColor:e.$5||"#e6b05c"}]}function zhr(){const[n]=ue(),e=vi(),{isAdmin:t,isOwner:i}=ao(),{isEditPage:r}=Kw({entity:"purchase_order"}),[,o]=Mo(nU),s=yZt(),a=ri(),l=CZt(),c=zo(),u=Gw(),d=HHe({entity:"purchase_order"}),h=MHe({resource:"purchase_order"}),g=VHe({entity:"purchase_order"}),p=YHe({resource:"purchase_order",downloadType:"download_e_purchase_order"}),{setChangeTemplateResources:m,setChangeTemplateVisible:_,setChangeTemplateEntityContext:v}=gA(),b=C=>{o({...C,id:"",number:"",documents:[],date:Cn().format("YYYY-MM-DD"),total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"1",client_id:"",paid_to_date:0,vendor:void 0}),a("/purchase_orders/create?action=clone")};return[C=>f(et,{onClick:()=>a(dt("/purchase_orders/:id/email",{id:C.id})),icon:f(Ve,{element:efe}),children:n("send_email")}),C=>f(et,{onClick:()=>a(dt("/purchase_orders/:id/pdf",{id:C.id})),icon:f(Ve,{element:Rz}),children:n("view_pdf")}),C=>nr(C)!==Di.Deleted&&f(et,{onClick:()=>d([C.id]),icon:f(Ve,{element:D5e}),children:n("print_pdf")}),C=>C.status_id!==q1.Accepted&&(t||i)&&f(et,{onClick:()=>g(C.id),icon:f(Ve,{element:Zhe}),children:n("schedule")}),C=>f(oU,{entity:"purchase_order",entityId:C.id,label:`#${C.number}`,labelElement:f(et,{icon:f(Ve,{element:Az}),children:n("add_comment")})}),C=>f(et,{onClick:()=>h(C),icon:f(Ve,{element:XC}),children:n("download")}),C=>!!(e!=null&&e.settings.enable_e_invoice)&&f(et,{onClick:()=>p(C),icon:f(Ve,{element:XC}),children:n("download_e_purchase_order")}),C=>C.status_id!==q1.Accepted&&f(et,{onClick:()=>l(C),icon:f(Ve,{element:A5e}),children:n("mark_sent")}),C=>!C.expense_id.length&&f(et,{onClick:()=>s([C.id],"expense"),icon:f(Ve,{element:nfe}),children:n("convert_to_expense")}),C=>C.status_id===q1.Accepted&&f(et,{onClick:()=>s([C.id],"add_to_inventory"),icon:f(Ve,{element:lyt}),children:n("add_to_inventory")}),C=>!!C.expense_id.length&&!u("expense",C.expense)&&f(et,{onClick:()=>a(dt("/expenses/:id/edit",{id:C.expense_id})),icon:f(Ve,{element:Xhe}),children:`${n("view")} ${n("expense")}`}),C=>f(et,{onClick:()=>FHe(C),icon:f(Ve,{element:tfe}),children:n("vendor_portal")}),()=>f(Jn,{withoutPadding:!0}),C=>c("create_purchase_order")&&f(et,{onClick:()=>b(C),icon:f(Ve,{element:tb}),children:n("clone_to_purchase_order")}),C=>f($Zt,{purchaseOrder:C}),C=>f(et,{onClick:()=>{_(!0),m([C]),v({endpoint:"/api/v1/purchase_orders/bulk",entity:"purchase_order"})},icon:f(Ve,{element:K2}),children:n("run_template")}),()=>r&&f(Jn,{withoutPadding:!0}),C=>!C.archived_at&&r&&f(et,{onClick:()=>s([C.id],"archive"),icon:f(Ve,{element:Xl}),children:n("archive")}),C=>!!C.archived_at&&r&&f(et,{onClick:()=>s([C.id],"restore"),icon:f(Ve,{element:Ql}),children:n("restore")}),C=>!C.is_deleted&&r&&f(et,{onClick:()=>s([C.id],"delete"),icon:f(Ve,{element:Pa}),children:n("delete")})]}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/var Oh=(n=>(n.Viewed="-2",n.Expired="-1",n.Draft="1",n.Sent="2",n.Approved="3",n.Converted="4",n))(Oh||{});/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/class YZt{constructor(e,t){this.invoice=e,this.currency=t,this.taxCollection=Wa(),this.lineItems=[],this.items=new Map,this.subTotal=0,this.grossSubTotal=0,this.totalTaxes=0}async process(){var e,t;return!((e=this.invoice)!=null&&e.line_items)||((t=this.invoice.line_items)==null?void 0:t.length)===0?this.items:(this.calculateLineItems(),this)}calculateLineItems(){return this.invoice.line_items.map(e=>{this.item=e,this.cleanLineItem().sumLineItem().setDiscount().calculateTaxes().push()}),this}cleanLineItem(){return this}sumLineItem(){return this.item.line_total=this.item.cost*this.item.quantity+4e-15,this}setDiscount(){if(this.invoice.is_amount_discount)this.item.line_total=this.item.line_total-this.item.discount;else{const e=this.item.line_total*(this.item.discount/100);this.item.line_total=this.item.line_total-e}return this.item.is_amount_discount=this.invoice.is_amount_discount,this}calculateTaxes(){let e=0;const t=this.item.line_total-this.item.line_total*(this.invoice.discount/100),i=this.calculateAmountLineTax(this.item.tax_rate1,t);e+=i,this.item.tax_name1.length>=1&&this.groupTax(this.item.tax_name1,this.item.tax_rate1,i);const r=this.calculateAmountLineTax(this.item.tax_rate2,t);e+=r,this.item.tax_name2.length>=1&&this.groupTax(this.item.tax_name2,this.item.tax_rate2,r);const o=this.calculateAmountLineTax(this.item.tax_rate3,t);return e+=o,this.item.tax_name3.length>=1&&this.groupTax(this.item.tax_name3,this.item.tax_rate3,o),this.item.gross_line_total=this.item.line_total+(isNaN(e)?0:e),this.totalTaxes+=isNaN(e)?0:e,this}groupTax(e,t,i){if(e.length===0)return;let r={};r={key:e+t.toString().replace(" ",""),total:i,name:`${e} ${parseFloat(t.toString())} %`},this.taxCollection.push(Wa(r))}calculateAmountLineTax(e,t){return Math.round(t*e/100*1e3/10)/100}push(){return this.subTotal+=parseFloat((this.item.line_total+4e-15).toFixed(this.currency.precision)),this.subTotal=parseFloat(this.subTotal.toFixed(this.currency.precision)),this.grossSubTotal+=this.item.gross_line_total,this.lineItems.push(this.item),this}calculateTaxesWithAmountDiscount(){this.taxCollection=Wa(),this.totalTaxes=0,this.lineItems.map((e,t)=>{let i=0;if(this.item=e,e.line_total!=0){const r=this.item.line_total-this.item.line_total*(this.invoice.discount/this.subTotal),o=this.calculateAmountLineTax(this.item.tax_rate1,r);i+=o,o!==0&&this.groupTax(this.item.tax_name1,this.item.tax_rate1,o);const s=this.calculateAmountLineTax(this.item.tax_rate2,r);i+=s,s!==0&&this.groupTax(this.item.tax_name2,this.item.tax_rate2,s);const a=this.calculateAmountLineTax(this.item.tax_rate3,r);i+=a,a!==0&&this.groupTax(this.item.tax_name3,this.item.tax_rate3,a),this.item.gross_line_total=this.item.line_total+(isNaN(i)?0:i),this.item.tax_amount=isNaN(i)?0:i}this.lineItems[t]=this.item,this.totalTaxes+=isNaN(i)?0:i})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/class cV{static formatValue(e,t){return mre(e,t,".","")}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/class QHe{constructor(e,t){this.invoice=e,this.currency=t,this.taxMap=Wa(),this.totalTaxMap=[],this.totalDiscount=0,this.total=0,this.totalTaxes=0,this.totalCustomValues=0,this.subTotal=0,this.invoiceItems=new YZt(this.invoice,this.currency)}build(){return this.calculateLineItems().calculateDiscount().calculateInvoiceTaxes().calculateCustomValues().setTaxMap().calculateTotals().calculateBalance(),this}getTaxMap(){return this.taxMap}calculateLineItems(){return this.invoiceItems.process(),this.invoice.line_items=this.invoiceItems.lineItems,this.total=this.invoiceItems.subTotal,this.subTotal=this.invoiceItems.subTotal,this}calculateDiscount(){return this.totalDiscount=this.discount(this.invoiceItems.subTotal),this.total-=this.totalDiscount,this}calculateInvoiceTaxes(){if(this.invoice.tax_name1.length>=1){let e=this.taxer(this.total,this.invoice.tax_rate1);e+=this.getSurchargeTaxTotalForKey(this.invoice.tax_name1,this.invoice.tax_rate1),this.totalTaxes+=e,this.totalTaxMap.push({name:`${this.invoice.tax_name1} ${parseFloat(this.invoice.tax_rate1.toFixed(this.currency.precision))} %`})}if(this.invoice.tax_name2.length>=1){let e=this.taxer(this.total,this.invoice.tax_rate2);e+=this.getSurchargeTaxTotalForKey(this.invoice.tax_name2,this.invoice.tax_rate2),this.totalTaxes+=e,this.totalTaxMap.push({name:`${this.invoice.tax_name2} ${parseFloat(this.invoice.tax_rate2.toFixed(this.currency.precision))} %`})}if(this.invoice.tax_name3.length>=1){let e=this.taxer(this.total,this.invoice.tax_rate3);e+=this.getSurchargeTaxTotalForKey(this.invoice.tax_name3,this.invoice.tax_rate3),this.totalTaxes+=e,this.totalTaxMap.push({name:`${this.invoice.tax_name3} ${parseFloat(this.invoice.tax_rate3.toFixed(this.currency.precision))} %`})}return this}calculateCustomValues(){return this.totalCustomValues+=this.valuer(this.invoice.custom_surcharge1),this.totalCustomValues+=this.valuer(this.invoice.custom_surcharge2),this.totalCustomValues+=this.valuer(this.invoice.custom_surcharge3),this.totalCustomValues+=this.valuer(this.invoice.custom_surcharge4),this.total+=this.totalCustomValues,this}getSurchargeTaxTotalForKey(e,t){let i=0;return this.invoice.custom_surcharge_tax1&&(i+=parseFloat((this.invoice.custom_surcharge1*(t/100)).toFixed(this.currency.precision))),this.invoice.custom_surcharge_tax2&&(i+=parseFloat((this.invoice.custom_surcharge2*(t/100)).toFixed(this.currency.precision))),this.invoice.custom_surcharge_tax3&&(i+=parseFloat((this.invoice.custom_surcharge3*(t/100)).toFixed(this.currency.precision))),this.invoice.custom_surcharge_tax4&&(i+=parseFloat((this.invoice.custom_surcharge4*(t/100)).toFixed(this.currency.precision))),i}setTaxMap(){this.invoice.is_amount_discount&&(this.invoiceItems.calculateTaxesWithAmountDiscount(),this.invoice.line_items=this.invoiceItems.lineItems),this.taxMap=Wa();let e=Wa();return e=this.invoiceItems.taxCollection.pluck("items"),e.pluck("key").unique().map(i=>{const r=e.filter(s=>s.key===i).pluck("name").first(),o=e.filter(s=>s.key===i).sum("total");this.taxMap.push({name:r,total:o})}),this.totalTaxes+=this.invoiceItems.totalTaxes,this}calculateTotals(){return this.total+=this.totalTaxes,this.total.toFixed(this.currency.precision),this}calculateBalance(){return this.setCalculatedAttributes(),this}setCalculatedAttributes(){return this.invoice.amount=parseFloat(cV.formatValue(this.total,this.currency.precision)),this.invoice.balance=parseFloat(cV.formatValue(this.total,this.currency.precision))-(this.invoice.paid_to_date??0),this.invoice.total_taxes=this.totalTaxes,this}getBalanceDue(){return this.invoice.partial&&this.invoice.partial>0?Math.min(this.invoice.partial,this.invoice.balance):this.invoice.balance}discount(e){return this.invoice.is_amount_discount?this.invoice.discount:parseFloat((e*(this.invoice.discount/100)).toFixed(this.currency.precision))}taxer(e,t){return Math.round(e*((t??0)/100)*1e3/10)/100}valuer(e){return typeof e=="number"?e:0}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function QZt(){const n=Kr(),e=ki(Hc);return t=>{ie.processing(),Te("PUT",ye("/api/v1/quotes/:id?approve=true",{id:t.id}),t).then(()=>{ie.success("approved_quote"),hn(["quotes"]),e&&n.invalidateQueries([e])})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const XZt={convert_to_invoice:"converted_quote",convert_to_project:"converted_quote",email:"emailed_quotes",sent:"marked_quote_as_sent"},XHe=()=>{const n=ri(),e=Kr(),t=ki(Hc);return(i,r)=>{ie.processing(),Te("POST",ye("/api/v1/quotes/bulk"),{action:r,ids:i}).then(o=>{const s=XZt[r]||`${r}d_quote`;r==="approve"?ie.success(Ds("approved_quotes",{value:i.length})):ie.success(s),hn(["quotes"]),t&&e.invalidateQueries([t]),r==="convert_to_project"&&n(dt("/projects/:id",{id:o.data.data[0].project_id}))})}};/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function ZZt(){const n=Kr(),e=ki(Hc);return t=>{ie.processing(),Te("PUT",ye("/api/v1/quotes/:id?mark_sent=true",{id:t.id}),t).then(()=>{ie.success("quote_sent"),hn(["quotes"]),e&&n.invalidateQueries([e])})}}function JZt(n){const[e]=ue(),{status_id:t,is_deleted:i,archived_at:r,invoice_id:o,invitations:s}=n.entity,a=Ng(),l=()=>s==null?void 0:s.some(g=>g.viewed_date),c=t===Oh.Approved||t===Oh.Converted,u=!c,d=l(),h=t===Oh.Expired;return i?f(Gi,{variant:"red",children:e("deleted")}):r?f(Gi,{variant:"orange",children:e("archived")}):o?f(Gi,{variant:"green",style:{backgroundColor:a.$3},children:e("converted")}):h?f(Gi,{variant:"red",style:{backgroundColor:a.$5},children:e("expired")}):d&&u&&!c?f(Gi,{variant:"yellow",children:e("viewed")}):t===Oh.Draft?f(Gi,{variant:"generic",children:e("draft")}):t===Oh.Sent?f(Gi,{variant:"light-blue",style:{backgroundColor:a.$1},children:e("sent")}):t===Oh.Approved?f(Gi,{variant:"dark-blue",style:{backgroundColor:a.$2},children:e("approved")}):f(_t,{})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/class eJt{constructor(e){this.invoice=e,this.taxCollection=Wa(),this.lineItems=[],this.items=new Map,this.subTotal=0,this.grossSubTotal=0,this.totalTaxes=0}async process(){var e,t;return!((e=this.invoice)!=null&&e.line_items)||((t=this.invoice.line_items)==null?void 0:t.length)===0?this.items:(this.calculateLineItems(),this)}calculateLineItems(){return this.invoice.line_items.map(e=>{this.item=e,this.cleanLineItem().sumLineItem().setDiscount().calculateTaxes().push()}),this}cleanLineItem(){return this}sumLineItem(){return this.item.line_total=this.item.cost*this.item.quantity,this}setDiscount(){return this.invoice.is_amount_discount?this.item.line_total-=this.item.discount:this.item.line_total-=this.item.line_total*(this.item.discount/100),this.item.is_amount_discount=this.invoice.is_amount_discount,this}calculateTaxes(){let e=0;const t=this.item.line_total-this.item.line_total*(this.invoice.discount/100),i=this.calcInclusiveLineTax(this.item.tax_rate1,t);e+=i,this.item.tax_name1.length>=1&&this.groupTax(this.item.tax_name1,this.item.tax_rate1,i);const r=this.calcInclusiveLineTax(this.item.tax_rate2,t);e+=r,this.item.tax_name2.length>=1&&this.groupTax(this.item.tax_name2,this.item.tax_rate2,r);const o=this.calcInclusiveLineTax(this.item.tax_rate3,t);return e+=o,this.item.tax_name3.length>=1&&this.groupTax(this.item.tax_name3,this.item.tax_rate3,o),this.item.gross_line_total=this.item.line_total,this.totalTaxes+=e,this}groupTax(e,t,i){let r={};r={key:e+t.toString().replace(" ",""),total:i,name:`${e} ${parseFloat(t.toString())} %`},this.taxCollection.push(Wa(r))}calcInclusiveLineTax(e,t){return t-t/(1+e/100)}push(){return this.subTotal+=this.item.line_total,this.grossSubTotal+=this.item.gross_line_total,this.lineItems.push(this.item),this}calculateTaxesWithAmountDiscount(){this.taxCollection=Wa(),this.lineItems.map((e,t)=>{let i=0;if(this.item=e,e.line_total>0){const r=this.subTotal>0?this.item.line_total-this.invoice.discount*(this.item.line_total/this.subTotal):0,o=this.calcInclusiveLineTax(this.item.tax_rate1,r);i+=o,o!==0&&this.groupTax(this.item.tax_name1,this.item.tax_rate1,o);const s=this.calcInclusiveLineTax(this.item.tax_rate2,r);i+=s,s!==0&&this.groupTax(this.item.tax_name2,this.item.tax_rate2,s);const a=this.calcInclusiveLineTax(this.item.tax_rate3,r);i+=a,a!==0&&this.groupTax(this.item.tax_name3,this.item.tax_rate3,a),this.item.gross_line_total=this.item.line_total,this.item.tax_amount=isNaN(i)?0:i}this.lineItems[t]=this.item,this.totalTaxes+=i})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/class ZHe{constructor(e,t){this.invoice=e,this.currency=t,this.taxMap=Wa(),this.totalTaxMap=[],this.totalDiscount=0,this.total=0,this.totalTaxes=0,this.totalCustomValues=0,this.subTotal=0,this.invoiceItems=new eJt(this.invoice)}build(){return this.calculateLineItems().calculateDiscount().calculateCustomValues().calculateInvoiceTaxes().setTaxMap().calculateTotals().calculateBalance(),this}calculateLineItems(){return this.invoiceItems.process(),this.invoice.line_items=this.invoiceItems.lineItems,this.total=this.invoiceItems.subTotal,this.subTotal=this.invoiceItems.subTotal,this}calculateDiscount(){return this.totalDiscount=this.discount(this.invoiceItems.subTotal),this.total-=this.totalDiscount,this}calculateInvoiceTaxes(){let e=this.total;if(this.invoice.discount>0&&this.invoice.is_amount_discount&&(e=this.subTotal-this.invoice.discount),this.invoice.discount>0&&!this.invoice.is_amount_discount&&(e=this.subTotal-this.subTotal*(this.invoice.discount/100)),this.invoice.tax_rate1>0){const t=this.calcInclusiveLineTax(e,this.invoice.tax_rate1);this.totalTaxes+=t,this.totalTaxMap.push({name:`${this.invoice.tax_name1} ${parseFloat(this.invoice.tax_rate1.toFixed(this.currency.precision))} %`})}if(this.invoice.tax_rate2>0){const t=this.calcInclusiveLineTax(e,this.invoice.tax_rate2);this.totalTaxes+=t,this.totalTaxMap.push({name:`${this.invoice.tax_name2} ${parseFloat(this.invoice.tax_rate2.toFixed(this.currency.precision))} %`})}if(this.invoice.tax_rate3>0){const t=this.calcInclusiveLineTax(e,this.invoice.tax_rate3);this.totalTaxes+=t,this.totalTaxMap.push({name:`${this.invoice.tax_name3} ${parseFloat(this.invoice.tax_rate3.toFixed(this.currency.precision))} %`})}return this}getTaxMap(){return this.taxMap}calculateCustomValues(){return this.totalCustomValues+=this.valuer(this.invoice.custom_surcharge1),this.totalCustomValues+=this.valuer(this.invoice.custom_surcharge2),this.totalCustomValues+=this.valuer(this.invoice.custom_surcharge3),this.totalCustomValues+=this.valuer(this.invoice.custom_surcharge4),this.total+=this.totalCustomValues,this}getSurchargeTaxTotalForKey(e,t){let i=0;return this.invoice.custom_surcharge_tax1&&(i+=parseFloat((this.invoice.custom_surcharge1*(t/100)).toFixed(this.currency.precision))),this.invoice.custom_surcharge_tax2&&(i+=parseFloat((this.invoice.custom_surcharge2*(t/100)).toFixed(this.currency.precision))),this.invoice.custom_surcharge_tax3&&(i+=parseFloat((this.invoice.custom_surcharge3*(t/100)).toFixed(this.currency.precision))),this.invoice.custom_surcharge_tax4&&(i+=parseFloat((this.invoice.custom_surcharge4*(t/100)).toFixed(this.currency.precision))),i}setTaxMap(){this.invoice.is_amount_discount&&(this.invoiceItems.calculateTaxesWithAmountDiscount(),this.invoice.line_items=this.invoiceItems.lineItems),this.taxMap=Wa();let e=Wa();return e=this.invoiceItems.taxCollection.pluck("items"),e.pluck("key").unique().map(i=>{const r=e.filter(s=>s.key===i).pluck("name").first(),o=e.filter(s=>s.key===i).sum("total");this.taxMap.push({name:r,total:o}),this.totalTaxes+=o}),this}calculateTotals(){return this.totalTaxes=Number(this.totalTaxes.toFixed(this.currency.precision)),this}calculateBalance(){return this.setCalculatedAttributes(),this}setCalculatedAttributes(){return this.invoice.amount=parseFloat(cV.formatValue(this.total,this.currency.precision)),this.invoice.balance=parseFloat(cV.formatValue(this.total,this.currency.precision))-(this.invoice.paid_to_date??0),this.invoice.total_taxes=this.totalTaxes,this}getBalanceDue(){return this.invoice.partial&&this.invoice.partial>0?Math.min(this.invoice.partial,this.invoice.balance):this.invoice.balance}discount(e){return this.invoice.is_amount_discount?this.invoice.discount:parseFloat((e*(this.invoice.discount/100)).toFixed(this.currency.precision))}taxer(e,t){return parseFloat((e*((t??0)/100)).toFixed(this.currency.precision))}valuer(e){return typeof e=="number"?e:0}calcInclusiveLineTax(e,t){return e-e/(1+t/100)}}const tJt=n=>{const[e]=ue(),[t,i]=w.useState(!1),{selectedIds:r,setSelected:o}=n,s=Vn(),a=XHe();return N(_t,{children:[f(et,{onClick:()=>i(!0),icon:f(Ve,{element:nfe}),children:e("convert_to_project")}),N(cr,{title:e("convert_to_project"),visible:t,onClose:()=>i(!1),children:[f("span",{className:"text-lg",style:{backgroundColor:s.$2,color:s.$3,colorScheme:s.$0},children:e("are_you_sure")}),f("div",{className:"flex justify-end space-x-4 mt-5",children:f(Ut,{behavior:"button",onClick:()=>{a(r,"convert_to_project"),o==null||o([]),i(!1)},children:f("span",{className:"text-base mx-3",children:e("yes")})})})]})]})};function nJt(n){const[e]=ue(),t=ri(),{quote:i}=n,r=zo(),o=Ri(D0),s=Ri(Hpe),a=Ri(rU),l=Ri(nU),c=Ti(),[u,d]=w.useState(!1),h=()=>{s({...i,id:"",number:"",documents:[],date:Cn().format("YYYY-MM-DD"),due_date:"",partial_due_date:"",total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",vendor_id:"",paid_to_date:0,design_id:c.settings.credit_design_id}),t("/credits/create?action=clone")},g=()=>{a({...i,id:"",number:"",documents:[],frequency_id:"5",total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",vendor_id:"",due_date:"",partial_due_date:"",design_id:c.settings.invoice_design_id}),t("/recurring_invoices/create?action=clone")},p=()=>{l({...i,id:"",number:"",documents:[],date:Cn().format("YYYY-MM-DD"),total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"1",vendor_id:"",due_date:"",partial_due_date:"",design_id:c.settings.purchase_order_design_id}),t("/purchase_orders/create?action=clone")},m=()=>{o({...i,id:"",number:"",documents:[],date:Cn().format("YYYY-MM-DD"),due_date:"",total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",vendor_id:"",paid_to_date:0,partial_due_date:"",design_id:c.settings.invoice_design_id}),t("/invoices/create?action=clone")};return N(_t,{children:[(r("create_invoice")||r("create_credit")||r("create_recurring_invoice")||r("create_purchase_order"))&&f(et,{onClick:()=>d(!0),icon:f(Ve,{element:tb}),children:e("clone_to_other")}),f(cr,{title:e("clone_to"),visible:u,onClose:()=>d(!1),closeButtonCypressRef:"cloneOptionsModalXButton",children:f("div",{className:"flex justify-center",children:N("div",{className:"flex flex-1 flex-col items-center space-y-3",children:[r("create_invoice")&&f(_p,{label:e("invoice"),icon:QC,onClick:m}),r("create_credit")&&f(_p,{label:e("credit"),icon:QC,onClick:h}),r("create_recurring_invoice")&&f(_p,{label:e("recurring_invoice"),icon:i7,onClick:g}),r("create_purchase_order")&&f(_p,{label:e("purchase_order"),icon:Ife,onClick:p})]})})})]})}function jhr(n){const e=qw(),t=vi(),[i,r]=Mo(iU),[,o]=Mo(FZt),s=(g,p)=>{r(m=>m&&{...m,[g]:p})};return{handleChange:s,handleInvitationChange:(g,p)=>{let m=[...i.invitations];const _=(m==null?void 0:m.find(v=>v.client_contact_id===g))||-1;if(_!==-1&&p===!1&&(m=m.filter(v=>v.client_contact_id!==g)),_===-1){const v={client_contact_id:g};m.push(v)}s("invitations",m)},handleLineItemChange:(g,p)=>{const m=(i==null?void 0:i.line_items)||[];m[g]=p,r(_=>_&&{..._,line_items:m})},handleLineItemPropertyChange:(g,p,m)=>{const _=(i==null?void 0:i.line_items)||[];_[m][g]=p,r(v=>v&&{...v,line_items:_})},handleCreateLineItem:g=>{r(p=>p&&{...p,line_items:[...p.line_items,{...A0(),type_id:g,quantity:1}]})},handleDeleteLineItem:g=>{const p=(i==null?void 0:i.line_items)||[];p.splice(g,1),r(m=>m&&{...m,line_items:p})},calculateInvoiceSum:g=>{var m;const p=e(((m=n.client)==null?void 0:m.settings.currency_id)||(t==null?void 0:t.settings.currency_id));if(p&&g){const _=g.uses_inclusive_taxes?new ZHe(g,p).build():new QHe(g,p).build();o(_)}}}}function Uhr(n){const{setErrors:e,isDefaultTerms:t,isDefaultFooter:i}=n,r=Wpe(),o=ri(),s=pu(),a=Ri(Yw);return async l=>{ie.processing(),e(void 0),await s(!0);let c="/api/v1/quotes?";t?(c+="save_default_terms=true",i&&(c+="&save_default_footer=true")):i&&(c+="save_default_footer=true"),Te("POST",ye(c),l).then(async u=>{(t||i)&&await r(),ie.success("created_quote"),hn(["quotes"]),o(dt("/quotes/:id/edit",{id:u.data.data.id}))}).catch(u=>{var d;if(((d=u.response)==null?void 0:d.status)===422){const h=u.response.data;h.errors.amount?ie.error(h.errors.amount[0]):ie.dismiss(),e(h)}}).finally(()=>a(void 0))}}function qhr(n){const{setErrors:e,isDefaultTerms:t,isDefaultFooter:i}=n,r=Wpe(),o=Ri(Yw),s=pu();return async a=>{ie.processing(),e(void 0),await s(!0);let l="/api/v1/quotes/:id?";t?(l+="save_default_terms=true",i&&(l+="&save_default_footer=true")):i&&(l+="save_default_footer=true"),Te("PUT",ye(l,{id:a.id}),a).then(async()=>{(t||i)&&await r(),ie.success("updated_quote"),hn(["quotes"])}).catch(c=>{var u;if(((u=c.response)==null?void 0:u.status)===422){const d=c.response.data;d.errors.amount?ie.error(d.errors.amount[0]):ie.dismiss(),e(d)}}).finally(()=>o(void 0))}}function Khr(n){const[e]=ue(),{showCommonBulkAction:t,showEditAction:i}=n||{},r=Ri(iU),o=vi(),{isAdmin:s,isOwner:a}=ao(),{isEditPage:l}=Kw({entity:"quote"}),c=QZt(),u=XHe(),d=ri(),h=ZZt(),g=zo(),p=HHe({entity:"quote"}),m=MHe({resource:"quote"}),_=YHe({resource:"quote",downloadType:"download_e_quote"}),v=VHe({entity:"quote"}),{setChangeTemplateResources:b,setChangeTemplateVisible:y,setChangeTemplateEntityContext:C}=gA(),x=I=>{r({...I,id:"",number:"",documents:[],date:Cn().format("YYYY-MM-DD"),due_date:"",total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",vendor_id:"",paid_to_date:0}),d("/quotes/create?action=clone")};return[I=>!!i&&f(et,{to:dt("/quotes/:id/edit",{id:I.id}),icon:f(Ve,{element:_3}),children:e("edit")}),()=>!!i&&f(Jn,{withoutPadding:!0}),I=>f(et,{to:dt("/quotes/:id/pdf",{id:I.id}),icon:f(Ve,{element:Rz}),children:e("view_pdf")}),I=>nr(I)!==Di.Deleted&&f(et,{onClick:()=>p([I.id]),icon:f(Ve,{element:D5e}),children:e("print_pdf")}),I=>f(et,{onClick:()=>m(I),icon:f(Ve,{element:XC}),children:e("download_pdf")}),I=>!!(o!=null&&o.settings.enable_e_invoice)&&f(et,{onClick:()=>_(I),icon:f(Ve,{element:XC}),children:e("download_e_quote")}),I=>I.status_id!==Oh.Converted&&I.status_id!==Oh.Approved&&(s||a)&&f(et,{onClick:()=>v(I.id),icon:f(Ve,{element:Zhe}),children:e("schedule")}),I=>f(oU,{entity:"quote",entityId:I.id,label:`#${I.number}`,labelElement:f(et,{icon:f(Ve,{element:Az}),children:e("add_comment")})}),I=>f(et,{to:dt("/quotes/:id/email",{id:I.id}),icon:f(Ve,{element:efe}),children:e("email_quote")}),I=>f(et,{onClick:()=>I&&FHe(I),icon:f(Ve,{element:tfe}),children:e("client_portal")}),I=>I.status_id===Oh.Draft&&f(et,{onClick:()=>h(I),icon:f(Ve,{element:A5e}),children:e("mark_sent")}),I=>(I.status_id===Oh.Draft||I.status_id===Oh.Sent)&&f(et,{onClick:()=>c(I),icon:f(Ve,{element:Yhe}),children:e("approve")}),I=>I.status_id!==Oh.Converted&&g("create_invoice")&&f(et,{onClick:()=>u([I.id],"convert_to_invoice"),icon:f(Ve,{element:nfe}),children:e("convert_to_invoice")}),I=>!I.project_id&&g("create_project")&&f(tJt,{selectedIds:[I.id]}),I=>f(et,{onClick:()=>{y(!0),b([I]),C({endpoint:"/api/v1/quotes/bulk",entity:"quote"})},icon:f(Ve,{element:K2}),children:e("run_template")}),()=>f(Jn,{withoutPadding:!0}),I=>g("create_quote")&&f(et,{onClick:()=>x(I),icon:f(Ve,{element:tb}),children:e("clone_to_quote")}),I=>f(nJt,{quote:I}),()=>(l||!!t)&&f(Jn,{withoutPadding:!0}),I=>(l||!!t)&&I.archived_at===0&&f(et,{onClick:()=>u([I.id],"archive"),icon:f(Ve,{element:Xl}),children:e("archive")}),I=>(l||!!t)&&I.archived_at>0&&f(et,{onClick:()=>u([I.id],"restore"),icon:f(Ve,{element:Ql}),children:e("restore")}),I=>(l||!!t)&&!(I!=null&&I.is_deleted)&&f(et,{onClick:()=>u([I.id],"delete"),icon:f(Ve,{element:Pa}),children:e("delete")})]}const iJt=["status","number","client","amount","date","valid_until"];function rJt(){const[n,e,t,i]=yf({entity:"invoice"});return["status","number","client","amount","date","valid_until","archived_at","client_city","client_country","client_postal_code","client_state","contact_email","contact_name","created_at",n,e,t,i,"discount","documents","entity_state","exchange_rate","is_deleted","is_viewed","last_sent_date","partial","partial_due_date","po_number","private_notes","public_notes","tax_amount","updated_at"]}function Ghr(){var b;const{t:n}=ue(),{dateFormat:e}=Il();rJt();const t=ys(),i=ri(),r=fA(),o=zo(),s=Gw(),a=bf(),l=sl(),c=dA(),u=Lk(),d=w.useCallback(y=>{let C="";return y.invitations.map(x=>{x.viewed_date&&(C=x.viewed_date)}),C},[]),[h,g,p,m]=yf({entity:"invoice"}),_=[{column:"status",id:"status_id",label:n("status"),format:(y,C)=>N("div",{className:"flex items-center space-x-2",children:[f(JZt,{entity:C}),C.status_id===Oh.Converted&&C.invoice_id&&f(Bpe,{entityId:C.invoice_id,cacheEndpoint:"/api/v1/invoices",apiEndpoint:"/api/v1/invoices/:id?include=client.group_settings",preCheck:o("view_invoice")||o("edit_invoice"),component:f(mk,{className:"cursor-pointer",fontSize:19,color:t,onClick:()=>i(dt("/invoices/:id/edit",{id:C.invoice_id}))})})]})},{column:"number",id:"number",label:n("number"),format:(y,C)=>N("div",{className:"flex space-x-2",children:[f(jh,{to:dt("/quotes/:id/edit",{id:C.id}),renderSpan:s("quote",C),children:y}),f(Ppe,{text:C.number,stopPropagation:!0})]})},{column:"client",id:"client_id",label:n("client"),format:(y,C)=>{var x;return f(jh,{to:dt("/clients/:id",{id:C.client_id}),renderSpan:s("client",C.client),children:(x=C.client)==null?void 0:x.display_name})}},{column:"amount",id:"amount",label:n("amount"),format:(y,C)=>{var x,k;return a(y,(x=C.client)==null?void 0:x.country_id,(k=C.client)==null?void 0:k.settings.currency_id)}},{column:"date",id:"date",label:n("date"),format:y=>Jr(y,e)},{column:"valid_until",id:"due_date",label:n("valid_until"),format:(y,C)=>Jr(C.due_date,e)},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:y=>Jr(y,e)},{column:"client_city",id:"client_id",label:n("client_city"),format:(y,C)=>{var x;return(x=C.client)==null?void 0:x.city}},{column:"client_country",id:"client_id",label:n("client_country"),format:(y,C)=>{var x,k,I;return((x=C.client)==null?void 0:x.country_id)&&((I=c((k=C.client)==null?void 0:k.country_id))==null?void 0:I.name)}},{column:"client_postal_code",id:"client_id",label:n("client_postal_code"),format:(y,C)=>{var x;return(x=C.client)==null?void 0:x.postal_code}},{column:"client_state",id:"client_id",label:n("client_state"),format:(y,C)=>{var x;return(x=C.client)==null?void 0:x.state}},{column:"contact_email",id:"client_id",label:n("contact_email"),format:(y,C)=>{var x;return C.client&&C.client.contacts.length>0&&f(ec,{text:(x=C.client)==null?void 0:x.contacts[0].email})}},{column:"contact_name",id:"client_id",label:n("contact_name"),format:(y,C)=>{var x,k;return C.client&&C.client.contacts.length>0&&`${(x=C.client)==null?void 0:x.contacts[0].first_name} ${(k=C.client)==null?void 0:k.contacts[0].last_name}`}},{column:"created_at",id:"created_at",label:n("created_at"),format:y=>Jr(y,e)},{column:h,id:"custom_value1",label:h,format:y=>u("invoice1",y==null?void 0:y.toString())},{column:g,id:"custom_value2",label:g,format:y=>u("invoice2",y==null?void 0:y.toString())},{column:p,id:"custom_value3",label:p,format:y=>u("invoice3",y==null?void 0:y.toString())},{column:m,id:"custom_value4",label:m,format:y=>u("invoice4",y==null?void 0:y.toString())},{column:"discount",id:"discount",label:n("discount"),format:(y,C)=>{var x,k;return C.is_amount_discount?a(y,(x=C.client)==null?void 0:x.country_id,(k=C.client)==null?void 0:k.settings.currency_id):`${r(y)} %`}},{column:"documents",id:"documents",label:n("documents"),format:(y,C)=>C.documents.length},{column:"entity_state",id:"id",label:n("entity_state"),format:(y,C)=>f(zp,{entity:C})},{column:"exchange_rate",id:"exchange_rate",label:n("exchange_rate"),format:y=>r(y)},{column:"is_deleted",id:"is_deleted",label:n("is_deleted"),format:(y,C)=>C.is_deleted?n("yes"):n("no")},{column:"is_viewed",id:"id",label:n("is_viewed"),format:(y,C)=>d(C).length>0?Jr(d(C),e):n("no")},{column:"last_sent_date",id:"last_sent_date",label:n("last_sent_date"),format:y=>Jr(y,e)},{column:"partial",id:"partial",label:n("partial"),format:(y,C)=>{var x,k;return a(y,(x=C.client)==null?void 0:x.country_id,(k=C.client)==null?void 0:k.settings.currency_id)}},{column:"partial_due_date",id:"partial_due_date",label:n("partial_due_date"),format:y=>Jr(y,e)},{column:"po_number",id:"po_number",label:n("po_number")},{column:"private_notes",id:"private_notes",label:n("private_notes"),format:y=>f(du,{width:"auto",tooltipElement:f("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:f("article",{className:St("prose prose-sm",{"prose-invert":l.dark_mode}),dangerouslySetInnerHTML:{__html:pc(y)}})}),children:f("span",{children:ib(pc(y)).slice(0,50)})})},{column:"public_notes",id:"public_notes",label:n("public_notes"),format:y=>f(du,{width:"auto",tooltipElement:f("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:f("article",{className:St("prose prose-sm",{"prose-invert":l.dark_mode}),dangerouslySetInnerHTML:{__html:pc(y)}})}),children:f("span",{children:ib(pc(y)).slice(0,50)})})},{column:"tax_amount",id:"total_taxes",label:n("total_taxes"),format:(y,C)=>{var x,k;return a(y,(x=C.client)==null?void 0:x.country_id,(k=C.client)==null?void 0:k.settings.currency_id)}},{column:"updated_at",id:"updated_at",label:n("last_updated"),format:y=>Jr(y,e)}],v=((b=l==null?void 0:l.react_table_columns)==null?void 0:b.quote)||iJt;return _.filter(y=>v.includes(y.column)).sort((y,C)=>v.indexOf(y.column)-v.indexOf(C.column))}function oJt(){const[n]=ue(),e=Ng();return[{label:n("draft"),value:"draft",color:"white",backgroundColor:"#6B7280"},{label:n("sent"),value:"sent",color:"white",backgroundColor:e.$1||"#93C5FD"},{label:n("approved"),value:"approved",color:"white",backgroundColor:e.$2||"#1D4ED8"},{label:n("expired"),value:"expired",color:"white",backgroundColor:e.$5||"#DC2626"},{label:n("upcoming"),value:"upcoming",color:"white",backgroundColor:e.$4||"#e6b05c"},{label:n("converted"),value:"converted",color:"white",backgroundColor:e.$3||"#22C55E"}]}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/var K1=(n=>(n.DRAFT="1",n.ACTIVE="2",n.PAUSED="3",n.COMPLETED="4",n.PENDING="-1",n))(K1||{});function sJt(n){const[e]=ue(),t=Ng(),{status_id:i,is_deleted:r,archived_at:o,last_sent_date:s,remaining_cycles:a}=n.entity,l=i===K1.DRAFT,c=!!r,u=!!o,d=i===K1.ACTIVE&&!s,h=a===-1?"endless":a;return c?f(Gi,{variant:"red",children:e("deleted")}):u?f(Gi,{variant:"orange",children:e("archived")}):!l&&h===0?f(Gi,{variant:"light-blue",style:{backgroundColor:t.$1},children:e("completed")}):d?f(Gi,{variant:"dark-blue",style:{backgroundColor:t.$2},children:e("pending")}):l?f(Gi,{variant:"generic",children:e("draft")}):i===K1.ACTIVE?f(Gi,{variant:"green",style:{backgroundColor:t.$3},children:e("active")}):i===K1.PAUSED?f(Gi,{variant:"orange",style:{backgroundColor:t.$4},children:e("paused")}):f(_t,{})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/var kh=(n=>(n.FREQUENCY_DAILY="1",n.FREQUENCY_WEEKLY="2",n.FREQUENCY_TWO_WEEKS="3",n.FREQUENCY_FOUR_WEEKS="4",n.FREQUENCY_MONTHLY="5",n.FREQUENCY_TWO_MONTHS="6",n.FREQUENCY_THREE_MONTHS="7",n.FREQUENCY_FOUR_MONTHS="8",n.FREQUENCY_SIX_MONTHS="9",n.FREQUENCY_ANNUALLY="10",n.FREQUENCY_TWO_YEARS="11",n.FREQUENCY_THREE_YEARS="12",n.RECURS_INDEFINITELY="-1",n))(kh||{});/**
* Invoice Ninja (https://invoiceninja.com).
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const aJt={[kh.FREQUENCY_ANNUALLY]:"freq_annually",[kh.FREQUENCY_DAILY]:"freq_daily",[kh.FREQUENCY_FOUR_MONTHS]:"freq_four_months",[kh.FREQUENCY_FOUR_WEEKS]:"freq_four_weeks",[kh.FREQUENCY_MONTHLY]:"freq_monthly",[kh.FREQUENCY_SIX_MONTHS]:"freq_six_months",[kh.FREQUENCY_THREE_MONTHS]:"freq_three_months",[kh.FREQUENCY_THREE_YEARS]:"freq_three_years",[kh.FREQUENCY_TWO_MONTHS]:"freq_two_months",[kh.FREQUENCY_TWO_WEEKS]:"freq_two_weeks",[kh.FREQUENCY_TWO_YEARS]:"freq_two_years",[kh.FREQUENCY_WEEKLY]:"freq_weekly",[kh.RECURS_INDEFINITELY]:"freq_indefinetley"};/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Yhr(n){return ai(["/api/v1/recurring_invoices",n.id],()=>Te("GET",ye("/api/v1/recurring_invoices/:id?include=client",{id:n.id})).then(e=>e.data.data),{staleTime:1/0,enabled:!!n.id})}function Qhr(n){const e=zo();return ai(["/api/v1/recurring_invoices","create"],()=>Te("GET",ye("/api/v1/recurring_invoices/create")).then(t=>t.data.data),{...n,staleTime:1/0,enabled:e("create_recurring_invoice")?(n==null?void 0:n.enabled)??!0:!1})}const lJt={start:"started_recurring_invoice",stop:"stopped_recurring_invoice",update_prices:"updated_prices",increase_prices:"updated_prices"};function zpe(n){const e=Kr(),t=ki(Hc),{onSuccess:i,setErrors:r}=n||{};return(o,s,a)=>{ie.processing(),Te("POST",ye("/api/v1/recurring_invoices/bulk"),{action:s,ids:o,...typeof a=="number"&&{percentage_increase:a}}).then(()=>{const l=lJt[s]||`${s}d_recurring_invoice`;ie.success(l),i==null||i(),t&&e.invalidateQueries([t]),hn(["recurring_invoices"])}).catch(l=>{var c;((c=l.response)==null?void 0:c.status)===422&&(r==null||r(l.response.data),ie.dismiss())})}}const cJt=n=>{const[e]=ue(),[t,i]=w.useState(!1),o=zpe({onSuccess:()=>{i(!1)}}),{selectedIds:s,setSelected:a}=n,l=()=>{o(s,"update_prices"),a==null||a([])};return N(_t,{children:[f(et,{onClick:()=>i(!0),icon:f(Ve,{element:pyt}),children:e("update_prices")}),N(cr,{title:e("update_prices"),visible:t,onClose:()=>i(!1),children:[f("span",{className:"text-lg text-gray-900",children:e("are_you_sure")}),f(Ut,{className:"self-end",onClick:l,children:e("yes")})]})]})},uJt=n=>{const[e]=ue(),[t,i]=w.useState(!1),[r,o]=w.useState(0),[s,a]=w.useState(),l=()=>{i(!1),o(0)},c=zpe({onSuccess:l,setErrors:a}),{selectedIds:u,setSelected:d}=n,h=()=>{c(u,"increase_prices",r),d==null||d([])};return N(_t,{children:[f(et,{onClick:()=>i(!0),icon:f(Ve,{element:Wxt}),children:e("increase_prices")}),N(cr,{title:e("increase_prices"),visible:t,onClose:l,children:[f(ke,{label:e("percent"),type:"number",value:r,onValueChange:g=>{o(Number(g)),s&&a(void 0)},errorMessage:s==null?void 0:s.errors.percentage_increase}),f(Ut,{className:"self-end",onClick:h,children:e("submit")})]})]})};function dJt(n){const[e]=ue(),t=ri(),{recurringInvoice:i}=n,r=zo(),o=Ri(iU),s=Ri(Hpe),a=Ri(D0),l=Ri(nU),c=Ti(),[u,d]=w.useState(!1),h=()=>{a({...i,id:"",documents:[],number:"",due_date:"",partial_due_date:"",date:Cn().format("YYYY-MM-DD"),total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",vendor_id:"",design_id:c.settings.invoice_design_id}),t("/invoices/create?action=clone")},g=()=>{o({...i,id:"",number:"",documents:[],date:Cn().format("YYYY-MM-DD"),due_date:"",total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",vendor_id:"",design_id:c.settings.quote_design_id}),t("/quotes/create?action=clone")},p=()=>{s({...i,id:"",number:"",documents:[],date:Cn().format("YYYY-MM-DD"),total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"",vendor_id:"",due_date:"",partial_due_date:"",design_id:c.settings.credit_design_id}),t("/credits/create?action=clone")},m=()=>{l({...i,id:"",number:"",documents:[],date:Cn().format("YYYY-MM-DD"),total_taxes:0,exchange_rate:1,last_sent_date:"",project_id:"",subscription_id:"",status_id:"1",vendor_id:"",paid_to_date:0,due_date:"",partial_due_date:"",design_id:c.settings.purchase_order_design_id}),t("/purchase_orders/create?action=clone")};return N(_t,{children:[(r("create_invoice")||r("create_quote")||r("create_credit")||r("create_purchase_order"))&&f(et,{onClick:()=>d(!0),icon:f(Ve,{element:tb}),children:e("clone_to_other")}),f(cr,{title:e("clone_to"),visible:u,onClose:()=>d(!1),closeButtonCypressRef:"cloneOptionsModalXButton",children:f("div",{className:"flex justify-center",children:N("div",{className:"flex flex-1 flex-col items-center space-y-3",children:[r("create_invoice")&&f(_p,{label:e("invoice"),icon:QC,onClick:h}),r("create_quote")&&f(_p,{label:e("quote"),icon:fhe,onClick:g}),r("create_credit")&&f(_p,{label:e("credit"),icon:QC,onClick:p}),r("create_purchase_order")&&f(_p,{label:e("purchase_order"),icon:Ife,onClick:m})]})})})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function sU(){const n=vi();let e=12,t="hh:mm:ss A";return n&&n.settings.military_time&&(e=24,t="HH:mm:ss"),{timeFormatId:e,timeFormat:t}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function hJt(){const n=vi(),{data:e}=Nd(),[t,i]=w.useState("1"),[r,o]=w.useState("America/Tijuana");return w.useEffect(()=>{if(e!=null&&e.timezones){const s=e.timezones.find(a=>{var l;return a.id===((l=n==null?void 0:n.settings)==null?void 0:l.timezone_id)});s&&(o(s.name),i(s.id))}},[n,e]),{timeZoneId:t,timeZone:r}}var JHe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Co,function(){var t="minute",i=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(o,s,a){var l=s.prototype;a.utc=function(m){var _={date:m,utc:!0,args:arguments};return new s(_)},l.utc=function(m){var _=a(this.toDate(),{locale:this.$L,utc:!0});return m?_.add(this.utcOffset(),t):_},l.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var c=l.parse;l.parse=function(m){m.utc&&(this.$u=!0),this.$utils().u(m.$offset)||(this.$offset=m.$offset),c.call(this,m)};var u=l.init;l.init=function(){if(this.$u){var m=this.$d;this.$y=m.getUTCFullYear(),this.$M=m.getUTCMonth(),this.$D=m.getUTCDate(),this.$W=m.getUTCDay(),this.$H=m.getUTCHours(),this.$m=m.getUTCMinutes(),this.$s=m.getUTCSeconds(),this.$ms=m.getUTCMilliseconds()}else u.call(this)};var d=l.utcOffset;l.utcOffset=function(m,_){var v=this.$utils().u;if(v(m))return this.$u?0:v(this.$offset)?d.call(this):this.$offset;if(typeof m=="string"&&(m=function(x){x===void 0&&(x="");var k=x.match(i);if(!k)return null;var I=(""+k[0]).match(r)||["-",0,0],L=I[0],D=60*+I[1]+ +I[2];return D===0?0:L==="+"?D:-D}(m),m===null))return this;var b=Math.abs(m)<=16?60*m:m,y=this;if(_)return y.$offset=b,y.$u=m===0,y;if(m!==0){var C=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(y=this.local().add(b+C,t)).$offset=b,y.$x.$localOffset=C}else y=this.utc();return y};var h=l.format;l.format=function(m){var _=m||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,_)},l.valueOf=function(){var m=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*m},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var g=l.toDate;l.toDate=function(m){return m==="s"&&this.$offset?a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var p=l.diff;l.diff=function(m,_,v){if(m&&this.$u===m.$u)return p.call(this,m,_,v);var b=this.local(),y=a(m).local();return p.call(b,y,_,v)}}})})(JHe);var fJt=JHe.exports;const gJt=ja(fJt);var eWe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Co,function(){var t={year:0,month:1,day:2,hour:3,minute:4,second:5},i={};return function(r,o,s){var a,l=function(h,g,p){p===void 0&&(p={});var m=new Date(h),_=function(v,b){b===void 0&&(b={});var y=b.timeZoneName||"short",C=v+"|"+y,x=i[C];return x||(x=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:v,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:y}),i[C]=x),x}(g,p);return _.formatToParts(m)},c=function(h,g){for(var p=l(h,g),m=[],_=0;_<p.length;_+=1){var v=p[_],b=v.type,y=v.value,C=t[b];C>=0&&(m[C]=parseInt(y,10))}var x=m[3],k=x===24?0:x,I=m[0]+"-"+m[1]+"-"+m[2]+" "+k+":"+m[4]+":"+m[5]+":000",L=+h;return(s.utc(I).valueOf()-(L-=L%1e3))/6e4},u=o.prototype;u.tz=function(h,g){h===void 0&&(h=a);var p=this.utcOffset(),m=this.toDate(),_=m.toLocaleString("en-US",{timeZone:h}),v=Math.round((m-new Date(_))/1e3/60),b=s(_,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(15*-Math.round(m.getTimezoneOffset()/15)-v,!0);if(g){var y=b.utcOffset();b=b.add(p-y,"minute")}return b.$x.$timezone=h,b},u.offsetName=function(h){var g=this.$x.$timezone||s.tz.guess(),p=l(this.valueOf(),g,{timeZoneName:h}).find(function(m){return m.type.toLowerCase()==="timezonename"});return p&&p.value};var d=u.startOf;u.startOf=function(h,g){if(!this.$x||!this.$x.$timezone)return d.call(this,h,g);var p=s(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return d.call(p,h,g).tz(this.$x.$timezone,!0)},s.tz=function(h,g,p){var m=p&&g,_=p||g||a,v=c(+s(),_);if(typeof h!="string")return s(h).tz(_);var b=function(k,I,L){var D=k-60*I*1e3,R=c(D,L);if(I===R)return[D,I];var P=c(D-=60*(R-I)*1e3,L);return R===P?[D,R]:[k-60*Math.min(R,P)*1e3,Math.max(R,P)]}(s.utc(h,m).valueOf(),v,_),y=b[0],C=b[1],x=s(y).utcOffset(C);return x.$x.$timezone=_,x},s.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},s.tz.setDefault=function(h){a=h}}})})(eWe);var pJt=eWe.exports;const mJt=ja(pJt);/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/Cn.extend(gJt);Cn.extend(mJt);function _Jt(){const{timeZone:n}=hJt(),{timeFormat:e}=sU(),{dateFormat:t}=Il();return(i,r,o,s)=>{if(i===0||i===""||i===void 0)return"";const a=`${r||t} ${o||e}`;return Cn.utc(i).tz(s||n).format(a)}}function Xhr(n){const e=qw(),t=vi(),[i,r]=Mo(rU),[,o]=Mo(BZt),s=(g,p)=>{r(m=>m&&{...m,[g]:p})};return{handleChange:s,handleInvitationChange:(g,p)=>{let m=[...i.invitations];const _=(m==null?void 0:m.find(v=>v.client_contact_id===g))||-1;if(_!==-1&&p===!1&&(m=m.filter(v=>v.client_contact_id!==g)),_===-1){const v={client_contact_id:g};m.push(v)}s("invitations",m)},handleLineItemChange:(g,p)=>{const m=(i==null?void 0:i.line_items)||[];m[g]=p,r(_=>_&&{..._,line_items:m})},handleLineItemPropertyChange:(g,p,m)=>{const _=(i==null?void 0:i.line_items)||[];_[m][g]=p,r(v=>v&&{...v,line_items:_})},handleCreateLineItem:g=>{r(p=>p&&{...p,line_items:[...p.line_items,{...A0(),type_id:g,quantity:1}]})},handleDeleteLineItem:g=>{const p=(i==null?void 0:i.line_items)||[];p.splice(g,1),r(m=>m&&{...m,line_items:p})},calculateInvoiceSum:g=>{var m;const p=e(((m=n.client)==null?void 0:m.settings.currency_id)||(t==null?void 0:t.settings.currency_id));if(p&&g){const _=g.uses_inclusive_taxes?new ZHe(g,p).build():new QHe(g,p).build();o(_)}}}}function Zhr(n){const{setErrors:e}=n,t=Ri(Yw);return(i,r)=>{ie.processing(),e(void 0);const o=r?`/api/v1/recurring_invoices/:id?${r}=true`:"/api/v1/recurring_invoices/:id";Te("PUT",ye(o,{id:i.id}),i).then(()=>{hn(["recurring_invoices"]),ie.success("updated_recurring_invoice")}).catch(s=>{var a;if(((a=s.response)==null?void 0:a.status)===422){const l=s.response.data;l.errors.amount?ie.error(l.errors.amount[0]):ie.dismiss(),e(l)}}).finally(()=>t(void 0))}}function vJt(){const n=Kr(),e=ki(Hc);return(t,i)=>{ie.processing(),Te("PUT",ye(i==="start"?"/api/v1/recurring_invoices/:id?start=true":"/api/v1/recurring_invoices/:id?stop=true",{id:t.id}),t).then(()=>{hn(["recurring_invoices"]),e&&n.invalidateQueries([e]),ie.success(i==="start"?"started_recurring_invoice":"stopped_recurring_invoice")})}}function Jhr(n){const[e]=ue(),t=zpe(),i=ri(),r=zo(),o=vJt(),s=Ri(rU),{showEditAction:a,showCommonBulkActions:l}=n||{},{isEditPage:c}=Kw({entity:"recurring_invoice"}),u=h=>{s({...h,id:"",documents:[],number:""}),i("/recurring_invoices/create?action=clone")};return[h=>!!a&&f(et,{to:dt("/recurring_invoices/:id/edit",{id:h.id}),icon:f(Ve,{element:_3}),children:e("edit")}),()=>!!a&&f(Jn,{withoutPadding:!0}),h=>f(et,{to:dt("/recurring_invoices/:id/pdf",{id:h.id}),icon:f(Ve,{element:Rz}),children:e("view_pdf")}),h=>(h.status_id===K1.DRAFT||h.status_id===K1.PAUSED)&&f(et,{onClick:()=>o(h,"start"),icon:f(Ve,{element:Qhe}),children:e("start")}),h=>h.status_id===K1.ACTIVE&&f(et,{onClick:()=>o(h,"stop"),icon:f(Ve,{element:Jhe}),children:e("stop")}),h=>!h.is_deleted&&f(cJt,{selectedIds:[h.id]}),h=>!h.is_deleted&&f(uJt,{selectedIds:[h.id]}),h=>f(oU,{entity:"recurring_invoice",entityId:h.id,label:`#${h.number}`,labelElement:f(et,{icon:f(Ve,{element:Az}),children:e("add_comment")})}),()=>f(Jn,{withoutPadding:!0}),h=>r("create_recurring_invoice")&&f(et,{onClick:()=>u(h),icon:f(Ve,{element:tb}),children:e("clone_to_recurring")}),h=>f(dJt,{recurringInvoice:h}),()=>(c||!!l)&&f(Jn,{withoutPadding:!0}),h=>(c||!!l)&&nr(h)===Di.Active&&f(et,{onClick:()=>t([h.id],"archive"),icon:f(Ve,{element:Xl}),children:e("archive")}),h=>(c||!!l)&&(nr(h)===Di.Archived||nr(h)===Di.Deleted)&&f(et,{onClick:()=>t([h.id],"restore"),icon:f(Ve,{element:Ql}),children:e("restore")}),h=>(c||!!l)&&(nr(h)===Di.Active||nr(h)===Di.Archived)&&f(et,{onClick:()=>t([h.id],"delete"),icon:f(Ve,{element:Pa}),children:e("delete")})]}function efr({setErrors:n}){const e=ri(),t=Ri(Yw);return(i,r)=>{n(void 0),ie.processing();const o=r?`/api/v1/recurring_invoices?${r}=true`:"/api/v1/recurring_invoices";Te("POST",ye(o),i).then(s=>{ie.success("created_recurring_invoice"),hn(["recurring_invoices"]),e(dt("/recurring_invoices/:id/edit",{id:s.data.data.id}))}).catch(s=>{var a;if(((a=s.response)==null?void 0:a.status)===422){const l=s.response.data;l.errors.amount?ie.error(l.errors.amount[0]):ie.dismiss(),n(l)}}).finally(()=>t(void 0))}}const bJt=["status","number","client","amount","remaining_cycles","next_send_date","frequency","due_date_days","auto_bill"];function yJt(){const[n,e,t,i]=yf({entity:"invoice"});return["status","number","client","amount","remaining_cycles","next_send_date","frequency","due_date_days","auto_bill","archived_at","created_at",n,e,t,i,"discount","documents","entity_state","exchange_rate","is_deleted","po_number","private_notes","public_notes","updated_at"]}function tfr(){var p;const{t:n}=ue(),{dateFormat:e}=Il(),t=_Jt(),i=fA(),r=Gw();yJt();const o=bf(),s=sl(),a=Lk(),[l,c,u,d]=yf({entity:"invoice"}),h=[{column:"status",id:"status_id",label:n("status"),format:(m,_)=>f(sJt,{entity:_})},{column:"number",id:"number",label:n("number"),format:(m,_)=>f(jh,{to:dt("/recurring_invoices/:id/edit",{id:_.id}),renderSpan:r("recurring_invoice",_),children:m})},{column:"client",id:"client_id",label:n("client"),format:(m,_)=>{var v;return f(jh,{to:dt("/clients/:id",{id:_.client_id}),renderSpan:r("client",_.client),children:(v=_.client)==null?void 0:v.display_name})}},{column:"amount",id:"amount",label:n("amount"),format:(m,_)=>{var v,b;return o(m,(v=_.client)==null?void 0:v.country_id,(b=_.client)==null?void 0:b.settings.currency_id)}},{column:"remaining_cycles",id:"remaining_cycles",label:n("remaining_cycles"),format:m=>Number(m)<0?n("endless"):m},{column:"next_send_date",id:"next_send_datetime",label:n("next_send_date"),format:m=>t(m)},{column:"frequency",id:"frequency_id",label:n("frequency"),format:m=>f(aM,{for:aJt,code:m,headless:!0})},{column:"due_date_days",id:"due_date_days",label:n("due_date"),format:m=>m==="terms"?n("use_payment_terms"):Number(m)===1?n("first_day_of_the_month"):m},{column:"auto_bill",id:"auto_bill",label:n("auto_bill"),format:m=>n(String(m))},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:m=>Jr(m,e)},{column:"created_at",id:"created_at",label:n("created_at"),format:m=>Jr(m,e)},{column:l,id:"custom_value1",label:l,format:m=>a("invoice1",m==null?void 0:m.toString())},{column:c,id:"custom_value2",label:c,format:m=>a("invoice2",m==null?void 0:m.toString())},{column:u,id:"custom_value3",label:u,format:m=>a("invoice3",m==null?void 0:m.toString())},{column:d,id:"custom_value4",label:d,format:m=>a("invoice4",m==null?void 0:m.toString())},{column:"discount",id:"discount",label:n("discount"),format:(m,_)=>{var v,b;return _.is_amount_discount?o(m,(v=_.client)==null?void 0:v.country_id,(b=_.client)==null?void 0:b.settings.currency_id):`${i(m)} %`}},{column:"documents",id:"documents",label:n("documents"),format:(m,_)=>_.documents.length},{column:"entity_state",id:"id",label:n("entity_state"),format:(m,_)=>f(zp,{entity:_})},{column:"exchange_rate",id:"exchange_rate",label:n("exchange_rate"),format:m=>i(m)},{column:"is_deleted",id:"is_deleted",label:n("is_deleted"),format:m=>Jr(m,e)},{column:"po_number",id:"po_number",label:n("po_number")},{column:"public_notes",id:"public_notes",label:n("public_notes"),format:m=>f(du,{width:"auto",tooltipElement:f("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:f("article",{className:St("prose prose-sm",{"prose-invert":s.dark_mode}),dangerouslySetInnerHTML:{__html:pc(m)}})}),children:f("span",{children:ib(pc(m)).slice(0,50)})})},{column:"private_notes",id:"private_notes",label:n("private_notes"),format:m=>f(du,{width:"auto",tooltipElement:f("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:f("article",{className:St("prose prose-sm",{"prose-invert":s.dark_mode}),dangerouslySetInnerHTML:{__html:pc(m)}})}),children:f("span",{children:ib(pc(m)).slice(0,50)})})},{column:"updated_at",id:"updated_at",label:n("updated_at"),format:m=>Jr(m,e)}],g=((p=s==null?void 0:s.react_table_columns)==null?void 0:p.recurringInvoice)||bJt;return h.filter(m=>g.includes(m.column)).sort((m,_)=>g.indexOf(m.column)-g.indexOf(_.column))}function CJt(){const[n]=ue(),e=Ng();return[{label:n("active"),value:"active",color:"white",backgroundColor:e.$3||"#22C55E"},{label:n("paused"),value:"paused",color:"white",backgroundColor:e.$4||"#F97316"},{label:n("completed"),value:"completed",color:"white",backgroundColor:e.$1||"#93C5FD"}]}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function wJt(){const[n]=ue(),e=Ng();return[{label:n("pending"),value:"pending",color:"white",backgroundColor:"#6B7280"},{label:n("cancelled"),value:"cancelled",color:"white",backgroundColor:e.$4||"#93C5FD"},{label:n("failed"),value:"failed",color:"white",backgroundColor:e.$5||"#DC2626"},{label:n("completed"),value:"completed",color:"white",backgroundColor:e.$3||"#22C55E"},{label:n("partially_refunded"),value:"partially_refunded",color:"white",backgroundColor:e.$2||"#1D4ED8"},{label:n("refunded"),value:"refunded",color:"white",backgroundColor:"#6B7280"},{label:n("partially_unapplied"),value:"partially_unapplied",color:"white",backgroundColor:"#bf83cc"}]}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const SJt=po(void 0);var tWe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Co,function(){var t,i,r=1e3,o=6e4,s=36e5,a=864e5,l=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=31536e6,u=2628e6,d=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,h={years:c,months:u,days:a,hours:s,minutes:o,seconds:r,milliseconds:1,weeks:6048e5},g=function(k){return k instanceof C},p=function(k,I,L){return new C(k,L,I.$l)},m=function(k){return i.p(k)+"s"},_=function(k){return k<0},v=function(k){return _(k)?Math.ceil(k):Math.floor(k)},b=function(k){return Math.abs(k)},y=function(k,I){return k?_(k)?{negative:!0,format:""+b(k)+I}:{negative:!1,format:""+k+I}:{negative:!1,format:""}},C=function(){function k(L,D,R){var P=this;if(this.$d={},this.$l=R,L===void 0&&(this.$ms=0,this.parseFromMilliseconds()),D)return p(L*h[m(D)],this);if(typeof L=="number")return this.$ms=L,this.parseFromMilliseconds(),this;if(typeof L=="object")return Object.keys(L).forEach(function(B){P.$d[m(B)]=L[B]}),this.calMilliseconds(),this;if(typeof L=="string"){var M=L.match(d);if(M){var O=M.slice(2).map(function(B){return B!=null?Number(B):0});return this.$d.years=O[0],this.$d.months=O[1],this.$d.weeks=O[2],this.$d.days=O[3],this.$d.hours=O[4],this.$d.minutes=O[5],this.$d.seconds=O[6],this.calMilliseconds(),this}}return this}var I=k.prototype;return I.calMilliseconds=function(){var L=this;this.$ms=Object.keys(this.$d).reduce(function(D,R){return D+(L.$d[R]||0)*h[R]},0)},I.parseFromMilliseconds=function(){var L=this.$ms;this.$d.years=v(L/c),L%=c,this.$d.months=v(L/u),L%=u,this.$d.days=v(L/a),L%=a,this.$d.hours=v(L/s),L%=s,this.$d.minutes=v(L/o),L%=o,this.$d.seconds=v(L/r),L%=r,this.$d.milliseconds=L},I.toISOString=function(){var L=y(this.$d.years,"Y"),D=y(this.$d.months,"M"),R=+this.$d.days||0;this.$d.weeks&&(R+=7*this.$d.weeks);var P=y(R,"D"),M=y(this.$d.hours,"H"),O=y(this.$d.minutes,"M"),B=this.$d.seconds||0;this.$d.milliseconds&&(B+=this.$d.milliseconds/1e3,B=Math.round(1e3*B)/1e3);var F=y(B,"S"),H=L.negative||D.negative||P.negative||M.negative||O.negative||F.negative,V=M.format||O.format||F.format?"T":"",$=(H?"-":"")+"P"+L.format+D.format+P.format+V+M.format+O.format+F.format;return $==="P"||$==="-P"?"P0D":$},I.toJSON=function(){return this.toISOString()},I.format=function(L){var D=L||"YYYY-MM-DDTHH:mm:ss",R={Y:this.$d.years,YY:i.s(this.$d.years,2,"0"),YYYY:i.s(this.$d.years,4,"0"),M:this.$d.months,MM:i.s(this.$d.months,2,"0"),D:this.$d.days,DD:i.s(this.$d.days,2,"0"),H:this.$d.hours,HH:i.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:i.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:i.s(this.$d.seconds,2,"0"),SSS:i.s(this.$d.milliseconds,3,"0")};return D.replace(l,function(P,M){return M||String(R[P])})},I.as=function(L){return this.$ms/h[m(L)]},I.get=function(L){var D=this.$ms,R=m(L);return R==="milliseconds"?D%=1e3:D=R==="weeks"?v(D/h[R]):this.$d[R],D||0},I.add=function(L,D,R){var P;return P=D?L*h[m(D)]:g(L)?L.$ms:p(L,this).$ms,p(this.$ms+P*(R?-1:1),this)},I.subtract=function(L,D){return this.add(L,D,!0)},I.locale=function(L){var D=this.clone();return D.$l=L,D},I.clone=function(){return p(this.$ms,this)},I.humanize=function(L){return t().add(this.$ms,"ms").locale(this.$l).fromNow(!L)},I.valueOf=function(){return this.asMilliseconds()},I.milliseconds=function(){return this.get("milliseconds")},I.asMilliseconds=function(){return this.as("milliseconds")},I.seconds=function(){return this.get("seconds")},I.asSeconds=function(){return this.as("seconds")},I.minutes=function(){return this.get("minutes")},I.asMinutes=function(){return this.as("minutes")},I.hours=function(){return this.get("hours")},I.asHours=function(){return this.as("hours")},I.days=function(){return this.get("days")},I.asDays=function(){return this.as("days")},I.weeks=function(){return this.get("weeks")},I.asWeeks=function(){return this.as("weeks")},I.months=function(){return this.get("months")},I.asMonths=function(){return this.as("months")},I.years=function(){return this.get("years")},I.asYears=function(){return this.as("years")},k}(),x=function(k,I,L){return k.add(I.years()*L,"y").add(I.months()*L,"M").add(I.days()*L,"d").add(I.hours()*L,"h").add(I.minutes()*L,"m").add(I.seconds()*L,"s").add(I.milliseconds()*L,"ms")};return function(k,I,L){t=L,i=L().$utils(),L.duration=function(P,M){var O=L.locale();return p(P,{$l:O},M)},L.isDuration=g;var D=I.prototype.add,R=I.prototype.subtract;I.prototype.add=function(P,M){return g(P)?x(this,P,1):D.bind(this)(P,M)},I.prototype.subtract=function(P,M){return g(P)?x(this,P,-1):R.bind(this)(P,M)}}})})(tWe);var EJt=tWe.exports;const xJt=ja(EJt);var nWe={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(Co,function(){return function(t,i,r){t=t||{};var o=i.prototype,s={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(c,u,d,h){return o.fromToBase(c,u,d,h)}r.en.relativeTime=s,o.fromToBase=function(c,u,d,h,g){for(var p,m,_,v=d.$locale().relativeTime||s,b=t.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],y=b.length,C=0;C<y;C+=1){var x=b[C];x.d&&(p=h?r(c).diff(d,x.d,!0):d.diff(c,x.d,!0));var k=(t.rounding||Math.round)(Math.abs(p));if(_=p>0,k<=x.r||!x.r){k<=1&&C>0&&(x=b[C-1]);var I=v[x.l];g&&(k=g(""+k)),m=typeof I=="string"?I.replace("%d",k):I(k,u,x.l,_);break}}if(u)return m;var L=_?v.future:v.past;return typeof L=="function"?L(m):L.replace("%s",m)},o.to=function(c,u){return a(c,u,this,!0)},o.from=function(c,u){return a(c,u,this)};var l=function(c){return c.$u?r.utc():r()};o.toNow=function(c){return this.to(l(this),c)},o.fromNow=function(c){return this.from(l(this),c)}}})})(nWe);var kJt=nWe.exports;const TJt=ja(kJt);/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Up(n){if(n===""||n==="[]")return[];const e=[[0,0,"",!0]],t=JSON.parse(n);return t.length?t:e}function IJt(n,e=!1){const t=Up(n);let i=0;for(const[a,l]of t){if(a>l&&!e)continue;const u=(l!==0?l:Math.floor(Date.now()/1e3))-a;i+=Math.max(u,0)}const r=Math.floor(i/3600),o=Math.floor(i%3600/60),s=i%60;return r<24?`${r}:${o.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`:`${r}h`}function nfr(n,e){const t=Up(n);Cn.extend(xJt),Cn.extend(TJt);let i=0;if(e!=null&&e.calculateLastTimeLog){const r=t.length-1,o=t[r][0],s=o?Cn.unix(o):Cn();i+=Cn().diff(s,"seconds")}else t.map(([r,o])=>{const s=r?Cn.unix(r):Cn(),a=o?Cn.unix(o):Cn();i+=a.diff(s,"seconds")});return e!=null&&e.inSeconds?i.toString():i>86400?Cn.duration(i,"seconds").humanize():Cn.duration(i,"seconds").format("HH:mm:ss")}function ifr(n,e){const i=Up(n)[e],r=i?Cn.unix(i[0]):Cn(),s=(i?Cn.unix(i[1]):Cn()).diff(r,"seconds");return new Date(s*1e3).toISOString().slice(11,19)}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function iWe(n){const{isAdmin:e}=ao();return ai(["/api/v1/task_statuses","create"],()=>Te("GET",ye("/api/v1/task_statuses/create")).then(t=>t.data.data),{staleTime:1/0,enabled:e?(n==null?void 0:n.enabled)??!0:!1})}function rWe(n){return ai(["/api/v1/task_statuses",n],()=>Te("GET",ye("/api/v1/task_statuses?status=:status",{status:(n==null?void 0:n.status)||"all"})).then(e=>e.data),{staleTime:1/0})}function LJt(n){return ai(["/api/v1/task_statuses",n.id],()=>Te("GET",ye("/api/v1/task_statuses/:id",{id:n.id})),{staleTime:1/0})}function DJt(){return(n,e)=>{ie.processing(),Te("POST",ye("/api/v1/task_statuses/bulk"),{action:e,ids:[n]}).then(()=>{ie.success(`${e}d_task_status`),hn(["task_statuses"])})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function oWe(n){let e=!1;const i=Up(n.time_log).sort((o,s)=>o[0]-s[0]);let r=0;return i.forEach(([o,s],a)=>{const l=i[a+1];s==0&&l&&(e=!0),l&&s>l[0]&&(e=!0),s!==0&&o>s&&(e=!0),s===0&&r++,r>1&&(e=!0)}),e}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function AJt(n){const{isFormBusy:e,setErrors:t,setIsFormBusy:i}=n;return r=>{if(!e){if(i(!0),ie.processing(),oWe(r))return i(!1),ie.error("task_errors");Te("PUT",ye("/api/v1/tasks/:id",{id:r.id}),r).then(()=>{ie.success("updated_task"),hn(["tasks"])}).catch(o=>{var s;((s=o.response)==null?void 0:s.status)===422&&(ie.dismiss(),t==null||t(o.response.data))}).finally(()=>i(!1))}}}function jpe(n){return(e,t)=>{n.setErrors(void 0),n.setTaskStatus(i=>i&&{...i,[e]:t})}}function RJt(){const[n]=ue(),e=DJt();return[i=>i.archived_at===0&&f(et,{onClick:()=>e(i.id,"archive"),icon:f(Ve,{element:Xl}),children:n("archive")}),i=>i.archived_at>0&&f(et,{onClick:()=>e(i.id,"restore"),icon:f(Ve,{element:Ql}),children:n("restore")}),i=>!i.is_deleted&&f(et,{onClick:()=>e(i.id,"delete"),icon:f(Ve,{element:Pa}),children:n("delete")})]}function NJt(n){const[e]=ue(),t=ys(),{data:i}=iWe(),[r,o]=w.useState(),[s,a]=w.useState(!1),[l,c]=w.useState(),u=jpe({setErrors:o,setTaskStatus:c}),d=()=>{s||(ie.processing(),o(void 0),a(!0),Te("POST",ye("/api/v1/task_statuses"),l).then(h=>{var g;ie.success("created_task_status"),hn(["task_statuses"]),c(i),(g=n.onCreatedTaskStatus)==null||g.call(n,h.data.data),n.setVisible(!1)}).catch(h=>{var g;((g=h.response)==null?void 0:g.status)===422&&(o(h.response.data),ie.dismiss())}).finally(()=>a(!1)))};return w.useEffect(()=>{i&&c(i)},[i]),N(cr,{title:e("new_task_status"),visible:n.visible,onClose:()=>{n.setVisible(!1),c(i)},children:[f(ke,{required:!0,label:e("name"),value:l==null?void 0:l.name,onValueChange:h=>u("name",h),errorMessage:r==null?void 0:r.errors.name}),f($p,{children:e("color")}),f(Tk,{value:(l==null?void 0:l.color)||t,onValueChange:h=>u("color",h)}),f(Ut,{className:"self-end",behavior:"button",disabled:s,onClick:d,children:e("save")})]})}function jTe(n){const[e]=ue(),t=Vn(),{isAdmin:i,isOwner:r}=ao(),{visible:o,isFormBusy:s,setIsFormBusy:a,task:l,setVisible:c}=n,[u,d]=w.useState(!1),{data:h}=rWe({status:"active"}),g=AJt({isFormBusy:s,setIsFormBusy:a});return N(_t,{children:[f(A3,{placement:"bottom",interactive:!0,render:()=>N("div",{className:"border box rounded-md shadow-lg focus:outline-none",style:{backgroundColor:t.$1,borderColor:t.$4,minWidth:"12rem",maxWidth:"14.7rem"},children:[(i||r)&&f(et,{className:"font-medium text-center py-3",onClick:()=>{d(!0),c(!1)},children:e("new_task_status")}),h==null?void 0:h.data.map((p,m)=>p.id!==l.status_id&&f(et,{onClick:()=>{c(!1),g({...l,status_id:p.id})},children:p.name},m)),!(h!=null&&h.data.length)&&f("div",{className:"font-medium text-center py-2 text-xs",children:e("no_records_found")})]}),visible:o,children:f("div",{})}),f(NJt,{visible:u,setVisible:d,onCreatedTaskStatus:p=>g({...l,status_id:p.id})})]})}function OJt(n){const[e]=ue(),t=w.useRef(null),i=oj(),r=Ng(),{invoice_id:o,archived_at:s,is_deleted:a,time_log:l,status:c}=n.entity,[u,d]=w.useState(!1),[h,g]=w.useState(!1);Bw(t,()=>{u&&d(!1)});const p=()=>{const m=Up(l),_=m.length;return _?m[_-1][1]===0:!1};if(a)return f(Gi,{variant:"red",children:e("deleted")});if(s)return f(Gi,{variant:"orange",children:e("archived")});if(o)return f(Gi,{variant:"green",style:{backgroundColor:r.$3},children:e("invoiced")});if(p())return f(Gi,{variant:"light-blue",style:{backgroundColor:r.$2},children:e("running")});if(c){const{red:m,green:_,blue:v,hex:b}=R3(c.color),y=rj(m,_,v)?-220:220;return N("div",{ref:t,onClick:C=>C.stopPropagation(),children:[f(du,{width:"auto",message:e("change_status"),withoutArrow:!0,placement:"bottom",children:f(aM,{for:{},code:c.name,style:{color:i(b,y),backgroundColor:c.color},onClick:()=>!h&&d(C=>!C)})}),f(jTe,{visible:u,isFormBusy:h,setIsFormBusy:g,task:n.entity,setVisible:d})]})}return N("div",{ref:t,onClick:m=>m.stopPropagation(),children:[f(du,{width:"auto",message:e("change_status"),withoutArrow:!0,placement:"bottom",children:f(aM,{for:{},code:"logged",onClick:()=>!h&&d(m=>!m)})}),f(jTe,{visible:u,isFormBusy:h,setIsFormBusy:g,task:n.entity,setVisible:d})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Ny(n){let e=!1;return Up(n.time_log).forEach(([,t])=>{t===0&&(e=!0)}),e}function PJt(n){return n.invoice_id?"invoiced":Ny(n)?"active":"logged"}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function sWe(){const[n]=ue(),e=ri(),t=vi(),{dateFormat:i}=Il(),{timeFormat:r}=sU(),{data:o}=tU(),[,s]=Mo(D0),a=fA(),l=c=>{const u=Up(c);let d=0;return u.length&&u.forEach(([h,g,,p])=>{if(p||!(t!=null&&t.settings.allow_billable_task_items)||typeof p>"u"){const m=Cn.unix(h),_=Cn.unix(g);d+=_.diff(m,"seconds")/3600,d=Number(d.toFixed(4))}}),d};return async c=>{var u,d,h,g,p,m,_,v,b;if(o){const y={...o};if(t&&t.enabled_tax_rates>0&&(y.tax_name1=(u=t.settings)==null?void 0:u.tax_name1,y.tax_rate1=(d=t.settings)==null?void 0:d.tax_rate1),t&&t.enabled_tax_rates>1&&(y.tax_name2=(h=t.settings)==null?void 0:h.tax_name2,y.tax_rate2=(g=t.settings)==null?void 0:g.tax_rate2),t&&t.enabled_tax_rates>2&&(y.tax_name3=(p=t.settings)==null?void 0:p.tax_name3,y.tax_rate3=(m=t.settings)==null?void 0:m.tax_rate3),y.uses_inclusive_taxes=((_=t==null?void 0:t.settings)==null?void 0:_.inclusive_taxes)??!1,Wa(c).pluck("client_id").unique().toArray().length>1)return ie.error("multiple_client_error");y.client_id=c[0].client_id,(v=c[0])!=null&&v.project_id&&(y.project_id=(b=c[0])==null?void 0:b.project_id),c.forEach(x=>{var P,M;const k=Up(x.time_log),I=[];k.forEach(([O,B,F,H])=>{if(H||!(t!=null&&t.settings.allow_billable_task_items)||typeof H>"u"){let V="";if(t.invoice_task_hours){const j=Cn.unix(O),ne=(Cn.unix(B).diff(j,"seconds")/3600).toFixed(4);V=`• ${a(ne)} ${n("hours")}`}const $=[];(t.invoice_task_datelog||t.invoice_task_timelog)&&$.push('<div class="task-time-details">'),t.invoice_task_datelog&&$.push(Cn.unix(O).format(i)),t.invoice_task_timelog&&$.push(Cn.unix(O).format(r)+" - "),t.invoice_task_timelog&&$.push(Cn.unix(B).format(r)),t.invoice_task_hours&&$.push(V),t.invoice_task_item_description&&$.push(F),(t.invoice_task_datelog||t.invoice_task_timelog)&&$.push(`</div>
`),I.push($.join(" "))}});const L=l(x.time_log),D={...A0(),type_id:y_.Task,cost:x.rate,quantity:L,line_total:Number((x.rate*L).toFixed(2)),task_id:x.id,tax_id:"",custom_value1:x.custom_value1,custom_value2:x.custom_value2,custom_value3:x.custom_value3,custom_value4:x.custom_value4},R=t.invoice_task_project&&((P=x==null?void 0:x.project)!=null&&P.name)?"## "+((M=x.project)==null?void 0:M.name)+`
`:"";I.length&&(D.notes=R+(x==null?void 0:x.description)+" "+I.join(" ")),typeof y.line_items=="string"&&(y.line_items=[]),y.line_items.push(D)}),s(y),e(dt("/invoices/create?table=tasks&project=:projectAssigned&action=invoice_task",{projectAssigned:!!c[0].project_id}))}}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function MJt(){const n=Kr(),e=ki(Hc),t=ol();return i=>{ie.processing(),Te("PUT",ye("/api/v1/tasks/:id?start=true",{id:i.id}),i).then(()=>{t.pathname.endsWith("/create")?ie.dismiss():ie.success("started_task"),hn(["tasks"]),e&&n.invalidateQueries([e])})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function FJt(){const n=Kr(),e=ki(Hc);return t=>{ie.processing();const i=Up(t.time_log),r=i[i.length-1][0],o=Cn().unix();if(r&&r>o)i[i.length-1][1]=r+1,t.time_log=JSON.stringify(i);else if(oWe(t))return ie.error("task_errors");Te("PUT",ye("/api/v1/tasks/:id?stop=true",{id:t.id}),t).then(()=>{ie.success("stopped_task"),hn(["tasks"]),e&&n.invalidateQueries([e])})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function rfr(n){return ai(["/api/v1/tasks",n.id],()=>Te("GET",ye("/api/v1/tasks/:id?include=status",{id:n.id})).then(e=>e.data.data),{staleTime:1/0,enabled:n.enabled??!0})}function ofr(n){const e=zo();return ai(["/api/v1/tasks/create"],()=>Te("GET",ye("/api/v1/tasks/create")).then(t=>t.data.data),{...n,staleTime:1/0,enabled:e("create_task")?(n==null?void 0:n.enabled)??!0:!1})}function sfr(n){return ai(["/api/v1/tasks",n],()=>Te("GET",ye(":endpoint",{endpoint:n.endpoint||"/api/v1/tasks"})).then(e=>e.data),{staleTime:1/0})}const aWe=()=>{const n=Kr(),e=ki(Hc);return(t,i)=>{ie.processing(),Te("POST",ye("/api/v1/tasks/bulk"),{action:i,ids:t}).then(()=>{i!=="start"&&i!=="stop"&&ie.success(`${i}d_task`),i==="start"&&ie.success(Ds("started_tasks",{value:t.length})),i==="stop"&&ie.success(Ds("stopped_tasks",{value:t.length})),e&&n.invalidateQueries([e]),hn(["tasks"])})}};/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const lWe=n=>{const e=Up(n);let t=0;return e.length&&e.forEach(([i,r])=>{if(i&&r){const o=Cn.unix(i),s=Cn.unix(r);t+=Number((s.diff(o,"seconds")/3600).toFixed(4))}}),t};function afr(){const[n]=ue(),e=ri(),t=vi(),{dateFormat:i}=Il(),{timeFormat:r}=sU(),{data:o}=tU(),s=Ri(D0);return a=>{var l,c,u,d,h,g;if(o){const p={...o};if(t&&t.enabled_tax_rates>0&&(p.tax_name1=(l=t.settings)==null?void 0:l.tax_name1,p.tax_rate1=(c=t.settings)==null?void 0:c.tax_rate1),t&&t.enabled_tax_rates>1&&(p.tax_name2=(u=t.settings)==null?void 0:u.tax_name2,p.tax_rate2=(d=t.settings)==null?void 0:d.tax_rate2),t&&t.enabled_tax_rates>2&&(p.tax_name3=(h=t.settings)==null?void 0:h.tax_name3,p.tax_rate3=(g=t.settings)==null?void 0:g.tax_rate3),Wa(a).pluck("client_id").unique().toArray().length>1)return ie.error("multiple_client_error");p.client_id=a.length?a[0].client_id:"",p.line_items=[],a.forEach(_=>{var k,I;const v=Up(_.time_log),b=[];v.forEach(([L,D,R,P])=>{if(P||!(t!=null&&t.settings.allow_billable_task_items)||typeof P>"u"){let M="";if(t.invoice_task_hours){const B=Cn.unix(L);M=`• ${(Cn.unix(D).diff(B,"seconds")/3600).toFixed(4)} ${n("hours")}`}const O=[];(t.invoice_task_datelog||t.invoice_task_timelog)&&O.push('<div class="task-time-details">'),t.invoice_task_datelog&&O.push(Cn.unix(L).format(i)),t.invoice_task_timelog&&O.push(Cn.unix(L).format(r)+" - "),t.invoice_task_timelog&&O.push(Cn.unix(D).format(r)),t.invoice_task_hours&&O.push(M),t.invoice_task_item_description&&O.push(R),(t.invoice_task_datelog||t.invoice_task_timelog)&&O.push(`</div>
`),b.push(O.join(" "))}});const y=lWe(_.time_log),C={...A0(),type_id:y_.Task,cost:_.rate,quantity:y,line_total:Number((_.rate*y).toFixed(2)),task_id:_.id,tax_id:""},x=(k=_==null?void 0:_.project)!=null&&k.name?"## "+((I=_.project)==null?void 0:I.name)+`
`:"";b.length&&(C.notes=x+(_==null?void 0:_.description)+" "+b.join(" ")),typeof p.line_items=="string"&&(p.line_items=[]),p.line_items.push(C)}),s(p),e(dt("/invoices/create?table=tasks&project=true&action=invoice_project"))}}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function BJt(n){const[e]=ue(),t=ri(),{tasks:i}=n,r=vi(),{dateFormat:o}=Il(),{timeFormat:s}=sU(),a=Ri(D0);return l=>{const c=Bn.cloneDeep(l);i&&(i.forEach(u=>{var _,v;const d=Up(u.time_log),h=[];d.forEach(([b,y,C,x])=>{if(x||!(r!=null&&r.settings.allow_billable_task_items)||typeof x>"u"){let k="";if(r.invoice_task_hours){const L=Cn.unix(b);k=`• ${(Cn.unix(y).diff(L,"seconds")/3600).toFixed(4)} ${e("hours")}`}const I=[];(r.invoice_task_datelog||r.invoice_task_timelog)&&I.push('<div class="task-time-details">'),r.invoice_task_datelog&&I.push(Cn.unix(b).format(o)),r.invoice_task_timelog&&I.push(Cn.unix(b).format(s)+" - "),r.invoice_task_timelog&&I.push(Cn.unix(y).format(s)),r.invoice_task_hours&&I.push(k),r.invoice_task_item_description&&I.push(C),(r.invoice_task_datelog||r.invoice_task_timelog)&&I.push(`</div>
`),h.push(I.join(" "))}});const g=lWe(u.time_log),p={...A0(),type_id:y_.Task,cost:u.rate,quantity:g,line_total:Number((u.rate*g).toFixed(2)),task_id:u.id,tax_id:"",custom_value1:u.custom_value1,custom_value2:u.custom_value2,custom_value3:u.custom_value3,custom_value4:u.custom_value4},m=r.invoice_task_project&&((_=u==null?void 0:u.project)!=null&&_.name)?"## "+((v=u.project)==null?void 0:v.name)+`
`:"";h.length&&(p.notes=m+(u==null?void 0:u.description)+" "+h.join(" ")),typeof c.line_items=="string"&&(c.line_items=[]),c.line_items.push(p)}),a(c),t(dt("/invoices/:id/edit?action=add_tasks&table=tasks",{id:c.id})))}}function $Jt(n){const{visible:e,setVisible:t,tasks:i,invoices:r}=n,o=bf(),s=BJt({tasks:i});return f(cr,{title:Ds("add_to_invoice",{invoice:""}),visible:e,onClose:()=>t(!1),children:f("div",{className:"flex flex-col overflow-y-auto max-h-96",children:r==null?void 0:r.map((a,l)=>{var c,u;return N("div",{className:"flex justify-between py-2 cursor-pointer hover:bg-gray-100 px-3",onClick:()=>s(a),children:[f("span",{children:a.number}),f("span",{children:o(a.amount,(c=a.client)==null?void 0:c.country_id,(u=a.client)==null?void 0:u.settings.currency_id)})]},l)})})})}function cWe(n){const{tasks:e,isBulkAction:t,setSelected:i}=n,r=Kr(),o=zo(),s=Zj(),[a,l]=w.useState(!1),[c,u]=w.useState([]),d=()=>{if(!e.length)return ie.error("no_invoices_found");const h=e.map(p=>p.client_id);if(h.some(p=>!p))return ie.error("no_invoices_found");if(h.length){const p=h[0];if(h.some(_=>_!==p))return ie.error("multiple_client_error")}ie.processing(),r.fetchQuery(["/api/v1/invoices","client_id",e[0].client_id],()=>Te("GET",ye("/api/v1/invoices?client_id=:clientId&include=client&status=active&per_page=100",{clientId:e[0].client_id})),{staleTime:1/0}).then(p=>{if(ie.dismiss(),!p.data.data.length)return ie.error("no_invoices_found");o("edit_invoice")?u(p.data.data):u(p.data.data.filter(m=>s(m))),l(!0)})};return w.useEffect(()=>{!a&&(i==null||i([]))},[a]),(e.length&&e[0].client_id&&!e[0].invoice_id||t)&&(o("create_invoice")||o("edit_invoice"))?N(_t,{children:[f($Jt,{visible:a,setVisible:l,tasks:e,invoices:c}),f(et,{onClick:d,icon:f(Ve,{element:syt}),children:Ds("add_to_invoice",{invoice:""})})]}):f(_t,{})}const VJt=["status","number","client","description","duration","entity_state"];function HJt(){const[n,e,t,i]=yf({entity:"task"});return["status","number","client","project","description","duration","entity_state","archived_at","calculated_rate","created_at",n,e,t,i,"date","documents","is_deleted","is_invoiced","is_running","rate","updated_at","user","assigned_user"]}function lfr(){var v;const{t:n}=ue(),{dateFormat:e}=Il(),t=ys(),i=zo(),r=Gw(),o=Lk(),s=vi(),a=sl(),l=ri(),c=bf();HJt();const u=b=>{const y=(b==null?void 0:b.first_name)??"",C=(b==null?void 0:b.last_name)??"";return y.length===0&&C.length===0?(b==null?void 0:b.email)??"Unknown User":`${y} ${C}`},[d,h,g,p]=yf({entity:"task"}),m=[{column:"project",id:"project_id",label:n("project"),format:(b,y)=>{var C,x;return f(Bpe,{entityId:y.project_id,cacheEndpoint:"/api/v1/projects",apiEndpoint:"/api/v1/projects/:id",preCheck:i("view_project")||i("edit_project"),component:f(Ii,{to:dt("/projects/:id",{id:(C=y==null?void 0:y.project)==null?void 0:C.id}),children:(x=y==null?void 0:y.project)==null?void 0:x.name})})}},{column:"status",id:"status_id",label:n("status"),format:(b,y)=>N("div",{className:"flex items-center space-x-2",children:[f(OJt,{entity:y}),y.invoice_id&&f(du,{width:"auto",message:n("view_invoice"),withoutArrow:!0,placement:"bottom",children:f(mk,{className:"cursor-pointer",fontSize:19,color:t,onClick:()=>l(dt("/invoices/:id/edit",{id:y.invoice_id}))})})]})},{column:"number",id:"number",label:n("number"),format:(b,y)=>f(jh,{to:dt("/tasks/:id/edit",{id:y.id}),renderSpan:r("task",y),children:b})},{column:"client",id:"client_id",label:n("client"),format:(b,y)=>y.client&&f(jh,{to:dt("/clients/:id",{id:b.toString()}),renderSpan:r("client",y.client),children:y.client.display_name})},{column:"description",id:"description",label:n("description"),format:b=>f(du,{width:"auto",tooltipElement:f("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:f("article",{className:St("prose prose-sm",{"prose-invert":a.dark_mode}),dangerouslySetInnerHTML:{__html:pc(b)}})}),children:f("span",{children:ib(pc(b)).slice(0,50)})})},{column:"duration",id:"time_log",label:n("duration"),format:b=>IJt(b.toString(),!0)},{column:"entity_state",id:"id",label:n("entity_state"),format:(b,y)=>n(PJt(y))},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:b=>Jr(b,e)},{column:"calculated_rate",id:"rate",label:n("calculated_rate"),format:(b,y)=>{var C,x;return c(y.rate||s.settings.default_task_rate,(C=y.client)==null?void 0:C.country_id,(x=y.client)==null?void 0:x.settings.currency_id)}},{column:"created_at",id:"created_at",label:n("created_at"),format:b=>Jr(b,e)},{column:d,id:"custom_value1",label:d,format:b=>o("task1",b==null?void 0:b.toString())},{column:h,id:"custom_value2",label:h,format:b=>o("task2",b==null?void 0:b.toString())},{column:g,id:"custom_value3",label:g,format:b=>o("task3",b==null?void 0:b.toString())},{column:p,id:"custom_value4",label:p,format:b=>o("task4",b==null?void 0:b.toString())},{column:"date",id:"calculated_start_date",label:n("date"),format:(b,y)=>Jr(y.date,e)},{column:"documents",id:"documents",label:n("documents"),format:(b,y)=>y.documents.length},{column:"is_deleted",id:"is_deleted",label:n("is_deleted"),format:(b,y)=>y.is_deleted?n("yes"):n("no")},{column:"is_invoiced",id:"invoice_id",label:n("is_invoiced"),format:(b,y)=>y.invoice_id?n("yes"):n("no")},{column:"is_running",id:"is_running",label:n("is_running"),format:(b,y)=>Ny(y)?n("yes"):n("no")},{column:"rate",id:"rate",label:n("rate"),format:(b,y)=>{var C,x;return c(b,(C=y.client)==null?void 0:C.country_id,(x=y.client)==null?void 0:x.settings.currency_id)}},{column:"updated_at",id:"updated_at",label:n("updated_at"),format:b=>Jr(b,e)},{column:"user",id:"user_id",label:n("user"),format:(b,y)=>u(y==null?void 0:y.user)},{column:"assigned_user",id:"assigned_user_id",label:n("assigned_user"),format:(b,y)=>y!=null&&y.assigned_user?u(y==null?void 0:y.assigned_user):""}],_=((v=a==null?void 0:a.react_table_columns)==null?void 0:v.task)||VJt;return m.filter(b=>_.includes(b.column)).sort((b,y)=>_.indexOf(b.column)-_.indexOf(y.column))}function cfr(){return n=>{Te("PUT",ye("/api/v1/tasks/:id",{id:n.id}),n).then(()=>{ie.success("updated_task"),hn(["tasks"])})}}function WJt(){const[n]=ue(),e=oj(),t=Ng(),{data:i}=rWe({status:"active"}),r=[{label:n("invoiced"),value:"invoiced",color:"white",backgroundColor:t.$3||"#22C55E"},{label:n("uninvoiced"),value:"uninvoiced",color:"white",backgroundColor:t.$4||"#F87171"}];return i==null||i.data.forEach(o=>{const{red:s,green:a,blue:l,hex:c}=R3(o.color),u=rj(s,a,l)?-220:220;r.push({label:o.name,value:o.id,color:e(c,u),backgroundColor:o.color,queryKey:"task_status"})}),r}function ufr(n){const[e]=ue(),t=ri(),i=zo(),{showCommonBulkAction:r,showEditAction:o}=n||{},{isEditPage:s}=Kw({entity:"task",editPageTabs:["documents"]}),a=MJt(),l=FJt(),c=aWe(),u=sWe(),d=Ri(SJt),h=v=>{d({...v,id:"",documents:[],number:"",invoice_id:""}),t("/tasks/create?action=clone")},{setChangeTemplateResources:g,setChangeTemplateVisible:p,setChangeTemplateEntityContext:m}=gA();return[v=>!!o&&f(et,{to:dt("/tasks/:id/edit",{id:v.id}),icon:f(Ve,{element:_3}),children:e("edit")}),()=>!!o&&f(Jn,{withoutPadding:!0}),v=>!Ny(v)&&!v.invoice_id&&f(et,{onClick:()=>a(v),icon:f(Ve,{element:Qhe}),children:e("start")}),v=>Ny(v)&&!v.invoice_id&&f(et,{onClick:()=>l(v),icon:f(Ve,{element:Jhe}),children:e("stop")}),v=>!Ny(v)&&!v.invoice_id&&i("create_invoice")&&f(et,{onClick:()=>u([v]),icon:f(Ve,{element:mk}),children:e("invoice_task")}),v=>f(cWe,{tasks:[v]}),v=>i("create_task")&&f(et,{onClick:()=>h(v),icon:f(Ve,{element:tb}),children:e("clone")}),v=>f(et,{onClick:()=>{p(!0),g([v]),m({endpoint:"/api/v1/tasks/bulk",entity:"task"})},icon:f(Ve,{element:K2}),children:e("run_template")}),()=>(s||!!r)&&f(Jn,{withoutPadding:!0}),v=>(s||!!r)&&nr(v)===Di.Active&&f(et,{onClick:()=>c([v.id],"archive"),icon:f(Ve,{element:Xl}),children:e("archive")}),v=>(s||!!r)&&(nr(v)===Di.Archived||nr(v)===Di.Deleted)&&f(et,{onClick:()=>c([v.id],"restore"),icon:f(Ve,{element:Ql}),children:e("restore")}),v=>(s||!!r)&&(nr(v)===Di.Active||nr(v)===Di.Archived)&&f(et,{onClick:()=>c([v.id],"delete"),icon:f(Ve,{element:Pa}),children:e("delete")})]}const dfr=()=>{const[n]=ue(),e=sWe(),t=aWe(),i=zo(),r=z8e(),o=_=>_.some(({documents:v})=>v.length),s=_=>_.flatMap(({documents:v})=>v.map(({id:b})=>b)),a=_=>_.every(v=>!Ny(v)&&!v.invoice_id),l=_=>_.every(v=>Ny(v)&&!v.invoice_id),c=_=>_.every(v=>!Ny(v)&&!v.invoice_id),u=_=>_.every(v=>!Ny(v)&&!v.invoice_id&&v.client_id),d=(_,v)=>{const b=s(_);r(b,"download"),v==null||v([])},{setChangeTemplateVisible:h,setChangeTemplateResources:g,setChangeTemplateEntityContext:p}=gA();return[({selectedIds:_,selectedResources:v,setSelected:b})=>v&&a(v)&&f(et,{onClick:()=>{t(_,"start"),b([])},icon:f(Ve,{element:Qhe}),children:n("start")}),({selectedIds:_,selectedResources:v,setSelected:b})=>v&&l(v)&&f(et,{onClick:()=>{t(_,"stop"),b([])},icon:f(Ve,{element:Jhe}),children:n("stop")}),({selectedResources:_,setSelected:v})=>_&&u(_)&&f(cWe,{tasks:_,isBulkAction:!0,setSelected:v}),({selectedResources:_,setSelected:v})=>_&&c(_)&&i("create_invoice")?f(et,{onClick:()=>{e(_),v([])},icon:f(Ve,{element:mk}),children:n("invoice_task")}):null,({selectedResources:_,setSelected:v})=>f(et,{onClick:()=>_&&o(_)?d(_,v):ie.error("no_documents_to_download"),icon:f(Ve,{element:XC}),children:n("documents")}),({selectedResources:_})=>f(et,{onClick:()=>{h(!0),g(_),p({endpoint:"/api/v1/tasks/bulk",entity:"task"})},icon:f(Ve,{element:K2}),children:n("run_template")})]};function uWe(n){const[e]=ue(),{value:t,onValueChange:i,errorMessage:r,report:o}=n,s=Ik(),a=WJt(),l=oJt(),c=_Xt(),u=wJt(),d=mXt(),h=ZXt(),g=GZt(),p=CJt(),[m,_]=w.useState([]),v=b=>b.map(y=>y.value).join(",");return w.useEffect(()=>{(o==="invoice"||o==="invoice_item")&&_(d),o==="credit"&&_(c),o==="expense"&&_(h),(o==="purchase_order"||o==="purchase_order_item")&&_(g),(o==="quote"||o==="quote_item")&&_(l),o==="recurring_invoice"&&_(p),o==="payment"&&_(u),o==="task"&&_(a)},[o]),N(_t,{children:[f(b_,{id:"statusSelector",styles:s,...t&&{value:m.filter(b=>t.split(",").find(y=>b.value===y))},onChange:b=>i(v(b)),placeholder:e("status"),options:m,isMulti:!0}),r&&f(bs,{className:"mt-2",type:"danger",children:r})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function dWe(){return[{identifier:"activity",label:"activity",endpoint:"/api/v1/reports/activities",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1},preview:"/api/v1/reports/activities?output=json",supports_previews:!1},{identifier:"client",label:"client",endpoint:"/api/v1/reports/clients",allow_custom_column:!0,custom_columns:["client"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1,include_deleted:!1},preview:"/api/v1/reports/clients?output=json",supports_previews:!0},{identifier:"contact",label:"contact",endpoint:"/api/v1/reports/contacts",allow_custom_column:!0,custom_columns:["contact"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1},preview:"/api/v1/reports/contacts?output=json",supports_previews:!0},{identifier:"credit",label:"credit",endpoint:"/api/v1/reports/credits",allow_custom_column:!0,custom_columns:["client","credit","payment"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1,include_deleted:!1,status:"",client_id:""},preview:"/api/v1/reports/credits?output=json",supports_previews:!0},{identifier:"document",label:"document",endpoint:"/api/v1/reports/documents",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1},preview:"/api/v1/reports/documents?output=json",supports_previews:!0},{identifier:"expense",label:"expense",endpoint:"/api/v1/reports/expenses",allow_custom_column:!0,custom_columns:["expense","client","vendor"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1,clients:"",vendors:"",categories:"",projects:"",include_deleted:!1,status:""},preview:"/api/v1/reports/expenses?output=json",supports_previews:!0},{identifier:"invoice",label:"invoice",endpoint:"/api/v1/reports/invoices",allow_custom_column:!0,custom_columns:["client","invoice","payment"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,status:"",document_email_attachment:!1,include_deleted:!1,client_id:""},preview:"/api/v1/reports/invoices?output=json",supports_previews:!0},{identifier:"invoice_item",label:"invoice_item",endpoint:"/api/v1/reports/invoice_items",allow_custom_column:!0,custom_columns:["client","invoice","payment","item"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1,include_deleted:!1,status:"",client_id:""},preview:"/api/v1/reports/invoice_items?output=json",supports_previews:!0},{identifier:"purchase_order",label:"purchase_order",endpoint:"/api/v1/reports/purchase_orders",allow_custom_column:!0,custom_columns:["vendor","purchase_order"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,status:"",document_email_attachment:!1,include_deleted:!1},preview:"/api/v1/reports/purchase_orders?output=json",supports_previews:!0},{identifier:"purchase_order_item",label:"purchase_order_item",endpoint:"/api/v1/reports/purchase_order_items",allow_custom_column:!0,custom_columns:["vendor","purchase_order","item"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1,include_deleted:!1,status:""},preview:"/api/v1/reports/purchase_order_items?output=json",supports_previews:!0},{identifier:"quote",label:"quote",endpoint:"/api/v1/reports/quotes",allow_custom_column:!0,custom_columns:["client","quote"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1,include_deleted:!1,status:"",client_id:""},preview:"/api/v1/reports/quotes?output=json",supports_previews:!0},{identifier:"quote_item",label:"quote_item",endpoint:"/api/v1/reports/quote_items",allow_custom_column:!0,custom_columns:["client","quote","item"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1,include_deleted:!1,status:"",client_id:""},preview:"/api/v1/reports/quote_items?output=json",supports_previews:!0},{identifier:"recurring_invoice",label:"recurring_invoice",endpoint:"/api/v1/reports/recurring_invoices",allow_custom_column:!0,custom_columns:["recurring_invoice","client","item"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,include_deleted:!1,status:"",client_id:""},preview:"/api/v1/reports/recurring_invoices?output=json",supports_previews:!0},{identifier:"payment",label:"payment",endpoint:"/api/v1/reports/payments",allow_custom_column:!0,custom_columns:["client","invoice","payment"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1,status:"",client_id:""},preview:"/api/v1/reports/payments?output=json",supports_previews:!0},{identifier:"product",label:"product",endpoint:"/api/v1/reports/products",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1},preview:"/api/v1/reports/products?output=json",supports_previews:!0},{identifier:"product_sales",label:"product_sales",endpoint:"/api/v1/reports/product_sales",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",client_id:"",date_key:"",date_range:"all",report_keys:[],send_email:!1},preview:"/api/v1/reports/product_sales?output=json",supports_previews:!1},{identifier:"task",label:"task",endpoint:"/api/v1/reports/tasks",allow_custom_column:!0,custom_columns:["task","client","invoice"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1,include_deleted:!1,status:"",client_id:""},preview:"/api/v1/reports/tasks?output=json",supports_previews:!0},{identifier:"vendor",label:"vendor",endpoint:"/api/v1/reports/vendors",allow_custom_column:!0,custom_columns:["vendor"],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,document_email_attachment:!1},preview:"/api/v1/reports/vendors?output=json",supports_previews:!0},{identifier:"profitloss",label:"profitloss",endpoint:"/api/v1/reports/profitloss",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,is_expense_billed:!1,is_income_billed:!1,include_tax:!1},preview:"/api/v1/reports/profitloss?output=json",supports_previews:!1},{identifier:"aged_receivable_detailed_report",schedule_identifier:"ar_detailed",label:"aged_receivable_detailed_report",endpoint:"/api/v1/reports/ar_detail_report",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,is_expense_billed:!1,is_income_billed:!1,include_tax:!1},preview:"/api/v1/reports/ar_detail_report?output=json",supports_previews:!1},{identifier:"aged_receivable_summary_report",schedule_identifier:"ar_summary",label:"aged_receivable_summary_report",endpoint:"/api/v1/reports/ar_summary_report",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,is_expense_billed:!1,is_income_billed:!1,include_tax:!1},preview:"/api/v1/reports/ar_summary_report?output=json",supports_previews:!1},{identifier:"client_balance_report",label:"client_balance_report",schedule_identifier:"client_balance",endpoint:"/api/v1/reports/client_balance_report",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,is_expense_billed:!1,is_income_billed:!1,include_tax:!1},preview:"/api/v1/reports/client_balance_report?output=json",supports_previews:!1},{identifier:"client_sales_report",label:"client_sales_report",schedule_identifier:"client_sales",endpoint:"/api/v1/reports/client_sales_report",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,is_expense_billed:!1,is_income_billed:!1,include_tax:!1},preview:"/api/v1/reports/client_sales_report?output=json",supports_previews:!1},{identifier:"tax_summary_report",label:"tax_summary_report",schedule_identifier:"tax_summary",endpoint:"/api/v1/reports/tax_summary_report",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,is_expense_billed:!1,is_income_billed:!1,include_tax:!1},preview:"/api/v1/reports/tax_summary_report?output=json",supports_previews:!1},{identifier:"user_sales_report",label:"user_sales_report",schedule_identifier:"user_sales",endpoint:"/api/v1/reports/user_sales_report",allow_custom_column:!1,custom_columns:[],payload:{start_date:"",end_date:"",date_key:"",date_range:"all",report_keys:[],send_email:!1,is_expense_billed:!1,is_income_billed:!1,include_tax:!1},preview:"/api/v1/reports/user_sales_report?output=json",supports_previews:!1}]}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const zJt=[{trans:"name",value:"client.name",map:"client"},{trans:"number",value:"client.number",map:"client"},{trans:"user",value:"client.user",map:"client"},{trans:"assigned_user",value:"client.assigned_user",map:"client"},{trans:"balance",value:"client.balance",map:"client"},{trans:"paid_to_date",value:"client.paid_to_date",map:"client"},{trans:"currency",value:"client.currency_id",map:"client"},{trans:"website",value:"client.website",map:"client"},{trans:"private_notes",value:"client.private_notes",map:"client"},{trans:"industry",value:"client.industry_id",map:"client"},{trans:"size",value:"client.size_id",map:"client"},{trans:"address1",value:"client.address1",map:"client"},{trans:"address2",value:"client.address2",map:"client"},{trans:"city",value:"client.city",map:"client"},{trans:"state",value:"client.state",map:"client"},{trans:"postal_code",value:"client.postal_code",map:"client"},{trans:"country",value:"client.country_id",map:"client"},{trans:"custom_value1",value:"client.custom_value1",map:"client"},{trans:"custom_value2",value:"client.custom_value2",map:"client"},{trans:"custom_value3",value:"client.custom_value3",map:"client"},{trans:"custom_value4",value:"client.custom_value4",map:"client"},{trans:"shipping_address1",value:"client.shipping_address1",map:"client"},{trans:"shipping_address2",value:"client.shipping_address2",map:"client"},{trans:"shipping_city",value:"client.shipping_city",map:"client"},{trans:"shipping_state",value:"client.shipping_state",map:"client"},{trans:"shipping_postal_code",value:"client.shipping_postal_code",map:"client"},{trans:"shipping_country",value:"client.shipping_country_id",map:"client"},{trans:"payment_terms",value:"client.payment_terms",map:"client"},{trans:"vat_number",value:"client.vat_number",map:"client"},{trans:"id_number",value:"client.id_number",map:"client"},{trans:"public_notes",value:"client.public_notes",map:"client"},{trans:"phone",value:"client.phone",map:"client"},{trans:"classification",value:"client.classification",map:"client"},{trans:"credit_balance",value:"client.credit_balance",map:"client"},{trans:"payment_balance",value:"client.payment_balance",map:"client"},{trans:"first_name",value:"contact.first_name",map:"client"},{trans:"last_name",value:"contact.last_name",map:"client"},{trans:"email",value:"contact.email",map:"client"},{trans:"phone",value:"contact.phone",map:"client"},{trans:"custom_value1",value:"contact.custom_value1",map:"client"},{trans:"custom_value2",value:"contact.custom_value2",map:"client"},{trans:"custom_value3",value:"contact.custom_value3",map:"client"},{trans:"custom_value4",value:"contact.custom_value4",map:"client"}];/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const jJt=[{trans:"date",value:"payment.date",map:"payment"},{trans:"amount",value:"payment.amount",map:"payment"},{trans:"refunded",value:"payment.refunded",map:"payment"},{trans:"applied",value:"payment.applied",map:"payment"},{trans:"transaction_reference",value:"payment.transaction_reference",map:"payment"},{trans:"currency",value:"payment.currency",map:"payment"},{trans:"exchange_rate",value:"payment.exchange_rate",map:"payment"},{trans:"number",value:"payment.number",map:"payment"},{trans:"method",value:"payment.method",map:"payment"},{trans:"status",value:"payment.status",map:"payment"},{trans:"private_notes",value:"payment.private_notes",map:"payment"},{trans:"custom_value1",value:"payment.custom_value1",map:"payment"},{trans:"custom_value2",value:"payment.custom_value2",map:"payment"},{trans:"custom_value3",value:"payment.custom_value3",map:"payment"},{trans:"custom_value4",value:"payment.custom_value4",map:"payment"},{trans:"user",value:"payment.user_id",map:"payment"},{trans:"assigned_user",value:"payment.assigned_user_id",map:"payment"}];/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const UTe=[{trans:"quote_number",value:"quote.number",map:"quote"},{trans:"amount",value:"quote.amount",map:"quote"},{trans:"balance",value:"quote.balance",map:"quote"},{trans:"paid_to_date",value:"quote.paid_to_date",map:"quote"},{trans:"discount",value:"invoice.discount",map:"quote"},{trans:"po_number",value:"quote.po_number",map:"quote"},{trans:"date",value:"quote.date",map:"quote"},{trans:"due_date",value:"quote.due_date",map:"quote"},{trans:"terms",value:"quote.terms",map:"quote"},{trans:"footer",value:"quote.footer",map:"quote"},{trans:"status",value:"quote.status",map:"quote"},{trans:"public_notes",value:"quote.public_notes",map:"quote"},{trans:"private_notes",value:"quote.private_notes",map:"quote"},{trans:"uses_inclusive_taxes",value:"quote.uses_inclusive_taxes",map:"quote"},{trans:"is_amount_discount",value:"quote.is_amount_discount",map:"quote"},{trans:"partial",value:"quote.partial",map:"quote"},{trans:"partial_due_date",value:"quote.partial_due_date",map:"quote"},{trans:"custom_value1",value:"quote.custom_value1",map:"quote"},{trans:"custom_value2",value:"quote.custom_value2",map:"quote"},{trans:"custom_value3",value:"quote.custom_value3",map:"quote"},{trans:"custom_value4",value:"quote.custom_value4",map:"quote"},{trans:"surcharge1",value:"quote.custom_surcharge1",map:"quote"},{trans:"surcharge2",value:"quote.custom_surcharge2",map:"quote"},{trans:"surcharge3",value:"quote.custom_surcharge3",map:"quote"},{trans:"surcharge4",value:"quote.custom_surcharge4",map:"quote"},{trans:"exchange_rate",value:"quote.exchange_rate",map:"quote"},{trans:"tax_amount",value:"quote.total_taxes",map:"quote"},{trans:"assigned_user",value:"quote.assigned_user_id",map:"quote"},{trans:"user",value:"quote.user_id",map:"quote"},{trans:"tax_name1",value:"quote.tax_name1",map:"quote"},{trans:"tax_rate1",value:"quote.tax_rate1",map:"quote"},{trans:"tax_name2",value:"quote.tax_name2",map:"quote"},{trans:"tax_rate2",value:"quote.tax_rate2",map:"quote"},{trans:"tax_name3",value:"quote.tax_name3",map:"quote"},{trans:"tax_rate3",value:"quote.tax_rate3",map:"quote"}];/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const qTe=[{trans:"credit_number",value:"credit.number",map:"credit"},{trans:"amount",value:"credit.amount",map:"credit"},{trans:"balance",value:"credit.balance",map:"credit"},{trans:"paid_to_date",value:"credit.paid_to_date",map:"credit"},{trans:"discount",value:"credit.discount",map:"credit"},{trans:"po_number",value:"credit.po_number",map:"credit"},{trans:"date",value:"credit.date",map:"credit"},{trans:"due_date",value:"credit.due_date",map:"credit"},{trans:"terms",value:"credit.terms",map:"credit"},{trans:"footer",value:"credit.footer",map:"credit"},{trans:"status",value:"credit.status",map:"credit"},{trans:"public_notes",value:"credit.public_notes",map:"credit"},{trans:"private_notes",value:"credit.private_notes",map:"credit"},{trans:"uses_inclusive_taxes",value:"credit.uses_inclusive_taxes",map:"credit"},{trans:"is_amount_discount",value:"credit.is_amount_discount",map:"credit"},{trans:"partial",value:"credit.partial",map:"credit"},{trans:"partial_due_date",value:"credit.partial_due_date",map:"credit"},{trans:"custom_value1",value:"credit.custom_value1",map:"credit"},{trans:"custom_value2",value:"credit.custom_value2",map:"credit"},{trans:"custom_value3",value:"credit.custom_value3",map:"credit"},{trans:"custom_value4",value:"credit.custom_value4",map:"credit"},{trans:"surcharge1",value:"credit.custom_surcharge1",map:"credit"},{trans:"surcharge2",value:"credit.custom_surcharge2",map:"credit"},{trans:"surcharge3",value:"credit.custom_surcharge3",map:"credit"},{trans:"surcharge4",value:"credit.custom_surcharge4",map:"credit"},{trans:"exchange_rate",value:"credit.exchange_rate",map:"credit"},{trans:"tax_amount",value:"credit.total_taxes",map:"credit"},{trans:"assigned_user",value:"credit.assigned_user_id",map:"credit"},{trans:"user",value:"credit.user_id",map:"credit"},{trans:"tax_name1",value:"credit.tax_name1",map:"credit"},{trans:"tax_rate1",value:"credit.tax_rate1",map:"credit"},{trans:"tax_name2",value:"credit.tax_name2",map:"credit"},{trans:"tax_rate2",value:"credit.tax_rate2",map:"credit"},{trans:"tax_name3",value:"credit.tax_name3",map:"credit"},{trans:"tax_rate3",value:"credit.tax_rate3",map:"credit"}];/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const AR=[{trans:"quantity",value:"item.quantity",map:""},{trans:"discount",value:"item.discount",map:""},{trans:"cost",value:"item.cost",map:""},{trans:"product_key",value:"item.product_key",map:""},{trans:"notes",value:"item.notes",map:""},{trans:"custom_value1",value:"item.custom_value1",map:""},{trans:"custom_value2",value:"item.custom_value2",map:""},{trans:"custom_value3",value:"item.custom_value3",map:""},{trans:"custom_value4",value:"item.custom_value4",map:""},{trans:"item_tax1",value:"item.tax_name1",map:""},{trans:"item_tax_rate1",value:"item.tax_rate1",map:""},{trans:"item_tax2",value:"item.tax_name2",map:""},{trans:"item_tax_rate2",value:"item.tax_rate2",map:""},{trans:"item_tax3",value:"item.tax_name3",map:""},{trans:"item_tax_rate3",value:"item.tax_rate3",map:""},{trans:"type",value:"item.type_id",map:""},{trans:"tax_category",value:"item.tax_id",map:""},{trans:"tax_amount",value:"item.tax_amount",map:""}];/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const UJt=[{trans:"name",value:"vendor.name",map:"vendor"},{trans:"address1",value:"vendor.address1",map:"vendor"},{trans:"address2",value:"vendor.address2",map:"vendor"},{trans:"city",value:"vendor.city",map:"vendor"},{trans:"country",value:"vendor.country_id",map:"vendor"},{trans:"custom_value1",value:"vendor.custom_value1",map:"vendor"},{trans:"custom_value2",value:"vendor.custom_value2",map:"vendor"},{trans:"custom_value3",value:"vendor.custom_value3",map:"vendor"},{trans:"custom_value4",value:"vendor.custom_value4",map:"vendor"},{trans:"id_number",value:"vendor.id_number",map:"vendor"},{trans:"number",value:"vendor.number",map:"vendor"},{trans:"phone",value:"vendor.phone",map:"vendor"},{trans:"postal_code",value:"vendor.postal_code",map:"vendor"},{trans:"private_notes",value:"vendor.private_notes",map:"vendor"},{trans:"public_notes",value:"vendor.public_notes",map:"vendor"},{trans:"state",value:"vendor.state",map:"vendor"},{trans:"vat_number",value:"vendor.vat_number",map:"vendor"},{trans:"website",value:"vendor.website",map:"vendor"},{trans:"currency",value:"vendor.currency",map:"vendor"},{trans:"first_name",value:"vendor_contact.first_name",map:"vendor"},{trans:"last_name",value:"vendor_contact.last_name",map:"vendor"},{trans:"contact_phone",value:"vendor_contact.phone",map:"vendor"},{trans:"contact_custom_value1",value:"vendor_contact.custom_value1",map:"vendor"},{trans:"contact_custom_value2",value:"vendor_contact.custom_value2",map:"vendor"},{trans:"contact_custom_value3",value:"vendor_contact.custom_value3",map:"vendor"},{trans:"contact_custom_value4",value:"vendor_contact.custom_value4",map:"vendor"},{trans:"email",value:"vendor_contact.email",map:"vendor"},{trans:"status",value:"vendor.status",map:"vendor"}];/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const KTe=[{trans:"purchase_order_number",value:"purchase_order.number",map:"purchase_order"},{trans:"amount",value:"purchase_order.amount",map:"purchase_order"},{trans:"balance",value:"purchase_order.balance",map:"purchase_order"},{trans:"paid_to_date",value:"purchase_order.paid_to_date",map:"purchase_order"},{trans:"discount",value:"purchase_order.discount",map:"purchase_order"},{trans:"po_number",value:"purchase_order.po_number",map:"purchase_order"},{trans:"date",value:"purchase_order.date",map:"purchase_order"},{trans:"due_date",value:"purchase_order.due_date",map:"purchase_order"},{trans:"terms",value:"purchase_order.terms",map:"purchase_order"},{trans:"footer",value:"purchase_order.footer",map:"purchase_order"},{trans:"status",value:"purchase_order.status",map:"purchase_order"},{trans:"public_notes",value:"purchase_order.public_notes",map:"purchase_order"},{trans:"private_notes",value:"purchase_order.private_notes",map:"purchase_order"},{trans:"uses_inclusive_taxes",value:"purchase_order.uses_inclusive_taxes",map:"purchase_order"},{trans:"is_amount_discount",value:"purchase_order.is_amount_discount",map:"purchase_order"},{trans:"partial",value:"purchase_order.partial",map:"purchase_order"},{trans:"partial_due_date",value:"purchase_order.partial_due_date",map:"purchase_order"},{trans:"surcharge1",value:"purchase_order.custom_surcharge1",map:"purchase_order"},{trans:"surcharge2",value:"purchase_order.custom_surcharge2",map:"purchase_order"},{trans:"surcharge3",value:"purchase_order.custom_surcharge3",map:"purchase_order"},{trans:"surcharge4",value:"purchase_order.custom_surcharge4",map:"purchase_order"},{trans:"exchange_rate",value:"purchase_order.exchange_rate",map:"purchase_order"},{trans:"tax_amount",value:"purchase_order.total_taxes",map:"purchase_order"},{trans:"assigned_user",value:"purchase_order.assigned_user_id",map:"purchase_order"},{trans:"user",value:"purchase_order.user_id",map:"purchase_order"},{trans:"tax_name1",value:"purchase_order.tax_name1",map:"purchase_order"},{trans:"tax_rate1",value:"purchase_order.tax_rate1",map:"purchase_order"},{trans:"tax_name2",value:"purchase_order.tax_name2",map:"purchase_order"},{trans:"tax_rate2",value:"purchase_order.tax_rate2",map:"purchase_order"},{trans:"tax_name3",value:"purchase_order.tax_name3",map:"purchase_order"},{trans:"tax_rate3",value:"purchase_order.tax_rate3",map:"purchase_order"}];/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const qJt=[{trans:"start_date",value:"task.start_date",map:"task"},{trans:"start_time",value:"task.start_time",map:"task"},{trans:"end_date",value:"task.end_date",map:"task"},{trans:"end_time",value:"task.end_time",map:"task"},{trans:"duration",value:"task.duration",map:"task"},{trans:"duration_words",value:"task.duration_words",map:"task"},{trans:"rate",value:"task.rate",map:"task"},{trans:"number",value:"task.number",map:"task"},{trans:"description",value:"task.description",map:"task"},{trans:"custom_value1",value:"task.custom_value1",map:"task"},{trans:"custom_value2",value:"task.custom_value2",map:"task"},{trans:"custom_value3",value:"task.custom_value3",map:"task"},{trans:"custom_value4",value:"task.custom_value4",map:"task"},{trans:"status",value:"task.status_id",map:"task"},{trans:"project",value:"task.project_id",map:"task"},{trans:"billable",value:"task.billable",map:"task"},{trans:"item_notes",value:"task.item_notes",map:"task"}];/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const KJt=[{trans:"amount",value:"expense.amount",map:"expense"},{trans:"category",value:"expense.category",map:"expense"},{trans:"custom_value1",value:"expense.custom_value1",map:"expense"},{trans:"custom_value2",value:"expense.custom_value2",map:"expense"},{trans:"custom_value3",value:"expense.custom_value3",map:"expense"},{trans:"custom_value4",value:"expense.custom_value4",map:"expense"},{trans:"currency",value:"expense.currency_id",map:"expense"},{trans:"date",value:"expense.date",map:"expense"},{trans:"exchange_rate",value:"expense.exchange_rate",map:"expense"},{trans:"converted_amount",value:"expense.foreign_amount",map:"expense"},{trans:"invoice_currency_id",value:"expense.invoice_currency_id",map:"expense"},{trans:"payment_date",value:"expense.payment_date",map:"expense"},{trans:"number",value:"expense.number",map:"expense"},{trans:"payment_type_id",value:"expense.payment_type_id",map:"expense"},{trans:"private_notes",value:"expense.private_notes",map:"expense"},{trans:"project",value:"expense.project_id",map:"expense"},{trans:"public_notes",value:"expense.public_notes",map:"expense"},{trans:"tax_amount1",value:"expense.tax_amount1",map:"expense"},{trans:"tax_amount2",value:"expense.tax_amount2",map:"expense"},{trans:"tax_amount3",value:"expense.tax_amount3",map:"expense"},{trans:"tax_name1",value:"expense.tax_name1",map:"expense"},{trans:"tax_name2",value:"expense.tax_name2",map:"expense"},{trans:"tax_name3",value:"expense.tax_name3",map:"expense"},{trans:"tax_rate1",value:"expense.tax_rate1",map:"expense"},{trans:"tax_rate2",value:"expense.tax_rate2",map:"expense"},{trans:"tax_rate3",value:"expense.tax_rate3",map:"expense"},{trans:"transaction_reference",value:"expense.transaction_reference",map:"expense"},{trans:"invoice",value:"expense.invoice_id",map:"expense"},{trans:"user",value:"expense.user",map:"expense"},{trans:"assigned_user",value:"expense.assigned_user",map:"expense"}];/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const GTe=[{trans:"invoice_number",value:"recurring_invoice.number",map:"recurring_invoice"},{trans:"amount",value:"recurring_invoice.amount",map:"recurring_invoice"},{trans:"balance",value:"recurring_invoice.balance",map:"recurring_invoice"},{trans:"paid_to_date",value:"recurring_invoice.paid_to_date",map:"recurring_invoice"},{trans:"discount",value:"recurring_invoice.discount",map:"recurring_invoice"},{trans:"po_number",value:"recurring_invoice.po_number",map:"recurring_invoice"},{trans:"date",value:"recurring_invoice.date",map:"recurring_invoice"},{trans:"due_date",value:"recurring_invoice.due_date",map:"recurring_invoice"},{trans:"terms",value:"recurring_invoice.terms",map:"recurring_invoice"},{trans:"footer",value:"recurring_invoice.footer",map:"recurring_invoice"},{trans:"status",value:"recurring_invoice.status",map:"recurring_invoice"},{trans:"public_notes",value:"recurring_invoice.public_notes",map:"recurring_invoice"},{trans:"private_notes",value:"recurring_invoice.private_notes",map:"recurring_invoice"},{trans:"uses_inclusive_taxes",value:"recurring_invoice.uses_inclusive_taxes",map:"recurring_invoice"},{trans:"is_amount_discount",value:"recurring_invoice.is_amount_discount",map:"recurring_invoice"},{trans:"partial",value:"recurring_invoice.partial",map:"recurring_invoice"},{trans:"partial_due_date",value:"recurring_invoice.partial_due_date",map:"recurring_invoice"},{trans:"custom_value1",value:"recurring_invoice.custom_value1",map:"recurring_invoice"},{trans:"custom_value2",value:"recurring_invoice.custom_value2",map:"recurring_invoice"},{trans:"custom_value3",value:"recurring_invoice.custom_value3",map:"recurring_invoice"},{trans:"custom_value4",value:"recurring_invoice.custom_value4",map:"recurring_invoice"},{trans:"surcharge1",value:"recurring_invoice.custom_surcharge1",map:"recurring_invoice"},{trans:"surcharge2",value:"recurring_invoice.custom_surcharge2",map:"recurring_invoice"},{trans:"surcharge3",value:"recurring_invoice.custom_surcharge3",map:"recurring_invoice"},{trans:"surcharge4",value:"recurring_invoice.custom_surcharge4",map:"recurring_invoice"},{trans:"exchange_rate",value:"recurring_invoice.exchange_rate",map:"recurring_invoice"},{trans:"tax_amount",value:"recurring_invoice.total_taxes",map:"recurring_invoice"},{trans:"assigned_user",value:"recurring_invoice.assigned_user_id",map:"recurring_invoice"},{trans:"user",value:"recurring_invoice.user_id",map:"recurring_invoice"},{trans:"frequency",value:"recurring_invoice.frequency_id",map:"recurring_invoice"},{trans:"next_send_date",value:"recurring_invoice.next_send_date",map:"recurring_invoice"},{trans:"auto_bill",value:"recurring_invoice.auto_bill",map:"recurring_invoice"},{trans:"auto_bill_enabled",value:"recurring_invoice.auto_bill_enabled",map:"recurring_invoice"},{trans:"tax_name1",value:"recurring_invoice.tax_name1",map:"recurring_invoice"},{trans:"tax_rate1",value:"recurring_invoice.tax_rate1",map:"recurring_invoice"},{trans:"tax_name2",value:"recurring_invoice.tax_name2",map:"recurring_invoice"},{trans:"tax_rate2",value:"recurring_invoice.tax_rate2",map:"recurring_invoice"},{trans:"tax_name3",value:"recurring_invoice.tax_name3",map:"recurring_invoice"},{trans:"tax_rate3",value:"recurring_invoice.tax_rate3",map:"recurring_invoice"}];/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const GJt=[{trans:"first_name",value:"contact.first_name",map:"contact"},{trans:"last_name",value:"contact.last_name",map:"contact"},{trans:"email",value:"contact.email",map:"contact"},{trans:"phone",value:"contact.phone",map:"contact"},{trans:"custom_value1",value:"contact.custom_value1",map:"contact"},{trans:"custom_value2",value:"contact.custom_value2",map:"contact"},{trans:"custom_value3",value:"contact.custom_value3",map:"contact"},{trans:"custom_value4",value:"contact.custom_value4",map:"contact"},{trans:"name",value:"client.name",map:"contact"},{trans:"user",value:"client.user",map:"contact"},{trans:"assigned_user",value:"client.assigned_user",map:"contact"},{trans:"balance",value:"client.balance",map:"contact"},{trans:"paid_to_date",value:"client.paid_to_date",map:"contact"},{trans:"currency",value:"client.currency_id",map:"contact"},{trans:"website",value:"client.website",map:"contact"},{trans:"private_notes",value:"client.private_notes",map:"contact"},{trans:"industry",value:"client.industry_id",map:"contact"},{trans:"size",value:"client.size_id",map:"contact"},{trans:"address1",value:"client.address1",map:"contact"},{trans:"address2",value:"client.address2",map:"contact"},{trans:"city",value:"client.city",map:"contact"},{trans:"state",value:"client.state",map:"contact"},{trans:"postal_code",value:"client.postal_code",map:"contact"},{trans:"country",value:"client.country_id",map:"contact"},{trans:"custom_value1",value:"client.custom_value1",map:"contact"},{trans:"custom_value2",value:"client.custom_value2",map:"contact"},{trans:"custom_value3",value:"client.custom_value3",map:"contact"},{trans:"custom_value4",value:"client.custom_value4",map:"contact"},{trans:"shipping_address1",value:"client.shipping_address1",map:"contact"},{trans:"shipping_address2",value:"client.shipping_address2",map:"contact"},{trans:"shipping_city",value:"client.shipping_city",map:"contact"},{trans:"shipping_state",value:"client.shipping_state",map:"contact"},{trans:"shipping_postal_code",value:"client.shipping_postal_code",map:"contact"},{trans:"shipping_country",value:"client.shipping_country_id",map:"contact"},{trans:"payment_terms",value:"client.payment_terms",map:"contact"},{trans:"vat_number",value:"client.vat_number",map:"contact"},{trans:"id_number",value:"client.id_number",map:"contact"},{trans:"public_notes",value:"client.public_notes",map:"contact"},{trans:"phone",value:"client.phone",map:"contact"}];/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const YTe=[{trans:"invoice_number",value:"invoice.number",map:"invoice"},{trans:"amount",value:"invoice.amount",map:"invoice"},{trans:"balance",value:"invoice.balance",map:"invoice"},{trans:"paid_to_date",value:"invoice.paid_to_date",map:"invoice"},{trans:"discount",value:"invoice.discount",map:"invoice"},{trans:"po_number",value:"invoice.po_number",map:"invoice"},{trans:"date",value:"invoice.date",map:"invoice"},{trans:"due_date",value:"invoice.due_date",map:"invoice"},{trans:"terms",value:"invoice.terms",map:"invoice"},{trans:"footer",value:"invoice.footer",map:"invoice"},{trans:"status",value:"invoice.status",map:"invoice"},{trans:"public_notes",value:"invoice.public_notes",map:"invoice"},{trans:"private_notes",value:"invoice.private_notes",map:"invoice"},{trans:"uses_inclusive_taxes",value:"invoice.uses_inclusive_taxes",map:"invoice"},{trans:"is_amount_discount",value:"invoice.is_amount_discount",map:"invoice"},{trans:"partial",value:"invoice.partial",map:"invoice"},{trans:"partial_due_date",value:"invoice.partial_due_date",map:"invoice"},{trans:"custom_value1",value:"invoice.custom_value1",map:"invoice"},{trans:"custom_value2",value:"invoice.custom_value2",map:"invoice"},{trans:"custom_value3",value:"invoice.custom_value3",map:"invoice"},{trans:"custom_value4",value:"invoice.custom_value4",map:"invoice"},{trans:"surcharge1",value:"invoice.custom_surcharge1",map:"invoice"},{trans:"surcharge2",value:"invoice.custom_surcharge2",map:"invoice"},{trans:"surcharge3",value:"invoice.custom_surcharge3",map:"invoice"},{trans:"surcharge4",value:"invoice.custom_surcharge4",map:"invoice"},{trans:"exchange_rate",value:"invoice.exchange_rate",map:"invoice"},{trans:"tax_amount",value:"invoice.total_taxes",map:"invoice"},{trans:"assigned_user",value:"invoice.assigned_user_id",map:"invoice"},{trans:"user",value:"invoice.user_id",map:"invoice"},{trans:"recurring_invoice",value:"invoice.recurring_id",map:"invoice"},{trans:"auto_bill",value:"invoice.auto_bill_enabled",map:"invoice"},{trans:"tax_name1",value:"invoice.tax_name1",map:"invoice"},{trans:"tax_rate1",value:"invoice.tax_rate1",map:"invoice"},{trans:"tax_name2",value:"invoice.tax_name2",map:"invoice"},{trans:"tax_rate2",value:"invoice.tax_rate2",map:"invoice"},{trans:"tax_name3",value:"invoice.tax_name3",map:"invoice"},{trans:"tax_rate3",value:"invoice.tax_rate3",map:"invoice"}],uv=11;function YJt(){const[n]=ue(),e=vi(),t=e==null?void 0:e.custom_fields,i={credit:"invoice",quote:"invoice",recurring_invoice:"invoice",purchase_order:"invoice",recurring_expense:"expense",item:"product"},r=(o,s)=>{const a=o.includes("custom_value")?o.replace("custom_value","custom"):o;return t[a]?Z7(t[a]).label():`${s?"contact_custom_value":"custom"}${a.charAt(a.length-1)}`};return(o,s)=>{const a=i[s]||s;return{custom_value1:r(`${a}1`),custom_value2:r(`${a}2`),custom_value3:r(`${a}3`),custom_value4:r(`${a}4`),surcharge1:t.surcharge1,surcharge2:t.surcharge2,surcharge3:t.surcharge3,surcharge4:t.surcharge4,contact_custom_value1:r("vendor_contact1",!0),contact_custom_value2:r("vendor_contact2",!0),contact_custom_value3:r("vendor_contact3",!0),contact_custom_value4:r("vendor_contact4",!0)}[o]||n(o)}}function ip({title:n,droppableId:e,isDropDisabled:t,data:i,onRemove:r}){const[o]=ue(),s=Vn(),a=YJt(),l=c=>{const u=c.value.split(".");return`${o(`${u[0]}`)} - ${a(c.trans,u[0])}`};return N("div",{children:[f("h2",{className:"text-gray-500 font-medium",children:typeof n=="string"?f("p",{children:n}):n()}),f(Qj,{droppableId:e,isDropDisabled:t,children:c=>N("div",{style:{color:s.$3,colorScheme:s.$0,backgroundColor:s.$1,borderColor:s.$4},className:"w-80 flex-column",ref:c.innerRef,...c.droppableProps,children:[f("div",{className:"overflow-y-scroll h-96 mt-2 border rounded-md divide-y",children:i&&i.map((u,d)=>f(Yj,{index:d,draggableId:`left-word-${u.value}`,children:h=>f("div",{ref:h.innerRef,...h.draggableProps,...h.dragHandleProps,children:N("span",{style:{color:s.$3,colorScheme:s.$0,backgroundColor:s.$1,borderColor:s.$4},className:"p-2 flex justify-between items-center cursor-move ml-2 text-sm",children:[l(u),e===uv.toString()&&f("button",{style:{color:s.$3,colorScheme:s.$0,backgroundColor:s.$1,borderColor:s.$4},type:"button",onClick:()=>r?r(u):null,children:f(L_,{size:15})})]},d)})},u.value))}),c.placeholder]})})]})}const QJt=["client","invoice","credit","quote","payment","vendor","purchase_order","task","expense","recurring_invoice","contact"];function XJt({report:n,columns:e}){const{preferences:t}=Ww(),i=[e.includes("client")?zJt:[],e.includes("invoice")?e.includes("item")?YTe.concat(AR.map(o=>({...o,origin:"invoice"}))):YTe:[],e.includes("credit")?e.includes("item")?qTe.concat(AR.map(o=>({...o,origin:"credit"}))):qTe:[],e.includes("quote")?e.includes("item")?UTe.concat(AR.map(o=>({...o,origin:"quote"}))):UTe:[],e.includes("payment")?jJt:[],e.includes("vendor")?UJt:[],e.includes("purchase_order")?e.includes("item")?KTe.concat(AR.map(o=>({...o,origin:"purchase_order"}))):KTe:[],e.includes("task")?qJt:[],e.includes("expense")?KJt:[],e.includes("recurring_invoice")?e.includes("item")?GTe.concat(AR.map(o=>({...o,origin:"recurring_invoice"}))):GTe:[],e.includes("contact")?GJt:[],[]];return{data:n in t.reports.columns&&t.reports.columns[n].length!==0?t.reports.columns[n]:i,defaultColumns:i}}function ZJt({report:n,columns:e}){const[t]=ue(),{update:i}=Ww(),{data:r,defaultColumns:o}=XJt({report:n,columns:e}),s=d=>{if(d.destination)try{const h=Bn.cloneDeep(r),g=parseInt(d.source.droppableId),p=h[g][d.source.index];h[g].splice(d.source.index,1);const m=parseInt(d.destination.droppableId);h[m].splice(d.destination.index,0,p),i(`preferences.reports.columns.${n}`,[...h])}catch{i(`preferences.reports.columns.${n}`,o)}},a=d=>{const h=QJt.indexOf(d.map),g=Bn.cloneDeep(r);g[uv]=g[uv].filter(p=>p.value!==d.value),g[h].push(d),i(`preferences.reports.columns.${n}`,[...g])},l=()=>{i(`preferences.reports.columns.${n}`,o)},c=d=>{const h=Bn.cloneDeep(r);h[uv]=[...h[uv],...h[d]],h[d]=[],i(`preferences.reports.columns.${n}`,[...h])},u=Vn();return f("div",{className:"min-w-min",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:f(Ot,{className:"my-6",children:f(Gj,{onDragEnd:s,children:N("div",{className:"flex w-full py-2 px-6 space-x-4",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[e.includes("client")&&f(ip,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[f("p",{children:t("client")}),f("button",{type:"button",onClick:()=>c(0),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:f(op,{size:16})})]}),data:r[0],droppableId:"0",isDropDisabled:!0}),e.includes("invoice")&&f(ip,{title:()=>N("div",{className:"flex justify-between items-center",children:[f("p",{children:t("invoice")}),f("button",{type:"button",onClick:()=>c(1),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:f(op,{size:16})})]}),data:r[1],droppableId:"1",isDropDisabled:!0}),e.includes("credit")&&f(ip,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[f("p",{children:t("credit")}),f("button",{type:"button",onClick:()=>c(2),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:f(op,{size:16})})]}),data:r[2],droppableId:"2",isDropDisabled:!0}),e.includes("quote")&&f(ip,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[f("p",{children:t("quote")}),f("button",{type:"button",onClick:()=>c(3),children:f(op,{size:16})})]}),data:r[3],droppableId:"3",isDropDisabled:!0}),e.includes("payment")&&f(ip,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[f("p",{children:t("payment")}),f("button",{type:"button",onClick:()=>c(4),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:f(op,{size:16})})]}),data:r[4],droppableId:"4",isDropDisabled:!0}),e.includes("vendor")&&f(ip,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[f("p",{children:t("vendor")}),f("button",{type:"button",onClick:()=>c(5),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:f(op,{size:16})})]}),data:r[5],droppableId:"5",isDropDisabled:!0}),e.includes("purchase_order")&&f(ip,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[f("p",{children:t("purchase_order")}),f("button",{type:"button",onClick:()=>c(6),children:f(op,{size:16})})]}),data:r[6],droppableId:"6",isDropDisabled:!0}),e.includes("task")&&f(ip,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[f("p",{children:t("task")}),f("button",{type:"button",onClick:()=>c(7),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:f(op,{size:16})})]}),data:r[7],droppableId:"7",isDropDisabled:!0}),e.includes("expense")&&f(ip,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[f("p",{children:t("expense")}),f("button",{type:"button",onClick:()=>c(8),children:f(op,{size:16})})]}),data:r[8],droppableId:"8",isDropDisabled:!0}),e.includes("recurring_invoice")&&f(ip,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[f("p",{children:t("recurring_invoice")}),f("button",{type:"button",onClick:()=>c(9),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:f(op,{size:16})})]}),data:r[9],droppableId:"9",isDropDisabled:!0}),e.includes("contact")&&f(ip,{title:()=>N("div",{className:"flex justify-between items-center",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[f("p",{children:t("contact")}),f("button",{type:"button",onClick:()=>c(10),style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:f(op,{size:16})})]}),data:r[10],droppableId:"10",isDropDisabled:!0}),f(ip,{title:()=>N("div",{className:"flex items-center justify-between",style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},children:[N("p",{children:[t("report")," ",t("columns")]}),N("div",{style:{color:u.$3,colorScheme:u.$0,backgroundColor:u.$1,borderColor:u.$4},className:"flex items-end space-x-1 cursor-pointer",onClick:l,children:[f(L_,{size:19}),N("span",{className:"text-xs",children:["(",t("reset"),")"]})]})]}),data:r[uv],droppableId:uv.toString(),isDropDisabled:!1,onRemove:a})]})})})})}const hWe=po(null);function JJt(){const[n]=Mo(hWe),[e,t]=w.useState(null),i=[{identifier:"credit.number",format:r=>f(Ii,{to:`/credits/${r.value}`,children:r.display_value})}];return w.useEffect(()=>{if(!n)return;const r=Bn.cloneDeep(n);r.rows.map(o=>{o.map(s=>{const a=i.find(l=>l.identifier===s.identifier);a&&(s.display_value=a.format(s))})}),t(r)},[n]),e}function een(){const n=JJt(),[e,t]=w.useState(null),[i,r]=w.useState(),[o]=ue();if(!n)return null;const s=(u,d)=>{const h=Bn.cloneDeep(n);h.rows=h.rows.filter(g=>g.some(p=>{if(p.identifier!==u)return!1;if(typeof p.display_value=="number")return p.display_value.toString().toLowerCase().includes(d.toLowerCase());if(typeof p.display_value=="string")return p.display_value.toLowerCase().includes(d.toLowerCase());if(typeof p.display_value=="object")return p.display_value.props.children.toLowerCase().includes(d.toLowerCase())})),t(h)},a=u=>{const d=(i==null?void 0:i[u])==="asc"?"desc":"asc";r(g=>({...g,[u]:d}));const h=Bn.cloneDeep(n);h.rows=h.rows.sort((g,p)=>{const m=g.find(v=>v.identifier===u),_=p.find(v=>v.identifier===u);if(m&&_)return d==="asc"?m.display_value>_.display_value?1:-1:m.display_value<_.display_value?1:-1}),t(h)},l=(e==null?void 0:e.rows)||n.rows,c=()=>{const u=[n.columns.map(_=>_.display_value).join(",")];(e?e.rows:n.rows).map(_=>{u.push(_.map(v=>v.display_value.toString()==="true"?"Yes":v.display_value.toString()==="false"?"No":`"${v.display_value}"`).join(","))});const h=u.join(`
`),g=new Blob([h],{type:"text/csv;charset=utf-8;"}),p=document.createElement("a"),m=URL.createObjectURL(g);p.setAttribute("href",m),p.setAttribute("download","example.csv"),p.click()};return n?N("div",{id:"preview-table my-4",children:[f("div",{className:"flex justify-end",children:N(Ut,{behavior:"button",onClick:c,children:[o("download")," ",o("csv_file")]})}),N(zw,{children:[f(Uw,{children:n.columns.map((u,d)=>f(la,{children:N("div",{onClick:()=>a(u.identifier),className:"cursor-pointer inline-flex items-center space-x-2",children:[f("p",{children:u.display_value})," ",f(jxt,{})]})},d))}),N(jw,{children:[f(zl,{children:n.columns.map((u,d)=>f(eo,{children:f(ke,{onValueChange:h=>s(u.identifier,h)})},d))}),l.map((u,d)=>f(zl,{children:u.map((h,g)=>f(eo,{children:h.display_value},g))},d))]})]})]}):null}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const ten={last7:"last7_days",last30:"last30_days"};function nen(){const n=ri(),{preferences:e}=Ww(),t=Ri(eU);return(i,r)=>{let o=[];i.identifier in e.reports.columns&&r&&(o=Wa(e.reports.columns[i.identifier][uv]).pluck("value").toArray()),t({...lM,report_name:i.identifier,start_date:i.payload.start_date,end_date:i.payload.end_date,client_id:i.payload.client_id||"",date_range:ten[i.payload.date_range]||i.payload.date_range,send_email:!0,is_income_billed:i.payload.is_income_billed??!1,is_expense_billed:i.payload.is_expense_billed??!1,include_tax:i.payload.include_tax??!1,status:i.payload.status||"",product_key:i.payload.product_key||"",document_email_attachment:i.payload.document_email_attachment??!1,clients:i.payload.clients?i.payload.clients.split(","):[],vendors:i.payload.vendors||"",projects:i.payload.projects||"",categories:i.payload.categories||"",report_keys:o,include_deleted:i.payload.include_deleted??!1}),n("/settings/schedules/create?template=email_report")}}function fWe(n){const[e]=ue(),t=Vn(),i=Ik(),{value:r,onValueChange:o,errorMessage:s}=n,[a,l]=w.useState(),{data:c}=wHe({status:["active"]});w.useEffect(()=>{c&&l(c.map(d=>({value:d.id,label:d.display_name,color:t.$3,backgroundColor:t.$1})))},[c]);const u=d=>d.map(h=>h.value).join(",");return N(_t,{children:[a?f(U,{leftSide:e("clients"),children:f(b_,{id:"clientItemSelector",placeholder:e("clients"),...r&&{value:a==null?void 0:a.filter(d=>r.split(",").find(h=>h===d.value))},onChange:d=>o(u(d)),options:a,isMulti:!0,styles:i})}):f("div",{className:"flex justify-center items-center",children:f(Vo,{})}),s&&f(bs,{className:"mt-2",type:"danger",children:s})]})}function gWe(n){const[e]=ue(),t=Vn(),i=Ik(),{value:r,onValueChange:o,errorMessage:s}=n,[a,l]=w.useState(),{data:c}=YVe({status:["active"]});w.useEffect(()=>{c&&l(c.map(d=>({value:d.id,label:d.name,color:t.$3,backgroundColor:t.$1})))},[c]);const u=d=>d.map(h=>h.value).join(",");return N(_t,{children:[a?f(U,{leftSide:e("expense_categories"),children:f(b_,{id:"expenseCategoryItemSelector",placeholder:e("expense_categories"),...r&&{value:a==null?void 0:a.filter(d=>r.split(",").find(h=>h===d.value))},onChange:d=>o(u(d)),options:a,isMulti:!0,styles:i})}):f("div",{className:"flex justify-center items-center",children:f(Vo,{})}),s&&f(bs,{className:"mt-2",type:"danger",children:s})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function hfr(n){const e=zo();return ai(["/api/v1/projects/create"],()=>Te("GET",ye("/api/v1/projects/create")).then(t=>t.data.data),{...n,staleTime:1/0,enabled:e("create_project")?(n==null?void 0:n.enabled)??!0:!1})}function ffr(n){return ai(["/api/v1/projects",n.id],()=>Te("GET",ye("/api/v1/projects/:id?include=client",{id:n.id})).then(e=>e.data.data),{staleTime:1/0})}function ien(n){return ai(["/api/v1/projects",n],()=>{var e;return Te("GET",ye("/api/v1/projects?status=:status",{status:((e=n==null?void 0:n.status)==null?void 0:e.join(","))??"all"})).then(t=>t.data.data)},{staleTime:1/0})}function pWe(n){const[e]=ue(),t=Vn(),i=Ik(),{value:r,onValueChange:o,errorMessage:s}=n,[a,l]=w.useState(),{data:c}=ien({status:["active"]});w.useEffect(()=>{c&&l(c.map(d=>({value:d.id,label:d.name,color:t.$3,backgroundColor:t.$1})))},[c]);const u=d=>d.map(h=>h.value).join(",");return N(_t,{children:[a?f(U,{leftSide:e("projects"),children:f(b_,{id:"projectItemSelector",placeholder:e("projects"),...r&&{value:a==null?void 0:a.filter(d=>r.split(",").find(h=>h===d.value))},onChange:d=>o(u(d)),options:a,isMulti:!0,styles:i})}):f("div",{className:"flex justify-center items-center",children:f(Vo,{})}),s&&f(bs,{className:"mt-2",type:"danger",children:s})]})}function mWe(n){const[e]=ue(),t=Vn(),i=Ik(),{value:r,onValueChange:o,errorMessage:s}=n,[a,l]=w.useState(),{data:c}=pQt({});w.useEffect(()=>{c&&l(c.map(d=>({value:d.id,label:d.name,color:t.$3,backgroundColor:t.$1})))},[c]);const u=d=>d.map(h=>h.value).join(",");return N(_t,{children:[a?f(U,{leftSide:e("vendors"),children:f(b_,{id:"vendorItemSelector",placeholder:e("vendors"),...r&&{value:a==null?void 0:a.filter(d=>r.split(",").find(h=>h===d.value))},onChange:d=>o(u(d)),options:a,isMulti:!0,styles:i})}):f("div",{className:"flex justify-center items-center",children:f(Vo,{})}),s&&f(bs,{className:"mt-2",type:"danger",children:s})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const ren={client:["document_email_attachment","include_deleted"],invoice:["document_email_attachment","status","include_deleted","client"],invoice_item:["document_email_attachment","product_key","include_deleted","status","client"],quote:["document_email_attachment","include_deleted","status","client"],quote_item:["document_email_attachment","include_deleted","status","client"],credit:["document_email_attachment","include_deleted","status","client"],document:["document_email_attachment"],payment:["document_email_attachment","status","client"],expense:["document_email_attachment","clients","vendors","projects","categories","include_deleted","status"],task:["document_email_attachment","include_deleted","status","client"],product:["document_email_attachment"],vendor:["document_email_attachment"],purchase_order:["document_email_attachment","include_deleted","status"],purchase_order_item:["document_email_attachment","include_deleted","status"],activity:[],contact:[],recurring_invoice:["include_deleted","status","client"],product_sales:["product_key","client"],aged_receivable_detailed_report:[],aged_receivable_summary_report:[],client_balance_report:[],client_sales_report:[],profitloss:["is_expense_billed","is_income_billed","include_tax"],tax_summary_report:[],user_sales_report:[]};function oen(n){const{report:e}=n;return t=>!!ren[e].includes(t)}function sen(n){const[e]=ue(),t=ha();return f(_t,{children:!Wp()&&!ql()&&f("div",{className:n==null?void 0:n.className,children:f(bs,{className:"mb-4",type:"warning",disableClosing:!0,children:N("div",{className:"flex items-center justify-between",children:[N("p",{className:"inline-flex items-center space-x-1",children:[f(yD,{fontSize:18}),N("span",{children:[e("start_free_trial_message"),"."]})]}),(t==null?void 0:t.company_user)&&f(Ii,{to:t.company_user.ninja_portal_url||dt("/settings/account_management"),className:"ml-10",external:!0,children:e("plan_change")})]})})})})}const uV=[{identifier:"all",label:"all",scheduleIdentifier:"all"},{identifier:"last7",label:"last_7_days",scheduleIdentifier:"last7_days"},{identifier:"last30",label:"last_30_days",scheduleIdentifier:"last30_days"},{identifier:"this_month",label:"this_month",scheduleIdentifier:"this_month"},{identifier:"last_month",label:"last_month",scheduleIdentifier:"last_month"},{identifier:"this_quarter",label:"this_quarter",scheduleIdentifier:"this_quarter"},{identifier:"last_quarter",label:"last_quarter",scheduleIdentifier:"last_quarter"},{identifier:"this_year",label:"this_year",scheduleIdentifier:"this_year"},{identifier:"custom",label:"custom",scheduleIdentifier:"custom"}],aen=(n,e)=>{const t=new Blob([n],{type:"text/csv"}),i=URL.createObjectURL(t),r=document.createElement("a");r.download=`${e}.csv`,r.href=i,r.target="_blank",document.body.appendChild(r),r.click(),document.body.removeChild(r)};function len(){var P,M;const{documentTitle:n}=gi("reports"),{t:e}=ue(),t=dWe(),i=Kr(),r=nen(),[o,s]=w.useState(t[0]),[a,l]=w.useState(!1),[c,u]=w.useState(),[d,h]=w.useState(!1),g=oen({report:o.identifier}),{save:p,preferences:m}=Ww(),_=[{name:e("reports"),href:"/reports"}],v=O=>{const B=t.find(F=>F.identifier===O);h(!1),B&&s(B)},b=(O,B)=>{s(F=>({...F,payload:{...F.payload,[O]:B}}))},y=O=>{const B=uV.find(F=>F.identifier===O);B&&s(F=>({...F,payload:{...F.payload,date_range:B.identifier}}))},C=(O,B)=>{s(F=>({...F,payload:{...F.payload,[O]:B}}))},x=O=>{s(B=>({...B,payload:{...B.payload,send_email:O}}))},k=()=>{ie.processing(),l(!0),u(void 0);const{client_id:O}=o.payload;let B=o.identifier==="product_sales"?{...o.payload,client_id:O||null}:o.payload,F=[];o.identifier in m.reports.columns&&d&&(F=Wa(m.reports.columns[o.identifier][uv]).pluck("value").toArray()),B={...B,report_keys:F},Te("POST",ye(o.endpoint),B,{}).then(H=>{if(o.payload.send_email)return l(!1),ie.success();const V=H.data.message;i.fetchQuery({queryKey:["exports",V],queryFn:()=>Te("POST",ye(`/api/v1/exports/preview/${V}`)).then($=>$.data),retry:50,retryDelay:2e3}).then($=>{aen($,o.identifier),ie.success()}).catch($=>{console.error($),ie.error()}).finally(()=>{l(!1)})}).catch(H=>{var V;((V=H.response)==null?void 0:V.status)===422&&(o.payload.send_email&&u(H.response.data),o.payload.send_email||H.response.data.text().then(j=>u(JSON.parse(j))))}).finally(()=>{d&&p({silent:!0})})},[I,L]=Mo(hWe),D=async()=>{u(void 0),L(null);const{client_id:O}=o.payload;let B=o.identifier==="product_sales"?{...o.payload,client_id:O||null}:o.payload,F=[];o.identifier in m.reports.columns&&d&&(F=Wa(m.reports.columns[o.identifier][uv]).pluck("value").toArray()),B={...B,report_keys:F},Te("POST",ye(o.preview),B,{}).then(H=>{const V=H.data.message;i.fetchQuery({queryKey:["reports",V],queryFn:()=>Te("POST",ye(`/api/v1/reports/preview/${V}`)).then($=>$.data),retry:10,retryDelay:5e3}).then($=>{const{columns:j,...Y}=$;L({columns:j,rows:Object.values(Y)}),ie.success()})})};w.useEffect(()=>()=>{i.cancelQueries(["reports"]),ie.dismiss(),L(null)},[]);const R=Vn();return N(oA,{title:n,breadcrumbs:_,onSaveClick:k,saveButtonLabel:e("export"),disableSaveButton:a||!Wp()&&!ql(),navigationTopRight:N(Hp,{label:e("more_actions"),disabled:!Wp()&&!ql(),children:[o.supports_previews&&f(et,{icon:f(Ve,{element:_yt}),onClick:D,children:e("preview")}),f(et,{icon:f(Ve,{element:Zhe}),onClick:()=>r(o,d),children:e("schedule")})]}),children:[f(sen,{}),N("div",{className:"grid grid-cols-12 gap-4",style:{color:R.$3,colorScheme:R.$0,backgroundColor:R.$1,borderColor:R.$4},children:[N(Ot,{className:"col-span-6 h-max",children:[f(U,{leftSide:e("report"),children:f(nn,{onValueChange:O=>{v(O),L(null)},value:o.identifier,cypressRef:"reportNameSelector",children:t.map((O,B)=>f("option",{value:O.identifier,children:e(O.label)},B))})}),f(U,{leftSide:e("send_email"),children:f(gt,{style:{color:R.$3,colorScheme:R.$0,backgroundColor:R.$1,borderColor:R.$4},checked:o.payload.send_email,onValueChange:x})}),g("document_email_attachment")&&f(U,{leftSide:e("document_email_attachment"),children:f(gt,{style:{color:R.$3,colorScheme:R.$0,backgroundColor:R.$1,borderColor:R.$4},checked:o.payload.document_email_attachment,onValueChange:O=>b("document_email_attachment",O),cypressRef:"scheduleDocumentEmailAttachment"})}),g("is_expense_billed")&&f(U,{leftSide:e("expense_paid_report"),children:f(gt,{style:{color:R.$3,colorScheme:R.$0,backgroundColor:R.$1,borderColor:R.$4},checked:o.payload.is_expense_billed,onValueChange:O=>b("is_expense_billed",O),cypressRef:"expenseBilled"})}),g("is_income_billed")&&f(U,{leftSide:e("cash_vs_accrual"),children:f(gt,{style:{color:R.$3,colorScheme:R.$0,backgroundColor:R.$1,borderColor:R.$4},checked:o.payload.is_income_billed,onValueChange:O=>b("is_income_billed",O),cypressRef:"incomeBilled"})}),g("include_tax")&&f(U,{leftSide:e("include_tax"),children:f(gt,{style:{color:R.$3,colorScheme:R.$0,backgroundColor:R.$1,borderColor:R.$4},checked:o.payload.include_tax,onValueChange:O=>b("include_tax",O),cypressRef:"includeTax"})}),g("include_deleted")&&f(U,{leftSide:e("include_deleted"),leftSideHelp:e("include_deleted_help"),children:f(gt,{style:{color:R.$3,colorScheme:R.$0,backgroundColor:R.$1,borderColor:R.$4},checked:o.payload.include_deleted,onValueChange:O=>b("include_deleted",O),cypressRef:"includeDeleted"})}),g("status")&&f(U,{leftSide:e("status"),className:"mb-50 py-50",children:f(uWe,{report:o.identifier,onValueChange:O=>b("status",O)})}),g("product_key")&&f(LHe,{onValueChange:O=>b("product_key",O)}),g("clients")&&f(fWe,{value:o.payload.clients,onValueChange:O=>b("clients",O)}),g("vendors")&&f(mWe,{value:o.payload.vendors,onValueChange:O=>b("vendors",O)}),g("projects")&&f(pWe,{value:o.payload.projects,onValueChange:O=>b("projects",O)}),g("categories")&&f(gWe,{value:o.payload.categories,onValueChange:O=>b("categories",O)})]}),N(Ot,{className:"col-span-6 h-max",children:[f(U,{leftSide:e("range"),children:f(nn,{style:{color:R.$3,colorScheme:R.$0,backgroundColor:R.$1},onValueChange:O=>y(O),value:o.payload.date_range,cypressRef:"reportDateRange",children:uV.map((O,B)=>f("option",{value:O.identifier,children:e(O.label)},B))})}),o.payload.date_range==="custom"&&f(U,{leftSide:e("start_date"),children:f(ke,{type:"date",value:o.payload.start_date,onValueChange:O=>C("start_date",O),errorMessage:(P=c==null?void 0:c.errors)==null?void 0:P.start_date,cypressRef:"reportStartDate"})}),o.payload.date_range==="custom"&&f(U,{leftSide:e("end_date"),children:f(ke,{style:{color:R.$3,colorScheme:R.$0,backgroundColor:R.$1,borderColor:R.$4},type:"date",value:o.payload.end_date,onValueChange:O=>C("end_date",O),errorMessage:(M=c==null?void 0:c.errors)==null?void 0:M.end_date,cypressRef:"reportEndDate"})}),g("client")&&f(U,{leftSide:e("client"),children:f(Jj,{value:o.payload.client_id,onChange:O=>b("client_id",O.id),clearButton:!0,onClearButtonClick:()=>b("client_id",""),withoutAction:!0})}),o.allow_custom_column&&f(U,{leftSide:`${e("customize")} ${e("columns")}`,children:f(gt,{style:{color:R.$3,colorScheme:R.$0,backgroundColor:R.$1,borderColor:R.$4},checked:d,onValueChange:O=>h(!!O)})})]})]}),d&&f(ZJt,{report:o.identifier,columns:o.custom_columns}),I&&f(een,{})]})}const cen=Object.freeze(Object.defineProperty({__proto__:null,default:len,ranges:uV},Symbol.toStringTag,{value:"Module"})),nc=["send_email","range","start_date","end_date"],_We={invoice:[...nc,"status","document_email_attachment","report_keys","include_deleted","client"],invoice_item:[...nc,"products","document_email_attachment","report_keys","status","include_deleted","client"],product_sales:[...nc,"products","client"],profitloss:[...nc,"expense_billed","income_billed","include_tax"],client:[...nc,"document_email_attachment","report_keys","include_deleted"],contact:[...nc,"report_keys"],recurring_invoice:[...nc,"report_keys","status","include_deleted","client"],quote:[...nc,"document_email_attachment","report_keys","status","include_deleted","client"],quote_item:[...nc,"document_email_attachment","report_keys","status","include_deleted","client"],credit:[...nc,"document_email_attachment","report_keys","include_deleted","status","client"],document:[...nc,"document_email_attachment"],payment:[...nc,"document_email_attachment","report_keys","status","client"],expense:[...nc,"document_email_attachment","clients","vendors","projects","categories","report_keys","status","include_deleted"],task:[...nc,"document_email_attachment","report_keys","status","include_deleted","client"],product:[...nc,"document_email_attachment"],vendor:[...nc,"document_email_attachment","report_keys"],purchase_order:[...nc,"document_email_attachment","report_keys","status","include_deleted"],purchase_order_item:[...nc,"document_email_attachment","report_keys","status","include_deleted"]};function uen(n){const[e]=ue(),t=dWe(),{schedule:i,handleChange:r,errors:o}=n,s=a=>(_We[i.parameters.report_name]||nc).includes(a);return N(_t,{children:[f(U,{leftSide:e("report"),children:f(nn,{value:i.parameters.report_name,onValueChange:a=>r("parameters.report_name",a),errorMessage:o==null?void 0:o.errors["parameters.report_name"],cypressRef:"scheduleReportName",children:t.map((a,l)=>f("option",{value:a.schedule_identifier||a.identifier,children:e(a.label)},l))})}),s("send_email")&&f(U,{leftSide:e("send_email"),children:f(gt,{checked:i.parameters.send_email,onValueChange:a=>r("parameters.send_email",a),disabled:!0,cypressRef:"scheduleSendEmail"})}),s("document_email_attachment")&&f(U,{leftSide:e("document_email_attachment"),children:f(gt,{checked:i.parameters.document_email_attachment,onValueChange:a=>r("parameters.document_email_attachment",a),cypressRef:"scheduleDocumentEmailAttachment"})}),s("expense_billed")&&f(U,{leftSide:e("expense_paid_report"),children:f(gt,{checked:i.parameters.is_expense_billed,onValueChange:a=>r("parameters.is_expense_billed",a),cypressRef:"expenseBilled"})}),s("income_billed")&&f(U,{leftSide:e("cash_vs_accrual"),children:f(gt,{checked:i.parameters.is_income_billed,onValueChange:a=>r("parameters.is_income_billed",a),cypressRef:"incomeBilled"})}),s("include_tax")&&f(U,{leftSide:e("include_tax"),children:f(gt,{checked:i.parameters.include_tax,onValueChange:a=>r("parameters.include_tax",a),cypressRef:"includeTax"})}),s("include_deleted")&&f(U,{leftSide:e("include_deleted"),leftSideHelp:e("include_deleted_help"),children:f(gt,{checked:i.parameters.include_deleted,onValueChange:a=>r("parameters.include_deleted",a),cypressRef:"includeDeleted"})}),s("status")&&f(U,{leftSide:e("status"),children:f(uWe,{report:i.parameters.report_name,value:i.parameters.status,onValueChange:a=>r("parameters.status",a),errorMessage:o==null?void 0:o.errors["parameters.status"]})}),s("products")&&f(LHe,{value:i.parameters.product_key,onValueChange:a=>r("parameters.product_key",a),errorMessage:o==null?void 0:o.errors["parameters.product_key"]}),s("range")&&f(U,{leftSide:e("range"),children:f(nn,{value:i.parameters.date_range,onValueChange:a=>r("parameters.date_range",a),errorMessage:o==null?void 0:o.errors["parameters.date_range"],cypressRef:"scheduleDateRange",children:uV.map((a,l)=>f("option",{value:a.scheduleIdentifier,children:e(a.label)},l))})}),s("range")&&i.parameters.date_range==="custom"&&N(_t,{children:[f(U,{leftSide:e("start_date"),children:f(ke,{type:"date",value:i.parameters.start_date,onValueChange:a=>r("parameters.start_date",a),errorMessage:o==null?void 0:o.errors["parameters.start_date"],cypressRef:"scheduleStartDate"})}),f(U,{leftSide:e("end_date"),children:f(ke,{type:"date",value:i.parameters.end_date,onValueChange:a=>r("parameters.end_date",a),errorMessage:o==null?void 0:o.errors["parameters.end_date"],cypressRef:"scheduleEndDate"})})]}),s("client")&&f(U,{leftSide:e("client"),children:f(Jj,{value:i.parameters.client_id,onChange:a=>r("parameters.client_id",a.id),clearButton:!0,onClearButtonClick:()=>r("parameters.client_id",""),withoutAction:!0,errorMessage:o==null?void 0:o.errors["parameters.client_id"]})}),s("clients")&&f(fWe,{value:i.parameters.clients.join(","),onValueChange:a=>{const l={...i.parameters};l.clients=a?[...a.split(",")]:[],r("parameters",l)},errorMessage:o==null?void 0:o.errors["parameters.clients"]}),s("vendors")&&f(mWe,{value:i.parameters.vendors,onValueChange:a=>r("parameters.vendors",a),errorMessage:o==null?void 0:o.errors["parameters.vendors"]}),s("projects")&&f(pWe,{value:i.parameters.projects,onValueChange:a=>r("parameters.projects",a),errorMessage:o==null?void 0:o.errors["parameters.projects"]}),s("categories")&&f(gWe,{value:i.parameters.categories,onValueChange:a=>r("parameters.categories",a),errorMessage:o==null?void 0:o.errors["parameters.categories"]})]})}var bre=(n=>(n.EMAIL_STATEMENT="email_statement",n.EMAIL_RECORD="email_record",n.EMAIL_REPORT="email_report",n))(bre||{});function vWe(n){const[e]=ue(),{schedule:t,handleChange:i,errors:r,page:o}=n,s=pXt({template:t.template});return N(Ot,{title:e(o==="edit"?"edit_schedule":"new_schedule"),children:[s("template")&&f(U,{leftSide:e("template"),required:!0,children:N(nn,{value:t.template,onValueChange:a=>i("template",a),errorMessage:r==null?void 0:r.errors.template,children:[f("option",{value:"email_statement",children:e("email_statement")}),f("option",{value:"email_record",children:e("email_record")}),f("option",{value:"email_report",children:e("email_report")})]})}),s("next_run")&&f(U,{leftSide:e("next_run"),required:!0,children:f(ke,{type:"date",value:t.next_run,onValueChange:a=>i("next_run",a),errorMessage:r==null?void 0:r.errors.next_run})}),s("frequency")&&f(U,{leftSide:e("frequency"),children:f(nn,{value:t.frequency_id,onValueChange:a=>i("frequency_id",a),errorMessage:r==null?void 0:r.errors.frequency_id,children:Object.keys(xx).map((a,l)=>f("option",{value:a,children:e(xx[a])},l))})}),s("remaining_cycles")&&f(U,{leftSide:e("remaining_cycles"),children:N(nn,{value:t.remaining_cycles,onValueChange:a=>i("remaining_cycles",parseInt(a)),errorMessage:r==null?void 0:r.errors.remaining_cycles,children:[f("option",{value:"-1",children:e("endless")}),[...Array(60).keys()].map((a,l)=>f("option",{value:a,children:a},l))]})}),t.template&&f(Jn,{}),t.template==="email_statement"&&f(hXt,{schedule:t,handleChange:i,errors:r,page:o}),t.template==="email_record"&&f(fXt,{schedule:t,handleChange:i,errors:r}),t.template==="email_report"&&f(uen,{schedule:t,handleChange:i,errors:r})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function den(){const[n]=ue();return[{id:"name",label:n("name"),format:(t,i)=>i.template===bre.EMAIL_RECORD?`${n(i.template)}: ${n(i.parameters.entity)}`:i.template===bre.EMAIL_REPORT?`${n(i.template)}: ${n(i.parameters.report_name)} | ${n(i.parameters.date_range)}`:`${n(i.template)}: ${n(i.parameters.date_range)}`},{id:"next_run",label:n("next_run")},{id:"frequency_id",label:n("frequency"),format:t=>n(xx[t])}]}function hen(){const{documentTitle:n}=gi("schedules"),[e]=ue(),t=den(),i=[{name:e("settings"),href:"/settings"},{name:e("schedules"),href:"/settings/schedules"}];return f($i,{title:n,docsLink:"en/advanced-settings/#schedules",breadcrumbs:i,children:f(Pg,{resource:"schedule",endpoint:"/api/v1/task_schedulers?sort=id|desc",bulkRoute:"/api/v1/task_schedulers/bulk",columns:t,linkToCreate:"/settings/schedules/create",linkToEdit:"/settings/schedules/:id/edit",withResourcefulActions:!0})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const fen={range:"date_range",expense_billed:"is_expense_billed",income_billed:"is_income_billed",products:"product_key",client:"client_id"};function gen(n){const{schedule:e}=n;return{email_statement:["date_range","status","show_aging_table","show_credits_table","show_payments_table","only_clients_with_invoices","clients"],email_record:["entity","entity_id"],email_report:["report_name",...(()=>{if(e){let r=(_We[e.parameters.report_name]||nc).map(o=>fen[o]||o);return e.parameters.date_range!=="custom"&&(r=r.filter(o=>o!=="start_date"&&o!=="end_date")),r}return[]})()]}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const pen={email_statement:["template","next_run","frequency_id","remaining_cycles","parameters"],email_record:["template","next_run","parameters"],email_report:["template","next_run","frequency_id","remaining_cycles","parameters"]},men=["vendors","projects","categories"];function bWe(n){const{schedule:e}=n,t=gen({schedule:e});return()=>{if(e){let i={};const r=pen[e.template],o=t[e.template];return Object.entries(e.parameters).forEach(([s])=>{o.includes(s)||delete e.parameters[s]}),Object.entries(e).forEach(([s,a])=>{r.includes(s)&&(i={...i,[s]:a})}),Object.entries(e.parameters).forEach(([s,a])=>{men.includes(s)&&(i={...i,parameters:{...i.parameters,[s]:a||""}})}),i}}}function _en(){const{documentTitle:n}=gi("new_schedule"),[e]=ue(),t=ri(),[i]=i3(),r=L0(),o=[{name:e("settings"),href:"/settings"},{name:e("schedules"),href:"/settings/schedules"},{name:e("new_schedule"),href:"/settings/schedules/create"}],{data:s}=BHe(),[a,l]=w.useState(),[c,u]=w.useState(),[d,h]=Mo(eU),[g,p]=w.useState(!1),m=$He({setErrors:u,setSchedule:l,schedule:a}),_=bWe({schedule:a});return w.useEffect(()=>{s&&l(()=>{let b=d;return i.get("template")||(b=void 0,h(void 0)),{...s,template:i.get("template")||"email_statement",frequency_id:gd.Monthly,remaining_cycles:-1,parameters:b||{...lM}}})},[s]),N($i,{title:n,breadcrumbs:o,disableSaveButton:g||!a||r,onSaveClick:()=>{!g&&a&&(p(!0),u(void 0),ie.processing(),Te("POST",ye("/api/v1/task_schedulers"),_()).then(b=>{ie.success("created_schedule"),hn(["task_schedulers"]),t(dt("/settings/schedules/:id/edit",{id:b.data.data.id}))}).catch(b=>{var y;((y=b.response)==null?void 0:y.status)===422&&(u(b.response.data),ie.dismiss())}).finally(()=>p(!1)))},children:[r&&f(xb,{}),a?f(vWe,{schedule:a,handleChange:m,errors:c}):f(Vo,{})]})}function ven(){const[n]=ue(),e=iZt();return[i=>nr(i)===Di.Active&&f(et,{onClick:()=>e([i.id],"archive"),icon:f(Ve,{element:Xl}),children:n("archive")}),i=>(nr(i)===Di.Archived||nr(i)===Di.Deleted)&&f(et,{onClick:()=>e([i.id],"restore"),icon:f(Ve,{element:Ql}),children:n("restore")}),i=>(nr(i)===Di.Active||nr(i)===Di.Archived)&&f(et,{onClick:()=>e([i.id],"delete"),icon:f(Ve,{element:Pa}),children:n("delete")})]}function ben(){const{documentTitle:n}=gi("edit_schedule"),[e]=ue(),{id:t}=Fa(),i=ven(),r=L0(),o=[{name:e("settings"),href:"/settings"},{name:e("schedules"),href:"/settings/schedules"},{name:e("edit_schedule"),href:dt("/settings/schedules/:id/edit")}],{data:s}=nZt({id:t}),[a,l]=w.useState(),[c,u]=w.useState(),[d,h]=w.useState(!1),g=$He({setErrors:u,setSchedule:l,schedule:a}),p=bWe({schedule:a}),m=()=>{!d&&a&&(h(!0),u(void 0),ie.processing(),Te("PUT",ye("/api/v1/task_schedulers/:id",{id:t}),p()).then(()=>{ie.success("updated_schedule"),hn(["task_schedulers"])}).catch(_=>{var v;((v=_.response)==null?void 0:v.status)===422&&(u(_.response.data),ie.dismiss())}).finally(()=>h(!1)))};return w.useEffect(()=>{s&&l(s)},[s]),N($i,{title:n,breadcrumbs:o,navigationTopRight:a&&f(I0,{resource:a,onSaveClick:m,actions:i,disableSaveButton:d||!a||r}),children:[r&&f(xb,{}),a?f(vWe,{schedule:a,handleChange:g,errors:c,page:"edit"}):f(Vo,{})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function yen(){const{t:n}=ue();return[{name:n("backup"),href:"/settings/backup_restore"},{name:n("restore"),href:"/settings/backup_restore/restore"}]}function Cen(){const[n]=ue(),e=yen(),t=[{name:n("settings"),href:"/settings"},{name:n("backup_restore"),href:"/settings/backup_restore"}];return N($i,{title:n("backup_restore"),breadcrumbs:t,children:[f(Vw,{tabs:e,className:"mt-6"}),f("div",{className:"my-4",children:f(ah,{})})]})}function wen(n){const[e]=ue(),{data:t}=C8e(),[i,r]=w.useState(!1),[o,s]=w.useState(),[a,l]=w.useState(),c=hHe(a,s,r,i,n.setIsModalOpen,n.onCreatedBankAccount),u=(g,p)=>{l(m=>m&&{...m,[g]:p})},d=()=>{i||n.setIsModalOpen(!1)};w.useEffect(()=>{t&&l(t)},[t]);const h=Vn();return N(cr,{title:e("new_bank_account"),visible:n.isModalOpen,onClose:d,children:[f(ke,{style:{color:h.$3,colorScheme:h.$0},label:e("name"),value:a==null?void 0:a.bank_account_name,onValueChange:g=>u("bank_account_name",g),errorMessage:o==null?void 0:o.errors.bank_account_name}),f("div",{className:"flex justify-end",children:f(Ut,{onClick:c,style:{color:h.$3,colorScheme:h.$0},children:e("save")})})]})}function Sen(n){var s;const[e]=ue(),[t,i]=w.useState(!1),{isAdmin:r,isOwner:o}=ao();return N(_t,{children:[f(wen,{isModalOpen:t,setIsModalOpen:i,onCreatedBankAccount:a=>n.onChange(a)}),f(Qd,{endpoint:ye("/api/v1/bank_integrations?status=active"),onChange:a=>a.resource&&n.onChange(a.resource),inputOptions:{label:(s=n.inputLabel)==null?void 0:s.toString(),value:n.value||null},entryOptions:{id:"id",label:"bank_account_name",value:"id"},action:{label:e("new_bank_account"),onClick:()=>i(!0),visible:r||o},readonly:n.readonly,onDismiss:n.onClearButtonClick,sortBy:"bank_account_name|desc",staleTime:n.staleTime,errorMessage:n.errorMessage})]})}function Een(n){const[e]=ue(),t=Ci(),i=ri(),{onImport:r,importMap:o,entity:s}=n,a=f3(),l=sl(),[c,u]=w.useState(!1),[d,h]=w.useState(!1),[g,p]=w.useState(!1),[m,_]=w.useState(""),v=()=>{_(""),u(!1)},b=()=>{var I,L;if(!((I=l==null?void 0:l.import_templates)!=null&&I[s]))return!0;if(!Object.keys(o.column_map).length)return!1;let k=!1;return Object.values((L=l==null?void 0:l.import_templates)==null?void 0:L[s]).forEach(D=>{var R,P;Bn.isEqual(Object.values(D).map(M=>M||""),Object.values((P=(R=o.column_map)==null?void 0:R[s])==null?void 0:P.mapping).map(M=>M||""))&&(k=!0)}),!k},y=()=>{var I,L;if(!((I=l==null?void 0:l.import_templates)!=null&&I[s]))return!1;let k=!1;return Object.keys((L=l==null?void 0:l.import_templates)==null?void 0:L[s]).forEach(D=>{D.toLowerCase()===m.toLowerCase()&&(k=!0)}),k},C=()=>{var k,I;if(!g){ie.processing(),p(!0);const L=Bn.cloneDeep(a);L&&(Bn.set(L,`company_user.react_settings.import_templates.${n.entity}.${m}`,Object.values((I=(k=o.column_map)==null?void 0:k[n.entity])==null?void 0:I.mapping).map(D=>D||"")),Te("PUT",ye("/api/v1/company_users/:id",{id:L.id}),L).then(D=>{ie.success("updated_settings"),Bn.set(L,"company_user",D.data.data),hn(["company_users"]),t(Uy(L)),v(),i(`/${s}s`)}).finally(()=>p(!1)))}};return N(_t,{children:[f(Ut,{className:"flex float-right",behavior:"button",onClick:()=>{var k;(k=r())==null||k.then(()=>b()?h(!0):i(`/${s}s`))},children:e("import")}),N(cr,{title:e("save_as_template"),visible:c,onClose:v,children:[f(ke,{label:e("name"),value:m,onValueChange:k=>_(k),changeOverride:!0}),f(Ut,{behavior:"button",onClick:C,disabled:!m||y()||g,disableWithoutIcon:!0,children:e("save")})]}),N(cr,{title:e("save_as_template"),visible:d,onClose:()=>{h(!1),i(`/${s}s`)},children:[f("span",{className:"font-medium text-base",children:e("save_template_body")}),N("div",{className:"flex justify-between",children:[f(Ut,{behavior:"button",type:"secondary",onClick:()=>{h(!1),i(`/${s}s`)},children:e("no")}),f(Ut,{behavior:"button",onClick:()=>{h(!1),u(!0)},children:e("yes")})]})]})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function xen(n){var o,s;const e=sl(),{entity:t}=n,i=Object.keys(((o=e==null?void 0:e.import_templates)==null?void 0:o[t])||{}).length,r=Object.keys(((s=e==null?void 0:e.import_templates)==null?void 0:s[t])||{});return{numberOfTemplates:i,templates:r}}function ken(n){const e=Ci(),{name:t,entity:i,onDeletedTemplate:r}=n,o=f3(),[s,a]=w.useState(!1),l=()=>{var c,u,d,h,g,p,m,_,v,b,y,C,x;if(!s){ie.processing(),a(!0);const k=Bn.cloneDeep(o);k&&(Object.keys(((d=(u=(c=k==null?void 0:k.company_user)==null?void 0:c.react_settings)==null?void 0:u.import_templates)==null?void 0:d[i])||{}).length>1?(p=(g=(h=k==null?void 0:k.company_user)==null?void 0:h.react_settings)==null?void 0:g.import_templates)==null||delete p[i][t]:Object.keys(((_=(m=k==null?void 0:k.company_user)==null?void 0:m.react_settings)==null?void 0:_.import_templates)||{}).length>1?(y=(b=(v=k==null?void 0:k.company_user)==null?void 0:v.react_settings)==null?void 0:b.import_templates)==null||delete y[i]:(x=(C=k==null?void 0:k.company_user)==null?void 0:C.react_settings)==null||delete x.import_templates,Te("PUT",ye("/api/v1/company_users/:id",{id:k.id}),k).then(L=>{ie.success("updated_settings"),Bn.set(k,"company_user",L.data.data),hn(["company_users"]),e(Uy(k)),r()}).finally(()=>a(!1)))}};return f(U,{children:N("div",{className:"flex items-center space-x-10",children:[f("span",{className:"font-medium",children:t}),f("div",{className:St({"cursor-pointer":!s,"cursor-not-allowed":s}),onClick:()=>!s&&l(),children:f(Ve,{element:Pa,size:22})})]})})}function yWe(n){const[e]=ue(),t=n.type==="zip",i={...!t&&{"text/*":[".csv"]},...t&&{"application/zip":[".zip"]}},r=Vn(),o=sl(),{numberOfTemplates:s,templates:a}=xen({entity:n.entity}),[l,c]=w.useState(!1),[u,d]=w.useState(!1),[h,g]=w.useState(new FormData),[p,m]=w.useState([]),[_,v]=w.useState(),[b,y]=w.useState({hash:"",import_type:n.type,skip_header:!0,column_map:{[n.entity]:{mapping:{}}}}),[C,x]=w.useState(),[k,I]=w.useState(""),[L,D]=w.useState({}),R=_e=>{b.column_map[n.entity].mapping[_e.target.id]=_e.target.value,y({...b}),I("")},P=()=>{var Ie,Re;const _e={};Object.entries(((Re=(Ie=o==null?void 0:o.import_templates)==null?void 0:Ie[n.entity])==null?void 0:Re[k])||{}).forEach(([Ye,Ze])=>{_e[Ye]=Ze||""}),y(Ye=>({...Ye,column_map:{[n.entity]:{mapping:_e}}}))},M=()=>{I(""),y(_e=>({..._e,column_map:{[n.entity]:{mapping:{...L}}}}))},O=_e=>{const Ie=_e.split(".");let Re=Ie[1];return Ie[1]=="user_id"&&(Re="user"),Ie[1]=="shipping_country_id"&&(Re="shipping_country"),`${e(Ie[0])} - ${e(Re)}`},B=()=>{if(!p.length&&t){ie.error("select_file");return}ie.processing(),x(void 0);let _e="/api/v1/import",Ie={};if(t)if(!l&&!u){ie.error("settings_or_data");return}else _e="/api/v1/import_json?",l&&(_e+="&import_settings=:import_settings",Ie={import_settings:!0}),u&&(_e+="&import_data=:import_data",Ie={...Ie,import_data:!0});else b.hash=_.hash;const Re=t?h:b;return Te("POST",ye(_e,Ie),Re).then(Ye=>{var Ze,tt;ie.success(((Ze=Ye==null?void 0:Ye.data)==null?void 0:Ze.message)??"error_title"),(tt=n.onFileImported)==null||tt.call(n),n.onSuccess}).catch(Ye=>{var Ze;((Ze=Ye.response)==null?void 0:Ze.status)===422&&(ie.dismiss(),x(Ye.response.data))})},F=_e=>{b.column_map[n.entity].mapping[_e]&&(b.column_map[n.entity].mapping[_e]="",I(""),y({...b}))},H=Xp({enableReinitialize:!0,initialValues:{},onSubmit:()=>{ie.processing(),x(void 0),Te("POST",ye("/api/v1/preimport"),h).then(_e=>{var Ie,Re,Ye,Ze;v(_e.data),n.onSuccess,ie.dismiss(),(Re=(Ie=_e.data)==null?void 0:Ie.mappings[n.entity])!=null&&Re.hints&&((Ze=(Ye=_e.data)==null?void 0:Ye.mappings[n.entity])==null||Ze.hints.forEach((tt,Be)=>{var kt,Vt,xt;b.column_map[n.entity].mapping[Be]=((kt=_e.data)==null?void 0:kt.mappings[n.entity].available[tt])??"",y(b),D({...(xt=(Vt=b==null?void 0:b.column_map)==null?void 0:Vt[n.entity])==null?void 0:xt.mapping})})),I("")}).catch(_e=>{var Ie;((Ie=_e.response)==null?void 0:Ie.status)===422&&(ie.dismiss(),x(_e.response.data))})}}),V=()=>{p.forEach(_e=>{h.append("files",_e)}),g(h)},$=_e=>{var Ie,Re;return Object.keys((Ie=b==null?void 0:b.column_map[n.entity])==null?void 0:Ie.mapping).length?((Re=b==null?void 0:b.column_map[n.entity])==null?void 0:Re.mapping[_e])??null:null},j=_e=>{const Ie=p.filter((Ye,Ze)=>_e!==Ze),Re=new FormData;Ie.forEach(Ye=>{Re.append("files",Ye)}),m(Ie),g(Re)},Y=_e=>new Promise(Ie=>{try{const Re=new FileReader;Re.onload=Ye=>{var Be;const tt=(((Be=Ye.target)==null?void 0:Be.result)||"").split(`
`);!tt.length||tt.length===1||tt.length===2&&!tt[1]?Ie(!1):Ie(!0)},Re.readAsText(_e)}catch{Ie(!1)}}),ne=async _e=>{for(let Ie=0;Ie<_e.length;Ie++)if(!await Y(_e[Ie]))return!1;return!0},{getRootProps:se,getInputProps:he,isDragActive:xe}=hA({accept:i,onDrop:async _e=>{await ne(_e)?_e.every(({type:Ye})=>Ye.includes(n.type))?(await Promise.all(_e.map(async Ye=>{if(t)m(Ze=>[...Ze,Ye]);else{const Ze=await Ye.arrayBuffer(),Be=new TextDecoder().decode(Ze),Vt=new TextEncoder().encode(Be),xt=new File([Vt],Ye.name,{type:Ye.type});Ye.path&&Object.defineProperty(xt,"path",{value:Ye.path,writable:!1,enumerable:!0,configurable:!0}),h.append(`files[${n.entity}]`,xt)}})),t||(h.append("import_type",n.entity),H.submitForm(),g(h))):ie.error("wrong_file_extension"):ie.error("csv_rows_length")}});return w.useEffect(()=>{V()},[p]),w.useEffect(()=>{k&&P()},[k]),w.useEffect(()=>()=>I(""),[]),N(_t,{children:[N(Ot,{title:e(n.entity),children:[f(U,{leftSide:e(t?"company_backup_file":"csv_file"),leftSideHelp:t&&e("company_backup_file_help"),children:p.length?f("ul",{className:"grid xs:grid-rows-6 lg:grid-cols-2",children:p.map((_e,Ie)=>N("li",{className:"flex items-center hover:bg-gray-50 cursor-pointer p-2",children:[_e.name," - ",(_e.size/1024).toPrecision(2)," KB"," ",f(f0,{fontSize:15,className:"cursor-pointer ml-3",onClick:()=>j(Ie)})]},Ie))}):N("div",{...se(),className:"flex flex-col md:flex-row md:items-center",children:[N("div",{className:"relative block w-full border-2 border-gray-300 border-dashed rounded-lg p-12 text-center hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:[f("input",{...he()}),f(px,{className:"mx-auto h-12 w-12",style:{color:r.$3,colorScheme:r.$0}}),f("span",{className:"mt-2 block text-sm font-medium",style:{color:r.$3,colorScheme:r.$0},children:e(xe?"drop_file_here":"dropzone_default_message")})]}),C&&Object.keys(C.errors).map((_e,Ie)=>f(bs,{type:"danger",children:C.errors[_e]},Ie))]})}),t&&N(_t,{children:[f(U,{leftSide:e("import_settings"),children:f(gt,{checked:l,onValueChange:_e=>c(_e)})}),f(U,{leftSide:e("import_data"),children:f(gt,{checked:u,onValueChange:_e=>d(_e)})}),f("div",{className:"flex justify-end pr-5",children:f(Ut,{behavior:"button",onClick:B,disableWithoutIcon:!0,disabled:!l&&!u||!p.length,children:e("import")})})]})]}),_&&!t&&!!s&&N(Ot,{className:"mt-4",children:[f(U,{leftSide:e("template"),children:f(nn,{value:k,onValueChange:_e=>{I(_e),_e||y(Ie=>({...Ie,column_map:{[n.entity]:{mapping:{...L}}}}))},withBlank:!0,children:a.map((_e,Ie)=>f("option",{value:_e,children:_e},Ie))})}),k&&f(ken,{name:k,entity:n.entity,onDeletedTemplate:M})]}),_&&!t&&N(zw,{children:[N(Uw,{children:[f(la,{children:e("header")}),f(la,{children:e("columns")})]}),N(jw,{children:[_.mappings[n.entity].headers[0].map((_e,Ie)=>N(zl,{children:[N(eo,{className:"space-x-2",children:[f("span",{children:_e}),f("span",{className:"text-gray-400",children:_.mappings[n.entity].headers[1][Ie].substring(0,20)})]}),f(eo,{children:N("div",{className:"flex items-center space-x-2",children:[f("div",{className:"flex-1",children:f(nn,{id:Ie,value:$(Ie),onChange:R,withBlank:!0,children:_.mappings[n.entity].available.map((Re,Ye)=>f("option",{value:Re,children:O(Re)},Ye))})}),f(Ve,{className:"cursor-pointer",element:f0,size:24,onClick:()=>F(Ie)})]})})]},Ie)),n.entity==="bank_transaction"&&N(zl,{children:[f(eo,{className:"space-x-2",children:f("span",{children:e("bank_account")})}),f(eo,{colSpan:2,children:f(Sen,{value:b.bank_integration_id,onChange:_e=>y(Ie=>({...Ie,bank_integration_id:_e==null?void 0:_e.id})),onClearButtonClick:()=>y(_e=>({..._e,bank_integration_id:""})),errorMessage:C==null?void 0:C.errors.bank_integration_id})})]}),f(zl,{children:f(eo,{colSpan:2,children:f(Een,{entity:n.entity,importMap:b,onImport:B})})})]})]})]})}function Ten(){const[n]=ue(),[e,t]=w.useState(!1);return f("div",{className:"grid grid-cols-12",children:f("div",{className:"col-span-12",children:e?f(Ot,{title:n("restore"),children:f("span",{className:"text-gray-600 pl-6",children:n("import_started")})}):f(yWe,{entity:"company",onSuccess:!1,type:"zip",onFileImported:()=>t(!0)})})})}function Ien(){const[n]=ue(),e=t=>{t.preventDefault(),ie.processing(),Te("POST",ye("/api/v1/export"),{send_email:!0,report_keys:[]}).then(i=>{ie.success(i.data.message)})};return f(Ot,{children:f(U,{leftSide:n("export_company"),leftSideHelp:n("exported_data"),children:f(Ut,{onClick:e,children:n("export")})})})}const Len=Ea.div`
color: ${n=>n.theme.color};
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function Den(n){const{padding:e="regular",className:t,style:i}=n,r=Vn();return f(Len,{style:{...i},theme:{hoverColor:r.$2,color:r.$3},className:St(`w-full text-left block hover:bg-gray-50 text-sm ${t}`,{"px-4 sm:px-6 py-4":e=="regular","px-4 py-2":e=="small"}),children:n.children})}function Aen(n){const e=Object.prototype.toString.call(n).slice(8,-1);return e==="Object"&&typeof n[Symbol.iterator]=="function"?"Iterable":e==="Custom"&&n.constructor!==Object&&n instanceof Object?"Object":e}function CWe(n){let{styling:e,arrowStyle:t="single",expanded:i,nodeType:r,onClick:o}=n;return te.createElement("div",rt({},e("arrowContainer",t),{onClick:o}),te.createElement("div",e(["arrow","arrowSign"],r,i,t),"▶",t==="double"&&te.createElement("div",e(["arrowSign","arrowSignInner"]),"▶")))}function Ren(n,e){return n==="Object"?Object.keys(e).length:n==="Array"?e.length:1/0}function Nen(n){return typeof n.set=="function"}function Oen(n,e,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1/0,o;if(n==="Object"){let s=Object.getOwnPropertyNames(e);t&&s.sort(t===!0?void 0:t),s=s.slice(i,r+1),o={entries:s.map(a=>({key:a,value:e[a]}))}}else if(n==="Array")o={entries:e.slice(i,r+1).map((s,a)=>({key:a+i,value:s}))};else{let s=0;const a=[];let l=!0;const c=Nen(e);for(const u of e){if(s>r){l=!1;break}i<=s&&(c&&Array.isArray(u)?typeof u[0]=="string"||typeof u[0]=="number"?a.push({key:u[0],value:u[1]}):a.push({key:`[entry ${s}]`,value:{"[key]":u[0],"[value]":u[1]}}):a.push({key:s,value:u})),s++}o={hasMore:!l,entries:a}}return o}function DX(n,e,t){const i=[];for(;e-n>t*t;)t=t*t;for(let r=n;r<=e;r+=t)i.push({from:r,to:Math.min(e,r+t-1)});return i}function Pen(n,e,t,i){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:1/0;const s=Oen.bind(null,n,e,t);if(!i)return s().entries;const a=o<1/0,l=Math.min(o-r,Ren(n,e));if(n!=="Iterable"){if(l<=i||i<7)return s(r,o).entries}else if(l<=i&&!a)return s(r,o).entries;let c;if(n==="Iterable"){const{hasMore:u,entries:d}=s(r,r+i-1);c=u?[...d,...DX(r+i,r+2*i-1,i)]:d}else c=a?DX(r,o,i):[...s(0,i-5).entries,...DX(i-4,l-5,i),...s(l-4,l-1).entries];return c}function Men(n){const{styling:e,from:t,to:i,renderChildNodes:r,nodeType:o}=n,[s,a]=w.useState(!1),l=w.useCallback(()=>{a(!s)},[s]);return s?te.createElement("div",e("itemRange",s),r(n,t,i)):te.createElement("div",rt({},e("itemRange",s),{onClick:l}),te.createElement(CWe,{nodeType:o,styling:e,expanded:!1,onClick:l,arrowStyle:"double"}),`${t} ... ${i}`)}function Fen(n){return n.to!==void 0}function wWe(n,e,t){const{nodeType:i,data:r,collectionLimit:o,circularCache:s,keyPath:a,postprocessValue:l,sortObjectKeys:c}=n,u=[];return Pen(i,r,c,o,e,t).forEach(d=>{if(Fen(d))u.push(te.createElement(Men,rt({},n,{key:`ItemRange--${d.from}-${d.to}`,from:d.from,to:d.to,renderChildNodes:wWe})));else{const{key:h,value:g}=d,p=s.indexOf(g)!==-1;u.push(te.createElement(SWe,rt({},n,{postprocessValue:l,collectionLimit:o,key:`Node--${h}`,keyPath:[h,...a],value:l(g),circularCache:[...s,g],isCircular:p,hideRoot:!1})))}}),u}function Upe(n){const{circularCache:e=[],collectionLimit:t,createItemString:i,data:r,expandable:o,getItemString:s,hideRoot:a,isCircular:l,keyPath:c,labelRenderer:u,level:d=0,nodeType:h,nodeTypeIndicator:g,shouldExpandNodeInitially:p,styling:m}=n,[_,v]=w.useState(l?!1:p(c,r,d)),b=w.useCallback(()=>{o&&v(!_)},[o,_]),y=_||a&&d===0?wWe({...n,circularCache:e,level:d+1}):null,C=te.createElement("span",m("nestedNodeItemType",_),g),x=s(h,r,C,i(r,t),c),k=[c,h,_,o];return a?te.createElement("li",m("rootNode",...k),te.createElement("ul",m("rootNodeChildren",...k),y)):te.createElement("li",m("nestedNode",...k),o&&te.createElement(CWe,{styling:m,nodeType:h,expanded:_,onClick:b}),te.createElement("label",rt({},m(["label","nestedNodeLabel"],...k),{onClick:b}),u(...k)),te.createElement("span",rt({},m("nestedNodeItemString",...k),{onClick:b}),x),te.createElement("ul",m("nestedNodeChildren",...k),y))}function Ben(n){const e=Object.getOwnPropertyNames(n).length;return`${e} ${e!==1?"keys":"key"}`}function $en(n){let{data:e,...t}=n;return te.createElement(Upe,rt({},t,{data:e,nodeType:"Object",nodeTypeIndicator:t.nodeType==="Error"?"Error()":"{}",createItemString:Ben,expandable:Object.getOwnPropertyNames(e).length>0}))}function Ven(n){return`${n.length} ${n.length!==1?"items":"item"}`}function Hen(n){let{data:e,...t}=n;return te.createElement(Upe,rt({},t,{data:e,nodeType:"Array",nodeTypeIndicator:"[]",createItemString:Ven,expandable:e.length>0}))}function Wen(n,e){let t=0,i=!1;if(Number.isSafeInteger(n.size))t=n.size;else for(const r of n){if(e&&t+1>e){i=!0;break}t+=1}return`${i?">":""}${t} ${t!==1?"entries":"entry"}`}function zen(n){return te.createElement(Upe,rt({},n,{nodeType:"Iterable",nodeTypeIndicator:"()",createItemString:Wen,expandable:!0}))}function Gb(n){let{nodeType:e,styling:t,labelRenderer:i,keyPath:r,valueRenderer:o,value:s,valueGetter:a=l=>l}=n;return te.createElement("li",t("value",e,r),te.createElement("label",t(["label","valueLabel"],e,r),i(r,e,!1,!1)),te.createElement("span",t("valueText",e,r),o(a(s),s,...r)))}function SWe(n){let{getItemString:e,keyPath:t,labelRenderer:i,styling:r,value:o,valueRenderer:s,isCustomNode:a,...l}=n;const c=a(o)?"Custom":Aen(o),u={getItemString:e,key:t[0],keyPath:t,labelRenderer:i,nodeType:c,styling:r,value:o,valueRenderer:s},d={...l,...u,data:o,isCustomNode:a};switch(c){case"Object":case"Error":case"WeakMap":case"WeakSet":return te.createElement($en,d);case"Array":return te.createElement(Hen,d);case"Iterable":case"Map":case"Set":return te.createElement(zen,d);case"String":return te.createElement(Gb,rt({},u,{valueGetter:h=>`"${h}"`}));case"Number":return te.createElement(Gb,u);case"Boolean":return te.createElement(Gb,rt({},u,{valueGetter:h=>h?"true":"false"}));case"Date":return te.createElement(Gb,rt({},u,{valueGetter:h=>h.toISOString()}));case"Null":return te.createElement(Gb,rt({},u,{valueGetter:()=>"null"}));case"Undefined":return te.createElement(Gb,rt({},u,{valueGetter:()=>"undefined"}));case"Function":case"Symbol":return te.createElement(Gb,rt({},u,{valueGetter:h=>h.toString()}));case"Custom":return te.createElement(Gb,u);default:return te.createElement(Gb,rt({},u,{valueGetter:()=>`<${c}>`}))}}const jen={scheme:"threezerotwofour",author:"jan t. sott (http://github.com/idleberg)",base00:"#090300",base01:"#3a3432",base02:"#4a4543",base03:"#5c5855",base04:"#807d7c",base05:"#a5a2a2",base06:"#d6d5d4",base07:"#f7f7f7",base08:"#db2d20",base09:"#e8bbd0",base0A:"#fded02",base0B:"#01a252",base0C:"#b5e4f4",base0D:"#01a0e4",base0E:"#a16a94",base0F:"#cdab53"},Uen={scheme:"apathy",author:"jannik siebert (https://github.com/janniks)",base00:"#031A16",base01:"#0B342D",base02:"#184E45",base03:"#2B685E",base04:"#5F9C92",base05:"#81B5AC",base06:"#A7CEC8",base07:"#D2E7E4",base08:"#3E9688",base09:"#3E7996",base0A:"#3E4C96",base0B:"#883E96",base0C:"#963E4C",base0D:"#96883E",base0E:"#4C963E",base0F:"#3E965B"},qen={scheme:"ashes",author:"jannik siebert (https://github.com/janniks)",base00:"#1C2023",base01:"#393F45",base02:"#565E65",base03:"#747C84",base04:"#ADB3BA",base05:"#C7CCD1",base06:"#DFE2E5",base07:"#F3F4F5",base08:"#C7AE95",base09:"#C7C795",base0A:"#AEC795",base0B:"#95C7AE",base0C:"#95AEC7",base0D:"#AE95C7",base0E:"#C795AE",base0F:"#C79595"},Ken={scheme:"atelier dune",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune)",base00:"#20201d",base01:"#292824",base02:"#6e6b5e",base03:"#7d7a68",base04:"#999580",base05:"#a6a28c",base06:"#e8e4cf",base07:"#fefbec",base08:"#d73737",base09:"#b65611",base0A:"#cfb017",base0B:"#60ac39",base0C:"#1fad83",base0D:"#6684e1",base0E:"#b854d4",base0F:"#d43552"},Gen={scheme:"atelier forest",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest)",base00:"#1b1918",base01:"#2c2421",base02:"#68615e",base03:"#766e6b",base04:"#9c9491",base05:"#a8a19f",base06:"#e6e2e0",base07:"#f1efee",base08:"#f22c40",base09:"#df5320",base0A:"#d5911a",base0B:"#5ab738",base0C:"#00ad9c",base0D:"#407ee7",base0E:"#6666ea",base0F:"#c33ff3"},Yen={scheme:"atelier heath",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/heath)",base00:"#1b181b",base01:"#292329",base02:"#695d69",base03:"#776977",base04:"#9e8f9e",base05:"#ab9bab",base06:"#d8cad8",base07:"#f7f3f7",base08:"#ca402b",base09:"#a65926",base0A:"#bb8a35",base0B:"#379a37",base0C:"#159393",base0D:"#516aec",base0E:"#7b59c0",base0F:"#cc33cc"},Qen={scheme:"atelier lakeside",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/lakeside/)",base00:"#161b1d",base01:"#1f292e",base02:"#516d7b",base03:"#5a7b8c",base04:"#7195a8",base05:"#7ea2b4",base06:"#c1e4f6",base07:"#ebf8ff",base08:"#d22d72",base09:"#935c25",base0A:"#8a8a0f",base0B:"#568c3b",base0C:"#2d8f6f",base0D:"#257fad",base0E:"#5d5db1",base0F:"#b72dd2"},Xen={scheme:"atelier seaside",author:"bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside/)",base00:"#131513",base01:"#242924",base02:"#5e6e5e",base03:"#687d68",base04:"#809980",base05:"#8ca68c",base06:"#cfe8cf",base07:"#f0fff0",base08:"#e6193c",base09:"#87711d",base0A:"#c3c322",base0B:"#29a329",base0C:"#1999b3",base0D:"#3d62f5",base0E:"#ad2bee",base0F:"#e619c3"},Zen={scheme:"bespin",author:"jan t. sott",base00:"#28211c",base01:"#36312e",base02:"#5e5d5c",base03:"#666666",base04:"#797977",base05:"#8a8986",base06:"#9d9b97",base07:"#baae9e",base08:"#cf6a4c",base09:"#cf7d34",base0A:"#f9ee98",base0B:"#54be0d",base0C:"#afc4db",base0D:"#5ea6ea",base0E:"#9b859d",base0F:"#937121"},Jen={scheme:"brewer",author:"timothée poisot (http://github.com/tpoisot)",base00:"#0c0d0e",base01:"#2e2f30",base02:"#515253",base03:"#737475",base04:"#959697",base05:"#b7b8b9",base06:"#dadbdc",base07:"#fcfdfe",base08:"#e31a1c",base09:"#e6550d",base0A:"#dca060",base0B:"#31a354",base0C:"#80b1d3",base0D:"#3182bd",base0E:"#756bb1",base0F:"#b15928"},etn={scheme:"bright",author:"chris kempson (http://chriskempson.com)",base00:"#000000",base01:"#303030",base02:"#505050",base03:"#b0b0b0",base04:"#d0d0d0",base05:"#e0e0e0",base06:"#f5f5f5",base07:"#ffffff",base08:"#fb0120",base09:"#fc6d24",base0A:"#fda331",base0B:"#a1c659",base0C:"#76c7b7",base0D:"#6fb3d2",base0E:"#d381c3",base0F:"#be643c"},ttn={scheme:"chalk",author:"chris kempson (http://chriskempson.com)",base00:"#151515",base01:"#202020",base02:"#303030",base03:"#505050",base04:"#b0b0b0",base05:"#d0d0d0",base06:"#e0e0e0",base07:"#f5f5f5",base08:"#fb9fb1",base09:"#eda987",base0A:"#ddb26f",base0B:"#acc267",base0C:"#12cfc0",base0D:"#6fc2ef",base0E:"#e1a3ee",base0F:"#deaf8f"},ntn={scheme:"codeschool",author:"brettof86",base00:"#232c31",base01:"#1c3657",base02:"#2a343a",base03:"#3f4944",base04:"#84898c",base05:"#9ea7a6",base06:"#a7cfa3",base07:"#b5d8f6",base08:"#2a5491",base09:"#43820d",base0A:"#a03b1e",base0B:"#237986",base0C:"#b02f30",base0D:"#484d79",base0E:"#c59820",base0F:"#c98344"},itn={scheme:"colors",author:"mrmrs (http://clrs.cc)",base00:"#111111",base01:"#333333",base02:"#555555",base03:"#777777",base04:"#999999",base05:"#bbbbbb",base06:"#dddddd",base07:"#ffffff",base08:"#ff4136",base09:"#ff851b",base0A:"#ffdc00",base0B:"#2ecc40",base0C:"#7fdbff",base0D:"#0074d9",base0E:"#b10dc9",base0F:"#85144b"},EWe={scheme:"default",author:"chris kempson (http://chriskempson.com)",base00:"#181818",base01:"#282828",base02:"#383838",base03:"#585858",base04:"#b8b8b8",base05:"#d8d8d8",base06:"#e8e8e8",base07:"#f8f8f8",base08:"#ab4642",base09:"#dc9656",base0A:"#f7ca88",base0B:"#a1b56c",base0C:"#86c1b9",base0D:"#7cafc2",base0E:"#ba8baf",base0F:"#a16946"},rtn={scheme:"eighties",author:"chris kempson (http://chriskempson.com)",base00:"#2d2d2d",base01:"#393939",base02:"#515151",base03:"#747369",base04:"#a09f93",base05:"#d3d0c8",base06:"#e8e6df",base07:"#f2f0ec",base08:"#f2777a",base09:"#f99157",base0A:"#ffcc66",base0B:"#99cc99",base0C:"#66cccc",base0D:"#6699cc",base0E:"#cc99cc",base0F:"#d27b53"},otn={scheme:"embers",author:"jannik siebert (https://github.com/janniks)",base00:"#16130F",base01:"#2C2620",base02:"#433B32",base03:"#5A5047",base04:"#8A8075",base05:"#A39A90",base06:"#BEB6AE",base07:"#DBD6D1",base08:"#826D57",base09:"#828257",base0A:"#6D8257",base0B:"#57826D",base0C:"#576D82",base0D:"#6D5782",base0E:"#82576D",base0F:"#825757"},stn={scheme:"flat",author:"chris kempson (http://chriskempson.com)",base00:"#2C3E50",base01:"#34495E",base02:"#7F8C8D",base03:"#95A5A6",base04:"#BDC3C7",base05:"#e0e0e0",base06:"#f5f5f5",base07:"#ECF0F1",base08:"#E74C3C",base09:"#E67E22",base0A:"#F1C40F",base0B:"#2ECC71",base0C:"#1ABC9C",base0D:"#3498DB",base0E:"#9B59B6",base0F:"#be643c"},atn={scheme:"google",author:"seth wright (http://sethawright.com)",base00:"#1d1f21",base01:"#282a2e",base02:"#373b41",base03:"#969896",base04:"#b4b7b4",base05:"#c5c8c6",base06:"#e0e0e0",base07:"#ffffff",base08:"#CC342B",base09:"#F96A38",base0A:"#FBA922",base0B:"#198844",base0C:"#3971ED",base0D:"#3971ED",base0E:"#A36AC7",base0F:"#3971ED"},ltn={scheme:"grayscale",author:"alexandre gavioli (https://github.com/alexx2/)",base00:"#101010",base01:"#252525",base02:"#464646",base03:"#525252",base04:"#ababab",base05:"#b9b9b9",base06:"#e3e3e3",base07:"#f7f7f7",base08:"#7c7c7c",base09:"#999999",base0A:"#a0a0a0",base0B:"#8e8e8e",base0C:"#868686",base0D:"#686868",base0E:"#747474",base0F:"#5e5e5e"},ctn={scheme:"green screen",author:"chris kempson (http://chriskempson.com)",base00:"#001100",base01:"#003300",base02:"#005500",base03:"#007700",base04:"#009900",base05:"#00bb00",base06:"#00dd00",base07:"#00ff00",base08:"#007700",base09:"#009900",base0A:"#007700",base0B:"#00bb00",base0C:"#005500",base0D:"#009900",base0E:"#00bb00",base0F:"#005500"},utn={scheme:"harmonic16",author:"jannik siebert (https://github.com/janniks)",base00:"#0b1c2c",base01:"#223b54",base02:"#405c79",base03:"#627e99",base04:"#aabcce",base05:"#cbd6e2",base06:"#e5ebf1",base07:"#f7f9fb",base08:"#bf8b56",base09:"#bfbf56",base0A:"#8bbf56",base0B:"#56bf8b",base0C:"#568bbf",base0D:"#8b56bf",base0E:"#bf568b",base0F:"#bf5656"},dtn={scheme:"hopscotch",author:"jan t. sott",base00:"#322931",base01:"#433b42",base02:"#5c545b",base03:"#797379",base04:"#989498",base05:"#b9b5b8",base06:"#d5d3d5",base07:"#ffffff",base08:"#dd464c",base09:"#fd8b19",base0A:"#fdcc59",base0B:"#8fc13e",base0C:"#149b93",base0D:"#1290bf",base0E:"#c85e7c",base0F:"#b33508"},htn={scheme:"isotope",author:"jan t. sott",base00:"#000000",base01:"#404040",base02:"#606060",base03:"#808080",base04:"#c0c0c0",base05:"#d0d0d0",base06:"#e0e0e0",base07:"#ffffff",base08:"#ff0000",base09:"#ff9900",base0A:"#ff0099",base0B:"#33ff00",base0C:"#00ffff",base0D:"#0066ff",base0E:"#cc00ff",base0F:"#3300ff"},ftn={scheme:"marrakesh",author:"alexandre gavioli (http://github.com/alexx2/)",base00:"#201602",base01:"#302e00",base02:"#5f5b17",base03:"#6c6823",base04:"#86813b",base05:"#948e48",base06:"#ccc37a",base07:"#faf0a5",base08:"#c35359",base09:"#b36144",base0A:"#a88339",base0B:"#18974e",base0C:"#75a738",base0D:"#477ca1",base0E:"#8868b3",base0F:"#b3588e"},gtn={scheme:"mocha",author:"chris kempson (http://chriskempson.com)",base00:"#3B3228",base01:"#534636",base02:"#645240",base03:"#7e705a",base04:"#b8afad",base05:"#d0c8c6",base06:"#e9e1dd",base07:"#f5eeeb",base08:"#cb6077",base09:"#d28b71",base0A:"#f4bc87",base0B:"#beb55b",base0C:"#7bbda4",base0D:"#8ab3b5",base0E:"#a89bb9",base0F:"#bb9584"},ptn={scheme:"monokai",author:"wimer hazenberg (http://www.monokai.nl)",base00:"#272822",base01:"#383830",base02:"#49483e",base03:"#75715e",base04:"#a59f85",base05:"#f8f8f2",base06:"#f5f4f1",base07:"#f9f8f5",base08:"#f92672",base09:"#fd971f",base0A:"#f4bf75",base0B:"#a6e22e",base0C:"#a1efe4",base0D:"#66d9ef",base0E:"#ae81ff",base0F:"#cc6633"},mtn={scheme:"ocean",author:"chris kempson (http://chriskempson.com)",base00:"#2b303b",base01:"#343d46",base02:"#4f5b66",base03:"#65737e",base04:"#a7adba",base05:"#c0c5ce",base06:"#dfe1e8",base07:"#eff1f5",base08:"#bf616a",base09:"#d08770",base0A:"#ebcb8b",base0B:"#a3be8c",base0C:"#96b5b4",base0D:"#8fa1b3",base0E:"#b48ead",base0F:"#ab7967"},_tn={scheme:"paraiso",author:"jan t. sott",base00:"#2f1e2e",base01:"#41323f",base02:"#4f424c",base03:"#776e71",base04:"#8d8687",base05:"#a39e9b",base06:"#b9b6b0",base07:"#e7e9db",base08:"#ef6155",base09:"#f99b15",base0A:"#fec418",base0B:"#48b685",base0C:"#5bc4bf",base0D:"#06b6ef",base0E:"#815ba4",base0F:"#e96ba8"},vtn={scheme:"pop",author:"chris kempson (http://chriskempson.com)",base00:"#000000",base01:"#202020",base02:"#303030",base03:"#505050",base04:"#b0b0b0",base05:"#d0d0d0",base06:"#e0e0e0",base07:"#ffffff",base08:"#eb008a",base09:"#f29333",base0A:"#f8ca12",base0B:"#37b349",base0C:"#00aabb",base0D:"#0e5a94",base0E:"#b31e8d",base0F:"#7a2d00"},btn={scheme:"railscasts",author:"ryan bates (http://railscasts.com)",base00:"#2b2b2b",base01:"#272935",base02:"#3a4055",base03:"#5a647e",base04:"#d4cfc9",base05:"#e6e1dc",base06:"#f4f1ed",base07:"#f9f7f3",base08:"#da4939",base09:"#cc7833",base0A:"#ffc66d",base0B:"#a5c261",base0C:"#519f50",base0D:"#6d9cbe",base0E:"#b6b3eb",base0F:"#bc9458"},ytn={scheme:"shapeshifter",author:"tyler benziger (http://tybenz.com)",base00:"#000000",base01:"#040404",base02:"#102015",base03:"#343434",base04:"#555555",base05:"#ababab",base06:"#e0e0e0",base07:"#f9f9f9",base08:"#e92f2f",base09:"#e09448",base0A:"#dddd13",base0B:"#0ed839",base0C:"#23edda",base0D:"#3b48e3",base0E:"#f996e2",base0F:"#69542d"},Ctn={scheme:"solarized",author:"ethan schoonover (http://ethanschoonover.com/solarized)",base00:"#002b36",base01:"#073642",base02:"#586e75",base03:"#657b83",base04:"#839496",base05:"#93a1a1",base06:"#eee8d5",base07:"#fdf6e3",base08:"#dc322f",base09:"#cb4b16",base0A:"#b58900",base0B:"#859900",base0C:"#2aa198",base0D:"#268bd2",base0E:"#6c71c4",base0F:"#d33682"},wtn={scheme:"summerfruit",author:"christopher corley (http://cscorley.github.io/)",base00:"#151515",base01:"#202020",base02:"#303030",base03:"#505050",base04:"#B0B0B0",base05:"#D0D0D0",base06:"#E0E0E0",base07:"#FFFFFF",base08:"#FF0086",base09:"#FD8900",base0A:"#ABA800",base0B:"#00C918",base0C:"#1faaaa",base0D:"#3777E6",base0E:"#AD00A1",base0F:"#cc6633"},Stn={scheme:"tomorrow",author:"chris kempson (http://chriskempson.com)",base00:"#1d1f21",base01:"#282a2e",base02:"#373b41",base03:"#969896",base04:"#b4b7b4",base05:"#c5c8c6",base06:"#e0e0e0",base07:"#ffffff",base08:"#cc6666",base09:"#de935f",base0A:"#f0c674",base0B:"#b5bd68",base0C:"#8abeb7",base0D:"#81a2be",base0E:"#b294bb",base0F:"#a3685a"},Etn={scheme:"london tube",author:"jan t. sott",base00:"#231f20",base01:"#1c3f95",base02:"#5a5758",base03:"#737171",base04:"#959ca1",base05:"#d9d8d8",base06:"#e7e7e8",base07:"#ffffff",base08:"#ee2e24",base09:"#f386a1",base0A:"#ffd204",base0B:"#00853e",base0C:"#85cebc",base0D:"#009ddc",base0E:"#98005d",base0F:"#b06110"},xtn={scheme:"twilight",author:"david hart (http://hart-dev.com)",base00:"#1e1e1e",base01:"#323537",base02:"#464b50",base03:"#5f5a60",base04:"#838184",base05:"#a7a7a7",base06:"#c3c3c3",base07:"#ffffff",base08:"#cf6a4c",base09:"#cda869",base0A:"#f9ee98",base0B:"#8f9d6a",base0C:"#afc4db",base0D:"#7587a6",base0E:"#9b859d",base0F:"#9b703f"},ktn=Object.freeze(Object.defineProperty({__proto__:null,apathy:Uen,ashes:qen,atelierDune:Ken,atelierForest:Gen,atelierHeath:Yen,atelierLakeside:Qen,atelierSeaside:Xen,bespin:Zen,brewer:Jen,bright:etn,chalk:ttn,codeschool:ntn,colors:itn,default:EWe,eighties:rtn,embers:otn,flat:stn,google:atn,grayscale:ltn,greenscreen:ctn,harmonic:utn,hopscotch:dtn,isotope:htn,marrakesh:ftn,mocha:gtn,monokai:ptn,ocean:mtn,paraiso:_tn,pop:vtn,railscasts:btn,shapeshifter:ytn,solarized:Ctn,summerfruit:wtn,threezerotwofour:jen,tomorrow:Stn,tube:Etn,twilight:xtn},Symbol.toStringTag,{value:"Module"}));var xWe={exports:{}},kWe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},TWe={exports:{}},Ttn=function(e){return!e||typeof e=="string"?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!=="String")},Itn=Ttn,Ltn=Array.prototype.concat,Dtn=Array.prototype.slice,QTe=TWe.exports=function(e){for(var t=[],i=0,r=e.length;i<r;i++){var o=e[i];Itn(o)?t=Ltn.call(t,Dtn.call(o)):t.push(o)}return t};QTe.wrap=function(n){return function(){return n(QTe(arguments))}};var Atn=TWe.exports,EO=kWe,t5=Atn,IWe=Object.hasOwnProperty,LWe=Object.create(null);for(var AX in EO)IWe.call(EO,AX)&&(LWe[EO[AX]]=AX);var rg=xWe.exports={to:{},get:{}};rg.get=function(n){var e=n.substring(0,3).toLowerCase(),t,i;switch(e){case"hsl":t=rg.get.hsl(n),i="hsl";break;case"hwb":t=rg.get.hwb(n),i="hwb";break;default:t=rg.get.rgb(n),i="rgb";break}return t?{model:i,value:t}:null};rg.get.rgb=function(n){if(!n)return null;var e=/^#([a-f0-9]{3,4})$/i,t=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,i=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,r=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^(\w+)$/,s=[0,0,0,1],a,l,c;if(a=n.match(t)){for(c=a[2],a=a[1],l=0;l<3;l++){var u=l*2;s[l]=parseInt(a.slice(u,u+2),16)}c&&(s[3]=parseInt(c,16)/255)}else if(a=n.match(e)){for(a=a[1],c=a[3],l=0;l<3;l++)s[l]=parseInt(a[l]+a[l],16);c&&(s[3]=parseInt(c+c,16)/255)}else if(a=n.match(i)){for(l=0;l<3;l++)s[l]=parseInt(a[l+1],0);a[4]&&(a[5]?s[3]=parseFloat(a[4])*.01:s[3]=parseFloat(a[4]))}else if(a=n.match(r)){for(l=0;l<3;l++)s[l]=Math.round(parseFloat(a[l+1])*2.55);a[4]&&(a[5]?s[3]=parseFloat(a[4])*.01:s[3]=parseFloat(a[4]))}else return(a=n.match(o))?a[1]==="transparent"?[0,0,0,0]:IWe.call(EO,a[1])?(s=EO[a[1]],s[3]=1,s):null:null;for(l=0;l<3;l++)s[l]=EC(s[l],0,255);return s[3]=EC(s[3],0,1),s};rg.get.hsl=function(n){if(!n)return null;var e=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=n.match(e);if(t){var i=parseFloat(t[4]),r=(parseFloat(t[1])%360+360)%360,o=EC(parseFloat(t[2]),0,100),s=EC(parseFloat(t[3]),0,100),a=EC(isNaN(i)?1:i,0,1);return[r,o,s,a]}return null};rg.get.hwb=function(n){if(!n)return null;var e=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=n.match(e);if(t){var i=parseFloat(t[4]),r=(parseFloat(t[1])%360+360)%360,o=EC(parseFloat(t[2]),0,100),s=EC(parseFloat(t[3]),0,100),a=EC(isNaN(i)?1:i,0,1);return[r,o,s,a]}return null};rg.to.hex=function(){var n=t5(arguments);return"#"+iB(n[0])+iB(n[1])+iB(n[2])+(n[3]<1?iB(Math.round(n[3]*255)):"")};rg.to.rgb=function(){var n=t5(arguments);return n.length<4||n[3]===1?"rgb("+Math.round(n[0])+", "+Math.round(n[1])+", "+Math.round(n[2])+")":"rgba("+Math.round(n[0])+", "+Math.round(n[1])+", "+Math.round(n[2])+", "+n[3]+")"};rg.to.rgb.percent=function(){var n=t5(arguments),e=Math.round(n[0]/255*100),t=Math.round(n[1]/255*100),i=Math.round(n[2]/255*100);return n.length<4||n[3]===1?"rgb("+e+"%, "+t+"%, "+i+"%)":"rgba("+e+"%, "+t+"%, "+i+"%, "+n[3]+")"};rg.to.hsl=function(){var n=t5(arguments);return n.length<4||n[3]===1?"hsl("+n[0]+", "+n[1]+"%, "+n[2]+"%)":"hsla("+n[0]+", "+n[1]+"%, "+n[2]+"%, "+n[3]+")"};rg.to.hwb=function(){var n=t5(arguments),e="";return n.length>=4&&n[3]!==1&&(e=", "+n[3]),"hwb("+n[0]+", "+n[1]+"%, "+n[2]+"%"+e+")"};rg.to.keyword=function(n){return LWe[n.slice(0,3)]};function EC(n,e,t){return Math.min(Math.max(e,n),t)}function iB(n){var e=Math.round(n).toString(16).toUpperCase();return e.length<2?"0"+e:e}var Rtn=xWe.exports,DWe={exports:{}},qE=kWe,AWe={};for(var RX in qE)qE.hasOwnProperty(RX)&&(AWe[qE[RX]]=RX);var _i=DWe.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var Sh in _i)if(_i.hasOwnProperty(Sh)){if(!("channels"in _i[Sh]))throw new Error("missing channels property: "+Sh);if(!("labels"in _i[Sh]))throw new Error("missing channel labels property: "+Sh);if(_i[Sh].labels.length!==_i[Sh].channels)throw new Error("channel and label counts mismatch: "+Sh);var Ntn=_i[Sh].channels,Otn=_i[Sh].labels;delete _i[Sh].channels,delete _i[Sh].labels,Object.defineProperty(_i[Sh],"channels",{value:Ntn}),Object.defineProperty(_i[Sh],"labels",{value:Otn})}_i.rgb.hsl=function(n){var e=n[0]/255,t=n[1]/255,i=n[2]/255,r=Math.min(e,t,i),o=Math.max(e,t,i),s=o-r,a,l,c;return o===r?a=0:e===o?a=(t-i)/s:t===o?a=2+(i-e)/s:i===o&&(a=4+(e-t)/s),a=Math.min(a*60,360),a<0&&(a+=360),c=(r+o)/2,o===r?l=0:c<=.5?l=s/(o+r):l=s/(2-o-r),[a,l*100,c*100]};_i.rgb.hsv=function(n){var e,t,i,r,o,s=n[0]/255,a=n[1]/255,l=n[2]/255,c=Math.max(s,a,l),u=c-Math.min(s,a,l),d=function(h){return(c-h)/6/u+1/2};return u===0?r=o=0:(o=u/c,e=d(s),t=d(a),i=d(l),s===c?r=i-t:a===c?r=1/3+e-i:l===c&&(r=2/3+t-e),r<0?r+=1:r>1&&(r-=1)),[r*360,o*100,c*100]};_i.rgb.hwb=function(n){var e=n[0],t=n[1],i=n[2],r=_i.rgb.hsl(n)[0],o=1/255*Math.min(e,Math.min(t,i));return i=1-1/255*Math.max(e,Math.max(t,i)),[r,o*100,i*100]};_i.rgb.cmyk=function(n){var e=n[0]/255,t=n[1]/255,i=n[2]/255,r,o,s,a;return a=Math.min(1-e,1-t,1-i),r=(1-e-a)/(1-a)||0,o=(1-t-a)/(1-a)||0,s=(1-i-a)/(1-a)||0,[r*100,o*100,s*100,a*100]};function Ptn(n,e){return Math.pow(n[0]-e[0],2)+Math.pow(n[1]-e[1],2)+Math.pow(n[2]-e[2],2)}_i.rgb.keyword=function(n){var e=AWe[n];if(e)return e;var t=1/0,i;for(var r in qE)if(qE.hasOwnProperty(r)){var o=qE[r],s=Ptn(n,o);s<t&&(t=s,i=r)}return i};_i.keyword.rgb=function(n){return qE[n]};_i.rgb.xyz=function(n){var e=n[0]/255,t=n[1]/255,i=n[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var r=e*.4124+t*.3576+i*.1805,o=e*.2126+t*.7152+i*.0722,s=e*.0193+t*.1192+i*.9505;return[r*100,o*100,s*100]};_i.rgb.lab=function(n){var e=_i.rgb.xyz(n),t=e[0],i=e[1],r=e[2],o,s,a;return t/=95.047,i/=100,r/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,o=116*i-16,s=500*(t-i),a=200*(i-r),[o,s,a]};_i.hsl.rgb=function(n){var e=n[0]/360,t=n[1]/100,i=n[2]/100,r,o,s,a,l;if(t===0)return l=i*255,[l,l,l];i<.5?o=i*(1+t):o=i+t-i*t,r=2*i-o,a=[0,0,0];for(var c=0;c<3;c++)s=e+1/3*-(c-1),s<0&&s++,s>1&&s--,6*s<1?l=r+(o-r)*6*s:2*s<1?l=o:3*s<2?l=r+(o-r)*(2/3-s)*6:l=r,a[c]=l*255;return a};_i.hsl.hsv=function(n){var e=n[0],t=n[1]/100,i=n[2]/100,r=t,o=Math.max(i,.01),s,a;return i*=2,t*=i<=1?i:2-i,r*=o<=1?o:2-o,a=(i+t)/2,s=i===0?2*r/(o+r):2*t/(i+t),[e,s*100,a*100]};_i.hsv.rgb=function(n){var e=n[0]/60,t=n[1]/100,i=n[2]/100,r=Math.floor(e)%6,o=e-Math.floor(e),s=255*i*(1-t),a=255*i*(1-t*o),l=255*i*(1-t*(1-o));switch(i*=255,r){case 0:return[i,l,s];case 1:return[a,i,s];case 2:return[s,i,l];case 3:return[s,a,i];case 4:return[l,s,i];case 5:return[i,s,a]}};_i.hsv.hsl=function(n){var e=n[0],t=n[1]/100,i=n[2]/100,r=Math.max(i,.01),o,s,a;return a=(2-t)*i,o=(2-t)*r,s=t*r,s/=o<=1?o:2-o,s=s||0,a/=2,[e,s*100,a*100]};_i.hwb.rgb=function(n){var e=n[0]/360,t=n[1]/100,i=n[2]/100,r=t+i,o,s,a,l;r>1&&(t/=r,i/=r),o=Math.floor(6*e),s=1-i,a=6*e-o,o&1&&(a=1-a),l=t+a*(s-t);var c,u,d;switch(o){default:case 6:case 0:c=s,u=l,d=t;break;case 1:c=l,u=s,d=t;break;case 2:c=t,u=s,d=l;break;case 3:c=t,u=l,d=s;break;case 4:c=l,u=t,d=s;break;case 5:c=s,u=t,d=l;break}return[c*255,u*255,d*255]};_i.cmyk.rgb=function(n){var e=n[0]/100,t=n[1]/100,i=n[2]/100,r=n[3]/100,o,s,a;return o=1-Math.min(1,e*(1-r)+r),s=1-Math.min(1,t*(1-r)+r),a=1-Math.min(1,i*(1-r)+r),[o*255,s*255,a*255]};_i.xyz.rgb=function(n){var e=n[0]/100,t=n[1]/100,i=n[2]/100,r,o,s;return r=e*3.2406+t*-1.5372+i*-.4986,o=e*-.9689+t*1.8758+i*.0415,s=e*.0557+t*-.204+i*1.057,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[r*255,o*255,s*255]};_i.xyz.lab=function(n){var e=n[0],t=n[1],i=n[2],r,o,s;return e/=95.047,t/=100,i/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,r=116*t-16,o=500*(e-t),s=200*(t-i),[r,o,s]};_i.lab.xyz=function(n){var e=n[0],t=n[1],i=n[2],r,o,s;o=(e+16)/116,r=t/500+o,s=o-i/200;var a=Math.pow(o,3),l=Math.pow(r,3),c=Math.pow(s,3);return o=a>.008856?a:(o-16/116)/7.787,r=l>.008856?l:(r-16/116)/7.787,s=c>.008856?c:(s-16/116)/7.787,r*=95.047,o*=100,s*=108.883,[r,o,s]};_i.lab.lch=function(n){var e=n[0],t=n[1],i=n[2],r,o,s;return r=Math.atan2(i,t),o=r*360/2/Math.PI,o<0&&(o+=360),s=Math.sqrt(t*t+i*i),[e,s,o]};_i.lch.lab=function(n){var e=n[0],t=n[1],i=n[2],r,o,s;return s=i/360*2*Math.PI,r=t*Math.cos(s),o=t*Math.sin(s),[e,r,o]};_i.rgb.ansi16=function(n){var e=n[0],t=n[1],i=n[2],r=1 in arguments?arguments[1]:_i.rgb.hsv(n)[2];if(r=Math.round(r/50),r===0)return 30;var o=30+(Math.round(i/255)<<2|Math.round(t/255)<<1|Math.round(e/255));return r===2&&(o+=60),o};_i.hsv.ansi16=function(n){return _i.rgb.ansi16(_i.hsv.rgb(n),n[2])};_i.rgb.ansi256=function(n){var e=n[0],t=n[1],i=n[2];if(e===t&&t===i)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var r=16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(i/255*5);return r};_i.ansi16.rgb=function(n){var e=n%10;if(e===0||e===7)return n>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var t=(~~(n>50)+1)*.5,i=(e&1)*t*255,r=(e>>1&1)*t*255,o=(e>>2&1)*t*255;return[i,r,o]};_i.ansi256.rgb=function(n){if(n>=232){var e=(n-232)*10+8;return[e,e,e]}n-=16;var t,i=Math.floor(n/36)/5*255,r=Math.floor((t=n%36)/6)/5*255,o=t%6/5*255;return[i,r,o]};_i.rgb.hex=function(n){var e=((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255),t=e.toString(16).toUpperCase();return"000000".substring(t.length)+t};_i.hex.rgb=function(n){var e=n.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var t=e[0];e[0].length===3&&(t=t.split("").map(function(a){return a+a}).join(""));var i=parseInt(t,16),r=i>>16&255,o=i>>8&255,s=i&255;return[r,o,s]};_i.rgb.hcg=function(n){var e=n[0]/255,t=n[1]/255,i=n[2]/255,r=Math.max(Math.max(e,t),i),o=Math.min(Math.min(e,t),i),s=r-o,a,l;return s<1?a=o/(1-s):a=0,s<=0?l=0:r===e?l=(t-i)/s%6:r===t?l=2+(i-e)/s:l=4+(e-t)/s+4,l/=6,l%=1,[l*360,s*100,a*100]};_i.hsl.hcg=function(n){var e=n[1]/100,t=n[2]/100,i=1,r=0;return t<.5?i=2*e*t:i=2*e*(1-t),i<1&&(r=(t-.5*i)/(1-i)),[n[0],i*100,r*100]};_i.hsv.hcg=function(n){var e=n[1]/100,t=n[2]/100,i=e*t,r=0;return i<1&&(r=(t-i)/(1-i)),[n[0],i*100,r*100]};_i.hcg.rgb=function(n){var e=n[0]/360,t=n[1]/100,i=n[2]/100;if(t===0)return[i*255,i*255,i*255];var r=[0,0,0],o=e%1*6,s=o%1,a=1-s,l=0;switch(Math.floor(o)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=a,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=a,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=a}return l=(1-t)*i,[(t*r[0]+l)*255,(t*r[1]+l)*255,(t*r[2]+l)*255]};_i.hcg.hsv=function(n){var e=n[1]/100,t=n[2]/100,i=e+t*(1-e),r=0;return i>0&&(r=e/i),[n[0],r*100,i*100]};_i.hcg.hsl=function(n){var e=n[1]/100,t=n[2]/100,i=t*(1-e)+.5*e,r=0;return i>0&&i<.5?r=e/(2*i):i>=.5&&i<1&&(r=e/(2*(1-i))),[n[0],r*100,i*100]};_i.hcg.hwb=function(n){var e=n[1]/100,t=n[2]/100,i=e+t*(1-e);return[n[0],(i-e)*100,(1-i)*100]};_i.hwb.hcg=function(n){var e=n[1]/100,t=n[2]/100,i=1-t,r=i-e,o=0;return r<1&&(o=(i-r)/(1-r)),[n[0],r*100,o*100]};_i.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]};_i.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]};_i.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};_i.gray.hsl=_i.gray.hsv=function(n){return[0,0,n[0]]};_i.gray.hwb=function(n){return[0,100,n[0]]};_i.gray.cmyk=function(n){return[0,0,0,n[0]]};_i.gray.lab=function(n){return[n[0],0,0]};_i.gray.hex=function(n){var e=Math.round(n[0]/100*255)&255,t=(e<<16)+(e<<8)+e,i=t.toString(16).toUpperCase();return"000000".substring(i.length)+i};_i.rgb.gray=function(n){var e=(n[0]+n[1]+n[2])/3;return[e/255*100]};var RWe=DWe.exports,dV=RWe;function Mtn(){for(var n={},e=Object.keys(dV),t=e.length,i=0;i<t;i++)n[e[i]]={distance:-1,parent:null};return n}function Ftn(n){var e=Mtn(),t=[n];for(e[n].distance=0;t.length;)for(var i=t.pop(),r=Object.keys(dV[i]),o=r.length,s=0;s<o;s++){var a=r[s],l=e[a];l.distance===-1&&(l.distance=e[i].distance+1,l.parent=i,t.unshift(a))}return e}function Btn(n,e){return function(t){return e(n(t))}}function $tn(n,e){for(var t=[e[n].parent,n],i=dV[e[n].parent][n],r=e[n].parent;e[r].parent;)t.unshift(e[r].parent),i=Btn(dV[e[r].parent][r],i),r=e[r].parent;return i.conversion=t,i}var Vtn=function(n){for(var e=Ftn(n),t={},i=Object.keys(e),r=i.length,o=0;o<r;o++){var s=i[o],a=e[s];a.parent!==null&&(t[s]=$tn(s,e))}return t},yre=RWe,Htn=Vtn,tI={},Wtn=Object.keys(yre);function ztn(n){var e=function(t){return t==null?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),n(t))};return"conversion"in n&&(e.conversion=n.conversion),e}function jtn(n){var e=function(t){if(t==null)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var i=n(t);if(typeof i=="object")for(var r=i.length,o=0;o<r;o++)i[o]=Math.round(i[o]);return i};return"conversion"in n&&(e.conversion=n.conversion),e}Wtn.forEach(function(n){tI[n]={},Object.defineProperty(tI[n],"channels",{value:yre[n].channels}),Object.defineProperty(tI[n],"labels",{value:yre[n].labels});var e=Htn(n),t=Object.keys(e);t.forEach(function(i){var r=e[i];tI[n][i]=jtn(r),tI[n][i].raw=ztn(r)})});var Utn=tI,CN=Rtn,Kf=Utn,qpe=[].slice,NWe=["keyword","gray","hex"],Cre={};Object.keys(Kf).forEach(function(n){Cre[qpe.call(Kf[n].labels).sort().join("")]=n});var hV={};function Lu(n,e){if(!(this instanceof Lu))return new Lu(n,e);if(e&&e in NWe&&(e=null),e&&!(e in Kf))throw new Error("Unknown model: "+e);var t,i;if(n==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(n instanceof Lu)this.model=n.model,this.color=n.color.slice(),this.valpha=n.valpha;else if(typeof n=="string"){var r=CN.get(n);if(r===null)throw new Error("Unable to parse color from string: "+n);this.model=r.model,i=Kf[this.model].channels,this.color=r.value.slice(0,i),this.valpha=typeof r.value[i]=="number"?r.value[i]:1}else if(n.length){this.model=e||"rgb",i=Kf[this.model].channels;var o=qpe.call(n,0,i);this.color=wre(o,i),this.valpha=typeof n[i]=="number"?n[i]:1}else if(typeof n=="number")n&=16777215,this.model="rgb",this.color=[n>>16&255,n>>8&255,n&255],this.valpha=1;else{this.valpha=1;var s=Object.keys(n);"alpha"in n&&(s.splice(s.indexOf("alpha"),1),this.valpha=typeof n.alpha=="number"?n.alpha:0);var a=s.sort().join("");if(!(a in Cre))throw new Error("Unable to parse color from object: "+JSON.stringify(n));this.model=Cre[a];var l=Kf[this.model].labels,c=[];for(t=0;t<l.length;t++)c.push(n[l[t]]);this.color=wre(c)}if(hV[this.model])for(i=Kf[this.model].channels,t=0;t<i;t++){var u=hV[this.model][t];u&&(this.color[t]=u(this.color[t]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Lu.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(n){var e=this.model in CN.to?this:this.rgb();e=e.round(typeof n=="number"?n:1);var t=e.valpha===1?e.color:e.color.concat(this.valpha);return CN.to[e.model](t)},percentString:function(n){var e=this.rgb().round(typeof n=="number"?n:1),t=e.valpha===1?e.color:e.color.concat(this.valpha);return CN.to.rgb.percent(t)},array:function(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var n={},e=Kf[this.model].channels,t=Kf[this.model].labels,i=0;i<e;i++)n[t[i]]=this.color[i];return this.valpha!==1&&(n.alpha=this.valpha),n},unitArray:function(){var n=this.rgb().color;return n[0]/=255,n[1]/=255,n[2]/=255,this.valpha!==1&&n.push(this.valpha),n},unitObject:function(){var n=this.rgb().object();return n.r/=255,n.g/=255,n.b/=255,this.valpha!==1&&(n.alpha=this.valpha),n},round:function(n){return n=Math.max(n||0,0),new Lu(this.color.map(Ktn(n)).concat(this.valpha),this.model)},alpha:function(n){return arguments.length?new Lu(this.color.concat(Math.max(0,Math.min(1,n))),this.model):this.valpha},red:dl("rgb",0,Ec(255)),green:dl("rgb",1,Ec(255)),blue:dl("rgb",2,Ec(255)),hue:dl(["hsl","hsv","hsl","hwb","hcg"],0,function(n){return(n%360+360)%360}),saturationl:dl("hsl",1,Ec(100)),lightness:dl("hsl",2,Ec(100)),saturationv:dl("hsv",1,Ec(100)),value:dl("hsv",2,Ec(100)),chroma:dl("hcg",1,Ec(100)),gray:dl("hcg",2,Ec(100)),white:dl("hwb",1,Ec(100)),wblack:dl("hwb",2,Ec(100)),cyan:dl("cmyk",0,Ec(100)),magenta:dl("cmyk",1,Ec(100)),yellow:dl("cmyk",2,Ec(100)),black:dl("cmyk",3,Ec(100)),x:dl("xyz",0,Ec(100)),y:dl("xyz",1,Ec(100)),z:dl("xyz",2,Ec(100)),l:dl("lab",0,Ec(100)),a:dl("lab",1),b:dl("lab",2),keyword:function(n){return arguments.length?new Lu(n):Kf[this.model].keyword(this.color)},hex:function(n){return arguments.length?new Lu(n):CN.to.hex(this.rgb().round().color)},rgbNumber:function(){var n=this.rgb().color;return(n[0]&255)<<16|(n[1]&255)<<8|n[2]&255},luminosity:function(){for(var n=this.rgb().color,e=[],t=0;t<n.length;t++){var i=n[t]/255;e[t]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return .2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(n){var e=this.luminosity(),t=n.luminosity();return e>t?(e+.05)/(t+.05):(t+.05)/(e+.05)},level:function(n){var e=this.contrast(n);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var n=this.rgb().color,e=(n[0]*299+n[1]*587+n[2]*114)/1e3;return e<128},isLight:function(){return!this.isDark()},negate:function(){for(var n=this.rgb(),e=0;e<3;e++)n.color[e]=255-n.color[e];return n},lighten:function(n){var e=this.hsl();return e.color[2]+=e.color[2]*n,e},darken:function(n){var e=this.hsl();return e.color[2]-=e.color[2]*n,e},saturate:function(n){var e=this.hsl();return e.color[1]+=e.color[1]*n,e},desaturate:function(n){var e=this.hsl();return e.color[1]-=e.color[1]*n,e},whiten:function(n){var e=this.hwb();return e.color[1]+=e.color[1]*n,e},blacken:function(n){var e=this.hwb();return e.color[2]+=e.color[2]*n,e},grayscale:function(){var n=this.rgb().color,e=n[0]*.3+n[1]*.59+n[2]*.11;return Lu.rgb(e,e,e)},fade:function(n){return this.alpha(this.valpha-this.valpha*n)},opaquer:function(n){return this.alpha(this.valpha+this.valpha*n)},rotate:function(n){var e=this.hsl(),t=e.color[0];return t=(t+n)%360,t=t<0?360+t:t,e.color[0]=t,e},mix:function(n,e){if(!n||!n.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof n);var t=n.rgb(),i=this.rgb(),r=e===void 0?.5:e,o=2*r-1,s=t.alpha()-i.alpha(),a=((o*s===-1?o:(o+s)/(1+o*s))+1)/2,l=1-a;return Lu.rgb(a*t.red()+l*i.red(),a*t.green()+l*i.green(),a*t.blue()+l*i.blue(),t.alpha()*r+i.alpha()*(1-r))}};Object.keys(Kf).forEach(function(n){if(NWe.indexOf(n)===-1){var e=Kf[n].channels;Lu.prototype[n]=function(){if(this.model===n)return new Lu(this);if(arguments.length)return new Lu(arguments,n);var t=typeof arguments[e]=="number"?e:this.valpha;return new Lu(Gtn(Kf[this.model][n].raw(this.color)).concat(t),n)},Lu[n]=function(t){return typeof t=="number"&&(t=wre(qpe.call(arguments),e)),new Lu(t,n)}}});function qtn(n,e){return Number(n.toFixed(e))}function Ktn(n){return function(e){return qtn(e,n)}}function dl(n,e,t){return n=Array.isArray(n)?n:[n],n.forEach(function(i){(hV[i]||(hV[i]=[]))[e]=t}),n=n[0],function(i){var r;return arguments.length?(t&&(i=t(i)),r=this[n](),r.color[e]=i,r):(r=this[n]().color[e],t&&(r=t(r)),r)}}function Ec(n){return function(e){return Math.max(0,Math.min(n,e))}}function Gtn(n){return Array.isArray(n)?n:[n]}function wre(n,e){for(var t=0;t<e;t++)typeof n[t]!="number"&&(n[t]=0);return n}var Ytn=Lu;const XTe=ja(Ytn);var Qtn="Expected a function",ZTe="__lodash_placeholder__",kx=1,aU=2,Xtn=4,KE=8,xO=16,yL=32,cM=64,OWe=128,Ztn=256,PWe=512,JTe=1/0,Jtn=9007199254740991,enn=17976931348623157e292,eIe=0/0,tnn=[["ary",OWe],["bind",kx],["bindKey",aU],["curry",KE],["curryRight",xO],["flip",PWe],["partial",yL],["partialRight",cM],["rearg",Ztn]],nnn="[object Function]",inn="[object GeneratorFunction]",rnn="[object Symbol]",onn=/[\\^$.*+?()[\]{}|]/g,snn=/^\s+|\s+$/g,ann=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,lnn=/\{\n\/\* \[wrapped with (.+)\] \*/,cnn=/,? & /,unn=/^[-+]0x[0-9a-f]+$/i,dnn=/^0b[01]+$/i,hnn=/^\[object .+?Constructor\]$/,fnn=/^0o[0-7]+$/i,gnn=/^(?:0|[1-9]\d*)$/,pnn=parseInt,mnn=typeof Co=="object"&&Co&&Co.Object===Object&&Co,_nn=typeof self=="object"&&self&&self.Object===Object&&self,n5=mnn||_nn||Function("return this")();function MWe(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function vnn(n,e){for(var t=-1,i=n?n.length:0;++t<i&&e(n[t],t,n)!==!1;);return n}function bnn(n,e){var t=n?n.length:0;return!!t&&Cnn(n,e,0)>-1}function ynn(n,e,t,i){for(var r=n.length,o=t+(i?1:-1);i?o--:++o<r;)if(e(n[o],o,n))return o;return-1}function Cnn(n,e,t){if(e!==e)return ynn(n,wnn,t);for(var i=t-1,r=n.length;++i<r;)if(n[i]===e)return i;return-1}function wnn(n){return n!==n}function Snn(n,e){for(var t=n.length,i=0;t--;)n[t]===e&&i++;return i}function Enn(n,e){return n==null?void 0:n[e]}function xnn(n){var e=!1;if(n!=null&&typeof n.toString!="function")try{e=!!(n+"")}catch{}return e}function FWe(n,e){for(var t=-1,i=n.length,r=0,o=[];++t<i;){var s=n[t];(s===e||s===ZTe)&&(n[t]=ZTe,o[r++]=t)}return o}var knn=Function.prototype,BWe=Object.prototype,NX=n5["__core-js_shared__"],tIe=function(){var n=/[^.]+$/.exec(NX&&NX.keys&&NX.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),$We=knn.toString,Tnn=BWe.hasOwnProperty,VWe=BWe.toString,Inn=RegExp("^"+$We.call(Tnn).replace(onn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Lnn=Object.create,fV=Math.max,Dnn=Math.min,nIe=function(){var n=iIe(Object,"defineProperty"),e=iIe.name;return e&&e.length>2?n:void 0}();function Ann(n){return FD(n)?Lnn(n):{}}function Rnn(n){if(!FD(n)||znn(n))return!1;var e=Knn(n)||xnn(n)?Inn:hnn;return e.test(Unn(n))}function Nnn(n,e,t,i){for(var r=-1,o=n.length,s=t.length,a=-1,l=e.length,c=fV(o-s,0),u=Array(l+c),d=!i;++a<l;)u[a]=e[a];for(;++r<s;)(d||r<o)&&(u[t[r]]=n[r]);for(;c--;)u[a++]=n[r++];return u}function Onn(n,e,t,i){for(var r=-1,o=n.length,s=-1,a=t.length,l=-1,c=e.length,u=fV(o-a,0),d=Array(u+c),h=!i;++r<u;)d[r]=n[r];for(var g=r;++l<c;)d[g+l]=e[l];for(;++s<a;)(h||r<o)&&(d[g+t[s]]=n[r++]);return d}function Pnn(n,e){var t=-1,i=n.length;for(e||(e=Array(i));++t<i;)e[t]=n[t];return e}function Mnn(n,e,t){var i=e&kx,r=uM(n);function o(){var s=this&&this!==n5&&this instanceof o?r:n;return s.apply(i?t:this,arguments)}return o}function uM(n){return function(){var e=arguments;switch(e.length){case 0:return new n;case 1:return new n(e[0]);case 2:return new n(e[0],e[1]);case 3:return new n(e[0],e[1],e[2]);case 4:return new n(e[0],e[1],e[2],e[3]);case 5:return new n(e[0],e[1],e[2],e[3],e[4]);case 6:return new n(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new n(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=Ann(n.prototype),i=n.apply(t,e);return FD(i)?i:t}}function Fnn(n,e,t){var i=uM(n);function r(){for(var o=arguments.length,s=Array(o),a=o,l=WWe(r);a--;)s[a]=arguments[a];var c=o<3&&s[0]!==l&&s[o-1]!==l?[]:FWe(s,l);if(o-=c.length,o<t)return HWe(n,e,Kpe,r.placeholder,void 0,s,c,void 0,void 0,t-o);var u=this&&this!==n5&&this instanceof r?i:n;return MWe(u,this,s)}return r}function Kpe(n,e,t,i,r,o,s,a,l,c){var u=e&OWe,d=e&kx,h=e&aU,g=e&(KE|xO),p=e&PWe,m=h?void 0:uM(n);function _(){for(var v=arguments.length,b=Array(v),y=v;y--;)b[y]=arguments[y];if(g)var C=WWe(_),x=Snn(b,C);if(i&&(b=Nnn(b,i,r,g)),o&&(b=Onn(b,o,s,g)),v-=x,g&&v<c){var k=FWe(b,C);return HWe(n,e,Kpe,_.placeholder,t,b,k,a,l,c-v)}var I=d?t:this,L=h?I[n]:n;return v=b.length,a?b=jnn(b,a):p&&v>1&&b.reverse(),u&&l<v&&(b.length=l),this&&this!==n5&&this instanceof _&&(L=m||uM(L)),L.apply(I,b)}return _}function Bnn(n,e,t,i){var r=e&kx,o=uM(n);function s(){for(var a=-1,l=arguments.length,c=-1,u=i.length,d=Array(u+l),h=this&&this!==n5&&this instanceof s?o:n;++c<u;)d[c]=i[c];for(;l--;)d[c++]=arguments[++a];return MWe(h,r?t:this,d)}return s}function HWe(n,e,t,i,r,o,s,a,l,c){var u=e&KE,d=u?s:void 0,h=u?void 0:s,g=u?o:void 0,p=u?void 0:o;e|=u?yL:cM,e&=~(u?cM:yL),e&Xtn||(e&=~(kx|aU));var m=t(n,e,r,g,d,p,h,a,l,c);return m.placeholder=i,zWe(m,n,e)}function $nn(n,e,t,i,r,o,s,a){var l=e&aU;if(!l&&typeof n!="function")throw new TypeError(Qtn);var c=i?i.length:0;if(c||(e&=~(yL|cM),i=r=void 0),s=s===void 0?s:fV(rIe(s),0),a=a===void 0?a:rIe(a),c-=r?r.length:0,e&cM){var u=i,d=r;i=r=void 0}var h=[n,e,t,i,r,u,d,o,s,a];if(n=h[0],e=h[1],t=h[2],i=h[3],r=h[4],a=h[9]=h[9]==null?l?0:n.length:fV(h[9]-c,0),!a&&e&(KE|xO)&&(e&=~(KE|xO)),!e||e==kx)var g=Mnn(n,e,t);else e==KE||e==xO?g=Fnn(n,e,a):(e==yL||e==(kx|yL))&&!r.length?g=Bnn(n,e,t,i):g=Kpe.apply(void 0,h);return zWe(g,n,e)}function WWe(n){var e=n;return e.placeholder}function iIe(n,e){var t=Enn(n,e);return Rnn(t)?t:void 0}function Vnn(n){var e=n.match(lnn);return e?e[1].split(cnn):[]}function Hnn(n,e){var t=e.length,i=t-1;return e[i]=(t>1?"& ":"")+e[i],e=e.join(t>2?", ":" "),n.replace(ann,`{
/* [wrapped with `+e+`] */
`)}function Wnn(n,e){return e=e??Jtn,!!e&&(typeof n=="number"||gnn.test(n))&&n>-1&&n%1==0&&n<e}function znn(n){return!!tIe&&tIe in n}function jnn(n,e){for(var t=n.length,i=Dnn(e.length,t),r=Pnn(n);i--;){var o=e[i];n[i]=Wnn(o,t)?r[o]:void 0}return n}var zWe=nIe?function(n,e,t){var i=e+"";return nIe(n,"toString",{configurable:!0,enumerable:!1,value:Znn(Hnn(i,qnn(Vnn(i),t)))})}:Jnn;function Unn(n){if(n!=null){try{return $We.call(n)}catch{}try{return n+""}catch{}}return""}function qnn(n,e){return vnn(tnn,function(t){var i="_."+t[0];e&t[1]&&!bnn(n,i)&&n.push(i)}),n.sort()}function Gpe(n,e,t){e=t?void 0:e;var i=$nn(n,KE,void 0,void 0,void 0,void 0,void 0,e);return i.placeholder=Gpe.placeholder,i}function Knn(n){var e=FD(n)?VWe.call(n):"";return e==nnn||e==inn}function FD(n){var e=typeof n;return!!n&&(e=="object"||e=="function")}function Gnn(n){return!!n&&typeof n=="object"}function Ynn(n){return typeof n=="symbol"||Gnn(n)&&VWe.call(n)==rnn}function Qnn(n){if(!n)return n===0?n:0;if(n=Xnn(n),n===JTe||n===-JTe){var e=n<0?-1:1;return e*enn}return n===n?n:0}function rIe(n){var e=Qnn(n),t=e%1;return e===e?t?e-t:e:0}function Xnn(n){if(typeof n=="number")return n;if(Ynn(n))return eIe;if(FD(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=FD(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=n.replace(snn,"");var t=dnn.test(n);return t||fnn.test(n)?pnn(n.slice(2),t?2:8):unn.test(n)?eIe:+n}function Znn(n){return function(){return n}}function Jnn(n){return n}Gpe.placeholder={};var ein=Gpe;const oIe=ja(ein);function tin(n){var e=n[0],t=n[1],i=n[2],r,o,s;return r=e*1+t*0+i*1.13983,o=e*1+t*-.39465+i*-.5806,s=e*1+t*2.02311+i*0,r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[r*255,o*255,s*255]}function nin(n){var e=n[0]/255,t=n[1]/255,i=n[2]/255,r=e*.299+t*.587+i*.114,o=e*-.14713+t*-.28886+i*.436,s=e*.615+t*-.51499+i*-.10001;return[r,o,s]}function sIe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function Uh(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?sIe(Object(t),!0).forEach(function(i){$e(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):sIe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}var jWe=EWe,aIe=Object.keys(jWe),iin=function(e){return e<.25?1:e<.5?.9-e:1.1-e},rin=function(e){var t=XTe(e),i=nin(t.array()),r=$t(i,3),o=r[0],s=r[1],a=r[2],l=[iin(o),s,a],c=tin(l);return XTe.rgb(c).hex()},kT=function(e){return function(t){return{className:[t.className,e.className].filter(Boolean).join(" "),style:Uh(Uh({},t.style||{}),e.style||{})}}},oin=function(e,t){if(e===void 0)return t;if(t===void 0)return e;var i=Er(e),r=Er(t);switch(i){case"string":switch(r){case"string":return[t,e].filter(Boolean).join(" ");case"object":return kT({className:e,style:t});case"function":return function(o){for(var s=arguments.length,a=new Array(s>1?s-1:0),l=1;l<s;l++)a[l-1]=arguments[l];return kT({className:e})(t.apply(void 0,[o].concat(a)))}}break;case"object":switch(r){case"string":return kT({className:t,style:e});case"object":return Uh(Uh({},t),e);case"function":return function(o){for(var s=arguments.length,a=new Array(s>1?s-1:0),l=1;l<s;l++)a[l-1]=arguments[l];return kT({style:e})(t.apply(void 0,[o].concat(a)))}}break;case"function":switch(r){case"string":return function(o){for(var s=arguments.length,a=new Array(s>1?s-1:0),l=1;l<s;l++)a[l-1]=arguments[l];return e.apply(void 0,[kT(o)({className:t})].concat(a))};case"object":return function(o){for(var s=arguments.length,a=new Array(s>1?s-1:0),l=1;l<s;l++)a[l-1]=arguments[l];return e.apply(void 0,[kT(o)({style:t})].concat(a))};case"function":return function(o){for(var s=arguments.length,a=new Array(s>1?s-1:0),l=1;l<s;l++)a[l-1]=arguments[l];return e.apply(void 0,[t.apply(void 0,[o].concat(a))].concat(a))}}}},sin=function(e,t){var i=Object.keys(t);for(var r in e)i.indexOf(r)===-1&&i.push(r);return i.reduce(function(o,s){return o[s]=oin(e[s],t[s]),o},{})},ain=function(e,t){for(var i=arguments.length,r=new Array(i>2?i-2:0),o=2;o<i;o++)r[o-2]=arguments[o];if(t===null)return e;Array.isArray(t)||(t=[t]);var s=t.map(function(l){return e[l]}).filter(Boolean),a=s.reduce(function(l,c){return typeof c=="string"?l.className=[l.className,c].filter(Boolean).join(" "):Er(c)==="object"?l.style=Uh(Uh({},l.style),c):typeof c=="function"&&(l=Uh(Uh({},l),c.apply(void 0,[l].concat(r)))),l},{className:"",style:{}});return a.className||delete a.className,Object.keys(a.style).length===0&&delete a.style,a},Sre=function(e){return Object.keys(e).reduce(function(t,i){return t[i]=/^base/.test(i)?rin(e[i]):i==="scheme"?e[i]+":inverted":e[i],t},{})},lin=oIe(function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=e.defaultBase16,r=i===void 0?jWe:i,o=e.base16Themes,s=o===void 0?null:o,a=cin(t,s);a&&(t=Uh(Uh({},a),t));for(var l=aIe.reduce(function(m,_){return m[_]=t[_]||r[_],m},{}),c=Object.keys(t).reduce(function(m,_){return aIe.indexOf(_)===-1&&(m[_]=t[_]),m},{}),u=n(l),d=sin(c,u),h=arguments.length,g=new Array(h>3?h-3:0),p=3;p<h;p++)g[p-3]=arguments[p];return oIe(ain,2).apply(void 0,[d].concat(g))},3),UWe=function(e){return!!e.extend},cin=function(e,t){if(e&&UWe(e)&&e.extend&&(e=e.extend),typeof e=="string"){var i=e.split(":"),r=$t(i,2),o=r[0],s=r[1];t?e=t[o]:e=ktn[o],s==="inverted"&&(e=Sre(e))}return e&&Object.prototype.hasOwnProperty.call(e,"base00")?e:void 0},uin=function(e){return typeof e=="string"?"".concat(e,":inverted"):e&&UWe(e)&&e.extend?typeof e.extend=="string"?Uh(Uh({},e),{},{extend:"".concat(e.extend,":inverted")}):Uh(Uh({},e),{},{extend:Sre(e.extend)}):e&&Sre(e)};const din={scheme:"solarized",author:"ethan schoonover (http://ethanschoonover.com/solarized)",base00:"#002b36",base01:"#073642",base02:"#586e75",base03:"#657b83",base04:"#839496",base05:"#93a1a1",base06:"#eee8d5",base07:"#fdf6e3",base08:"#dc322f",base09:"#cb4b16",base0A:"#b58900",base0B:"#859900",base0C:"#2aa198",base0D:"#268bd2",base0E:"#6c71c4",base0F:"#d33682"},hin=n=>({BACKGROUND_COLOR:n.base00,TEXT_COLOR:n.base07,STRING_COLOR:n.base0B,DATE_COLOR:n.base0B,NUMBER_COLOR:n.base09,BOOLEAN_COLOR:n.base09,NULL_COLOR:n.base08,UNDEFINED_COLOR:n.base08,FUNCTION_COLOR:n.base08,SYMBOL_COLOR:n.base08,LABEL_COLOR:n.base0D,ARROW_COLOR:n.base0D,ITEM_STRING_COLOR:n.base0B,ITEM_STRING_EXPANDED_COLOR:n.base03}),fin=n=>({String:n.STRING_COLOR,Date:n.DATE_COLOR,Number:n.NUMBER_COLOR,Boolean:n.BOOLEAN_COLOR,Null:n.NULL_COLOR,Undefined:n.UNDEFINED_COLOR,Function:n.FUNCTION_COLOR,Symbol:n.SYMBOL_COLOR}),gin=n=>{const e=hin(n);return{tree:{border:0,padding:0,marginTop:"0.5em",marginBottom:"0.5em",marginLeft:"0.125em",marginRight:0,listStyle:"none",MozUserSelect:"none",WebkitUserSelect:"none",backgroundColor:e.BACKGROUND_COLOR},value:(t,i,r)=>{let{style:o}=t;return{style:{...o,paddingTop:"0.25em",paddingRight:0,marginLeft:"0.875em",WebkitUserSelect:"text",MozUserSelect:"text",wordWrap:"break-word",paddingLeft:r.length>1?"2.125em":"1.25em",textIndent:"-0.5em",wordBreak:"break-all"}}},label:{display:"inline-block",color:e.LABEL_COLOR},valueLabel:{margin:"0 0.5em 0 0"},valueText:(t,i)=>{let{style:r}=t;return{style:{...r,color:fin(e)[i]}}},itemRange:(t,i)=>({style:{paddingTop:i?0:"0.25em",cursor:"pointer",color:e.LABEL_COLOR}}),arrow:(t,i,r)=>{let{style:o}=t;return{style:{...o,marginLeft:0,transition:"150ms",WebkitTransition:"150ms",MozTransition:"150ms",WebkitTransform:r?"rotateZ(90deg)":"rotateZ(0deg)",MozTransform:r?"rotateZ(90deg)":"rotateZ(0deg)",transform:r?"rotateZ(90deg)":"rotateZ(0deg)",transformOrigin:"45% 50%",WebkitTransformOrigin:"45% 50%",MozTransformOrigin:"45% 50%",position:"relative",lineHeight:"1.1em",fontSize:"0.75em"}}},arrowContainer:(t,i)=>{let{style:r}=t;return{style:{...r,display:"inline-block",paddingRight:"0.5em",paddingLeft:i==="double"?"1em":0,cursor:"pointer"}}},arrowSign:{color:e.ARROW_COLOR},arrowSignInner:{position:"absolute",top:0,left:"-0.4em"},nestedNode:(t,i,r,o,s)=>{let{style:a}=t;return{style:{...a,position:"relative",paddingTop:"0.25em",marginLeft:i.length>1?"0.875em":0,paddingLeft:s?0:"1.125em"}}},rootNode:{padding:0,margin:0},nestedNodeLabel:(t,i,r,o,s)=>{let{style:a}=t;return{style:{...a,margin:0,padding:0,WebkitUserSelect:s?"inherit":"text",MozUserSelect:s?"inherit":"text",cursor:s?"pointer":"default"}}},nestedNodeItemString:(t,i,r,o)=>{let{style:s}=t;return{style:{...s,paddingLeft:"0.5em",cursor:"default",color:o?e.ITEM_STRING_EXPANDED_COLOR:e.ITEM_STRING_COLOR}}},nestedNodeItemType:{marginLeft:"0.3em",marginRight:"0.3em"},nestedNodeChildren:(t,i,r)=>{let{style:o}=t;return{style:{...o,padding:0,margin:0,listStyle:"none",display:r?"block":"none"}}},rootNodeChildren:{padding:0,margin:0,listStyle:"none"}}},pin=lin(gin,{defaultBase16:din}),min=pin,lIe=n=>n,_in=(n,e,t)=>t===0,vin=(n,e,t,i)=>te.createElement("span",null,t," ",i),bin=n=>{let[e]=n;return te.createElement("span",null,e,":")},yin=()=>!1;function Cin(n){let{data:e,theme:t,invertTheme:i,keyPath:r=["root"],labelRenderer:o=bin,valueRenderer:s=lIe,shouldExpandNodeInitially:a=_in,hideRoot:l=!1,getItemString:c=vin,postprocessValue:u=lIe,isCustomNode:d=yin,collectionLimit:h=50,sortObjectKeys:g=!1}=n;const p=w.useMemo(()=>min(i?uin(t):t),[t,i]);return te.createElement("ul",p("tree"),te.createElement(SWe,{keyPath:l?[]:r,value:u(e),isCustomNode:d,styling:p,labelRenderer:o,valueRenderer:s,shouldExpandNodeInitially:a,hideRoot:l,getItemString:c,postprocessValue:u,collectionLimit:h,sortObjectKeys:g}))}const win={scheme:"monokai",author:"wimer hazenberg (http://www.monokai.nl)",base00:"#272822",base01:"#383830",base02:"#49483e",base03:"#75715e",base04:"#a59f85",base05:"#f8f8f2",base06:"#f5f4f1",base07:"#f9f8f5",base08:"#f92672",base09:"#fd971f",base0A:"#f4bf75",base0B:"#a6e22e",base0C:"#a1efe4",base0D:"#66d9ef",base0E:"#ae81ff",base0F:"#cc6633"};function Sin(){const[n]=ue(),e=[{name:n("settings"),href:"/settings"},{name:n("system_logs"),href:"/settings/system_logs"}],{dateFormat:t}=Il(),{data:i,isLoading:r}=ai(["/api/v1/system_logs","per_page=200","sort=created_at|DESC"],()=>Te("GET",ye("/api/v1/system_logs?per_page=200&sort=created_at|DESC")),{staleTime:36e5}),o=[{id:1,name:n("gateway_id")},{id:2,name:n("email")},{id:3,name:n("webhook")},{id:4,name:n("pdf")},{id:5,name:n("security")}],s=[{id:10,name:n("payment_failure")},{id:11,name:n("payment_success")},{id:21,name:n("success")},{id:22,name:n("failure")},{id:23,name:n("error")},{id:30,name:n("email_send")},{id:31,name:n("email_retry_queue")},{id:32,name:n("email_bounced")},{id:33,name:n("email_spam_complaint")},{id:34,name:n("email_delivery")},{id:35,name:n("opened")},{id:40,name:n("webhook_response")},{id:41,name:n("webhook_success")},{id:50,name:n("pdf")},{id:60,name:n("login_failure")},{id:61,name:n("user")}],a=[{id:300,name:n("paypal")},{id:301,name:n("payment_type_stripe")},{id:302,name:n("ledger")},{id:303,name:n("failure")},{id:304,name:n("checkout_com")},{id:305,name:"auth.net"},{id:306,name:n("custom")},{id:307,name:"Braintree"},{id:309,name:n("wepay")},{id:310,name:"PayFast"},{id:311,name:"PayTrace"},{id:312,name:"Mollie"},{id:313,name:"eWay"},{id:320,name:"Square"},{id:321,name:n("gocardless")},{id:322,name:"Razorpay"},{id:323,name:n("paypal")},{id:400,name:"Quota exceeded"},{id:401,name:"Upstream failure"},{id:500,name:"Webhook response"},{id:600,name:"PDF Failure"},{id:601,name:"PDF Sucess"},{id:701,name:"Modified"},{id:702,name:"Deleted"},{id:800,name:"Login Success"},{id:801,name:"Login Failure"}],l=h=>{const g=o.find(p=>p.id===h);return g?g.name:"Undefined Category"},c=h=>{const g=s.find(p=>p.id===h);return g?g.name:"Undefined Event"},u=h=>{const g=a.find(p=>p.id===h);return g?g.name:"Undefined Type"},d=h=>f(Cin,{data:JSON.parse(h),theme:win})||h;return N($i,{title:n("system_logs"),breadcrumbs:e,children:[r&&f(Den,{children:f(Vo,{})}),f(Ot,{children:i==null?void 0:i.data.data.map((h,g,{length:p})=>N("div",{children:[f(U,{leftSide:l(h.category_id),leftSideHelp:`${u(h.type_id)} ${Jr(h.created_at,t)}`,children:N("div",{className:"flex flex-col space-y-2",children:[f("div",{children:f(Gi,{children:c(h.event_id)})}),f("div",{children:d(h.log)})]})},g),g+1!==p&&f(Jn,{})]},g))})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function lU(n){const e=ri(),t=Ci(),{withoutNavigation:i}=n||{},r=Ri(kk);return o=>{r(o),t(Vr({object:"company",property:"settings",value:o.settings})),t(x3({status:{name:o.name,level:"group"}})),!i&&e("/settings/company_details")}}function qWe(){const[n]=ue(),e=ol(),t=ri(),i=Kr(),r=lU(),{id:o}=Fa(),s=sXt(),a=e.pathname.includes(o),l=async u=>{const d=await i.fetchQuery(["/api/v1/group_settings",u],()=>Te("GET",ye("/api/v1/group_settings/:id",{id:u})).then(h=>h.data.data),{staleTime:1/0});r(d)};return[u=>!a&&f(et,{onClick:()=>l(u.id),icon:f(Ve,{className:"h-4 w-4",element:Ihe}),children:n("configure_settings")}),u=>nr(u)===Di.Active&&f(et,{onClick:()=>t(dt("/clients/create?group=:groupId",{groupId:u.id})),icon:f(Ve,{element:eg}),children:n("new_client")}),()=>a&&f(Jn,{withoutPadding:!0}),u=>a&&nr(u)===Di.Active&&f(et,{onClick:()=>s([u.id],"archive"),icon:f(Ve,{element:Xl}),children:n("archive")}),u=>a&&(nr(u)===Di.Archived||nr(u)===Di.Deleted)&&f(et,{onClick:()=>s([u.id],"restore"),icon:f(Ve,{element:Ql}),children:n("restore")}),u=>a&&(nr(u)===Di.Active||nr(u)===Di.Archived)&&f(et,{onClick:()=>s([u.id],"delete"),icon:f(Ve,{element:Pa}),children:n("delete")})]}function Ein(){const{documentTitle:n}=gi("online_payments"),[e]=ue(),t=qWe(),i=[{name:e("settings"),href:"/settings"},{name:e("group_settings"),href:"/settings/group_settings"}],r=[{id:"status_id",label:e("status"),format:(o,s)=>f(zp,{entity:s})},{id:"name",label:e("name"),format:(o,s)=>f(Ii,{to:dt("/settings/group_settings/:id/edit",{id:s.id}),children:o})}];return f($i,{title:n,breadcrumbs:i,docsLink:"en/advanced-settings/#group_settings",children:f(Pg,{columns:r,resource:"group",endpoint:"/api/v1/group_settings?sort=id|desc",bulkRoute:"/api/v1/group_settings/bulk",linkToCreate:"/settings/group_settings/create",linkToEdit:"/settings/group_settings/:id/edit",customActions:t,withResourcefulActions:!0})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const KWe={id:"",name:"",settings:{},created_at:0,updated_at:0,archived_at:0,is_deleted:!1,documents:[]};function GWe(n){const{setGroupSettings:e,setErrors:t,isCreatePage:i}=n;return(r,o)=>{t(void 0),e(i?{...KWe,[r]:o}:s=>s&&{...s,[r]:o})}}function YWe(n){const[e]=ue(),{groupSettings:t,handleChange:i,errors:r}=n;return f(U,{leftSide:e("name"),children:f(ke,{value:t.name,onValueChange:o=>i("name",o),errorMessage:r==null?void 0:r.errors.name,cypressRef:"groupSettingsNameField"})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function xin(n){const e=ri(),t=Kr(),i=ki(Hc),{groupSettings:r,setErrors:o,setIsFormBusy:s,isFormBusy:a}=n;return()=>{a||(ie.processing(),o(void 0),s(!0),Te("POST",ye("/api/v1/group_settings"),r).then(l=>{ie.success("created_group"),hn(["group_settings"]),i&&t.invalidateQueries([i]),e(dt("/settings/group_settings/:id/edit",{id:l.data.data.id}))}).catch(l=>{var c;((c=l.response)==null?void 0:c.status)===422&&(ie.dismiss(),o(l.response.data))}).finally(()=>s(!1)))}}function kin(){const[n]=ue(),{documentTitle:e}=gi("new_group"),t=L0(),i=[{name:n("settings"),href:"/settings"},{name:n("group_settings"),href:"/settings/group_settings"},{name:n("new_group"),href:"/settings/group_settings/create"}],[r,o]=w.useState(),[s,a]=w.useState(),[l,c]=w.useState(!1),u=GWe({setGroupSettings:o,setErrors:a,isCreatePage:!0}),d=xin({groupSettings:r,setErrors:a,isFormBusy:l,setIsFormBusy:c});return w.useEffect(()=>{o(KWe)},[]),N($i,{title:e,breadcrumbs:i,onSaveClick:d,disableSaveButton:l||!r||t,children:[t&&f(xb,{}),r&&f(Ot,{title:n("new_group"),children:f(YWe,{groupSettings:r,handleChange:u,errors:s})})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Ype(n){const e=ri(),t=Ci(),i=vi(),r=Ti(),{withoutNavigation:o}=n||{},s=Ri(kk);return a=>{s(a),t(r?Vr({object:"company",property:"settings",value:a.settings}):gx({object:"company",data:{...i,settings:a.settings}})),t(x3({status:{name:a.display_name,level:"client"}})),!o&&e("/settings/company_details")}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Tin(n){const e=ri(),t=Kr(),{setIsPurgeOrMergeActionCalled:i}=n||{},r=Ri(_f);return(o,s)=>{ie.processing(),i==null||i(!0),Te("POST",ye("/api/v1/clients/:id/purge",{id:s}),{},{headers:{"X-Api-Password":o}}).then(()=>{ie.success("purged_client"),t.invalidateQueries(),e("/clients")}).catch(a=>{var l;((l=a.response)==null?void 0:l.status)===412&&(ie.error("password_error_incorrect"),r(0)),i==null||i(!1)})}}function Iin(n){const[e]=ue(),{client:t,setIsPurgeOrMergeActionCalled:i}=n,r=Tin({setIsPurgeOrMergeActionCalled:i}),[o,s]=w.useState(!1);return N(_t,{children:[f(et,{onClick:()=>s(!0),icon:f(Ve,{element:tyt}),children:e("purge")}),f(Rg,{show:o,onClose:s,onSave:a=>r(a,t.id)})]})}function Lin(n){const[e]=ue(),t=Ci(),i=ri(),{isEditOrShowPage:r}=Kw({entity:"client"}),{setIsPurgeOrMergeActionCalled:o}=n,s=Ri(_f),[a,l]=w.useState(""),[c,u]=w.useState(!1),[d,h]=w.useState(!1),g=p=>{d||(ie.processing(),h(!0),o==null||o(!0),Te("POST",ye("/api/v1/clients/:mergeIntoClientId/:mergeFromClientId/merge",{mergeIntoClientId:a,mergeFromClientId:n.mergeFromClientId}),{},{headers:{"X-Api-Password":p}}).then(()=>{hn(["clients"]),Te("POST",ye("/api/v1/refresh")).then(m=>{ie.success("merged_clients"),t(yb(m.data.data)),l(""),n.setVisible(!1),r&&i("/clients")}).catch(()=>o==null?void 0:o(!1))}).catch(m=>{var _;((_=m.response)==null?void 0:_.status)===412&&(ie.error("password_error_incorrect"),s(0)),o==null||o(!1)}).finally(()=>h(!1)))};return N(cr,{title:e("merge_into"),visible:n.visible,onClose:()=>{l(""),n.setVisible(!1)},overflowVisible:!0,children:[f(Jj,{inputLabel:e("client"),onChange:p=>l(p.id),value:a,clearButton:!0,onClearButtonClick:()=>l(""),withoutAction:!0,exclude:[n.mergeFromClientId],dropdownLabelFn:p=>{var m;return N("div",{className:"flex items-center space-x-1",children:[f("span",{children:p.display_name}),((m=p.contacts[0])==null?void 0:m.email)&&N("span",{className:"text-xs",children:["(",p.contacts[0].email,")"]})]})},initiallyVisible:!0}),f("div",{className:"self-end pt-2",children:f(Ut,{disableWithoutIcon:!0,disabled:!a,onClick:()=>u(!0),children:e("merge")})}),f(Rg,{show:c,onClose:u,onSave:g})]})}function Din(n){const[e]=ue(),{client:t,setIsPurgeOrMergeActionCalled:i}=n,[r,o]=w.useState(!1);return N(_t,{children:[f(et,{onClick:()=>o(!0),icon:f(Ve,{element:zxt}),children:e("merge")}),f(Lin,{visible:r,setVisible:o,mergeFromClientId:t.id,setIsPurgeOrMergeActionCalled:i})]})}function Ain(n){const[e]=ue(),t=Mpe(),{setIsPurgeOrMergeActionCalled:i}=n||{},r=zo(),{isAdmin:o,isOwner:s}=ao(),{isEditOrShowPage:a}=Kw({entity:"client"}),l=Ype(),{setChangeTemplateVisible:c,setChangeTemplateResources:u,setChangeTemplateEntityContext:d}=gA();return[g=>!g.is_deleted&&f(et,{to:dt("/clients/:id/statement",{id:g.id}),icon:f(Ve,{element:Rz}),children:e("view_statement")}),g=>!g.is_deleted&&f(et,{onClick:()=>window.open(dt(`${g.contacts[0].link}?silent=true&client_hash=:clientHash`,{clientHash:g.client_hash}),"__blank"),icon:f(Ve,{element:tfe}),children:e("client_portal")}),g=>f(oU,{entity:"client",entityId:g.id,label:g.display_name,labelElement:f(et,{icon:f(Ve,{element:Az}),children:e("add_comment")})}),g=>!g.is_deleted&&(o||s)&&f(et,{onClick:()=>l(g),icon:f(Ve,{element:ryt}),children:e("settings")}),g=>!g.is_deleted&&r("create_invoice")&&f(et,{to:dt("/invoices/create?client=:id",{id:g.id}),icon:f(Ve,{element:eg}),children:e("new_invoice")}),g=>!g.is_deleted&&r("create_payment")&&f(et,{to:dt("/payments/create?client=:id",{id:g.id}),icon:f(Ve,{element:eg}),children:e("new_payment")}),g=>!g.is_deleted&&r("create_quote")&&f(et,{to:dt("/quotes/create?client=:id",{id:g.id}),icon:f(Ve,{element:eg}),children:e("new_quote")}),g=>!g.is_deleted&&r("create_credit")&&f(et,{to:dt("/credits/create?client=:id",{id:g.id}),icon:f(Ve,{element:eg}),children:e("new_credit")}),g=>!g.is_deleted&&(o||s)&&g&&f(Din,{client:g,setIsPurgeOrMergeActionCalled:i}),g=>f(et,{onClick:()=>{c(!0),u([g]),d({endpoint:"/api/v1/clients/bulk",entity:"clients"})},icon:f(Ve,{element:K2}),children:e("run_template")}),g=>a&&!g.is_deleted&&f(Jn,{withoutPadding:!0}),g=>a&&nr(g)===Di.Active&&f(et,{onClick:()=>t([g.id],"archive"),icon:f(Ve,{element:Xl}),children:e("archive")}),g=>a&&(nr(g)===Di.Archived||nr(g)===Di.Deleted)&&f(et,{onClick:()=>t([g.id],"restore"),icon:f(Ve,{element:Ql}),children:e("restore")}),g=>a&&(nr(g)===Di.Active||nr(g)===Di.Archived)&&f(et,{onClick:()=>t([g.id],"delete"),icon:f(Ve,{element:Pa}),children:e("delete")}),g=>(o||s)&&g&&f(Iin,{client:g,setIsPurgeOrMergeActionCalled:i},"purge")]}const Rin=["name","contact_email","id_number","balance","paid_to_date","created_at","last_login_at","website"];function Nin(){const[n,e,t,i]=yf({entity:"client"});return["number","name","balance","paid_to_date","contact_name","contact_email","last_login_at","address2","archived_at","contact_phone","contacts","country","created_at","credit_balance","currency",n,e,t,i,"documents","entity_state","group","id_number","is_deleted","language","phone","private_notes","public_notes","state","address1","task_rate","updated_at","vat_number","website","city"]}function Oin(){var v;const{t:n}=ue(),{dateFormat:e}=Il(),t=Gw(),i=vi(),r=sl(),o=bf(),s=dA(),a=qw(),l=D4e(),c=Lk(),u=w.useCallback(b=>{const y=[];return b.contacts.map(C=>y.push(`${C.first_name} ${C.last_name}`)),y.join("<br />")},[]);Nin();const[d,h,g,p]=yf({entity:"client"}),m=[{column:"number",id:"number",label:n("number")},{column:"name",id:"display_name",label:n("name"),format:(b,y)=>f(jh,{to:dt("/clients/:id",{id:y.id}),renderSpan:t("client",y),children:b})},{column:"balance",id:"balance",label:n("balance"),format:(b,y)=>o(b,y==null?void 0:y.country_id,y==null?void 0:y.settings.currency_id)},{column:"paid_to_date",id:"paid_to_date",label:n("paid_to_date"),format:(b,y)=>o(b,y==null?void 0:y.country_id,y==null?void 0:y.settings.currency_id)},{column:"contact_name",id:"id",label:n("contact_name"),format:(b,y)=>y.contacts.length>0&&N(jh,{to:dt("/clients/:id",{id:y.id}),renderSpan:t("client",y),children:[y.contacts[0].first_name," ",y.contacts[0].last_name]})},{column:"contact_email",id:"id",label:n("contact_email"),format:(b,y)=>y.contacts.length>0&&f(ec,{text:y.contacts[0].email})},{column:"last_login_at",id:"last_login",label:n("last_login"),format:b=>Jr(b,e)},{column:"address2",id:"address2",label:n("address2")},{column:"archived_at",id:"archived_at",label:n("archived_at"),format:b=>Jr(b,e)},{column:"contact_phone",id:"id",label:n("contact_phone"),format:(b,y)=>y.contacts[0].phone},{column:"contacts",id:"id",label:n("contacts"),format:(b,y)=>f("span",{dangerouslySetInnerHTML:{__html:u(y)}})},{column:"country",id:"country_id",label:n("country"),format:b=>{var y;return b&&((y=s(b))==null?void 0:y.name)}},{column:"created_at",id:"created_at",label:n("created_at"),format:b=>Jr(b,e)},{column:"credit_balance",id:"credit_balance",label:n("credit_balance"),format:(b,y)=>o(b,y==null?void 0:y.country_id,y==null?void 0:y.settings.currency_id)},{column:"currency",id:"id",label:n("currency"),format:(b,y)=>{var C,x;return((C=y.settings)==null?void 0:C.currency_id)&&((x=a(y.settings.currency_id))==null?void 0:x.code)}},{column:d,id:"custom_value1",label:d,format:b=>c("client1",b==null?void 0:b.toString())},{column:h,id:"custom_value2",label:h,format:b=>c("client2",b==null?void 0:b.toString())},{column:g,id:"custom_value3",label:g,format:b=>c("client3",b==null?void 0:b.toString())},{column:p,id:"custom_value4",label:p,format:b=>c("client4",b==null?void 0:b.toString())},{column:"documents",id:"documents",label:n("documents"),format:(b,y)=>y.documents.length},{column:"entity_state",id:"id",label:n("entity_state"),format:(b,y)=>f(zp,{entity:y})},{column:"id_number",id:"id_number",label:n("id_number")},{column:"is_deleted",id:"is_deleted",label:n("is_deleted"),format:(b,y)=>y.is_deleted?n("yes"):n("no")},{column:"language",id:"id",label:n("language"),format:(b,y)=>{var C;return(C=l(y.settings.language_id||i.settings.language_id))==null?void 0:C.name}},{column:"phone",id:"phone",label:n("phone")},{column:"private_notes",id:"private_notes",label:n("private_notes"),format:b=>f(du,{width:"auto",tooltipElement:f("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:f("article",{className:St("prose prose-sm",{"prose-invert":r.dark_mode}),dangerouslySetInnerHTML:{__html:pc(b)}})}),children:f("span",{children:ib(pc(b)).slice(0,50)})})},{column:"public_notes",id:"public_notes",label:n("public_notes"),format:b=>f(du,{width:"auto",tooltipElement:f("div",{className:"w-full max-h-48 overflow-auto whitespace-normal break-all",children:f("article",{className:St("prose prose-sm",{"prose-invert":r.dark_mode}),dangerouslySetInnerHTML:{__html:pc(b)}})}),children:f("span",{children:ib(pc(b)).slice(0,50)})})},{column:"state",id:"state",label:n("state")},{column:"address1",id:"address1",label:n("address1")},{column:"task_rate",id:"id",label:n("task_rate"),format:(b,y)=>o(y.settings.default_task_rate||i.settings.default_task_rate,y==null?void 0:y.country_id,y==null?void 0:y.settings.currency_id)},{column:"updated_at",id:"updated_at",label:n("updated_at"),format:b=>Jr(b,e)},{column:"vat_number",id:"vat_number",label:n("vat_number")},{column:"website",id:"website",label:n("website"),format:b=>f(Ii,{to:b.toString(),external:!0,children:N(ZP,{children:[f("span",{children:b}),b.toString().length>0&&f(Imt,{size:14})]})})},{column:"group",id:"group_settings_id",label:n("group"),format:(b,y)=>{var C;return!!b&&f(Ii,{to:dt("/settings/group_settings/:id/edit",{id:b}),children:(C=y.group_settings)==null?void 0:C.name})}},{column:"city",id:"city",label:n("city")}],_=((v=r==null?void 0:r.react_table_columns)==null?void 0:v.client)||Rin;return m.filter(b=>_.includes(b.column)).sort((b,y)=>_.indexOf(b.column)-_.indexOf(y.column))}function Pin(n){var t;const[e]=ue();return f(Qd,{endpoint:ye("/api/v1/group_settings?status=active"),onChange:i=>i.resource&&n.onChange(i.resource),inputOptions:{label:(t=n.inputLabel)==null?void 0:t.toString(),value:n.value||null},entryOptions:{id:"id",label:"name",value:"id"},action:{label:e("new_group"),onClick:()=>{},visible:!1},readonly:n.readonly,onDismiss:n.onClearButtonClick,initiallyVisible:n.initiallyVisible,sortBy:"name|asc",staleTime:n.staleTime,errorMessage:n.errorMessage})}function Min(n){const[e]=ue(),{clients:t,setSelected:i}=n,r=Mpe(),[o,s]=w.useState(!1),[a,l]=w.useState(""),c=()=>{s(!1),l("")};return N(_t,{children:[f(et,{onClick:()=>s(!0),icon:f(Ve,{element:N5e}),children:e("assign_group")}),N(cr,{title:e("group"),visible:o,onClose:c,overflowVisible:!0,children:[f(Pin,{value:a,onChange:u=>l(u.id),onClearButtonClick:()=>l("")}),f(Ut,{behavior:"button",onClick:()=>{r(t.map(({id:u})=>u),"assign_group",{groupSettingsId:a}).then(()=>c()),i([])},disabled:!a,disableWithoutIcon:!0,children:e("add_to_group")})]})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Fin(){const{data:n}=Nd(),[e,t]=w.useState();return w.useEffect(()=>{n!=null&&n.bulk_updates&&t(n.bulk_updates)},[n]),e}const Bin=[{key:"public_notes",type:"markdownEditor"},{key:"industry_id",type:"industrySelector"},{key:"size_id",type:"sizeSelector"},{key:"country_id",type:"countrySelector"},{key:"custom_value1",type:"customField"},{key:"custom_value2",type:"customField"},{key:"custom_value3",type:"customField"},{key:"custom_value4",type:"customField"}];function $in(n){var b;const[e]=ue(),{setSelected:t,resourceIds:i}=n,r=Mpe(),{data:o}=Nd(),s=vi(),a=Fin(),[l,c]=w.useState(""),[u,d]=w.useState(""),[h,g]=w.useState(!1),p=()=>{g(!1),c(""),d("")},m=()=>{var y;return((y=Bin.find(({key:C})=>C===l))==null?void 0:y.type)||""},_=y=>y.startsWith("custom_value")?!!s.custom_fields[y.replace("custom_value",n.entity)]:!0,v=()=>l.replace("custom_value",n.entity);return N(_t,{children:[f(et,{onClick:()=>g(!0),icon:f(Ve,{element:eyt}),children:e("bulk_update")}),f(cr,{title:e("bulk_update"),size:"regular",visible:h,onClose:p,overflowVisible:!0,children:N("div",{className:"flex flex-col space-y-5",children:[f(nn,{label:e("column"),value:l,onValueChange:y=>{c(y),d("")},withBlank:!0,children:a==null?void 0:a[n.entity].map(y=>_(y)&&f("option",{value:y,children:e(y)},y))}),N("div",{className:"flex flex-col",children:[!!m()&&f($p,{className:"mb-2",children:e("value")}),m()==="markdownEditor"&&f(vd,{value:u,onChange:y=>d(y)}),m()==="industrySelector"&&f(nn,{value:u,onValueChange:y=>d(y),withBlank:!0,children:o==null?void 0:o.industries.map(y=>f("option",{value:y.id,children:y.name},y.id))}),m()==="sizeSelector"&&f(nn,{value:u,onValueChange:y=>d(y),withBlank:!0,children:o==null?void 0:o.sizes.map((y,C)=>f("option",{value:y.id,children:y.name},C))}),m()==="countrySelector"&&f(Xj,{value:u,onChange:y=>d(y),dismissable:!0}),m()==="customField"&&((b=s==null?void 0:s.custom_fields)==null?void 0:b[v()])&&f(Do,{field:v(),defaultValue:u,value:s.custom_fields[v()],onValueChange:y=>d(y),fieldOnly:!0})]}),f("div",{className:"flex self-end",children:f(Ut,{behavior:"button",onClick:()=>{r(i,"bulk_update",{column:l,newValue:u}).then(()=>p()),t([])},disabled:!l,disableWithoutIcon:!0,children:e("update")})})]})})]})}const Vin=()=>{const[n]=ue(),e=z8e(),t=d=>d.flatMap(({documents:h})=>h.map(({id:g})=>g)),i=d=>d.some(({documents:h})=>h.length),r=d=>d.every(({is_deleted:h})=>!h),o=d=>d.every(({is_deleted:h})=>!h),s=(d,h)=>{const g=t(d);e(g,"download"),h([])},{setChangeTemplateVisible:a,setChangeTemplateResources:l,setChangeTemplateEntityContext:c}=gA();return[({selectedResources:d,setSelected:h})=>r(d)&&f(et,{onClick:()=>i(d)?s(d,h):ie.error("no_documents_to_download"),icon:f(Ve,{element:XC}),children:n("documents")}),({selectedResources:d})=>f(et,{onClick:()=>{a(!0),l(d),c({endpoint:"/api/v1/clients/bulk",entity:"client"})},icon:f(Ve,{element:K2}),children:n("run_template")}),({selectedResources:d,setSelected:h})=>o(d)&&f(Min,{clients:d,setSelected:h}),({selectedIds:d,setSelected:h})=>f($in,{entity:"client",resourceIds:d,setSelected:h})]};function Hin(){const{id:n}=Fa(),e=Ain(),t=Oin(),i=Vin();return f("div",{className:"mt-8",children:f(Pg,{resource:"client",endpoint:dt("/api/v1/clients?include=group_settings&group=:groupId&sort=id|desc",{groupId:n}),bulkRoute:"/api/v1/clients/bulk",linkToEdit:"/clients/:id/edit",columns:t,customActions:e,bottomActionsKeys:["purge"],customBulkActions:i,withResourcefulActions:!0,linkToCreate:dt("/clients/create?group=:groupId",{groupId:n})})})}function Win(){const[n]=ue(),{id:e}=Fa(),{documentTitle:t}=gi("edit_group"),{data:i}=oXt({id:e}),r=qWe(),o=lU(),s=[{name:n("settings"),href:"/settings"},{name:n("group_settings"),href:"/settings/group_settings"},{name:n("edit_group"),href:dt("/settings/group_settings/:id/edit",{id:e})}],[a,l]=w.useState(),[c,u]=w.useState(),[d,h]=w.useState(!1),g=GWe({setGroupSettings:l,setErrors:u}),p=H8e({groupSettings:a,setErrors:u,isFormBusy:d,setIsFormBusy:h});w.useEffect(()=>{i&&l(i)},[i]);const m=()=>{hn(["group_settings"])};return f($i,{title:t,breadcrumbs:s,onSaveClick:p,disableSaveButton:d||!a,navigationTopRight:a&&f(I0,{label:n("more_actions"),resource:a,actions:r}),children:N(D_,{tabs:[n("overview"),n("clients"),n("documents")],formatTabLabel:_=>{if(_===2)return f(Ege,{numberOfDocuments:a==null?void 0:a.documents.length})},children:[f("div",{children:a&&i&&f(Ot,{title:n("edit_group"),topRight:N(Ut,{behavior:"button",onClick:()=>o(i),children:[f(Ve,{className:"h-4 w-4",element:Ihe,color:"white"}),f("span",{children:n("configure_settings")})]}),children:f("div",{children:f(YWe,{groupSettings:a,handleChange:g,errors:c})})})}),f("div",{children:f(Hin,{})}),N("div",{children:[f(Fpe,{endpoint:ye("/api/v1/group_settings/:id/upload",{id:e}),onSuccess:m,widgetOnly:!0}),f(xHe,{documents:(a==null?void 0:a.documents)||[],onDocumentDelete:m})]})]})})}function zin(){gi("user_management");const n=ha(),[e]=ue(),[t,i]=w.useState(!1),[r,o]=w.useState(),[s,a]=w.useState([]),l=uXt(),c=[{name:e("settings"),href:"/settings"},{name:e("user_management"),href:"/settings/users"}],u=[{id:"name",label:"name",format:(d,h)=>N(Ii,{to:dt("/settings/users/:id/edit",{id:h.id}),children:[h.first_name," ",h.last_name]})},{id:"email",label:"email"}];return N(_t,{children:[f($i,{title:e("user_details"),breadcrumbs:c,docsLink:"/docs/advanced-settings/#user_management",children:f(Pg,{resource:"user",columns:u,endpoint:dt("/api/v1/users?hideOwnerUsers=true&without=:userId&sort=id|desc&status=active",{userId:n==null?void 0:n.id}),linkToCreate:"/settings/users/create",bulkRoute:"/api/v1/users/bulk",onBulkActionCall:(d,h)=>{a(d),o(h),i(!0)}})}),f(Rg,{show:t,onClose:i,onSave:d=>r&&l(s,r,d),tableActions:!0})]})}function jin(n){const[e]=ue(),[t,i]=w.useState(!1),[r,o]=w.useState(),{user:s}=n,{id:a}=Fa(),l=ri(),c=()=>{ie.processing(),Te("POST",ye("/api/v1/users/:id/invite",{id:a})).then(()=>{hn(["users"]),ie.success("email_sent_to_confirm_email")})},u=()=>{ie.processing(),Te("DELETE",ye("/api/v1/users/:id/detach_from_company",{id:a})).then(()=>{ie.success("removed_user"),hn(["users"]),l("/settings/users")}).catch(h=>{var g;((g=h.response)==null?void 0:g.status)===412&&ie.error("password_error_incorrect")})};return N(_t,{children:[f(Rg,{show:t,onClose:i,onSave:()=>{if(r==="remove")return u();const h={archive:"archived_user",restore:"restored_user",delete:"deleted_user",remove:"removed_user"};ie.processing(),Te("POST",ye("/api/v1/users/bulk"),{action:r,ids:[a]}).then(()=>{const g=h[r]||`${r}d_user`;ie.success(g),hn(["users"])}).catch(g=>{var p;((p=g.response)==null?void 0:p.status)===412&&ie.error("password_error_incorrect")})}}),N(Hp,{label:e("more_actions"),className:"divide-y",children:[N("div",{children:[f(et,{onClick:()=>c(),icon:f(Ve,{element:efe}),children:e("resend_email")}),f(et,{onClick:()=>{o("remove"),i(!0)},icon:f(Ve,{element:uyt}),children:e("remove")})]}),N("div",{children:[s.archived_at===0&&f(et,{onClick:()=>{o("archive"),i(!0)},icon:f(Ve,{element:Xl}),children:e("archive")}),s.archived_at>0&&f(et,{onClick:()=>{o("restore"),i(!0)},icon:f(Ve,{element:Ql}),children:e("restore")}),!s.is_deleted&&f(et,{onClick:()=>{o("delete"),i(!0)},icon:f(Ve,{element:Pa}),children:e("delete")})]})]})]})}function QWe(n){var s,a,l,c,u,d,h,g;const[e]=ue(),{user:t,setUser:i}=n,r=(p,m)=>{i(_=>_&&{..._,[p]:m})},o=vi();return N(Ot,{title:e("details"),children:[f(U,{leftSide:e("first_name"),required:!0,children:f(ke,{value:t==null?void 0:t.first_name,onValueChange:p=>r("first_name",p),errorMessage:(s=n.errors)==null?void 0:s.errors.first_name})}),f(U,{leftSide:e("last_name"),required:!0,children:f(ke,{value:t==null?void 0:t.last_name,onValueChange:p=>r("last_name",p),errorMessage:(a=n.errors)==null?void 0:a.errors.last_name})}),f(U,{leftSide:e("email"),children:f(ke,{type:"email",value:t==null?void 0:t.email,onValueChange:p=>r("email",p),errorMessage:(l=n.errors)==null?void 0:l.errors.email})}),f(U,{leftSide:e("phone"),children:f(ke,{value:t==null?void 0:t.phone,onValueChange:p=>r("phone",p),errorMessage:(c=n.errors)==null?void 0:c.errors.phone})}),f(U,{leftSide:e("login_notification"),leftSideHelp:e("login_notification_help"),children:f(gt,{checked:t==null?void 0:t.user_logged_in_notification,onChange:p=>r("user_logged_in_notification",p)})}),((u=o==null?void 0:o.custom_fields)==null?void 0:u.user1)&&f(Do,{field:"user1",defaultValue:t.custom_value1,value:o.custom_fields.user1,onValueChange:p=>r("custom_value1",String(p))}),((d=o==null?void 0:o.custom_fields)==null?void 0:d.user2)&&f(Do,{field:"user2",defaultValue:t.custom_value2,value:o.custom_fields.user2,onValueChange:p=>r("custom_value2",String(p))}),((h=o==null?void 0:o.custom_fields)==null?void 0:h.user3)&&f(Do,{field:"user3",defaultValue:t.custom_value3,value:o.custom_fields.user3,onValueChange:p=>r("custom_value3",String(p))}),((g=o==null?void 0:o.custom_fields)==null?void 0:g.user4)&&f(Do,{field:"user4",defaultValue:t.custom_value4,value:o.custom_fields.user4,onValueChange:p=>r("custom_value4",String(p))})]})}function XWe(n){const[e]=ue(),{user:t,setUser:i}=n,r=[{id:"invoice_created",label:"invoice_created"},{id:"invoice_sent",label:"invoice_sent_notification_label"},{id:"invoice_viewed",label:"invoice_viewed"},{id:"invoice_late",label:"invoice_late"},{id:"inventory_threshold",label:"inventory_threshold"},{id:"payment_success",label:"payment_success"},{id:"payment_failure",label:"payment_failure"},{id:"payment_manual",label:"manual_payment"},{id:"purchase_order_created",label:"purchase_order_created"},{id:"purchase_order_sent",label:"purchase_order_sent"},{id:"purchase_order_viewed",label:"purchase_order_viewed"},{id:"purchase_order_accepted",label:"purchase_order_accepted"},{id:"quote_created",label:"quote_created"},{id:"quote_sent",label:"quote_sent"},{id:"quote_viewed",label:"quote_viewed"},{id:"quote_approved",label:"quote_approved"},{id:"quote_expired",label:"quote_expired"},{id:"credit_created",label:"credit_created"},{id:"credit_sent",label:"credit_sent"},{id:"credit_viewed",label:"credit_viewed"}],o=()=>{var u;const c=((u=t==null?void 0:t.company_user)==null?void 0:u.notifications.email)??[];return c.includes("all_notifications")?"all_notifications":c.includes("all_user_notifications")?"all_user_notifications":""},s=(c,u)=>{var h,g;const d=Bn.cloneDeep(t);if(c==="all_events"&&d.company_user)u.length===0?d.company_user.notifications.email=[]:d.company_user.notifications.email=[u];else if(u.endsWith("none")&&d.company_user){const p=(h=d.company_user)==null?void 0:h.notifications.email.filter(m=>!m.startsWith(c));d.company_user.notifications.email=p}else{const p=((g=d.company_user)==null?void 0:g.notifications.email.filter(m=>!m.startsWith(c)))||[];p==null||p.push(u),d.company_user&&(d.company_user.notifications.email=p)}i({...d})},a=c=>{var d;const u=((d=t==null?void 0:t.company_user)==null?void 0:d.notifications.email)??[];return u.includes("all_notifications")?`${c}_all`:u.includes("all_user_notifications")?`${c}_user`:u.includes(`${c}_all`)?`${c}_all`:u.includes(`${c}_user`)?`${c}_user`:`${c}_none`},l=()=>{var u;const c=((u=t==null?void 0:t.company_user)==null?void 0:u.notifications.email)??[];return!!(c.includes("all_notifications")||c.includes("all_user_notifications"))};return N(Ot,{title:e("notifications"),children:[f(U,{children:e("email")}),f(U,{leftSide:e("all_events"),children:N(nn,{withBlank:!0,value:o(),onValueChange:c=>s("all_events",c),children:[f("option",{value:"all_notifications",children:e("all_records")}),f("option",{value:"all_user_notifications",children:e("owned_by_user")}),f("option",{value:"",children:e("custom")})]})}),r.map((c,u)=>f(U,{leftSide:e(c.label),children:N(nn,{value:a(c.id),disabled:l(),onValueChange:d=>s(c.id,d),children:[f("option",{value:`${c.id}_all`,children:e("all_records")}),f("option",{value:`${c.id}_user`,children:e("owned_by_user")}),f("option",{value:`${c.id}_none`,children:e("none")})]})},u))]})}function ZWe(n){var l;const[e]=ue(),{user:t,setUser:i}=n,r=["client","product","invoice","payment","recurring_invoice","quote","credit","project","task","vendor","expense","bank_transaction","purchase_order","recurring_expense"],o=c=>{i(u=>u&&{...u,company_user:u.company_user&&{...u.company_user,is_admin:c}})},s=c=>{var h;const u=(h=t==null?void 0:t.company_user)==null?void 0:h.permissions,[d]=c.split("_");return!!(u&&u.includes(`${d}_all`)&&c!=="view_reports"&&c!=="view_dashboard"||u&&u.includes(c))},a=(c,u)=>{var p;let d=Bn.clone(((p=t==null?void 0:t.company_user)==null?void 0:p.permissions)??"").split(",").filter(m=>m!==c);const[h,g]=c.split("_");if(g==="all")d=d.filter(m=>!m.startsWith(h));else if(d.includes(`${h}_all`)){const m=r.map(_=>`${h}_${_}`).filter(_=>_!==c);d=d.filter(_=>_!==`${h}_all`),d=[...d,...m]}u&&d.push(c),d[0]===""&&d.shift(),i(m=>m&&{...m,company_user:m.company_user&&{...m.company_user,permissions:d.join(",")}})};return N(Ot,{title:e("permissions"),children:[f(U,{leftSide:e("administrator"),leftSideHelp:e("administrator_help"),children:f(gt,{checked:(l=t==null?void 0:t.company_user)==null?void 0:l.is_admin,onChange:c=>o(c),cypressRef:"admin"})}),f(U,{leftSide:e("view_dashboard"),children:f(gt,{checked:s("view_dashboard"),onValueChange:c=>a("view_dashboard",c),cypressRef:"viewDashboard"})}),f(U,{leftSide:e("reports"),leftSideHelp:e("view_report_permission"),children:f(gt,{checked:s("view_reports"),onValueChange:c=>a("view_reports",c),cypressRef:"viewReports"})}),f(U,{children:N("div",{className:"grid grid-cols-3 md:grid-cols-6",children:[f("div",{className:"col-1",children:e("create")}),f("div",{className:"col-1",children:e("view")}),f("div",{className:"col-1",children:e("edit")})]})}),f(U,{leftSide:e("all"),children:N("div",{className:"grid grid-cols-3 md:grid-cols-6",children:[f("div",{className:"col-1",children:f(Nh,{checked:s("create_all"),onChange:c=>a("create_all",c.target.checked),cypressRef:"create_all"})}),f("div",{className:"col-1",children:f(Nh,{checked:s("view_all"),onChange:c=>a("view_all",c.target.checked),cypressRef:"view_all"})}),f("div",{className:"col-1",children:f(Nh,{checked:s("edit_all"),onChange:c=>a("edit_all",c.target.checked),cypressRef:"edit_all"})})]})}),r.map((c,u)=>f(U,{leftSide:e(c),children:N("div",{className:"grid grid-cols-3 md:grid-cols-6",children:[f("div",{className:"col-1",children:f(Nh,{checked:s(`create_${c}`),onChange:d=>a(`create_${c}`,d.target.checked),cypressRef:`create_${c}`})}),f("div",{className:"col-1",children:f(Nh,{checked:s(`view_${c}`),onChange:d=>a(`view_${c}`,d.target.checked),cypressRef:`view_${c}`})}),f("div",{className:"col-1",children:f(Nh,{checked:s(`edit_${c}`),onChange:d=>a(`edit_${c}`,d.target.checked),cypressRef:`edit_${c}`})})]})},u))]})}function Uin(){const[n,e]=w.useState(!1),{id:t}=Fa(),{data:i}=lXt({id:t,enabled:n}),[r,o]=w.useState(),[s]=ue(),a=[s("details"),s("notifications"),s("permissions")],l=[{name:s("settings"),href:"/settings"},{name:s("user_management"),href:"/settings/users"},{name:s("edit_user"),href:dt("/settings/users/:id/edit",{id:t})}],c=ha(),u=ri(),d=Kr(),[h,g]=w.useState(),p=Ri(_f);w.useEffect(()=>{i!=null&&i.data.data&&i.data.data.email===(c==null?void 0:c.email)?u("/settings/user_details"):o(i==null?void 0:i.data.data)},[i==null?void 0:i.data.data]);const m=()=>{ie.processing(),Te("PUT",ye("/api/v1/users/:id?include=company_user",{id:t}),r).then(()=>{ie.success("updated_user"),hn(["users"])}).catch(v=>{var b;((b=v.response)==null?void 0:b.status)===422&&(g(v.response.data),ie.dismiss())})},_=v=>{ie.processing(),d.fetchQuery(["/api/v1/users",t],()=>Te("GET",ye("/api/v1/users/:id?include=company_user",{id:t}),{},{headers:{"X-Api-Password":v}}),{staleTime:1/0}).then(()=>{e(!0),ie.dismiss()}).catch(b=>{var y;((y=b.response)==null?void 0:y.status)===412&&(ie.error("password_error_incorrect"),p(0))})};return N($i,{breadcrumbs:l,title:s("edit_user"),onSaveClick:m,navigationTopRight:r&&f(jin,{user:r}),children:[f(Rg,{show:!n,onSave:_,onClose:e}),r&&r.email_verified_at===null&&N(bs,{type:"warning",children:[s("email_sent_to_confirm_email"),"."]}),N(D_,{tabs:a,children:[f("div",{children:r&&f(QWe,{user:r,setUser:o,errors:h})}),f("div",{children:r&&f(XWe,{user:r,setUser:o})}),f("div",{children:r&&f(ZWe,{user:r,setUser:o})})]})]})}function qin(){gi("new_user");const[n]=ue(),e=[{name:n("settings"),href:"/settings"},{name:n("user_management"),href:"/settings/users"},{name:n("new_user"),href:"/settings/users/create"}],t=[n("details"),n("notifications"),n("permissions")],i=Ri(_f),{data:r}=cXt(),[o,s]=w.useState(),[a,l]=w.useState(),[c,u]=w.useState(!1),d=ri();w.useEffect(()=>{s({...r==null?void 0:r.data.data,company_user:{permissions:"",notifications:{email:[]},settings:{table_columns:[],report_settings:[],number_years_active:1,include_deleted_clients:!1,accent_color:"#2F7DC3"},is_owner:!1,is_admin:!1,is_locked:!1,updated_at:+new Date,archived_at:+new Date,created_at:+new Date,permissions_updated_at:+new Date,ninja_portal_url:""}})},[r==null?void 0:r.data.data]);const h=g=>{ie.processing(),u(!1),Te("POST",ye("/api/v1/users?include=company_user"),o,{headers:{"X-Api-Password":g,...fx()}}).then(p=>{ie.success("created_user"),hn(["users"]),d(dt("/settings/users/:id/edit",{id:p.data.data.id}))}).catch(p=>{var m,_;if(((m=p.response)==null?void 0:m.status)===412)ie.error("password_error_incorrect"),i(0);else if(((_=p.response)==null?void 0:_.status)===422){const v=p.response.data;v.errors.id?ie.error(v.errors.id):ie.dismiss(),l(v)}})};return N($i,{title:n("new_user"),breadcrumbs:e,onSaveClick:()=>u(!0),disableSaveButton:!ql()&&Yo(),children:[!ql()&&Yo()&&f(xb,{message:n("add_users_not_supported")}),f(Rg,{show:c,onSave:h,onClose:u}),N(D_,{tabs:t,children:[f("div",{children:o&&f(QWe,{user:o,setUser:s,errors:a})}),f("div",{children:o&&f(XWe,{user:o,setUser:s})}),f("div",{children:o&&f(ZWe,{user:o,setUser:s})})]})]})}function pA(n){return N("div",{className:"flex justify-center",children:[f(Tfe,{pages:n.breadcrumbs}),f("div",{className:`container max-w-3xl space-y-6 ${n.className}`,children:n.children})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Kin(n){const{setPaymentTerm:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(o=>o&&{...o,[i]:r})}}function Gin(){const{documentTitle:n}=gi("create_payment_term"),[e]=ue(),t=ri(),{data:i}=pKt(),r=[{name:e("settings"),href:"/settings"},{name:e("payment_settings"),href:"/settings/online_payments"},{name:e("payment_terms"),href:"/settings/payment_terms"},{name:e("create_payment_term"),href:"/settings/payment_terms/create"}],[o,s]=w.useState(),[a,l]=w.useState(!1),[c,u]=w.useState(),d=Kin({setErrors:s,setPaymentTerm:u}),h=(p,m)=>{p.preventDefault(),a||(ie.processing(),l(!0),Te("POST",ye("/api/v1/payment_terms"),c).then(_=>{ie.success("created_payment_term"),hn(["payment_terms"]),m==="save"?t(dt("/settings/payment_terms/:id/edit",{id:_.data.data.id})):i&&u(i)}).catch(_=>{var v;((v=_.response)==null?void 0:v.status)===422&&(ie.dismiss(),s(_.response.data))}).finally(()=>l(!1)))},g=[{onClick:p=>h(p,"create"),text:`${e("save")} / ${e("create")}`,icon:f(Ve,{element:eg})}];return w.useEffect(()=>{i&&u(i)},[i]),f($i,{title:e("payment_terms"),breadcrumbs:r,children:f(pA,{breadcrumbs:[],children:f(Ot,{title:n,withSaveButton:!0,disableSubmitButton:a,onFormSubmit:p=>h(p,"save"),onSaveClick:p=>h(p,"save"),additionalSaveOptions:g,children:f(Sb,{children:f(ke,{required:!0,value:c==null?void 0:c.num_days,type:"number",label:e("number_of_days"),onValueChange:p=>d("num_days",Number(p)),errorMessage:o==null?void 0:o.errors.num_days})})})})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Yin(){return n=>{ie.processing(),Ipe([n],"archive").then(()=>ie.success("archived_payment_term")).finally(()=>hn(["payment_terms"]))}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Qin(){return n=>{ie.processing(),Ipe([n],"delete").then(()=>ie.success("deleted_payment_term")).finally(()=>hn(["payment_terms"]))}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Xin(){return n=>{ie.processing(),Ipe([n],"restore").then(()=>ie.success("restored_payment_term")).finally(()=>hn(["payment_terms"]))}}function Zin(n){const[e]=ue(),t=Yin(),i=Xin(),r=Qin();return N(Hp,{label:e("more_actions"),children:[!n.paymentTerm.archived_at&&!n.paymentTerm.is_deleted&&f(et,{onClick:()=>t(n.paymentTerm.id),icon:f(Ve,{element:Xl}),children:e("archive")}),(n.paymentTerm.archived_at||n.paymentTerm.is_deleted)&&f(et,{onClick:()=>i(n.paymentTerm.id),icon:f(Ve,{element:Ql}),children:e("restore")}),!n.paymentTerm.is_deleted&&f(et,{onClick:()=>r(n.paymentTerm.id),icon:f(Ve,{element:Pa}),children:e("delete")})]})}function Jin(){gi("payment_terms");const[n]=ue(),{id:e}=Fa(),t=[{name:n("settings"),href:"/settings"},{name:n("payment_settings"),href:"/settings/online_payments"},{name:n("payment_terms"),href:"/settings/payment_terms"},{name:n("edit_payment_term"),href:dt("/settings/payment_terms/:id/edit",{id:e})}],{data:i}=gKt({id:e}),r=()=>{hn(["payment_terms"])},o=Xp({enableReinitialize:!0,initialValues:{num_days:(i==null?void 0:i.data.data.num_days)||0},onSubmit:s=>{ie.processing(),Te("PUT",ye("/api/v1/payment_terms/:id",{id:i==null?void 0:i.data.data.id}),s).then(()=>ie.success("updated_payment_term")).finally(()=>{o.setSubmitting(!1),r()})}});return N($i,{title:n("payment_terms"),breadcrumbs:t,navigationTopRight:i&&f(Zin,{paymentTerm:i.data.data}),children:[!i&&f("div",{className:"flex justify-center",children:f(Vo,{})}),i&&f(pA,{breadcrumbs:[],children:N(Ot,{title:i.data.data.name,disableSubmitButton:o.isSubmitting,onFormSubmit:o.handleSubmit,withSaveButton:!0,children:[N(U,{leftSide:"Status",children:[!i.data.data.is_deleted&&!i.data.data.archived_at&&f(Gi,{variant:"primary",children:n("active")}),i.data.data.archived_at&&!i.data.data.is_deleted?f(Gi,{variant:"yellow",children:n("archived")}):null,i.data.data.is_deleted&&f(Gi,{variant:"red",children:n("deleted")})]}),f(Sb,{children:f(ke,{value:o.values.num_days,type:"number",id:"num_days",label:n("number_of_days"),onChange:o.handleChange})})]})})]})}function ern(){const{documentTitle:n}=gi("payment_terms"),[e]=ue(),t=[{name:e("settings"),href:"/settings"},{name:e("payment_settings"),href:"/settings/online_payments"},{name:e("payment_terms"),href:"/settings/payment_terms"}],i=[{id:"name",label:e("number_of_days"),format:(r,o)=>f(Ii,{to:dt("/settings/payment_terms/:id/edit",{id:o.id}),children:r})}];return f($i,{breadcrumbs:t,title:n,children:f(Pg,{endpoint:"/api/v1/payment_terms?sort=id|desc",bulkRoute:"/api/v1/payment_terms/bulk",resource:"payment_term",columns:i,linkToCreate:"/settings/payment_terms/create",linkToEdit:"/settings/payment_terms/:id/edit",withResourcefulActions:!0})})}const trn=()=>{const[n]=ue();return[{id:"name",label:n("name"),format:(t,i)=>f(Ii,{to:dt("/settings/tax_rates/:id/edit",{id:i.id}),children:i==null?void 0:i.name})},{id:"rate",label:n("tax_rate"),format:t=>N("span",{children:[t,"%"]})}]};function nrn(){const n=Ci(),e=trn(),t=i=>{(i==="archive"||i==="delete")&&Te("POST",ye("/api/v1/refresh")).then(r=>{n(yb(r.data.data)),n(Bde("company"))})};return f(Pg,{resource:"tax_rate",endpoint:"/api/v1/tax_rates?sort=id|desc&per_page=100",bulkRoute:"/api/v1/tax_rates/bulk",columns:e,linkToCreate:"/settings/tax_rates/create",linkToEdit:"/settings/tax_rates/:id/edit",withResourcefulActions:!0,onBulkActionSuccess:(i,r)=>t(r)})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function irn(n){const{setTaxRate:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(o=>o&&{...o,[i]:r})}}function rrn(){const{documentTitle:n}=gi("create_tax_rate"),[e]=ue(),t=ri(),{data:i}=M5t(),r=[{name:e("settings"),href:"/settings"},{name:e("tax_settings"),href:"/settings/tax_settings"},{name:e("create_tax_rate"),href:"/settings/tax_rates/create"}],[o,s]=w.useState(),[a,l]=w.useState(),[c,u]=w.useState(!1),d=irn({setErrors:s,setTaxRate:l}),h=(p,m)=>{p.preventDefault(),c||(ie.processing(),u(!0),Te("POST",ye("/api/v1/tax_rates"),a).then(_=>{ie.success("created_tax_rate"),hn(["tax_rates"]),m==="save"?t(dt("/settings/tax_rates/:id/edit",{id:_.data.data.id})):i&&l(i)}).catch(_=>{var v;((v=_.response)==null?void 0:v.status)===422&&(ie.dismiss(),s(_.response.data))}).finally(()=>u(!1)))},g=[{onClick:p=>h(p,"create"),text:`${e("save")} / ${e("create")}`,icon:f(Ve,{element:eg})}];return w.useEffect(()=>{i&&l(i)},[i]),f($i,{title:e("tax_rates"),breadcrumbs:[],children:f(pA,{className:"space-y-6",breadcrumbs:r,children:f(Ot,{title:n,withSaveButton:!0,disableSubmitButton:c,onFormSubmit:p=>h(p,"save"),onSaveClick:p=>h(p,"save"),additionalSaveOptions:g,children:N(Sb,{children:[f(ke,{required:!0,type:"text",label:e("name"),value:a==null?void 0:a.name,onValueChange:p=>d("name",p),errorMessage:o==null?void 0:o.errors.name}),f(ke,{required:!0,type:"number",label:e("tax_rate"),value:a==null?void 0:a.rate,onValueChange:p=>d("rate",Number(p)),errorMessage:o==null?void 0:o.errors.rate})]})})})})}function orn(){const[n]=ue(),e=F5t();return[i=>i.archived_at===0&&f(et,{onClick:()=>e(i.id,"archive"),icon:f(Ve,{element:Xl}),children:n("archive")}),i=>i.archived_at>0&&f(et,{onClick:()=>e(i.id,"restore"),icon:f(Ve,{element:Ql}),children:n("restore")}),i=>!i.is_deleted&&f(et,{onClick:()=>e(i.id,"delete"),icon:f(Ve,{element:Pa}),children:n("delete")})]}function srn(){var u,d;const{setDocumentTitle:n}=gi("edit_tax_rate"),[e]=ue(),{id:t}=Fa(),i=[{name:e("settings"),href:"/settings"},{name:e("tax_settings"),href:"/settings/tax_settings"},{name:e("edit_tax_rate"),href:dt("/settings/tax_rates/:id/edit",{id:t})}],{data:r}=P5t({id:t}),[o,s]=w.useState({}),a=orn();w.useEffect(()=>{n(r==null?void 0:r.data.data.name)},[r]);const l=()=>{hn(["tax_rates"])},c=Xp({enableReinitialize:!0,initialValues:{name:(r==null?void 0:r.data.data.name)||"",rate:(r==null?void 0:r.data.data.rate)||0},onSubmit:h=>{s({}),ie.processing(),Te("PUT",ye("/api/v1/tax_rates/:id",{id:t}),h).then(()=>ie.success("updated_tax_rate")).catch(g=>{var p;((p=g.response)==null?void 0:p.status)===422&&(ie.dismiss(),s(g.response.data))}).finally(()=>{c.setSubmitting(!1),l()})}});return N($i,{title:e("tax_rates"),navigationTopRight:r&&f(I0,{label:e("more_actions"),resource:r.data.data,actions:a}),breadcrumbs:[],children:[!r&&f("div",{className:"flex justify-center",children:f(Vo,{})}),r&&f(pA,{className:"space-y-6",breadcrumbs:i,children:N(Ot,{withSaveButton:!0,onFormSubmit:c.handleSubmit,disableSubmitButton:c.isSubmitting,title:r.data.data.name,children:[N(U,{leftSide:e("status"),children:[!r.data.data.is_deleted&&!r.data.data.archived_at&&f(Gi,{variant:"primary",children:e("active")}),r.data.data.archived_at&&!r.data.data.is_deleted?f(Gi,{variant:"yellow",children:e("archived")}):null,r.data.data.is_deleted&&f(Gi,{variant:"red",children:e("deleted")})]}),N(Sb,{children:[f(ke,{type:"text",id:"name",label:e("name"),onChange:c.handleChange,errorMessage:(u=o==null?void 0:o.errors)==null?void 0:u.name,value:c.values.name}),f(ke,{type:"number",id:"rate",label:e("tax_rate"),onChange:c.handleChange,errorMessage:(d=o==null?void 0:o.errors)==null?void 0:d.rate,value:c.values.rate})]})]})})]})}function arn(){const n=()=>{hn(["documents"])},e=vi();return N(_t,{children:[e&&f(Fpe,{endpoint:ye("/api/v1/companies/:id/upload",{id:e.id}),onSuccess:n}),f(qQt,{})]})}function lrn(){var a,l,c,u,d,h;const[n]=ue(),{data:e}=Nd(),t=Ci(),i=Zs(),r=Tl(g=>g.companyUsers.changes.company),o=ki(Ss),s=g=>t(Vr({object:"company",property:g.target.id,value:g.target.value}));return f(_t,{children:(r==null?void 0:r.settings)&&N(Ot,{title:n("address"),children:[f(U,{leftSide:f(bt,{propertyKey:"address1",labelElement:f(yt,{label:n("address1")})}),children:f(ke,{value:((a=r==null?void 0:r.settings)==null?void 0:a.address1)||"",onChange:s,id:"settings.address1",disabled:i("address1"),errorMessage:o==null?void 0:o.errors["settings.address1"]})}),f(U,{leftSide:f(bt,{propertyKey:"address2",labelElement:f(yt,{label:n("address2")})}),children:f(ke,{value:((l=r==null?void 0:r.settings)==null?void 0:l.address2)||"",onChange:s,id:"settings.address2",disabled:i("address2"),errorMessage:o==null?void 0:o.errors["settings.address2"]})}),f(U,{leftSide:f(bt,{propertyKey:"city",labelElement:f(yt,{label:n("city")})}),children:f(ke,{value:((c=r==null?void 0:r.settings)==null?void 0:c.city)||"",onChange:s,id:"settings.city",disabled:i("city"),errorMessage:o==null?void 0:o.errors["settings.city"]})}),f(U,{leftSide:f(bt,{propertyKey:"state",labelElement:f(yt,{label:n("state")})}),children:f(ke,{value:((u=r==null?void 0:r.settings)==null?void 0:u.state)||"",onChange:s,id:"settings.state",disabled:i("state"),errorMessage:o==null?void 0:o.errors["settings.state"]})}),f(U,{leftSide:f(bt,{propertyKey:"postal_code",labelElement:f(yt,{label:n("postal_code")})}),children:f(ke,{value:((d=r==null?void 0:r.settings)==null?void 0:d.postal_code)||"",onChange:s,id:"settings.postal_code",disabled:i("postal_code"),errorMessage:o==null?void 0:o.errors["settings.postal_code"]})}),f(U,{leftSide:f(bt,{propertyKey:"country_id",labelElement:f(yt,{label:n("country")})}),children:f(nn,{value:((h=r==null?void 0:r.settings)==null?void 0:h.country_id)||"",onChange:s,id:"settings.country_id",disabled:i("country_id"),errorMessage:o==null?void 0:o.errors["settings.country_id"],withBlank:!0,children:e==null?void 0:e.countries.map(g=>f("option",{value:g.id,children:g.name},g.id))})})]})})}function crn(){var r,o,s,a,l,c,u,d;const[n]=ue(),e=Ci(),t=Zs(),i=Tl(h=>h.companyUsers.changes.company);return f(_t,{children:(i==null?void 0:i.settings)&&N(Ot,{title:n("defaults"),children:[f(U,{leftSide:f(bt,{propertyKey:"invoice_terms",labelElement:f(yt,{label:n("invoice_terms")})}),children:f(vd,{value:((r=i==null?void 0:i.settings)==null?void 0:r.invoice_terms)||"",onChange:h=>e(Vr({object:"company",property:"settings.invoice_terms",value:h})),disabled:t("invoice_terms")})}),f(U,{className:"mt-4",leftSide:f(bt,{propertyKey:"invoice_footer",labelElement:f(yt,{label:n("invoice_footer")})}),children:f(vd,{value:((o=i==null?void 0:i.settings)==null?void 0:o.invoice_footer)||"",onChange:h=>e(Vr({object:"company",property:"settings.invoice_footer",value:h})),disabled:t("invoice_footer")})}),f(U,{className:"mt-4",leftSide:f(bt,{propertyKey:"quote_terms",labelElement:f(yt,{label:n("quote_terms")})}),children:f(vd,{value:((s=i==null?void 0:i.settings)==null?void 0:s.quote_terms)||"",onChange:h=>e(Vr({object:"company",property:"settings.quote_terms",value:h})),disabled:t("quote_terms")})}),f(U,{className:"mt-4",leftSide:f(bt,{propertyKey:"quote_footer",labelElement:f(yt,{label:n("quote_footer")})}),children:f(vd,{value:((a=i==null?void 0:i.settings)==null?void 0:a.quote_footer)||"",onChange:h=>e(Vr({object:"company",property:"settings.quote_footer",value:h})),disabled:t("quote_footer")})}),f(U,{className:"mt-4",leftSide:f(bt,{propertyKey:"credit_terms",labelElement:f(yt,{label:n("credit_terms")})}),children:f(vd,{value:((l=i==null?void 0:i.settings)==null?void 0:l.credit_terms)||"",onChange:h=>e(Vr({object:"company",property:"settings.credit_terms",value:h})),disabled:t("credit_terms")})}),f(U,{className:"mt-4",leftSide:f(bt,{propertyKey:"credit_footer",labelElement:f(yt,{label:n("credit_footer")})}),children:f(vd,{value:((c=i==null?void 0:i.settings)==null?void 0:c.credit_footer)||"",onChange:h=>e(Vr({object:"company",property:"settings.credit_footer",value:h})),disabled:t("credit_footer")})}),f(U,{className:"mt-4",leftSide:f(bt,{propertyKey:"purchase_order_terms",labelElement:f(yt,{label:n("purchase_order_terms")})}),children:f(vd,{value:((u=i==null?void 0:i.settings)==null?void 0:u.purchase_order_terms)||"",onChange:h=>e(Vr({object:"company",property:"settings.purchase_order_terms",value:h})),disabled:t("purchase_order_terms")})}),f(U,{className:"mt-4",leftSide:f(bt,{propertyKey:"purchase_order_footer",labelElement:f(yt,{label:n("purchase_order_footer")})}),children:f(vd,{value:((d=i==null?void 0:i.settings)==null?void 0:d.purchase_order_footer)||"",onChange:h=>e(Vr({object:"company",property:"settings.purchase_order_footer",value:h})),disabled:t("purchase_order_footer")})})]})})}function urn(){var l,c,u,d,h,g,p,m,_,v,b,y,C;const[n]=ue(),e=Ci(),t=Zs(),{isCompanySettingsActive:i}=Ms(),{data:r}=Nd(),o=ki(Ss),s=Tl(x=>x.companyUsers.changes.company),a=(x,k)=>e(Vr({object:"company",property:x,value:k}));return f(_t,{children:(s==null?void 0:s.settings)&&N(Ot,{title:n("details"),children:[f(U,{leftSide:f(bt,{propertyKey:"name",labelElement:f(yt,{label:n("company_name")})}),children:f(ke,{value:((l=s==null?void 0:s.settings)==null?void 0:l.name)||"",onValueChange:x=>a("settings.name",x.toString()),disabled:t("name"),errorMessage:o==null?void 0:o.errors["settings.name"]})}),f(U,{leftSide:f(bt,{propertyKey:"id_number",labelElement:f(yt,{label:n("id_number")})}),children:f(ke,{value:((c=s==null?void 0:s.settings)==null?void 0:c.id_number)||"",onValueChange:x=>a("settings.id_number",x.toString()),disabled:t("id_number"),errorMessage:o==null?void 0:o.errors["settings.id_number"]})}),f(U,{leftSide:f(bt,{propertyKey:"vat_number",labelElement:f(yt,{label:n("vat_number")})}),children:f(ke,{value:((u=s==null?void 0:s.settings)==null?void 0:u.vat_number)||"",onValueChange:x=>a("settings.vat_number",x.toString()),disabled:t("vat_number"),errorMessage:o==null?void 0:o.errors["settings.vat_number"]})}),f(U,{leftSide:f(bt,{propertyKey:"website",labelElement:f(yt,{label:n("website")})}),children:f(ke,{value:((d=s==null?void 0:s.settings)==null?void 0:d.website)||"",onValueChange:x=>a("settings.website",x.toString()),disabled:t("website"),errorMessage:o==null?void 0:o.errors["settings.website"]})}),f(U,{leftSide:f(bt,{propertyKey:"email",labelElement:f(yt,{label:n("email")})}),children:f(ke,{value:((h=s==null?void 0:s.settings)==null?void 0:h.email)||"",onValueChange:x=>a("settings.email",x.toString()),disabled:t("email"),errorMessage:o==null?void 0:o.errors["settings.email"]})}),f(U,{leftSide:f(bt,{propertyKey:"phone",labelElement:f(yt,{label:`${n("company")} ${n("phone")}`})}),children:f(ke,{value:((g=s==null?void 0:s.settings)==null?void 0:g.phone)||"",onValueChange:x=>a("settings.phone",x.toString()),disabled:t("phone"),errorMessage:o==null?void 0:o.errors["settings.phone"]})}),(s==null?void 0:s.settings.country_id)=="756"?N(_t,{children:[f(U,{leftSide:f(bt,{propertyKey:"qr_iban",labelElement:f(yt,{label:n("qr_iban")})}),children:f(ke,{value:((p=s==null?void 0:s.settings)==null?void 0:p.qr_iban)||"",onValueChange:x=>a("settings.qr_iban",x.toString()),disabled:t("qr_iban"),errorMessage:o==null?void 0:o.errors["settings.qr_iban"]})}),f(U,{leftSide:f(bt,{propertyKey:"besr_id",labelElement:f(yt,{label:n("besr_id")})}),children:f(ke,{value:((m=s==null?void 0:s.settings)==null?void 0:m.besr_id)||"",onValueChange:x=>a("settings.besr_id",x.toString()),disabled:t("besr_id"),errorMessage:o==null?void 0:o.errors["settings.besr_id"]})})]}):"",i&&f(U,{leftSide:n("size_id"),children:f(nn,{value:(s==null?void 0:s.size_id)||"1",onValueChange:x=>a("size_id",x.toString()),errorMessage:o==null?void 0:o.errors.size_id,children:r==null?void 0:r.sizes.map(x=>f("option",{value:x.id,children:x.name},x.id))})}),i&&f(U,{leftSide:n("industry_id"),children:f(nn,{value:(s==null?void 0:s.industry_id)||"1",onValueChange:x=>a("industry_id",x.toString()),errorMessage:o==null?void 0:o.errors.industry_id,children:r==null?void 0:r.industries.map(x=>f("option",{value:x.id,children:x.name},x.id))})}),f(U,{leftSide:f(bt,{propertyKey:"classification",labelElement:f(yt,{label:n("classification")})}),children:N(nn,{id:"classification",value:((_=s==null?void 0:s.settings)==null?void 0:_.classification)??"",onValueChange:x=>a("settings.classification",x.toString()),disabled:t("classification"),withBlank:!0,children:[f("option",{value:"individual",children:n("individual")}),f("option",{value:"business",children:n("business")}),f("option",{value:"company",children:n("company")}),f("option",{value:"partnership",children:n("partnership")}),f("option",{value:"trust",children:n("trust")}),f("option",{value:"charity",children:n("charity")}),f("option",{value:"government",children:n("government")}),f("option",{value:"other",children:n("other")})]})}),((v=s==null?void 0:s.custom_fields)==null?void 0:v.company1)&&f(Do,{field:"company1",defaultValue:s.settings.custom_value1||"",value:s.custom_fields.company1,onValueChange:x=>a("settings.custom_value1",x.toString())}),((b=s==null?void 0:s.custom_fields)==null?void 0:b.company2)&&f(Do,{field:"company2",defaultValue:s.settings.custom_value2||"",value:s.custom_fields.company2,onValueChange:x=>a("settings.custom_value2",x.toString())}),((y=s==null?void 0:s.custom_fields)==null?void 0:y.company3)&&f(Do,{field:"company3",defaultValue:s.settings.custom_value3||"",value:s.custom_fields.company3,onValueChange:x=>a("settings.custom_value3",x.toString())}),((C=s==null?void 0:s.custom_fields)==null?void 0:C.company4)&&f(Do,{field:"company4",defaultValue:s.settings.custom_value4||"",value:s.custom_fields.company4,onValueChange:x=>a("settings.custom_value4",x.toString())})]})})}function cIe({isSettingsPage:n=!0}){const[e]=ue(),t=Ti(),i=vi(),r=Ci(),{isGroupSettingsActive:o,isCompanySettingsActive:s,isClientSettingsActive:a}=Ms(),l=ki(kk),c=lU({withoutNavigation:!0}),u=Ype({withoutNavigation:!0}),d=Xp({enableReinitialize:!0,initialValues:t,onSubmit:()=>{ie.processing();let g="/api/v1/companies/:id",p=i.id;l&&(o&&(g="/api/v1/group_settings/:id",p=l.id),a&&(g="/api/v1/clients/:id",p=l.id)),Te("PUT",ye(g,{id:p}),d.values).then(m=>{s&&r(Pw({object:"company",data:m.data.data})),o&&(hn(["group_settings"]),c(m.data.data)),a&&(hn(["clients"]),u(m.data.data)),ie.success("removed_logo")})}}),h=()=>{d.setFieldValue("settings.company_logo",""),d.submitForm()};return n?f(U,{children:f(Ut,{behavior:"button",type:"minimal",onClick:()=>h(),children:e("remove_logo")})}):f(Ut,{behavior:"button",type:"minimal",onClick:()=>h(),children:e("remove_logo")})}function JWe({isSettingsPage:n=!0}){const[e]=ue(),t=vi(),i=Ci(),[r,o]=w.useState(new FormData),s=Qz(),{isGroupSettingsActive:a,isCompanySettingsActive:l,isClientSettingsActive:c}=Ms(),u=ki(kk),d=lU({withoutNavigation:!0}),h=Ype({withoutNavigation:!0}),g=Xp({enableReinitialize:!0,initialValues:r,onSubmit:()=>{ie.processing();let b="/api/v1/companies/:id",y=t.id;u&&(a&&(b="/api/v1/group_settings/:id",y=u.id),c&&(b="/api/v1/clients/:id",y=u.id)),Te("POST",ye(b,{id:y}),r,{headers:{"Content-Type":"multipart/form-data"}}).then(C=>{l&&i(Pw({object:"company",data:C.data.data})),a&&(hn(["group_settings"]),d(C.data.data)),c&&(hn(["clients"]),h(C.data.data)),ie.success("uploaded_logo")}).finally(()=>o(new FormData))}}),p=w.useCallback(b=>{r.append("company_logo",b[0]),r.append("_method","PUT"),o(r),g.submitForm()},[r]),{getRootProps:m,getInputProps:_,isDragActive:v}=hA({onDrop:p,multiple:!1,maxFiles:1,accept:{"image/*":[".jpeg",".png"]}});return n?N(Ot,{title:e("logo"),children:[f(U,{leftSide:e("logo"),children:N("div",{className:"grid grid-cols-12 lg:gap-4 space-y-4 lg:space-y-0",children:[f("div",{className:"bg-gray-200 col-span-12 lg:col-span-5 rounded-lg p-6",children:f("img",{src:s,alt:e("company_logo")??"Company logo"})}),f("div",{className:"col-span-12 lg:col-span-5 bg-gray-900 rounded-lg p-6",children:f("img",{src:s,alt:e("company_logo")??"Company logo"})})]})}),f(U,{leftSide:e("upload_logo"),children:f("div",{...m(),className:"flex flex-col md:flex-row md:items-center",children:N("div",{className:"relative block w-full border-2 border-gray-300 border-dashed rounded-lg p-12 text-center hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:[f("input",{..._()}),f(px,{className:"mx-auto h-12 w-12 text-gray-400"}),f("span",{className:"mt-2 block text-sm font-medium",children:v?"drop_your_logo_here":e("dropzone_default_message")})]})})}),f(cIe,{})]}):N("div",{className:"flex flex-col space-y-5",children:[f("span",{className:"text-lg font-medium",children:e("upload_logo")}),N("div",{className:"grid grid-cols-12 gap-x-4",children:[f("div",{className:"bg-gray-200 col-span-6 rounded-lg p-6",children:f("img",{src:s,alt:e("company_logo")??"Company logo"})}),f("div",{className:"col-span-6 bg-gray-900 rounded-lg p-6",children:f("img",{src:s,alt:e("company_logo")??"Company logo"})})]}),N("div",{className:"flex flex-col space-y-3",children:[f("div",{...m(),className:"flex flex-col md:flex-row md:items-center",children:N("div",{className:"relative block w-full border-2 border-gray-300 border-dashed rounded-lg p-12 text-center hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:[f("input",{..._()}),f(px,{className:"mx-auto h-12 w-12 text-gray-400"}),f("span",{className:"mt-2 block text-sm font-medium",children:v?"drop_your_logo_here":e("dropzone_default_message")})]})}),f("div",{className:"self-start",children:f(cIe,{isSettingsPage:!1})})]})]})}function drn(){const[n]=ue(),e=vi(),t=em();return N(_t,{children:[f(ope,{}),f(Ot,{title:n("custom_fields"),children:f("div",{className:"px-6",children:e&&["company1","company2","company3","company4"].map(i=>f(uf,{initialValue:e.custom_fields[i]||"",field:i,placeholder:n("company_field"),onChange:r=>t(i,r)},i))})})]})}function hrn(){const[n]=ue(),e=[{id:"name",label:n("name"),format:(t,i)=>f(Ii,{to:dt("/settings/task_statuses/:id/edit",{id:i.id}),children:t})},{id:"color",label:n("color"),format:t=>f("div",{className:"w-10 h-4 border border-gray-300 rounded-sm",style:{backgroundColor:t.toString()}})}];return f(Pg,{resource:"task_status",columns:e,endpoint:"/api/v1/task_statuses?sort=id|desc",bulkRoute:"/api/v1/task_statuses/bulk",linkToCreate:"/settings/task_statuses/create",linkToEdit:"/settings/task_statuses/:id/edit",withResourcefulActions:!0})}function frn(){const{documentTitle:n}=gi("new_task_status"),[e]=ue(),t=ri(),i=ys(),r=[{name:e("settings"),href:"/settings"},{name:e("task_settings"),href:"/settings/task_settings"},{name:e("new_task_status"),href:"/settings/task_statuses/create"}],{data:o}=iWe(),[s,a]=w.useState(),[l,c]=w.useState(!1),[u,d]=w.useState(),h=jpe({setErrors:a,setTaskStatus:d}),g=(m,_)=>{m.preventDefault(),l||(ie.processing(),a(void 0),c(!0),Te("POST",ye("/api/v1/task_statuses"),u).then(v=>{ie.success("created_task_status"),hn(["task_statuses"]),_==="save"?t(dt("/settings/task_statuses/:id/edit",{id:v.data.data.id})):d(o)}).catch(v=>{var b;((b=v.response)==null?void 0:b.status)===422&&(a(v.response.data),ie.dismiss())}).finally(()=>c(!1)))};w.useEffect(()=>{o&&d(o)},[o]);const p=[{onClick:m=>g(m,"create"),text:`${e("save")} / ${e("create")}`,icon:f(Ve,{element:eg})}];return f($i,{title:e("task_statuses"),breadcrumbs:[],children:f(pA,{className:"space-y-6",breadcrumbs:r,children:f(Ot,{title:n,withSaveButton:!0,disableSubmitButton:l,onSaveClick:m=>g(m,"save"),additionalSaveOptions:p,children:N(Sb,{children:[f(ke,{required:!0,label:e("name"),value:u==null?void 0:u.name,onValueChange:m=>h("name",m),errorMessage:s==null?void 0:s.errors.name}),f($p,{children:e("color")}),f(Tk,{value:(u==null?void 0:u.color)||i,onValueChange:m=>h("color",m)})]})})})})}function grn(){var v;const[n]=ue(),{id:e}=Fa(),t=RJt(),i=[{name:n("settings"),href:"/settings"},{name:n("task_settings"),href:"/settings/task_settings"},{name:n("edit_task_status"),href:dt("/settings/task_statuses/:id/edit",{id:e})}],{data:r}=LJt({id:e}),[o,s]=w.useState(),[a,l]=w.useState(!1),{documentTitle:c,setDocumentTitle:u}=gi(""),[d,h]=w.useState(!1),[g,p]=w.useState(),m=jpe({setErrors:p,setTaskStatus:s}),_=b=>{b.preventDefault(),d||(ie.processing(),p(void 0),h(!0),Te("PUT",ye("/api/v1/task_statuses/:id",{id:e}),o).then(()=>{ie.success("updated_task_status"),hn(["task_statuses"]),l(!1)}).catch(y=>{var C;((C=y.response)==null?void 0:C.status)===422&&(p(y.response.data),ie.dismiss())}).finally(()=>h(!1)))};return w.useEffect(()=>{r&&s(r.data.data)},[r]),w.useEffect(()=>{o&&!a&&(u(o.name),l(!0))},[o]),N($i,{title:n("task_statuses"),navigationTopRight:o&&f(I0,{label:n("more_actions"),resource:o,actions:t}),breadcrumbs:[],children:[!o&&f("div",{className:"flex justify-center",children:f(Vo,{})}),o&&f(pA,{className:"space-y-6",breadcrumbs:i,children:N(Ot,{title:c,withSaveButton:!0,disableSubmitButton:d,onFormSubmit:_,children:[N(U,{leftSide:n("status"),children:[!o.is_deleted&&!o.archived_at&&f(Gi,{variant:"primary",children:n("active")}),o.archived_at&&!o.is_deleted?f(Gi,{variant:"yellow",children:n("archived")}):null,o.is_deleted&&f(Gi,{variant:"red",children:n("deleted")})]}),N(Sb,{children:[f(ke,{required:!0,label:n("name"),value:o.name,onValueChange:b=>m("name",b),errorMessage:(v=g==null?void 0:g.errors)==null?void 0:v.name}),f($p,{children:n("color")}),f(Tk,{value:o.color,onValueChange:b=>m("color",b)})]})]})})]})}function prn(){const[n]=ue(),{documentTitle:e}=gi("api_tokens"),{dateFormat:t}=Il(),i=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"},{name:n("api_tokens"),href:"/settings/integrations/api_tokens"}],r=[{id:"name",label:n("name"),format:(o,s)=>f(Ii,{to:dt("/settings/integrations/api_tokens/:id/edit",{id:s==null?void 0:s.id}),children:s==null?void 0:s.name})},{id:"created_at",label:n("created_on"),format:(o,s)=>Jr(s.created_at,t)}];return f($i,{title:e,breadcrumbs:i,children:f(Pg,{resource:"token",columns:r,endpoint:"/api/v1/tokens?sort=id|desc&is_system=false",bulkRoute:"/api/v1/tokens/bulk",linkToCreate:"/settings/integrations/api_tokens/create",linkToEdit:"/settings/integrations/api_tokens/:id/edit",withResourcefulActions:!0})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function mrn(n){const{isOwner:e,isAdmin:t}=ao();return ai(["/api/v1/tokens",n.id],()=>Te("GET",ye("/api/v1/tokens/:id",{id:n.id})).then(i=>i.data.data),{staleTime:1/0,enabled:e||t})}function _rn(){return(n,e)=>{ie.processing(),Te("POST",ye("/api/v1/tokens/bulk"),{action:e,ids:[n]}).then(()=>{ie.success(`${e}d_token`),hn(["tokens"])})}}function vrn(){const{isAdmin:n}=ao();return ai("/api/v1/tokens/create",()=>Te("GET",ye("/api/v1/tokens/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function eze(n){const{setApiToken:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(o=>o&&{...o,[i]:r})}}function brn(){const[n]=ue(),{documentTitle:e}=gi("new_token"),t=ri(),i=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"},{name:n("api_tokens"),href:"/settings/integrations/api_tokens"},{name:n("new_token"),href:"/settings/integrations/api_tokens/create"}],{data:r}=vrn(),o=Ri(_f),[s,a]=w.useState(!1),[l,c]=w.useState(!1),[u,d]=w.useState(),[h,g]=w.useState(),p=eze({setApiToken:d,setErrors:g}),m=_=>{l||(g(void 0),ie.processing(),c(!0),Te("POST",ye("/api/v1/tokens"),u,{headers:{"X-Api-Password":_}}).then(v=>{ie.success("created_token"),hn(["tokens"]),t(dt("/settings/integrations/api_tokens/:id/edit",{id:v.data.data.id}))}).catch(v=>{var b,y;((b=v.response)==null?void 0:b.status)===422&&(ie.dismiss(),g(v.response.data)),((y=v.response)==null?void 0:y.status)===412&&(ie.error("password_error_incorrect"),o(0))}).finally(()=>c(!1)))};return w.useEffect(()=>{r&&d(r)},[r]),N(_t,{children:[f(Rg,{show:s,onClose:a,onSave:m}),f($i,{title:e,breadcrumbs:i,onSaveClick:()=>a(!0),disableSaveButton:!u,children:f(Ot,{title:n("new_token"),children:f(U,{leftSide:n("name"),required:!0,children:f(ke,{required:!0,onValueChange:_=>p("name",_),errorMessage:h==null?void 0:h.errors.name})})})})]})}function yrn(){const[n]=ue(),e=_rn();return[i=>i.archived_at===0&&f(et,{onClick:()=>e(i.id,"archive"),icon:f(Ve,{element:Xl}),children:n("archive")}),i=>i.archived_at>0&&f(et,{onClick:()=>e(i.id,"restore"),icon:f(Ve,{element:Ql}),children:n("restore")}),i=>!i.is_deleted&&f(et,{onClick:()=>e(i.id,"delete"),icon:f(Ve,{element:Pa}),children:n("delete")})]}function Crn(){const[n]=ue(),{id:e}=Fa(),{data:t}=mrn({id:e}),i=ri(),{documentTitle:r}=gi("edit_token"),o=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"},{name:n("api_tokens"),href:"/settings/integrations/api_tokens"},{name:n("edit_token"),href:dt("/settings/integrations/api_tokens/:id/edit",{id:e})}],s=yrn(),{dateFormat:a}=Il(),l=Ri(_f),[c,u]=w.useState(!1),[d,h]=w.useState(!1),[g,p]=w.useState(),[m,_]=w.useState(),v=eze({setApiToken:p,setErrors:_}),b=y=>{d||(_(void 0),ie.processing(),h(!0),Te("PUT",ye("/api/v1/tokens/:id",{id:e}),g,{headers:{"X-Api-Password":y}}).then(()=>{ie.success("updated_token"),hn(["tokens"]),i(dt("/settings/integrations/api_tokens"))}).catch(C=>{var x,k;((x=C.response)==null?void 0:x.status)===422&&(ie.dismiss(),_(C.response.data)),((k=C.response)==null?void 0:k.status)===412&&(ie.error("password_error_incorrect"),l(0))}).finally(()=>h(!1)))};return w.useEffect(()=>{t&&p(t)},[t]),N(_t,{children:[f(Rg,{show:c,onClose:u,onSave:b}),f($i,{title:r,breadcrumbs:o,disableSaveButton:!g,onSaveClick:()=>u(!0),navigationTopRight:g&&f(I0,{resource:g,label:n("more_actions"),actions:s}),children:t&&g&&N(Ot,{title:t.name,children:[N(U,{leftSide:"Status",children:[!g.is_deleted&&!g.archived_at&&f(Gi,{variant:"primary",children:n("active")}),g.archived_at&&!g.is_deleted?f(Gi,{variant:"yellow",children:n("archived")}):null,g.is_deleted&&f(Gi,{variant:"red",children:n("deleted")})]}),f(U,{leftSide:n("name"),required:!0,children:f(ke,{value:g.name,onValueChange:y=>v("name",y),errorMessage:m==null?void 0:m.errors.name})}),f(U,{leftSide:n("token"),children:f(ec,{secure:!0,className:"break-all",text:g.token})}),f(U,{leftSide:n("created_on"),children:Jr(g.created_at,a)})]})})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Qpe(){const[n]=ue(),e="1",t="2",i="3",r="4",o="5",s="6",a="7",l="8",c="9",u="10",d="11",h="12",g="13",p="14",m="15",_="16",v="17",b="18",y="19",C="20",x="21",k="22",I="23",L="24",D="33",R="37",P="41",M="45",O="60",B="61",F="34",H="42",V="64",$="27",j="62",Y="28",ne="35",se="43",he="29",xe="31",_e="32",Ie="40",Re="48",Ye="49",Ze="39",tt="47",Be="36",kt="44",Vt="25",xt="26",Kt="38",cn="46",wn="30",on="50",Zt="51",pe="52",me="53",Z="54",G="55",K="63",oe="56",le="57",we="58",Me="59";return[{event:e,label:n("create_client")},{event:u,label:n("update_client")},{event:R,label:n("archive_client")},{event:M,label:n("restore_client")},{event:d,label:n("delete_client")},{event:t,label:n("create_invoice")},{event:O,label:n("sent_invoice")},{event:l,label:n("update_invoice")},{event:k,label:n("late_invoice")},{event:L,label:n("remind_invoice")},{event:D,label:n("archive_invoice")},{event:P,label:n("restore_invoice")},{event:c,label:n("delete_invoice")},{event:i,label:n("create_quote")},{event:B,label:n("sent_quote")},{event:s,label:n("update_quote")},{event:x,label:n("approve_quote")},{event:I,label:n("expired_quote")},{event:F,label:n("archive_quote")},{event:H,label:n("restore_quote")},{event:a,label:n("delete_quote")},{event:V,label:n("remind_quote")},{event:$,label:n("create_credit")},{event:j,label:n("sent_credit")},{event:Y,label:n("update_credit")},{event:ne,label:n("archive_credit")},{event:se,label:n("restore_credit")},{event:he,label:n("delete_credit")},{event:r,label:n("create_payment")},{event:xe,label:n("update_payment")},{event:_e,label:n("archive_payment")},{event:Ie,label:n("restore_payment")},{event:h,label:n("delete_payment")},{event:o,label:n("create_vendor")},{event:g,label:n("update_vendor")},{event:Re,label:n("archive_vendor")},{event:Ye,label:n("restore_vendor")},{event:p,label:n("delete_vendor")},{event:m,label:n("create_expense")},{event:_,label:n("update_expense")},{event:Ze,label:n("archive_expense")},{event:tt,label:n("restore_expense")},{event:v,label:n("delete_expense")},{event:b,label:n("create_task")},{event:y,label:n("update_task")},{event:Be,label:n("archive_task")},{event:kt,label:n("restore_task")},{event:C,label:n("delete_task")},{event:Vt,label:n("create_project")},{event:xt,label:n("update_project")},{event:Kt,label:n("archive_project")},{event:cn,label:n("restore_project")},{event:wn,label:n("delete_project")},{event:on,label:n("create_product")},{event:Zt,label:n("update_product")},{event:pe,label:n("delete_product")},{event:me,label:n("restore_product")},{event:Z,label:n("archive_product")},{event:G,label:n("create_purchase_order")},{event:K,label:n("sent_purchase_order")},{event:oe,label:n("update_purchase_order")},{event:le,label:n("delete_purchase_order")},{event:we,label:n("restore_purchase_order")},{event:Me,label:n("archive_purchase_order")}]}function wrn(){const[n]=ue(),e=Qpe();return[{id:"endpoint",label:n("endpoint"),format:(i,r)=>f(Ii,{to:dt("/settings/integrations/api_webhooks/:id/edit",{id:r.id}),children:r.target_url})},{id:"method",label:n("method"),format:(i,r)=>r.rest_method.toUpperCase()},{id:"event_id",label:n("event_type"),format:(i,r)=>{var o;return((o=e.find(({event:s})=>s===r.event_id))==null?void 0:o.label)||""}}]}function Srn(){gi("api_webhooks");const[n]=ue(),e=wrn(),t=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"},{name:n("api_webhooks"),href:"/settings/integrations/api_webhooks"}];return f($i,{title:n("api_webhooks"),breadcrumbs:t,children:f(Pg,{resource:"webhook",columns:e,endpoint:"/api/v1/webhooks?sort=id|desc",bulkRoute:"/api/v1/webhooks/bulk",linkToCreate:"/settings/integrations/api_webhooks/create",linkToEdit:"/settings/integrations/api_webhooks/:id/edit",withResourcefulActions:!0})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Ern(n){const{isAdmin:e}=ao();return ai(["/api/v1/webhooks",n.id],()=>Te("GET",ye("/api/v1/webhooks/:id",{id:n.id})).then(t=>t.data.data),{staleTime:1/0,enabled:e})}function xrn(){const{isAdmin:n}=ao();return ai("/api/v1/webhooks/create",()=>Te("GET",ye("/api/v1/webhooks/create")).then(e=>e.data.data),{staleTime:1/0,enabled:n})}function krn(){return(n,e)=>{ie.processing(),Te("POST",ye("/api/v1/webhooks/bulk"),{action:e,ids:[n]}).then(()=>{ie.success(`${e}d_webhook`),hn(["webhooks"])})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function tze(n){const{setApiWebHook:e,setErrors:t}=n;return(i,r)=>{t(void 0),e(o=>o&&{...o,[i]:r})}}function Trn(){const[n]=ue(),{documentTitle:e}=gi("new_webhook"),{data:t}=xrn(),i=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"},{name:n("api_webhooks"),href:"/settings/integrations/api_webhooks"},{name:n("new_webhook"),href:"/settings/integrations/api_webhooks/create"}],r=Qpe(),[o,s]=w.useState({}),[a,l]=w.useState({}),[c,u]=w.useState(),[d,h]=w.useState(),[g,p]=w.useState(!1),m=tze({setApiWebHook:h,setErrors:u}),_=y=>{if(Object.hasOwn(o,y)){const C={...o};delete C[y],s(C)}},v=ri(),b=()=>{d&&!g&&(ie.processing(),p(!0),u(void 0),d.headers=o,Te("POST",ye("/api/v1/webhooks"),d).then(y=>{ie.success("created_webhook"),hn(["webhooks"]),v(dt("/settings/integrations/api_webhooks/:id/edit",{id:y.data.data.id}))}).catch(y=>{var C;((C=y.response)==null?void 0:C.status)===422&&(ie.dismiss(),u(y.response.data))}).finally(()=>p(!1)))};return w.useEffect(()=>{t&&h({...t,headers:{}})},[t]),f($i,{title:n("api_webhooks"),breadcrumbs:i,disableSaveButton:!d,onSaveClick:b,children:N(Ot,{title:e,children:[f(U,{leftSide:n("target_url"),required:!0,children:f(ke,{required:!0,value:d==null?void 0:d.target_url,onValueChange:y=>m("target_url",y),errorMessage:c==null?void 0:c.errors.target_url})}),f(U,{leftSide:n("event_type"),children:f(nn,{value:d==null?void 0:d.event_id,onValueChange:y=>m("event_id",y),errorMessage:c==null?void 0:c.errors.event_id,children:r.map(y=>f("option",{value:y.event,children:y.label},y.event))})}),f(U,{leftSide:n("method"),children:N(nn,{value:d==null?void 0:d.rest_method,onValueChange:y=>m("rest_method",y),errorMessage:c==null?void 0:c.errors.method,children:[f("option",{value:"post",children:"POST"}),f("option",{value:"put",children:"PUT"})]})}),f(U,{leftSide:n("add_header"),children:N("div",{className:"flex flex-col",children:[N("div",{className:"flex flex-1 justify-between items-center space-x-6",children:[f("div",{className:"flex-1",children:f(ke,{debounceTimeout:0,id:"header_key",placeholder:n("header_key"),value:a.key||"",onValueChange:y=>l({...a,key:y})})}),f("div",{className:"flex-1",children:f(ke,{className:"flex-1",debounceTimeout:0,id:"header_value",value:a.value||"",placeholder:n("header_value"),onValueChange:y=>l({...a,value:y})})}),f(Ut,{behavior:"button",type:"minimal",disableWithoutIcon:!0,disabled:!a.key||!a.value,onClick:()=>{s(y=>({...y,[a.key]:a.value})),l({})},children:f(dd,{})})]}),N("div",{className:"flex flex-col space-y-5 pt-5",children:[Object.entries(o).map(([y,C],x)=>N("div",{className:"flex justify-between items-center space-x-4",children:[f("span",{className:"flex-1 text-start",children:y}),f("span",{className:"flex-1 text-start",children:C}),f(Ut,{behavior:"button",type:"minimal",onClick:()=>_(y),children:f(L_,{size:18})})]},x)),!Object.entries(o).length&&f("span",{className:"text-gray-500 self-center text-xl",children:n("no_headers")})]})]})})]})})}function Irn(){const[n]=ue(),e=krn();return[i=>i.archived_at===0&&f(et,{onClick:()=>e(i.id,"archive"),icon:f(Ve,{element:Xl}),children:n("archive")}),i=>i.archived_at>0&&f(et,{onClick:()=>e(i.id,"restore"),icon:f(Ve,{element:Ql}),children:n("restore")}),i=>!i.is_deleted&&f(et,{onClick:()=>e(i.id,"delete"),icon:f(Ve,{element:Pa}),children:n("delete")})]}function Lrn(){const[n]=ue(),{id:e}=Fa();gi("edit_webhook");const t=ri(),i=Irn(),r=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"},{name:n("api_webhooks"),href:"/settings/integrations/api_webhooks"},{name:n("edit_webhook"),href:dt("/settings/integrations/api_webhooks/:id/edit",{id:e})}],o=Qpe(),[s,a]=w.useState({}),[l,c]=w.useState({}),[u,d]=w.useState(),[h,g]=w.useState(!1),[p,m]=w.useState(),_=tze({setApiWebHook:m,setErrors:d}),{data:v}=Ern({id:e}),b=C=>{if(Object.hasOwn(s,C)){const x={...s};delete x[C],a(x)}},y=()=>{p&&!h&&(ie.processing(),g(!0),d(void 0),p.headers=s,Te("PUT",ye("/api/v1/webhooks/:id",{id:e}),p).then(()=>{ie.success("created_webhook"),hn(["webhooks"]),t("/settings/integrations/api_webhooks")}).catch(C=>{var x;((x=C.response)==null?void 0:x.status)===422&&(ie.dismiss(),d(C.response.data))}).finally(()=>g(!1)))};return w.useEffect(()=>{v&&(m(v),a(v.headers))},[v]),f($i,{title:n("api_webhooks"),breadcrumbs:r,disableSaveButton:!p,onSaveClick:y,navigationTopRight:p&&f(I0,{label:n("more_actions"),resource:p,actions:i}),children:N(Ot,{title:v==null?void 0:v.target_url,children:[f(U,{leftSide:n("target_url"),required:!0,children:f(ke,{required:!0,value:p==null?void 0:p.target_url,onValueChange:C=>_("target_url",C),errorMessage:u==null?void 0:u.errors.target_url})}),f(U,{leftSide:n("event_type"),children:f(nn,{value:p==null?void 0:p.event_id,onValueChange:C=>_("event_id",C),errorMessage:u==null?void 0:u.errors.event_id,children:o.map(C=>f("option",{value:C.event,children:C.label},C.event))})}),f(U,{leftSide:n("method"),children:N(nn,{value:p==null?void 0:p.rest_method,onValueChange:C=>_("rest_method",C),errorMessage:u==null?void 0:u.errors.rest_method,children:[f("option",{value:"post",children:"POST"}),f("option",{value:"put",children:"PUT"})]})}),f(U,{leftSide:n("add_header"),children:N("div",{className:"flex flex-col",children:[N("div",{className:"flex flex-1 justify-between items-center space-x-6",children:[f("div",{className:"flex-1",children:f(ke,{debounceTimeout:0,id:"header_key",placeholder:n("header_key"),value:l.key||"",onValueChange:C=>c({...l,key:C})})}),f("div",{className:"flex-1",children:f(ke,{debounceTimeout:0,id:"header_value",value:l.value||"",placeholder:n("header_value"),onValueChange:C=>c({...l,value:C})})}),f(Ut,{behavior:"button",type:"minimal",disableWithoutIcon:!0,disabled:!l.key||!l.value,onClick:()=>{a(C=>({...C,[l.key]:l.value})),c({})},children:f(dd,{})})]}),N("div",{className:"flex flex-col space-y-5 pt-5",children:[Object.entries(s).map(([C,x],k)=>N("div",{className:"flex justify-between items-center space-x-4",children:[f("span",{className:"flex-1 text-start",children:C}),f("span",{className:"flex-1 text-start",children:x}),f(Ut,{behavior:"button",type:"minimal",onClick:()=>b(C),children:f(L_,{size:18})})]},k)),!Object.entries(s).length&&f("span",{className:"text-gray-500 self-center text-xl",children:n("no_headers")})]})]})})]})})}function Drn(){const[n]=ue(),e=[{name:n("settings"),href:"/settings"},{name:n("account_management"),href:"/settings/account_management"},{name:n("analytics"),href:"/settings/integrations/analytics"}];gi("analytics");const t=Ci(),i=vi(),r=Ti(),[o,s]=w.useState(),[a,l]=w.useState(!1);w.useEffect(()=>{t(gx({object:"company",data:i}))},[i]);const c=d=>{s(void 0),t(Vr({object:"company",property:d.target.id,value:d.target.value}))},u=()=>{a||(ie.processing(),l(!0),s(void 0),Te("PUT",ye("/api/v1/companies/:id",{id:r.id}),r).then(d=>{t(Pw({object:"company",data:d.data.data})),ie.success("updated_settings")}).catch(d=>{var h;((h=d.response)==null?void 0:h.status)===422&&(s(d.response.data),ie.dismiss())}).finally(()=>l(!1)))};return f($i,{title:n("analytics"),breadcrumbs:e,onSaveClick:u,disableSaveButton:a,children:N(Ot,{title:n("analytics"),children:[f(U,{leftSide:N("div",{className:"flex flex-col items-start",children:[n("google_analytics_tracking_id"),f(Ii,{to:"https://support.google.com/analytics/answer/1037249?hl=en",external:!0,children:n("learn_more")})]}),children:f(ke,{id:"google_analytics_key",value:r==null?void 0:r.google_analytics_key,onChange:c,errorMessage:o==null?void 0:o.errors.google_analytics_key})}),f(U,{leftSide:n("matomo_id"),children:f(ke,{id:"matomo_id",value:r==null?void 0:r.matomo_id,onChange:c,errorMessage:o==null?void 0:o.errors.matomo_id})}),f(U,{leftSide:n("matomo_url"),children:f(ke,{id:"matomo_url",value:r==null?void 0:r.matomo_url,onChange:c,errorMessage:o==null?void 0:o.errors.matomo_url})})]})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function nze(){const[n,e]=w.useState([]),{data:t}=Nd();return w.useEffect(()=>{t!=null&&t.gateways&&e(()=>t.gateways.filter(i=>i.visible).sort((i,r)=>i.sort_order>r.sort_order?1:-1))},[t]),n}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function ize(n){return n.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/(^\w|\s\w)/g,e=>e.toUpperCase())}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Arn(n){return(e,t)=>{n(i=>i&&{...i,config:JSON.stringify({...JSON.parse(i.config),[e]:t})})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function rze(n){const e=JSON.parse(n.config);return t=>e[t]||""}function oze(n,e){const t=rze(n),i=Arn(e),r=ys();return(o,s,a)=>{if(o.toLowerCase().endsWith("color"))return f(Tk,{value:t(o)||r,onValueChange:l=>i(o,l)});if(o==="text")return f(vd,{value:t(o),onChange:l=>i(o,l)});if(o==="appleDomainVerification")return f(ke,{element:"textarea",onChange:l=>i(o,l.target.value),value:t(o),errorMessage:a==null?void 0:a.errors.appleDomainVerification});if(typeof s=="string"){const l=o.toLowerCase().includes("key")||o.toLowerCase().includes("password")||o.toLowerCase().includes("secret")||o.toLowerCase().includes("id");return f(ke,{type:l?"password":"text",onChange:c=>i(o,c.target.value),value:t(o),errorMessage:a==null?void 0:a.errors[o]})}if(typeof s=="boolean")return f(gt,{checked:t(o),onChange:l=>i(o,l)});if(typeof s=="object")return f(nn,{onChange:l=>i(o,l.target.value),value:t(o),errorMessage:a==null?void 0:a.errors[o],children:s.map((l,c)=>f("option",{value:l,children:l},c))})}}function Rrn(){const[n]=ue();return f(U,{children:f(Ut,{onClick:()=>{Te("POST",ye("/api/v1/one_time_token"),{context:"stripe_connect"}).then(t=>{var i;return(i=window.open(dt("https://invoicing.co/stripe/signup/:token",{token:t.data.hash}),"_blank"))==null?void 0:i.focus()})},type:"minimal",behavior:"button",children:n("gateway_setup")})})}function Nrn(){const[n]=ue();return f(U,{children:f(Ut,{onClick:()=>{Te("POST",ye("/api/v1/one_time_token"),{context:"wepay"}).then(t=>{var i;return(i=window.open(dt("https://invoicing.co/wepay/signup/:token",{token:t.data.hash}),"_blank"))==null?void 0:i.focus()})},type:"minimal",behavior:"button",children:n("gateway_setup")})})}function Orn(n){const[e]=ue(),t=()=>{Te("POST",ye("/api/v1/one_time_token"),{context:"paypal_ppcp"}).then(a=>{var l;return(l=window.open(dt("https://invoicing.co/paypal?hash=:hash",{hash:a.data.hash}),"_blank"))==null?void 0:l.focus()})},i=rze(n.companyGateway),r=oze(n.companyGateway,n.setCompanyGateway),o=()=>{const a=i("status"),l=i("merchantId");return a==="activated"&&l},s=()=>i("merchantId").length>0;return N(_t,{children:[f(U,{leftSide:e("status"),children:N("ul",{className:"list-none",children:[N("li",{children:[f("b",{children:"Merchant id:"})," ",i("merchantId")]}),N("li",{children:[N("b",{children:[e("status"),":"]})," ",i("status")]}),N("li",{children:[N("b",{children:[e("email"),":"]})," ",i("emailVerified")]}),N("li",{children:[N("b",{children:[e("permissions"),":"]})," ",i("permissions")]}),N("li",{children:[N("b",{children:[e("notifications"),":"]})," ",i("returnMessage")]})]})}),n.companyGateway&&!o()&&f(U,{children:f(Ut,{onClick:t,type:"minimal",behavior:"button",children:e("gateway_setup")})}),n.gateway&&s()&&Object.keys(JSON.parse(n.gateway.fields)).map((a,l)=>f(U,{leftSide:ize(a),children:r(a,JSON.parse(n.gateway.fields)[a],n.errors)},l))]})}function sze(n){const[e]=ue(),t=oze(n.companyGateway,n.setCompanyGateway),i="d14dd26a47cecc30fdd65700bfb67b34",r="8fdeed552015b3c7b44ed6c8ebd9e992",o="80af24a6a691230bbec33e930ab40666",s=[i,r,o],[a,l]=w.useState(!1),[c,u]=w.useState(),d=()=>{a||(ie.processing(),l(!0),Te("POST",ye("/api/v1/company_gateways/:id/test",{id:n.companyGateway.id})).then(()=>u(!0)).catch(()=>u(!1)).finally(()=>{ie.dismiss(),l(!1)}))};return N(_t,{children:[N(Ot,{title:e("credentials"),children:[n.gateway.site_url&&n.gateway.site_url.length>=1&&f(U,{leftSide:e("help"),children:f(Ii,{external:!0,to:n.gateway.site_url,children:e("learn_more")})}),n.gateway&&n.gateway.key===i&&f(Rrn,{}),n.gateway&&n.gateway.key===r&&f(Nrn,{}),n.gateway&&n.gateway.key===o&&f(Orn,{gateway:n.gateway,companyGateway:n.companyGateway,setCompanyGateway:n.setCompanyGateway,errors:n.errors}),n.gateway&&!s.includes(n.gateway.key)&&Object.keys(JSON.parse(n.gateway.fields)).map((h,g)=>f(U,{leftSide:ize(h),children:t(h,JSON.parse(n.gateway.fields)[h],n.errors)},g)),f(Jn,{}),f("div",{className:"flex justify-end pr-6",children:f(Ut,{behavior:"button",onClick:d,disableWithoutIcon:!0,disabled:a,children:e("health_check")})})]}),f(cr,{title:e("status"),visible:typeof c<"u",onClose:()=>u(void 0),children:typeof c<"u"&&f("span",{className:"text-center font-medium text-base pb-3",children:e(c?"success":"status_failed")})})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Prn(n){return(e,t,i)=>{n&&n(r=>r&&{...r,fees_and_limits:{...r.fees_and_limits,[e]:{...r.fees_and_limits[e],[t]:i}}})}}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/var fs=(n=>(n.CreditCard="1",n.BankTransfer="2",n.PayPal="3",n.Crypto="4",n.Custom="5",n.Alipay="6",n.Sofort="7",n.ApplePay="8",n.SEPA="9",n.Credit="10",n.KBC="11",n.Bancontact="12",n.IDeal="13",n.Hosted="14",n.Giropay="15",n.Przelewy24="16",n.EPS="17",n.DirectDebit="18",n.ACSS="19",n.BECS="20",n.InstantBankPay="21",n.FPX="22",n.KLARNA="23",n.BACS="24",n.VENMO="25",n.MERCADOPAGO="26",n.MYBANK="27",n.PAYLATER="28",n.PAYPAL_ADVANCED_CARDS="29",n))(fs||{});/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const Mrn={[fs.CreditCard]:"credit_card",[fs.BankTransfer]:"bank_transfer",[fs.PayPal]:"paypal",[fs.Crypto]:"crypto",[fs.Custom]:"custom",[fs.Alipay]:"alipay",[fs.Sofort]:"sofort",[fs.ApplePay]:"apple_pay",[fs.SEPA]:"sepa",[fs.Credit]:"credit",[fs.KBC]:"kbc",[fs.Bancontact]:"bancontact",[fs.IDeal]:"ideal",[fs.Hosted]:"hosted",[fs.Giropay]:"giropay",[fs.Przelewy24]:"przelewy24",[fs.DirectDebit]:"direct_debit",[fs.EPS]:"eps",[fs.ACSS]:"acss",[fs.BECS]:"becs",[fs.InstantBankPay]:"instant_bank_pay",[fs.KLARNA]:"klarna",[fs.BACS]:"bacs",[fs.FPX]:"fpx",[fs.VENMO]:"venmo",[fs.MERCADOPAGO]:"mercadopago",[fs.MYBANK]:"mybank",[fs.PAYLATER]:"paylater",[fs.PAYPAL_ADVANCED_CARDS]:"paypal_advanced_cards"};/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function aze(){const[n]=ue();return e=>n(Mrn[e]||"other")}const Frn=po(void 0);function lze(n){var c,u,d,h,g,p,m,_,v,b,y,C,x,k,I,L,D,R,P,M,O,B;const[e]=ue(),t=vi(),[i,r]=Mo(Frn),o=aze(),s=Prn(n.setCompanyGateway);w.useEffect(()=>{const F=Object.entries(n.companyGateway.fees_and_limits).filter(([,H])=>H.is_enabled);typeof i<"u"&&F.length>0||(F.length>0?r(F[0][0]):r(void 0))},[n.companyGateway]);const a=F=>{r(F.target.value)},l=(F,H)=>{i&&s(i,F,H)};return N(Ot,{title:e("limits_and_fees"),children:[f(U,{leftSide:e("payment_type"),children:f(nn,{onChange:a,errorMessage:(c=n.errors)==null?void 0:c.errors.gatewayTypeId,children:Object.entries(n.companyGateway.fees_and_limits).filter(([,F])=>F.is_enabled).map(([F],H)=>f("option",{value:F,children:o(F)},H))})}),i&&N(_t,{children:[f(Jn,{}),f(U,{leftSide:`${e("min")} ${e("limit")}`,children:N("div",{className:"space-y-4",children:[f(ke,{type:"number",value:(u=n.companyGateway.fees_and_limits)==null?void 0:u[i].min_limit,onValueChange:F=>l("min_limit",parseFloat(F)||-1),disabled:((d=n.companyGateway.fees_and_limits)==null?void 0:d[i].min_limit)===-1,errorMessage:(h=n.errors)==null?void 0:h.errors.min_limit}),f(gt,{checked:((g=n.companyGateway.fees_and_limits)==null?void 0:g[i].min_limit)>=0,label:e("enable_min"),onValueChange:F=>l("min_limit",F?0:-1)})]})}),f(U,{leftSide:`${e("max")} ${e("limit")}`,children:N("div",{className:"space-y-4",children:[f(ke,{type:"number",value:(p=n.companyGateway.fees_and_limits)==null?void 0:p[i].max_limit,onValueChange:F=>l("max_limit",parseFloat(F)||-1),disabled:((m=n.companyGateway.fees_and_limits)==null?void 0:m[i].max_limit)===-1,errorMessage:(_=n.errors)==null?void 0:_.errors.max_limit}),f(gt,{checked:((v=n.companyGateway.fees_and_limits)==null?void 0:v[i].max_limit)>=0,label:e("enable_max"),onValueChange:F=>l("max_limit",F?0:-1)})]})}),f(Jn,{}),f(U,{leftSide:e("fee_percent"),children:f(ke,{type:"number",value:(b=n.companyGateway.fees_and_limits)==null?void 0:b[i].fee_percent,onValueChange:F=>l("fee_percent",parseFloat(F)),errorMessage:(y=n.errors)==null?void 0:y.errors.fee_percent})}),f(U,{leftSide:e("fee_amount"),children:f(ke,{type:"number",value:(C=n.companyGateway.fees_and_limits)==null?void 0:C[i].fee_amount,onValueChange:F=>l("fee_amount",parseFloat(F)),errorMessage:(x=n.errors)==null?void 0:x.errors.fee_amount})}),t&&t.enabled_item_tax_rates>0&&f(U,{leftSide:e("tax"),children:f(SC,{defaultValue:((I=(k=n.companyGateway)==null?void 0:k.fees_and_limits[i])==null?void 0:I.fee_tax_name1)||"",onChange:F=>{var H,V;l("fee_tax_name1",((H=F.resource)==null?void 0:H.name)||""),l("fee_tax_rate1",((V=F.resource)==null?void 0:V.rate)||0)},onClearButtonClick:()=>{l("fee_tax_name1",""),l("fee_tax_rate1",0)},onTaxCreated:F=>{l("fee_tax_name1",F.name),l("fee_tax_rate1",F.rate)}})}),t&&t.enabled_item_tax_rates>1&&f(U,{leftSide:e("tax"),children:f(SC,{defaultValue:((D=(L=n.companyGateway)==null?void 0:L.fees_and_limits[i])==null?void 0:D.fee_tax_name2)||"",onChange:F=>{var H,V;l("fee_tax_name2",((H=F.resource)==null?void 0:H.name)||""),l("fee_tax_rate2",((V=F.resource)==null?void 0:V.rate)||0)},onClearButtonClick:()=>{l("fee_tax_name2",""),l("fee_tax_rate2",0)},onTaxCreated:F=>{l("fee_tax_name2",F.name),l("fee_tax_rate2",F.rate)}})}),t&&t.enabled_item_tax_rates>2&&f(U,{leftSide:e("tax"),children:f(SC,{defaultValue:((P=(R=n.companyGateway)==null?void 0:R.fees_and_limits[i])==null?void 0:P.fee_tax_name3)||"",onChange:F=>{var H,V;l("fee_tax_name3",((H=F.resource)==null?void 0:H.name)||""),l("fee_tax_rate3",((V=F.resource)==null?void 0:V.rate)||0)},onClearButtonClick:()=>{l("fee_tax_name3",""),l("fee_tax_rate3",0)},onTaxCreated:F=>{l("fee_tax_name3",F.name),l("fee_tax_rate3",F.rate)}})}),f(U,{leftSide:e("fee_cap"),children:f(ke,{type:"number",value:(M=n.companyGateway.fees_and_limits)==null?void 0:M[i].fee_cap,onValueChange:F=>l("fee_cap",parseFloat(F)),errorMessage:(O=n.errors)==null?void 0:O.errors.fee_cap})}),f(U,{leftSide:e("adjust_fee_percent"),children:f(gt,{checked:(B=n.companyGateway.fees_and_limits)==null?void 0:B[i].adjust_fee_percent,label:e("adjust_fee_percent_help"),onValueChange:F=>l("adjust_fee_percent",F)})})]})]})}function cze(n){const[e]=ue(),t=(i,r)=>{n.setCompanyGateway(o=>o&&{...o,[i]:r})};return N(Ot,{title:e("required_fields"),children:[f(U,{leftSide:e("client_name"),children:f(gt,{checked:n.companyGateway.require_client_name,onChange:i=>t("require_client_name",i)})}),f(U,{leftSide:e("client_phone"),children:f(gt,{checked:n.companyGateway.require_client_phone,onChange:i=>t("require_client_phone",i)})}),f(U,{leftSide:e("contact_name"),children:f(gt,{checked:n.companyGateway.require_contact_name,onChange:i=>t("require_contact_name",i)})}),f(U,{leftSide:e("contact_email"),children:f(gt,{checked:n.companyGateway.require_contact_email,onChange:i=>t("require_contact_email",i)})}),f(U,{leftSide:e("postal_code"),children:f(gt,{checked:n.companyGateway.require_postal_code,onChange:i=>t("require_postal_code",i)})}),f(U,{leftSide:e("cvv"),children:f(gt,{checked:n.companyGateway.require_cvv,onChange:i=>t("require_cvv",i)})}),f(U,{leftSide:e("billing_address"),children:f(gt,{checked:n.companyGateway.require_billing_address,onChange:i=>t("require_billing_address",i)})}),f(U,{leftSide:e("shipping_address"),children:f(gt,{checked:n.companyGateway.require_shipping_address,onChange:i=>t("require_shipping_address",i)})}),f(Jn,{}),f(U,{leftSide:e("update_address"),children:f(gt,{label:e("update_address_help"),checked:n.companyGateway.update_details,onChange:i=>t("update_details",i)})}),f(U,{leftSide:e("always_show_required_fields"),children:f(gt,{label:e("always_show_required_fields_help"),checked:n.companyGateway.always_show_required_fields??!0,onChange:i=>t("always_show_required_fields",i)})})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/const uze={adjust_fee_percent:!1,fee_amount:0,fee_cap:0,fee_percent:0,fee_tax_name1:"",fee_tax_name2:"",fee_tax_name3:"",fee_tax_rate1:0,fee_tax_rate2:0,fee_tax_rate3:0,is_enabled:!0,max_limit:-1,min_limit:-1};function Brn(n,e){return(t,i)=>{if(Object.hasOwn(n.fees_and_limits,t))return e(r=>r&&{...r,fees_and_limits:{...r.fees_and_limits,[t]:{...r.fees_and_limits[t],is_enabled:i}}});e(r=>r&&{...r,fees_and_limits:{...r.fees_and_limits,[t]:uze}})}}function dze(n){var u,d;const[e]=ue(),[t,i]=w.useState(n.gateway),[r,o]=w.useState([]);w.useEffect(()=>i(n.gateway),[n.gateway]),w.useEffect(()=>{const h=[];for(const g in t.options)h.push({gatewayTypeId:g,...t.options[g]});o([...h])},[t]);const s=aze(),a=(h,g)=>{n.setCompanyGateway(p=>p&&{...p,[h]:g})},l=Brn(n.companyGateway,n.setCompanyGateway),c=h=>{const g=Object.entries(n.companyGateway.fees_and_limits).find(([m])=>h===m);if(!g)return!1;const[,p]=g;return p.is_enabled};return N(Ot,{title:e("settings"),children:[f(U,{leftSide:e("label"),children:f(ke,{value:n.companyGateway.label||t.name,onValueChange:h=>a("label",h),errorMessage:(u=n.errors)==null?void 0:u.errors.label})}),r.some(h=>h.token_billing==!0)&&f(U,{leftSide:e("capture_card"),children:N(nn,{value:n.companyGateway.token_billing||"off",onValueChange:h=>a("token_billing",h),errorMessage:(d=n.errors)==null?void 0:d.errors.token_billing,children:[f("option",{value:"always",children:e("enabled")}),f("option",{value:"optout",children:e("auto_bill_help_optout")}),f("option",{value:"optin",children:e("auto_bill_help_optin")}),f("option",{value:"off",children:e("off")})]})}),f(Jn,{}),r.map((h,g)=>f(U,{leftSide:s(h.gatewayTypeId),children:f(gt,{checked:c(h.gatewayTypeId),onChange:p=>l(h.gatewayTypeId,p)})},g))]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function $rn(n,e){const t=ri(),i=Kr(),r=ki(Hc);return o=>{ie.processing(),e(void 0),Te("POST",ye("/api/v1/company_gateways"),n).then(s=>{r&&i.invalidateQueries([r]),hn(["company_gateways"]),ie.success("created_company_gateway"),t(dt("/settings/gateways/:id/edit?tab=:defaultTabIndex",{id:s.data.data.id,defaultTabIndex:o}))}).catch(s=>{var a;((a=s==null?void 0:s.response)==null?void 0:a.status)===422&&(ie.dismiss(),e(s.response.data))})}}const Vrn="/gateway-card-images/visa.png",Hrn="/gateway-card-images/authorize-net.png",Wrn="/gateway-card-images/american-express.png",zrn="/gateway-card-images/mastercard.png",OX="/gateway-card-images/paypal.png",jrn="/gateway-card-images/braintree.svg.png",Urn="/gateway-card-images/checkout.jpg",qrn="/gateway-card-images/gocardless.png",Krn="/gateway-card-images/mollie.png",Grn="/gateway-card-images/payfast.png",Yrn="/gateway-card-images/paytrace.svg",Qrn="/gateway-card-images/razorpay.png",Xrn="/gateway-card-images/square.svg.png",Zrn="/gateway-card-images/stripe.svg",Jrn="/gateway-card-images/eway.png",eon="/gateway-card-images/forte.png",ton="/gateway-card-images/wepay.svg",non="/gateway-card-images/btcpay.png",ion=["paypal_ppcp","visa","american_express","mastercard","paypal_platform","authorize","braintree","checkoutcom","gocardless","mollie","payfast","paytrace","razorpay","square","stripe","wepay","eway","forte","paypal_rest","btcpay"];function Ere(n){switch(n.name){case"visa":return f("img",{src:Vrn,alt:"Visa",style:n.style||{width:30,height:30}});case"american_express":return f("img",{src:Wrn,alt:"American Express",style:n.style||{width:30,height:30}});case"mastercard":return f("img",{src:zrn,alt:"Mastercard",style:n.style||{width:30,height:30}});case"paypal_platform":return f("img",{src:OX,alt:"PayPal",style:n.style||{width:40,height:40}});case"paypal_rest":return f("img",{src:OX,alt:"PayPal Rest",style:n.style||{width:40,height:40}});case"paypal_ppcp":return f("img",{src:OX,alt:"PayPal",style:n.style||{width:40,height:40}});case"authorize":return f("img",{src:Hrn,alt:"AuthorizeNet",style:n.style||{width:40,height:40}});case"braintree":return f("img",{src:jrn,alt:"Braintree",style:n.style||{width:40,height:40}});case"checkoutcom":return f("img",{src:Urn,alt:"Checkoutcom",style:n.style||{width:40,height:40}});case"gocardless":return f("img",{src:qrn,alt:"GoCardless",style:n.style||{width:40,height:40}});case"mollie":return f("img",{src:Krn,alt:"Mollie",style:n.style||{width:40,height:40}});case"payfast":return f("img",{src:Grn,alt:"Payfast",style:n.style||{width:40,height:40}});case"paytrace":return f("img",{src:Yrn,alt:"Paytrace",style:n.style||{width:40,height:40}});case"razorpay":return f("img",{src:Qrn,alt:"Razorpay",style:n.style||{width:40,height:40}});case"square":return f("img",{src:Xrn,alt:"Square",style:n.style||{width:40,height:40}});case"stripe":return f("img",{src:Zrn,alt:"Stripe",style:n.style||{width:40,height:40}});case"eway":return f("img",{src:Jrn,alt:"Eway",style:n.style||{width:40,height:40}});case"forte":return f("img",{src:eon,alt:"Forte",style:n.style||{width:40,height:40}});case"wepay":return f("img",{src:ton,alt:"Wepay",style:n.style||{width:30,height:30}});case"btcpay":return f("img",{src:non,alt:"BTCPay",style:n.style||{width:30,height:30}});default:return f(_t,{})}}const ron=[{name:"paypal_ppcp",width:110},{name:"paypal_express",width:110},{name:"mollie",width:110},{name:"eway",width:170},{name:"forte",width:190},{name:"square",width:130},{name:"checkoutcom",width:170},{name:"btcpay",width:90}],oon=[{name:"stripe",key:"d14dd26a37cecc30fdd65700bfb55b23"},{name:"stripe",key:"d14dd26a47cecc30fdd65700bfb67b34"},{name:"paypal_platform",key:"80af24a6a691230bbec33e930ab40666"},{name:"paypal_rest",key:"80af24a6a691230bbec33e930ab40665"},{name:"braintree",key:"f7ec488676d310683fb51802d076d713"},{name:"paypal_ppcp",key:"80af24a6a691230bbec33e930ab40666"},{name:"authorize",key:"3b6621f970ab18887c4f6dca78d3f8bb"},{name:"mollie",key:"1bd651fb213ca0c9d66ae3c336dc77e8"},{name:"gocardless",key:"b9886f9257f0c6ee7c302f1c74475f6c"},{name:"forte",key:"kivcvjexxvdiyqtj3mju5d6yhpeht2xs"},{name:"razorpay",key:"hxd6gwg3ekb9tb3v9lptgx1mqyg69zu9"},{name:"square",key:"65faab2ab6e3223dbe848b1686490baz"},{name:"paytrace",key:"bbd736b3254b0aabed6ad7fda1298c88"},{name:"checkoutcom",key:"3758e7f7c6f4cecf0f4f348b9a00f456"},{name:"payfast",key:"d6814fc83f45d2935e7777071e629ef9"},{name:"eway",key:"944c20175bbe6b9972c05bcfe294c2c7"},{name:"btcpay",key:"vpyfbmdrkqcicpkjqdusgjfluebftuva"}];function son(){const[n]=ue(),{documentTitle:e}=gi("add_gateway"),{data:t}=N5t(),[i,r]=w.useState(),[o,s]=w.useState(),[a,l]=w.useState(),[c,u]=w.useState([]),[d,h]=w.useState(!1),[g,p]=w.useState(0),m=nze(),_=$rn(i,s),v=(P,M)=>{const O=m.find(B=>B.id===P);l(O),(O==null?void 0:O.key)==="80af24a6a691230bbec33e930ab40666"?b():(O==null?void 0:O.key)==="d14dd26a47cecc30fdd65700bfb67b34"?y():M&&p(1)},b=()=>{Te("POST",ye("/api/v1/one_time_token"),{context:"paypal_ppcp"}).then(P=>{var M;return(M=window.open(dt("https://invoicing.co/paypal?hash=:hash",{hash:P.data.hash}),"_blank"))==null?void 0:M.focus()})},y=()=>{Te("POST",ye("/api/v1/one_time_token"),{context:"stripe_connect"}).then(P=>{var M;return(M=window.open(dt("https://invoicing.co/stripe/signup/:token",{token:P.data.hash}),"_blank"))==null?void 0:M.focus()})},C=[n("payment_provider")],x=[n("credentials"),n("settings"),n("required_fields"),n("limits_and_fees")],k=[{name:n("settings"),href:"/settings"},{name:n("online_payments"),href:"/settings/online_payments"},{name:n("add_gateway"),href:"/settings/gateways/create"}],[I,L]=w.useState(C),D=P=>{const M=oon.find(O=>O.key===P);return(M==null?void 0:M.name)||""},R=P=>{const M=ron.find(O=>O.name===P);return M?M.width:void 0};return w.useEffect(()=>{if(m){const P=m.findIndex(({key:M})=>M==="80af24a6a691230bbec33e930ab40665");if(P>=0){const M=Tpe(m,P,1);u(M)}else u(m)}},[m]),w.useEffect(()=>{t!=null&&t.data.data&&i===void 0&&r(t.data.data)},[t,a]),w.useEffect(()=>{r(O=>O&&a&&{...O,gateway_key:a.key,token_billing:"always"}),(a?Object.entries(a.options):[]).find(([O])=>O==="1")&&r(O=>O&&{...O,fees_and_limits:{...O.fees_and_limits,1:uze}})},[a]),w.useEffect(()=>{L(a?[...C,...x]:[...C])},[a]),w.useEffect(()=>{d&&(_(1),h(!1))},[i]),N($i,{title:e,breadcrumbs:k,onSaveClick:()=>_(1),disableSaveButton:!a,children:[N(D_,{tabs:I,defaultTabIndex:g,onTabChange:P=>p(P),children:[f(Ot,{title:n("add_gateway"),children:f(U,{leftSide:n("payment_provider"),children:f(nn,{onValueChange:P=>v(P,!0),value:a==null?void 0:a.id,errorMessage:o==null?void 0:o.errors.gateway_key,withBlank:!0,children:c.map((P,M)=>f("option",{value:P.id,children:P.name},M))})})}),f("div",{children:a&&i&&f(sze,{gateway:a,companyGateway:i,setCompanyGateway:r,errors:o})}),f("div",{children:a&&i&&f(dze,{gateway:a,companyGateway:i,setCompanyGateway:r,errors:o})}),f("div",{children:a&&i&&f(cze,{gateway:a,companyGateway:i,setCompanyGateway:r})}),f("div",{children:a&&i&&f(lze,{gateway:a,companyGateway:i,setCompanyGateway:r,errors:o})})]}),!g&&f("div",{className:"flex flex-wrap gap-4",children:c.map((P,M)=>ion.includes(D(P.key))&&f(Ot,{className:"w-52",children:N("div",{className:"flex flex-col items-center justify-between h-52",children:[f("div",{className:"flex justify-center items-center border-b border-b-gray-200 w-full h-28",children:f(Ere,{name:D(P.key),style:{width:R(D(P.key))||150}})}),N("div",{className:St("flex flex-col pt-4 flex-1",{"justify-between":P.site_url,"justify-end":!P.site_url}),children:[P.site_url&&f(Ii,{external:!0,to:P.site_url,children:n("website")}),f(Ut,{behavior:"button",onClick:()=>{P.key!=="80af24a6a691230bbec33e930ab40666"&&h(!0),v(P.id)},children:n("setup")})]})]})},M))})]})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function aon(n,e){return()=>{n&&(e(void 0),ie.processing(),Te("PUT",ye("/api/v1/company_gateways/:id",{id:n==null?void 0:n.id}),n).then(()=>{ie.success("updated_company_gateway"),hn(["company_gateways"])}).catch(t=>{var i;((i=t==null?void 0:t.response)==null?void 0:i.status)===422&&(ie.dismiss(),e(t.response.data))}))}}function lon(){const[n]=ue(),[e,t]=w.useState(!1),i=Ri(_f),r=o=>{ie.processing(),Te("post",ye("/api/v1/stripe/import_customers"),{},{headers:{"X-Api-Password":o}}).then(()=>ie.success("imported_customers")).catch(s=>{var a;((a=s.response)==null?void 0:a.status)===412&&(ie.error("password_error_incorrect"),i(0))})};return N(_t,{children:[f(Ot,{title:n("import_customers"),children:f(Ja,{onClick:()=>t(!0),children:n("click_to_continue")})}),f(Rg,{onSave:r,show:e,onClose:t})]})}function con(n){const[e]=ue(),t=vi();return N(Ot,{title:e("webhooks"),children:[f(U,{leftSide:e("webhook_url"),children:f(ec,{className:"break-all",text:`${n3()}/payment_webhook/${t.company_key}/${n.companyGateway.id}`})}),f(U,{leftSide:e("supported_events"),children:f("ul",{className:"list-disc",children:Wa(Object.values(n.gateway.options)).pluck("webhooks").flatten().unique().whereNotNull().all().sort().map((i,r)=>f("li",{children:i},r))})})]})}function uon(){const[n]=ue(),e=b8e(),t=r=>{ie.processing(),Te("POST",ye("/api/v1/company_gateways/:id/import_customers",{id:r})).then(o=>ie.success(o.data.message))};return[r=>f(et,{onClick:()=>t(r.id),icon:f(Ve,{element:hyt}),children:n("import_customers")}),()=>f(Jn,{withoutPadding:!0}),r=>nr(r)===Di.Active&&f(et,{onClick:()=>e([r.id],"archive"),icon:f(Ve,{element:Xl}),children:n("archive")}),r=>(nr(r)===Di.Archived||nr(r)===Di.Deleted)&&f(et,{onClick:()=>e([r.id],"restore"),icon:f(Ve,{element:Ql}),children:n("restore")}),r=>(nr(r)===Di.Active||nr(r)===Di.Archived)&&f(et,{onClick:()=>e([r.id],"delete"),icon:f(Ve,{element:Pa}),children:n("delete")})]}function don(){const[n]=ue(),[e]=i3(),{id:t}=Fa(),i=uon(),{data:r}=R5t({id:t}),{documentTitle:o}=gi("edit_gateway"),[s,a]=w.useState(),[l,c]=w.useState(),u=[n("payment_provider")],d=[n("credentials"),n("settings"),n("required_fields"),n("limits_and_fees")],h=[{name:n("settings"),href:"/settings"},{name:n("online_payments"),href:"/settings/online_payments"},{name:n("edit_gateway"),href:dt("/settings/gateways/:id/edit",{id:t})}],[g,p]=w.useState(),[m,_]=w.useState(u),v=nze(),b=aon(l,a);return w.useEffect(()=>{l&&p(v.find(y=>y.key==l.gateway_key))},[l,v]),w.useEffect(()=>{r!=null&&r.data.data&&c(r.data.data)},[r]),w.useEffect(()=>()=>{c(void 0)},[]),w.useEffect(()=>{_(g?[...u,...d]:[...u])},[g]),f($i,{title:o,breadcrumbs:h,navigationTopRight:l&&f(I0,{resource:l,onSaveClick:b,actions:i}),children:N(D_,{tabs:m,defaultTabIndex:Number(e.get("tab"))??0,children:[f("div",{children:l&&N("div",{className:"space-y-4",children:[f(Ot,{title:n("edit_gateway"),children:f(U,{leftSide:n("payment_provider"),children:l.label})}),(g==null?void 0:g.key)==="d14dd26a37cecc30fdd65700bfb55b23"?f(lon,{}):null,g&&Wa(Object.values(g.options)).pluck("webhooks").flatten().unique().whereNotNull().count()>1&&f(con,{companyGateway:l,gateway:g})]})}),f("div",{children:g&&l&&f(sze,{gateway:g,companyGateway:l,setCompanyGateway:c,errors:s})}),f("div",{children:g&&l&&f(dze,{gateway:g,companyGateway:l,setCompanyGateway:c,errors:s})}),f("div",{children:g&&l&&f(cze,{gateway:g,companyGateway:l,setCompanyGateway:c})}),f("div",{children:g&&l&&f(lze,{gateway:g,companyGateway:l,setCompanyGateway:c,errors:s})})]})})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function Of(){return({settingsLevel:n})=>Promise.resolve(n===pO.Company)}const hon=w.lazy(()=>X(()=>import("./bundle53.js"),["bundle53.js","bundle455.js","bundle418.js"])),fon=w.lazy(()=>X(()=>import("./bundle54.js"),["bundle54.js","bundle422.js","bundle455.js","bundle456.js"])),gon=w.lazy(()=>X(()=>import("./bundle55.js"),["bundle55.js","bundle457.js"])),pon=w.lazy(()=>X(()=>import("./bundle56.js"),["bundle56.js","bundle421.js","bundle422.js","bundle457.js"])),mon=w.lazy(()=>X(()=>import("./bundle57.js"),["bundle57.js","bundle458.js","bundle457.js"])),_on=w.lazy(()=>X(()=>import("./bundle58.js"),["bundle58.js","bundle458.js"])),von=w.lazy(()=>X(()=>import("./bundle59.js"),["bundle59.js","bundle458.js"])),bon=w.lazy(()=>X(()=>import("./bundle60.js"),["bundle60.js","bundle458.js"])),yon=w.lazy(()=>X(()=>import("./bundle61.js"),["bundle61.js","bundle458.js"])),Con=w.lazy(()=>X(()=>import("./bundle62.js"),["bundle62.js","bundle458.js"])),won=w.lazy(()=>X(()=>import("./bundle63.js"),["bundle63.js","bundle458.js"])),Son=w.lazy(()=>X(()=>import("./bundle64.js"),["bundle64.js","bundle458.js"])),Eon=w.lazy(()=>X(()=>import("./bundle65.js"),["bundle65.js","bundle458.js","bundle456.js"])),xon=w.lazy(()=>X(()=>import("./bundle66.js"),["bundle66.js","bundle458.js"])),kon=w.lazy(()=>X(()=>import("./bundle67.js"),["bundle67.js","bundle458.js"])),Ton=w.lazy(()=>X(()=>import("./bundle68.js"),["bundle68.js","bundle458.js"])),Ion=w.lazy(()=>X(()=>import("./bundle69.js"),["bundle69.js","bundle422.js","bundle418.js","bundle449.js"])),Lon=w.lazy(()=>X(()=>import("./bundle70.js"),["bundle70.js","bundle421.js","bundle422.js","bundle459.js","bundle56.js","bundle457.js"])),Don=w.lazy(()=>X(()=>import("./bundle71.js"),["bundle71.js","bundle459.js"])),Aon=w.lazy(()=>X(()=>import("./bundle72.js"),["bundle72.js","bundle459.js"])),Ron=w.lazy(()=>X(()=>import("./bundle73.js"),["bundle73.js","bundle459.js"])),Non=w.lazy(()=>X(()=>import("./bundle74.js"),["bundle74.js","bundle459.js"])),Oon=w.lazy(()=>X(()=>import("./bundle75.js"),[])),Pon=N(ge,{path:"invoice_design",element:f(hon,{}),children:[f(ge,{path:"",element:f(fon,{})}),f(ge,{path:"custom_designs",element:f(gon,{})}),N(ge,{path:"custom_designs/:id/edit",element:f(vn,{guards:[Of()],component:f(Ion,{}),type:"subPage"}),children:[f(ge,{path:"",element:f(Lon,{})}),f(ge,{path:"body",element:f(Don,{})}),f(ge,{path:"header",element:f(Aon,{})}),f(ge,{path:"footer",element:f(Ron,{})}),f(ge,{path:"includes",element:f(Non,{})}),f(ge,{path:"variables",element:f(Oon,{})})]}),f(ge,{path:"custom_designs/create",element:f(pon,{})}),f(ge,{path:"client_details",element:f(vn,{guards:[Of()],component:f(mon,{}),type:"subPage"})}),f(ge,{path:"company_details",element:f(vn,{guards:[Of(),si(Ls(),Ls())],component:f(_on,{}),type:"subPage"})}),f(ge,{path:"company_address",element:f(vn,{guards:[Of(),si(Ls(),Ls())],component:f(von,{}),type:"subPage"})}),f(ge,{path:"invoice_details",element:f(vn,{guards:[Of(),si(Ls(),Ls())],component:f(bon,{}),type:"subPage"})}),f(ge,{path:"quote_details",element:f(vn,{guards:[Of(),si(Ls(),Ls())],component:f(yon,{}),type:"subPage"})}),f(ge,{path:"credit_details",element:f(vn,{guards:[Of(),si(Ls(),Ls())],component:f(Con,{}),type:"subPage"})}),f(ge,{path:"vendor_details",element:f(vn,{guards:[Of(),si(Ls(),Ls())],component:f(won,{}),type:"subPage"})}),f(ge,{path:"purchase_order_details",element:f(vn,{guards:[Of(),si(Ls(),Ls())],component:f(Son,{}),type:"subPage"})}),f(ge,{path:"product_columns",element:f(vn,{guards:[Of(),si(Ls(),Ls())],component:f(Eon,{}),type:"subPage"})}),f(ge,{path:"quote_product_columns",element:f(vn,{guards:[Of(),si(Ls(),Ls())],component:f(xon,{}),type:"subPage"})}),f(ge,{path:"task_columns",element:f(vn,{guards:[Of(),si(Ls(),Ls())],component:f(kon,{}),type:"subPage"})}),f(ge,{path:"total_fields",element:f(vn,{guards:[Of(),si(Ls(),Ls())],component:f(Ton,{}),type:"subPage"})})]}),Mon=N(ge,{path:"/settings",children:[N(ge,{path:"user_details",element:f(_Wt,{}),children:[f(ge,{path:"",element:f(NHt,{})}),f(ge,{path:"password",element:f(MHt,{})}),f(ge,{path:"connect",element:f(AHt,{})}),f(ge,{path:"accent_color",element:f(g7t,{})}),f(ge,{path:"notifications",element:f(PHt,{})}),f(ge,{path:"enable_two_factor",element:f(dWt,{})}),f(ge,{path:"custom_fields",element:f(hWt,{})}),f(ge,{path:"preferences",element:f(pWt,{})})]}),N(ge,{element:f(vn,{guards:[kI()],component:f(ah,{})}),children:[f(ge,{path:"",element:f(H9t,{})}),N(ge,{path:"company_details",element:f(K9t,{}),children:[f(ge,{path:"",element:f(urn,{})}),f(ge,{path:"address",element:f(lrn,{})}),f(ge,{path:"logo",element:f(JWe,{})}),f(ge,{path:"defaults",element:f(crn,{})}),f(ge,{path:"documents",element:f(arn,{})}),f(ge,{path:"custom_fields",element:f(drn,{})})]}),N(ge,{path:"localization",element:f(CWt,{}),children:[f(ge,{path:"",element:f(bWt,{})}),f(ge,{path:"custom_labels",element:f(vWt,{})})]}),f(ge,{path:"online_payments",element:f(mKt,{})}),f(ge,{path:"tax_settings",element:f(IKt,{})}),f(ge,{path:"product_settings",element:f(LKt,{})}),f(ge,{path:"task_settings",element:f(DKt,{})}),f(ge,{path:"expense_settings",element:f(jKt,{})}),f(ge,{path:"workflow_settings",element:f(KKt,{})}),f(ge,{path:"import_export",element:f(qGt,{})}),N(ge,{path:"account_management",element:f(GGt,{}),children:[f(ge,{path:"",element:f(T5t,{})}),f(ge,{path:"overview",element:f(k5t,{})}),f(ge,{path:"enabled_modules",element:f(hAt,{})}),f(ge,{path:"integrations",element:f(fAt,{})}),f(ge,{path:"security_settings",element:f(I5t,{})}),f(ge,{path:"referral_program",element:f(D5t,{})}),!u0()&&f(ge,{path:"danger_zone",element:f(L5t,{})})]}),N(ge,{path:"backup_restore",element:f(Cen,{}),children:[f(ge,{path:"",element:f(Ien,{})}),f(ge,{path:"restore",element:f(Ten,{})})]}),N(ge,{path:"custom_fields",element:f(YGt,{}),children:[f(ge,{path:"company",element:f(QGt,{})}),f(ge,{path:"clients",element:f(XGt,{})}),f(ge,{path:"products",element:f(ZGt,{})}),f(ge,{path:"invoices",element:f(tYt,{})}),f(ge,{path:"payments",element:f(nYt,{})}),f(ge,{path:"projects",element:f(iYt,{})}),f(ge,{path:"tasks",element:f(rYt,{})}),f(ge,{path:"vendors",element:f(oYt,{})}),f(ge,{path:"expenses",element:f(sYt,{})}),f(ge,{path:"users",element:f(aYt,{})})]}),N(ge,{path:"generated_numbers",element:f(cYt,{}),children:[f(ge,{path:"",element:f(EYt,{})}),f(ge,{path:"clients",element:f(uYt,{})}),f(ge,{path:"invoices",element:f(dYt,{})}),f(ge,{path:"recurring_invoices",element:f(hYt,{})}),f(ge,{path:"payments",element:f(fYt,{})}),f(ge,{path:"quotes",element:f(gYt,{})}),f(ge,{path:"credits",element:f(pYt,{})}),f(ge,{path:"projects",element:f(mYt,{})}),f(ge,{path:"tasks",element:f(_Yt,{})}),f(ge,{path:"vendors",element:f(vYt,{})}),f(ge,{path:"purchase_orders",element:f(bYt,{})}),f(ge,{path:"expenses",element:f(yYt,{})}),f(ge,{path:"recurring_expenses",element:f(CYt,{})})]}),N(ge,{path:"client_portal",element:f(YYt,{}),children:[f(ge,{path:"",element:f(zYt,{})}),f(ge,{path:"authorization",element:f(jYt,{})}),f(ge,{path:"registration",element:f(KYt,{})}),f(ge,{path:"messages",element:f(qYt,{})}),f(ge,{path:"customize",element:f(UYt,{})})]}),f(ge,{path:"email_settings",element:f(WYt,{})}),f(ge,{path:"templates_and_reminders",element:f(JYt,{})}),N(ge,{path:"bank_accounts",children:[f(ge,{path:"",element:f(rQt,{})}),f(ge,{path:":id/details",element:f(lQt,{})}),f(ge,{path:"create",element:f(sQt,{})}),f(ge,{path:":id/edit",element:f(oQt,{})})]}),N(ge,{path:"group_settings",children:[f(ge,{path:"",element:f(Ein,{})}),f(ge,{path:"create",element:f(kin,{})}),f(ge,{path:":id/edit",element:f(Win,{})})]}),N(ge,{path:"subscriptions",children:[f(ge,{path:"",element:f(kQt,{})}),f(ge,{path:"create",element:f(RQt,{})}),f(ge,{path:":id/edit",element:f(OQt,{})})]}),N(ge,{path:"schedules",children:[f(ge,{path:"",element:f(hen,{})}),f(ge,{path:"create",element:f(_en,{})}),f(ge,{path:":id/edit",element:f(ben,{})})]}),N(ge,{path:"users",children:[f(ge,{path:"",element:f(zin,{})}),f(ge,{path:"create",element:f(qin,{})}),f(ge,{path:":id/edit",element:f(vn,{guards:[Ls()],component:f(Uin,{})})})]}),f(ge,{path:"/settings/system_logs",children:f(ge,{path:"",element:f(Sin,{})})}),N(ge,{path:"payment_terms",children:[f(ge,{path:"",element:f(ern,{})}),f(ge,{path:":id/edit",element:f(Jin,{})}),f(ge,{path:"create",element:f(Gin,{})})]}),N(ge,{path:"tax_rates",children:[f(ge,{path:"create",element:f(rrn,{})}),f(ge,{path:":id/edit",element:f(srn,{})})]}),N(ge,{path:"task_statuses",children:[f(ge,{path:"create",element:f(frn,{})}),f(ge,{path:":id/edit",element:f(grn,{})})]}),N(ge,{path:"expense_categories",children:[f(ge,{path:"create",element:f(HKt,{})}),f(ge,{path:":id/edit",element:f(zKt,{})})]}),N(ge,{path:"integrations",children:[N(ge,{path:"api_tokens",children:[f(ge,{path:"",element:f(vn,{guards:[si(Ls(),Ls()),kI()],component:f(prn,{})})}),f(ge,{path:"create",element:f(vn,{guards:[si(Ls(),Ls()),kI()],component:f(brn,{})})}),f(ge,{path:":id/edit",element:f(vn,{guards:[si(Ls(),Ls()),kI()],component:f(Crn,{})})})]}),N(ge,{path:"api_webhooks",children:[f(ge,{path:"",element:f(Srn,{})}),f(ge,{path:"create",element:f(Trn,{})}),f(ge,{path:":id/edit",element:f(Lrn,{})})]}),f(ge,{path:"analytics",element:f(Drn,{})})]}),N(ge,{path:"gateways",children:[f(ge,{path:"create",element:f(son,{})}),f(ge,{path:":id/edit",element:f(don,{})})]}),N(ge,{path:"bank_accounts/transaction_rules",children:[f(ge,{path:"",element:f(uQt,{})}),f(ge,{path:"create",element:f(SQt,{})}),f(ge,{path:":id/edit",element:f(EQt,{})})]}),Pon]})]});function Fon(){return f(aD,{to:"/"})}function Bon(){return Vde()?f(aD,{to:"/dashboard"}):f(ah,{})}/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/function hze(){const n=Ci();return e=>{localStorage.removeItem("X-CURRENT-INDEX");let t=0;const i=e.data.data,r=i[0].account.default_company_id;t=i.findIndex(o=>o.company.id===r),t===-1&&(t=0),n(h3({type:W2.TOKEN,user:e.data.data[t].user,token:e.data.data[t].token.token})),n(yb(e.data.data)),n(Ez(t))}}const $on="",Von="";function Hon(){const n=ri(),e=hze();return w.useEffect(()=>{if(!u0())return n("/login");Te("POST",ye("/api/v1/login"),{email:$on,password:Von}).then(t=>e(t)).catch(()=>n("/login"))},[]),f("div",{})}const PX=Ea.a`
&:hover {
background-color: ${n=>n.theme.hoverColor};
}
`;function Won(){const n=Vn();return N("div",{className:"grid grid-cols-3 text-sm border rounded",style:{backgroundColor:n.$1,borderColor:n.$5,color:n.$3},children:[f("div",{className:"col-span-3 md:col-span-1",children:N(PX,{theme:{hoverColor:n.$2},href:"https://status.invoiceninja.com/",target:"_blank",className:"py-3 w-full px-2 inline-flex justify-center items-center rounded-l",rel:"noreferrer",children:[f(Xmt,{size:15}),f("span",{className:"m-1",children:"Check status"})]})}),f("div",{className:"col-span-3 md:col-span-1",children:N(PX,{theme:{hoverColor:n.$2},href:"https://www.invoiceninja.com/mobile/",target:"_blank",className:"py-3 w-full px-2 inline-flex justify-center items-center",rel:"noreferrer",children:[f(E_t,{size:15}),f("span",{className:"m-1",children:"Applications"})]})}),f("div",{className:"col-span-3 md:col-span-1",children:N(PX,{theme:{hoverColor:n.$2},href:"https://invoiceninja.github.io",target:"_blank",className:"py-3 w-full hover:bg-gray-100 px-2 inline-flex justify-center items-center rounded-r",rel:"noreferrer",children:[f(Upt,{size:15}),f("span",{className:"m-1",children:"Documentation"})]})})]})}const zon="/invoiceninja-logo@dark-365f6449.png";function Xpe(){const e={backgroundColor:ys()};return N(_t,{children:[f("div",{className:"py-1",style:e}),f("div",{className:"flex justify-center py-8",children:f(Ii,{to:"/",children:f("img",{src:zon,alt:"Invoice Ninja Logo",className:"h-12"})})})]})}function jon(n){const[e]=ue(),{visible:t,setVisible:i}=n,[r,o]=w.useState(""),[s,a]=w.useState(""),[l,c]=w.useState(!1),[u,d]=w.useState(!1),[h,g]=w.useState(),[p,m]=w.useState(!1),_=()=>{ie.processing(),c(!0),Te("POST",ye("/api/v1/sms_reset"),{email:r}).then(b=>{ie.success(b.data.message),i(!1),m(!0)}).catch(b=>{var y;((y=b.response)==null?void 0:y.status)===422&&(g(b.response.data),ie.dismiss())}).finally(()=>c(!1))},v=()=>{ie.processing(),d(!0),Te("POST",ye("/api/v1/sms_reset/confirm"),{email:r,code:s}).then(b=>{ie.success(b.data.message),a(""),o(""),m(!1)}).finally(()=>d(!1))};return N(_t,{children:[f(cr,{title:e("disable_2fa"),visible:t,onClose:()=>{i(!1),o("")},children:N("div",{className:"flex flex-col space-y-6",children:[f(ke,{label:e("email"),value:r,onValueChange:b=>{o(b),h&&g(void 0)},errorMessage:h==null?void 0:h.errors.email}),f(Ut,{className:"self-end",onClick:_,disableWithoutIcon:!0,disabled:!r||l,children:e("send_code")})]})}),f(cr,{title:e("disable_two_factor"),visible:p,onClose:()=>{m(!1),a(""),o("")},children:N("div",{className:"flex flex-col space-y-7 items-center",children:[f(k8e,{onComplete:a}),N("div",{className:"flex self-end space-x-5",children:[f(Ut,{type:"minimal",onClick:_,disableWithoutIcon:!0,disabled:l||u,children:e("resend_code")}),f(Ut,{onClick:v,disableWithoutIcon:!0,disabled:l||u||s.length!==6,children:e("verify")})]})]})})]})}function Uon(){gi("login");const n=ys(),[e,t]=w.useState(void 0),[i,r]=w.useState(void 0),[o,s]=w.useState(!1),[a]=ue(),[l,c]=w.useState(!1),u=hze();function d(g){const p=new FormData(g);t(void 0),r(void 0),s(!0);const m=p.get("secret");Te("POST",ye("/api/v1/login"),Object.fromEntries(p),{...m&&{headers:{"X-API-SECRET":m}}}).then(_=>u(_)).catch(_=>{var v,b,y;((v=_.response)==null?void 0:v.status)===422?r(_.response.data.errors):((b=_.response)==null?void 0:b.status)===503?ie.error("app_maintenance"):t(((y=_.response)==null?void 0:y.data.message)??a("invalid_credentials"))}).finally(()=>s(!1))}const h=Vn();return N("div",{className:"h-screen",children:[f(Xpe,{}),N("div",{className:"flex flex-col items-center",children:[N("div",{className:"mx-4 max-w-md w-full p-8 rounded md:shadow-lg border",style:{backgroundColor:h.$1,borderColor:h.$5},children:[f("h2",{className:"text-2xl",style:{color:h.$3},children:a("login")}),N("form",{onSubmit:g=>{g.preventDefault(),d(g.currentTarget)},className:"my-6 space-y-4",children:[f(ke,{type:"email",autoComplete:"on",label:a("email_address"),errorMessage:i==null?void 0:i.email,name:"email"}),f(ke,{type:"password",autoComplete:"on",label:a("password"),id:"password",errorMessage:i==null?void 0:i.password,name:"password"}),f("div",{className:"space-y-2",children:N("div",{className:"flex flex-col lg:flex-row items-center justify-between",children:[f($p,{children:`2FA - ${a("one_time_password")}`}),f(Ii,{to:"/recover_password",children:a("forgot_password")})]})}),f(ke,{type:"text",autoComplete:"on",id:"one_time_password",placeholder:a("plaid_optional"),errorMessage:i==null?void 0:i.one_time_password,name:"one_time_password"}),f("div",{className:"space-y-2",children:N("div",{className:St("flex flex-col lg:flex-row items-center",{"justify-between":t3(),"justify-end":Yo()}),children:[f($p,{children:a("secret")}),f("div",{className:"text-sm hover:underline cursor-pointer",onClick:()=>c(!0),style:{color:n},children:a("disable_2fa")})]})}),f(ke,{type:"password",autoComplete:"on",placeholder:a("plaid_optional"),name:"secret"}),e&&f(bs,{className:"mt-4",type:"danger",children:e}),f(Ut,{disabled:o,className:"mt-4",variant:"block",children:a("login")})]}),f("div",{className:"flex justify-center",children:Yo()})]}),Yo(),f("p",{className:"mt-4 text-xs",children:Q6e})]}),f(jon,{visible:l,setVisible:c})]})}function qon(){const n=Kr();return w.useEffect(()=>{I4e(),sessionStorage.clear(),n.invalidateQueries(),n.removeQueries(),window.location.href="/"},[]),f(_t,{})}function Kon(){var c,u;gi("recover_password");const[n]=ue(),[e,t]=w.useState(!1),[i,r]=w.useState(void 0),[o,s]=w.useState(void 0),a=Xp({initialValues:{email:""},onSubmit:d=>{t(!0),s(void 0),r(void 0),Te("POST",ye("/api/v1/reset_password"),d).then(h=>r(h.data)).catch(h=>{var g,p,m;return((g=h.response)==null?void 0:g.status)===422?s((p=h.response)==null?void 0:p.data.errors):r((m=h.response)==null?void 0:m.data)}).finally(()=>t(!1))}}),l=Vn();return N("div",{className:"h-screen",children:[f(Xpe,{}),N("div",{className:"flex flex-col items-center",children:[N("div",{className:"mx-4 max-w-md w-full p-8 rounded md:shadow-lg border",style:{backgroundColor:l.$1,borderColor:l.$5},children:[f("h2",{className:"text-2xl",style:{color:l.$3},children:n("recover_password")}),N("form",{onSubmit:a.handleSubmit,className:"my-6",children:[f(ke,{type:"email",label:n("email_address"),id:"email",onChange:a.handleChange}),((c=o==null?void 0:o.errors)==null?void 0:c.email)&&f(bs,{className:"mt-2",type:"danger",children:(u=o.errors)==null?void 0:u.email}),i&&f(bs,{className:"mt-4",type:i.status?"success":"danger",children:i.message}),f(Ut,{disabled:e,className:"mt-4",variant:"block",children:n("send_email")})]}),f("div",{className:"flex justify-center",children:Yo()})]}),Yo()]})]})}var cU={},Gon=Co&&Co.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),Yon=Co&&Co.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),Qon=Co&&Co.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)t!=="default"&&Object.prototype.hasOwnProperty.call(n,t)&&Gon(e,n,t);return Yon(e,n),e};Object.defineProperty(cU,"__esModule",{value:!0});var fze=cU.useTurnstile=void 0;const iE=Qon(w),kO=typeof globalThis<"u"?globalThis:window;let xC=typeof kO.turnstile<"u"?"ready":"unloaded",gze,xre;const pze=new Promise((n,e)=>{xre={resolve:n,reject:e},xC==="ready"&&n(void 0)});{const n="cf__reactTurnstileOnLoad",e="https://challenges.cloudflare.com/turnstile/v0/api.js";gze=()=>{if(xC==="unloaded"){xC="loading",kO[n]=()=>{xre.resolve(),xC="ready",delete kO[n]};const t=`${e}?onload=${n}&render=explicit`,i=document.createElement("script");i.src=t,i.async=!0,i.addEventListener("error",()=>{xre.reject("Failed to load Turnstile."),delete kO[n]}),document.head.appendChild(i)}return pze}}function Xon({id:n,className:e,style:t,sitekey:i,action:r,cData:o,theme:s,language:a,tabIndex:l,responseField:c,responseFieldName:u,size:d,fixedSize:h,retry:g,retryInterval:p,refreshExpired:m,appearance:_,execution:v,userRef:b,onVerify:y,onLoad:C,onError:x,onExpire:k,onTimeout:I,onAfterInteractive:L,onBeforeInteractive:D,onUnsupported:R}){const P=(0,iE.useRef)(null),M=(0,iE.useState)({onVerify:y,onLoad:C,onError:x,onExpire:k,onTimeout:I,onAfterInteractive:L,onBeforeInteractive:D,onUnsupported:R})[0],O=b??P;return(0,iE.useEffect)(()=>{if(!O.current)return;let B=!1,F="";return(async()=>{var H,V;if(xC!=="ready")try{await gze()}catch(Y){(H=M.onError)===null||H===void 0||H.call(M,Y);return}if(B||!O.current)return;let $;const j={sitekey:i,action:r,cData:o,theme:s,language:a,tabindex:l,"response-field":c,"response-field-name":u,size:d,retry:g,"retry-interval":p,"refresh-expired":m,appearance:_,execution:v,callback:Y=>{var ne;return(ne=M.onVerify)===null||ne===void 0?void 0:ne.call(M,Y,$)},"error-callback":Y=>{var ne;return(ne=M.onError)===null||ne===void 0?void 0:ne.call(M,Y,$)},"expired-callback":Y=>{var ne;return(ne=M.onExpire)===null||ne===void 0?void 0:ne.call(M,Y,$)},"timeout-callback":()=>{var Y;return(Y=M.onTimeout)===null||Y===void 0?void 0:Y.call(M,$)},"after-interactive-callback":()=>{var Y;return(Y=M.onAfterInteractive)===null||Y===void 0?void 0:Y.call(M,$)},"before-interactive-callback":()=>{var Y;return(Y=M.onBeforeInteractive)===null||Y===void 0?void 0:Y.call(M,$)},"unsupported-callback":()=>{var Y;return(Y=M.onUnsupported)===null||Y===void 0?void 0:Y.call(M,$)}};F=window.turnstile.render(O.current,j),$=Jon(F),(V=M.onLoad)===null||V===void 0||V.call(M,F,$)})(),()=>{B=!0,F&&window.turnstile.remove(F)}},[i,r,o,s,a,l,c,u,d,g,p,m,_,v]),(0,iE.useEffect)(()=>{M.onVerify=y,M.onLoad=C,M.onError=x,M.onExpire=k,M.onTimeout=I,M.onAfterInteractive=L,M.onBeforeInteractive=D,M.onUnsupported=R},[y,C,x,k,I,L,D,R]),iE.default.createElement("div",{ref:O,id:n,className:e,style:h?{...t??{},width:d==="compact"?"130px":"300px",height:d==="compact"?"120px":"65px"}:t})}var Zon=cU.default=Xon;function Jon(n){return{execute:e=>window.turnstile.execute(n,e),reset:()=>window.turnstile.reset(n),getResponse:()=>window.turnstile.getResponse(n),isExpired:()=>window.turnstile.isExpired(n)}}function esn(){const[n,e]=(0,iE.useState)(xC);return(0,iE.useEffect)(()=>{xC!=="ready"&&pze.then(()=>e(xC))},[]),kO.turnstile}fze=cU.useTurnstile=esn;function tsn(n){const{onVerified:e}=n;return f(Zon,{appearance:"interaction-only",sitekey:"",onVerify:i=>e(i)})}function nsn(){gi("register");const[n]=ue(),e=fze(),[t,i]=w.useState(void 0),[r,o]=w.useState(""),[s,a]=w.useState(!1),[l,c]=w.useState(!1),[u,d]=w.useState(""),h=Ci(),[g]=i3(),p=Xp({initialValues:{email:"",password:"",password_confirmation:"",terms_of_service:!1,privacy_policy:!1},onSubmit(_){if(d(""),i(void 0),c(!0),_.password!==_.password_confirmation){c(!1),i({password_confirmation:["Password confirmation does not match."]});return}const v=new URL("/api/v1/signup?include=token,user.company_user,company,account",n3());["utm_source","utm_medium","utm_campaign","utm_content","utm_term"].forEach(y=>{g.has(y)&&v.searchParams.append(y,g.get(y))});const b=g.get("rc");b&&v.searchParams.append("rc",b),Te("POST",v.href,{..._,"cf-turnstile":r}).then(y=>{h(hpt({token:y.data.data[0].token.token,user:y.data.data[0].user})),h(yb(y.data.data)),h(Ez(0))}).catch(y=>{var C,x;((C=y.response)==null?void 0:C.status)===422&&i(y.response.data.errors),d((x=y.response)==null?void 0:x.data.message),c(!1)}).finally(()=>{e.reset(),a(!1),o("")})}}),m=Vn();return w.useEffect(()=>{r&&p.handleSubmit()},[r]),f(_t,{children:N("div",{className:"h-screen",children:[f(Xpe,{}),N("div",{className:"flex flex-col items-center",children:[N("div",{className:"mx-4 max-w-md w-full p-8 rounded md:shadow-lg border",style:{backgroundColor:m.$1,borderColor:m.$5},children:[f("h2",{className:"text-2xl",style:{color:m.$3},children:n("register_label")}),N("div",{className:"space-y-5 my-6",children:[f(ke,{type:"email",autoComplete:"on",label:n("email_address"),id:"email",onChange:p.handleChange,errorMessage:t==null?void 0:t.email}),f(ke,{type:"password",autoComplete:"on",label:n("password"),id:"password",onChange:p.handleChange,errorMessage:t==null?void 0:t.password}),f(ke,{type:"password",autoComplete:"on",label:n("password_confirmation"),id:"password_confirmation",onChange:p.handleChange,errorMessage:t==null?void 0:t.password_confirmation}),u&&f(bs,{className:"mt-4",type:"danger",children:u}),s&&f("div",{className:"flex justify-center",children:f(tsn,{onVerified:_=>o(_)})}),f(Ut,{disabled:l,className:"mt-4",variant:"block",onClick:()=>a(!0),children:n("register")})]}),f("div",{className:"flex justify-center",children:Yo()})]}),N(_t,{children:[f(LHt,{}),f("div",{className:"mx-4 max-w-md w-full rounded md:shadow-lg mt-4",children:f(Won,{})})]})]})]})})}const isn=N(_t,{children:[N(ge,{element:f(Bon,{}),children:[f(ge,{path:"/login",element:f(Uon,{})}),f(ge,{path:"/recover_password",element:f(Kon,{})}),f(ge,{element:f(Fon,{}),children:f(ge,{path:"/register",element:f(nsn,{})})}),f(ge,{path:"/demo",element:f(Hon,{})})]}),f(ge,{element:f(B8e,{}),children:f(ge,{path:"/logout",element:f(qon,{})})})]}),rsn=w.lazy(()=>X(()=>import("./bundle76.js"),["bundle76.js","bundle396.js","bundle397.js","bundle424.js","bundle405.js","bundle408.js","bundle399.js","bundle402.js","bundle401.js","bundle404.js","bundle437.js","bundle403.js"])),osn=w.lazy(()=>X(()=>import("./bundle77.js"),[])),ssn=w.lazy(()=>X(()=>import("./bundle78.js"),["bundle78.js","bundle413.js","bundle417.js","bundle415.js","bundle418.js","bundle438.js","bundle421.js","bundle422.js","bundle420.js","bundle437.js","bundle416.js"])),asn=w.lazy(()=>X(()=>import("./bundle79.js"),["bundle79.js","bundle412.js","bundle413.js","bundle417.js","bundle415.js","bundle418.js","bundle438.js","bundle421.js","bundle422.js","bundle420.js","bundle437.js","bundle416.js"])),lsn=w.lazy(()=>X(()=>import("./bundle80.js"),["bundle80.js","bundle418.js","bundle437.js"])),csn=w.lazy(()=>X(()=>import("./bundle81.js"),["bundle81.js","bundle419.js","bundle418.js","bundle437.js"])),usn=N(ge,{path:"/quotes",children:[f(ge,{path:"",element:f(vn,{guards:[rr(Xn.Quotes),si(Rt("view_quote"),Rt("create_quote"),Rt("edit_quote"))],component:f(rsn,{})})}),f(ge,{path:"import",element:f(vn,{guards:[rr(Xn.Quotes),si(Rt("create_quote"),Rt("edit_quote"))],component:f(osn,{})})}),f(ge,{path:":id/edit",element:f(vn,{guards:[rr(Xn.Quotes),si(Rt("view_quote"),Rt("edit_quote"),Ys("/api/v1/quotes/:id"))],component:f(ssn,{})})}),f(ge,{path:"create",element:f(vn,{guards:[rr(Xn.Quotes),Rt("create_quote")],component:f(asn,{})})}),N(ge,{path:":id",element:f(vn,{guards:[rr(Xn.Quotes),si(Rt("edit_quote"),Ys("/api/v1/quotes/:id"))],component:f(ah,{})}),children:[f(ge,{path:"pdf",element:f(lsn,{})}),f(ge,{path:"email",element:f(csn,{})})]})]}),dsn=w.lazy(()=>X(()=>import("./bundle82.js"),["bundle82.js","bundle396.js","bundle428.js","bundle430.js","bundle395.js","bundle401.js","bundle404.js","bundle429.js","bundle405.js","bundle406.js","bundle407.js"])),hsn=w.lazy(()=>X(()=>import("./bundle83.js"),["bundle83.js","bundle412.js","bundle413.js","bundle417.js","bundle415.js","bundle418.js","bundle439.js","bundle421.js","bundle422.js","bundle420.js","bundle428.js","bundle430.js","bundle395.js","bundle401.js","bundle404.js","bundle440.js"])),fsn=w.lazy(()=>X(()=>import("./bundle84.js"),["bundle84.js","bundle413.js","bundle417.js","bundle415.js","bundle418.js","bundle439.js","bundle421.js","bundle422.js","bundle420.js","bundle428.js","bundle430.js","bundle395.js","bundle401.js","bundle404.js","bundle440.js"])),gsn=w.lazy(()=>X(()=>import("./bundle85.js"),["bundle85.js","bundle418.js","bundle440.js"])),psn=w.lazy(()=>X(()=>import("./bundle86.js"),["bundle86.js","bundle419.js","bundle418.js","bundle440.js"])),msn=N(ge,{path:"/credits",children:[f(ge,{path:"",element:f(vn,{guards:[rr(Xn.Credits),si(Rt("view_credit"),Rt("create_credit"),Rt("edit_credit"))],component:f(dsn,{})})}),f(ge,{path:"create",element:f(vn,{guards:[rr(Xn.Credits),Rt("create_credit")],component:f(hsn,{})})}),f(ge,{path:":id/edit",element:f(vn,{guards:[rr(Xn.Credits),si(Rt("edit_credit"),Rt("view_credit"),Ys("/api/v1/credits/:id"))],component:f(fsn,{})})}),f(ge,{path:":id/pdf",element:f(vn,{guards:[rr(Xn.Credits),si(Rt("edit_credit"),Ys("/api/v1/credits/:id"))],component:f(gsn,{})})}),f(ge,{path:":id/email",element:f(vn,{guards:[rr(Xn.Credits),si(Rt("edit_credit"),Ys("/api/v1/credits/:id"))],component:f(psn,{})})})]}),_sn=w.lazy(()=>X(()=>import("./bundle87.js"),["bundle87.js","bundle431.js","bundle432.js","bundle396.js"])),vsn=w.lazy(()=>X(()=>import("./bundle88.js"),["bundle88.js","bundle432.js"])),uIe=w.lazy(()=>X(()=>import("./bundle89.js"),["bundle89.js","bundle431.js","bundle432.js"])),bsn=w.lazy(()=>X(()=>import("./bundle90.js"),["bundle90.js","bundle417.js"])),ysn=w.lazy(()=>X(()=>import("./bundle91.js"),["bundle91.js","bundle423.js","bundle431.js","bundle432.js","bundle396.js","bundle433.js","bundle417.js"])),Csn=w.lazy(()=>X(()=>import("./bundle92.js"),[])),wsn=N(ge,{children:[f(ge,{path:"/projects",element:f(vn,{guards:[rr(Xn.Projects),si(Rt("view_project"),Rt("create_project"),Rt("edit_project"))],component:f(_sn,{})})}),f(ge,{path:"/projects/create",element:f(vn,{guards:[rr(Xn.Projects),Rt("create_project")],component:f(vsn,{})})}),f(ge,{path:"/projects/:id",element:f(vn,{guards:[rr(Xn.Projects),si(Rt("view_project"),Rt("edit_project"),Ys("/api/v1/projects/:id"))],component:f(ysn,{})})}),f(ge,{path:"/projects/:id",element:f(vn,{guards:[rr(Xn.Projects),si(Rt("view_project"),Rt("edit_project"),Ys("/api/v1/projects/:id"))],component:f(uIe,{})}),children:f(ge,{path:"documents",element:f(Csn,{})})}),f(ge,{path:"/projects/:id/edit",element:f(vn,{guards:[rr(Xn.Projects),si(Rt("edit_project"),Ys("/api/v1/projects/:id"))],component:f(uIe,{})}),children:f(ge,{path:"",element:f(bsn,{})})})]});function Ssn(){const{t:n}=ue(),{documentTitle:e}=gi("import"),t=[{name:n("tasks"),href:"/tasks"},{name:n("import"),href:"/tasks/import"}];return f(oA,{title:e,breadcrumbs:t,children:f("div",{className:"grid grid-cols-12",children:f("div",{className:"col-span-12 xl:col-span-10",children:f(yWe,{entity:"task",onSuccess:!1,type:"csv"})})})})}const Esn=w.lazy(()=>X(()=>import("./bundle93.js"),["bundle93.js","bundle396.js","bundle433.js","bundle397.js","bundle399.js","bundle441.js","bundle442.js"])),xsn=w.lazy(()=>X(()=>import("./bundle94.js"),["bundle94.js","bundle441.js","bundle442.js","bundle399.js","bundle420.js","bundle443.js","bundle417.js"])),ksn=w.lazy(()=>X(()=>import("./bundle95.js"),["bundle95.js","bundle443.js","bundle420.js","bundle442.js","bundle417.js"])),Tsn=w.lazy(()=>X(()=>import("./bundle96.js"),[])),Isn=w.lazy(()=>X(()=>import("./bundle97.js"),["bundle97.js","bundle443.js","bundle420.js","bundle442.js","bundle417.js"])),Lsn=w.lazy(()=>X(()=>import("./bundle98.js"),[])),Dsn=N(ge,{path:"/tasks",children:[f(ge,{path:"",element:f(vn,{guards:[rr(Xn.Tasks),si(Rt("view_task"),Rt("create_task"),Rt("edit_task"))],component:f(Esn,{})})}),f(ge,{path:"kanban",element:f(vn,{guards:[rr(Xn.Tasks),si(Rt("view_task"),Rt("edit_task"))],component:f(xsn,{})})}),f(ge,{path:"create",element:f(vn,{guards:[rr(Xn.Tasks),Rt("create_task")],component:f(ksn,{})})}),N(ge,{path:":id",element:f(vn,{guards:[rr(Xn.Tasks),si(Rt("view_task"),Rt("edit_task"),Ys("/api/v1/tasks/:id"))],component:f(Tsn,{})}),children:[f(ge,{path:"edit",element:f(Isn,{})}),f(ge,{path:"documents",element:f(Lsn,{})})]}),f(ge,{path:"import",element:f(vn,{guards:[rr(Xn.Tasks),si(Rt("create_task"),Rt("edit_task"))],component:f(Ssn,{})})})]}),Asn=w.lazy(()=>X(()=>import("./bundle99.js"),["bundle99.js","bundle396.js","bundle397.js","bundle444.js"])),Rsn=w.lazy(()=>X(()=>import("./bundle100.js"),[])),Nsn=w.lazy(()=>X(()=>import("./bundle101.js"),["bundle101.js","bundle423.js","bundle444.js"])),dIe=w.lazy(()=>X(()=>import("./bundle102.js"),["bundle102.js","bundle445.js","bundle405.js"])),Osn=w.lazy(()=>X(()=>import("./bundle103.js"),[])),Psn=w.lazy(()=>X(()=>import("./bundle104.js"),["bundle104.js","bundle434.js"])),Msn=w.lazy(()=>X(()=>import("./bundle105.js"),[])),Fsn=w.lazy(()=>X(()=>import("./bundle106.js"),["bundle106.js","bundle444.js"])),Bsn=w.lazy(()=>X(()=>import("./bundle107.js"),[])),$sn=N(ge,{path:"vendors",children:[f(ge,{path:"",element:f(vn,{guards:[rr(Xn.Vendors),si(Rt("view_vendor"),Rt("create_vendor"),Rt("edit_vendor"))],component:f(Asn,{})})}),f(ge,{path:"import",element:f(vn,{guards:[rr(Xn.Vendors),si(Rt("create_vendor"),Rt("edit_vendor"))],component:f(Rsn,{})})}),N(ge,{path:":id",element:f(vn,{guards:[rr(Xn.Vendors),si(Rt("view_vendor"),Rt("edit_vendor"),Ys("/api/v1/vendors/:id"))],component:f(Nsn,{})}),children:[f(ge,{path:"",element:f(dIe,{})}),f(ge,{path:"purchase_orders",element:f(dIe,{})}),f(ge,{path:"expenses",element:f(Osn,{})}),f(ge,{path:"recurring_expenses",element:f(Psn,{})}),f(ge,{path:"documents",element:f(Msn,{})})]}),f(ge,{path:":id/edit",element:f(vn,{guards:[rr(Xn.Vendors),si(Rt("edit_vendor"),Ys("/api/v1/vendors/:id"))],component:f(Fsn,{})})}),f(ge,{path:"create",element:f(vn,{guards:[rr(Xn.Vendors),Rt("create_vendor")],component:f(Bsn,{})})})]}),Vsn=w.lazy(()=>X(()=>import("./bundle108.js"),["bundle108.js","bundle396.js","bundle397.js"])),Hsn=w.lazy(()=>X(()=>import("./bundle109.js"),[])),Wsn=w.lazy(()=>X(()=>import("./bundle110.js"),["bundle110.js","bundle446.js","bundle420.js","bundle417.js","bundle447.js","bundle448.js"])),zsn=w.lazy(()=>X(()=>import("./bundle111.js"),["bundle111.js","bundle449.js","bundle418.js"])),jsn=w.lazy(()=>X(()=>import("./bundle112.js"),["bundle112.js","bundle446.js","bundle420.js","bundle417.js","bundle447.js","bundle448.js"])),Usn=w.lazy(()=>X(()=>import("./bundle113.js"),[])),qsn=N(ge,{path:"expenses",children:[f(ge,{path:"",element:f(vn,{guards:[rr(Xn.Expenses),si(Rt("view_expense"),Rt("create_expense"),Rt("edit_expense"))],component:f(Vsn,{})})}),f(ge,{path:"import",element:f(vn,{guards:[rr(Xn.Expenses),si(Rt("create_expense"),Rt("edit_expense"))],component:f(Hsn,{})})}),f(ge,{path:"create",element:f(vn,{guards:[rr(Xn.Expenses),Rt("create_expense")],component:f(Wsn,{})})}),N(ge,{path:":id",element:f(vn,{guards:[rr(Xn.Expenses),si(Rt("view_expense"),Rt("edit_expense"),Ys("/api/v1/expenses/:id"))],component:f(zsn,{})}),children:[f(ge,{path:"edit",element:f(jsn,{})}),f(ge,{path:"documents",element:f(Usn,{})})]})]}),Ksn=w.lazy(()=>X(()=>import("./bundle114.js"),["bundle114.js","bundle396.js","bundle445.js","bundle405.js"])),Gsn=w.lazy(()=>X(()=>import("./bundle115.js"),["bundle115.js","bundle415.js","bundle418.js","bundle450.js","bundle421.js","bundle422.js","bundle420.js"])),Ysn=w.lazy(()=>X(()=>import("./bundle116.js"),["bundle116.js","bundle419.js","bundle418.js"])),Qsn=w.lazy(()=>X(()=>import("./bundle117.js"),["bundle117.js","bundle418.js"])),Xsn=w.lazy(()=>X(()=>import("./bundle118.js"),["bundle118.js","bundle415.js","bundle418.js","bundle450.js","bundle421.js","bundle422.js","bundle420.js","bundle412.js"])),Zsn=N(ge,{path:"/purchase_orders",children:[f(ge,{path:"",element:f(vn,{guards:[rr(Xn.PurchaseOrders),si(Rt("view_purchase_order"),Rt("create_purchase_order"),Rt("edit_purchase_order"))],component:f(Ksn,{})})}),f(ge,{path:":id",element:f(vn,{guards:[rr(Xn.PurchaseOrders),si(Rt("view_purchase_order"),Rt("edit_purchase_order"),Ys("/api/v1/purchase_orders/:id"))],component:f(ah,{})}),children:f(ge,{path:"edit",element:f(Gsn,{})})}),N(ge,{path:":id",element:f(vn,{guards:[rr(Xn.PurchaseOrders),si(Rt("edit_purchase_order"),Ys("/api/v1/purchase_orders/:id"))],component:f(ah,{})}),children:[f(ge,{path:"email",element:f(Ysn,{})}),f(ge,{path:"pdf",element:f(Qsn,{})})]}),f(ge,{path:"create",element:f(vn,{guards:[rr(Xn.PurchaseOrders),Rt("create_purchase_order")],component:f(Xsn,{})})})]}),Jsn=w.lazy(()=>X(()=>Promise.resolve().then(()=>cen),void 0)),ean=f(ge,{path:"/reports",element:f(vn,{guards:[Rt("view_reports")],component:f(Jsn,{})})}),tan=w.lazy(()=>X(()=>import("./bundle119.js"),["bundle119.js","bundle451.js","bundle452.js","bundle397.js","bundle406.js","bundle404.js","bundle409.js","bundle399.js"])),nan=w.lazy(()=>X(()=>import("./bundle120.js"),["bundle120.js","bundle451.js","bundle448.js","bundle453.js"])),ian=w.lazy(()=>X(()=>import("./bundle121.js"),[])),ran=w.lazy(()=>X(()=>import("./bundle122.js"),["bundle122.js","bundle448.js","bundle453.js","bundle451.js","bundle452.js"])),oan=N(ge,{path:"transactions",children:[f(ge,{path:"",element:f(vn,{guards:[rr(Xn.Transactions),si(Rt("view_bank_transaction"),Rt("create_bank_transaction"),Rt("edit_bank_transaction"))],component:f(tan,{})})}),f(ge,{path:"create",element:f(vn,{guards:[rr(Xn.Transactions),si(Rt("create_bank_transaction"))],component:f(nan,{})})}),f(ge,{path:"import",element:f(vn,{guards:[rr(Xn.Transactions),si(Rt("create_bank_transaction"),Rt("edit_bank_transaction"))],component:f(ian,{})})}),f(ge,{path:":id/edit",element:f(vn,{guards:[rr(Xn.Transactions),si(Rt("view_bank_transaction"),Rt("edit_bank_transaction"),Ys("/api/v1/bank_transactions/:id"))],component:f(ran,{})})})]}),san=w.lazy(()=>X(()=>import("./bundle123.js"),["bundle123.js","bundle434.js"])),aan=w.lazy(()=>X(()=>import("./bundle124.js"),["bundle124.js","bundle396.js","bundle434.js"])),lan=w.lazy(()=>X(()=>import("./bundle125.js"),["bundle125.js","bundle454.js","bundle420.js","bundle434.js","bundle417.js","bundle447.js","bundle448.js"])),can=w.lazy(()=>X(()=>import("./bundle126.js"),["bundle126.js","bundle434.js","bundle454.js","bundle420.js","bundle417.js","bundle447.js","bundle448.js"])),uan=w.lazy(()=>X(()=>import("./bundle127.js"),[])),dan=N(ge,{path:"/recurring_expenses",children:[f(ge,{path:"",element:f(vn,{guards:[rr(Xn.RecurringExpenses),si(Rt("view_recurring_expense"),Rt("create_recurring_expense"),Rt("edit_recurring_expense"))],component:f(aan,{})})}),f(ge,{path:"create",element:f(vn,{guards:[rr(Xn.RecurringExpenses),Rt("create_recurring_expense")],component:f(lan,{})})}),N(ge,{path:":id",element:f(vn,{guards:[rr(Xn.RecurringExpenses),si(Rt("view_recurring_expense"),Rt("edit_recurring_expense"),Ys("/api/v1/recurring_expenses/:id"))],component:f(san,{})}),children:[f(ge,{path:"edit",element:f(can,{})}),f(ge,{path:"documents",element:f(uan,{})})]})]});function han(){return Vde()?f(aD,{to:"/dashboard"}):f(aD,{to:"/login"})}function fan(){return f(ah,{})}function gan(){const[n]=ue(),[e,t]=w.useState(!1),[i,r]=w.useState("");return f("div",{className:"flex items-center w-full h-full justify-center",children:N("div",{className:"mt-96",children:[f(IHe,{isModalOpen:e,setIsModalOpen:t,onClientCreated:o=>r(o.id)}),f(Qd,{inputOptions:{value:i??null},endpoint:ye("/api/v1/clients?status=active"),entryOptions:{id:"id",label:"name",value:"id"},onChange:o=>o.resource&&r(o.resource.id),onDismiss:()=>r(""),action:{label:n("new_client"),onClick:()=>t(!0),visible:!0}})]})})}const pan=w.lazy(()=>X(()=>import("./bundle128.js"),["bundle128.js","bundle418.js"])),man=f(ge,{children:f(ge,{path:"/activities/:id",element:f(pan,{})})}),_an=w.lazy(()=>X(()=>import("./bundle129.js"),[])),van=w.lazy(()=>X(()=>import("./bundle130.js"),[])),ban=N(Fft,{children:[f(ge,{path:"/",element:f(han,{})}),isn,N(ge,{element:f(B8e,{}),children:[f(ge,{path:"/dashboard",element:f(vn,{guards:[Rt("view_dashboard")],component:f(_an,{})})}),e9t,v9t,k9t,R9t,V9t,usn,msn,wsn,Dsn,$sn,Zsn,qsn,dan,ean,oan,Mon,man,f(ge,{element:f(fan,{}),children:f(ge,{path:"/testing",element:f(gan,{})})})]}),f(ge,{path:"*",element:f(van,{})})]});function yan(){return n=>{switch(n.replace("_","-").toLowerCase()){case"af":return X(()=>import("./bundle131.js").then(t=>t.a),[]);case"am":return X(()=>import("./bundle132.js").then(t=>t.a),[]);case"ar-dz":return X(()=>import("./bundle133.js").then(t=>t.a),[]);case"ar-iq":return X(()=>import("./bundle134.js").then(t=>t.a),[]);case"ar-kw":return X(()=>import("./bundle135.js").then(t=>t.a),[]);case"ar-ly":return X(()=>import("./bundle136.js").then(t=>t.a),[]);case"ar-ma":return X(()=>import("./bundle137.js").then(t=>t.a),[]);case"ar-sa":return X(()=>import("./bundle138.js").then(t=>t.a),[]);case"ar-tn":return X(()=>import("./bundle139.js").then(t=>t.a),[]);case"ar":return X(()=>import("./bundle140.js").then(t=>t.a),[]);case"az":return X(()=>import("./bundle141.js").then(t=>t.a),[]);case"be":return X(()=>import("./bundle142.js").then(t=>t.b),[]);case"bg":return X(()=>import("./bundle143.js").then(t=>t.b),[]);case"bi":return X(()=>import("./bundle144.js").then(t=>t.b),[]);case"bm":return X(()=>import("./bundle145.js").then(t=>t.b),[]);case"bn-bd":return X(()=>import("./bundle146.js").then(t=>t.b),[]);case"bn":return X(()=>import("./bundle147.js").then(t=>t.b),[]);case"bo":return X(()=>import("./bundle148.js").then(t=>t.b),[]);case"br":return X(()=>import("./bundle149.js").then(t=>t.b),[]);case"bs":return X(()=>import("./bundle150.js").then(t=>t.b),[]);case"ca":return X(()=>import("./bundle151.js").then(t=>t.c),[]);case"cs":return X(()=>import("./bundle152.js").then(t=>t.c),[]);case"cv":return X(()=>import("./bundle153.js").then(t=>t.c),[]);case"cy":return X(()=>import("./bundle154.js").then(t=>t.c),[]);case"da":return X(()=>import("./bundle155.js").then(t=>t.d),[]);case"de-at":return X(()=>import("./bundle156.js").then(t=>t.d),[]);case"de-ch":return X(()=>import("./bundle157.js").then(t=>t.d),[]);case"de":return X(()=>import("./bundle158.js").then(t=>t.d),[]);case"dv":return X(()=>import("./bundle159.js").then(t=>t.d),[]);case"el":return X(()=>import("./bundle160.js").then(t=>t.e),[]);case"en-au":return X(()=>import("./bundle161.js").then(t=>t.e),[]);case"en-ca":return X(()=>import("./bundle162.js").then(t=>t.e),[]);case"en-gb":return X(()=>import("./bundle163.js").then(t=>t.e),[]);case"en-ie":return X(()=>import("./bundle164.js").then(t=>t.e),[]);case"en-il":return X(()=>import("./bundle165.js").then(t=>t.e),[]);case"en-in":return X(()=>import("./bundle166.js").then(t=>t.e),[]);case"en-nz":return X(()=>import("./bundle167.js").then(t=>t.e),[]);case"en-sg":return X(()=>import("./bundle168.js").then(t=>t.e),[]);case"en-tt":return X(()=>import("./bundle169.js").then(t=>t.e),[]);case"en":return X(()=>import("./bundle170.js").then(t=>t.e),[]);case"eo":return X(()=>import("./bundle171.js").then(t=>t.e),[]);case"es-do":return X(()=>import("./bundle172.js").then(t=>t.e),[]);case"es-mx":return X(()=>import("./bundle173.js").then(t=>t.e),[]);case"es-pr":return X(()=>import("./bundle174.js").then(t=>t.e),[]);case"es-us":return X(()=>import("./bundle175.js").then(t=>t.e),[]);case"es":return X(()=>import("./bundle176.js").then(t=>t.e),[]);case"et":return X(()=>import("./bundle177.js").then(t=>t.e),[]);case"eu":return X(()=>import("./bundle178.js").then(t=>t.e),[]);case"fa":return X(()=>import("./bundle179.js").then(t=>t.f),[]);case"fi":return X(()=>import("./bundle180.js").then(t=>t.f),[]);case"fo":return X(()=>import("./bundle181.js").then(t=>t.f),[]);case"fr-ca":return X(()=>import("./bundle182.js").then(t=>t.f),[]);case"fr-ch":return X(()=>import("./bundle183.js").then(t=>t.f),[]);case"fr":return X(()=>import("./bundle184.js").then(t=>t.f),[]);case"fy":return X(()=>import("./bundle185.js").then(t=>t.f),[]);case"ga":return X(()=>import("./bundle186.js").then(t=>t.g),[]);case"gd":return X(()=>import("./bundle187.js").then(t=>t.g),[]);case"gl":return X(()=>import("./bundle188.js").then(t=>t.g),[]);case"gom-latn":return X(()=>import("./bundle189.js").then(t=>t.g),[]);case"gu":return X(()=>import("./bundle190.js").then(t=>t.g),[]);case"he":return X(()=>import("./bundle191.js").then(t=>t.h),[]);case"hi":return X(()=>import("./bundle192.js").then(t=>t.h),[]);case"hr":return X(()=>import("./bundle193.js").then(t=>t.h),[]);case"hu":return X(()=>import("./bundle194.js").then(t=>t.h),[]);case"hy-am":return X(()=>import("./bundle195.js").then(t=>t.h),[]);case"id":return X(()=>import("./bundle196.js").then(t=>t.i),[]);case"is":return X(()=>import("./bundle197.js").then(t=>t.i),[]);case"it":return X(()=>import("./bundle198.js").then(t=>t.i),[]);case"ja":return X(()=>import("./bundle199.js").then(t=>t.j),[]);case"jv":return X(()=>import("./bundle200.js").then(t=>t.j),[]);case"ka":return X(()=>import("./bundle201.js").then(t=>t.k),[]);case"kk":return X(()=>import("./bundle202.js").then(t=>t.k),[]);case"km":return X(()=>import("./bundle203.js").then(t=>t.k),[]);case"kn":return X(()=>import("./bundle204.js").then(t=>t.k),[]);case"ko":return X(()=>import("./bundle205.js").then(t=>t.k),[]);case"ku":return X(()=>import("./bundle206.js").then(t=>t.k),[]);case"ky":return X(()=>import("./bundle207.js").then(t=>t.k),[]);case"lb":return X(()=>import("./bundle208.js").then(t=>t.l),[]);case"lo":return X(()=>import("./bundle209.js").then(t=>t.l),[]);case"lt":return X(()=>import("./bundle210.js").then(t=>t.l),[]);case"lv":return X(()=>import("./bundle211.js").then(t=>t.l),[]);case"me":return X(()=>import("./bundle212.js").then(t=>t.m),[]);case"mi":return X(()=>import("./bundle213.js").then(t=>t.m),[]);case"mk":return X(()=>import("./bundle214.js").then(t=>t.m),[]);case"ml":return X(()=>import("./bundle215.js").then(t=>t.m),[]);case"mn":return X(()=>import("./bundle216.js").then(t=>t.m),[]);case"mr":return X(()=>import("./bundle217.js").then(t=>t.m),[]);case"ms-my":return X(()=>import("./bundle218.js").then(t=>t.m),[]);case"ms":return X(()=>import("./bundle219.js").then(t=>t.m),[]);case"mt":return X(()=>import("./bundle220.js").then(t=>t.m),[]);case"my":return X(()=>import("./bundle221.js").then(t=>t.m),[]);case"nb":return X(()=>import("./bundle222.js").then(t=>t.n),[]);case"ne":return X(()=>import("./bundle223.js").then(t=>t.n),[]);case"nl-be":return X(()=>import("./bundle224.js").then(t=>t.n),[]);case"nl":return X(()=>import("./bundle225.js").then(t=>t.n),[]);case"nn":return X(()=>import("./bundle226.js").then(t=>t.n),[]);case"oc-lnc":return X(()=>import("./bundle227.js").then(t=>t.o),[]);case"pa-in":return X(()=>import("./bundle228.js").then(t=>t.p),[]);case"pl":return X(()=>import("./bundle229.js").then(t=>t.p),[]);case"pt-br":return X(()=>import("./bundle230.js").then(t=>t.p),[]);case"pt":return X(()=>import("./bundle231.js").then(t=>t.p),[]);case"rn":return X(()=>import("./bundle232.js").then(t=>t.r),[]);case"ro":return X(()=>import("./bundle233.js").then(t=>t.r),[]);case"ru":return X(()=>import("./bundle234.js").then(t=>t.r),[]);case"rw":return X(()=>import("./bundle235.js").then(t=>t.r),[]);case"sd":return X(()=>import("./bundle236.js").then(t=>t.s),[]);case"se":return X(()=>import("./bundle237.js").then(t=>t.s),[]);case"si":return X(()=>import("./bundle238.js").then(t=>t.s),[]);case"sk":return X(()=>import("./bundle239.js").then(t=>t.s),[]);case"sl":return X(()=>import("./bundle240.js").then(t=>t.s),[]);case"sq":return X(()=>import("./bundle241.js").then(t=>t.s),[]);case"sr-cyrl":return X(()=>import("./bundle242.js").then(t=>t.s),[]);case"sr":return X(()=>import("./bundle243.js").then(t=>t.s),[]);case"ss":return X(()=>import("./bundle244.js").then(t=>t.s),[]);case"sv-fi":return X(()=>import("./bundle245.js").then(t=>t.s),[]);case"sv":return X(()=>import("./bundle246.js").then(t=>t.s),[]);case"sw":return X(()=>import("./bundle247.js").then(t=>t.s),[]);case"ta":return X(()=>import("./bundle248.js").then(t=>t.t),[]);case"te":return X(()=>import("./bundle249.js").then(t=>t.t),[]);case"tet":return X(()=>import("./bundle250.js").then(t=>t.t),[]);case"tg":return X(()=>import("./bundle251.js").then(t=>t.t),[]);case"th":return X(()=>import("./bundle252.js").then(t=>t.t),[]);case"tk":return X(()=>import("./bundle253.js").then(t=>t.t),[]);case"tl-ph":return X(()=>import("./bundle254.js").then(t=>t.t),[]);case"tlh":return X(()=>import("./bundle255.js").then(t=>t.t),[]);case"tr":return X(()=>import("./bundle256.js").then(t=>t.t),[]);case"tzl":return X(()=>import("./bundle257.js").then(t=>t.t),[]);case"tzm-latn":return X(()=>import("./bundle258.js").then(t=>t.t),[]);case"tzm":return X(()=>import("./bundle259.js").then(t=>t.t),[]);case"ug-cn":return X(()=>import("./bundle260.js").then(t=>t.u),[]);case"uk":return X(()=>import("./bundle261.js").then(t=>t.u),[]);case"ur":return X(()=>import("./bundle262.js").then(t=>t.u),[]);case"uz-latn":return X(()=>import("./bundle263.js").then(t=>t.u),[]);case"uz":return X(()=>import("./bundle264.js").then(t=>t.u),[]);case"vi":return X(()=>import("./bundle265.js").then(t=>t.v),[]);case"x-pseudo":return X(()=>import("./bundle266.js").then(t=>t.x),[]);case"yo":return X(()=>import("./bundle267.js").then(t=>t.y),[]);case"zh-cn":return X(()=>import("./bundle268.js").then(t=>t.z),[]);case"zh-hk":return X(()=>import("./bundle269.js").then(t=>t.z),[]);case"zh-tw":return X(()=>import("./bundle270.js").then(t=>t.z),[]);case"zh":return X(()=>import("./bundle271.js").then(t=>t.z),[]);default:return X(()=>import("./bundle170.js").then(t=>t.e),[])}}}function Can(){return n=>{switch(n){case"en":return X(()=>import("./bundle272.js").then(e=>e.e),["bundle272.js","bundle393.js"]);case"it":return X(()=>import("./bundle273.js").then(e=>e.i),["bundle273.js","bundle393.js"]);case"de":return X(()=>import("./bundle274.js").then(e=>e.d),["bundle274.js","bundle393.js"]);case"fr":return X(()=>import("./bundle275.js").then(e=>e.f),["bundle275.js","bundle393.js"]);case"pt_BR":return X(()=>import("./bundle276.js").then(e=>e.p),["bundle276.js","bundle393.js"]);case"nl":return X(()=>import("./bundle277.js").then(e=>e.n),["bundle277.js","bundle393.js"]);case"es":return X(()=>import("./bundle278.js").then(e=>e.e),["bundle278.js","bundle393.js"]);case"nb_NO":return X(()=>import("./bundle279.js").then(e=>e.n),["bundle279.js","bundle393.js"]);case"da":return X(()=>import("./bundle280.js").then(e=>e.d),["bundle280.js","bundle393.js"]);case"ja":return X(()=>import("./bundle281.js").then(e=>e.j),["bundle281.js","bundle393.js"]);case"sv":return X(()=>import("./bundle282.js").then(e=>e.s),["bundle282.js","bundle393.js"]);case"es_ES":return X(()=>import("./bundle278.js").then(e=>e.e),["bundle278.js","bundle393.js"]);case"fr_CA":return X(()=>import("./bundle283.js").then(e=>e.f),["bundle283.js","bundle393.js"]);case"lt":return X(()=>import("./bundle284.js").then(e=>e.l),["bundle284.js","bundle393.js"]);case"pl":return X(()=>import("./bundle285.js").then(e=>e.p),["bundle285.js","bundle393.js"]);case"cs":return X(()=>import("./bundle286.js").then(e=>e.c),["bundle286.js","bundle393.js"]);case"hr":return X(()=>import("./bundle287.js").then(e=>e.h),["bundle287.js","bundle393.js"]);case"sq":return X(()=>import("./bundle272.js").then(e=>e.e),["bundle272.js","bundle393.js"]);case"el":return X(()=>import("./bundle288.js").then(e=>e.e),["bundle288.js","bundle393.js"]);case"en_GB":return X(()=>import("./bundle289.js").then(e=>e.e),["bundle289.js","bundle393.js"]);case"pt_PT":return X(()=>import("./bundle290.js").then(e=>e.p),["bundle290.js","bundle393.js"]);case"sl":return X(()=>import("./bundle291.js").then(e=>e.s),["bundle291.js","bundle393.js"]);case"fi":return X(()=>import("./bundle292.js").then(e=>e.f),["bundle292.js","bundle393.js"]);case"ro":return X(()=>import("./bundle293.js").then(e=>e.r),["bundle293.js","bundle393.js"]);case"tr_TR":return X(()=>import("./bundle294.js").then(e=>e.t),["bundle294.js","bundle393.js"]);case"th":return X(()=>import("./bundle295.js").then(e=>e.t),["bundle295.js","bundle393.js"]);case"mk_MK":return X(()=>import("./bundle296.js").then(e=>e.m),["bundle296.js","bundle393.js"]);case"zh_TW":return X(()=>import("./bundle297.js").then(e=>e.z),["bundle297.js","bundle393.js"]);case"ru_RU":return X(()=>import("./bundle298.js").then(e=>e.r),["bundle298.js","bundle393.js"]);case"ar":return X(()=>import("./bundle299.js").then(e=>e.a),["bundle299.js","bundle393.js"]);case"fa":return X(()=>import("./bundle300.js").then(e=>e.f),["bundle300.js","bundle393.js"]);case"lv_LV":return X(()=>import("./bundle301.js").then(e=>e.l),["bundle301.js","bundle393.js"]);case"sr":return X(()=>import("./bundle302.js").then(e=>e.s),["bundle302.js","bundle393.js"]);case"sk":return X(()=>import("./bundle303.js").then(e=>e.s),["bundle303.js","bundle393.js"]);case"et":return X(()=>import("./bundle304.js").then(e=>e.e),["bundle304.js","bundle393.js"]);case"bg":return X(()=>import("./bundle305.js").then(e=>e.b),["bundle305.js","bundle393.js"]);case"he":return X(()=>import("./bundle306.js").then(e=>e.h),["bundle306.js","bundle393.js"]);case"km_KH":return X(()=>import("./bundle307.js").then(e=>e.k),["bundle307.js","bundle393.js"]);case"hu":return X(()=>import("./bundle308.js").then(e=>e.h),["bundle308.js","bundle393.js"]);case"fr_CH":return X(()=>import("./bundle275.js").then(e=>e.f),["bundle275.js","bundle393.js"]);default:return X(()=>import("./bundle272.js").then(e=>e.e),["bundle272.js","bundle393.js"])}}}const hIe=Ea.div`
&:hover {
background-color: ${n=>n.theme.hoverColor};
}:
`;function wan(n){var b,y,C,x,k;const[e]=ue(),t=ri(),i=Ci(),r=Vn(),o=vi(),s=bc(),[a,l]=w.useState(),[c,u]=w.useState(!1),[d,h]=w.useState(0),g=Fo(),p=I=>{g("settings.name",I);const L=I.split("").filter(D=>/[a-zA-Z]/.test(D)).join("").toLowerCase();g("subdomain",L)},m=I=>{Te("PUT",ye("/api/v1/companies/:id",{id:s==null?void 0:s.id}),s).then(L=>{ie.success("updated_company"),I?h(D=>D+1):n.setIsModalOpen(!1),i(Pw({object:"company",data:L.data.data}))}).catch(L=>{var D;((D=L.response)==null?void 0:D.status)===422&&(l(L.response.data),ie.dismiss())}).finally(()=>u(!1))},_=I=>{ie.processing(),Te("POST",ye("/api/v1/one_time_token"),{context:I}).then(L=>{var R;let D="stripe/signup/:token";I==="paypal_ppcp"&&(D="paypal?hash=:token"),(R=window.open(dt(`https://invoicing.co/${D}`,{token:L.data.hash}),"_blank"))==null||R.focus(),ie.dismiss()})},v=async I=>{if(!c){if(Bn.isEqual(o,s)){I?h(L=>L+1):n.setIsModalOpen(!1);return}ie.processing(),l(void 0),u(!0),s!=null&&s.subdomain&&Yo()?Te("POST",ye("/api/v1/check_subdomain"),{subdomain:s.subdomain}).then(()=>m(I)).finally(()=>u(!1)):m(I)}};return f(cr,{title:d!==1?e(d===0?"welcome_to_invoice_ninja":"accept_payments_online"):"",visible:n.isModalOpen,onClose:()=>{n.setIsModalOpen(!1),l(void 0)},backgroundColor:"white",overflowVisible:!0,children:N("div",{className:"flex flex-col space-y-6",children:[d===0&&N("div",{className:"flex flex-col space-y-4",children:[f(ke,{label:e("company_name"),value:(b=s==null?void 0:s.settings)==null?void 0:b.name,onValueChange:I=>p(I),errorMessage:(y=a==null?void 0:a.errors)==null?void 0:y.name,changeOverride:!0}),Yo(),f(Y3,{label:e("language"),value:((C=s==null?void 0:s.settings)==null?void 0:C.language_id)||"",onChange:I=>g("settings.language_id",I),errorMessage:(x=a==null?void 0:a.errors)==null?void 0:x.language_id}),f(ND,{label:e("currency"),value:((k=s==null?void 0:s.settings)==null?void 0:k.currency_id)||"",onChange:I=>g("settings.currency_id",I)})]}),d===1&&f(JWe,{isSettingsPage:!1}),d===2&&N("div",{className:"flex flex-col items-center",children:[f(hIe,{className:"flex w-full justify-center h-28 cursor-pointer",theme:{hoverColor:r.$5},onClick:()=>_("stripe_connect"),children:f(Ere,{name:"stripe",style:{width:"64%"}})}),f(hIe,{className:"flex w-full justify-center h-28 cursor-pointer",theme:{hoverColor:r.$5},onClick:()=>_("paypal_ppcp"),children:f(Ere,{name:"paypal_ppcp",style:{width:"38%",transform:"scale(1.7)",pointerEvents:"none"}})}),f(Ut,{behavior:"button",className:"w-full mt-4",onClick:()=>{n.setIsModalOpen(!1),t("/settings/gateways/create")},children:e("all_payment_gateways")})]}),f("div",{className:"flex justify-end",children:(d!==2||t3())&&f(Ut,{behavior:"button",onClick:()=>{d===0&&v(Yo()),d!==0&&h(I=>I+1)},children:e("save")})})]})})}function San(){const[n]=ue(),e=ri(),t=ol(),[i,r]=Mo(EFe),o=ki(xFe),[s,a]=Mo(b3),[l,c]=Mo(hfe),[u,d]=w.useState(!1),{nonPreventedLocations:h}=i,g=()=>{const m=s.actionKey==="browserBack",{url:_,externalLink:v,fn:b}=o||{};v||(r(x=>({...x,lastLocation:""})),a({prevent:!1,actionKey:void 0}));const y=h.length;let C=h[y-1];C=C!==t.pathname?C:h[y-2],m&&C&&e(C),o&&(_&&(v?window.open(_,"_blank"):e(_)),b==null||b()),c(!1)},p=()=>{const m=s.actionKey==="browserBack";a(_=>_&&{..._,actionKey:_.actionKey!=="browserBack"?void 0:"browserBack"}),c(!1),m&&history.pushState(null,document.title,window.location.href)};return w.useEffect(()=>{d(l)},[l]),f(cr,{visible:u,onClose:()=>{},disableClosing:!0,children:N("div",{className:"flex flex-col space-y-8",children:[f("span",{className:"font-medium text-lg text-center",children:n("error_unsaved_changes")}),N("div",{className:"flex justify-between",children:[f(Ut,{type:"secondary",onClick:p,children:n("continue_editing")}),f(Ut,{onClick:g,children:n("discard_changes")})]})]})})}function Ean(){const[n]=ue(),{isOwner:e}=ao(),{i18n:t}=ue(),i=Tl(L=>L.settings.darkMode),r=ri(),{id:o}=Fa(),s=ha(),a=ol(),l=vi();mwt();const c=T4e(),u=zo(),d=D4e(),h=Can(),g=yan(),p=$8e(),m=ki(V3e),_=Ri(Ape),v=Ri(FCt),{isCompanySettingsActive:b,isGroupSettingsActive:y}=Ms(),[C,x]=w.useState(!1),k=l?d(s!=null&&s.language_id&&s.language_id.length>0?s.language_id:l.settings.language_id):void 0,I=L=>{var D,R;if(!o&&!a.pathname.startsWith("/settings")){const{error:P}=L.detail;if(P.response.data.errors){const M=P.response.data.errors||{},O=(D=Object.keys(M))==null?void 0:D[0],B=(R=M==null?void 0:M[O])==null?void 0:R[0];B&&ie.error(B)}}};return w.useEffect(()=>{document.body.style.backgroundColor=m.$2,document.body.style.colorScheme=m.$0},[m]),w.useEffect(()=>{k!=null&&k.locale&&(g(k.locale).then(L=>{v(L),Cn.locale(L)}),h(k.locale).then(L=>{_(L)}),t.hasResourceBundle(k.locale,"translation")?t.changeLanguage(k.locale):fetch(new URL(Object.assign({"/src/resources/lang/ar/ar.json":wot,"/src/resources/lang/bg/bg.json":Sot,"/src/resources/lang/ca/ca.json":Eot,"/src/resources/lang/cs/cs.json":xot,"/src/resources/lang/da/da.json":kot,"/src/resources/lang/de/de.json":Tot,"/src/resources/lang/el/el.json":Iot,"/src/resources/lang/en/en.json":Lot,"/src/resources/lang/en_GB/en_GB.json":Dot,"/src/resources/lang/es/es.json":Aot,"/src/resources/lang/es_ES/es_ES.json":Rot,"/src/resources/lang/et/et.json":Not,"/src/resources/lang/fa/fa.json":Oot,"/src/resources/lang/fi/fi.json":Pot,"/src/resources/lang/fr/fr.json":Mot,"/src/resources/lang/fr_CA/fr_CA.json":Fot,"/src/resources/lang/fr_CH/fr_CH.json":Bot,"/src/resources/lang/he/he.json":$ot,"/src/resources/lang/hr/hr.json":Vot,"/src/resources/lang/hu/hu.json":Hot,"/src/resources/lang/it/it.json":Wot,"/src/resources/lang/ja/ja.json":zot,"/src/resources/lang/km_KH/km_KH.json":jot,"/src/resources/lang/lo_LA/lo_LA.json":Uot,"/src/resources/lang/lt/lt.json":qot,"/src/resources/lang/lv_LV/lv_LV.json":Kot,"/src/resources/lang/mk_MK/mk_MK.json":Got,"/src/resources/lang/nb_NO/nb_NO.json":Yot,"/src/resources/lang/nl/nl.json":Qot,"/src/resources/lang/pl/pl.json":Xot,"/src/resources/lang/pt_BR/pt_BR.json":Zot,"/src/resources/lang/pt_PT/pt_PT.json":Jot,"/src/resources/lang/ro/ro.json":est,"/src/resources/lang/ru_RU/ru_RU.json":tst,"/src/resources/lang/sk/sk.json":nst,"/src/resources/lang/sl/sl.json":ist,"/src/resources/lang/sq/sq.json":rst,"/src/resources/lang/sr/sr.json":ost,"/src/resources/lang/sv/sv.json":sst,"/src/resources/lang/th/th.json":ast,"/src/resources/lang/tr_TR/tr_TR.json":lst,"/src/resources/lang/zh_TW/zh_TW.json":cst})[`/src/resources/lang/${k.locale}/${k.locale}.json`],self.location).href).then(L=>L.json()).then(L=>{t.addResources(k.locale,"translation",L),t.changeLanguage(k.locale)}))},[i,k]),w.useEffect(()=>{window.addEventListener("navigate.invalid.page",()=>r("/not_found")),window.addEventListener("refetch",L=>{const{property:D}=L.detail;c(D)})},[]),w.useEffect(()=>(window.removeEventListener("display.error.toaster",I),window.addEventListener("display.error.toaster",I),()=>{window.removeEventListener("display.error.toaster",I)}),[o,a]),w.useEffect(()=>{var D;const L=(D=l==null?void 0:l.settings)==null?void 0:D.name;l&&(!L||L===n("untitled_company"))&&localStorage.getItem("COMPANY-EDIT-OPENED")!=="true"&&(localStorage.setItem("COMPANY-EDIT-OPENED","true"),x(!0))},[l]),w.useEffect(()=>{!a.pathname.startsWith("/settings")&&!b&&p(),a.pathname.startsWith("/settings/group_settings")&&y&&r("/settings/company_details")},[a]),w.useEffect(()=>{s&&Object.keys(s).length&&a.pathname.endsWith("/dashboard")&&!u("view_dashboard")&&r("/settings/user_details")},[a,s]),N(_t,{children:[N("div",{className:"App",children:[f(Qdt,{position:"top-center"}),ban]}),f(wan,{isModalOpen:C&&e,setIsModalOpen:x}),f(San,{})]})}const mze=Object.prototype.toString;function _ze(n){switch(mze.call(n)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return m0(n,Error)}}function mA(n,e){return mze.call(n)===`[object ${e}]`}function Zpe(n){return mA(n,"ErrorEvent")}function fIe(n){return mA(n,"DOMError")}function xan(n){return mA(n,"DOMException")}function iw(n){return mA(n,"String")}function vze(n){return n===null||typeof n!="object"&&typeof n!="function"}function BD(n){return mA(n,"Object")}function uU(n){return typeof Event<"u"&&m0(n,Event)}function kan(n){return typeof Element<"u"&&m0(n,Element)}function Tan(n){return mA(n,"RegExp")}function Jpe(n){return!!(n&&n.then&&typeof n.then=="function")}function Ian(n){return BD(n)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n}function bze(n){return typeof n=="number"&&n!==n}function m0(n,e){try{return n instanceof e}catch{return!1}}function yze(n){return!!(typeof n=="object"&&n!==null&&(n.__isVue||n._isVue))}function CL(n,e=0){return typeof n!="string"||e===0||n.length<=e?n:`${n.slice(0,e)}...`}function gIe(n,e){if(!Array.isArray(n))return"";const t=[];for(let i=0;i<n.length;i++){const r=n[i];try{yze(r)?t.push("[VueViewModel]"):t.push(String(r))}catch{t.push("[value cannot be serialized]")}}return t.join(e)}function Lan(n,e,t=!1){return iw(n)?Tan(e)?e.test(n):iw(e)?t?n===e:n.includes(e):!1:!1}function i5(n,e=[],t=!1){return e.some(i=>Lan(n,i,t))}function Dan(n,e,t=250,i,r,o,s){if(!o.exception||!o.exception.values||!s||!m0(s.originalException,Error))return;const a=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;a&&(o.exception.values=Aan(kre(n,e,r,s.originalException,i,o.exception.values,a,0),t))}function kre(n,e,t,i,r,o,s,a){if(o.length>=t+1)return o;let l=[...o];if(m0(i[r],Error)){pIe(s,a);const c=n(e,i[r]),u=l.length;mIe(c,r,u,a),l=kre(n,e,t,i[r],r,[c,...l],c,u)}return Array.isArray(i.errors)&&i.errors.forEach((c,u)=>{if(m0(c,Error)){pIe(s,a);const d=n(e,c),h=l.length;mIe(d,`errors[${u}]`,h,a),l=kre(n,e,t,c,r,[d,...l],d,h)}}),l}function pIe(n,e){n.mechanism=n.mechanism||{type:"generic",handled:!0},n.mechanism={...n.mechanism,is_exception_group:!0,exception_id:e}}function mIe(n,e,t,i){n.mechanism=n.mechanism||{type:"generic",handled:!0},n.mechanism={...n.mechanism,type:"chained",source:e,exception_id:t,parent_id:i}}function Aan(n,e){return n.map(t=>(t.value&&(t.value=CL(t.value,e)),t))}function rB(n){return n&&n.Math==Math?n:void 0}const Oc=typeof globalThis=="object"&&rB(globalThis)||typeof window=="object"&&rB(window)||typeof self=="object"&&rB(self)||typeof global=="object"&&rB(global)||function(){return this}()||{};function r5(){return Oc}function Cze(n,e,t){const i=t||Oc,r=i.__SENTRY__=i.__SENTRY__||{};return r[n]||(r[n]=e())}const y8=r5(),Ran=80;function $D(n,e={}){if(!n)return"<unknown>";try{let t=n;const i=5,r=[];let o=0,s=0;const a=" > ",l=a.length;let c;const u=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||Ran;for(;t&&o++<i&&(c=Nan(t,u),!(c==="html"||o>1&&s+r.length*l+c.length>=d));)r.push(c),s+=c.length,t=t.parentNode;return r.reverse().join(a)}catch{return"<unknown>"}}function Nan(n,e){const t=n,i=[];let r,o,s,a,l;if(!t||!t.tagName)return"";i.push(t.tagName.toLowerCase());const c=e&&e.length?e.filter(d=>t.getAttribute(d)).map(d=>[d,t.getAttribute(d)]):null;if(c&&c.length)c.forEach(d=>{i.push(`[${d[0]}="${d[1]}"]`)});else if(t.id&&i.push(`#${t.id}`),r=t.className,r&&iw(r))for(o=r.split(/\s+/),l=0;l<o.length;l++)i.push(`.${o[l]}`);const u=["aria-label","type","name","title","alt"];for(l=0;l<u.length;l++)s=u[l],a=t.getAttribute(s),a&&i.push(`[${s}="${a}"]`);return i.join("")}function Oan(){try{return y8.document.location.href}catch{return""}}function Pan(n){return y8.document&&y8.document.querySelector?y8.document.querySelector(n):null}const Man="Sentry Logger ",Tre=["debug","info","warn","error","log","assert","trace"],gV={};function wze(n){if(!("console"in Oc))return n();const e=Oc.console,t={},i=Object.keys(gV);i.forEach(r=>{const o=gV[r];t[r]=e[r],e[r]=o});try{return n()}finally{i.forEach(r=>{e[r]=t[r]})}}function Fan(){let n=!1;const e={enable:()=>{n=!0},disable:()=>{n=!1},isEnabled:()=>n};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?Tre.forEach(t=>{e[t]=(...i)=>{n&&wze(()=>{Oc.console[t](`${Man}[${t}]:`,...i)})}}):Tre.forEach(t=>{e[t]=()=>{}}),e}const pn=Fan(),Ban=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function $an(n){return n==="http"||n==="https"}function dU(n,e=!1){const{host:t,path:i,pass:r,port:o,projectId:s,protocol:a,publicKey:l}=n;return`${a}://${l}${e&&r?`:${r}`:""}@${t}${o?`:${o}`:""}/${i&&`${i}/`}${s}`}function Van(n){const e=Ban.exec(n);if(!e){console.error(`Invalid Sentry Dsn: ${n}`);return}const[t,i,r="",o,s="",a]=e.slice(1);let l="",c=a;const u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){const d=c.match(/^\d+/);d&&(c=d[0])}return Sze({host:o,pass:r,path:l,projectId:c,port:s,protocol:t,publicKey:i})}function Sze(n){return{protocol:n.protocol,publicKey:n.publicKey||"",pass:n.pass||"",host:n.host,port:n.port||"",path:n.path||"",projectId:n.projectId}}function Han(n){if(!(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__))return!0;const{port:e,projectId:t,protocol:i}=n;return["protocol","publicKey","host","projectId"].find(s=>n[s]?!1:(pn.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:t.match(/^\d+$/)?$an(i)?e&&isNaN(parseInt(e,10))?(pn.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(pn.error(`Invalid Sentry Dsn: Invalid protocol ${i}`),!1):(pn.error(`Invalid Sentry Dsn: Invalid projectId ${t}`),!1)}function Wan(n){const e=typeof n=="string"?Van(n):Sze(n);if(!(!e||!Han(e)))return e}class vv extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}function $u(n,e,t){if(!(e in n))return;const i=n[e],r=t(i);typeof r=="function"&&Eze(r,i),n[e]=r}function dM(n,e,t){try{Object.defineProperty(n,e,{value:t,writable:!0,configurable:!0})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(`Failed to add non-enumerable property "${e}" to object`,n)}}function Eze(n,e){try{const t=e.prototype||{};n.prototype=e.prototype=t,dM(n,"__sentry_original__",e)}catch{}}function eme(n){return n.__sentry_original__}function zan(n){return Object.keys(n).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(n[e])}`).join("&")}function xze(n){if(_ze(n))return{message:n.message,name:n.name,stack:n.stack,...vIe(n)};if(uU(n)){const e={type:n.type,target:_Ie(n.target),currentTarget:_Ie(n.currentTarget),...vIe(n)};return typeof CustomEvent<"u"&&m0(n,CustomEvent)&&(e.detail=n.detail),e}else return n}function _Ie(n){try{return kan(n)?$D(n):Object.prototype.toString.call(n)}catch{return"<unknown>"}}function vIe(n){if(typeof n=="object"&&n!==null){const e={};for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e}else return{}}function jan(n,e=40){const t=Object.keys(xze(n));if(t.sort(),!t.length)return"[object has no keys]";if(t[0].length>=e)return CL(t[0],e);for(let i=t.length;i>0;i--){const r=t.slice(0,i).join(", ");if(!(r.length>e))return i===t.length?r:CL(r,e)}return""}function kC(n){return Ire(n,new Map)}function Ire(n,e){if(BD(n)){const t=e.get(n);if(t!==void 0)return t;const i={};e.set(n,i);for(const r of Object.keys(n))typeof n[r]<"u"&&(i[r]=Ire(n[r],e));return i}if(Array.isArray(n)){const t=e.get(n);if(t!==void 0)return t;const i=[];return e.set(n,i),n.forEach(r=>{i.push(Ire(r,e))}),i}return n}function nh(){const n=Oc,e=n.crypto||n.msCrypto;let t=()=>Math.random()*16;try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(t=()=>e.getRandomValues(new Uint8Array(1))[0])}catch{}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,i=>(i^(t()&15)>>i/4).toString(16))}function kze(n){return n.exception&&n.exception.values?n.exception.values[0]:void 0}function A1(n){const{message:e,event_id:t}=n;if(e)return e;const i=kze(n);return i?i.type&&i.value?`${i.type}: ${i.value}`:i.type||i.value||t||"<unknown>":t||"<unknown>"}function Lre(n,e,t){const i=n.exception=n.exception||{},r=i.values=i.values||[],o=r[0]=r[0]||{};o.value||(o.value=e||""),o.type||(o.type=t||"Error")}function hM(n,e){const t=kze(n);if(!t)return;const i={type:"generic",handled:!0},r=t.mechanism;if(t.mechanism={...i,...r,...e},e&&"data"in e){const o={...r&&r.data,...e.data};t.mechanism.data=o}}function bIe(n){if(n&&n.__sentry_captured__)return!0;try{dM(n,"__sentry_captured__",!0)}catch{}return!1}function Tze(n){return Array.isArray(n)?n:[n]}const Ize=50,yIe=/\(error: (.*)\)/,CIe=/captureMessage|captureException/;function Lze(...n){const e=n.sort((t,i)=>t[0]-i[0]).map(t=>t[1]);return(t,i=0)=>{const r=[],o=t.split(`
`);for(let s=i;s<o.length;s++){const a=o[s];if(a.length>1024)continue;const l=yIe.test(a)?a.replace(yIe,"$1"):a;if(!l.match(/\S*Error: /)){for(const c of e){const u=c(l);if(u){r.push(u);break}}if(r.length>=Ize)break}}return qan(r)}}function Uan(n){return Array.isArray(n)?Lze(...n):n}function qan(n){if(!n.length)return[];const e=Array.from(n);return/sentryWrapped/.test(e[e.length-1].function||"")&&e.pop(),e.reverse(),CIe.test(e[e.length-1].function||"")&&(e.pop(),CIe.test(e[e.length-1].function||"")&&e.pop()),e.slice(0,Ize).map(t=>({...t,filename:t.filename||e[e.length-1].filename,function:t.function||"?"}))}const MX="<anonymous>";function _0(n){try{return!n||typeof n!="function"?MX:n.name||MX}catch{return MX}}const Dre=r5();function Dze(){if(!("fetch"in Dre))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Are(n){return n&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(n.toString())}function Kan(){if(!Dze())return!1;if(Are(Dre.fetch))return!0;let n=!1;const e=Dre.document;if(e&&typeof e.createElement=="function")try{const t=e.createElement("iframe");t.hidden=!0,e.head.appendChild(t),t.contentWindow&&t.contentWindow.fetch&&(n=Are(t.contentWindow.fetch)),e.head.removeChild(t)}catch(t){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return n}const oB=r5();function Gan(){const n=oB.chrome,e=n&&n.app&&n.app.runtime,t="history"in oB&&!!oB.history.pushState&&!!oB.history.replaceState;return!e&&t}const au=r5(),DI="__sentry_xhr_v2__",TO={},wIe={};function Yan(n){if(!wIe[n])switch(wIe[n]=!0,n){case"console":Qan();break;case"dom":oln();break;case"xhr":Jan();break;case"fetch":Xan();break;case"history":eln();break;case"error":sln();break;case"unhandledrejection":aln();break;default:(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn("unknown instrumentation type:",n);return}}function Gf(n,e){TO[n]=TO[n]||[],TO[n].push(e),Yan(n)}function d_(n,e){if(!(!n||!TO[n]))for(const t of TO[n]||[])try{t(e)}catch(i){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.error(`Error while triggering instrumentation handler.
Type: ${n}
Name: ${_0(t)}
Error:`,i)}}function Qan(){"console"in Oc&&Tre.forEach(function(n){n in Oc.console&&$u(Oc.console,n,function(e){return gV[n]=e,function(...t){d_("console",{args:t,level:n});const i=gV[n];i&&i.apply(Oc.console,t)}})})}function Xan(){Kan()&&$u(Oc,"fetch",function(n){return function(...e){const{method:t,url:i}=Zan(e),r={args:e,fetchData:{method:t,url:i},startTimestamp:Date.now()};return d_("fetch",{...r}),n.apply(Oc,e).then(o=>(d_("fetch",{...r,endTimestamp:Date.now(),response:o}),o),o=>{throw d_("fetch",{...r,endTimestamp:Date.now(),error:o}),o})}})}function Rre(n,e){return!!n&&typeof n=="object"&&!!n[e]}function SIe(n){return typeof n=="string"?n:n?Rre(n,"url")?n.url:n.toString?n.toString():"":""}function Zan(n){if(n.length===0)return{method:"GET",url:""};if(n.length===2){const[t,i]=n;return{url:SIe(t),method:Rre(i,"method")?String(i.method).toUpperCase():"GET"}}const e=n[0];return{url:SIe(e),method:Rre(e,"method")?String(e.method).toUpperCase():"GET"}}function Jan(){if(!au.XMLHttpRequest)return;const n=XMLHttpRequest.prototype;$u(n,"open",function(e){return function(...t){const i=Date.now(),r=t[1],o=this[DI]={method:iw(t[0])?t[0].toUpperCase():t[0],url:t[1],request_headers:{}};iw(r)&&o.method==="POST"&&r.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const s=()=>{const a=this[DI];if(a&&this.readyState===4){try{a.status_code=this.status}catch{}d_("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:i,xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?$u(this,"onreadystatechange",function(a){return function(...l){return s(),a.apply(this,l)}}):this.addEventListener("readystatechange",s),$u(this,"setRequestHeader",function(a){return function(...l){const[c,u]=l,d=this[DI];return d&&(d.request_headers[c.toLowerCase()]=u),a.apply(this,l)}}),e.apply(this,t)}}),$u(n,"send",function(e){return function(...t){const i=this[DI];return i&&t[0]!==void 0&&(i.body=t[0]),d_("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}})}let sB;function eln(){if(!Gan())return;const n=au.onpopstate;au.onpopstate=function(...t){const i=au.location.href,r=sB;if(sB=i,d_("history",{from:r,to:i}),n)try{return n.apply(this,t)}catch{}};function e(t){return function(...i){const r=i.length>2?i[2]:void 0;if(r){const o=sB,s=String(r);sB=s,d_("history",{from:o,to:s})}return t.apply(this,i)}}$u(au.history,"pushState",e),$u(au.history,"replaceState",e)}const tln=1e3;let EIe,Nre,Ore;function nln(n){if(n.type!==Nre)return!1;try{if(!n.target||n.target._sentryId!==Ore)return!1}catch{}return!0}function iln(n,e){return n!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function rln(n){try{return n.target}catch{return null}}function xIe(n,e=!1){return t=>{if(!t||t._sentryCaptured)return;const i=rln(t);if(iln(t.type,i))return;dM(t,"_sentryCaptured",!0),i&&!i._sentryId&&dM(i,"_sentryId",nh());const r=t.type==="keypress"?"input":t.type;nln(t)||(n({event:t,name:r,global:e}),Nre=t.type,Ore=i?i._sentryId:void 0),clearTimeout(EIe),EIe=au.setTimeout(()=>{Ore=void 0,Nre=void 0},tln)}}function oln(){if(!au.document)return;const n=d_.bind(null,"dom"),e=xIe(n,!0);au.document.addEventListener("click",e,!1),au.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(t=>{const i=au[t]&&au[t].prototype;!i||!i.hasOwnProperty||!i.hasOwnProperty("addEventListener")||($u(i,"addEventListener",function(r){return function(o,s,a){if(o==="click"||o=="keypress")try{const l=this,c=l.__sentry_instrumentation_handlers__=l.__sentry_instrumentation_handlers__||{},u=c[o]=c[o]||{refCount:0};if(!u.handler){const d=xIe(n);u.handler=d,r.call(this,o,d,a)}u.refCount++}catch{}return r.call(this,o,s,a)}}),$u(i,"removeEventListener",function(r){return function(o,s,a){if(o==="click"||o=="keypress")try{const l=this,c=l.__sentry_instrumentation_handlers__||{},u=c[o];u&&(u.refCount--,u.refCount<=0&&(r.call(this,o,u.handler,a),u.handler=void 0,delete c[o]),Object.keys(c).length===0&&delete l.__sentry_instrumentation_handlers__)}catch{}return r.call(this,o,s,a)}}))})}let aB=null;function sln(){aB=au.onerror,au.onerror=function(n,e,t,i,r){return d_("error",{column:i,error:r,line:t,msg:n,url:e}),aB&&!aB.__SENTRY_LOADER__?aB.apply(this,arguments):!1},au.onerror.__SENTRY_INSTRUMENTED__=!0}let lB=null;function aln(){lB=au.onunhandledrejection,au.onunhandledrejection=function(n){return d_("unhandledrejection",n),lB&&!lB.__SENTRY_LOADER__?lB.apply(this,arguments):!0},au.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function lln(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function cln(){return"npm"}function uln(){return!lln()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function dln(n,e){return n.require(e)}function hln(){const n=typeof WeakSet=="function",e=n?new WeakSet:[];function t(r){if(n)return e.has(r)?!0:(e.add(r),!1);for(let o=0;o<e.length;o++)if(e[o]===r)return!0;return e.push(r),!1}function i(r){if(n)e.delete(r);else for(let o=0;o<e.length;o++)if(e[o]===r){e.splice(o,1);break}}return[t,i]}function w1(n,e=100,t=1/0){try{return Pre("",n,e,t)}catch(i){return{ERROR:`**non-serializable** (${i})`}}}function Aze(n,e=3,t=100*1024){const i=w1(n,e);return mln(i)>t?Aze(n,e-1,t):i}function Pre(n,e,t=1/0,i=1/0,r=hln()){const[o,s]=r;if(e==null||["number","boolean","string"].includes(typeof e)&&!bze(e))return e;const a=fln(n,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;const l=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:t;if(l===0)return a.replace("object ","");if(o(e))return"[Circular ~]";const c=e;if(c&&typeof c.toJSON=="function")try{const g=c.toJSON();return Pre("",g,l-1,i,r)}catch{}const u=Array.isArray(e)?[]:{};let d=0;const h=xze(e);for(const g in h){if(!Object.prototype.hasOwnProperty.call(h,g))continue;if(d>=i){u[g]="[MaxProperties ~]";break}const p=h[g];u[g]=Pre(g,p,l-1,i,r),d++}return s(e),u}function fln(n,e){try{if(n==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(n==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(yze(e))return"[VueViewModel]";if(Ian(e))return"[SyntheticEvent]";if(typeof e=="number"&&e!==e)return"[NaN]";if(typeof e=="function")return`[Function: ${_0(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;const t=gln(e);return/^HTML(\w*)Element$/.test(t)?`[HTMLElement: ${t}]`:`[object ${t}]`}catch(t){return`**non-serializable** (${t})`}}function gln(n){const e=Object.getPrototypeOf(n);return e?e.constructor.name:"null prototype"}function pln(n){return~-encodeURI(n).split(/%..|./).length}function mln(n){return pln(JSON.stringify(n))}var cy;(function(n){n[n.PENDING=0]="PENDING";const t=1;n[n.RESOLVED=t]="RESOLVED";const i=2;n[n.REJECTED=i]="REJECTED"})(cy||(cy={}));function Tx(n){return new jf(e=>{e(n)})}function tme(n){return new jf((e,t)=>{t(n)})}class jf{constructor(e){jf.prototype.__init.call(this),jf.prototype.__init2.call(this),jf.prototype.__init3.call(this),jf.prototype.__init4.call(this),this._state=cy.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(t){this._reject(t)}}then(e,t){return new jf((i,r)=>{this._handlers.push([!1,o=>{if(!e)i(o);else try{i(e(o))}catch(s){r(s)}},o=>{if(!t)r(o);else try{i(t(o))}catch(s){r(s)}}]),this._executeHandlers()})}catch(e){return this.then(t=>t,e)}finally(e){return new jf((t,i)=>{let r,o;return this.then(s=>{o=!1,r=s,e&&e()},s=>{o=!0,r=s,e&&e()}).then(()=>{if(o){i(r);return}t(r)})})}__init(){this._resolve=e=>{this._setResult(cy.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(cy.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===cy.PENDING){if(Jpe(t)){t.then(this._resolve,this._reject);return}this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===cy.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(t=>{t[0]||(this._state===cy.RESOLVED&&t[1](this._value),this._state===cy.REJECTED&&t[2](this._value),t[0]=!0)})}}}function _ln(n){const e=[];function t(){return n===void 0||e.length<n}function i(s){return e.splice(e.indexOf(s),1)[0]}function r(s){if(!t())return tme(new vv("Not adding Promise because buffer limit was reached."));const a=s();return e.indexOf(a)===-1&&e.push(a),a.then(()=>i(a)).then(null,()=>i(a).then(null,()=>{})),a}function o(s){return new jf((a,l)=>{let c=e.length;if(!c)return a(!0);const u=setTimeout(()=>{s&&s>0&&a(!1)},s);e.forEach(d=>{Tx(d).then(()=>{--c||(clearTimeout(u),a(!0))},l)})})}return{$:e,add:r,drain:o}}function FX(n){if(!n)return{};const e=n.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const t=e[6]||"",i=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:t,hash:i,relative:e[5]+t+i}}const vln=["fatal","error","warning","log","info","debug"];function bln(n){return n==="warn"?"warning":vln.includes(n)?n:"log"}const Rze=r5(),Mre={nowSeconds:()=>Date.now()/1e3};function yln(){const{performance:n}=Rze;if(!n||!n.now)return;const e=Date.now()-n.now();return{now:()=>n.now(),timeOrigin:e}}function Cln(){try{return dln(module,"perf_hooks").performance}catch{return}}const BX=uln()?Cln():yln(),kIe=BX===void 0?Mre:{nowSeconds:()=>(BX.timeOrigin+BX.now())/1e3},hU=Mre.nowSeconds.bind(Mre),Ix=kIe.nowSeconds.bind(kIe),rb=(()=>{const{performance:n}=Rze;if(!n||!n.now)return;const e=3600*1e3,t=n.now(),i=Date.now(),r=n.timeOrigin?Math.abs(n.timeOrigin+t-i):e,o=r<e,s=n.timing&&n.timing.navigationStart,l=typeof s=="number"?Math.abs(s+t-i):e,c=l<e;return o||c?r<=l?n.timeOrigin:s:i})(),Fre="baggage",Nze="sentry-",wln=/^sentry-/,Sln=8192;function Eln(n){if(!iw(n)&&!Array.isArray(n))return;let e={};if(Array.isArray(n))e=n.reduce((i,r)=>{const o=TIe(r);return{...i,...o}},{});else{if(!n)return;e=TIe(n)}const t=Object.entries(e).reduce((i,[r,o])=>{if(r.match(wln)){const s=r.slice(Nze.length);i[s]=o}return i},{});if(Object.keys(t).length>0)return t}function Bre(n){if(!n)return;const e=Object.entries(n).reduce((t,[i,r])=>(r&&(t[`${Nze}${i}`]=r),t),{});return xln(e)}function TIe(n){return n.split(",").map(e=>e.split("=").map(t=>decodeURIComponent(t.trim()))).reduce((e,[t,i])=>(e[t]=i,e),{})}function xln(n){if(Object.keys(n).length!==0)return Object.entries(n).reduce((e,[t,i],r)=>{const o=`${encodeURIComponent(t)}=${encodeURIComponent(i)}`,s=r===0?o:`${e},${o}`;return s.length>Sln?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn(`Not adding key: ${t} with val: ${i} to baggage header due to exceeding baggage size limits.`),e):s},"")}const kln=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Tln(n){if(!n)return;const e=n.match(kln);if(!e)return;let t;return e[3]==="1"?t=!0:e[3]==="0"&&(t=!1),{traceId:e[1],parentSampled:t,parentSpanId:e[2]}}function Iln(n,e){const t=Tln(n),i=Eln(e),{traceId:r,parentSpanId:o,parentSampled:s}=t||{},a={traceId:r||nh(),spanId:nh().substring(16),sampled:s};return o&&(a.parentSpanId=o),i&&(a.dsc=i),{traceparentData:t,dynamicSamplingContext:i,propagationContext:a}}function nme(n=nh(),e=nh().substring(16),t){let i="";return t!==void 0&&(i=t?"-1":"-0"),`${n}-${e}${i}`}function o5(n,e=[]){return[n,e]}function Lln(n,e){const[t,i]=n;return[t,[...i,e]]}function IIe(n,e){const t=n[1];for(const i of t){const r=i[0].type;if(e(i,r))return!0}return!1}function $re(n,e){return(e||new TextEncoder).encode(n)}function Dln(n,e){const[t,i]=n;let r=JSON.stringify(t);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[$re(r,e),s]:r.push(typeof s=="string"?$re(s,e):s)}for(const s of i){const[a,l]=s;if(o(`
${JSON.stringify(a)}
`),typeof l=="string"||l instanceof Uint8Array)o(l);else{let c;try{c=JSON.stringify(l)}catch{c=JSON.stringify(w1(l))}o(c)}}return typeof r=="string"?r:Aln(r)}function Aln(n){const e=n.reduce((r,o)=>r+o.length,0),t=new Uint8Array(e);let i=0;for(const r of n)t.set(r,i),i+=r.length;return t}function Rln(n,e){const t=typeof n.data=="string"?$re(n.data,e):n.data;return[kC({type:"attachment",length:t.length,filename:n.filename,content_type:n.contentType,attachment_type:n.attachmentType}),t]}const Nln={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",statsd:"unknown"};function LIe(n){return Nln[n]}function Oze(n){if(!n||!n.sdk)return;const{name:e,version:t}=n.sdk;return{name:e,version:t}}function Oln(n,e,t,i){const r=n.sdkProcessingMetadata&&n.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:n.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!t&&i&&{dsn:dU(i)},...r&&{trace:kC({...r})}}}function Pln(n,e,t){const i=[{type:"client_report"},{timestamp:t||hU(),discarded_events:n}];return o5(e?{dsn:e}:{},[i])}const Mln=60*1e3;function Fln(n,e=Date.now()){const t=parseInt(`${n}`,10);if(!isNaN(t))return t*1e3;const i=Date.parse(`${n}`);return isNaN(i)?Mln:i-e}function Bln(n,e){return n[e]||n.all||0}function $ln(n,e,t=Date.now()){return Bln(n,e)>t}function Vln(n,{statusCode:e,headers:t},i=Date.now()){const r={...n},o=t&&t["x-sentry-rate-limits"],s=t&&t["retry-after"];if(o)for(const a of o.trim().split(",")){const[l,c]=a.split(":",2),u=parseInt(l,10),d=(isNaN(u)?60:u)*1e3;if(!c)r.all=i+d;else for(const h of c.split(";"))r[h]=i+d}else s?r.all=i+Fln(s,i):e===429&&(r.all=i+60*1e3);return r}const ime="production";function rme(){return Cze("globalEventProcessors",()=>[])}function Hln(n){rme().push(n)}function pV(n,e,t,i=0){return new jf((r,o)=>{const s=n[i];if(e===null||typeof s!="function")r(e);else{const a=s({...e},t);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&s.id&&a===null&&pn.log(`Event processor "${s.id}" dropped event`),Jpe(a)?a.then(l=>pV(n,l,t,i+1).then(r)).then(null,o):pV(n,a,t,i+1).then(r).then(null,o)}})}function Wln(n){const e=Ix(),t={sid:nh(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>jln(t)};return n&&VD(t,n),t}function VD(n,e={}){if(e.user&&(!n.ipAddress&&e.user.ip_address&&(n.ipAddress=e.user.ip_address),!n.did&&!e.did&&(n.did=e.user.id||e.user.email||e.user.username)),n.timestamp=e.timestamp||Ix(),e.abnormal_mechanism&&(n.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(n.ignoreDuration=e.ignoreDuration),e.sid&&(n.sid=e.sid.length===32?e.sid:nh()),e.init!==void 0&&(n.init=e.init),!n.did&&e.did&&(n.did=`${e.did}`),typeof e.started=="number"&&(n.started=e.started),n.ignoreDuration)n.duration=void 0;else if(typeof e.duration=="number")n.duration=e.duration;else{const t=n.timestamp-n.started;n.duration=t>=0?t:0}e.release&&(n.release=e.release),e.environment&&(n.environment=e.environment),!n.ipAddress&&e.ipAddress&&(n.ipAddress=e.ipAddress),!n.userAgent&&e.userAgent&&(n.userAgent=e.userAgent),typeof e.errors=="number"&&(n.errors=e.errors),e.status&&(n.status=e.status)}function zln(n,e){let t={};e?t={status:e}:n.status==="ok"&&(t={status:"exited"}),VD(n,t)}function jln(n){return kC({sid:`${n.sid}`,init:n.init,started:new Date(n.started*1e3).toISOString(),timestamp:new Date(n.timestamp*1e3).toISOString(),status:n.status,errors:n.errors,did:typeof n.did=="number"||typeof n.did=="string"?`${n.did}`:void 0,duration:n.duration,abnormal_mechanism:n.abnormal_mechanism,attrs:{release:n.release,environment:n.environment,ip_address:n.ipAddress,user_agent:n.userAgent}})}const Uln=100;class GE{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=DIe()}static clone(e){const t=new GE;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags={...e._tags},t._extra={...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments],t._sdkProcessingMetadata={...e._sdkProcessingMetadata},t._propagationContext={...e._propagationContext}),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&VD(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;if(typeof e=="function"){const t=e(this);return t instanceof GE?t:this}return e instanceof GE?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession),e._propagationContext&&(this._propagationContext=e._propagationContext)):BD(e)&&(e=e,this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession),e.propagationContext&&(this._propagationContext=e.propagationContext)),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=DIe(),this}addBreadcrumb(e,t){const i=typeof t=="number"?t:Uln;if(i<=0)return this;const r={timestamp:hU(),...e},o=this._breadcrumbs;return o.push(r),this._breadcrumbs=o.length>i?o.slice(-i):o,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={},i){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};const s=this._span.transaction;if(s){e.sdkProcessingMetadata={dynamicSamplingContext:s.getDynamicSamplingContext(),...e.sdkProcessingMetadata};const a=s.name;a&&(e.tags={transaction:a,...e.tags})}}this._applyFingerprint(e);const r=this._getBreadcrumbs(),o=[...e.breadcrumbs||[],...r];return e.breadcrumbs=o.length>0?o:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},pV([...i||[],...rme(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}_getBreadcrumbs(){return this._breadcrumbs}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Tze(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function DIe(){return{traceId:nh(),spanId:nh().substring(16)}}const Pze=4,qln=100;class Mze{constructor(e,t=new GE,i=Pze){this._version=i,this._stack=[{scope:t}],e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){const t=this.getStackTop();t.client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=GE.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(e){const t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){const i=this._lastEventId=t&&t.event_id?t.event_id:nh(),r=new Error("Sentry syntheticException");return this._withClient((o,s)=>{o.captureException(e,{originalException:e,syntheticException:r,...t,event_id:i},s)}),i}captureMessage(e,t,i){const r=this._lastEventId=i&&i.event_id?i.event_id:nh(),o=new Error(e);return this._withClient((s,a)=>{s.captureMessage(e,t,{originalException:e,syntheticException:o,...i,event_id:r},a)}),r}captureEvent(e,t){const i=t&&t.event_id?t.event_id:nh();return e.type||(this._lastEventId=i),this._withClient((r,o)=>{r.captureEvent(e,{...t,event_id:i},o)}),i}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:i,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:s=qln}=r.getOptions&&r.getOptions()||{};if(s<=0)return;const l={timestamp:hU(),...e},c=o?wze(()=>o(l,t)):l;c!==null&&(r.emit&&r.emit("beforeAddBreadcrumb",c,t),i.addBreadcrumb(c,s))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t)}configureScope(e){const{scope:t,client:i}=this.getStackTop();i&&e(t)}run(e){const t=AIe(this);try{e(this)}finally{AIe(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const i=this._callExtensionMethod("startTransaction",e,t);if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&!i){const r=this.getClient();console.warn(r?`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
Sentry.addTracingExtensions();
Sentry.init({...});
`:"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return i}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const t=this.getStackTop().scope,i=t.getSession();i&&zln(i),this._sendSessionUpdate(),t.setSession()}startSession(e){const{scope:t,client:i}=this.getStackTop(),{release:r,environment:o=ime}=i&&i.getOptions()||{},{userAgent:s}=Oc.navigator||{},a=Wln({release:r,environment:o,user:t.getUser(),...s&&{userAgent:s},...e}),l=t.getSession&&t.getSession();return l&&l.status==="ok"&&VD(l,{status:"exited"}),this.endSession(),t.setSession(a),a}shouldSendDefaultPii(){const e=this.getClient(),t=e&&e.getOptions();return!!(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop(),i=e.getSession();i&&t&&t.captureSession&&t.captureSession(i)}_withClient(e){const{scope:t,client:i}=this.getStackTop();i&&e(i,t)}_callExtensionMethod(e,...t){const r=s5().__SENTRY__;if(r&&r.extensions&&typeof r.extensions[e]=="function")return r.extensions[e].apply(this,t);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function s5(){return Oc.__SENTRY__=Oc.__SENTRY__||{extensions:{},hub:void 0},Oc}function AIe(n){const e=s5(),t=Vre(e);return Fze(e,n),t}function xl(){const n=s5();if(n.__SENTRY__&&n.__SENTRY__.acs){const e=n.__SENTRY__.acs.getCurrentHub();if(e)return e}return Kln(n)}function Kln(n=s5()){return(!Gln(n)||Vre(n).isOlderThan(Pze))&&Fze(n,new Mze),Vre(n)}function Gln(n){return!!(n&&n.__SENTRY__&&n.__SENTRY__.hub)}function Vre(n){return Cze("hub",()=>new Mze,n)}function Fze(n,e){if(!n)return!1;const t=n.__SENTRY__=n.__SENTRY__||{};return t.hub=e,!0}function a5(n){return(n||xl()).getScope().getTransaction()}let RIe=!1;function Yln(){RIe||(RIe=!0,Gf("error",Hre),Gf("unhandledrejection",Hre))}function Hre(){const n=a5();if(n){const e="internal_error";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(`[Tracing] Transaction: ${e} -> Global error occured`),n.setStatus(e)}}Hre.tag="sentry_tracingErrorCallback";class Bze{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}}class ome{constructor(e={}){this.traceId=e.traceId||nh(),this.spanId=e.spanId||nh().substring(16),this.startTimestamp=e.startTimestamp||Ix(),this.tags=e.tags||{},this.data=e.data||{},this.instrumenter=e.instrumenter||"sentry",this.origin=e.origin||"manual",e.parentSpanId&&(this.parentSpanId=e.parentSpanId),"sampled"in e&&(this.sampled=e.sampled),e.op&&(this.op=e.op),e.description&&(this.description=e.description),e.name&&(this.description=e.name),e.status&&(this.status=e.status),e.endTimestamp&&(this.endTimestamp=e.endTimestamp)}get name(){return this.description||""}set name(e){this.setName(e)}startChild(e){const t=new ome({...e,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(t.spanRecorder=this.spanRecorder,t.spanRecorder&&t.spanRecorder.add(t),t.transaction=this.transaction,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&t.transaction){const i=e&&e.op||"< unknown op >",r=t.transaction.name||"< unknown name >",o=t.transaction.spanId,s=`[Tracing] Starting '${i}' span on transaction '${r}' (${o}).`;t.transaction.metadata.spanMetadata[t.spanId]={logMessage:s},pn.log(s)}return t}setTag(e,t){return this.tags={...this.tags,[e]:t},this}setData(e,t){return this.data={...this.data,[e]:t},this}setStatus(e){return this.status=e,this}setHttpStatus(e){this.setTag("http.status_code",String(e)),this.setData("http.response.status_code",e);const t=Qln(e);return t!=="unknown_error"&&this.setStatus(t),this}setName(e){this.description=e}isSuccess(){return this.status==="ok"}finish(e){if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){const{logMessage:t}=this.transaction.metadata.spanMetadata[this.spanId];t&&pn.log(t.replace("Starting","Finishing"))}this.endTimestamp=typeof e=="number"?e:Ix()}toTraceparent(){return nme(this.traceId,this.spanId,this.sampled)}toContext(){return kC({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})}updateWithContext(e){return this.data=e.data||{},this.description=e.description,this.endTimestamp=e.endTimestamp,this.op=e.op,this.parentSpanId=e.parentSpanId,this.sampled=e.sampled,this.spanId=e.spanId||this.spanId,this.startTimestamp=e.startTimestamp||this.startTimestamp,this.status=e.status,this.tags=e.tags||{},this.traceId=e.traceId||this.traceId,this}getTraceContext(){return kC({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})}toJSON(){return kC({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId,origin:this.origin})}}function Qln(n){if(n<400&&n>=100)return"ok";if(n>=400&&n<500)switch(n){case 401:return"unauthenticated";case 403:return"permission_denied";case 404:return"not_found";case 409:return"already_exists";case 413:return"failed_precondition";case 429:return"resource_exhausted";default:return"invalid_argument"}if(n>=500&&n<600)switch(n){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}function fU(n,e,t){const i=e.getOptions(),{publicKey:r}=e.getDsn()||{},{segment:o}=t&&t.getUser()||{},s=kC({environment:i.environment||ime,release:i.release,user_segment:o,public_key:r,trace_id:n});return e.emit&&e.emit("createDsc",s),s}class $ze extends ome{constructor(e,t){super(e),delete this.description,this._measurements={},this._contexts={},this._hub=t||xl(),this._name=e.name||"",this.metadata={source:"custom",...e.metadata,spanMetadata:{}},this._trimEnd=e.trimEnd,this.transaction=this;const i=this.metadata.dynamicSamplingContext;i&&(this._frozenDynamicSamplingContext={...i})}get name(){return this._name}set name(e){this.setName(e)}setName(e,t="custom"){this._name=e,this.metadata.source=t}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new Bze(e)),this.spanRecorder.add(this)}setContext(e,t){t===null?delete this._contexts[e]:this._contexts[e]=t}setMeasurement(e,t,i=""){this._measurements[e]={value:t,unit:i}}setMetadata(e){this.metadata={...this.metadata,...e}}finish(e){const t=this._finishTransaction(e);if(t)return this._hub.captureEvent(t)}toContext(){const e=super.toContext();return kC({...e,name:this.name,trimEnd:this._trimEnd})}updateWithContext(e){return super.updateWithContext(e),this.name=e.name||"",this._trimEnd=e.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;const e=this._hub||xl(),t=e.getClient();if(!t)return{};const i=e.getScope(),r=fU(this.traceId,t,i),o=this.metadata.sampleRate;o!==void 0&&(r.sample_rate=`${o}`);const s=this.metadata.source;return s&&s!=="url"&&(r.transaction=this.name),this.sampled!==void 0&&(r.sampled=String(this.sampled)),r}setHub(e){this._hub=e}_finishTransaction(e){if(this.endTimestamp!==void 0)return;this.name||((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),super.finish(e);const t=this._hub.getClient();if(t&&t.emit&&t.emit("finishTransaction",this),this.sampled!==!0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","transaction");return}const i=this.spanRecorder?this.spanRecorder.spans.filter(a=>a!==this&&a.endTimestamp):[];this._trimEnd&&i.length>0&&(this.endTimestamp=i.reduce((a,l)=>a.endTimestamp&&l.endTimestamp?a.endTimestamp>l.endTimestamp?a:l:a).endTimestamp);const r=this.metadata,o={contexts:{...this._contexts,trace:this.getTraceContext()},spans:i,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...r,dynamicSamplingContext:this.getDynamicSamplingContext()},...r.source&&{transaction_info:{source:r.source}}};return Object.keys(this._measurements).length>0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),o.measurements=this._measurements),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),o}}const C8={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},Xln="finishReason",TT=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"];class Zln extends Bze{constructor(e,t,i,r){super(r),this._pushActivity=e,this._popActivity=t,this.transactionSpanId=i}add(e){e.spanId!==this.transactionSpanId&&(e.finish=t=>{e.endTimestamp=typeof t=="number"?t:Ix(),this._popActivity(e.spanId)},e.endTimestamp===void 0&&this._pushActivity(e.spanId)),super.add(e)}}class Jln extends $ze{constructor(e,t,i=C8.idleTimeout,r=C8.finalTimeout,o=C8.heartbeatInterval,s=!1){super(e,t),this._idleHub=t,this._idleTimeout=i,this._finalTimeout=r,this._heartbeatInterval=o,this._onScope=s,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=TT[4],s&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),t.configureScope(a=>a.setSpan(this))),this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=TT[3],this.finish())},this._finalTimeout)}finish(e=Ix()){if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setTag(Xln,this._finishReason),this.spanRecorder){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("[Tracing] finishing IdleTransaction",new Date(e*1e3).toISOString(),this.op);for(const t of this._beforeFinishCallbacks)t(this,e);this.spanRecorder.spans=this.spanRecorder.spans.filter(t=>{if(t.spanId===this.spanId)return!0;t.endTimestamp||(t.endTimestamp=e,t.setStatus("cancelled"),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(t,void 0,2)));const i=t.startTimestamp<e,r=(this._finalTimeout+this._idleTimeout)/1e3,o=t.endTimestamp-this.startTimestamp<r;if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){const s=JSON.stringify(t,void 0,2);i?o||pn.log("[Tracing] discarding Span since it finished after Transaction final timeout",s):pn.log("[Tracing] discarding Span since it happened after Transaction was finished",s)}return i&&o}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("[Tracing] flushing IdleTransaction")}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("[Tracing] No active IdleTransaction");if(this._onScope){const t=this._idleHub.getScope();t.getTransaction()===this&&t.setSpan(void 0)}return super.finish(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){const t=r=>{this._finished||this._pushActivity(r)},i=r=>{this._finished||this._popActivity(r)};this.spanRecorder=new Zln(t,i,this.spanId,e),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:t}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=t===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=TT[5],this.finish(e)))}setFinishReason(e){this._finishReason=e}_restartIdleTimeout(e){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=TT[1],this.finish(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(`[Tracing] popActivity ${e}`),delete this.activities[e],(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){const t=Ix();this._idleTimeoutCanceledPermanently?(this._finishReason=TT[5],this.finish(t)):this._restartIdleTimeout(t+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;const e=Object.keys(this.activities).join("");e===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=TT[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}}function sme(n){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=xl().getClient(),t=n||e&&e.getOptions();return!!t&&(t.enableTracing||"tracesSampleRate"in t||"tracesSampler"in t)}function Vze(n,e,t){if(!sme(e))return n.sampled=!1,n;if(n.sampled!==void 0)return n.setMetadata({sampleRate:Number(n.sampled)}),n;let i;return typeof e.tracesSampler=="function"?(i=e.tracesSampler(t),n.setMetadata({sampleRate:Number(i)})):t.parentSampled!==void 0?i=t.parentSampled:typeof e.tracesSampleRate<"u"?(i=e.tracesSampleRate,n.setMetadata({sampleRate:Number(i)})):(i=1,n.setMetadata({sampleRate:i})),ecn(i)?i?(n.sampled=Math.random()<i,n.sampled?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(`[Tracing] starting ${n.op} transaction - ${n.name}`),n):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),n)):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),n.sampled=!1,n):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn("[Tracing] Discarding transaction because of invalid sample rate."),n.sampled=!1,n)}function ecn(n){return bze(n)||!(typeof n=="number"||typeof n=="boolean")?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(n)} of type ${JSON.stringify(typeof n)}.`),!1):n<0||n>1?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${n}.`),!1):!0}function tcn(){const e=this.getScope().getSpan();return e?{"sentry-trace":e.toTraceparent()}:{}}function ncn(n,e){const t=this.getClient(),i=t&&t.getOptions()||{},r=i.instrumenter||"sentry",o=n.instrumenter||"sentry";r!==o&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.error(`A transaction was started with instrumenter=\`${o}\`, but the SDK is configured with the \`${r}\` instrumenter.
The transaction will not be sampled. Please use the ${r} instrumentation to start transactions.`),n.sampled=!1);let s=new $ze(n,this);return s=Vze(s,i,{parentSampled:n.parentSampled,transactionContext:n,...e}),s.sampled&&s.initSpanRecorder(i._experiments&&i._experiments.maxSpans),t&&t.emit&&t.emit("startTransaction",s),s}function NIe(n,e,t,i,r,o,s){const a=n.getClient(),l=a&&a.getOptions()||{};let c=new Jln(e,n,t,i,s,r);return c=Vze(c,l,{parentSampled:e.parentSampled,transactionContext:e,...o}),c.sampled&&c.initSpanRecorder(l._experiments&&l._experiments.maxSpans),a&&a.emit&&a.emit("startTransaction",c),c}function icn(){const n=s5();n.__SENTRY__&&(n.__SENTRY__.extensions=n.__SENTRY__.extensions||{},n.__SENTRY__.extensions.startTransaction||(n.__SENTRY__.extensions.startTransaction=ncn),n.__SENTRY__.extensions.traceHeaders||(n.__SENTRY__.extensions.traceHeaders=tcn),Yln())}function rcn(n,e){return xl().captureException(n,{captureContext:e})}function ocn(n){xl().withScope(n)}const scn="7";function acn(n){const e=n.protocol?`${n.protocol}:`:"",t=n.port?`:${n.port}`:"";return`${e}//${n.host}${t}${n.path?`/${n.path}`:""}/api/`}function lcn(n){return`${acn(n)}${n.projectId}/envelope/`}function ccn(n,e){return zan({sentry_key:n.publicKey,sentry_version:scn,...e&&{sentry_client:`${e.name}/${e.version}`}})}function ucn(n,e={}){const t=typeof e=="string"?e:e.tunnel,i=typeof e=="string"||!e._metadata?void 0:e._metadata.sdk;return t||`${lcn(n)}?${ccn(n,i)}`}function dcn(n,e){return e&&(n.sdk=n.sdk||{},n.sdk.name=n.sdk.name||e.name,n.sdk.version=n.sdk.version||e.version,n.sdk.integrations=[...n.sdk.integrations||[],...e.integrations||[]],n.sdk.packages=[...n.sdk.packages||[],...e.packages||[]]),n}function hcn(n,e,t,i){const r=Oze(t),o={sent_at:new Date().toISOString(),...r&&{sdk:r},...!!i&&e&&{dsn:dU(e)}},s="aggregates"in n?[{type:"sessions"},n]:[{type:"session"},n.toJSON()];return o5(o,[s])}function fcn(n,e,t,i){const r=Oze(t),o=n.type&&n.type!=="replay_event"?n.type:"event";dcn(n,t&&t.sdk);const s=Oln(n,r,i,e);return delete n.sdkProcessingMetadata,o5(s,[[{type:o},n]])}const OIe=[];function gcn(n){const e={};return n.forEach(t=>{const{name:i}=t,r=e[i];r&&!r.isDefaultInstance&&t.isDefaultInstance||(e[i]=t)}),Object.keys(e).map(t=>e[t])}function pcn(n){const e=n.defaultIntegrations||[],t=n.integrations;e.forEach(s=>{s.isDefaultInstance=!0});let i;Array.isArray(t)?i=[...e,...t]:typeof t=="function"?i=Tze(t(e)):i=e;const r=gcn(i),o=_cn(r,s=>s.name==="Debug");if(o!==-1){const[s]=r.splice(o,1);r.push(s)}return r}function mcn(n,e){const t={};return e.forEach(i=>{i&&Hze(n,i,t)}),t}function Hze(n,e,t){if(t[e.name]=e,OIe.indexOf(e.name)===-1&&(e.setupOnce(Hln,xl),OIe.push(e.name)),n.on&&typeof e.preprocessEvent=="function"){const i=e.preprocessEvent.bind(e);n.on("preprocessEvent",(r,o)=>i(r,o,n))}if(n.addEventProcessor&&typeof e.processEvent=="function"){const i=e.processEvent.bind(e),r=Object.assign((o,s)=>i(o,s,n),{id:e.name});n.addEventProcessor(r)}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(`Integration installed: ${e.name}`)}function _cn(n,e){for(let t=0;t<n.length;t++)if(e(n[t])===!0)return t;return-1}function vcn(n,e,t,i,r){const{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=n,a={...e,event_id:e.event_id||t.event_id||nh(),timestamp:e.timestamp||hU()},l=t.integrations||n.integrations.map(h=>h.name);bcn(a,n),wcn(a,l),e.type===void 0&&ycn(a,n.stackParser);let c=i;t.captureContext&&(c=GE.clone(c).update(t.captureContext));let u=Tx(a);const d=r&&r.getEventProcessors?r.getEventProcessors():[];if(c){if(c.getAttachments){const h=[...t.attachments||[],...c.getAttachments()];h.length&&(t.attachments=h)}u=c.applyToEvent(a,t,d)}else u=pV([...d,...rme()],a,t);return u.then(h=>(h&&Ccn(h),typeof o=="number"&&o>0?Scn(h,o,s):h))}function bcn(n,e){const{environment:t,release:i,dist:r,maxValueLength:o=250}=e;"environment"in n||(n.environment="environment"in e?t:ime),n.release===void 0&&i!==void 0&&(n.release=i),n.dist===void 0&&r!==void 0&&(n.dist=r),n.message&&(n.message=CL(n.message,o));const s=n.exception&&n.exception.values&&n.exception.values[0];s&&s.value&&(s.value=CL(s.value,o));const a=n.request;a&&a.url&&(a.url=CL(a.url,o))}const PIe=new WeakMap;function ycn(n,e){const t=Oc._sentryDebugIds;if(!t)return;let i;const r=PIe.get(e);r?i=r:(i=new Map,PIe.set(e,i));const o=Object.keys(t).reduce((s,a)=>{let l;const c=i.get(a);c?l=c:(l=e(a),i.set(a,l));for(let u=l.length-1;u>=0;u--){const d=l[u];if(d.filename){s[d.filename]=t[a];break}}return s},{});try{n.exception.values.forEach(s=>{s.stacktrace.frames.forEach(a=>{a.filename&&(a.debug_id=o[a.filename])})})}catch{}}function Ccn(n){const e={};try{n.exception.values.forEach(i=>{i.stacktrace.frames.forEach(r=>{r.debug_id&&(r.abs_path?e[r.abs_path]=r.debug_id:r.filename&&(e[r.filename]=r.debug_id),delete r.debug_id)})})}catch{}if(Object.keys(e).length===0)return;n.debug_meta=n.debug_meta||{},n.debug_meta.images=n.debug_meta.images||[];const t=n.debug_meta.images;Object.keys(e).forEach(i=>{t.push({type:"sourcemap",code_file:i,debug_id:e[i]})})}function wcn(n,e){e.length>0&&(n.sdk=n.sdk||{},n.sdk.integrations=[...n.sdk.integrations||[],...e])}function Scn(n,e,t){if(!n)return null;const i={...n,...n.breadcrumbs&&{breadcrumbs:n.breadcrumbs.map(r=>({...r,...r.data&&{data:w1(r.data,e,t)}}))},...n.user&&{user:w1(n.user,e,t)},...n.contexts&&{contexts:w1(n.contexts,e,t)},...n.extra&&{extra:w1(n.extra,e,t)}};return n.contexts&&n.contexts.trace&&i.contexts&&(i.contexts.trace=n.contexts.trace,n.contexts.trace.data&&(i.contexts.trace.data=w1(n.contexts.trace.data,e,t))),n.spans&&(i.spans=n.spans.map(r=>(r.data&&(r.data=w1(r.data,e,t)),r))),i}const MIe="Not capturing exception because it's already been captured.";class Ecn{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=Wan(e.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn("No DSN provided, client will not send events."),this._dsn){const t=ucn(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,i){if(bIe(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(MIe);return}let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then(o=>this._captureEvent(o,t,i)).then(o=>{r=o})),r}captureMessage(e,t,i,r){let o=i&&i.event_id;const s=vze(e)?this.eventFromMessage(String(e),t,i):this.eventFromException(e,i);return this._process(s.then(a=>this._captureEvent(a,i,r)).then(a=>{o=a})),o}captureEvent(e,t,i){if(t&&t.originalException&&bIe(t.originalException)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(MIe);return}let r=t&&t.event_id;return this._process(this._captureEvent(e,t,i).then(o=>{r=o})),r}captureSession(e){typeof e.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),VD(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;return t?this._isClientDoneProcessing(e).then(i=>t.flush(e).then(r=>i&&r)):Tx(!0)}close(e){return this.flush(e).then(t=>(this.getOptions().enabled=!1,t))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&(this._integrations=mcn(this,this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){Hze(this,e,this._integrations)}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let i=fcn(e,this._dsn,this._options._metadata,this._options.tunnel);for(const o of t.attachments||[])i=Lln(i,Rln(o,this._options.transportOptions&&this._options.transportOptions.textEncoder));const r=this._sendEnvelope(i);r&&r.then(o=>this.emit("afterSendEvent",e,o),null)}sendSession(e){const t=hcn(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}recordDroppedEvent(e,t,i){if(this._options.sendClientReports){const r=`${e}:${t}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(`Adding outcome: "${r}"`),this._outcomes[r]=this._outcomes[r]+1||1}}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach(i=>i(...t))}_updateSessionFromEvent(e,t){let i=!1,r=!1;const o=t.exception&&t.exception.values;if(o){r=!0;for(const l of o){const c=l.mechanism;if(c&&c.handled===!1){i=!0;break}}}const s=e.status==="ok";(s&&e.errors===0||s&&i)&&(VD(e,{...i&&{status:"crashed"},errors:e.errors||Number(r||i)}),this.captureSession(e))}_isClientDoneProcessing(e){return new jf(t=>{let i=0;const r=1,o=setInterval(()=>{this._numProcessing==0?(clearInterval(o),t(!0)):(i+=r,e&&i>=e&&(clearInterval(o),t(!1)))},r)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,i){const r=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),this.emit("preprocessEvent",e,t),vcn(r,e,t,i,this).then(s=>{if(s===null)return s;const{propagationContext:a}=s.sdkProcessingMetadata||{};if(!(s.contexts&&s.contexts.trace)&&a){const{traceId:c,spanId:u,parentSpanId:d,dsc:h}=a;s.contexts={trace:{trace_id:c,span_id:u,parent_span_id:d},...s.contexts};const g=h||fU(c,this,i);s.sdkProcessingMetadata={dynamicSamplingContext:g,...s.sdkProcessingMetadata}}return s})}_captureEvent(e,t={},i){return this._processEvent(e,t,i).then(r=>r.event_id,r=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){const o=r;o.logLevel==="log"?pn.log(o.message):pn.warn(o)}})}_processEvent(e,t,i){const r=this.getOptions(),{sampleRate:o}=r,s=zze(e),a=Wze(e),l=e.type||"error",c=`before send for type \`${l}\``;if(a&&typeof o=="number"&&Math.random()>o)return this.recordDroppedEvent("sample_rate","error",e),tme(new vv(`Discarding event because it's not included in the random sample (sampling rate = ${o})`,"log"));const u=l==="replay_event"?"replay":l;return this._prepareEvent(e,t,i).then(d=>{if(d===null)throw this.recordDroppedEvent("event_processor",u,e),new vv("An event processor returned `null`, will not send event.","log");if(t.data&&t.data.__sentry__===!0)return d;const g=kcn(r,d,t);return xcn(g,c)}).then(d=>{if(d===null)throw this.recordDroppedEvent("before_send",u,e),new vv(`${c} returned \`null\`, will not send event.`,"log");const h=i&&i.getSession();!s&&h&&this._updateSessionFromEvent(h,d);const g=d.transaction_info;if(s&&g&&d.transaction!==e.transaction){const p="custom";d.transaction_info={...g,source:p}}return this.sendEvent(d,t),d}).then(null,d=>{throw d instanceof vv?d:(this.captureException(d,{data:{__sentry__:!0},originalException:d}),new vv(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
Reason: ${d}`))})}_process(e){this._numProcessing++,e.then(t=>(this._numProcessing--,t),t=>(this._numProcessing--,t))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,t=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.error("Error while sending event:",t)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map(t=>{const[i,r]=t.split(":");return{reason:i,category:r,quantity:e[t]}})}}function xcn(n,e){const t=`${e} must return \`null\` or a valid event.`;if(Jpe(n))return n.then(i=>{if(!BD(i)&&i!==null)throw new vv(t);return i},i=>{throw new vv(`${e} rejected with ${i}`)});if(!BD(n)&&n!==null)throw new vv(t);return n}function kcn(n,e,t){const{beforeSend:i,beforeSendTransaction:r}=n;return Wze(e)&&i?i(e,t):zze(e)&&r?r(e,t):e}function Wze(n){return n.type===void 0}function zze(n){return n.type==="transaction"}function Tcn(n,e){e.debug===!0&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?pn.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));const t=xl();t.getScope().update(e.initialScope);const r=new n(e);t.bindClient(r)}const Icn=30;function jze(n,e,t=_ln(n.bufferSize||Icn)){let i={};const r=s=>t.drain(s);function o(s){const a=[];if(IIe(s,(d,h)=>{const g=LIe(h);if($ln(i,g)){const p=FIe(d,h);n.recordDroppedEvent("ratelimit_backoff",g,p)}else a.push(d)}),a.length===0)return Tx();const l=o5(s[0],a),c=d=>{IIe(l,(h,g)=>{const p=FIe(h,g);n.recordDroppedEvent(d,LIe(g),p)})},u=()=>e({body:Dln(l,n.textEncoder)}).then(d=>(d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),i=Vln(i,d),d),d=>{throw c("network_error"),d});return t.add(u).then(d=>d,d=>{if(d instanceof vv)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.error("Skipped sending event because buffer is full."),c("queue_overflow"),Tx();throw d})}return o.__sentry__baseTransport__=!0,{send:o,flush:r}}function FIe(n,e){if(!(e!=="event"&&e!=="transaction"))return Array.isArray(n)?n[1]:void 0}const mV="7.77.0";let BIe;class gU{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=gU.id}setupOnce(){BIe=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=eme(this)||this;return BIe.apply(t,e)}}catch{}}}gU.__initStatic();const Lcn=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],Dcn=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/];class pU{static __initStatic(){this.id="InboundFilters"}constructor(e={}){this.name=pU.id,this._options=e}setupOnce(e,t){}processEvent(e,t,i){const r=i.getOptions(),o=Acn(this._options,r);return Rcn(e,o)?null:e}}pU.__initStatic();function Acn(n={},e={}){return{allowUrls:[...n.allowUrls||[],...e.allowUrls||[]],denyUrls:[...n.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...n.ignoreErrors||[],...e.ignoreErrors||[],...n.disableErrorDefaults?[]:Lcn],ignoreTransactions:[...n.ignoreTransactions||[],...e.ignoreTransactions||[],...n.disableTransactionDefaults?[]:Dcn],ignoreInternal:n.ignoreInternal!==void 0?n.ignoreInternal:!0}}function Rcn(n,e){return e.ignoreInternal&&Bcn(n)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn(`Event dropped due to being internal Sentry Error.
Event: ${A1(n)}`),!0):Ncn(n,e.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
Event: ${A1(n)}`),!0):Ocn(n,e.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
Event: ${A1(n)}`),!0):Pcn(n,e.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn(`Event dropped due to being matched by \`denyUrls\` option.
Event: ${A1(n)}.
Url: ${_V(n)}`),!0):Mcn(n,e.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn(`Event dropped due to not being matched by \`allowUrls\` option.
Event: ${A1(n)}.
Url: ${_V(n)}`),!0)}function Ncn(n,e){return n.type||!e||!e.length?!1:Fcn(n).some(t=>i5(t,e))}function Ocn(n,e){if(n.type!=="transaction"||!e||!e.length)return!1;const t=n.transaction;return t?i5(t,e):!1}function Pcn(n,e){if(!e||!e.length)return!1;const t=_V(n);return t?i5(t,e):!1}function Mcn(n,e){if(!e||!e.length)return!0;const t=_V(n);return t?i5(t,e):!0}function Fcn(n){const e=[];n.message&&e.push(n.message);let t;try{t=n.exception.values[n.exception.values.length-1]}catch{}return t&&t.value&&(e.push(t.value),t.type&&e.push(`${t.type}: ${t.value}`)),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&e.length===0&&pn.error(`Could not extract message for event ${A1(n)}`),e}function Bcn(n){try{return n.exception.values[0].type==="SentryError"}catch{}return!1}function $cn(n=[]){for(let e=n.length-1;e>=0;e--){const t=n[e];if(t&&t.filename!=="<anonymous>"&&t.filename!=="[native code]")return t.filename||null}return null}function _V(n){try{let e;try{e=n.exception.values[0].stacktrace.frames}catch{}return e?$cn(e):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.error(`Cannot extract url for event ${A1(n)}`),null}}const oa=Oc;let Wre=0;function Uze(){return Wre>0}function Vcn(){Wre++,setTimeout(()=>{Wre--})}function HD(n,e={},t){if(typeof n!="function")return n;try{const r=n.__sentry_wrapped__;if(r)return r;if(eme(n))return n}catch{return n}const i=function(){const r=Array.prototype.slice.call(arguments);try{t&&typeof t=="function"&&t.apply(this,arguments);const o=r.map(s=>HD(s,e));return n.apply(this,o)}catch(o){throw Vcn(),ocn(s=>{s.addEventProcessor(a=>(e.mechanism&&(Lre(a,void 0,void 0),hM(a,e.mechanism)),a.extra={...a.extra,arguments:r},a)),rcn(o)}),o}};try{for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(i[r]=n[r])}catch{}Eze(i,n),dM(n,"__sentry_wrapped__",i);try{Object.getOwnPropertyDescriptor(i,"name").configurable&&Object.defineProperty(i,"name",{get(){return n.name}})}catch{}return i}function qze(n,e){const t=ame(n,e),i={type:e&&e.name,value:jcn(e)};return t.length&&(i.stacktrace={frames:t}),i.type===void 0&&i.value===""&&(i.value="Unrecoverable error caught"),i}function Hcn(n,e,t,i){const o=xl().getClient(),s=o&&o.getOptions().normalizeDepth,a={exception:{values:[{type:uU(e)?e.constructor.name:i?"UnhandledRejection":"Error",value:Kcn(e,{isUnhandledRejection:i})}]},extra:{__serialized__:Aze(e,s)}};if(t){const l=ame(n,t);l.length&&(a.exception.values[0].stacktrace={frames:l})}return a}function $X(n,e){return{exception:{values:[qze(n,e)]}}}function ame(n,e){const t=e.stacktrace||e.stack||"",i=zcn(e);try{return n(t,i)}catch{}return[]}const Wcn=/Minified React error #\d+;/i;function zcn(n){if(n){if(typeof n.framesToPop=="number")return n.framesToPop;if(Wcn.test(n.message))return 1}return 0}function jcn(n){const e=n&&n.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function Ucn(n,e,t,i){const r=t&&t.syntheticException||void 0,o=lme(n,e,r,i);return hM(o),o.level="error",t&&t.event_id&&(o.event_id=t.event_id),Tx(o)}function qcn(n,e,t="info",i,r){const o=i&&i.syntheticException||void 0,s=zre(n,e,o,r);return s.level=t,i&&i.event_id&&(s.event_id=i.event_id),Tx(s)}function lme(n,e,t,i,r){let o;if(Zpe(e)&&e.error)return $X(n,e.error);if(fIe(e)||xan(e)){const s=e;if("stack"in e)o=$X(n,e);else{const a=s.name||(fIe(s)?"DOMError":"DOMException"),l=s.message?`${a}: ${s.message}`:a;o=zre(n,l,t,i),Lre(o,l)}return"code"in s&&(o.tags={...o.tags,"DOMException.code":`${s.code}`}),o}return _ze(e)?$X(n,e):BD(e)||uU(e)?(o=Hcn(n,e,t,r),hM(o,{synthetic:!0}),o):(o=zre(n,e,t,i),Lre(o,`${e}`,void 0),hM(o,{synthetic:!0}),o)}function zre(n,e,t,i){const r={message:e};if(i&&t){const o=ame(n,t);o.length&&(r.exception={values:[{value:e,stacktrace:{frames:o}}]})}return r}function Kcn(n,{isUnhandledRejection:e}){const t=jan(n),i=e?"promise rejection":"exception";return Zpe(n)?`Event \`ErrorEvent\` captured as ${i} with message \`${n.message}\``:uU(n)?`Event \`${Gcn(n)}\` (type=${n.type}) captured as ${i}`:`Object captured as ${i} with keys: ${t}`}function Gcn(n){try{const e=Object.getPrototypeOf(n);return e?e.constructor.name:void 0}catch{}}function Ycn(n,{metadata:e,tunnel:t,dsn:i}){const r={event_id:n.event_id,sent_at:new Date().toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!t&&!!i&&{dsn:dU(i)}},o=Qcn(n);return o5(r,[o])}function Qcn(n){return[{type:"user_report"},n]}class Xcn extends Ecn{constructor(e){const t=oa.SENTRY_SDK_SOURCE||cln();e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:`${t}:@sentry/browser`,version:mV}],version:mV},super(e),e.sendClientReports&&oa.document&&oa.document.addEventListener("visibilitychange",()=>{oa.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,t){return Ucn(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",i){return qcn(this._options.stackParser,e,t,i,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn("SDK not enabled, will not capture user feedback.");return}const t=Ycn(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,i){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,i)}_flushOutcomes(){const e=this._clearOutcomes();if(e.length===0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("No outcomes to send");return}if(!this._dsn){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("No dsn provided, will not send outcomes");return}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("Sending outcomes:",e);const t=Pln(e,this._options.tunnel&&dU(this._dsn));this._sendEnvelope(t)}}let wN;function Zcn(){if(wN)return wN;if(Are(oa.fetch))return wN=oa.fetch.bind(oa);const n=oa.document;let e=oa.fetch;if(n&&typeof n.createElement=="function")try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);const i=t.contentWindow;i&&i.fetch&&(e=i.fetch),n.head.removeChild(t)}catch(t){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return wN=e.bind(oa)}function Jcn(){wN=void 0}function eun(n,e=Zcn()){let t=0,i=0;function r(o){const s=o.body.length;t+=s,i++;const a={body:o.body,method:"POST",referrerPolicy:"origin",headers:n.headers,keepalive:t<=6e4&&i<15,...n.fetchOptions};try{return e(n.url,a).then(l=>(t-=s,i--,{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}))}catch(l){return Jcn(),t-=s,i--,tme(l)}}return jze(n,r)}const tun=4;function nun(n){function e(t){return new jf((i,r)=>{const o=new XMLHttpRequest;o.onerror=r,o.onreadystatechange=()=>{o.readyState===tun&&i({statusCode:o.status,headers:{"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")}})},o.open("POST",n.url);for(const s in n.headers)Object.prototype.hasOwnProperty.call(n.headers,s)&&o.setRequestHeader(s,n.headers[s]);o.send(t.body)})}return jze(n,e)}const mU="?",iun=30,run=40,oun=50;function cme(n,e,t,i){const r={filename:n,function:e,in_app:!0};return t!==void 0&&(r.lineno=t),i!==void 0&&(r.colno=i),r}const sun=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,aun=/\((\S*)(?::(\d+))(?::(\d+))\)/,lun=n=>{const e=sun.exec(n);if(e){if(e[2]&&e[2].indexOf("eval")===0){const o=aun.exec(e[2]);o&&(e[2]=o[1],e[3]=o[2],e[4]=o[3])}const[i,r]=Kze(e[1]||mU,e[2]);return cme(r,i,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}},cun=[iun,lun],uun=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,dun=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,hun=n=>{const e=uun.exec(n);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const o=dun.exec(e[3]);o&&(e[1]=e[1]||"eval",e[3]=o[1],e[4]=o[2],e[5]="")}let i=e[3],r=e[1]||mU;return[r,i]=Kze(r,i),cme(i,r,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},fun=[oun,hun],gun=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,pun=n=>{const e=gun.exec(n);return e?cme(e[2],e[1]||mU,+e[3],e[4]?+e[4]:void 0):void 0},mun=[run,pun],_un=[cun,fun,mun],vun=Lze(..._un),Kze=(n,e)=>{const t=n.indexOf("safari-extension")!==-1,i=n.indexOf("safari-web-extension")!==-1;return t||i?[n.indexOf("@")!==-1?n.split("@")[0]:mU,t?`safari-extension:${e}`:`safari-web-extension:${e}`]:[n,e]};class _A{static __initStatic(){this.id="GlobalHandlers"}constructor(e){this.name=_A.id,this._options={onerror:!0,onunhandledrejection:!0,...e},this._installFunc={onerror:bun,onunhandledrejection:yun}}setupOnce(){Error.stackTraceLimit=50;const e=this._options;for(const t in e){const i=this._installFunc[t];i&&e[t]&&(Sun(t),i(),this._installFunc[t]=void 0)}}}_A.__initStatic();function bun(){Gf("error",n=>{const[e,t,i]=Qze();if(!e.getIntegration(_A))return;const{msg:r,url:o,line:s,column:a,error:l}=n;if(Uze()||l&&l.__sentry_own_request__)return;const c=l===void 0&&iw(r)?wun(r,o,s,a):Gze(lme(t,l||r,void 0,i,!1),o,s,a);c.level="error",Yze(e,l,c,"onerror")})}function yun(){Gf("unhandledrejection",n=>{const[e,t,i]=Qze();if(!e.getIntegration(_A))return;let r=n;try{"reason"in n?r=n.reason:"detail"in n&&"reason"in n.detail&&(r=n.detail.reason)}catch{}if(Uze()||r&&r.__sentry_own_request__)return!0;const o=vze(r)?Cun(r):lme(t,r,void 0,i,!0);o.level="error",Yze(e,r,o,"onunhandledrejection")})}function Cun(n){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(n)}`}]}}}function wun(n,e,t,i){const r=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let o=Zpe(n)?n.message:n,s="Error";const a=o.match(r);return a&&(s=a[1],o=a[2]),Gze({exception:{values:[{type:s,value:o}]}},e,t,i)}function Gze(n,e,t,i){const r=n.exception=n.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{},a=s.stacktrace=s.stacktrace||{},l=a.frames=a.frames||[],c=isNaN(parseInt(i,10))?void 0:i,u=isNaN(parseInt(t,10))?void 0:t,d=iw(e)&&e.length>0?e:Oan();return l.length===0&&l.push({colno:c,filename:d,function:"?",in_app:!0,lineno:u}),n}function Sun(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(`Global Handler attached: ${n}`)}function Yze(n,e,t,i){hM(t,{handled:!1,type:i}),n.captureEvent(t,{originalException:e})}function Qze(){const n=xl(),e=n.getClient(),t=e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[n,t.stackParser,t.attachStacktrace]}const Eun=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"];class _U{static __initStatic(){this.id="TryCatch"}constructor(e){this.name=_U.id,this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&$u(oa,"setTimeout",$Ie),this._options.setInterval&&$u(oa,"setInterval",$Ie),this._options.requestAnimationFrame&&$u(oa,"requestAnimationFrame",xun),this._options.XMLHttpRequest&&"XMLHttpRequest"in oa&&$u(XMLHttpRequest.prototype,"send",kun);const e=this._options.eventTarget;e&&(Array.isArray(e)?e:Eun).forEach(Tun)}}_U.__initStatic();function $Ie(n){return function(...e){const t=e[0];return e[0]=HD(t,{mechanism:{data:{function:_0(n)},handled:!1,type:"instrument"}}),n.apply(this,e)}}function xun(n){return function(e){return n.apply(this,[HD(e,{mechanism:{data:{function:"requestAnimationFrame",handler:_0(n)},handled:!1,type:"instrument"}})])}}function kun(n){return function(...e){const t=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(r=>{r in t&&typeof t[r]=="function"&&$u(t,r,function(o){const s={mechanism:{data:{function:r,handler:_0(o)},handled:!1,type:"instrument"}},a=eme(o);return a&&(s.mechanism.data.handler=_0(a)),HD(o,s)})}),n.apply(this,e)}}function Tun(n){const e=oa,t=e[n]&&e[n].prototype;!t||!t.hasOwnProperty||!t.hasOwnProperty("addEventListener")||($u(t,"addEventListener",function(i){return function(r,o,s){try{typeof o.handleEvent=="function"&&(o.handleEvent=HD(o.handleEvent,{mechanism:{data:{function:"handleEvent",handler:_0(o),target:n},handled:!1,type:"instrument"}}))}catch{}return i.apply(this,[r,HD(o,{mechanism:{data:{function:"addEventListener",handler:_0(o),target:n},handled:!1,type:"instrument"}}),s])}}),$u(t,"removeEventListener",function(i){return function(r,o,s){const a=o;try{const l=a&&a.__sentry_wrapped__;l&&i.call(this,r,l,s)}catch{}return i.call(this,r,a,s)}}))}const cB=1024;class vU{static __initStatic(){this.id="Breadcrumbs"}constructor(e){this.name=vU.id,this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){if(this.options.console&&Gf("console",Dun),this.options.dom&&Gf("dom",Lun(this.options.dom)),this.options.xhr&&Gf("xhr",Aun),this.options.fetch&&Gf("fetch",Run),this.options.history&&Gf("history",Nun),this.options.sentry){const e=xl().getClient();e&&e.on&&e.on("beforeSendEvent",Iun)}}}vU.__initStatic();function Iun(n){xl().addBreadcrumb({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:A1(n)},{event:n})}function Lun(n){function e(t){let i,r=typeof n=="object"?n.serializeAttribute:void 0,o=typeof n=="object"&&typeof n.maxStringLength=="number"?n.maxStringLength:void 0;o&&o>cB&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn(`\`dom.maxStringLength\` cannot exceed ${cB}, but a value of ${o} was configured. Sentry will use ${cB} instead.`),o=cB),typeof r=="string"&&(r=[r]);try{const s=t.event;i=Oun(s)?$D(s.target,{keyAttrs:r,maxStringLength:o}):$D(s,{keyAttrs:r,maxStringLength:o})}catch{i="<unknown>"}i.length!==0&&xl().addBreadcrumb({category:`ui.${t.name}`,message:i},{event:t.event,name:t.name,global:t.global})}return e}function Dun(n){const e={category:"console",data:{arguments:n.args,logger:"console"},level:bln(n.level),message:gIe(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)e.message=`Assertion failed: ${gIe(n.args.slice(1)," ")||"console.assert"}`,e.data.arguments=n.args.slice(1);else return;xl().addBreadcrumb(e,{input:n.args,level:n.level})}function Aun(n){const{startTimestamp:e,endTimestamp:t}=n,i=n.xhr[DI];if(!e||!t||!i)return;const{method:r,url:o,status_code:s,body:a}=i,l={method:r,url:o,status_code:s},c={xhr:n.xhr,input:a,startTimestamp:e,endTimestamp:t};xl().addBreadcrumb({category:"xhr",data:l,type:"http"},c)}function Run(n){const{startTimestamp:e,endTimestamp:t}=n;if(t&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const i=n.fetchData,r={data:n.error,input:n.args,startTimestamp:e,endTimestamp:t};xl().addBreadcrumb({category:"fetch",data:i,level:"error",type:"http"},r)}else{const i={...n.fetchData,status_code:n.response&&n.response.status},r={input:n.args,response:n.response,startTimestamp:e,endTimestamp:t};xl().addBreadcrumb({category:"fetch",data:i,type:"http"},r)}}function Nun(n){let e=n.from,t=n.to;const i=FX(oa.location.href);let r=FX(e);const o=FX(t);r.path||(r=i),i.protocol===o.protocol&&i.host===o.host&&(t=o.relative),i.protocol===r.protocol&&i.host===r.host&&(e=r.relative),xl().addBreadcrumb({category:"navigation",data:{from:e,to:t}})}function Oun(n){return!!n&&!!n.target}const Pun="cause",Mun=5;class bU{static __initStatic(){this.id="LinkedErrors"}constructor(e={}){this.name=bU.id,this._key=e.key||Pun,this._limit=e.limit||Mun}setupOnce(){}preprocessEvent(e,t,i){const r=i.getOptions();Dan(qze,r.stackParser,r.maxValueLength,this._key,this._limit,e,t)}}bU.__initStatic();class yU{static __initStatic(){this.id="HttpContext"}constructor(){this.name=yU.id}setupOnce(){}preprocessEvent(e){if(!oa.navigator&&!oa.location&&!oa.document)return;const t=e.request&&e.request.url||oa.location&&oa.location.href,{referrer:i}=oa.document||{},{userAgent:r}=oa.navigator||{},o={...e.request&&e.request.headers,...i&&{Referer:i},...r&&{"User-Agent":r}},s={...e.request,...t&&{url:t},headers:o};e.request=s}}yU.__initStatic();class CU{static __initStatic(){this.id="Dedupe"}constructor(){this.name=CU.id}setupOnce(e,t){}processEvent(e){if(e.type)return e;try{if(Fun(e,this._previousEvent))return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return this._previousEvent=e}}CU.__initStatic();function Fun(n,e){return e?!!(Bun(n,e)||$un(n,e)):!1}function Bun(n,e){const t=n.message,i=e.message;return!(!t&&!i||t&&!i||!t&&i||t!==i||!Zze(n,e)||!Xze(n,e))}function $un(n,e){const t=VIe(e),i=VIe(n);return!(!t||!i||t.type!==i.type||t.value!==i.value||!Zze(n,e)||!Xze(n,e))}function Xze(n,e){let t=HIe(n),i=HIe(e);if(!t&&!i)return!0;if(t&&!i||!t&&i||(t=t,i=i,i.length!==t.length))return!1;for(let r=0;r<i.length;r++){const o=i[r],s=t[r];if(o.filename!==s.filename||o.lineno!==s.lineno||o.colno!==s.colno||o.function!==s.function)return!1}return!0}function Zze(n,e){let t=n.fingerprint,i=e.fingerprint;if(!t&&!i)return!0;if(t&&!i||!t&&i)return!1;t=t,i=i;try{return t.join("")===i.join("")}catch{return!1}}function VIe(n){return n.exception&&n.exception.values&&n.exception.values[0]}function HIe(n){const e=n.exception;if(e)try{return e.values[0].stacktrace.frames}catch{return}}const Vun=[new pU,new gU,new _U,new vU,new _A,new bU,new CU,new yU];function Hun(n={}){n.defaultIntegrations===void 0&&(n.defaultIntegrations=Vun),n.release===void 0&&(typeof __SENTRY_RELEASE__=="string"&&(n.release=__SENTRY_RELEASE__),oa.SENTRY_RELEASE&&oa.SENTRY_RELEASE.id&&(n.release=oa.SENTRY_RELEASE.id)),n.autoSessionTracking===void 0&&(n.autoSessionTracking=!0),n.sendClientReports===void 0&&(n.sendClientReports=!0);const e={...n,stackParser:Uan(n.stackParser||vun),integrations:pcn(n),transport:n.transport||(Dze()?eun:nun)};Tcn(Xcn,e),n.autoSessionTracking&&Wun()}function WIe(n){n.startSession({ignoreDuration:!0}),n.captureSession()}function Wun(){if(typeof oa.document>"u"){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");return}const n=xl();n.captureSession&&(WIe(n),Gf("history",({from:e,to:t})=>{e===void 0||e===t||WIe(xl())}))}const ca=Oc;function zun(){ca&&ca.document?ca.document.addEventListener("visibilitychange",()=>{const n=a5();if(ca.document.hidden&&n){const e="cancelled";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n.op}`),n.status||n.setStatus(e),n.setTag("visibilitychange","document.hidden"),n.finish()}}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const ume=(n,e,t)=>{let i,r;return o=>{e.value>=0&&(o||t)&&(r=e.value-(i||0),(r||i===void 0)&&(i=e.value,e.delta=r,n(e)))}},jun=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,Uun=()=>{const n=ca.performance.timing,e=ca.performance.navigation.type,t={entryType:"navigation",startTime:0,type:e==2?"back_forward":e===1?"reload":"navigate"};for(const i in n)i!=="navigationStart"&&i!=="toJSON"&&(t[i]=Math.max(n[i]-n.navigationStart,0));return t},Jze=()=>ca.__WEB_VITALS_POLYFILL__?ca.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||Uun()):ca.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],eje=()=>{const n=Jze();return n&&n.activationStart||0},dme=(n,e)=>{const t=Jze();let i="navigate";return t&&(ca.document.prerendering||eje()>0?i="prerender":i=t.type.replace(/_/g,"-")),{name:n,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:jun(),navigationType:i}},wU=(n,e,t)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(n)){const i=new PerformanceObserver(r=>{e(r.getEntries())});return i.observe(Object.assign({type:n,buffered:!0},t||{})),i}}catch{}},SU=(n,e)=>{const t=i=>{(i.type==="pagehide"||ca.document.visibilityState==="hidden")&&(n(i),e&&(removeEventListener("visibilitychange",t,!0),removeEventListener("pagehide",t,!0)))};addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0)},qun=n=>{const e=dme("CLS",0);let t,i=0,r=[];const o=a=>{a.forEach(l=>{if(!l.hadRecentInput){const c=r[0],u=r[r.length-1];i&&r.length!==0&&l.startTime-u.startTime<1e3&&l.startTime-c.startTime<5e3?(i+=l.value,r.push(l)):(i=l.value,r=[l]),i>e.value&&(e.value=i,e.entries=r,t&&t())}})},s=wU("layout-shift",o);if(s){t=ume(n,e);const a=()=>{o(s.takeRecords()),t(!0)};return SU(a),a}};let w8=-1;const Kun=()=>ca.document.visibilityState==="hidden"&&!ca.document.prerendering?0:1/0,Gun=()=>{SU(({timeStamp:n})=>{w8=n},!0)},hme=()=>(w8<0&&(w8=Kun(),Gun()),{get firstHiddenTime(){return w8}}),Yun=n=>{const e=hme(),t=dme("FID");let i;const r=a=>{a.startTime<e.firstHiddenTime&&(t.value=a.processingStart-a.startTime,t.entries.push(a),i(!0))},o=a=>{a.forEach(r)},s=wU("first-input",o);i=ume(n,t),s&&SU(()=>{o(s.takeRecords()),s.disconnect()},!0)},zIe={},Qun=n=>{const e=hme(),t=dme("LCP");let i;const r=s=>{const a=s[s.length-1];if(a){const l=Math.max(a.startTime-eje(),0);l<e.firstHiddenTime&&(t.value=l,t.entries=[a],i())}},o=wU("largest-contentful-paint",r);if(o){i=ume(n,t);const s=()=>{zIe[t.id]||(r(o.takeRecords()),o.disconnect(),zIe[t.id]=!0,i(!0))};return["keydown","click"].forEach(a=>{addEventListener(a,s,{once:!0,capture:!0})}),SU(s,!0),s}},IO={},vV={};let tje,nje,ije;function Xun(n){return gme("cls",n,edn,tje)}function Zun(n){return gme("lcp",n,ndn,ije)}function Jun(n){return gme("fid",n,tdn,nje)}function fme(n,e){return rje(n,e),vV[n]||(idn(n),vV[n]=!0),oje(n,e)}function EU(n,e){const t=IO[n];if(!(!t||!t.length))for(const i of t)try{i(e)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.error(`Error while triggering instrumentation handler.
Type: ${n}
Name: ${_0(i)}
Error:`,r)}}function edn(){qun(n=>{EU("cls",{metric:n}),tje=n})}function tdn(){Yun(n=>{EU("fid",{metric:n}),nje=n})}function ndn(){Qun(n=>{EU("lcp",{metric:n}),ije=n})}function gme(n,e,t,i){return rje(n,e),vV[n]||(t(),vV[n]=!0),i&&e({metric:i}),oje(n,e)}function idn(n){const e={};n==="event"&&(e.durationThreshold=0),wU(n,t=>{EU(n,{entries:t})},e)}function rje(n,e){IO[n]=IO[n]||[],IO[n].push(e)}function oje(n,e){return()=>{const t=IO[n];if(!t)return;const i=t.indexOf(e);i!==-1&&t.splice(i,1)}}function VX(n){return typeof n=="number"&&isFinite(n)}function WD(n,{startTimestamp:e,...t}){return e&&n.startTimestamp>e&&(n.startTimestamp=e),n.startChild({startTimestamp:e,...t})}function Ic(n){return n/1e3}function sje(){return ca&&ca.addEventListener&&ca.performance}let jIe=0,hl={},tv,LO;function rdn(){const n=sje();if(n&&rb){n.mark&&ca.performance.mark("sentry-tracing-init");const e=cdn(),t=adn(),i=ldn();return()=>{e(),t(),i()}}return()=>{}}function odn(){fme("longtask",({entries:n})=>{for(const e of n){const t=a5();if(!t)return;const i=Ic(rb+e.startTime),r=Ic(e.duration);t.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:i,endTimestamp:i+r})}})}function sdn(){fme("event",({entries:n})=>{for(const e of n){const t=a5();if(!t)return;if(e.name==="click"){const i=Ic(rb+e.startTime),r=Ic(e.duration);t.startChild({description:$D(e.target),op:`ui.interaction.${e.name}`,origin:"auto.ui.browser.metrics",startTimestamp:i,endTimestamp:i+r})}}})}function adn(){return Xun(({metric:n})=>{const e=n.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("[Measurements] Adding CLS"),hl.cls={value:n.value,unit:""},LO=e)})}function ldn(){return Zun(({metric:n})=>{const e=n.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("[Measurements] Adding LCP"),hl.lcp={value:n.value,unit:"millisecond"},tv=e)})}function cdn(){return Jun(({metric:n})=>{const e=n.entries.pop();if(!e)return;const t=Ic(rb),i=Ic(e.startTime);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("[Measurements] Adding FID"),hl.fid={value:n.value,unit:"millisecond"},hl["mark.fid"]={value:t+i,unit:"second"}})}function udn(n){const e=sje();if(!e||!ca.performance.getEntries||!rb)return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("[Tracing] Adding & adjusting spans using Performance API");const t=Ic(rb),i=e.getEntries();let r,o;if(i.slice(jIe).forEach(s=>{const a=Ic(s.startTime),l=Ic(s.duration);if(!(n.op==="navigation"&&t+a<n.startTimestamp))switch(s.entryType){case"navigation":{hdn(n,s,t),r=t+Ic(s.responseStart),o=t+Ic(s.requestStart);break}case"mark":case"paint":case"measure":{ddn(n,s,a,l,t);const c=hme(),u=s.startTime<c.firstHiddenTime;s.name==="first-paint"&&u&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("[Measurements] Adding FP"),hl.fp={value:s.startTime,unit:"millisecond"}),s.name==="first-contentful-paint"&&u&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("[Measurements] Adding FCP"),hl.fcp={value:s.startTime,unit:"millisecond"});break}case"resource":{const c=s.name.replace(ca.location.origin,"");gdn(n,s,c,a,l,t);break}}}),jIe=Math.max(i.length-1,0),pdn(n),n.op==="pageload"){typeof r=="number"&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("[Measurements] Adding TTFB"),hl.ttfb={value:(r-n.startTimestamp)*1e3,unit:"millisecond"},typeof o=="number"&&o<=r&&(hl["ttfb.requestTime"]={value:(r-o)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(a=>{if(!hl[a]||t>=n.startTimestamp)return;const l=hl[a].value,c=t+Ic(l),u=Math.abs((c-n.startTimestamp)*1e3),d=u-l;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(`[Measurements] Normalized ${a} from ${l} to ${u} (${d})`),hl[a].value=u});const s=hl["mark.fid"];s&&hl.fid&&(WD(n,{description:"first input delay",endTimestamp:s.value+Ic(hl.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:s.value}),delete hl["mark.fid"]),"fcp"in hl||delete hl.cls,Object.keys(hl).forEach(a=>{n.setMeasurement(a,hl[a].value,hl[a].unit)}),mdn(n)}tv=void 0,LO=void 0,hl={}}function ddn(n,e,t,i,r){const o=r+t,s=o+i;return WD(n,{description:e.name,endTimestamp:s,op:e.entryType,origin:"auto.resource.browser.metrics",startTimestamp:o}),o}function hdn(n,e,t){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(i=>{uB(n,e,i,t)}),uB(n,e,"secureConnection",t,"TLS/SSL","connectEnd"),uB(n,e,"fetch",t,"cache","domainLookupStart"),uB(n,e,"domainLookup",t,"DNS"),fdn(n,e,t)}function uB(n,e,t,i,r,o){const s=o?e[o]:e[`${t}End`],a=e[`${t}Start`];!a||!s||WD(n,{op:"browser",origin:"auto.browser.browser.metrics",description:r||t,startTimestamp:i+Ic(a),endTimestamp:i+Ic(s)})}function fdn(n,e,t){WD(n,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:t+Ic(e.requestStart),endTimestamp:t+Ic(e.responseEnd)}),WD(n,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:t+Ic(e.responseStart),endTimestamp:t+Ic(e.responseEnd)})}function gdn(n,e,t,i,r,o){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const s={};"transferSize"in e&&(s["http.response_transfer_size"]=e.transferSize),"encodedBodySize"in e&&(s["http.response_content_length"]=e.encodedBodySize),"decodedBodySize"in e&&(s["http.decoded_response_content_length"]=e.decodedBodySize),"renderBlockingStatus"in e&&(s["resource.render_blocking_status"]=e.renderBlockingStatus);const a=o+i,l=a+r;WD(n,{description:t,endTimestamp:l,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:a,data:s})}function pdn(n){const e=ca.navigator;if(!e)return;const t=e.connection;t&&(t.effectiveType&&n.setTag("effectiveConnectionType",t.effectiveType),t.type&&n.setTag("connectionType",t.type),VX(t.rtt)&&(hl["connection.rtt"]={value:t.rtt,unit:"millisecond"})),VX(e.deviceMemory)&&n.setTag("deviceMemory",`${e.deviceMemory} GB`),VX(e.hardwareConcurrency)&&n.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function mdn(n){tv&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("[Measurements] Adding LCP Data"),tv.element&&n.setTag("lcp.element",$D(tv.element)),tv.id&&n.setTag("lcp.id",tv.id),tv.url&&n.setTag("lcp.url",tv.url.trim().slice(0,200)),n.setTag("lcp.size",tv.size)),LO&&LO.sources&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log("[Measurements] Adding CLS Data"),LO.sources.forEach((e,t)=>n.setTag(`cls.source.${t+1}`,$D(e.node))))}const jre=["localhost",/^\/(?!\/)/],Ure={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:jre,tracePropagationTargets:jre};function _dn(n){const{traceFetch:e,traceXHR:t,tracePropagationTargets:i,tracingOrigins:r,shouldCreateSpanForRequest:o,enableHTTPTimings:s}={traceFetch:Ure.traceFetch,traceXHR:Ure.traceXHR,...n},a=typeof o=="function"?o:u=>!0,l=u=>Cdn(u,i||r),c={};e&&Gf("fetch",u=>{const d=wdn(u,a,l,c);s&&d&&UIe(d)}),t&&Gf("xhr",u=>{const d=Edn(u,a,l,c);s&&d&&UIe(d)})}function vdn(n){return n.entryType==="resource"&&"initiatorType"in n&&typeof n.nextHopProtocol=="string"&&(n.initiatorType==="fetch"||n.initiatorType==="xmlhttprequest")}function UIe(n){const e=n.data.url;if(!e)return;const t=fme("resource",({entries:i})=>{i.forEach(r=>{vdn(r)&&r.name.endsWith(e)&&(ydn(r).forEach(s=>n.setData(...s)),setTimeout(t))})})}function bdn(n){let e="unknown",t="unknown",i="";for(const r of n){if(r==="/"){[e,t]=n.split("/");break}if(!isNaN(Number(r))){e=i==="h"?"http":i,t=n.split(i)[1];break}i+=r}return i===n&&(e=i),{name:e,version:t}}function K_(n=0){return((rb||performance.timeOrigin)+n)/1e3}function ydn(n){const{name:e,version:t}=bdn(n.nextHopProtocol),i=[];return i.push(["network.protocol.version",t],["network.protocol.name",e]),rb?[...i,["http.request.redirect_start",K_(n.redirectStart)],["http.request.fetch_start",K_(n.fetchStart)],["http.request.domain_lookup_start",K_(n.domainLookupStart)],["http.request.domain_lookup_end",K_(n.domainLookupEnd)],["http.request.connect_start",K_(n.connectStart)],["http.request.secure_connection_start",K_(n.secureConnectionStart)],["http.request.connection_end",K_(n.connectEnd)],["http.request.request_start",K_(n.requestStart)],["http.request.response_start",K_(n.responseStart)],["http.request.response_end",K_(n.responseEnd)]]:i}function Cdn(n,e){return i5(n,e||jre)}function wdn(n,e,t,i){if(!sme()||!n.fetchData)return;const r=e(n.fetchData.url);if(n.endTimestamp&&r){const h=n.fetchData.__span;if(!h)return;const g=i[h];if(g){if(n.response){g.setHttpStatus(n.response.status);const p=n.response&&n.response.headers&&n.response.headers.get("content-length"),m=parseInt(p);m>0&&g.setData("http.response_content_length",m)}else n.error&&g.setStatus("internal_error");g.finish(),delete i[h]}return}const o=xl(),s=o.getScope(),a=o.getClient(),l=s.getSpan(),{method:c,url:u}=n.fetchData,d=r&&l?l.startChild({data:{url:u,type:"fetch","http.method":c},description:`${c} ${u}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(d&&(n.fetchData.__span=d.spanId,i[d.spanId]=d),t(n.fetchData.url)&&a){const h=n.args[0];n.args[1]=n.args[1]||{};const g=n.args[1];g.headers=Sdn(h,a,s,g,d)}return d}function Sdn(n,e,t,i,r){const o=r||t.getSpan(),s=o&&o.transaction,{traceId:a,sampled:l,dsc:c}=t.getPropagationContext(),u=o?o.toTraceparent():nme(a,void 0,l),d=s?s.getDynamicSamplingContext():c||fU(a,e,t),h=Bre(d),g=typeof Request<"u"&&m0(n,Request)?n.headers:i.headers;if(g)if(typeof Headers<"u"&&m0(g,Headers)){const p=new Headers(g);return p.append("sentry-trace",u),h&&p.append(Fre,h),p}else if(Array.isArray(g)){const p=[...g,["sentry-trace",u]];return h&&p.push([Fre,h]),p}else{const p="baggage"in g?g.baggage:void 0,m=[];return Array.isArray(p)?m.push(...p):p&&m.push(p),h&&m.push(h),{...g,"sentry-trace":u,baggage:m.length>0?m.join(","):void 0}}else return{"sentry-trace":u,baggage:h}}function Edn(n,e,t,i){const r=n.xhr,o=r&&r[DI];if(!sme()||r&&r.__sentry_own_request__||!r||!o)return;const s=e(o.url);if(n.endTimestamp&&s){const d=r.__sentry_xhr_span_id__;if(!d)return;const h=i[d];h&&(h.setHttpStatus(o.status_code),h.finish(),delete i[d]);return}const a=xl(),l=a.getScope(),c=l.getSpan(),u=s&&c?c.startChild({data:{...o.data,type:"xhr","http.method":o.method,url:o.url},description:`${o.method} ${o.url}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(u&&(r.__sentry_xhr_span_id__=u.spanId,i[r.__sentry_xhr_span_id__]=u),r.setRequestHeader&&t(o.url))if(u){const d=u&&u.transaction,h=d&&d.getDynamicSamplingContext(),g=Bre(h);qIe(r,u.toTraceparent(),g)}else{const d=a.getClient(),{traceId:h,sampled:g,dsc:p}=l.getPropagationContext(),m=nme(h,void 0,g),_=p||(d?fU(h,d,l):void 0),v=Bre(_);qIe(r,m,v)}return u}function qIe(n,e,t){try{n.setRequestHeader("sentry-trace",e),t&&n.setRequestHeader(Fre,t)}catch{}}function xdn(n,e=!0,t=!0){if(!ca||!ca.location){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn("Could not initialize routing instrumentation due to invalid location");return}let i=ca.location.href,r;e&&(r=n({name:ca.location.pathname,startTimestamp:rb?rb/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),t&&Gf("history",({to:o,from:s})=>{if(s===void 0&&i&&i.indexOf(o)!==-1){i=void 0;return}s!==o&&(i=void 0,r&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(`[Tracing] Finishing current transaction with op: ${r.op}`),r.finish()),r=n({name:ca.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}const kdn="BrowserTracing",Tdn={...C8,markBackgroundTransactions:!0,routingInstrumentation:xdn,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...Ure};class Idn{constructor(e){this.name=kdn,this._hasSetTracePropagationTargets=!1,icn(),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this._hasSetTracePropagationTargets=!!(e&&(e.tracePropagationTargets||e.tracingOrigins))),this.options={...Tdn,...e},this.options._experiments.enableLongTask!==void 0&&(this.options.enableLongTask=this.options._experiments.enableLongTask),e&&!e.tracePropagationTargets&&e.tracingOrigins&&(this.options.tracePropagationTargets=e.tracingOrigins),this._collectWebVitals=rdn(),this.options.enableLongTask&&odn(),this.options._experiments.enableInteractions&&sdn()}setupOnce(e,t){this._getCurrentHub=t;const r=t().getClient(),o=r&&r.getOptions(),{routingInstrumentation:s,startTransactionOnLocationChange:a,startTransactionOnPageLoad:l,markBackgroundTransactions:c,traceFetch:u,traceXHR:d,shouldCreateSpanForRequest:h,enableHTTPTimings:g,_experiments:p}=this.options,m=o&&o.tracePropagationTargets,_=m||this.options.tracePropagationTargets;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this._hasSetTracePropagationTargets&&m&&pn.warn("[Tracing] The `tracePropagationTargets` option was set in the BrowserTracing integration and top level `Sentry.init`. The top level `Sentry.init` value is being used."),s(v=>{const b=this._createRouteTransaction(v);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(b,v,t),b},l,a),c&&zun(),p.enableInteractions&&this._registerInteractionListener(),_dn({traceFetch:u,traceXHR:d,tracePropagationTargets:_,shouldCreateSpanForRequest:h,enableHTTPTimings:g})}_createRouteTransaction(e){if(!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}const t=this._getCurrentHub(),{beforeNavigate:i,idleTimeout:r,finalTimeout:o,heartbeatInterval:s}=this.options,a=e.op==="pageload",l=a?KIe("sentry-trace"):"",c=a?KIe("baggage"):"",{traceparentData:u,dynamicSamplingContext:d,propagationContext:h}=Iln(l,c),g={...e,...u,metadata:{...e.metadata,dynamicSamplingContext:u&&!d?{}:d},trimEnd:!0},p=typeof i=="function"?i(g):g,m=p===void 0?{...g,sampled:!1}:p;m.metadata=m.name!==g.name?{...m.metadata,source:"custom"}:m.metadata,this._latestRouteName=m.name,this._latestRouteSource=m.metadata&&m.metadata.source,m.sampled===!1&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(`[Tracing] Will not send ${m.op} transaction because of beforeNavigate.`),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.log(`[Tracing] Starting ${m.op} transaction on scope`);const{location:_}=ca,v=NIe(t,m,r,o,!0,{location:_},s),b=t.getScope();return a&&u?b.setPropagationContext(h):b.setPropagationContext({traceId:v.traceId,spanId:v.spanId,parentSpanId:v.parentSpanId,sampled:v.sampled}),v.registerBeforeFinishCallback(y=>{this._collectWebVitals(),udn(y)}),v}_registerInteractionListener(){let e;const t=()=>{const{idleTimeout:i,finalTimeout:r,heartbeatInterval:o}=this.options,s="ui.action.click",a=a5();if(a&&a.op&&["navigation","pageload"].includes(a.op)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn(`[Tracing] Did not create ${s} transaction because a pageload or navigation transaction is in progress.`);return}if(e&&(e.setFinishReason("interactionInterrupted"),e.finish(),e=void 0),!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn(`[Tracing] Did not create ${s} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRouteName){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pn.warn(`[Tracing] Did not create ${s} transaction because _latestRouteName is missing.`);return}const l=this._getCurrentHub(),{location:c}=ca,u={name:this._latestRouteName,op:s,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};e=NIe(l,u,i,r,!0,{location:c},o)};["click"].forEach(i=>{addEventListener(i,t,{once:!1,capture:!0})})}}function KIe(n){const e=Pan(`meta[name=${n}]`);return e?e.getAttribute("content"):void 0}function Ldn(n){const e={_metadata:{},...n};e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.react",packages:[{name:"npm:@sentry/react",version:mV}],version:mV},Hun(e)}function Ddn(n){const e=ol();return w.useEffect(()=>{window.scrollTo(0,0)},[e]),f(_t,{children:n.children})}var aje,GIe=Yp;aje=GIe.createRoot,GIe.hydrateRoot;const Adn="Organization",Rdn="Name",Ndn="Website",Odn="Phone",Pdn="Address",Mdn="Street",Fdn="Apt/Suite",Bdn="City",$dn="State/Province",Vdn="Postal Code",Hdn="Country",Wdn="Contacts",zdn="First Name",jdn="Last Name",Udn="Phone",qdn="Email",Kdn="Additional Info",Gdn="Payment Terms",Ydn="Currency",Qdn="Company Size",Xdn="Industry",Zdn="Private Notes",Jdn="Invoice",ehn="Client",thn="Invoice Date",nhn="Due Date",ihn="Invoice Number",rhn="Invoice #",ohn="PO Number",shn="PO #",ahn="How Often",lhn="Discount",chn="Taxes",uhn="Tax",dhn="Item",hhn="Description",fhn="Unit Cost",ghn="Quantity",phn="Line Total",mhn="Subtotal",_hn="Net",vhn="Paid to Date",bhn="Balance Due",yhn="Design",Chn="Terms",whn="Your Invoice",Shn="Remove contact",Ehn="Add contact",xhn="Create new client",khn="Edit client details",Thn="Enable",Ihn="Learn more",Lhn="Manage rates",Dhn="Note to Client",Ahn="Invoice Terms",Rhn="Save as default terms",Nhn="Download PDF",Ohn="Pay Now",Phn="Save Invoice",Mhn="Clone To Invoice",Fhn="Archive Invoice",Bhn="Delete Invoice",$hn="Email Invoice",Vhn="Enter Payment",Hhn="Tax Rates",Whn="Rate",zhn="Settings",jhn="Enable specifying an <b>invoice tax</b>",Uhn="Enable specifying <b>line item taxes</b>",qhn="Dashboard",Khn='Note: add a :link named ":name" to show the totals using a single base currency.',Ghn="Clients",Yhn="Invoices",Qhn="Payments",Xhn="Credits",Zhn="History",Jhn="Search",efn="Sign Up",tfn="Guest",nfn="Company Details",ifn="Online Payments",rfn="Notifications",ofn="Import | Export",sfn="Done",afn="Save",lfn="Create",cfn="Upload",ufn="Download",dfn="Cancel",hfn="Close",ffn="Please provide a valid email address",gfn="Powered by",pfn="No items",mfn="Recurring Invoices",_fn=`<p>Automatically send clients the same invoices weekly, bi-monthly, monthly, quarterly or annually. </p>
<p>Use :MONTH, :QUARTER or :YEAR for dynamic dates. Basic math works as well, for example :MONTH-1.</p>
<p>Examples of dynamic invoice variables:</p>
<ul>
<li>"Gym membership for the month of :MONTH" >> "Gym membership for the month of July"</li>
<li>":YEAR+1 yearly subscription" >> "2015 Yearly Subscription"</li>
<li>"Retainer payment for :QUARTER+1" >> "Retainer payment for Q2"</li>
</ul>`,vfn="Recurring Quotes",bfn="in total revenue",yfn="billed client",Cfn="billed clients",wfn="active client",Sfn="active clients",Efn="Invoices Past Due",xfn="Upcoming Invoices",kfn="Average Invoice",Tfn="Archive",Ifn="Archive Client",Lfn="Delete Client",Dfn="Archive Payment",Afn="Delete Payment",Rfn="Archive Credit",Nfn="Delete Credit",Ofn="Show archived/deleted",Pfn="Filter",Mfn="New Client",Ffn="New Invoice",Bfn="Enter Payment",$fn="Enter Credit",Vfn="Contact",Hfn="Date Created",Wfn="Last Login",zfn="Balance",jfn="Action",Ufn="Status",qfn="Invoice Total",Kfn="Frequency",Gfn="Range",Yfn="Start Date",Qfn="End Date",Xfn="Transaction Reference",Zfn="Method",Jfn="Payment Amount",egn="Payment Date",tgn="Credit Amount",ngn="Credit Balance",ign="Credit Date",rgn="No data available in table",ogn="Select",sgn="Edit Client",agn="Edit Invoice",lgn="Create Invoice",cgn="Enter Credit",ugn="Last logged in",dgn="Details",hgn="Standing",fgn="Credit",ggn="Activity",pgn="Date",mgn="Message",_gn="Adjustment",vgn="Are you sure?",bgn="Payment Type",ygn="Amount",Cgn="Email",wgn="Language",Sgn="Timezone",Egn="Date Format",xgn="Date/Time Format",kgn="Users",Tgn="Localization",Ign="Remove logo",Lgn="Supported: JPEG, GIF and PNG",Dgn="Payment Gateway",Agn="Gateway",Rgn="Email Notifications",Ngn="Email me when an invoice is <b>viewed</b>",Ogn="Email me when an invoice is <b>paid</b>",Pgn="Site Updates",Mgn="Custom Messages",Fgn="Set default <b>email signature</b>",Bgn="Please select a file",$gn="Use first row as headers",Vgn="Column",Hgn="Sample",Wgn="Import to",zgn="client will be created",jgn="clients will be created",Ugn="Email Settings",qgn="Client View Styling",Kgn="Attach PDF",Ggn="Custom CSS",Ygn="Import Client Data",Qgn="CSV file",Xgn="Export Client Data",Zgn="Successfully created client",Jgn="Successfully created :count client(s)",epn="Successfully updated settings",tpn="Successfully removed logo",npn="Successfully sent message",ipn="Please make sure to select a client and correct any errors",rpn="You've hit the :count client limit on Free accounts. Congrats on your success!",opn="There was an error processing your payment. Please try again later.",spn="Registration Required",apn="Please confirm your email address, :link to resend the confirmation email.",lpn="Successfully updated client",cpn="Successfully archived client",upn="Successfully archived :count clients",dpn="Successfully deleted client",hpn="Successfully deleted :count clients",fpn="Successfully updated invoice",gpn="Successfully created invoice",ppn="Successfully cloned invoice",mpn="Successfully emailed invoice",_pn="and created client",vpn="Successfully archived invoice",bpn="Successfully archived :count invoices",ypn="Successfully deleted invoice",Cpn="Successfully deleted :count invoices",wpn="Successfully created payment",Spn="Successfully created :count payment(s)",Epn="Successfully archived payment",xpn="Successfully archived :count payments",kpn="Successfully deleted payment",Tpn="Successfully deleted :count payments",Ipn="Successfully applied payment",Lpn="Successfully created credit",Dpn="Successfully archived credit",Apn="Successfully archived :count credits",Rpn="Successfully deleted credit",Npn="Successfully deleted :count credits",Opn="Successfully imported file",Ppn="Successfully updated vendor",Mpn="Successfully created vendor",Fpn="Successfully archived vendor",Bpn="Successfully archived :count vendors",$pn="Successfully deleted vendor",Vpn="Successfully deleted :count vendors",Hpn="Account Confirmation",Wpn="Account Confirmation",zpn="Please access the link below to confirm your account.",jpn="New invoice :number from :account",Upn="To view your invoice for :amount, click the link below.",qpn="Payment Received",Kpn="Thank you for your payment of :amount.",Gpn="Dear :name,",Ypn="Regards,",Qpn="The Invoice Ninja Team",Xpn="To view the invoice click the link below:",Zpn="Invoice :invoice was paid by :client",Jpn="Invoice :invoice was sent to :client",emn="Invoice :invoice was viewed by :client",tmn="A payment of :amount was made by client :client towards Invoice :invoice.",nmn="The following client :client was emailed Invoice :invoice for :amount.",imn="The following client :client viewed Invoice :invoice for :amount.",rmn="Invoice :invoicenumber for :amount for client :client",omn="Payment with no invoice for amount :amount for client :client",smn="You can reset your account password by clicking the following button:",amn="Secure Payment",lmn="Card Number",cmn="Expiration Month",umn="Expiration Year",dmn="CVV",hmn="Log Out",fmn="Sign up to save your work",gmn="I agree to the :terms",pmn="Terms of Service",mmn="The email address is already registered",_mn="Working",vmn="Success",bmn="You have successfully registered! Please visit the link in the account confirmation email to verify your email address.",ymn="Your account is not registered, this will permanently erase your data.",Cmn="Password",wmn="Pro Plan",Smn="You have unsaved changes",Emn="Custom Fields",xmn="Company Fields",kmn="Client Fields",Tmn="Field Label",Imn="Field Value",Lmn="Edit",Dmn="Set your company name",Amn="View as recipient",Rmn="Product Library",Nmn="Product",Omn="Products",Pmn="Auto-fill products",Mmn="Selecting a product will automatically <b>fill in the description and cost</b>",Fmn="Auto-update products",Bmn="Updating an invoice will automatically <b>update the product library</b>",$mn="Add Product",Vmn="Edit Product",Hmn="Archive Product",Wmn="Successfully updated product",zmn="Successfully created product",jmn="Successfully archived product",Umn=":link to enable custom fields by joining the Pro Plan",qmn="Advanced Settings",Kmn=":link to enable the advanced settings by joining the Pro Plan",Gmn="Invoice Design",Ymn="Specify colors",Qmn="Select the colors used in the invoice",Xmn="Chart Builder",Zmn="Created by :site | Create. Send. Get Paid.",Jmn="Go Pro",e_n="Quote",t_n="Quotes",n_n="Quote Number",i_n="Quote #",r_n="Quote Date",o_n="Quote Total",s_n="Your Quote",a_n="Total",l_n="Clone",c_n="New Quote",u_n="Create Quote",d_n="Edit Quote",h_n="Archive Quote",f_n="Delete Quote",g_n="Save Quote",p_n="Email Quote",m_n="Clone To Quote",__n="Convert to Invoice",v_n="View Invoice",b_n="View Client",y_n="View Quote",C_n="Successfully updated quote",w_n="Successfully created quote",S_n="Successfully cloned quote",E_n="Successfully emailed quote",x_n="Successfully archived quote",k_n="Successfully archived :count quotes",T_n="Successfully deleted quote",I_n="Successfully deleted :count quotes",L_n="Successfully converted quote to invoice",D_n="New quote :number from :account",A_n="To view your quote for :amount, click the link below.",R_n="To view your client quote click the link below:",N_n="Quote :invoice was sent to :client",O_n="Quote :invoice was viewed by :client",P_n="The following client :client was emailed Quote :invoice for :amount.",M_n="The following client :client viewed Quote :invoice for :amount.",F_n="Your session has expired.",B_n="Invoice Fields",$_n="Invoice Options",V_n="Hide Paid to Date",H_n='Only display the "Paid to Date" area on your invoices once a payment has been received.',W_n="Charge taxes",z_n="User Management",j_n="Add User",U_n="Send Invitation",q_n="Successfully sent invitation",K_n="Successfully updated user",G_n="You've been invited by :invitor. ",Y_n="Please sign up to add a user",Q_n="State",X_n="Edit User",Z_n="Delete User",J_n="Active",evn="Pending",tvn="Successfully deleted user",nvn="Are you sure you want to email this invoice?",ivn="Are you sure you want to email this quote?",rvn="Are you sure you want this invoice emailed?",ovn="Are you sure you want to start the recurrence?",svn="Delete Account",avn="Warning: This will permanently delete your account, there is no undo.",lvn="Go Back",cvn="Data Visualizations",uvn="Sample data shown",dvn="Hide",hvn="A new version of :releases_link is available. You're running v:user_version, the latest is v:latest_version",fvn="Invoice Settings",gvn="Invoice Number Prefix",pvn="Invoice Number Counter",mvn="Quote Number Prefix",_vn="Quote Number Counter",vvn="Share invoice counter",bvn="Invoice issued to",yvn="To prevent a possible conflict please set either an invoice or quote number prefix",Cvn="Mark Sent",wvn="More designs",Svn="Additional Invoice Designs",Evn="Go Pro for more invoice designs",xvn="",kvn="",Tvn="Buy",Ivn="Successfully added additional invoice designs",Lvn="Sent",Dvn="VAT Number",Avn="Enter Your Billing Address and Credit Card information",Rvn="*This is the 3-4 digit number on the back of your card",Nvn="*Billing address must match address associated with credit card.",Ovn='*Please click "PAY NOW" only once - transaction may take up to 1 minute to process.',Pvn="ID Number",Mvn="White label",Fvn="White Label",Bvn="Successfully enabled white label license",$vn="White labeled",Vvn="Restore",Hvn="Restore Invoice",Wvn="Restore Quote",zvn="Restore Client",jvn="Restore Credit",Uvn="Restore Payment",qvn="Successfully restored invoice",Kvn="Successfully restored quote",Gvn="Successfully restored client",Yvn="Successfully restored payment",Qvn="Successfully restored credit",Xvn="Help us improve our site by telling us why you're leaving.",Zvn="Percent",Jvn="Amount",ebn="Invoice History",tbn="Quote History",nbn="Current version",ibn="Select version",rbn="View History",obn="Edit Payment",sbn="Successfully updated payment",abn="Deleted",lbn="Restore User",cbn="Successfully restored user",ubn="Show deleted users",dbn="Email Templates",hbn="Invoice Email",fbn="Payment Email",gbn="Quote Email",pbn="Reset All",mbn="Approve",_bn="Token Billing",vbn="Disabled",bbn="Opt-in - checkbox is shown but not selected",ybn="Opt-out - checkbox is shown and selected",Cbn="Always",wbn="Store credit card details",Sbn="View in :gateway",Ebn="Use Card on File",xbn="Edit payment details",kbn="Save card details",Tbn="The data is stored securely by :link",Ibn="Support",Lbn="Contact Information",Dbn="Amount due",Abn="Billing Address",Rbn="Billing Method",Nbn="Order overview",Obn="*Address must match address associated with credit card.",Pbn='*Please click "PAY NOW" only once - transaction may take up to 1 minute to process.',Mbn="Invoice Footer",Fbn="Save as default footer",Bbn="Token Management",$bn="Tokens",Vbn="Add Token",Hbn="Show deleted tokens",Wbn="Successfully deleted token",zbn="Successfully created token",jbn="Successfully updated token",Ubn="Edit Token",qbn="Delete Token",Kbn="Token",Gbn="Add Payment Gateway",Ybn="Delete Payment Gateway",Qbn="Edit Payment Gateway",Xbn="Successfully updated gateway",Zbn="Successfully created gateway",Jbn="Successfully deleted gateway",eyn="PayPal",tyn="Credit Card",nyn="Change password",iyn="Current password",ryn="New password",oyn="Confirm password",syn="The current password is incorrect.",ayn="The new password is invalid.",lyn="Successfully updated password",cyn="API Tokens",uyn="Users & Tokens",dyn="Account Login",hyn="Recover your password",fyn="Forgot your password?",gyn="Email address",pyn="Let's go",myn="Password Recovery",_yn="Send Email",vyn="Set Password",byn="Converted",yyn="Email me when a quote is <b>approved</b>",Cyn="Quote :invoice was approved by :client",wyn="The following client :client approved Quote :invoice for :amount.",Syn="Resend confirmation email",Eyn="The confirmation email was resent",xyn="Credit Card",kyn="PayPal",Tyn="Bitcoin",Iyn="GoCardless",Lyn="Knowledge Base",Dyn="Partial/Deposit",Ayn=":partial of :balance",Ryn="More Fields",Nyn="Less Fields",Oyn="Client Name",Pyn="PDF Settings",Myn="Product Settings",Fyn="Auto Line Wrap",Byn="Warning: the previous page was submitted twice. The second submission had been ignored.",$yn="View Documentation",Vyn="Free Online Invoicing",Hyn="Invoice Ninja is a free, open-code solution for invoicing and billing customers. With Invoice Ninja, you can easily build and send beautiful invoices from any device that has access to the web. Your clients can print your invoices, download them as pdf files, and even pay you online from within the system.",Wyn="rows",zyn="www",jyn="Logo",Uyn="Subdomain",qyn="Please provide a name or email",Kyn="Charts & Reports",Gyn="Chart",Yyn="Report",Qyn="Group by",Xyn="Paid",Zyn="Report",Jyn="Chart",e0n="Totals",t0n="Run",n0n="Documentation",i0n="Zapier",r0n="Recurring",o0n="Last invoice sent :date",s0n="Successfully completed update",a0n="Tasks",l0n="New Task",c0n="Start Time",u0n="Successfully created task",d0n="Successfully updated task",h0n="Edit Task",f0n="Clone Task",g0n="Archive Task",p0n="Restore Task",m0n="Delete Task",_0n="Stop Task",v0n="Time",b0n="Start",y0n="Stop",C0n="Now",w0n="Timer",S0n="Manual",E0n="Date & Time",x0n="Second",k0n="Seconds",T0n="Minute",I0n="Minutes",L0n="Hour",D0n="Hours",A0n="Task Details",R0n="Duration",N0n="Time Log",O0n="End Time",P0n="End",M0n="Invoiced",F0n="Logged",B0n="Running",$0n="The tasks can't belong to different clients",V0n="Please stop running tasks first",H0n="Tasks have already been invoiced",W0n="Successfully restored task",z0n="Successfully archived task",j0n="Successfully archived :count tasks",U0n="Successfully deleted task",q0n="Successfully deleted :count tasks",K0n="Create Task",G0n="Successfully stopped task",Y0n="Invoice Task",Q0n="Invoice Labels",X0n="Prefix",Z0n="Counter",J0n="Dwolla",e1n="Must be greater than zero and less than the total",t1n="More Actions",n1n="NINJA PRO",i1n="Upgrade Now!",r1n="Create Unlimited Clients",o1n="Access to 10 Beautiful Invoice Designs",s1n='Custom URLs - "YourBrand.InvoiceNinja.com"',a1n='Remove "Created by Invoice Ninja"',l1n="Multi-user Access & Activity Tracking",c1n="Create Quotes & Pro-forma Invoices",u1n="Customize Invoice Field Titles & Numbering",d1n="Option to Attach PDFs to Client Emails",h1n="Resume",f1n="Break",g1n="Edit Details",p1n="Work",m1n="Please :link to set your timezone",_1n="click here",v1n="Email payment receipt to the client",b1n="Successfully created payment and emailed client",y1n="Add Company",C1n="Untitled",w1n="New Company",S1n="Successfully linked accounts",E1n="Successfully unlinked accounts",x1n="Login",k1n="or",T1n="There was a problem sending the email",I1n="Note: emails are sent at the start of the hour.",L1n="Note: invoices are created at the start of the hour.",D1n="Unlink Account",A1n="Unlink",R1n="Show Address",N1n="Require client to provide their billing address",O1n="Update Address",P1n="Update client's address with provided details",M1n="Times",F1n="Set to now",B1n="Dark Mode",$1n="Use a dark background for the sidebars",V1n="Add to invoice :invoice",H1n="Create new invoice",W1n="Please correct any overlapping times",z1n="From",j1n="To",U1n="Font Size",q1n="Primary Color",K1n="Secondary Color",G1n="Customize Design",Y1n="Content",Q1n="Styles",X1n="Defaults",Z1n="Margins",J1n="Header",eCn="Footer",tCn="Custom",nCn="Invoice to",iCn="Invoice No.",rCn="Quote No.",oCn="Recent Payments",sCn="Outstanding",aCn="Manage Companies",lCn="Total Revenue",cCn="Current User",uCn="New Recurring Invoice",dCn="Recurring Invoice",hCn="New Recurring Quote",fCn="Recurring Quote",gCn="Created by :invoice",pCn="Primary User",mCn="Help",_Cn="playground",vCn="Support Forums",bCn="Due Date",yCn="Valid Until",CCn="Valid Until",wCn="Reset terms",SCn="Reset footer",ECn=":count invoice sent",xCn=":count invoices sent",kCn="Draft",TCn="Sent",ICn="Viewed",LCn="Partial",DCn="Paid",ACn="Unpaid",RCn="All",NCn="Display <b>line item taxes inline</b>",OCn="Auto Bill",PCn="24 Hour Time",MCn="Last Sent",FCn="Reminder Emails",BCn="Quote Reminder Emails",$Cn="Templates & Reminders",VCn="Subject",HCn="Body",WCn="First Reminder",zCn="Second Reminder",jCn="Third Reminder",UCn="Days after due date",qCn="Reminder: Invoice :invoice from :account",KCn="Reset",GCn="The requested invoice is not available",YCn="Referral Program",QCn="Referral URL",XCn="Sent Last: :date",ZCn="This page will expire soon, :click_here to keep working",JCn="Upcoming Quotes",ewn="Expired Quotes",twn="Sign up using",nwn="These credentials do not match our records",iwn="Show all options",rwn="User Details",own="Connected Account",swn="Disable",awn="Invoice and Quote Numbers",lwn="Invoice Surcharges",cwn="We were unable to deliver Invoice :invoice to :contact. <br><br> :error",uwn="Unable to deliver Invoice :invoice",dwn="We were unable to deliver Quote :invoice to :contact. <br><br> :error",hwn="Unable to deliver Quote :invoice",fwn="Custom Invoice Link",gwn="Total Invoiced",pwn="Open Balance",mwn="Please visit the link in the account confirmation email to verify your email address.",_wn="Basic Settings",vwn="Pro",bwn="Payment Gateways",ywn="Send Next: :date",Cwn="This invoice is not scheduled to run",wwn="General Settings",Swn="Customize",Ewn="Connect an account to login without a password",xwn="Earn money by sharing our app online",kwn="Enable | Requires Stripe",Twn="Tax Settings",Iwn="Add Tax Rate",Lwn="Successfully updated tax rate",Dwn="Successfully created tax rate",Awn="Edit tax rate",Rwn="Archive Tax Rate",Nwn="Successfully archived the tax rate",Own="Default Tax Rate",Pwn="Tax Rate",Mwn="Recurring Hour",Fwn="Pattern",Bwn="Pattern Help",$wn="Create custom numbers by specifying a pattern",Vwn="Available variables:",Hwn="For example, :example would be converted to :value",Wwn="See options",zwn="Invoice Counter",jwn="Quote Counter",Uwn="Type",qwn=":user created client :client",Kwn=":user archived client :client",Gwn=":user deleted client :client",Ywn=":user created invoice :invoice",Qwn=":user updated invoice :invoice",Xwn=":user emailed invoice :invoice for :client to :contact",Zwn=":contact viewed invoice :invoice for :client",Jwn=":user archived invoice :invoice",eSn=":user deleted invoice :invoice",tSn=":user entered payment :payment for :payment_amount on invoice :invoice for :client",nSn=":user updated payment :payment",iSn=":user archived payment :payment",rSn=":user deleted payment :payment",oSn=":user entered :credit credit",sSn=":user updated :credit credit",aSn=":user archived :credit credit",lSn=":user deleted :credit credit",cSn=":user created quote :quote",uSn=":user updated quote :quote",dSn=":user emailed quote :quote for :client to :contact",hSn=":contact viewed quote :quote",fSn=":user archived quote :quote",gSn=":user deleted quote :quote",pSn=":user restored quote :quote",mSn=":user restored invoice :invoice",_Sn=":user restored client :client",vSn=":user restored payment :payment",bSn=":user restored :credit credit",ySn=":contact approved quote :quote for :client",CSn=":user created vendor :vendor",wSn=":user archived vendor :vendor",SSn=":user deleted vendor :vendor",ESn=":user restored vendor :vendor",xSn=":user created expense :expense",kSn=":user archived expense :expense",TSn=":user deleted expense :expense",ISn=":user restored expense :expense",LSn=":user created task :task",DSn=":user updated task :task",ASn=":user archived task :task",RSn=":user deleted task :task",NSn=":user restored task :task",OSn=":user updated expense :expense",PSn=":user created user :user",MSn=":user updated user :user",FSn=":user archived user :user",BSn=":user deleted user :user",$Sn=":user restored user :user",VSn=":user marked sent :invoice",HSn=":user paid invoice :invoice",WSn=":contact replied ticket :ticket",zSn=":user viewed ticket :ticket",jSn="Payment",USn="System",qSn="Email Signature",KSn="Default Messages",GSn="Quote Terms",YSn="Default Quote Terms",QSn="Default Invoice Terms",XSn="Default Invoice Footer",ZSn="Quote Footer",JSn="Free",eEn="Successfully approved",tEn="Apply Credit",nEn="System Settings",iEn="Archive Token",rEn="Successfully archived token",oEn="Archive User",sEn="Successfully archived user",aEn="Delete Gateway",lEn="Successfully archived gateway",cEn="Archive Recurring Invoice",uEn="Successfully archived recurring invoice",dEn="Delete Recurring Invoice",hEn="Successfully deleted recurring invoice",fEn="Restore Recurring Invoice",gEn="Successfully restored recurring invoice",pEn="Archive Recurring Quote",mEn="Successfully archived recurring quote",_En="Delete Recurring Quote",vEn="Successfully deleted recurring quote",bEn="Restore Recurring Quote",yEn="Successfully restored recurring quote",CEn="Archived",wEn="Untitled Company",SEn="Before",EEn="After",xEn="Reset to the default account terms",kEn="Reset to the default account footer",TEn="Export Data",IEn="User",LEn="Country",DEn="Include",AEn="Your logo is :size, for better PDF performance we suggest uploading an image file less than 200KB",REn="Import From FreshBooks",NEn="Import Data",OEn="Source",PEn="CSV",MEn="Client File",FEn="Invoice File",BEn="Task File",$En="No valid mapping for file",VEn="Invalid CSV Header",HEn="Client Portal",WEn="Admin",zEn="Disabled",jEn="Show archived users",UEn="Notes",qEn="invoice will be created",KEn="invoices will be created",GEn="The following records failed to import, they either already exist or are missing required fields.",YEn="Publishable Key",QEn="Secret Key",XEn="Set your Stripe publishable key for an improved checkout process",ZEn="Email Design",JEn="Due by :date",exn="Enable Markup",txn="Make it easier for your clients to pay you by adding schema.org markup to your emails.",nxn="Templates Help",ixn="Available variables:",rxn="Email Style",oxn="Make your emails look more professional with HTML layouts.",sxn="Plain",axn="Light",lxn="Dark",cxn="Used to provide comparisons against the averages of companies of similar size and industry.",uxn="Set the subdomain or display the invoice on your own website.",dxn="Display the invoice in an iFrame on your own website",hxn="Specify a prefix or use a custom pattern to dynamically set the invoice number.",fxn="Specify a prefix or use a custom pattern to dynamically set the quote number.",gxn="Add a field when creating a client and optionally display the label and value on the PDF.",pxn="Add a label and value to the company details section of the PDF.",mxn="Add a field when creating an invoice and optionally display the label and value on the PDF.",_xn="Add a field when creating an invoice and include the charge in the invoice subtotals.",vxn="Validation token was expired. Please try again.",bxn="Invoice Link",yxn="Confirm your email.",Cxn="Confirm",wxn="Email Preferences",Sxn="Successfully created :count invoice(s)",Exn="The next invoice number is :number.",xxn="The next quote number is :number.",kxn="days before the",Txn="days after the",Ixn="due date",Lxn="invoice date",Dxn="Schedule",Axn="Email Designs",Rxn="Assigned when sent",Nxn="Purchase a white label license",Oxn="Expense",Pxn="Expenses",Mxn="Enter Expense",Fxn="New Vendor",Bxn="Net",$xn="Vendor",Vxn="Edit Vendor",Hxn="Archive Vendor",Wxn="Delete Vendor",zxn="View Vendor",jxn="Successfully deleted expense",Uxn="Successfully archived expense",qxn="Successfully deleted expenses",Kxn="Successfully archived expenses",Gxn="Expense Amount",Yxn="Expense Balance",Qxn="Expense Date",Xxn="Should this expense be invoiced?",Zxn="Public Notes",Jxn="Invoice Amount",ekn="Exchange Rate",tkn="Yes",nkn="No",ikn="Should be invoiced",rkn="View expense # :expense",okn="Edit Expense",skn="Archive Expense",akn="Delete Expense",lkn="Expense # :expense",ckn="Successfully updated expense",ukn="Successfully created expense",dkn="Enter Expense",hkn="View",fkn="Restore Expense",gkn="Invoice Expense",pkn="The expenses can't belong to different clients",mkn="Expense has already been invoiced",_kn="Convert currency",vkn="Number of Days",bkn="Create Payment Term",ykn="Edit Payment Term",Ckn="Edit Payment Term",wkn="Archive Payment Term",Skn="Recurring Invoice Due Dates",Ekn=`<p>Automatically sets a due date for the invoice.</p>
<p>Invoices on a monthly or yearly cycle set to be due on or before the day they are created will be due the next month. Invoices set to be due on the 29th or 30th in months that don't have that day will be due the last day of the month.</p>
<p>Invoices on a weekly cycle set to be due on the day of the week they are created will be due the next week.</p>
<p>For example:</p>
<ul>
<li>Today is the 15th, due date is 1st of the month. The due date should likely be the 1st of the next month.</li>
<li>Today is the 15th, due date is the last day of the month. The due date will be the last day of the this month.
</li>
<li>Today is the 15th, due date is the 15th day of the month. The due date will be the 15th day of <strong>next</strong> month.
</li>
<li>Today is the Friday, due date is the 1st Friday after. The due date will be next Friday, not today.
</li>
</ul>`,xkn="Due",kkn="Due Next: :date",Tkn="Use client terms",Ikn=":ordinal day of month",Lkn="Last day of month",Dkn=":ordinal :day after",Akn="Sunday",Rkn="Monday",Nkn="Tuesday",Okn="Wednesday",Pkn="Thursday",Mkn="Friday",Fkn="Saturday",Bkn="Header Font",$kn="Body Font",Vkn="Note: the primary color and fonts are also used in the client portal and custom email designs.",Hkn="Live Preview",Wkn="Unable to send email, please check that the mail settings are correct.",zkn="To view your invoice for :amount, click the button below.",jkn="To view your quote for :amount, click the button below.",Ukn="Thank you for your payment of :amount.",qkn="Direct Debit",Kkn="Credit Cards & Banks",Gkn="Add Bank Account",Ykn="Setup Account",Qkn="Import Expenses",Xkn="Bank",Zkn="Integration Type",Jkn="Successfully updated bank account",eTn="Edit Bank Account",tTn="Archive Bank Account",nTn="Successfully archived bank account",iTn="Successfully created bank account",rTn="Validate Bank Account",oTn="Note: your password is transmitted securely and never stored on our servers.",sTn="Warning: your password may be transmitted in plain text, consider enabling HTTPS.",aTn="Username",lTn="Account Number",cTn="Account Name",uTn="Failed to retrieve account details, please check your credentials.",dTn="Approved",hTn="Quote Settings",fTn="Auto Convert",gTn="Automatically convert a quote to an invoice when approved.",pTn="Validate",mTn="Info",_Tn="Successfully created :count_vendors vendor(s) and :count_expenses expense(s)",vTn="Note: if you plan on accepting credit cards details we strongly recommend enabling HTTPS on your site.",bTn="The expenses can't have different currencies.",yTn="The client's currency does not match the expense currency.",CTn="Trello Roadmap",wTn="Header/Footer",STn="First page",ETn="All pages",xTn="Last page",kTn="Show Header on",TTn="Show Footer on",ITn="Invoice Currency",LTn="We strongly recommend using HTTPS to accept credit card details online.",DTn="Quote issued to",ATn="Currency Code",RTn="Your account has been upgraded to the pro plan for one year at no cost.",NTn="Your account will receive a free two week trial of our pro plan.",OTn="Your free pro plan trial lasts :count more days, :link to upgrade now.",PTn="This is the last day of your free pro plan trial, :link to upgrade now.",MTn="Start Free Trial",FTn="Successfully enabled two week free pro plan trial",BTn="Overdue",$Tn="Purchase a ONE YEAR white label license for $:price to remove the Invoice Ninja branding from the invoice and client portal.",VTn="To adjust your email notification settings please visit :link",HTn="If you did not request this password reset please email our support: :email",WTn="Sorry, this will exceed the limit of :limit users",zTn="Get 6 more invoice designs for just $:price",jTn="Please use a :link",UTn="newer browser",qTn=":link for $:price to enable custom styling and help support our project.",KTn=":link to remove the Invoice Ninja logo by joining the Pro Plan",GTn="Click here",YTn="Sent",QTn="Opened",XTn="Viewed",ZTn="Emails can not be sent to inactive clients",JTn="Emails can not be sent to inactive contacts",eIn="Emails can not be sent to inactive invoices",tIn="Emails can not be sent to inactive proposals",nIn="Please register your account to send emails",iIn="Please confirm your account to send emails",rIn="Invalid contact email",oIn="Navigation",sIn="List Invoices",aIn="List Clients",lIn="List Quotes",cIn="List Tasks",uIn="List Expenses",dIn="List Recurring Invoices",hIn="List Payments",fIn="List Credits",gIn="Tax Name",pIn="Report Settings",mIn="New User",_In="New Product",vIn="New Tax Rate",bIn="Invoiced Amount",yIn="Invoice Item Fields",CIn="Add a field when creating an invoice item and display the label and value on the PDF.",wIn="Recurring Number",SIn="Specify a prefix to be added to the invoice number for recurring invoices.",EIn="Password Protect Invoices",xIn="Allows you to set a password for each contact. If a password is set, the contact will be required to enter a password before viewing invoices.",kIn="Generate Automatically",TIn="If no password is set, one will be generated and sent with the first invoice.",IIn="Expired",LIn="The credit card number is not valid.",DIn="The expiration date is not valid.",AIn="The CVV is not valid.",RIn="Cost",NIn="Note: create your first invoice to see a preview here.",OIn="Owner",PIn="Administrator",MIn="Allow user to manage users, change settings and modify all records",FIn="Create clients, invoices, etc.",BIn="View all clients, invoices, etc.",$In="Edit all clients, invoices, etc.",VIn="Partial Due",HIn="Restore Vendor",WIn="Successfully restored vendor",zIn="Successfully restored expense",jIn="Permissions",UIn="Allow user to create and modify records",qIn="Allow user to view records they didn't create",KIn="Allow user to modify records they didn't create",GIn="View Payment",YIn="January",QIn="February",XIn="March",ZIn="April",JIn="May",eLn="June",tLn="July",nLn="August",iLn="September",rLn="October",oLn="November",sLn="December",aLn="Documents:",lLn="Documents:",cLn="Widgets Receipt.pdf",uLn="Final Deliverable.zip",dLn="Quote Documents",hLn="Invoice Documents",fLn="Expense Documents",gLn="Embed Documents",pLn="Include attached images in the invoice.",mLn="Attach Documents",_Ln="Attach UBL/E-Invoice",vLn="Download Documents (:size)",bLn="From Expenses:",yLn="Drop files or click to upload",CLn="Uploads disabled",wLn="Your browser does not support drag'n'drop file uploads.",SLn="Please use the fallback form below to upload your files like in the olden days.",ELn="File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",xLn="You can't upload files of this type.",kLn="Server responded with {{statusCode}} code.",TLn="Cancel upload",ILn="Are you sure you want to cancel this upload?",LLn="Remove file",DLn="Documents",ALn="Document Date",RLn="Size",NLn="Client Portal",OLn="Show/hide the client portal.",PLn="Dashboard",MLn="Show/hide the dashboard page in the client portal.",FLn="Account Management",BLn="Plan Status",$Ln="Upgrade",VLn="Manage Plan",HLn="Changes To",WLn=":plan on :date",zLn=":plan (:term) on :date",jLn="Cancel Change",ULn="Plan",qLn="Expires",KLn="Renews",GLn=":plan Plan Expired",YLn=":plan Plan Trial Ended",QLn="Never",XLn="Free",ZLn="Pro",JLn="Enterprise",eDn="Self Hosted (White labeled)",tDn="Self Hosted (Free)",nDn="Trial",iDn="Term",rDn="Monthly",oDn="Yearly",sDn="Month",aDn="Year",lDn="$:price/Month",cDn="$:price/Year",uDn="Updated plan settings",dDn="Term Started",hDn="Plan Started",fDn="Plan Expires",gDn="Purchase White Label",pDn="One year enrollment in the Invoice Ninja Pro Plan.",mDn="One month enrollment in the Invoice Ninja Pro Plan.",_Dn="Enterprise Plan",vDn="One year enrollment in the Invoice Ninja Enterprise Plan.",bDn="One month enrollment in the Invoice Ninja Enterprise Plan.",yDn="Credit",CDn="Credit for unused time",wDn="Will switch to monthly on :date",SDn="A refund has been issued.",EDn="Page Size",xDn="Live preview has been disabled to support selected font",kDn="Padding",TDn="Preview",IDn="List Vendors",LDn="Upgrade to the Enterprise Plan to add additional users to your account.",DDn="The Enterprise Plan adds support for multiple users and file attachments, :link to see the full list of features.",ADn="Return To App",RDn="Refund Payment",NDn="Max:",ODn="Refund",PDn="Refund selected payments?",MDn="Pending",FDn="Completed",BDn="Failed",$Dn="Partially Refunded",VDn=":amount Refunded",HDn="Refunded",WDn="Cancelled",zDn="Refunded Payment",jDn=":user cancelled a :payment_amount payment :payment",UDn=":user refunded :adjustment of a :payment_amount payment :payment",qDn="Exp:&nbsp:expires",KDn="Unknown",GDn="American Express",YDn="Carte Blanche",QDn="UnionPay",XDn="Diners Club",ZDn="Discover",JDn="JCB",e2n="Laser",t2n="Maestro",n2n="MasterCard",i2n="Solo",r2n="Switch",o2n="Visa",s2n="ACH",a2n="Stripe",l2n="ACH",c2n="Accept US bank transfers",u2n="ACH support must also be enabled in :link.",d2n="Another gateway is already configured for direct debit.",h2n="Plaid",f2n="Client Id",g2n="Secret",p2n="Public Key",m2n="(optional)",_2n="When a Stripe test key is given, Plaid's development environment (tartan) will be used.",v2n="Other Providers",b2n="That country is not supported.",y2n="The routing number is not valid.",C2n="The account number is not valid.",w2n="The account numbers do not match.",S2n="Please select an individual or company account.",E2n="Please enter the account holder's name.",x2n="Routing Number",k2n="Confirm Account Number",T2n="Individual Account",I2n="Company Account",L2n="Account Holder Name",D2n="Add Account",A2n="Payment Methods",R2n="Complete Verification",N2n="Amount 1",O2n="Amount 2",P2n="Verification completed successfully",M2n="Verification Failed",F2n="Remove Payment Method",B2n="Are you sure you want to remove this payment method?",$2n="Remove",V2n="Removed payment method.",H2n='We have made two deposits into your account with the description "VERIFICATION". These deposits will take 1-2 business days to appear on your statement. Please enter the amounts below.',W2n=`We have made two deposits into your account with the description "VERIFICATION". These deposits will take 1-2 business days to appear on your statement.
Once you have the amounts, come back to this payment methods page and click "Complete Verification" next to the account.`,z2n="Unknown Bank",j2n="You will be able to use the account after completing verification. Verification usually takes 1-2 business days.",U2n="Add Credit Card",q2n="Added payment method.",K2n="Use For Autobill",G2n="Autobill Payment Method",Y2n="Set Autobill payment method.",Q2n=":payment_amount payment (:payment) failed",X2n="Webhook URL",Z2n="You must :link.",J2n="add this URL as an endpoint at Stripe",eAn="add this URL as an endpoint in GoCardless",tAn="There was an error adding your payment methd. Please try again later.",nAn="Payment failed for Invoice :invoice",iAn="A payment made by client :client towards Invoice :invoice failed. The payment has been marked as failed and :amount has been added to the client's balance.",rAn="Link Account Instantly with Plaid",oAn="Link Manually",sAn="Secured by Plaid",aAn="Your bank account at :bank",lAn="Add Payment Method",cAn="Account Holder Type",uAn="I authorize :company to use my bank account for future payments and, if necessary, electronically credit my account to correct erroneous debits. I understand that I may cancel this authorization at any time by removing the payment method or by contacting :email.",dAn="You must consent to ACH transactions.",hAn="Off",fAn="Opt-in",gAn="Opt-out",pAn="Always",mAn="Opted out",_An="Opted in",vAn="Manage Auto-bill",bAn="Enabled",yAn="PayPal",CAn="Enable PayPal payments through BrainTree",wAn="The PayPal gateway is processing PayPal payments",SAn="You must also :link.",EAn="link PayPal to your BrainTree account",xAn="Save payment details",kAn="Add PayPal Account",TAn="No payment method specified",IAn="Chart Type",LAn="Format",DAn="Import OFX",AAn="OFX File",RAn="Failed to parse OFX file",NAn="WePay",OAn="Sign up with WePay",PAn="Use another provider",MAn="Company Name",FAn="This will appear on client's credit card statements.",BAn="The purpose of this account.",$An="I agree to the :link.",VAn="WePay Terms of Service",HAn="Resend Confirmation Email",WAn="Manage Account",zAn="Action Required",jAn="Finish Setup",UAn="Please check your email and confirm your email address with WePay.",qAn="Switch to WePay",KAn="Restore Gateway",GAn="Successfully restored gateway",YAn="United States",QAn="Canada",XAn="Accept Debit Cards",ZAn="Debit Cards",JAn="The next invoice will be sent on the new start date.",eRn="The next invoice will be created on the new start date.",tRn="Original start date",nRn="New start date",iRn="Security",rRn="See what's new in v:version",oRn="Please wait for the document upload to complete.",sRn="Upgrade to our Enterprise Plan to enable permissions.",aRn="Enable specifying a <b>second tax rate</b>",lRn="Payment File",cRn="Expense File",uRn="Product File",dRn="Import Products",hRn="products will be created",fRn="Product",gRn="Successfully created/updated :count product(s)",pRn="Use JSON if you plan to import the data into Invoice Ninja.<br/>The file includes clients, products, invoices, quotes and payments.",mRn="<br/>We recommend using mysqldump to create a full backup.",_Rn="JSON File",vRn="View Dashboard",bRn="Session Expired",yRn="Your session has expired. Please click the link in your email again.",CRn="This invoice will automatically be billed to your :payment_method on file on :due_date.",wRn="bank account",SRn="credit card",ERn="PayPal account",xRn="This invoice will automatically be billed to your credit card on file on the due date.",kRn="Payment Settings",TRn="On send date",IRn="On due date",LRn="ACH will always auto bill on the due date.",DRn="Due to NACHA rules, changes to this invoice may prevent ACH auto bill.",ARn="Bank Account",RRn="ACH payments will be processed using WePay.",NRn="Privacy Policy",ORn="Please enter your email address:",PRn="Verification Pending",MRn="Please force refresh the page to update the font cache.",FRn="More options",BRn="Credit Card",$Rn="Bank Transfer",VRn="We did not receive a payment transaction reference from the gateway.",HRn="Use Bank on File",WRn="This invoice will automatically be billed to the payment method on file on the due date.",zRn="Bitcoin",jRn="GoCardless",URn="Added :date",qRn="Failed to remove the payment method",KRn="This gateway already exists",GRn="Manual entry",YRn="First Day of the Week",QRn="Inactive",XRn="Daily",ZRn="Weekly",JRn="Biweekly",eNn="Two weeks",tNn="Four weeks",nNn="Monthly",iNn="Three months",rNn="Four months",oNn="Six months",sNn="Annually",aNn="Two years",lNn="Cash",cNn="Debit",uNn="ACH",dNn="MasterCard",hNn="EuroCard",fNn="Nova",gNn="PayPal",pNn="Check",mNn="UnionPay",_Nn="JCB",vNn="Laser",bNn="Maestro",yNn="Solo",CNn="Switch",wNn="iZettle",SNn="Swish",ENn="Alipay",xNn="Sofort",kNn="SEPA Direct Debit",TNn="Bitcoin",INn="GoCardless",LNn="Zelle",DNn="Afghanistan",ANn="Albania",RNn="Antarctica",NNn="Algeria",ONn="Andorra",PNn="Angola",MNn="Azerbaijan",FNn="Argentina",BNn="Australia",$Nn="Austria",VNn="Bahamas",HNn="Bahrain",WNn="Bangladesh",zNn="Armenia",jNn="Barbados",UNn="Belgium",qNn="Bermuda",KNn="Bhutan",GNn="Botswana",YNn="Brazil",QNn="Belize",XNn="Bulgaria",ZNn="Myanmar",JNn="Burundi",eOn="Belarus",tOn="Cambodia",nOn="Cameroon",iOn="Canada",rOn="Chad",oOn="Chile",sOn="China",aOn="Colombia",lOn="Comoros",cOn="Mayotte",uOn="Congo",dOn="Croatia",hOn="Cuba",fOn="Cyprus",gOn="Benin",pOn="Denmark",mOn="Dominica",_On="Ecuador",vOn="Ethiopia",bOn="Eritrea",yOn="Estonia",COn="Fiji",wOn="Finland",SOn="France",EOn="Djibouti",xOn="Gabon",kOn="Georgia",TOn="Gambia",IOn="Germany",LOn="Ghana",DOn="Gibraltar",AOn="Kiribati",ROn="Greece",NOn="Greenland",OOn="Grenada",POn="Guadeloupe",MOn="Guam",FOn="Guatemala",BOn="Guinea",$On="Guyana",VOn="Haiti",HOn="Honduras",WOn="Hungary",zOn="Iceland",jOn="India",UOn="Indonesia",qOn="Iraq",KOn="Ireland",GOn="Israel",YOn="Italy",QOn="Jamaica",XOn="Japan",ZOn="Kazakhstan",JOn="Jordan",ePn="Kenya",tPn="Kuwait",nPn="Kyrgyzstan",iPn="Lebanon",rPn="Lesotho",oPn="Latvia",sPn="Liberia",aPn="Libya",lPn="Liechtenstein",cPn="Lithuania",uPn="Luxembourg",dPn="Macao",hPn="Madagascar",fPn="Malawi",gPn="Malaysia",pPn="Maldives",mPn="Mali",_Pn="Malta",vPn="Martinique",bPn="Mauritania",yPn="Mauritius",CPn="Mexico",wPn="Monaco",SPn="Mongolia",EPn="Montenegro",xPn="Montserrat",kPn="Morocco",TPn="Mozambique",IPn="Oman",LPn="Namibia",DPn="Nauru",APn="Nepal",RPn="Netherlands",NPn="Aruba",OPn="Vanuatu",PPn="Nicaragua",MPn="Niger",FPn="Nigeria",BPn="Niue",$Pn="Norway",VPn="Palau",HPn="Pakistan",WPn="Panama",zPn="Paraguay",jPn="Peru",UPn="Philippines",qPn="Pitcairn",KPn="Poland",GPn="Portugal",YPn="Qatar",QPn="Romania",XPn="Rwanda",ZPn="Anguilla",JPn="Senegal",eMn="Serbia",tMn="Seychelles",nMn="Singapore",iMn="Slovakia",rMn="Slovenia",oMn="Somalia",sMn="Zimbabwe",aMn="Spain",lMn="Sudan",cMn="Suriname",uMn="Swaziland",dMn="Sweden",hMn="Switzerland",fMn="Tajikistan",gMn="Thailand",pMn="Togo",mMn="Tokelau",_Mn="Tonga",vMn="Tunisia",bMn="Turkey",yMn="Turkmenistan",CMn="Tuvalu",wMn="Uganda",SMn="Ukraine",EMn="Egypt",xMn="Guernsey",kMn="Jersey",TMn="Uruguay",IMn="Uzbekistan",LMn="Samoa",DMn="Yemen",AMn="Zambia",RMn="Croatian",NMn="Czech",OMn="Danish",PMn="Dutch",MMn="English",FMn="French",BMn="German",$Mn="Italian",VMn="Japanese",HMn="Lithuanian",WMn="Norwegian",zMn="Polish",jMn="Spanish",UMn="Swedish",qMn="Albanian",KMn="Greek",GMn="Slovenian",YMn="Finnish",QMn="Romanian",XMn="Thai",ZMn="Macedonian",JMn="Serbian",e4n="Bulgarian",t4n="Advertising",n4n="Aerospace",i4n="Agriculture",r4n="Automotive",o4n="Biotechnology",s4n="Broadcasting",a4n="Communications",l4n="Defense",c4n="Energy",u4n="Entertainment",d4n="Government",h4n="Insurance",f4n="Manufacturing",g4n="Marketing",p4n="Media",m4n="Pharmaceuticals",_4n="Sports",v4n="Transportation",b4n="Other",y4n="Photography",C4n="View client portal",w4n="View Portal",S4n="Vendor Contacts",E4n="All",x4n="Selected",k4n="Category",T4n="Categories",I4n="New Expense Category",L4n="Edit Category",D4n="Archive Category",A4n="Expense Categories",R4n="List Expense Categories",N4n="Successfully updated expense category",O4n="Successfully created expense category",P4n="Successfully archived expense category",M4n="Successfully archived :count expense category",F4n="Restore expense category",B4n="Successfully restored expense category",$4n="Apply taxes",V4n=":min to :max users",H4n="The maximum number of users has been reached.",W4n="Buy Now Buttons",z4n="Landing Page",j4n="Payment Type",U4n="Form",q4n="Link",K4n="Fields",G4n="Dwolla",Y4n="Note: the client and invoice are created even if the transaction isn't completed.",Q4n="This feature requires that a product is created and a payment gateway is configured.",X4n="Enable support for buy now buttons",Z4n="Note: changes take effect immediately",J4n="Payment gateway for Invoice Ninja",e3n="There was an error processing your payment [:code]. Please try again later.",t3n="Fee: 2.9%/1.2% [Credit Card/Bank Transfer] + $0.30 per successful charge.",n3n="Data needs to be imported in batches of :count rows or less",i3n="Something went wrong",r3n="If you'd like help please email us at :mailaddress",o3n="Warning: this can't be undone.",s3n="Please select a contact",a3n="Please select a client",l3n="It may help to set new passwords or generate new API keys.",c3n=":type on file",u3n="Invoice :invoice for :client",d3n="Sorry, I'm not sure what you're asking.",h3n="Sorry, I'm not able to do that.",f3n="I wasn't able to find the client",g3n="Sorry, you don't have the needed permissions",p3n="Your invoice has been sent.",m3n="I'll email you when it's viewed.",_3n="I'll email you when it's paid.",v3n="Add 1 :product",b3n="You are not authorized",y3n="I wasn't able to find an available account for :email",C3n="The code is not correct",w3n="List Products",S3n="Include <b>line item taxes in line total</b>",E3n="Successfully created :count quotes(s)",x3n="Warning",k3n="Update Invoice Ninja",T3n="Before start upgrading Invoice Ninja create a backup of your database and files!",I3n="A new version of Invoice Ninja is available.",L3n="No new version of Invoice Ninja available.",D3n="Update now",A3n="Download :version",R3n="Create New",N3n="Toggle Navigation",O3n="Toggle History",P3n="Unassigned",M3n="Task",F3n="Contact Name",B3n="City/State/Postal",$3n="Postal/City",V3n="Custom Field",H3n="Company Fields",W3n="Facebook and Twitter",z3n="Follow our feeds to help support our project",j3n="Note: the white-label license is intended for personal use, please email us at :email if you'd like to resell the app.",U3n="Unnamed Client",q3n="Day",K3n="Week",G3n="Month",Y3n="You have been logged out due to inactivity",Q3n="Reports",X3n="Total Profit",Z3n="Total Expenses",J3n="Quote to",e5n="Limit",t5n="Min: :min",n5n="Max: :max",i5n="No Limits",r5n="Set :gateway_type Limits",o5n="Enable min",s5n="Enable max",a5n="Min",l5n="Max",c5n="This invoice does not meet the limits for that payment type.",u5n="Date Range",d5n="Raw",h5n="Raw HTML",f5n="Update",g5n="Drag and drop fields to change their order and location",p5n="New Category",m5n="Restore Product",_5n="Blank",v5n="There was an error saving your invoice",b5n="Enable Recurring",y5n="Disable Recurring",C5n="Text",w5n="expense will be created",S5n="expenses will be created",E5n="Successfully created :count expense(s)",x5n="Help improve our translations with :link",k5n="Expense Category",T5n="Go Ninja Pro!",I5n="Go Enterprise!",L5n="Upgrade For More Features",D5n="Pay annually for 10 months + 2 free!",A5n="Ninja Pro",R5n="YourBrand.InvoiceNinja.com",N5n="Customize every aspect of your invoice!",O5n="Set permissions for multiple-users",P5n="Attach 3rd party files to invoices & expenses",M5n="Much More!",F5n="Plus all pro features!",B5n="Symbol",$5n="Code",V5n="Buy License",H5n="Apply License",W5n="Submit",z5n="License Key",j5n="The white label license is not valid",U5n="Created by :name",q5n="Modules",K5n="First Month of the Year",G5n="Authentication",Y5n="Checkbox",Q5n="Signature",X5n="Invoice Terms Checkbox",Z5n="Require client to confirm that they accept the invoice terms.",J5n="Quote Terms Checkbox",eFn="Require client to confirm that they accept the quote terms.",tFn="Invoice Signature",nFn="Require client to provide their signature.",iFn="Quote Signature",rFn="Require client to provide their signature.",oFn="I Agree To The Terms",sFn="Please sign here:",aFn="Use the mouse or your touchpad to trace your signature.",lFn="Authorization",cFn="Signed",uFn="Vendor",dFn="State",hFn="Date Created",fFn="There was a problem sending the email through Postmark: :link",gFn="Project",pFn="Projects",mFn="New Project",_Fn="Edit Project",vFn="Archive Project",bFn="List Projects",yFn="Successfully updated project",CFn="Successfully created project",wFn="Successfully archived project",SFn="Successfully archived :count projects",EFn="Restore Project",xFn="Successfully restored project",kFn="Delete Project",TFn="Successfully deleted project",IFn="Successfully deleted :count projects",LFn="Delete category",DFn="Successfully deleted category",AFn="Delete Product",RFn="Successfully deleted product",NFn="Successfully deleted :count products",OFn="Successfully restored product",PFn="Update Credit",MFn="Successfully updated credit",FFn="Edit Credit",BFn="Realtime Preview",$Fn="Realtime refresh PDF preview on the invoice page when editing invoice.<br/>Disable this to improve performance when editing invoices.",VFn="Display a live PDF preview on the invoice page.",HFn="Replace the built-in PDF viewer in :chrome_link and :firefox_link.<br/>Enable this if your browser is automatically downloading the PDF.",WFn="Prevent Download",zFn="Redirect URL",jFn="Optionally specify a URL to redirect to after a payment is entered.",UFn="Save Draft",qFn="Refunded credit payment",KFn="Keyboard Shortcuts",GFn="Toggle Menu",YFn="Date Created",QFn="Contact Us",XFn="User Guide",ZFn="Upgrade before :expires and get :amount OFF your first year of our Pro or Enterprise packages.",JFn=":amount off expires :expires",e6n="Mark Paid",t6n="Successfully marked invoice sent",n6n="Successfully marked invoices sent",i6n="Invoice",r6n="product will be created",o6n="Thank you for your message! We'll try to respond as soon as possible.",s6n="Last 7 Days",a6n="Last 30 Days",l6n="This Month",c6n="Last Month",u6n="Current Quarter",d6n="Last Quarter",h6n="Last Year",f6n="All Time",g6n="Custom Range",p6n="URL",m6n="Debug",_6n="HTTPS",v6n="Require",b6n="Note: Your license will expire in :count days, :link to renew it.",y6n="Your email address has been confirmed.",C6n="Your white label license has expired, please consider renewing it to help support our project.",w6n="Renew License",S6n="Consider downloading our :link",E6n="iPhone app",x6n="Android app",k6n="Logged In",T6n="Switch to your primary company (:name) to manage your plan.",I6n="Inclusive",L6n="Exclusive",D6n="Postal/City/State",A6n="In certain cases the app uses :link_phantom to generate the PDF, install :link_docs to generate it locally.",R6n="Using local PhantomJS",N6n="Client Number",O6n="Specify a prefix or use a custom pattern to dynamically set the client number.",P6n="The next client number is :number.",M6n="Generated Numbers",F6n="First Reminder",B6n="Second Reminder",$6n="Third Reminder",V6n="Reminder",H6n="BCC Email",W6n="Tax Quote",z6n="Tax Invoice",j6n="Successfully emailed invoices",U6n="Successfully emailed quotes",q6n="Website URL",K6n="Domain",G6n="Used in the client portal and when sending emails.",Y6n="Used when sending emails.",Q6n="Import Invoices",X6n="New Report",Z6n="Edit Report",J6n="Columns",eBn="Filters",tBn="Sort By",nBn="Draft",iBn="Unpaid",rBn="Aging",oBn="Age",sBn="Days",aBn="0 - 30 Days",lBn="30 - 60 Days",cBn="60 - 90 Days",uBn="90 - 120 Days",dBn="120+ Days",hBn="Invoice Details",fBn="Quantity",gBn="Profit and Loss",pBn="Revenue",mBn="Profit",_Bn="Group Sort",vBn="Group Dates By",bBn="Year",yBn="View Statement",CBn="Statement",wBn="Statement Date",SBn="Mark Active",EBn="Send Automatically",xBn="Initial Email",kBn="This invoice hasn't been emailed.",TBn="This quote hasn't been emailed.",IBn="Sent by :user",LBn="Recipients",DBn="Save as default",ABn="Used by <b>date</b> selectors",RBn="Used by <b>date range</b> selectors",NBn="Shift + Click to sort by multiple columns, Ctrl + Click to clear the grouping.",OBn="This Year",PBn="Create. Send. Get Paid.",MBn="Or login with a connected account.",FBn="Sign Up Now",BBn="Not a member yet?",$Bn="Create an Account!",VBn="Invoices From:",HBn="Full Name",WBn="MONTH/YEAR",zBn="Valid\\nthru",jBn="Product Fields",UBn="Add a field when creating a product or invoice and display the label and value on the PDF.",qBn="Two months",KBn="Annually",GBn="Profile",YBn="Construction",QBn="Your Statement",XBn="Statement issued to",ZBn="Statement to",JBn="Customize options",e$n="Successfully created payment term",t$n="Successfully updated payment term",n$n="Successfully archived payment term",i$n="Resend Invitation",r$n="Credit created by payment :transaction_reference",o$n="Successfully created payment and credit",s$n="Successfully created payment and credit, and emailed client",a$n="Create project",l$n="Create vendor",c$n="Create category",u$n=":link to enable reports by joining the Pro Plan",d$n="Mark Ready",h$n="Limits",f$n="Fees",g$n="Fee",p$n="Set :gateway_type Limits/Fees",m$n="Enable line item taxes to set the fee tax rates.",_$n="The fee for a :amount invoice would be :total.",v$n="The discount for a :amount invoice would be :total.",b$n="No Fees",y$n="Warning: not all states/payment gateways allow adding fees, please review local laws/terms of service.",C$n="Percent",w$n="Location",S$n="Line Item",E$n="Surcharge",x$n="Enabled - First surcharge",k$n="Enabled - Second surcharge",T$n="Enabled - Line item",I$n="Online Payment Surcharge",L$n="Gateway Fees",D$n="Fees are disabled",A$n="Automatically add an online payment surcharge/discount.",R$n="Gateway",N$n="If there are unpaid invoices with fees they need to be updated manually.",O$n="Customize surcharge :link.",P$n="label and taxes",M$n="Billable",F$n="The image file is too large.",B$n="Warning: To support gifs the fileinfo PHP extension needs to be enabled.",$$n="There was a problem reading the image file, please try a different format.",V$n="An error occurred, please refresh the page and try again.",H$n="Data",W$n="Successfully imported settings",z$n="Reset Counter",j$n="Next Reset",U$n="Automatically reset the invoice and quote counters.",q$n="Auto-billing for invoice :invoice_number failed",K$n="Online Payment Discount",G$n="Successfully created new company",Y$n="Fees are disabled for this gateway.",Q$n="Log Out/Delete Account",X$n="Inclusive tax rates adjust the line item cost when selected.<br/>Only exclusive tax rates can be used as a default.",Z$n="Credit Note",J$n="Credit issued to",e8n="Credit to",t8n="Your Credit",n8n="Credit Number",i8n="Create Credit Note",r8n="Menu",o8n="Error: The gateways table has incorrect ids.",s8n="Purge Data",a8n="Delete Data",l8n="Permanently delete all data but keep the account and settings.",c8n="Permanently delete the account along with all data and setting.",u8n="Successfully purged company data",d8n="Forbidden",h8n="Warning: This will permanently erase your data, there is no undo.",f8n="Contact Phone",g8n="Contact Email",p8n="Reply-To Email",m8n="Specify the reply-to address for client emails.",_8n="Privately include this address with client emails.",v8n="Your import has successfully completed.",b8n="Please confirm your account to import data.",y8n="Your import has started, we'll send you an email once it completes.",C8n="Venmo",w8n="Successfully archived :count products",S8n="We recommend <b>enabling</b> this setting.",E8n="We recommend <b>disabling</b> this setting.",x8n="Auto-billed",k8n="Surcharge Label",T8n="Contact Fields",I8n="Add a field when creating a contact and optionally display the label and value on the PDF.",L8n="Showing :start to :end of :total entries",D8n="Credit Total",A8n="Mark billable",R8n="Billed",N8n="Company Variables",O8n="Client Variables",P8n="Invoice Variables",M8n="Navigation Variables",F8n="Custom Variables",B8n="Invalid file type",$8n="Add Documents to Invoice",V8n="Mark paid",H8n="Failed to validate the license, either expired or excessive activations. Email contact@invoiceninja.com for more information.",W8n="Plan Price",z8n="Incorrect confirmation code",j8n="The account is already registered",U8n="Successfully emailed payment",q8n="Email Payment",K8n="Use :link to migrate your data from InvoicePlane.",G8n="Warning: This :link may be a duplicate",Y8n="expense",Q8n="Resume Task",X8n="Successfully resumed task",Z8n="Quote Design",J8n="Standard Design",e9n="Custom Design 1",t9n="Custom Design 2",n9n="Custom Design 3",i9n="Empty",r9n="Load Design",o9n="Accepted Card Logos",s9n="Google Analytics",a9n="Analytics Key",l9n="Track payments using :link",c9n="The start date is required",u9n="Application Settings",d9n="Database Connection",h9n="Driver",f9n="Host",g9n="Database",p9n="Test connection",m9n="From Name",_9n="From Address",v9n="Port",b9n="Encryption",y9n="Mailgun Domain",C9n="Mailgun Private Key",w9n="Brevo Domain",S9n="Brevo Private Key",E9n="Send Test Email",x9n="Select Label",k9n="Label",T9n="Service",I9n="Update payment details",L9n="Successfully updated payment details",D9n="Update Credit Card",A9n="Recurring Expenses",R9n="Recurring Expense",N9n="New Recurring Expense",O9n="Edit Recurring Expense",P9n="Archive Recurring Expense",M9n="List Recurring Expenses",F9n="Successfully updated recurring expense",B9n="Successfully created recurring expense",$9n="Successfully archived recurring expense",V9n="Restore Recurring Expense",H9n="Successfully restored recurring expense",W9n="Delete Recurring Expense",z9n="Successfully deleted recurring expense",j9n="View Recurring Expense",U9n="Taxes and fees",q9n="Import Failed",K9n="Recurring Prefix",G9n="Options",Y9n="Specify a prefix or use a custom pattern to dynamically set the credit number for negative invoices.",Q9n="The next credit number is :number.",X9n="The number of zero's to pad the number.",Z9n="Warning: The date format appears to be invalid.",J9n="Product Notes",e7n="App Version",t7n="OFX Version",n7n="Charge Late Fee",i7n="Late Fee Amount",r7n="Late Fee Percent",o7n="Late fee added on :date",s7n="Download Invoice",a7n="Download Quote",l7n="Your invoice PDFs are attached.",c7n="An email will be sent with the invoice PDF",u7n="An email will be sent with the quote PDF",d7n="An email will be sent with the invoice PDFs",h7n="An email will be sent with the quote PDFs",f7n="Clone Expense",g7n="Default Documents",p7n="Send email to the client",m7n="Refund Processed",_7n="You have been processed a refund of :amount for invoice :invoice_number.",v7n="US Dollar",b7n="British Pound",y7n="Euro",C7n="South African Rand",w7n="Danish Krone",S7n="Israeli Shekel",E7n="Swedish Krona",x7n="Kenyan Shilling",k7n="Canadian Dollar",T7n="Philippine Peso",I7n="Indian Rupee",L7n="Australian Dollar",D7n="Singapore Dollar",A7n="Norske Kroner",R7n="New Zealand Dollar",N7n="Vietnamese Dong",O7n="Swiss Franc",P7n="Guatemalan Quetzal",M7n="Malaysian Ringgit",F7n="Brazilian Real",B7n="Thai Baht",$7n="Nigerian Naira",V7n="Argentine Peso",H7n="Bangladeshi Taka",W7n="United Arab Emirates Dirham",z7n="Hong Kong Dollar",j7n="Indonesian Rupiah",U7n="Mexican Peso",q7n="Egyptian Pound",K7n="Colombian Peso",G7n="West African Franc",Y7n="Chinese Renminbi",Q7n="Rwandan Franc",X7n="Tanzanian Shilling",Z7n="Netherlands Antillean Guilder",J7n="Trinidad and Tobago Dollar",eVn="East Caribbean Dollar",tVn="Ghanaian Cedi",nVn="Bulgarian Lev",iVn="Aruban Florin",rVn="Turkish Lira",oVn="Romanian New Leu",sVn="Croatian Kuna",aVn="Saudi Riyal",lVn="Japanese Yen",cVn="Maldivian Rufiyaa",uVn="Costa Rican Colón",dVn="Pakistani Rupee",hVn="Polish Zloty",fVn="Sri Lankan Rupee",gVn="Czech Koruna",pVn="Uruguayan Peso",mVn="Namibian Dollar",_Vn="Tunisian Dinar",vVn="Russian Ruble",bVn="Mozambican Metical",yVn="Omani Rial",CVn="Ukrainian Hryvnia",wVn="Macanese Pataca",SVn="Taiwan New Dollar",EVn="Dominican Peso",xVn="Chilean Peso",kVn="Icelandic Króna",TVn="Papua New Guinean Kina",IVn="Jordanian Dinar",LVn="Myanmar Kyat",DVn="Peruvian Sol",AVn="Botswana Pula",RVn="Hungarian Forint",NVn="Ugandan Shilling",OVn="Barbadian Dollar",PVn="Brunei Dollar",MVn="Georgian Lari",FVn="Qatari Riyal",BVn="Honduran Lempira",$Vn="Surinamese Dollar",VVn="Bahraini Dinar",HVn="Venezuelan Bolivars",WVn="South Korean Won",zVn="Moroccan Dirham",jVn="Jamaican Dollar",UVn="Angolan Kwanza",qVn="Haitian Gourde",KVn="Zambian Kwacha",GVn="Nepalese Rupee",YVn="CFP Franc",QVn="Mauritian Rupee",XVn="Cape Verdean Escudo",ZVn="Kuwaiti Dinar",JVn="Algerian Dinar",eHn="Macedonian Denar",tHn="Fijian Dollar",nHn="Bolivian Boliviano",iHn="Albanian Lek",rHn="Serbian Dinar",oHn="Lebanese Pound",sHn="Armenian Dram",aHn="Azerbaijan Manat",lHn="Bosnia and Herzegovina Convertible Mark",cHn="Belarusian Ruble",uHn="Moldovan Leu",dHn="Kazakhstani Tenge",hHn="Gibraltar Pound",fHn="Gambia Dalasi",gHn="Paraguayan Guarani",pHn="Malawi Kwacha",mHn="Zimbabwean Dollar",_Hn="Cambodian Riel",vHn="Vanuatu Vatu",bHn="Cuban Peso",yHn="BZ Dollar",CHn="Libyan Dinar",wHn="Silver Troy Ounce",SHn="Gold Troy Ounce",EHn="Malagasy ariary",xHn="Tongan Pa'anga",kHn="We hope you're enjoying using the app.<br/>If you'd consider :link we'd greatly appreciate it!",THn="writing a review",IHn="First Tax",LHn="Second Tax",DHn="Gateway fees are the costs charged for access to the financial networks that handle the processing of online payments.",AHn="Exporting format",RHn="First Custom",NHn="Second Custom",OHn="Contact First Name",PHn="Contact Last Name",MHn="Contact First Custom",FHn="Contact Second Custom",BHn="Currency",$Hn="To troubleshoot check for comments on :ofxhome_link and test with :ofxget_link.",VHn="comments",HHn="Item Product",WHn="Item Notes",zHn="Item Cost",jHn="Item Quantity",UHn="Item Tax Rate",qHn="Item Tax Name",KHn="Item Tax1",GHn="Item Tax2",YHn="Delete Company",QHn="Permanently delete the company along with all data and setting.",XHn="Warning: This will permanently delete your company, there is no undo.",ZHn="The coupon has been applied, the plan price has been reduced by :discount%.",JHn="The coupon has been applied, your account has been upgraded to pro for one year.",eWn="If you're reporting an error please include any relevant logs from storage/logs/laravel-error.log",tWn="Include Errors",nWn="Include :link from storage/logs/laravel-error.log",iWn="recent errors",rWn="Customer",oWn="Customers",sWn="Successfully created customer",aWn="Successfully created :count customers",lWn="The data in your company (:account) has been successfully purged.",cWn="Successfully deleted company",uWn="Successfully canceled account",dWn="Your company (:account) has been successfully deleted.",hWn="Your account (:account) has been successfully deleted.",fWn="Alipay",gWn="Sofort",pWn="SEPA Direct Debit",mWn="Please enter a name with only the letters a-z and whitespaces",_Wn="Accept Alipay",vWn="Accept EU bank transfers",bWn="These gateways also need to be activated in :link.",yWn="Calendar",CWn=":link to enable the calendar by joining the Pro Plan",wWn="What are you working on?",SWn="Time Tracker",EWn="Refresh",xWn="Filter/Sort",kWn="No Description",TWn="Time Tracker Login",IWn="Save or discard your changes",LWn="Discard Changes",DWn="Tasks are not enabled.",AWn="Successfully started task",RWn="Create Client",NWn="Download the desktop app",OWn="Download the iPhone app",PWn="Download the Android app",MWn="Double tap a task to select it",FWn="Stopped",BWn="Ascending",$Wn="Descending",VWn="Sort By",HWn="Direction",WWn="Discard",zWn="AM",jWn="PM",UWn="mins",qWn="hr",KWn="hrs",GWn="Clear",YWn="Note: accepting online payments requires a payment gateway, :link to add one.",QWn="Task Rate",XWn="Set the default rate for invoiced tasks.",ZWn="Past Due",JWn="Document",ezn="Invoice/Expense",tzn="Invoice PDFs",nzn="Accept SEPA",izn="Accept Bitcoin",rzn="IBAN",ozn="By providing your IBAN and confirming this payment, you are authorizing :company and Stripe, our payment service provider, to send instructions to your bank to debit your account and your bank to debit your account in accordance with those instructions. You are entitled to a refund from your bank under the terms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited.",szn="Recover License",azn="Purchase",lzn="Recover",czn="Apply",uzn="Recover White Label License",dzn="Apply White Label License",hzn="Videos",fzn="Video",gzn="Return to Invoice",pzn="Partial Due Date",mzn="Task Fields",_zn="Drag and drop fields to change their order",vzn="Custom Value 1",bzn="Custom Value 2",yzn="Two-Factor Authentication",Czn="Use your phone to confirm your identity when logging in",wzn="Two-Factor Setup",Szn="Scan the bar code with a :link compatible app.",Ezn="One Time Password",xzn="Set your mobile phone number as a backup to enable.",kzn="Successfully enabled Two-Factor Authentication",Tzn="Add Product",Izn="Note: the email will be sent on :date.",Lzn="Invoice Product",Dzn="Self-Host Login",Azn="Self-Host URL",Rzn="Error: local storage is not available.",Nzn="Your Password Reset Link",Ozn="The subdomain is already in use",Pzn="Client Login",Mzn="Converted Amount",Fzn="Shipping Address",Bzn="Billing Address",$zn="Billing Street",Vzn="Billing Apt/Suite",Hzn="Billing City",Wzn="Billing State/Province",zzn="Billing Postal Code",jzn="Billing Country",Uzn="Shipping Street",qzn="Shipping Apt/Suite",Kzn="Shipping City",Gzn="Shipping State/Province",Yzn="Shipping Postal Code",Qzn="Shipping Country",Xzn="Classify",Zzn="Require client to provide their shipping address",Jzn="Ship to billing address",ejn="Delivery Note",tjn="Show tasks in the client portal",njn="Cancel Schedule",ijn="Scheduled Report",rjn="Email the :report report as :format to :email",ojn="Successfully scheduled report",sjn="Successfully canceled scheduled report",ajn="Your scheduled :type report is attached.",ljn="Failed to create schedule report",cjn="Invalid one time password",ujn="Apple/Google Pay",djn="Accept Apple Pay and Pay with Google",hjn="This payment type requires that a :link.",fjn="subdomain is set",gjn="Verification File",pjn="The verification file is needed to accept payments.",mjn="Use <code>:domain</code> as the domain in :link.",_jn="Sorry, Apple/Google Pay isn't supported by your browser",vjn="Optional Payment Methods",bjn="Add Subscription",yjn="Target",Cjn="When the selected event occurs the app will post the entity to the target URL.",wjn="Event",Sjn="Created Client",Ejn="Created Invoice",xjn="Created Quote",kjn="Created Payment",Tjn="Created Vendor",Ijn="Updated Quote",Ljn="Deleted Quote",Djn="Updated Invoice",Ajn="Deleted Invoice",Rjn="Updated Client",Njn="Deleted Client",Ojn="Deleted Payment",Pjn="Updated Vendor",Mjn="Deleted Vendor",Fjn="Created Expense",Bjn="Updated Expense",$jn="Deleted Expense",Vjn="Created Task",Hjn="Updated Task",Wjn="Deleted Task",zjn="Approved Quote",jjn="Subscriptions",Ujn="Successfully updated subscription",qjn="Successfully created subscription",Kjn="Edit Subscription",Gjn="Archive Subscription",Yjn="Successfully archived subscription",Qjn="The projects can't belong to different clients",Xjn="Invoice Project",Zjn="Recurring Invoices",Jjn="Credits",eUn="Quotes & Proposals",tUn="Tasks & Projects",nUn="Expenses & Vendors",iUn="Tickets",rUn="Reminders",oUn="Send email reminders",sUn="Tasks are visible in the portal",aUn="Reminders are not sent",lUn="Your promotion will expire soon, :link to upgrade now.",cUn="Note: to delete this company first delete all linked companies.",uUn="Please register your account",dUn="Processing request",hUn="Warning: Mcrypt is deprecated, run :command to update your cipher.",fUn="Edit Times",gUn="Include <b>taxes in the cost</b>",pUn="This setting can not be changed once an invoice has been created.",mUn="Warning: existing invoices will need to be resaved",_Un="Copy Shipping",vUn="Copy Billing",bUn="The quote has expired, please contact the merchant.",yUn="Showing 0 to 0 of 0 entries",CUn="Do not remember this device",wUn="Trust for 30 days",SUn="Trust forever",EUn="Kanban",xUn="Backlog",kUn="Ready to do",TUn="In progress",IUn="Add status",LUn="Archive Status",DUn="New Status",AUn="Convert Products",RUn="Automatically convert product prices to the client's currency",NUn="Set a subdomain to shorten the client portal link.",OUn="Budgeted Hours",PUn="Progress",MUn="View Project",FUn="Summary",BUn="Endless Reminder",$Un="Add the following code to show your client's signature on the PDF.",VUn="Show on PDF",HUn="Show the client signature on the invoice/quote PDF.",WUn="The white label license has expired",zUn="Return to Login",jUn='Note: add a :link named ":name" to see the exchange rate.',UUn="The amount is greater than the invoice balance, a credit will be created with the remaining amount.",qUn="Use <code>Label|Option1,Option2</code> to show a select box.",KUn="Client Information",GUn="Successfully updated client details",YUn="Auto",QUn="Tax Amount",XUn="Tax Paid",ZUn="None",JUn="To view your proposal for :amount, click the button below.",eqn="Proposal",tqn="Proposals",nqn="List Proposals",iqn="New Proposal",rqn="Edit Proposal",oqn="Archive Proposal",sqn="Delete Proposal",aqn="Successfully created proposal",lqn="Successfully updated proposal",cqn="Successfully archived proposal",uqn="Successfully archived proposal",dqn="Successfully archived :count proposals",hqn="Successfully archived :count proposals",fqn="Successfully restored proposal",gqn="Restore Proposal",pqn="Snippet",mqn="Snippets",_qn="Snippet",vqn="Snippets",bqn="New Snippet",yqn="Edit Snippet",Cqn="Archive Snippet",wqn="Delete Snippet",Sqn="Successfully created snippet",Eqn="Successfully updated snippet",xqn="Successfully archived snippet",kqn="Successfully archived snippet",Tqn="Successfully archived :count snippets",Iqn="Successfully archived :count snippets",Lqn="Successfully restored snippet",Dqn="Restore Snippet",Aqn="Template",Rqn="Templates",Nqn="Template",Oqn="Templates",Pqn="New Template",Mqn="Edit Template",Fqn="Archive Template",Bqn="Delete Template",$qn="Successfully created template",Vqn="Successfully updated template",Hqn="Successfully archived template",Wqn="Successfully archived template",zqn="Successfully archived :count templates",jqn="Successfully archived :count templates",Uqn="Successfully restored template",qqn="Restore Template",Kqn="Category",Gqn="Categories",Yqn="New Category",Qqn="Edit Category",Xqn="Archive Category",Zqn="Delete Category",Jqn="Successfully created category",eKn="Successfully updated category",tKn="Successfully archived category",nKn="Successfully archived category",iKn="Successfully archived :count categories",rKn="Successfully archived :count categories",oKn="Successfully restored category",sKn="Restore Category",aKn="Delete Status",lKn="Standard",cKn="Icon",uKn="The requested proposal is not available",dKn="Create category",hKn="Clone Template",fKn="Proposal Email",gKn="New proposal :number from :account",pKn="To view your proposal for :amount, click the link below.",mKn="Successfully emailed proposal",_Kn="Load Template",vKn="No images, drag to upload",bKn="Add Image",yKn="Select Image",CKn="Upgrade to the Enterprise Plan to upload files & images",wKn="Delete Image",SKn="Warning: deleting the image will remove it from all proposals.",EKn="Note: the invoice $amount field will use the partial/deposit field if set otherwise it will use the invoice balance.",xKn="Note: Inclusive taxes have been enabled.",kKn="Note: Inclusive taxes are not enabled.",TKn="Changing this setting requires :link the account data.",IKn="purging",LKn="The refund will be recorded in the app but will NOT be processed by the payment gateway.",DKn="Email address has been changed",AKn="The email address for your account has been changed from :old_email to :new_email.",RKn="Test",NKn="Beta",OKn="Email History",PKn="Loading",MKn="No messages found",FKn="Processing",BKn="Reactivate",$Kn="The email address has been reactivated",VKn="Emails",HKn="Opened",WKn="Bounced",zKn="Total Sent",jKn="Total Opened",UKn="Total Bounced",qKn="Total Spam",KKn="Platforms",GKn="Email Clients",YKn="Mobile",QKn="Desktop",XKn="Webmail",ZKn="Group",JKn="Subgroup",eGn="Unset",tGn="You've received a new payment!",nGn="Receive payment notifications using :link.",iGn="Slack incoming webhooks",rGn="Accept",oGn="Successfully accepted the latest terms of service",sGn="Invalid URL",aGn="Workflow Settings",lGn="Auto Email",cGn="Automatically email recurring invoices when created.",uGn="Auto Archive",dGn="Automatically archive invoices when paid.",hGn="Auto Archive",fGn="Automatically archive quotes when converted to invoice.",gGn="Require approve quote",pGn="Require clients to approve quotes.",mGn="Allow approve expired quote",_Gn="Allow clients to approve expired quotes.",vGn="Invoice Workflow",bGn="Quote Workflow",yGn="Error: the client must be active",CGn="Purge Client",wGn="Successfully purged client",SGn="All related records (invoices, tasks, expenses, documents, etc) will also be deleted.",EGn="Clone Product",xGn="Item Details",kGn="Send line item details to the payment gateway.",TGn="View Proposal",IGn="View in Portal",LGn="This website uses cookies to ensure you get the best experience on our website.",DGn="Got it!",AGn="vendor will be created",RGn="vendors will be created",NGn="Successfully created :count vendor(s)",OGn="Import Vendors",PGn="Company",MGn="Client Field",FGn="Contact Field",BGn="Product Field",$Gn="Task Field",VGn="Project Field",HGn="Expense Field",WGn="Vendor Field",zGn="Company Field",jGn="Invoice Field",UGn="Invoice Surcharge",qGn="Add a field when creating a task.",KGn="Add a field when creating a project.",GGn="Add a field when creating an expense.",YGn="Add a field when creating a vendor.",QGn="Messages",XGn="Unpaid Invoice",ZGn="Paid Invoice",JGn="Unapproved Quote",eYn="Unapproved Proposal",tYn="Auto-fills city/state",nYn="No match found",iYn="Password Strength",rYn="Weak",oYn="Good",sYn="Strong",aYn="Mark",lYn="Successfully update task status",cYn="Background Image",uYn="Use the :link to manage your images, we recommend using a small file.",dYn="proposal editor",hYn="Background",fYn="Guide",gYn="Gateway Fee Item",pYn="Gateway Fee Surcharge",mYn="Gateway Fee Discount",_Yn="Show Payments",vYn="Show Aging",bYn="Reference",yYn="Amount Paid",CYn="Send Notifications For",wYn="All Invoices",SYn="My Invoices",EYn="Payment Reference",xYn="Maximum",kYn="Sort",TYn="Refresh Complete",IYn="Please enter your email",LYn="Please enter your password",DYn="Please enter your URL",AYn="Please enter a product key",RYn="An error occurred",NYn="Overview",OYn="Copied :value to the clipboard",PYn="Error",MYn="Could not launch",FYn="Additional",BYn="Ok",$Yn="Email is invalid",VYn="Items",HYn="Partial/Deposit",WYn="Add Item",zYn="Total Amount",jYn="PDF",UYn="Invoice Status",qYn="Click + to add an item",KYn=":count selected",GYn="Dismiss",YYn="Please select a date",QYn="Please select a client",XYn="Language",ZYn="Updated",JYn="Please enter an invoice number",eQn="Please enter a quote number",tQn=":client's invoices",nQn="Viewed",iQn="Approved",rQn="Draft",oQn="Sent",sQn="Viewed",aQn="Approved",lQn="Partial",cQn="Paid",uQn="Successfully marked invoice as sent",dQn="Please enter a client or contact name",hQn="Restart the app to apply the change",fQn="Refresh Data",gQn="Blank Contact",pQn="No records found",mQn="Industry",_Qn="Size",vQn="Net",bQn="Show tasks",yQn="Email Reminders",CQn="First Reminder",wQn="Second Reminder",SQn="Third Reminder",EQn="Send",xQn="Auto billing",kQn="Button",TQn="More",IQn="Edit Recurring Invoice",LQn="Edit Recurring Quote",DQn="Quote Status",AQn="Please select an invoice",RQn="Filtered by",NQn="Payment Status",OQn="Pending",PQn="Voided",MQn="Failed",FQn="Completed",BQn="Partially Refunded",$Qn="Refunded",VQn="Send receipt to the client",HQn="Refunded",WQn="Successfully marked quote as sent",zQn="Custom Module Settings",jQn="Open",UQn="Closed",qQn="Reopened",KQn="Priority",GQn="Last Updated",YQn="Comments",QQn="Tags",XQn="Linked Objects",ZQn="Low",JQn="Medium",eXn="High",tXn="No due date set",nXn="Assigned to",iXn="Reply",rXn="Awaiting reply",oXn="Mark as Spam",sXn="Local Part",aXn="Name taken",lXn="Name available",cXn="Invalid name (alpha numeric only, no spaces",uXn="Customize the local part of your inbound support email, ie. YOUR_NAME@support.invoiceninja.com",dXn="From name is the recognizable sender which is displayed instead of the email address, ie Support Center",hXn="YOUR_NAME",fXn="Support Center",gXn="Attachments",pXn="Client uploads",mXn="Allow clients to upload documents/attachments",_Xn="Maximum file size (KB) is limited by your post_max_size and upload_max_filesize variables as set in your PHP.INI",vXn="Maximum file size",bXn="Mime types",yXn=".pdf , .docx, .jpg",CXn="Comma separated list of allowed mime types, leave blank for all",wXn="Ticket number must be greater than the current ticket number",SXn="New ticket",EXn="Selecting a template will send an auto response to a client/contact when a new ticket is created",xXn="Updated ticket",kXn="Selecting a template will send an auto response to a client/contact when a ticket is updated",TXn="Closed ticket",IXn="Selecting a template will send an auto response to a client/contact when a ticket is closed",LXn="Default priority",DXn="New comment",AXn="Additional new comment notifications",RXn="admin@example.com, supervisor@example.com",NXn="Default Agent",OXn="If selected will automatically be assigned to all inbound tickets",PXn="Show agent details on responses",MXn="Avatar",FXn="Remove avatar",BXn="Add Template",$Xn="Archive Template",VXn="Restore Template",HXn="Successfully archived template",WXn="Successfully restored template",zXn="Please enter a message to update the ticket",jXn="Show / Hide all",UXn="Subject required",qXn="If you're using the mobile app you may need to do a full refresh.",KXn="Merge",GXn="Merged",YXn="Agent",QXn="Include in filter",XXn=":VALUE",ZXn=":VALUE",JXn="Compare",eZn="Hosted Login",tZn="Selfhost Login",nZn="Google Login",iZn="Thank for your patience while we work to implement these features.<br><br>We hope to have them completed in the next few months.<br><br>Until then we'll continue to support the",rZn="legacy mobile app",oZn="Today",sZn="Current",aZn="Previous",lZn="Current Period",cZn="Comparison Period",uZn="Previous Period",dZn="Previous Year",hZn="Compare to",fZn="Last Week",gZn="Clone to Invoice",pZn="Clone to Quote",mZn="Convert",_Zn="Last 7 Days",vZn="Last 30 Days",bZn="Custom JS",yZn="Adjust percent to account for fee",CZn="Show product details",wZn="Include the <b>description and cost</b> in the product dropdown",SZn="Important",EZn="Thank you for using our app!",xZn="If you like it please",kZn="to rate it.",TZn="Average",IZn="Unapproved",LZn="Please authenticate to change this setting",DZn="Locked",AZn="Authenticate",RZn="Please authenticate",NZn="Biometric Authentication",OZn="Auto Start Tasks",PZn="Budgeted",MZn="Please enter a name",FZn="Click + to add time",BZn="Design",$Zn="Password is too short",VZn="Failed to find record",HZn="Valid Until",WZn="Automatically sets the <b>Valid Until</b> value on quotes to this many days in the future. Leave blank to disable.",zZn="Days",jZn="Requires an Enterprise Plan",UZn="Take Picture",qZn="Upload File",KZn="New Document",GZn="Edit Document",YZn="Successfully uploaded document",QZn="Successfully updated document",XZn="Successfully archived document",ZZn="Successfully deleted document",JZn="Successfully restored document",eJn="No History",tJn="Logged",nJn="Pending",iJn="Invoiced",rJn="No record selected",oJn="Please save or cancel your changes",sJn="Thank you for your purchase!",aJn="Redeem",lJn="Back",cJn="Past Purchases",uJn="Annual Subscription",dJn="Pro Plan",hJn="Enterprise Plan",fJn=":count users",gJn="Upgrade",pJn="Please enter a first name",mJn="Please enter a last name",_Jn="Please agree to the terms of service and privacy policy to create an account.",vJn="I agree to the",bJn="terms of service",yJn="privacy policy",CJn="View Website",wJn="Create Account",SJn="Email Login",EJn="Late Fees",xJn="Payment Number",kJn="Before the due date",TJn="After the due date",IJn="After the invoice date",LJn="Filtered by User",DJn="Successfully created user",AJn="Primary Font",RJn="Secondary Font",NJn="Number Padding",OJn="General",PJn="Surcharge Field",MJn="Company Value",FJn="Credit Field",BJn="Payment Field",$Jn="Group Field",VJn="Number Counter",HJn="Number Pattern",WJn="Custom JavaScript",zJn="Portal Mode",jJn="Attach PDF",UJn="Attach Documents",qJn="Attach UBL/E-Invoice",KJn="Email Style",GJn="Processed",YJn="Fee Amount",QJn="Fee Percent",XJn="Fee Cap",ZJn="Limits/Fees",JJn="Credentials",eei="Require client to provide their billing address",tei="Require client to provide their shipping address",nei="Successfully deleted tax rate",iei="Successfully restored tax rate",rei="Provider",oei="Payment Gateway",sei="Payment Gateways",aei="New Gateway",lei="Edit Gateway",cei="Successfully created gateway",uei="Successfully updated gateway",dei="Successfully archived gateway",hei="Successfully deleted gateway",fei="Successfully restored gateway",gei="Continue Editing",pei="Default value",mei="Currency Format",_ei="First Day of the Week",vei="First Month of the Year",bei="Symbol",yei="Code",Cei="Date Format",wei="Datetime Format",Sei="Send Reminders",Eei="Timezone",xei="Filtered by Group",kei="Filtered by Invoice",Tei="Filtered by Client",Iei="Filtered by Vendor",Lei="Group Settings",Dei="Groups",Aei="New Group",Rei="Edit Group",Nei="Successfully created group",Oei="Successfully updated group",Pei="Successfully archived group",Mei="Successfully deleted group",Fei="Successfully restored group",Bei="Upload Your Company Logo",$ei="Successfully uploaded logo",Vei="Successfully saved settings",Hei="Device Settings",Wei="Credit Cards & Banks",zei="Price",jei="Email Sign Up",Uei="Google Sign Up",qei="Sign Up With Google",Kei="Long-press Multiselect",Gei="Migrate to the next version of Invoice Ninja",Yei="We've been working on next version of Invoice Ninja. Click the button bellow to start the migration.",Qei="Start the migration",Xei="Migration",Zei="Welcome to the new version of Invoice Ninja",Jei="At the next step, we'll let you download your data for the migration.",eti="Press button below to download the data.",tti="Custom Company 1",nti="Custom Company 2",iti="Custom Company 3",rti="Custom Company 4",oti="Custom Product 1",sti="Custom Product 2",ati="Custom Product 3",lti="Custom Product 4",cti="Custom Client 1",uti="Custom Client 2",dti="Custom Client 3",hti="Custom Client 4",fti="Custom Contact 1",gti="Custom Contact 2",pti="Custom Contact 3",mti="Custom Contact 4",_ti="Custom Task 1",vti="Custom Task 2",bti="Custom Task 3",yti="Custom Task 4",Cti="Custom Project 1",wti="Custom Project 2",Sti="Custom Project 3",Eti="Custom Project 4",xti="Custom Expense 1",kti="Custom Expense 2",Tti="Custom Expense 3",Iti="Custom Expense 4",Lti="Custom Vendor 1",Dti="Custom Vendor 2",Ati="Custom Vendor 3",Rti="Custom Vendor 4",Nti="Custom Invoice 1",Oti="Custom Invoice 2",Pti="Custom Invoice 3",Mti="Custom Invoice 4",Fti="Custom Payment 1",Bti="Custom Payment 2",$ti="Custom Payment 3",Vti="Custom Payment 4",Hti="Custom Surcharge 1",Wti="Custom Surcharge 2",zti="Custom Surcharge 3",jti="Custom Surcharge 4",Uti="Custom Group 1",qti="Custom Group 2",Kti="Custom Group 3",Gti="Custom Group 4",Yti="Number",Qti="Count",Xti="Is Active",Zti="Contact Last Login",Jti="Contact Full Name",eni="Contact Custom Value 1",tni="Contact Custom Value 2",nni="Contact Custom Value 3",ini="Contact Custom Value 4",rni="Assigned To Id",oni="Created By Id",sni="Add Column",ani="Edit Columns",lni="to learn about Google Fonts",cni="Refund Date",uni="Multiselect",dni="Verify Password",hni="Applied",fni="Include recent errors from the logs",gni="We have received your message and will try to respond promptly.",pni="Show Product Details",mni="Include the description and cost in the product dropdown",_ni="The PDF renderer requires :version",vni="Adjust Fee Percent",bni="Configure Settings",yni="About",Cni="Credit Email",wni="Domain URL",Sni="Password must contain an upper case character and a number",Eni="Client Portal Tasks",xni="Client Portal Dashboard",kni="Please enter a value",Tni="Successfully deleted logo",Ini="Generate Number",Lni="When Saved",Dni="When Sent",Ani="Select Company",Rni="Float",Nni="Collapse",Oni="Show/hide",Pni="Menu Sidebar",Mni="History Sidebar",Fni="Tablet",Bni="Layout",$ni="Module",Vni="First Custom",Hni="Second Custom",Wni="Third Custom",zni="Show Cost",jni="Display a product cost field to track the markup/profit",Uni="Show Product Quantity",qni="Display a product quantity field, otherwise default to one",Kni="Show Invoice Quantity",Gni="Display a line item quantity field, otherwise default to one",Yni="Default Quantity",Qni="Automatically set the line item quantity to one",Xni="One Tax Rate",Zni="Two Tax Rates",Jni="Three Tax Rates",eii="Default Tax Rate",tii="Invoice Tax",nii="Line Item Tax",iii="Inclusive Taxes",rii="Invoice Tax Rates",oii="Item Tax Rates",sii="Configure rates",aii="Tax Rates",lii="Accent Color",cii="Comma separated list",uii="Single-line text",dii="Multi-line text",hii="Dropdown",fii="Field Type",gii="A password recovery email has been sent",pii="Successfully removed user",mii="Three Years",_ii="24 Hour Display",vii="Click here",bii="Successfully marked invoice as paid",yii="Successfully marked invoices as sent",Cii="Successfully marked invoices as paid",wii="System failed to email invoice :invoice",Sii="Custom Value 3",Eii="Custom Value 4",xii="Custom Email Style",kii="Custom Dashboard Message",Tii="Custom Unpaid Invoice Message",Iii="Custom Paid Invoice Message",Lii="Custom Unapproved Quote Message",Dii="Lock Sent Invoices",Aii="Translations",Rii="Task Number Pattern",Nii="Task Number Counter",Oii="Expense Number Pattern",Pii="Expense Number Counter",Mii="Vendor Number Pattern",Fii="Vendor Number Counter",Bii="Ticket Number Pattern",$ii="Ticket Number Counter",Vii="Payment Number Pattern",Hii="Payment Number Counter",Wii="Invoice Number Pattern",zii="Quote Number Pattern",jii="Credit Number Pattern",Uii="Credit Number Counter",qii="Credit Number Pattern",Kii="Credit Number Counter",Gii="Reset Counter Date",Yii="Counter Padding",Qii="Share Invoice/Quote Counter",Xii="Default Tax Name 1",Zii="Default Tax Rate 1",Jii="Default Tax Name 2",eri="Default Tax Rate 2",tri="Default Tax Name 3",nri="Default Tax Rate 3",iri="Email Invoice Subject",rri="Email Quote Subject",ori="Email Payment Subject",sri="Switch List Table",ari="Client City",lri="Client State",cri="Client Country",uri="Client is Active",dri="Client Balance",hri="Client Street",fri="Client Apt/Suite",gri="Client Shipping Street",pri="Client Shipping Apt/Suite",mri="Tax Rate 1",_ri="Tax Rate 2",vri="Tax Rate 3",bri="Archived At",yri="Has Expenses",Cri="Custom Taxes 1",wri="Custom Taxes 2",Sri="Custom Taxes 3",Eri="Custom Taxes 4",xri="Custom Surcharge 1",kri="Custom Surcharge 2",Tri="Custom Surcharge 3",Iri="Custom Surcharge 4",Lri="Is Deleted",Dri="Vendor City",Ari="Vendor State",Rri="Vendor Country",Nri="Credit Footer",Ori="Credit Terms",Pri="Untitled Company",Mri="Successfully added company",Fri="Supported Events",Bri="Third Custom",$ri="Fourth Custom",Vri="Optional",Hri="License",Wri="Invoice Balance",zri="Successfully saved design",jri="Client Details",Uri="Company Address",qri="Quote Details",Kri="Credit Details",Gri="Product Columns",Yri="Task Columns",Qri="Add Field",Xri="All Events",Zri="Owned",Jri="Payment Success",eoi="Payment Failure",toi="Quote Sent",noi="Credit Sent",ioi="Invoice Viewed",roi="Quote Viewed",ooi="Credit Viewed",soi="Quote Approved",aoi="Receive All Notifications",loi="Purchase License",coi="Enable Modules",uoi="Successfully converted quote",doi="Credit Design",hoi="Includes",foi="CSS Framework",goi="Custom Designs",poi="Designs",moi="New Design",_oi="Edit Design",voi="Successfully created design",boi="Successfully updated design",yoi="Successfully archived design",Coi="Successfully deleted design",woi="Successfully removed design",Soi="Successfully restored design",Eoi="Recurring Tasks",xoi="Successfully removed credit",koi="Latest Version",Toi="Update Now",Ioi="A new version of the web app is available",Loi="Update Available",Doi="Update successfully completed",Aoi="Integrations",Roi="Tracking Id",Noi="Slack Webhook URL",Ooi="Partial Payment",Poi="Partial Payment Email",Moi="Clone to Credit",Foi="Successfully emailed credit",Boi="Successfully marked credit as sent",$oi="Email Partial Payment Subject",Voi="Is Approved",Hoi="Oops, something went wrong! Please make sure you have setup an Invoice Ninja v5 instance before starting the migration.",Woi='Cross account migration is not allowed. Please read more about it here: <a href="https://invoiceninja.github.io/docs/migration/#troubleshooting">https://invoiceninja.github.io/docs/migration/#troubleshooting</a>',zoi="Email Credit",joi="Client does not have an email address set",Uoi="Ledger",qoi="View PDF",Koi="All records",Goi="Owned by user",Yoi="Credit Remaining",Qoi="Use default",Xoi="Endless Reminders",Zoi="Number of days",Joi="Configure Payment Terms",esi="Payment Term",tsi="New Payment Term",nsi="Successfully deleted payment term",isi="Successfully removed payment term",rsi="Successfully restored payment term",osi="Full Width Editor",ssi="Full Height Filter",asi="Sign in with email",lsi="Change",csi="Change to the mobile layout?",usi="Change to the desktop layout?",dsi="Send from Gmail",hsi="Reversed",fsi="Cancelled",gsi="Quote Amount",psi="Hosted",msi="Self-Hosted",_si="Hide Menu",vsi="Show Menu",bsi="Partially Refunded",ysi="Search Documents",Csi="Search Designs",wsi="Search Invoices",Ssi="Search Clients",Esi="Search Products",xsi="Search Quotes",ksi="Search Credits",Tsi="Search Vendors",Isi="Search Users",Lsi="Search Tax Rates",Dsi="Search Tasks",Asi="Search Settings",Rsi="Search Projects",Nsi="Search Expenses",Osi="Search Payments",Psi="Search Groups",Msi="Search Company",Fsi="Successfully cancelled invoice",Bsi="Successfully cancelled invoices",$si="Successfully reversed invoice",Vsi="Successfully reversed invoices",Hsi="Reverse",Wsi="Filtered by Project",zsi="Sign in with Google",jsi=":user reversed invoice :invoice",Usi=":user cancelled invoice :invoice",qsi="Reconciliation Failure",Ksi="Reconciliation Success",Gsi="Gateway Success",Ysi="Gateway Failure",Qsi="Gateway Error",Xsi="Email Send",Zsi="Email Retry Queue",Jsi="Failure",eai="Quota Exceeded",tai="Upstream Failure",nai="System Logs",iai="Copy Link",rai="Welcome to Invoice Ninja",oai="Opt-In",sai="Opt-Out",aai="Auto Convert",lai="Reminder 1 Sent",cai="Reminder 2 Sent",uai="Reminder 3 Sent",dai="Reminder Last Sent",hai="Page :current of :total",fai="Successfully emailed credits",gai="View in Stripe",pai="Rows Per Page",mai="Apply Payment",_ai="Unapplied",vai="Custom Labels",bai="Record Type",yai="Record Name",Cai="File Type",wai="Height",Sai="Width",Eai="Health Check",xai="Last Login At",kai="Company Key",Tai="Storefront",Iai="Enable third-party apps to create invoices",Lai=":count records selected",Dai=":count record selected",Aai="Client Created",Rai="Online Payment Email",Nai="Manual Payment Email",Oai="Completed",Pai="Gross",Mai="Net Amount",Fai="Net Balance",Bai="Client Settings",$ai="Selected Invoices",Vai="Selected Payments",Hai="Selected Quotes",Wai="Selected Tasks",zai="Selected Expenses",jai="Past Due Invoices",Uai="Create Payment",qai="Update Quote",Kai="Update Invoice",Gai="Update Client",Yai="Update Vendor",Qai="Create Expense",Xai="Update Expense",Zai="Update Task",Jai="Approve Quote",eli="When Paid",tli="Expires On",nli="Show Sidebar",ili="Hide Sidebar",rli="Event Type",oli="Copy",sli="Please restart the app once connected to the internet",ali="The crons need to be enabled",lli="API Webhooks",cli="Search :count Webhooks",uli="Search 1 Webhook",dli="Webhook",hli="Webhooks",fli="New Webhook",gli="Edit Webhook",pli="Successfully created webhook",mli="Successfully updated webhook",_li="Successfully archived webhook",vli="Successfully deleted webhook",bli="Successfully removed webhook",yli="Successfully restored webhook",Cli="Search :count Tokens",wli="Search 1 Token",Sli="New Token",Eli="Successfully removed token",xli="Successfully restored token",kli="Client Registration",Tli="Enable clients to self register in the portal",Ili="Customize & Preview",Lli="Search 1 Document",Dli="Search 1 Design",Ali="Search 1 Invoice",Rli="Search 1 Client",Nli="Search 1 Product",Oli="Search 1 Quote",Pli="Search 1 Credit",Mli="Search 1 Vendor",Fli="Search 1 User",Bli="Search 1 Tax Rate",$li="Search 1 Tasks",Vli="Search 1 Project",Hli="Search 1 Expense",Wli="Search 1 Payment",zli="Search 1 Group",jli="Created On",Uli="Lock Invoices",qli="Show Table",Kli="Show List",Gli="View Changes",Yli="Force Update",Qli="You are running the latest version but there may be pending fixes available.",Xli="Track the expense has been paid",Zli="Enable the expense to be invoiced",Jli="Make the documents visible to client",eci="Set an exchange rate",tci="Expense Settings",nci="Clone to Recurring",ici="Crypto",rci="User Field",oci="Variables",sci="Show Password",aci="Hide Password",lci="Copy Error",cci="Capture Card",uci="Auto Bill Enabled",dci="Total Taxes",hci="Line Taxes",fci="Total Fields",gci="Successfully stopped recurring invoice",pci="Successfully started recurring invoice",mci="Successfully resumed recurring invoice",_ci="Gateway Refund",vci="Process the refund with the payment gateway",bci="Due Date",yci="Paused",Cci="Day :count",wci="First Day of the Month",Sci="Last Day of the Month",Eci="Use Payment Terms",xci="Endless",kci="Next Send Date",Tci="Remaining Cycles",Ici="Successfully created recurring invoice",Lci="Successfully updated recurring invoice",Dci="Successfully removed recurring invoice",Aci="Search 1 Recurring Invoice",Rci="Search :count Recurring Invoices",Nci="Send Date",Oci="Auto Bill On",Pci="Minimum Under Payment Amount",Mci="Allow Overpayment",Fci="Support paying extra to accept tips",Bci="Allow Underpayment",$ci="Support paying at minimum the partial/deposit amount",Vci="Test Mode",Hci="Calculated Rate",Wci="Default Task Rate",zci="Clear Cache",jci="Sort Order",Uci="Status",qci="Task Statuses",Kci="New Task Status",Gci="Edit Task Status",Yci="Successfully created task status",Qci="Successfully archived task status",Xci="Successfully deleted task status",Zci="Successfully removed task status",Jci="Successfully restored task status",eui="Search 1 Task Status",tui="Search :count Task Statuses",nui="Show Tasks Table",iui="Always show the tasks section when creating invoices",rui="Invoice Task Timelog",oui="Add time details to the invoice line items",sui="Start tasks before saving",aui="Configure Statuses",lui="Task Settings",cui="Configure Categories",uui="Edit Expense Category",dui="Successfully removed expense category",hui="Search 1 Expense Category",fui="Search :count Expense Categories",gui="Use Available Credits",pui="Show Option",mui="The credit amount cannot exceed the payment amount",_ui="Enable the expense to be invoiced",vui="Configure Gateways",bui="Partial Payment",yui="Is Running",Cui="Invoice Currency ID",wui="Tax Name 1",Sui="Tax Name 2",Eui="Transaction ID",xui="Invoice Late",kui="Quote Expired",Tui="Invoice Total",Iui="Actions",Lui="Expense Number",Dui="Task Number",Aui="Project Number",Rui="View Settings",Nui="Warning: this company has not yet been activated",Oui="Late Invoice",Pui="Expired Quote",Mui="Remind Invoice",Fui="Client Phone",Bui="Required Fields",$ui="Enabled Modules",Vui=":contact viewed quote :quote",Hui=":user updated client :client",Wui=":user updated vendor :vendor",zui=":user emailed first reminder for invoice :invoice to :contact",jui=":user emailed second reminder for invoice :invoice to :contact",Uui=":user emailed third reminder for invoice :invoice to :contact",qui=":user emailed endless reminder for invoice :invoice to :contact",Kui="Expense Category ID",Gui="View Licenses",Yui="Fullscreen Editor",Qui="Sidebar Editor",Xui='Please type ":value" to confirm',Zui="Purge",Jui="Clone To",edi="Clone to Other",tdi="Labels",ndi="Add Custom",idi="Payment Tax",rdi="White Label",odi="Sent invoices are locked",sdi="Paid invoices are locked",adi="Source Code",ldi="App Platforms",cdi="Successfully archived :value task statuses",udi="Successfully deleted :value task statuses",ddi="Successfully restored :value task statuses",hdi="Successfully deleted expense :value categories",fdi="Successfully restored expense :value categories",gdi="Successfully archived recurring :value invoices",pdi="Successfully deleted recurring :value invoices",mdi="Successfully restored recurring :value invoices",_di="Successfully archived :value webhooks",vdi="Successfully deleted :value webhooks",bdi="Successfully removed :value webhooks",ydi="Successfully restored :value webhooks",Cdi="API Docs",wdi="Successfully archived :value tokens",Sdi="Successfully deleted :value tokens",Edi="Successfully restored :value tokens",xdi="Successfully archived :value payment terms",kdi="Successfully deleted :value payment terms",Tdi="Successfully restored :value payment terms",Idi="Successfully archived :value designs",Ldi="Successfully deleted :value designs",Ddi="Successfully restored :value designs",Adi="Successfully restored :value credits",Rdi="Successfully archived :value users",Ndi="Successfully deleted :value users",Odi="Successfully removed :value users",Pdi="Successfully restored :value users",Mdi="Successfully archived :value tax rates",Fdi="Successfully deleted :value tax rates",Bdi="Successfully restored :value tax rates",$di="Successfully archived :value gateways",Vdi="Successfully deleted :value gateways",Hdi="Successfully restored :value gateways",Wdi="Successfully archived :value groups",zdi="Successfully deleted :value groups",jdi="Successfully restored :value groups",Udi="Successfully archived :value documents",qdi="Successfully deleted :value documents",Kdi="Successfully restored :value documents",Gdi="Successfully restored :value vendors",Ydi="Successfully restored :value expenses",Qdi="Successfully restored :value tasks",Xdi="Successfully restored :value projects",Zdi="Successfully restored :value products",Jdi="Successfully restored :value clients",ehi="Successfully restored :value invoices",thi="Successfully restored :value payments",nhi="Successfully restored :value quotes",ihi="Update App",rhi="Successfully started import",ohi="Duplicate column mapping",shi="Uses Inclusive Taxes",ahi="Is Amount Discount",lhi="Map To",chi="Use first row as column names",uhi="No File Selected",dhi="Import Type",hhi="Draft Mode",fhi="Preview updates faster but is less accurate",ghi="Show Product Discount",phi="Display a line item discount field",mhi="Tax Name 3",_hi="Debug mode is enabled",vhi="Warning: it is intended for use on local machines, it can leak credentials. Click to learn more.",bhi="Running Tasks",yhi="Recent Tasks",Chi="Recent Expenses",whi="Upcoming Expenses",Shi="Search 1 Payment Term",Ehi="Search :count Payment Terms",xhi="Save and Preview",khi="Save and Email",Thi="Converted Balance",Ihi="Is Sent",Lhi="Document Upload",Dhi="Enable clients to upload documents",Ahi="Expense Total",Rhi="Enter Taxes",Nhi="By Rate",Ohi="By Amount",Phi="Enter Amount",Mhi="Before Taxes",Fhi="After Taxes",Bhi="Color",$hi="Show",Vhi="Empty Columns",Hhi="Project Name",Whi="To use :client_counter please add either :client_number or :client_id_number to prevent conflicts",zhi="This Quarter",jhi="To update run",Uhi="Registration URL",qhi="Show Product Cost",Khi="Complete",Ghi="Next",Yhi="Next step",Qhi="Credit :invoice was sent to :client",Xhi="Credit :invoice was viewed by :client",Zhi="The following client :client was emailed Credit :invoice for :amount.",Jhi="The following client :client viewed Credit :credit for :amount.",efi="Enter your email to reset your password.",tfi="Password reset",nfi="Welcome! Glad to see you.",ifi="Request cancellation",rfi="Delete Payment Method",ofi="You are about to delete the payment method.",sfi="Action can't be reversed",afi="The profile has been updated successfully.",lfi="Ethiopian Birr",cfi="Use a permanent address where you can receive mail.",ufi="Invoice Status",dfi="This email is already linked to an account",hfi="Locations",ffi="Indefinitely",gfi="Cycles remaining",pfi="I understand, delete",mfi="Download Files",_fi="Use this link to download your files, the link will expire in 1 hour.",vfi="New Signup",bfi="A new account has been created by :user - :email - from IP address: :ip",yfi="Payment was made by :client",Cfi="Partial payment was made by :client",wfi="A payment of :amount was made by client :client towards :invoice",Sfi="A partial payment of :amount was made by client :client towards :invoice",Efi="Notification Bot",xfi="Invoice # :invoice",kfi=":entity # :entity_number",Tfi="If the button above isn't working for you, please click on the link",Ifi="Display Log",Lfi="Report errors to help improve the app",Dfi="Setup",Afi="Quick overview & statistics",Rfi="Update your personal information",Nfi="Name, website & logo",Ofi="Make sure you use full link to your site",Pfi="Personal address",Mfi="Enter your personal address",Ffi="Enter your shipping address",Bfi="List of invoices",$fi="With selected",Vfi="This invoice is still not paid. Click the button to complete the payment",Hfi="List of recurring invoices",Wfi="Here are some details about recurring invoice",zfi="Cancellation",jfi="In case you want to stop the recurring invoice, please click to request the cancellation.",Ufi="Warning! You are requesting a cancellation of this service. Your service may be cancelled with no further notification to you.",qfi="Cancellation pending, we'll be in touch!",Kfi="List of payments",Gfi="Details of the payment",Yfi="Associate invoices",Qfi="List of payment methods",Xfi="Details of payment method",Zfi="Permanently remove this payment method.",Jfi="Warning! This action can not be reversed!",egi="Confirmation",tgi="Quotes",ngi="Waiting for approval",igi="This quote is still not approved",rgi="Credits",ogi="Required extensions",sgi="PHP version",agi="Writable .env file",lgi=".env file is not writable by the current user.",cgi="Minimum PHP version",ugi="Make sure all requirements are satisfied.",dgi="Oops, something does not look right!",hgi="Open in new tab",fgi="Complete payment",ggi="Authorize payment method for future use",pgi="Page",mgi="Per page",_gi="Of",vgi="View Credit",bgi="To view the :entity you need to enter password.",ygi="Showing :first to :last out of :total results",Cgi="No results found.",wgi="Payment failed for Client :client",Sgi="A payment made by client :client failed with message :message",Egi="Register",xgi="Create your account in seconds",kgi="Confirm your password",Tgi="Verification",Igi="Before using a bank account it must be verified.",Lgi="Checkout.com",Dgi="Copyright © :year :company.",Agi="Provided credit card number is not valid.",Rgi="Provided month is not valid.",Ngi="Provided year is not valid.",Ogi="HTTPS is required, form will fail",Pgi="If you need help you can post to our",Mgi="After updating password, your account will be confirmed.",Fgi="To pay with a bank account, first you have to add it as payment method.",Bgi="Let's store basic information about your Invoice Ninja!",$gi="Highly recommended in production",Vgi="Enable only for development",Hgi="Test PDF",Wgi=`Checkout.com can be can saved as payment method for future use, once you complete your first transaction. Don't forget to check "Store credit card details" during payment process.`,zgi=`Bank account (SOFORT) can be can saved as payment method for future use, once you complete your first transaction. Don't forget to check "Store payment details" during payment process.`,jgi="Node status",Ugi="NPM status",qgi="I could not find Node anywhere. Is it installed?",Kgi="I could not find NPM anywhere. Is it installed?",Ggi="This invoice is locked and unable to be modified",Ygi="Downloads",Qgi="Resource",Xgi="Details about the document",Zgi="Hash",Jgi="Resources",epi="Allowed file types:",tpi="Common codes and their meanings",npi="20087: Bad Track Data (invalid CVV and/or expiry date)",ipi="Download selected",rpi="To pay invoices, you have to",opi="add payment method",spi="No items selected.",api="Payment due",lpi="Account Balance",cpi="Thanks",upi="Minimum required payment is :amount",dpi="Company doesn't support underpayments.",hpi="Company doesn't support overpayments.",fpi="Saved at :time",gpi="Credit applied to Invoice :invoice_number",ppi="New credit :number from :account",mpi="To view your credit for :amount, click the link below.",_pi="Cryptocurrency",vpi="Credit",bpi="Store for future use",ypi="Pay with credit",Cpi="Payment method can't be saved for future use.",wpi="Pay with",Spi='By clicking "Next step" you accept terms.',Epi="Not specified",xpi="Before proceeding with payment, you have to fill following fields",kpi="After completing, go back to previous page.",Tpi="Pay",Ipi="Instructions",Lpi="Reminder 1 for Invoice :invoice was sent to :client",Dpi="Reminder 2 for Invoice :invoice was sent to :client",Api="Reminder 3 for Invoice :invoice was sent to :client",Rpi="Custom reminder for Invoice :invoice was sent to :client",Npi="Endless reminder for Invoice :invoice was sent to :client",Opi="Assigned User",Ppi="To proceed to next step, make sure you test each section.",Mpi="Note about Phantom JS. Read more.",Fpi="Minimum Payment",Bpi="No action provided. If you believe this is wrong, please contact the support.",$pi="No payable invoices selected. Make sure you are not trying to pay draft invoice or invoice with zero balance due.",Vpi="Required payment details",Hpi="To complete a payment we need more details about you.",Wpi="We will save this, so you don't have to enter it next time.",zpi="We were unable to deliver Credit :invoice to :contact. \\n :error",jpi="Unable to deliver Credit :invoice",Upi="Save payment method details",qpi="New card",Kpi="Add Bank Account",Gpi="Limit of :limit companies per account.",Ypi="Total credits applied cannot be MORE than total of invoices",Qpi="Credit number already taken",Xpi="Credit not found",Zpi="Selected invoices are not from a single client",Jpi="Duplicate credits submitted.",emi="Duplicate invoices submitted.",tmi="You must have an invoice set when using a credit in a payment",nmi="Client id is required",imi="Expense number already taken",rmi="Invoice number already taken",omi="Payment `id` required.",smi="Unable to retrieve specified payment",ami="Invoice id :invoice is not related to this payment",lmi="Credit id :credit is not related to this payment",cmi="Attempting to refund more than allowed for invoice id :invoice, maximum refundable amount is :amount",umi="Attempting to refund a payment with invoices attached, please specify valid invoice/s to be refunded.",dmi="Attempting to refund a payment with credits attached, please specify valid credits/s to be refunded.",hmi="Attempting to refund more than allowed for credit :credit, maximum refundable amount is :amount",fmi="Project client does not match entity client",gmi="Quote number already taken",pmi="Recurring Invoice number :number already taken",mmi="User not associated with this account",_mi="Amounts do not balance correctly.",vmi="Insufficient applied amount remaining to cover payment.",bmi="Insufficient balance on credit.",ymi="One or more of these invoices have been paid",Cmi="Invoice id :number cannot be refunded",wmi="Attempting to refund :amount only :refundable_amount available for refund",Smi="This user is unable to be attached to this company. Perhaps they have already registered a user on another account?",Emi="Migration completed",xmi="Your migration has completed, please review your data after logging in.",kmi="404 | Nothing to see here!",Tmi="Cannot load a large account without a updated_at parameter",Imi="No backup exists for this activity",Lmi="Company User record not found",Dmi="No credits found.",Ami="The requested action :action is not available.",Rmi="No Documents Found",Nmi="No group settings found",Omi="Insufficient privileges to access/modify this resource",Pmi="Invoice cannot be marked as paid",Mmi="Invalid license, or invalid environment :environment",Fmi="Route not available",Bmi="Invalid custom design object",$mi="Quote/s not found",Vmi="Unable to approve this quote as it has expired.",Hmi="Scheduler has run",Wmi="Scheduler has never run",zmi="Self update not available on this system.",jmi="User detached from company",Umi="Failed to create Webhook",qmi="Thank you for your payment of :amount for :invoice",Kmi="Note: Online payments are supported only if amount is larger than $1 or currency equivalent.",Gmi="Payment token not found, please try again. If an issue still persist, try with another payment method",Ymi="Vendor Street",Qmi="Vendor Apt/Suite",Xmi="Partially Unapplied",Zmi="Please select a user authenticated with Gmail",Jmi="List Long Press",e_i="Show Actions",t_i="Start Multiselect",n_i="An email has been sent to confirm the email address",i_i="Converted Paid to Date",r_i="Converted Credit Balance",o_i="Converted Total",s_i="Reply-To Name",a_i="Color Theme",l_i="Start Migration",c_i="Request for recurring invoice cancellation from :contact",u_i=":contact from Client :client requested to cancel Recurring Invoice :invoice",d_i="Hello",h_i="Group documents",f_i="Are you sure you want to approve this quote?",g_i="Select companies to migrate",p_i="Force migration",m_i="Require Password with Social Login",__i="Stay Logged In",v_i="Warning: Your session is about to expire",b_i=":count Hours",y_i="1 Day",C_i=":count Days",w_i="Web Session Timeout",S_i="Security Settings",E_i="Resend Email",x_i="Please confirm your email address",k_i="FreshBooks",T_i="Invoice2go",I_i="Invoicely",L_i="Wave Accounting",D_i="Zoho",A_i="Accounting",R_i="Please provide all CSVs.",N_i="Let's continue by authenticating.",O_i="API secret",P_i="You can find API_SECRET in the .env file or Invoice Ninja v5. If property is missing, leave field blank.",M_i="Your discount will be applied on the checkout.",F_i="Use last email",B_i="Activate Company",$_i="Enable emails, recurring invoices and notifications",V_i="An error occurred, please try again",H_i="Please first set a password",W_i="Warning: Changing your phone number will disable 2FA",z_i="Help Translate",j_i="Please select a country",U_i="Successfully disabled 2FA",q_i="Successfully connected account",K_i="Successfully disconnected account",G_i="Delivered",Y_i="Spam",Q_i="View Docs",X_i="Please provide a mobile phone number to enable two factor authentication",Z_i="Send SMS",J_i="SMS Code",evi="Connect Google",tvi="Disconnect Google",nvi="Disable Two Factor",ivi="Invoice Task Datelog",rvi="Add date details to the invoice line items",ovi="Promo code",svi="Recurring invoice issued to",avi="Subscription",lvi="New Subscription",cvi="Successfully deleted subscription",uvi="Successfully removed subscription",dvi="Successfully restored subscription",hvi="Search 1 Subscription",fvi="Search :count Subscriptions",gvi="Subdomain is not available",pvi="Connect Gmail",mvi="Disconnect Gmail",_vi="Successfully connected Gmail",vvi="Successfully disconnected Gmail",bvi="Changes to the codebase may be blocking the update, you can run this command to discard the changes:",yvi="Client ID Number",Cvi=":count Minutes",wvi="Password Timeout",Svi="Share Invoice/Credit Counter",Evi=":user created subscription :subscription",xvi=":user updated subscription :subscription",kvi=":user archived subscription :subscription",Tvi=":user deleted subscription :subscription",Ivi=":user restored subscription :subscription",Lvi="The amount is greater than the invoice balance. You cannot overpay an invoice.",Dvi="Click to continue",Avi="The following invoice :invoice was created for client :client for :amount.",Rvi="Invoice :invoice was created for :client",Nvi="The following quote :invoice was created for client :client for :amount.",Ovi="Quote :invoice was created for :client",Pvi="The following credit :invoice was created for client :client for :amount.",Mvi="Credit :invoice was created for :client",Fvi="Maximum companies migrated",Bvi="You have reached your maximum number of companies. Delete existing companies to migrate new ones.",$vi="Company already migrated",Vvi="Looks like you already migrated <b> :company_name </b>to the V5 version of the Invoice Ninja. In case you want to start over, you can force migrate to wipe existing data.",Hvi=`This payment method can be can saved for future use, once you complete your first transaction. Don't forget to check "Store details" during payment process.`,Wvi="New account",zvi=":user created recurring invoice :recurring_invoice",jvi=":user updated recurring invoice :recurring_invoice",Uvi=":user archived recurring invoice :recurring_invoice",qvi=":user deleted recurring invoice :recurring_invoice",Kvi=":user restored recurring invoice :recurring_invoice",Gvi="New login detected for your account.",Yvi="You recently logged in to your Invoice Ninja account from a new location or device:<br><br><b>IP:</b> :ip<br><b>Time:</b> :time<br><b>Email:</b> :email",Qvi="Contact Details",Xvi="Your company backup is ready for download",Zvi="Account passwordless login",Jvi="Cannot add the same user to the same company",ebi="User exists but cannot be crossed linked to multiple accounts",tbi="ACH verification",nbi="Connecting bank accounts require verification. Payment gateway will automatically send two small deposits for this purpose. These deposits take 1-2 business days to appear on the customer's online statement.",ibi="Login link requested",rbi="There was a request to login using link. If you did not request this, it's safe to ignore it.",obi="Your invoices are ready for download",sbi="Migration failed",abi="Looks like something went wrong with the migration for the following company:",lbi="If you have any questions please contact us, we're here to help!",cbi="Quote was approved",ubi="We would like to inform you that quote was approved.",dbi="Error importing :company",hbi="There was an error importing the company data, the error message was:",fbi="Due Date",gbi="Amount in pennies,pence or cents. ie for $0.10 please enter 10",pbi="Default Payment Method",mbi="Make this your preferred way of paying.",_bi="This is your preferred way of paying.",vbi="Auto Bill Disabled",bbi="Select a payment method:",ybi="Log in without password",Cbi="Email me when an invoice is <b>sent</b>",wbi="One time purchases",Sbi="Recurring purchases",Ebi="You might be interested in the following",xbi='Only quotes with "Sent" status can be approved. Expired quotes cannot be approved.',kbi="No quotes available for download.",Tbi="Copyright",Ibi=":user created :created_user at :time",Lbi="Company deleted",Dbi="Company [ :company ] was deleted by :user",Abi="Back to :url",Rbi="Connect your Stripe Account",Nbi="Invoice Ninja v5 uses Stripe Connect to link your Stripe account to Invoice Ninja. This provides an additional layer of security for your account. Now that you data has migrated, you will need to Authorize Stripe to accept payments in v5.<br><br>To do this, navigate to Settings > Online Payments > Configure Gateways. Click on Stripe Connect and then under Settings click Setup Gateway. This will take you to Stripe to authorize Invoice Ninja and on your return your account will be successfully linked!",Obi="Account email quota exceeded.",Pbi="In a 24 hour period you have sent :quota emails. <br> We have paused your outbound emails.<br><br> Your email quota will reset at 23:00 UTC.",Mbi="Opt in or out of having this invoice automatically charged.",Fbi="Arabic",Bbi="Persian",$bi="Latvian",Vbi="Expiry date",Hbi="Card holder name",Wbi="Recurring Quote number :number already taken",zbi="Account type",jbi="Locality",Ubi="Checking",qbi="Savings",Kbi="Unable to verify payment method.",Gbi="Gateway configuration error. Please check your credentials.",Ybi="My documents",Qbi="This payment method cannot be preauthorized.",Xbi="KBC/CBC",Zbi="Bancontact",Jbi="By providing your IBAN and confirming this payment, you are authorizing :company and Stripe, our payment service provider, to send instructions to your bank to debit your account and your bank to debit your account in accordance with those instructions. You are entitled to a refund from your bank under the terms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited.",eyi="iDEAL",tyi="Bank Account Holder",nyi="All-in-one checkout",iyi="Przelewy24",ryi="I declare that I have familiarized myself with the regulations and information obligation of the Przelewy24 service.",oyi="GiroPay",syi="By entering your Customer information (such as name, sort code and account number) you (the Customer) agree that this information is given voluntarily.",ayi="Klarna",lyi="EPS",cyi="BECS Direct Debit",uyi="BACS Direct Debit",dyi="BACS Direct Debit",hyi="Please add a payment method first, before trying to pay.",fyi='By providing your bank account details, you agree to this <a class="underline" href="https://stripe.com/au-becs-dd-service-agreement/legal">Direct Debit Request and the Direct Debit Request service agreement</a>, and authorise Stripe Payments Australia Pty Ltd ACN 160 180 343 Direct Debit User ID number 507156 (“Stripe”) to debit your account through the Bulk Electronic Clearing System (BECS) on behalf of :company (the “Merchant”) for any amounts separately communicated to you by the Merchant. You certify that you are either an account holder or an authorised signatory on the account listed above.',gyi="You need to accept the terms before proceeding.",pyi="Direct Debit",myi="Clone to Expense",_yi="Checkout",vyi="ACSS Debit",byi="Invalid amount. Number/Decimal values only.",yyi="Payment for Invoice :invoice for amount :amount failed.",Cyi="Google Pay, Apple Pay, Microsoft Pay",wyi=`We can't find any credit cards on your device. <a href="https://invoiceninja.github.io/docs/payments#apple-pay-google-pay-microsoft-pay" target="_blank" class="underline">Read more about this.</a>`,Syi="Payment mandate is not ready. Please try again later.",Eyi="Instant Bank Pay",xyi="iDEAL",kyi="Przelewy24",Tyi="GiroPay",Iyi="EPS",Lyi="Bancontact",Dyi="BECS",Ayi="ACSS",Ryi="Gross Line Total",Nyi="Slovak",Oyi="Normal",Pyi="Large",Myi="Extra Large",Fyi="Show PDF Preview",Byi="Display PDF preview while editing invoices",$yi="Print PDF",Vyi="Remind Me",Hyi="Instant Bank Pay",Wyi="Click Selected",zyi="Hide Preview",jyi="Edit Record",Uyi="The credit amount can not be more than the invoice amount",qyi="Please set an account password",Kyi="We recommend using the desktop app for the best performance",Gyi="We recommend using the mobile app for the best performance",Yyi="Successfully disconnected gateway",Qyi="Disconnect",Xyi="Add to Invoices",Zyi="Download",Jyi="Save data locally to enable the app to start faster, disabling may improve performance in large accounts",e0i="Persist UI",t0i="Save UI state locally to enable the app to start at the last location, disabling may improve performance",n0i="Client Postal Code",i0i="Client VAT Number",r0i="Has Tasks",o0i="Registration",s0i="Please authorize Stripe to accept online payments.",a0i="Update all records",l0i="Set Default Company",c0i="Successfully updated company",u0i="KBC",d0i="Help us improve by telling us why (optional)",h0i="Webhook Success",f0i="Tasks must all belong to the same client",g0i="Expenses must all belong to the same client",p0i="App",m0i="For the best performance download the :app app",_0i="Email Invoice",v0i="Email Quote",b0i="Email Credit",y0i="Successfully removed recurring expense",C0i="Search Recurring Expense",w0i="Search Recurring Expenses",S0i="Last Sent Date",E0i="Include Drafts",x0i="Include draft records in reports",k0i="Is Invoiced",T0i="Manage Plan",I0i="Persist Data",L0i="Customer Count",D0i="Verify Customers",A0i="Google Analytics Tracking ID",R0i="Decimal Comma",N0i="Use comma as decimal place in forms",O0i="Select Method",P0i="Select Platform",M0i="Please use the web app to connect to Gmail",F0i="Item tax rates are disabled",B0i="Enable Markdown",$0i="Convert markdown to HTML on the PDF",V0i="Add Second Contact",H0i="Previous Page",W0i="Next Page",z0i="Export Colors",j0i="Import Colors",U0i="Clear All",q0i="Contrast",K0i="Custom Colors",G0i="Colors",Y0i="Sidebar Active Background Color",Q0i="Sidebar Active Font Color",X0i="Sidebar Inactive Background Color",Z0i="Sidebar Inactive Font Color",J0i="Table Alternate Row Background Color",e1i="Invoice Header Background Color",t1i="Invoice Header Font Color",n1i="Review App",i1i="Check Status",r1i="Free Trial",o1i="All accounts receive a two week trial of the Pro plan, once the trial ends your account will automatically change to the free plan.",s1i="The Pro plan trial ends in :count days, click to upgrade.",a1i="Today is the last day of the Pro plan trial, click to upgrade.",l1i="Change Email",c1i="Optionally configure a separate client portal domain",u1i="Tasks Shown in Portal",d1i="Uninvoiced",h1i="The subdomain is used in the client portal to personalize links to match your brand. ie, https://your-brand.invoicing.co",f1i="Send Time",g1i="Import Settings",p1i="Please provide the JSON file",m1i="Please select to import the settings and/or data",_1i="JSON",v1i="No payment types enabled",b1i="Please wait for the data to finish loading",y1i="Net Total",C1i="Has Taxes",w1i="Import Customers",S1i="Successfully started importing customers",E1i="Successful Login",x1i="Failed Login",k1i="Once the file is ready you'll receive an email with a download link",T1i="Include Deleted Clients",I1i="Load records belonging to deleted clients",L1i="Step 1: Sign In",D1i="Step 2: Authorize",A1i="Account ID",R1i="The migration has not yet completed",N1i="Show Task End Date",O1i="Enable specifying the task end date",P1i="Gateway Setup",M1i="Preview Sidebar",F1i="Years Data Shown",B1i="Successfully ended all sessions",$1i="End All Sessions",V1i="1 Session",H1i=":count Sessions",W1i="Invoice Created",z1i="Quote Created",j1i="Credit Created",U1i="Enterprise",q1i="Invoice Item",K1i="Quote Item",G1i="Order",Y1i="Search Kanban",Q1i="Search Kanban",X1i="Move Top",Z1i="Move Up",J1i="Move Down",eCi="Move Bottom",tCi="Error: the custom email must include a :body variable",nCi="Make sure to include a :body variable",iCi="View Date Formats",rCi="Is Viewed",oCi="Letter",sCi="Legal",aCi="Page Layout",lCi="Portrait",cCi="Landscape",uCi="The account owner can upgrade to a paid plan to enable the advanced advanced settings",dCi="Upgrade to a paid plan to enable the advanced settings",hCi="Invoice Payment Terms",fCi="Quote Valid Until",gCi="No Headers",pCi="Add Header",mCi="Remove Header",_Ci="Return URL",vCi="REST Method",bCi="Header Key",yCi="Header Value",CCi="Recurring Products",wCi="Promo Discount",SCi="Allow Cancellation",ECi="Per Seat Enabled",xCi="Max Seats Limit",kCi="Trial Enabled",TCi="Trial Duration",ICi="Allow Query Overrides",LCi="Allow Plan Changes",DCi="Plan Map",ACi="Refund Period",RCi="Webhook Configuration",NCi="Purchase Page",OCi="Email Bounced",PCi="Spam Complaint",MCi="Email Delivery",FCi="Webhook Response",BCi="PDF Response",$Ci="Authentication Failure",VCi="PDF Failed",HCi="PDF Success",WCi="Modified",zCi="HTML Mode",jCi="Preview updates faster but is less accurate",UCi="Status Color Theme",qCi="Load Color Theme",KCi="Estonian",GCi="Successfully marked credit as paid",YCi="Successfully marked credits as paid",QCi="Data loading - please wait for it to complete",XCi="Data saving - please wait for it to complete",ZCi="Note: changes made here are only previewed, they must be applied in the tabs above to be saved",JCi="Remaining",ewi="Invoice Paid",twi=":user created recurring expense :recurring_expense",nwi=":user updated recurring expense :recurring_expense",iwi=":user archived recurring expense :recurring_expense",rwi=":user deleted recurring expense :recurring_expense",owi=":user restored recurring expense :recurring_expense",swi="FPX",awi="To view the :entity you need to set a password.",lwi="Unsubscribe",cwi="Unsubscribed",uwi="You have been removed from notifications for this document",dwi="Client Shipping State",hwi="Client Shipping City",fwi="Client Shipping Postal Code",gwi="Client Shipping Country",pwi="Load PDF",mwi="Start Free Trial",_wi="Start your FREE 14 day trial of the Pro Plan",vwi="Due on Receipt",bwi="Is Paid",ywi="Paid",Cwi="Id",wwi="Convert To",Swi="Client Currency",Ewi="Company Currency",xwi="To prevent spam we require upgrading to a paid account to customize the email",kwi="Upgrade your plan to add companies",Twi="The file has been saved in the downloads folder",Iwi="Small",Lwi="Your quotes are ready for download",Dwi="Your credits are ready for download",Awi="Your documents are ready for download",Rwi="Reminder for invoice :number for :balance",Nwi="Send with GMail invalid credentials",Owi="Your GMail credentials are not correct, please log into the administrator portal and navigate to Settings > User Details and disconnect and reconnect your GMail account. We will send you this notification daily until this issue is resolved",Pwi="Total Fields",Mwi="View Task",Fwi="Cancel",Bwi="Successfully changed task status",$wi="Change Status",Vwi="Enable Touch Events",Hwi="Support drag events to scroll",Wwi="After Saving",zwi="View Record",jwi="Enable Email Markdown",Uwi="Use visual markdown editor for emails",qwi="Enable PDF Markdown",Kwi="Note: JSON files generated by the v4 app are not supported",Gwi="Release Notes",Ywi="Upgrade your plan to view reports",Qwi="Successfully started :value tasks",Xwi="Successfully stopped :value tasks",Zwi="Successfully apporved quote",Jwi="Successfully :value approved quotes",eSi="Client Website",tSi="Invalid Time",nSi="Signed in as",iSi="Total results",rSi="Restore gateway",oSi="Archive gateway",sSi="Delete gateway",aSi="Exchange currency",lSi="Tax Amount 1",cSi="Tax Amount 2",uSi="Tax Amount 3",dSi="Update Project",hSi="Auto Archive Cancelled Invoice",fSi="Automatically archive invoices when cancelled",gSi="No invoices found",pSi="Successfully created record",mSi="Auto Archive Paid",_Si="Automatically archive invoices when they are paid.",vSi="Auto Archive Cancelled",bSi="Automatically archive invoices when cancelled.",ySi="Alternate PDF Viewer",CSi="Improve scrolling over the PDF preview [BETA]",wSi="Cayman Island Dollar",SSi="Please see attached file to check your report.",ESi="Left",xSi="Right",kSi="Center",TSi="Page Numbering",ISi="Page Numbering Alignment",LSi="Invoice Sent",DSi="Show Product Description",ASi="Include the description in the product dropdown",RSi="Invoice Items",NSi="Quote Items",OSi="Profit and Loss",PSi="Import Format",MSi="Export Format",FSi="Export Type",BSi="Stop On Unpaid",$Si="Stop creating recurring invoices if the last invoice is unpaid.",VSi="Use Quote Terms",HSi="When converting a quote to an invoice",WSi="Add Country",zSi="Enable Tooltips",jSi="Show tooltips when hovering the mouse",USi="Error: records belong to more than one client",qSi="Login to an existing account",KSi="Purchase Order",GSi="Purchase Order Number",YSi="Purchase Order #",QSi="Inventory threshold notification for product: :product",XSi="Threshold of :amount has been reached for product: :product",ZSi=":user created purchase order :purchase_order",JSi=":user updated purchase order :purchase_order",eEi=":user archived purchase order :purchase_order",tEi=":user deleted purchase order :purchase_order",nEi=":user restored purchase order :purchase_order",iEi=":user emailed purchase order :purchase_order",rEi=":contact viewed purchase order :purchase_order",oEi="New Purchase Order :number from :account",sEi="To view your purchase order for :amount, click the link below.",aEi="View Purchase Order",lEi="Your purchase orders are ready for download",cEi="Purchase Order :invoice was viewed by :client",uEi="The following vendor :client viewed Purchase Order :invoice for :amount.",dEi="Purchase Order Date",hEi="Purchase Orders",fEi="Purchase Order # :purchase_order",gEi="Accepted",pEi=":contact accepted purchase order :purchase_order",mEi="Vendor Information",_Ei="Purchase Order :purchase_order was accepted by :vendor",vEi="The following vendor :vendor accepted Purchase Order :purchase_order for :amount.",bEi="Amount received",yEi="Already converted to an expense.",CEi="Convert to Expense",wEi="Add to Inventory",SEi="Successfully added purchase order to inventory",EEi="Successfully added purchase orders to inventory",xEi="Client Document Upload",kEi="Vendor Document Upload",TEi="Enable vendors to upload documents",IEi="Are you enjoying the app?",LEi="Yes, it's great!",DEi="Not so much",AEi="Great to hear! Would you like to rate it?",REi="Sorry to hear it! Would you like to tell us more?",NEi="Sure, happy to",OEi="No, not now",PEi="Add",MEi="Last Sent Template",FEi="Enable Flexible Search",BEi='Match non-contiguous characters, ie. "ct" matches "cat"',$Ei="Vendor Details",VEi="Purchase Order Details",HEi="QR IBAN",WEi="BESR ID",zEi="Clone to PO",jEi="Vendor does not have an email address set",UEi="Send Email",qEi="Successfully marked purchase order as sent",KEi="Successfully marked purchase orders as sent",GEi="Successfully accepted purchase order",YEi="Successfully accepted purchase orders",QEi="Successfully cancelled purchase order",XEi="Successfully cancelled purchase orders",ZEi="Please select a vendor",JEi="Purchase Order Total",exi="Email Purchase Order",txi="Email Purchase Order",nxi="Successfully disconnected email",ixi="Connect Email",rxi="Disconnect Email",oxi="Please use the web app to connect to Microsoft",sxi="Email Provider",axi="Connect Microsoft",lxi="Disconnect Microsoft",cxi="Successfully connected Microsoft",uxi="Successfully disconnected Microsoft",dxi="Login with Microsoft",hxi="Sign up with Microsoft",fxi="Successfully queued purchase order to be sent",gxi="Successfully queued purchase orders to be sent",pxi="Change to the React web app",mxi="Purchase Order Design",_xi="Purchase Order Terms",vxi="Purchase Order Footer",bxi="Purchase Order Signature",yxi="Require vendor to provide their signature.",Cxi="New Purchase Order",wxi="Edit Purchase Order",Sxi="Successfully created purchase order",Exi="Successfully updated purchase order",xxi="Successfully archived purchase order",kxi="Successfully deleted purchase order",Txi="Successfully removed purchase order",Ixi="Successfully restored purchase order",Lxi="Search Purchase Order",Dxi="Search Purchase Orders",Axi="Login URL",Rxi="Manual Overpayments",Nxi="Support adding an overpayment amount manually on a payment",Oxi="Stock Quantity",Pxi="Notification Threshold",Mxi="Track Inventory",Fxi="Display a product stock field and update when invoices are sent",Bxi="Stock Notifications",$xi="Send an email when the stock reaches the threshold",Vxi="VAT",Hxi="View Map",Wxi="Set Default Design",zxi="Purchase Order issued to",jxi="Archive Task Status",Uxi="Delete Task Status",qxi="Restore Task Status",Kxi="Hebrew",Gxi="Price change accepted",Yxi="Price change failed with code",Qxi="Restore Purchases",Xxi="Activate",Zxi="Connect Apple",Jxi="Disconnect Apple",eki="Successfully disconnected Apple",tki="Send Now",nki="Received",iki="Successfully converted to expense",rki="Successfully converted to expenses",oki="This document has been removed, please contact the vendor for further information",ski="Document no longer available",aki="Field",lki="Period",cki="Fields Per Row",uki="Active Invoices",dki="Outstanding Invoices",hki="Completed Payments",fki="Refunded Payments",gki="Active Quotes",pki="Approved Quotes",mki="Unapproved Quotes",_ki="Logged Tasks",vki="Invoiced Tasks",bki="Paid Tasks",yki="Logged Expenses",Cki="Pending Expenses",wki="Invoiced Expenses",Ski="Invoice Paid Expenses",Eki="Vendor Portal",xki="Send Code",kki="Save the record to upload documents",Tki="Expense Tax Rates",Iki="Invoice Item Tax Rates",Lki="Successfully verified phone number",Dki="A code has been sent via SMS",Aki="Resend",Rki="Verify",Nki="Please provide a phone number",Oki="Invalid phone number",Pki="Verify Phone Number",Mki="Please verify your phone number to send emails",Fki="Successfully merged clients",Bki="Merge Into",$ki="Note: v5.5 requires PHP 8.1",Vki="Email Purchase Orders",Hki="Email Invoices",Wki="Email Quotes",zki="Email Credits",jki="Archive Purchase Order",Uki="Restore Purchase Order",qki="Delete Purchase Order",Kki="Connect",Gki="Mark Paid Payment Email",Yki="Convert to Project",Qki="Client Email",Xki="Invoice Task Project",Zki="Add the project to the invoice line items",Jki="Bulk Action",eTi="This mobile (cell) phone number is not valid, please enter in E.164 format",tTi="Transaction",nTi="Disable 2FA",iTi="Change Number",rTi="Resend Code",oTi="Base Type",sTi="Category Type",aTi="Transaction",lTi="Print PDF",cTi="Vendor Postal Code",uTi="Preview Location",dTi="Bottom",hTi="Side",fTi="PDF Preview",gTi="Long Press to Select",pTi="Purchase Order Item",mTi="Would you like to rate the app?",_Ti="Include Deleted",vTi="Include deleted records in reports",bTi="Due On",yTi="Use Browser PDF Viewer",CTi="Warning: Prevents interacting with app over the PDF",wTi="Successfully converted transactions",STi="Default Category",ETi="Connect Accounts",xTi="Manage Rules",kTi="Search 1 Category",TTi="Search :count Categories",ITi="Min Amount",LTi="Max Amount",DTi="Successfully converted transaction",ATi="Convert to Payment",RTi="Deposit",NTi="Withdrawal",OTi="Deposits",PTi="Withdrawals",MTi="Matched",FTi="Unmatched",BTi="Create Credit",$Ti="Transactions",VTi="New Transaction",HTi="Edit Transaction",WTi="Successfully created transaction",zTi="Successfully updated transaction",jTi="Successfully archived transaction",UTi="Successfully deleted transaction",qTi="Successfully removed transaction",KTi="Successfully restored transaction",GTi="Search Transaction",YTi="Search :count Transactions",QTi="Successfully deleted bank account",XTi="Successfully removed bank account",ZTi="Successfully restored bank account",JTi="Search Bank Account",eIi="Search :count Bank Accounts",tIi="A code has been sent via SMS to :number",nIi="Please verify your phone number for 2FA backup",iIi="Enable Applying Payments Later",rIi="Line Item Tax Rates",oIi="Show Tasks in Client Portal",sIi="Quote :invoice has expired for :client",aIi="The following Quote :invoice for client :client and :amount has now expired.",lIi="Auto Sync",cIi="Refresh Accounts",uIi="Upgrade to Enterprise to connect your bank account",dIi="Click here to connect your bank account",hIi="Include tax",fIi="E-mail template body can be changed on",gIi="Insufficient permissions, or task may be locked",pIi="Accrual accounting",mIi="Turn on for accrual reporting, turn off for cash basis reporting.",_Ii="Expensed reporting",vIi="Turn on for reporting all expenses, turn off for reporting only paid expenses",bIi="Send an email when an online payment is made",yIi="Send an email when manually entering a payment",CIi="Send an email when marking an invoice as paid",wIi="Successfully linked transaction",SIi="Link Payment",EIi="Link Expense",xIi="Lock Invoiced Tasks",kIi="Prevent tasks from being edited once invoiced",TIi="Require clients to register",IIi="Use Inventory Management",LIi="Require products to be in stock",DIi="Optional Products",AIi="Optional Recurring Products",RIi="Convert",NIi="Successfully queued invoice to be auto-billed",OIi="Successfully queued invoices to be auto-billed",PIi="Operator",MIi="Value",FIi="Is",BIi="Contains",$Ii="Starts with",VIi="Is empty",HIi="Add Rule",WIi="Match All Rules",zIi="All criteria needs to match for the rule to be applied",jIi="Automatically convert matched transactions to expenses",UIi="Rules",qIi="Transaction Rule",KIi="Transaction Rules",GIi="New Transaction Rule",YIi="Edit Transaction Rule",QIi="Successfully created rule",XIi="Successfully updated transaction rule",ZIi="Successfully archived transaction rule",JIi="Successfully deleted transaction rule",eLi="Successfully removed transaction rule",tLi="Successfully restored transaction rule",nLi="Search Transaction Rule",iLi="Search Transaction Rules",rLi="Delete Bank Account",oLi="Archive Transaction",sLi="Delete Transaction",aLi="We have sent a code to :email enter this code to proceed.",lLi="Your one time passcode code",cLi="Your one time passcode is :code",uLi="Delete Tax Rate",dLi="Restore Tax Rate",hLi="Select company backup file",fLi="Please upload the .zip file used to create this backup.",gLi="Backup | Restore",pLi="Create company backup",mLi="Backup",_Li="The following purchase_order :purchase_order was created for vendor :vendor for :amount.",vLi="Purchase Order :purchase_order was created for :vendor",bLi="Purchase Order :purchase_order was sent to :vendor",yLi="The following vendor :vendor was emailed Purchase Order :purchase_order for :amount.",CLi="This product is a restricted item, please contact the vendor for further information.",wLi="Product not available.",SLi="Purchase Order Created",ELi="Purchase Order Sent",xLi="Purchase Order Viewed",kLi="Purchase Order Accepted",TLi="The credit amount can not be greater than the payment amount",ILi="Set an exchange rate when entering a manual payment",LLi="Set an exchange rate when creating an expense",DLi="Matomo URL",ALi="Matomo Id",RLi="Add To Invoice",NLi="Danger Zone",OLi="Import completed",PLi="Your statement from :start_date to :end_date is attached.",MLi="Email queued",FLi="Clone to Recurring Invoice",BLi="Inventory Threshold",$Li="Successfully queued statement to be sent",VLi="Show Email Footer",HLi="Invoice Task Hours",WLi="Add the hours to the invoice line items",zLi="Auto Bill Standard Invoices",jLi="Auto Bill Recurring Invoices",ULi="Email Alignment",qLi="PDF Preview Location",KLi="Mailgun",GLi="Brevo",YLi="Postmark",QLi="Microsoft",XLi="Click + to create a record",ZLi="Last 365 Days",JLi="Import Design",eDi="Successfully imported design",tDi="The design is invalid, the :value section is missing",nDi="Would you like to upload your logo?",iDi="Installed Version",rDi="Notify Vendor When Paid",oDi="Send an email to the vendor when the expense is marked as paid",sDi="Update Payment",aDi="Markup",lDi="Unlock Pro",cDi="Upgrade to a paid plan to create schedules",uDi="Next Run",dDi="All Clients",hDi="Show Aging Table",fDi="Show Payments Table",gDi="Only Clients with Invoices",pDi="Email Statement",mDi="Once",_Di="Schedules",vDi="New Schedule",bDi="Edit Schedule",yDi="Successfully created schedule",CDi="Successfully updated schedule",wDi="Successfully archived schedule",SDi="Successfully deleted schedule",EDi="Successfully removed schedule",xDi="Successfully restored schedule",kDi="Search Schedule",TDi="Search Schedules",IDi="Update Product",LDi="Create Purchase Order",DDi="Update Purchase Order",ADi="Sent Invoice",RDi="Sent Quote",NDi="Sent Credit",ODi="Sent Purchase Order",PDi="Image URL",MDi="Max Quantity",FDi="Test URL",BDi="Option is not shown",$Di="Option is shown but not selected",VDi="Option is shown and selected",HDi="Option is not shown",WDi="View All",zDi="Edit All",jDi="Accept Purchase Order Number",UDi="Enable clients to provide a PO number when approving a quote",qDi="From Email",KDi="Show Preview",GDi="Show Paid Stamp",YDi="Show Shipping Address",QDi="There are no documents in the selected records to download",XDi="Pixels",ZDi="Logo Size",JDi="Failed",e2i="Client Contacts",t2i="Sync From",n2i="Invoices: :invoices for :amount for client :client",i2i="Payment with no invoice for amount :amount for client :client",r2i="Click here to see all variables.",o2i="Ship to",s2i="Please transfer into the nominated bank account above.",a2i="Branch Name",l2i="Branch Code",c2i="Bank Name",u2i="Bank Code",d2i="BIC",h2i="Upgrade or downgrade your current plan.",f2i="Add Logo",g2i="Add Stripe",p2i="Invalid Coupon",m2i="No billable tasks for this project",_2i="Insufficient permissions to perform this action",v2i="Please verify your account to send emails.",b2i="Thank you for purchasing a white label license. <br><br> Your license key is: <br><br> :license_key <br><br> You can manage your license here: https://invoiceninja.invoicing.co/client/login",y2i="Klarna",C2i="Payable within :payeddue days net until :paydate",w2i="No buyer's reference given",S2i="The invoice needs to be paid online via the provided link",E2i="Pre Payment",x2i="Number of payments",k2i="The number of times this payment will be made",T2i="Continue until cancelled",I2i="Payment :payment was emailed to :client",L2i="Payment :payment was emailed",D2i="Record not found",A2i="Minimum Payment Amount",R2i="Client Initiated Payments",N2i="Support making a payment in the client portal without an invoice",O2i="Share Invoice/Quote Columns",P2i="CC Email",M2i="Payment Balance",F2i="Allow user to access the reports, data is limited to available permissions",B2i="Payment :payment was emailed to :client",$2i="One-Time Products",V2i="Optional One-Time Products",H2i="Required",W2i="Hidden",z2i="Payment Links",j2i="Payment Link",U2i="New Payment Link",q2i="Edit Payment Link",K2i="Successfully created payment link",G2i="Successfully updated payment link",Y2i="Successfully archived payment link",Q2i="Successfully deleted payment link",X2i="Successfully removed payment link",Z2i="Successfully restored payment link",J2i="Search 1 Payment Link",eAi="Search :count Payment Links",tAi="Increase Prices",nAi="Update Prices",iAi="Successfully queued prices to be increased",rAi="Successfully queued prices to be updated",oAi="API Token",sAi="API Key",aAi="Endpoint",lAi="Not Billable",cAi="Allow Billable Task Items",uAi="Enable configuring which task items are billed",dAi="Show Task Item Description",hAi="Enable specifying task item descriptions",fAi="Email Record",gAi="Invoice Product Columns",pAi="Quote Product Columns",mAi="Vendors",_Ai="Product Sales",vAi="User sales report for client/s :client from :start_date to :end_date",bAi="Customer balance report",yAi="Customer sales report",CAi="User sales report",wAi="Aged Receivable Detailed Report",SAi="Aged Receivable Summary Report",EAi="Taxable Amount",xAi="Tax Summary",kAi="OAuth / Mail",TAi="Preferences",IAi="Analytics",LAi="Reduced Rate",DAi="Tax All",AAi="Tax Selected",RAi="version",NAi="Seller Subregion",OAi="Calculate Taxes",PAi="Automatically calculate taxes when saving invoices",MAi="Link Expenses",FAi="Converted Client Balance",BAi="Converted Payment Balance",$Ai="Total Hours",VAi="Use +days to set the date in the future",HAi="More information ",WAi="here",zAi="Show Credits Table",jAi="Payment Manual",UAi="Tax Summary Report",qAi="Tax Category",KAi="Physical Goods",GAi="Digital Products",YAi="Services",QAi="Shipping",XAi="Tax Exempt",ZAi="Late fee for invoice :invoice added on :date",JAi="Khmer",eRi="Routing ID",tRi="Enable E-Invoice",nRi="E-Invoice Type",iRi="Reduced Tax",rRi="Override Tax",oRi="Zero Rated",sRi="Reverse Tax",aRi="Successfully updated the tax category",lRi="Successfully updated the tax categories",cRi="Set Tax Category",uRi="Payment Manual",dRi="Expense Payment Type",hRi="Rename",fRi="Successfully renamed document",gRi="E-Invoice",pRi="Light/Dark Mode",mRi="Activities",_Ri="Here are your company's most recent transactions:",vRi="Palestine",bRi="Taiwan",yRi="Duties",CRi="Order Number",wRi="Order",SRi="Total Invoices Outstanding",ERi="Recent Activity",xRi="Enable auto billing",kRi="Email :count invoices",TRi="Invoice Task Item Description",IRi="Add the item description to the invoice line items",LRi="Next Send Time",DRi="Successfully uploaded certificate",ARi="Certificate set",RRi="Certificate not set",NRi="Passphrase set",ORi="Passphrase not set",PRi="Upload Certificate",MRi="Certificate Passphrase",FRi="Valid VAT Number",BRi="React Notification Links",$Ri="Admin emails will contain links to the react application",VRi="Show Task Billable",HRi="Credit Item",WRi="Drop file here",zRi="Files",jRi="Camera",URi="Gallery",qRi="Project Location",KRi="Add a payment gateway (ie. Stripe, WePay or PayPal) to accept online payments",GRi="Hungarian",YRi="Use your phone subscription settings to manage your plan",QRi="Item Tax3",XRi="Item Tax Rate 1",ZRi="Item Tax Rate 2",JRi="Item Tax Rate 3",eNi="Buy Price",tNi="Macedonia",nNi="Admin Initiated Payments",iNi="Support entering a payment in the admin portal without an invoice",rNi="Paid Date",oNi="An email will be sent with the PDFs",sNi="Swazi Lilangeni",aNi="Income",lNi="Enter a value here if the total amount received was MORE than the invoice amount, or when recording a payment with no invoices. Otherwise this field should be left blank.",cNi="Vendor Phone",uNi="Mercado Pago",dNi="MyBank",hNi="Pay in 4",fNi="District",gNi="Region",pNi="County",mNi="Tax Details",_Ni=":contact made payment :payment for invoice :invoice for :client",vNi=":user entered payment :payment for invoice :invoice for :client",bNi="Default Payment Type",yNi="Number precision",CNi="Controls the number of decimals supported in the interface",wNi="Tax Exempt",SNi="Drop files here",ENi="Upload Files",xNi="Download E-Invoice",kNi="Download E-Credit",TNi="Download E-Quote",INi="Intra-community triangular transaction",LNi="Tax-free intra-community delivery",DNi="Please note that this supply is subject to reverse charge",ANi="Nicaraguan Córdoba",RNi="Image",NNi="Other",ONi="Linked To",PNi="The file has been saved in :path",MNi="Successfully unlinked :count transactions",FNi="Successfully unlinked transaction",BNi="Allow user to access the dashboard, data is limited to available permissions",$Ni="Successfully marked credits sent",VNi="Show Document Preview",HNi="Cash accounting",WNi="Click or drop files here",zNi="Set public",jNi="Set private",UNi="Individual",qNi="Business",KNi="Partnership",GNi="Trust",YNi="Charity",QNi="Government",XNi="Stock quantity",ZNi="Vendor Contact",JNi="Unpaid",eOi="Paid",tOi="Note: this feature requires a Zip-Tax API key to lookup US sales tax by address",nOi="Cache Data",iOi="Unknown",rOi="Webhook Failure",oOi="Email Opened",sOi="Email Delivered",aOi="Log",lOi="Classification",cOi="Stock :quantity",uOi="Upcoming",dOi="Client Contact",hOi="Uncategorized",fOi="Login Notification",gOi="Sends an email notifying that a login has taken place.",pOi="Payment Refund Receipt # :number",mOi="Payment Receipt # :number",_Oi="The template will be applied to following:",vOi="Run Template",bOi="Statement Design",yOi="Delivery Note Design",COi="Payment Receipt Design",wOi="Payment Refund Design",SOi="Add the Chrome extension to manage your tasks",EOi="Watch Video",xOi="View Extension",kOi="Reactivate Email",TOi="Successfully reactivated email",IOi="Enable using the design as a template",LOi="Quarter",DOi="Item Description",AOi="Task Item",ROi="Record State",NOi="Save files to this folder",OOi="Downloads Folder",POi="Invoiced Quotes",MOi="Invoice Paid Quotes",FOi="The downloads folder does not exist :value",BOi="User Logged in Notification",$Oi="Send an email when logging in from a new location",VOi="Payment Email To All Contacts",HOi="Sends the payment email to all contacts when enabled",WOi="Add Line",zOi="Expense :expense notification sent to :contact",jOi="Confirmation of payment :amount sent to :vendor",UOi="Payment processed for :amount dated :payment_date. <br>[Transaction Reference: :transaction_reference]",qOi="Receipt",KOi="Charges",GOi="Email Report",YOi="Payment Type Credit",QOi="Payment Type Debit",XOi="Send Emails To",ZOi="Primary Contact",JOi="All Contacts",ePi="Insert Below",tPi="Bank account authentication. Selecting your institution to complete the request with your account credentials.",nPi="An error has occurred",iPi="An unknown error has occurred! Reason:",rPi="Invalid Token",oPi="The provided token was invalid. Contact support for help, if this issue persists.",sPi="Missing Credentials",aPi="Invalid or missing credentials for Gocardless Bank Account Data. Contact support for help, if this issue persists.",lPi="Not Available",cPi="Feature unavailable, Enterprise Plan only.",uPi="Invalid Institution",dPi="The provided institution-id is invalid or no longer valid.",hPi="Invalid Reference",fPi="GoCardless did not provide a valid reference. Please run flow again and contact support, if this issue persists.",gPi="Invalid Requisition",pPi="GoCardless did not provide a valid reference. Please run flow again and contact support, if this issue persists.",mPi="Not Ready",_Pi="You called this site too early. Please finish authorization and refresh this page. Contact support for help, if this issue persists.",vPi="No Accounts selected",bPi="The service has not returned any valid accounts. Consider restarting the flow.",yPi="Restart flow.",CPi="Return to application.",wPi="Lao",SPi="Lao kip",EPi="Regions: USA, UK, Australia & India",xPi="Regions: Europe & UK",kPi="Select Provider",TPi="Requisition expired, please reauthenticate.",IPi="Access to bank account feeds has expired as set in End User Agreement. <br><br>Please log into Invoice Ninja and re-authenticate with your banks to continue receiving transactions.",LPi="Participant",DPi="Participant name",APi="Client unsubscribed from emails.",RPi="Client :client has unsubscribed from your e-mails. The client needs to consent to receive future emails from you.",NPi="Resubscribe",OPi="Subscribe",PPi="You are currently subscribed and will continue to receive email communications.",MPi="You are currently not subscribed, and therefore, will not receive emails at this time.",FPi="We were unable to deliver Purchase Order :invoice to :contact. <br><br> :error",BPi="Unable to deliver Purchase Order :invoice",$Pi="Display HTML version of entity when viewing on mobile",VPi="For improved visualization, displays a HTML version of the invoice/quote when viewing on mobile.",HPi="Please select an invoice or credit",WPi="Mobile Version",zPi="Venmo",jPi="MyBank",UPi="Pay Later",qPi="Local Domain",KPi="Verify Peer",GPi="Note: connecting an account requires a GoCardless/Nordigen API key",YPi="Accounts Receivable Detailed",QPi="Accounts Receivable Summary",XPi="Client Sales",ZPi="User Sales",JPi="iFrame URL",eMi="User unsubscribed from emails :link",tMi="Out of stock",nMi=`Component ":step" requires at least one of it's dependencies (":dependencies") in the list.`,iMi='Component ":step" depends on ":dependency". Make component(s) order is correct.',rMi="You must include at least one of authentication methods.",oMi="Cart",sMi="Methods",aMi="Required fields form",lMi="Add step",cMi="Steps",uMi="The order of the steps is important. The first step should not depend on any other step. The second step should depend on the first step, and so on.",dMi="Other steps",hMi="Use Available Payments",fMi="Successfully sent email",gMi="Gateway Type",pMi="Would you like to save this import mapping as a template for future use?",mMi="Save Template Mapping",_Mi="Checkout is enabled only for existing customers. Please login with existing account to checkout.",vMi="Checkout is enabled only for new customers. Please register a new account to checkout.",bMi="Auto bill standard invoices on the due date",yMi="Auto bill on send date OR due date (recurring invoices)",CMi="Apply any credit balances to payments prior to charging a payment method",wMi="Use unapplied payments",SMi="Apply any payment balances prior to charging a payment method",EMi="The number of days after the invoice date that payment is due",xMi="The default payment type to be used for payments",kMi="The number of days that the quote is valid for",TMi="The default expense payment type to be used",IMi="Pay in 4",LMi="Payment Provider",DMi="Set your email as the sending user",AMi="Purchase Order Items",RMi="No data found in this CSV file",NMi="Accept Payments Online",OMi="View all payment gateways",PMi="Product cost",MMi="Duration in words",FMi="Upcoming Recurring Invoices",BMi="Shipping Country",$Mi="Show table footer",VMi="Displays the totals in the footer of the table",HMi="Total Invoices",WMi="Add to group",zMi="Check Credentials",jMi="Credentials are valid",UMi="E-Quote",qMi="E-Credit",KMi="E-Purchase Order",GMi="E-Quote Type",YMi="Please upgrade to unlock unlimited clients!",QMi="Download E-Purchase Order",XMi="We recommend using the new web app or the desktop app for the best performance",ZMi="Rappen Rounding",JMi="Round amount to 5 cents",e4i="Assign group",t4i="Advanced Card Payments",n4i="EHLO domain (optional)",i4i="ie. 25,587,465",r4i="ie. smtp.gmail.com",o4i="Always show required fields form",s4i="Displays the required fields form always at checkout",a4i="Advanced Cards",l4i="Statement sent to :client",c4i="Invoice Net Amount",u4i="Round To Minutes",d4i="Task Rounding Direction",h4i="Round task times up or down.",f4i="Direction",g4i="Round Up",p4i="Round Down",m4i="Round To Nearest",_4i="The interval to round the task to.",v4i="Successfully updated data",b4i="Bulk Update",y4i="Calculate",C4i="Sum",w4i="Money",S4i="Web App",E4i="Desktop App",x4i="Disconnected",k4i="Reconnect",T4i="E-Invoice Settings",I4i="Refund of your invoice via BTCPay",L4i="A refund intended for you has been issued. To claim it via BTCPay, please click on this link:",D4i="Mauritanian Ouguiya",A4i="Bhutan Ngultrum",R4i="End Of Month",N4i="Merge E-Invoice and PDF",O4i="New task assignment [Task :task] [ :date ]",P4i="You have been assigned task :task <br><br> Description: :description <br><br> Client: :client",M4i="User :user entered note: :notes",F4i="Reminder: Quote :quote from :company",B4i="Reminder for quote :number for :amount",$4i="First Quote Reminder",V4i="Before the valid until date",H4i="After the valid until date",W4i="After the quote date",z4i="Remind Quote",j4i="Tax currency is different from invoice currency",U4i="The invoice has already been imported on :date",q4i="Before the valid until",K4i="After the valid until",G4i="Task Assigned Notification",Y4i="Send an email when a task is assigned",Q4i="Invoices are locked at the end of the month",X4i="Referral URL",Z4i="Add Comment",J4i="Successfully saved comment",e3i="Tickets",t3i="Successfully assigned group",n3i="Merge to PDF",i3i="Note: the latest version requires PHP :version",r3i="Automatically expand products table notes",o3i="Automatically expands the notes section within the products table to display more lines.",s3i="Institution Number",a3i="Transit Number",l3i="Personal",c3i="Address Information",u3i="Enter the Information for the Bank Account",d3i="Account Holder Information",h3i="Enter Information for the Account Holder",f3i="Customer Type",g3i="Process Date",p3i="Forever Free",m3i={organization:Adn,name:Rdn,website:Ndn,work_phone:Odn,address:Pdn,address1:Mdn,address2:Fdn,city:Bdn,state:$dn,postal_code:Vdn,country_id:Hdn,contacts:Wdn,first_name:zdn,last_name:jdn,phone:Udn,email:qdn,additional_info:Kdn,payment_terms:Gdn,currency_id:Ydn,size_id:Qdn,industry_id:Xdn,private_notes:Zdn,invoice:Jdn,client:ehn,invoice_date:thn,due_date:nhn,invoice_number:ihn,invoice_number_short:rhn,po_number:ohn,po_number_short:shn,frequency_id:ahn,discount:lhn,taxes:chn,tax:uhn,item:dhn,description:hhn,unit_cost:fhn,quantity:ghn,line_total:phn,subtotal:mhn,net_subtotal:_hn,paid_to_date:vhn,balance_due:bhn,invoice_design_id:yhn,terms:Chn,your_invoice:whn,remove_contact:Shn,add_contact:Ehn,create_new_client:xhn,edit_client_details:khn,enable:Thn,learn_more:Ihn,manage_rates:Lhn,note_to_client:Dhn,invoice_terms:Ahn,save_as_default_terms:Rhn,download_pdf:Nhn,pay_now:Ohn,save_invoice:Phn,clone_invoice:Mhn,archive_invoice:Fhn,delete_invoice:Bhn,email_invoice:$hn,enter_payment:Vhn,tax_rates:Hhn,rate:Whn,settings:zhn,enable_invoice_tax:jhn,enable_line_item_tax:Uhn,dashboard:qhn,dashboard_totals_in_all_currencies_help:Khn,clients:Ghn,invoices:Yhn,payments:Qhn,credits:Xhn,history:Zhn,search:Jhn,sign_up:efn,guest:tfn,company_details:nfn,online_payments:ifn,notifications:rfn,import_export:ofn,done:sfn,save:afn,create:lfn,upload:cfn,import:"Import",download:ufn,cancel:dfn,close:hfn,provide_email:ffn,powered_by:gfn,no_items:pfn,recurring_invoices:mfn,recurring_help:_fn,recurring_quotes:vfn,in_total_revenue:bfn,billed_client:yfn,billed_clients:Cfn,active_client:wfn,active_clients:Sfn,invoices_past_due:Efn,upcoming_invoices:xfn,average_invoice:kfn,archive:Tfn,delete:"Delete",archive_client:Ifn,delete_client:Lfn,archive_payment:Dfn,delete_payment:Afn,archive_credit:Rfn,delete_credit:Nfn,show_archived_deleted:Ofn,filter:Pfn,new_client:Mfn,new_invoice:Ffn,new_payment:Bfn,new_credit:$fn,contact:Vfn,date_created:Hfn,last_login:Wfn,balance:zfn,action:jfn,status:Ufn,invoice_total:qfn,frequency:Kfn,range:Gfn,start_date:Yfn,end_date:Qfn,transaction_reference:Xfn,method:Zfn,payment_amount:Jfn,payment_date:egn,credit_amount:tgn,credit_balance:ngn,credit_date:ign,empty_table:rgn,select:ogn,edit_client:sgn,edit_invoice:agn,create_invoice:lgn,enter_credit:cgn,last_logged_in:ugn,details:dgn,standing:hgn,credit:fgn,activity:ggn,date:pgn,message:mgn,adjustment:_gn,are_you_sure:vgn,payment_type_id:bgn,amount:ygn,work_email:Cgn,language_id:wgn,timezone_id:Sgn,date_format_id:Egn,datetime_format_id:xgn,users:kgn,localization:Tgn,remove_logo:Ign,logo_help:Lgn,payment_gateway:Dgn,gateway_id:Agn,email_notifications:Rgn,email_viewed:Ngn,email_paid:Ogn,site_updates:Pgn,custom_messages:Mgn,default_email_footer:Fgn,select_file:Bgn,first_row_headers:$gn,column:Vgn,sample:Hgn,import_to:Wgn,client_will_create:zgn,clients_will_create:jgn,email_settings:Ugn,client_view_styling:qgn,pdf_email_attachment:Kgn,custom_css:Ggn,import_clients:Ygn,csv_file:Qgn,export_clients:Xgn,created_client:Zgn,created_clients:Jgn,updated_settings:epn,removed_logo:tpn,sent_message:npn,invoice_error:ipn,limit_clients:rpn,payment_error:opn,registration_required:spn,confirmation_required:apn,updated_client:lpn,archived_client:cpn,archived_clients:upn,deleted_client:dpn,deleted_clients:hpn,updated_invoice:fpn,created_invoice:gpn,cloned_invoice:ppn,emailed_invoice:mpn,and_created_client:_pn,archived_invoice:vpn,archived_invoices:bpn,deleted_invoice:ypn,deleted_invoices:Cpn,created_payment:wpn,created_payments:Spn,archived_payment:Epn,archived_payments:xpn,deleted_payment:kpn,deleted_payments:Tpn,applied_payment:Ipn,created_credit:Lpn,archived_credit:Dpn,archived_credits:Apn,deleted_credit:Rpn,deleted_credits:Npn,imported_file:Opn,updated_vendor:Ppn,created_vendor:Mpn,archived_vendor:Fpn,archived_vendors:Bpn,deleted_vendor:$pn,deleted_vendors:Vpn,confirmation_subject:Hpn,confirmation_header:Wpn,confirmation_message:zpn,invoice_subject:jpn,invoice_message:Upn,payment_subject:qpn,payment_message:Kpn,email_salutation:Gpn,email_signature:Ypn,email_from:Qpn,invoice_link_message:Xpn,notification_invoice_paid_subject:Zpn,notification_invoice_sent_subject:Jpn,notification_invoice_viewed_subject:emn,notification_invoice_paid:tmn,notification_invoice_sent:nmn,notification_invoice_viewed:imn,stripe_payment_text:rmn,stripe_payment_text_without_invoice:omn,reset_password:smn,secure_payment:amn,card_number:lmn,expiration_month:cmn,expiration_year:umn,cvv:dmn,logout:hmn,sign_up_to_save:fmn,agree_to_terms:gmn,terms_of_service:pmn,email_taken:mmn,working:_mn,success:vmn,success_message:bmn,erase_data:ymn,password:Cmn,pro_plan_product:wmn,unsaved_changes:Smn,custom_fields:Emn,company_fields:xmn,client_fields:kmn,field_label:Tmn,field_value:Imn,edit:Lmn,set_name:Dmn,view_as_recipient:Amn,product_library:Rmn,product:Nmn,products:Omn,fill_products:Pmn,fill_products_help:Mmn,update_products:Fmn,update_products_help:Bmn,create_product:$mn,edit_product:Vmn,archive_product:Hmn,updated_product:Wmn,created_product:zmn,archived_product:jmn,pro_plan_custom_fields:Umn,advanced_settings:qmn,pro_plan_advanced_settings:Kmn,invoice_design:Gmn,specify_colors:Ymn,specify_colors_label:Qmn,chart_builder:Xmn,ninja_email_footer:Zmn,go_pro:Jmn,quote:e_n,quotes:t_n,quote_number:n_n,quote_number_short:i_n,quote_date:r_n,quote_total:o_n,your_quote:s_n,total:a_n,clone:l_n,new_quote:c_n,create_quote:u_n,edit_quote:d_n,archive_quote:h_n,delete_quote:f_n,save_quote:g_n,email_quote:p_n,clone_quote:m_n,convert_to_invoice:__n,view_invoice:v_n,view_client:b_n,view_quote:y_n,updated_quote:C_n,created_quote:w_n,cloned_quote:S_n,emailed_quote:E_n,archived_quote:x_n,archived_quotes:k_n,deleted_quote:T_n,deleted_quotes:I_n,converted_to_invoice:L_n,quote_subject:D_n,quote_message:A_n,quote_link_message:R_n,notification_quote_sent_subject:N_n,notification_quote_viewed_subject:O_n,notification_quote_sent:P_n,notification_quote_viewed:M_n,session_expired:F_n,invoice_fields:B_n,invoice_options:$_n,hide_paid_to_date:V_n,hide_paid_to_date_help:H_n,charge_taxes:W_n,user_management:z_n,add_user:j_n,send_invite:U_n,sent_invite:q_n,updated_user:K_n,invitation_message:G_n,register_to_add_user:Y_n,user_state:Q_n,edit_user:X_n,delete_user:Z_n,active:J_n,pending:evn,deleted_user:tvn,confirm_email_invoice:nvn,confirm_email_quote:ivn,confirm_recurring_email_invoice:rvn,confirm_recurring_email_invoice_not_sent:ovn,cancel_account:svn,cancel_account_message:avn,go_back:lvn,data_visualizations:cvn,sample_data:uvn,hide:dvn,new_version_available:hvn,invoice_settings:fvn,invoice_number_prefix:gvn,invoice_number_counter:pvn,quote_number_prefix:mvn,quote_number_counter:_vn,share_invoice_counter:vvn,invoice_issued_to:bvn,invalid_counter:yvn,mark_sent:Cvn,more_designs:wvn,more_designs_title:Svn,more_designs_cloud_header:Evn,more_designs_cloud_text:xvn,more_designs_self_host_text:kvn,buy:Tvn,bought_designs:Ivn,sent:Lvn,vat_number:Dvn,payment_title:Avn,payment_cvv:Rvn,payment_footer1:Nvn,payment_footer2:Ovn,id_number:Pvn,white_label_link:Mvn,white_label_header:Fvn,bought_white_label:Bvn,white_labeled:$vn,restore:Vvn,restore_invoice:Hvn,restore_quote:Wvn,restore_client:zvn,restore_credit:jvn,restore_payment:Uvn,restored_invoice:qvn,restored_quote:Kvn,restored_client:Gvn,restored_payment:Yvn,restored_credit:Qvn,reason_for_canceling:Xvn,discount_percent:Zvn,discount_amount:Jvn,invoice_history:ebn,quote_history:tbn,current_version:nbn,select_version:ibn,view_history:rbn,edit_payment:obn,updated_payment:sbn,deleted:abn,restore_user:lbn,restored_user:cbn,show_deleted_users:ubn,email_templates:dbn,invoice_email:hbn,payment_email:fbn,quote_email:gbn,reset_all:pbn,approve:mbn,token_billing_type_id:_bn,token_billing_1:vbn,token_billing_2:bbn,token_billing_3:ybn,token_billing_4:Cbn,token_billing_checkbox:wbn,view_in_gateway:Sbn,use_card_on_file:Ebn,edit_payment_details:xbn,token_billing:kbn,token_billing_secure:Tbn,support:Ibn,contact_information:Lbn,"256_encryption":"256-Bit Encryption",amount_due:Dbn,billing_address:Abn,billing_method:Rbn,order_overview:Nbn,match_address:Obn,click_once:Pbn,invoice_footer:Mbn,save_as_default_footer:Fbn,token_management:Bbn,tokens:$bn,add_token:Vbn,show_deleted_tokens:Hbn,deleted_token:Wbn,created_token:zbn,updated_token:jbn,edit_token:Ubn,delete_token:qbn,token:Kbn,add_gateway:Gbn,delete_gateway:Ybn,edit_gateway:Qbn,updated_gateway:Xbn,created_gateway:Zbn,deleted_gateway:Jbn,pay_with_paypal:eyn,pay_with_card:tyn,change_password:nyn,current_password:iyn,new_password:ryn,confirm_password:oyn,password_error_incorrect:syn,password_error_invalid:ayn,updated_password:lyn,api_tokens:cyn,users_and_tokens:uyn,account_login:dyn,recover_password:hyn,forgot_password:fyn,email_address:gyn,lets_go:pyn,password_recovery:myn,send_email:_yn,set_password:vyn,converted:byn,email_approved:yyn,notification_quote_approved_subject:Cyn,notification_quote_approved:wyn,resend_confirmation:Syn,confirmation_resent:Eyn,payment_type_credit_card:xyn,payment_type_paypal:kyn,payment_type_bitcoin:Tyn,payment_type_gocardless:Iyn,knowledge_base:Lyn,partial:Dyn,partial_remaining:Ayn,more_fields:Ryn,less_fields:Nyn,client_name:Oyn,pdf_settings:Pyn,product_settings:Myn,auto_wrap:Fyn,duplicate_post:Byn,view_documentation:$yn,app_title:Vyn,app_description:Hyn,rows:Wyn,www:zyn,logo:jyn,subdomain:Uyn,provide_name_or_email:qyn,charts_and_reports:Kyn,chart:Gyn,report:Yyn,group_by:Qyn,paid:Xyn,enable_report:Zyn,enable_chart:Jyn,totals:e0n,run:t0n,export:"Export",documentation:n0n,zapier:i0n,recurring:r0n,last_invoice_sent:o0n,processed_updates:s0n,tasks:a0n,new_task:l0n,start_time:c0n,created_task:u0n,updated_task:d0n,edit_task:h0n,clone_task:f0n,archive_task:g0n,restore_task:p0n,delete_task:m0n,stop_task:_0n,time:v0n,start:b0n,stop:y0n,now:C0n,timer:w0n,manual:S0n,date_and_time:E0n,second:x0n,seconds:k0n,minute:T0n,minutes:I0n,hour:L0n,hours:D0n,task_details:A0n,duration:R0n,time_log:N0n,end_time:O0n,end:P0n,invoiced:M0n,logged:F0n,running:B0n,task_error_multiple_clients:$0n,task_error_running:V0n,task_error_invoiced:H0n,restored_task:W0n,archived_task:z0n,archived_tasks:j0n,deleted_task:U0n,deleted_tasks:q0n,create_task:K0n,stopped_task:G0n,invoice_task:Y0n,invoice_labels:Q0n,prefix:X0n,counter:Z0n,payment_type_dwolla:J0n,partial_value:e1n,more_actions:t1n,pro_plan_title:n1n,pro_plan_call_to_action:i1n,pro_plan_feature1:r1n,pro_plan_feature2:o1n,pro_plan_feature3:s1n,pro_plan_feature4:a1n,pro_plan_feature5:l1n,pro_plan_feature6:c1n,pro_plan_feature7:u1n,pro_plan_feature8:d1n,resume:h1n,break_duration:f1n,edit_details:g1n,work:p1n,timezone_unset:m1n,click_here:_1n,email_receipt:v1n,created_payment_emailed_client:b1n,add_company:y1n,untitled:C1n,new_company:w1n,associated_accounts:S1n,unlinked_account:E1n,login:x1n,or:k1n,email_error:T1n,confirm_recurring_timing:I1n,confirm_recurring_timing_not_sent:L1n,unlink_account:D1n,unlink:A1n,show_address:R1n,show_address_help:N1n,update_address:O1n,update_address_help:P1n,times:M1n,set_now:F1n,dark_mode:B1n,dark_mode_help:$1n,add_to_invoice:V1n,create_new_invoice:H1n,task_errors:W1n,from:z1n,to:j1n,font_size:U1n,primary_color:q1n,secondary_color:K1n,customize_design:G1n,content:Y1n,styles:Q1n,defaults:X1n,margins:Z1n,header:J1n,footer:eCn,custom:tCn,invoice_to:nCn,invoice_no:iCn,quote_no:rCn,recent_payments:oCn,outstanding:sCn,manage_companies:aCn,total_revenue:lCn,current_user:cCn,new_recurring_invoice:uCn,recurring_invoice:dCn,new_recurring_quote:hCn,recurring_quote:fCn,created_by_invoice:gCn,primary_user:pCn,help:mCn,playground:_Cn,support_forum:vCn,invoice_due_date:bCn,quote_due_date:yCn,valid_until:CCn,reset_terms:wCn,reset_footer:SCn,invoice_sent:ECn,invoices_sent:xCn,status_draft:kCn,status_sent:TCn,status_viewed:ICn,status_partial:LCn,status_paid:DCn,status_unpaid:ACn,status_all:RCn,show_line_item_tax:NCn,auto_bill:OCn,military_time:PCn,last_sent:MCn,reminder_emails:FCn,quote_reminder_emails:BCn,templates_and_reminders:$Cn,subject:VCn,body:HCn,first_reminder:WCn,second_reminder:zCn,third_reminder:jCn,num_days_reminder:UCn,reminder_subject:qCn,reset:KCn,invoice_not_found:GCn,referral_program:YCn,referral_code:QCn,last_sent_on:XCn,page_expire:ZCn,upcoming_quotes:JCn,expired_quotes:ewn,sign_up_using:twn,invalid_credentials:nwn,show_all_options:iwn,user_details:rwn,oneclick_login:own,disable:swn,invoice_quote_number:awn,invoice_charges:lwn,notification_invoice_bounced:cwn,notification_invoice_bounced_subject:uwn,notification_quote_bounced:dwn,notification_quote_bounced_subject:hwn,custom_invoice_link:fwn,total_invoiced:gwn,open_balance:pwn,verify_email:mwn,basic_settings:_wn,pro:vwn,gateways:bwn,next_send_on:ywn,no_longer_running:Cwn,general_settings:wwn,customize:Swn,oneclick_login_help:Ewn,referral_code_help:xwn,enable_with_stripe:kwn,tax_settings:Twn,create_tax_rate:Iwn,updated_tax_rate:Lwn,created_tax_rate:Dwn,edit_tax_rate:Awn,archive_tax_rate:Rwn,archived_tax_rate:Nwn,default_tax_rate_id:Own,tax_rate:Pwn,recurring_hour:Mwn,pattern:Fwn,pattern_help_title:Bwn,pattern_help_1:$wn,pattern_help_2:Vwn,pattern_help_3:Hwn,see_options:Wwn,invoice_counter:zwn,quote_counter:jwn,type:Uwn,activity_1:qwn,activity_2:Kwn,activity_3:Gwn,activity_4:Ywn,activity_5:Qwn,activity_6:Xwn,activity_7:Zwn,activity_8:Jwn,activity_9:eSn,activity_10:tSn,activity_11:nSn,activity_12:iSn,activity_13:rSn,activity_14:oSn,activity_15:sSn,activity_16:aSn,activity_17:lSn,activity_18:cSn,activity_19:uSn,activity_20:dSn,activity_21:hSn,activity_22:fSn,activity_23:gSn,activity_24:pSn,activity_25:mSn,activity_26:_Sn,activity_27:vSn,activity_28:bSn,activity_29:ySn,activity_30:CSn,activity_31:wSn,activity_32:SSn,activity_33:ESn,activity_34:xSn,activity_35:kSn,activity_36:TSn,activity_37:ISn,activity_42:LSn,activity_43:DSn,activity_44:ASn,activity_45:RSn,activity_46:NSn,activity_47:OSn,activity_48:PSn,activity_49:MSn,activity_50:FSn,activity_51:BSn,activity_52:$Sn,activity_53:VSn,activity_54:HSn,activity_55:WSn,activity_56:zSn,payment:jSn,system:USn,signature:qSn,default_messages:KSn,quote_terms:GSn,default_quote_terms:YSn,default_invoice_terms:QSn,default_invoice_footer:XSn,quote_footer:ZSn,free:JSn,quote_is_approved:eEn,apply_credit:tEn,system_settings:nEn,archive_token:iEn,archived_token:rEn,archive_user:oEn,archived_user:sEn,archive_account_gateway:aEn,archived_account_gateway:lEn,archive_recurring_invoice:cEn,archived_recurring_invoice:uEn,delete_recurring_invoice:dEn,deleted_recurring_invoice:hEn,restore_recurring_invoice:fEn,restored_recurring_invoice:gEn,archive_recurring_quote:pEn,archived_recurring_quote:mEn,delete_recurring_quote:_En,deleted_recurring_quote:vEn,restore_recurring_quote:bEn,restored_recurring_quote:yEn,archived:CEn,untitled_account:wEn,before:SEn,after:EEn,reset_terms_help:xEn,reset_footer_help:kEn,export_data:TEn,user:IEn,country:LEn,include:DEn,logo_too_large:AEn,import_freshbooks:REn,import_data:NEn,source:OEn,csv:PEn,client_file:MEn,invoice_file:FEn,task_file:BEn,no_mapper:$En,invalid_csv_header:VEn,client_portal:HEn,admin:WEn,disabled:zEn,show_archived_users:jEn,notes:UEn,invoice_will_create:qEn,invoices_will_create:KEn,failed_to_import:GEn,publishable_key:YEn,secret_key:QEn,missing_publishable_key:XEn,email_design:ZEn,due_by:JEn,enable_email_markup:exn,enable_email_markup_help:txn,template_help_title:nxn,template_help_1:ixn,email_design_id:rxn,email_design_help:oxn,plain:sxn,light:axn,dark:lxn,industry_help:cxn,subdomain_help:uxn,website_help:dxn,invoice_number_help:hxn,quote_number_help:fxn,custom_client_fields_helps:gxn,custom_account_fields_helps:pxn,custom_invoice_fields_helps:mxn,custom_invoice_charges_helps:_xn,token_expired:vxn,invoice_link:bxn,button_confirmation_message:yxn,confirm:Cxn,email_preferences:wxn,created_invoices:Sxn,next_invoice_number:Exn,next_quote_number:xxn,days_before:kxn,days_after:Txn,field_due_date:Ixn,field_invoice_date:Lxn,schedule:Dxn,email_designs:Axn,assigned_when_sent:Rxn,white_label_purchase_link:Nxn,expense:Oxn,expenses:Pxn,new_expense:Mxn,new_vendor:Fxn,payment_terms_net:Bxn,vendor:$xn,edit_vendor:Vxn,archive_vendor:Hxn,delete_vendor:Wxn,view_vendor:zxn,deleted_expense:jxn,archived_expense:Uxn,deleted_expenses:qxn,archived_expenses:Kxn,expense_amount:Gxn,expense_balance:Yxn,expense_date:Qxn,expense_should_be_invoiced:Xxn,public_notes:Zxn,invoice_amount:Jxn,exchange_rate:ekn,yes:tkn,no:nkn,should_be_invoiced:ikn,view_expense:rkn,edit_expense:okn,archive_expense:skn,delete_expense:akn,view_expense_num:lkn,updated_expense:ckn,created_expense:ukn,enter_expense:dkn,view:hkn,restore_expense:fkn,invoice_expense:gkn,expense_error_multiple_clients:pkn,expense_error_invoiced:mkn,convert_currency:_kn,num_days:vkn,create_payment_term:bkn,edit_payment_terms:ykn,edit_payment_term:Ckn,archive_payment_term:wkn,recurring_due_dates:Skn,recurring_due_date_help:Ekn,due:xkn,next_due_on:kkn,use_client_terms:Tkn,day_of_month:Ikn,last_day_of_month:Lkn,day_of_week_after:Dkn,sunday:Akn,monday:Rkn,tuesday:Nkn,wednesday:Okn,thursday:Pkn,friday:Mkn,saturday:Fkn,header_font_id:Bkn,body_font_id:$kn,color_font_help:Vkn,live_preview:Hkn,invalid_mail_config:Wkn,invoice_message_button:zkn,quote_message_button:jkn,payment_message_button:Ukn,payment_type_direct_debit:qkn,bank_accounts:Kkn,add_bank_account:Gkn,setup_account:Ykn,import_expenses:Qkn,bank_id:Xkn,integration_type:Zkn,updated_bank_account:Jkn,edit_bank_account:eTn,archive_bank_account:tTn,archived_bank_account:nTn,created_bank_account:iTn,validate_bank_account:rTn,bank_password_help:oTn,bank_password_warning:sTn,username:aTn,account_number:lTn,account_name:cTn,bank_account_error:uTn,status_approved:dTn,quote_settings:hTn,auto_convert_quote:fTn,auto_convert_quote_help:gTn,validate:pTn,info:mTn,imported_expenses:_Tn,iframe_url_help3:vTn,expense_error_multiple_currencies:bTn,expense_error_mismatch_currencies:yTn,trello_roadmap:CTn,header_footer:wTn,first_page:STn,all_pages:ETn,last_page:xTn,all_pages_header:kTn,all_pages_footer:TTn,invoice_currency:ITn,enable_https:LTn,quote_issued_to:DTn,show_currency_code:ATn,free_year_message:RTn,trial_message:NTn,trial_footer:OTn,trial_footer_last_day:PTn,trial_call_to_action:MTn,trial_success:FTn,overdue:BTn,white_label_text:$Tn,user_email_footer:VTn,reset_password_footer:HTn,limit_users:WTn,more_designs_self_host_header:zTn,old_browser:jTn,newer_browser:UTn,white_label_custom_css:qTn,pro_plan_remove_logo:KTn,pro_plan_remove_logo_link:GTn,invitation_status_sent:YTn,invitation_status_opened:QTn,invitation_status_viewed:XTn,email_error_inactive_client:ZTn,email_error_inactive_contact:JTn,email_error_inactive_invoice:eIn,email_error_inactive_proposal:tIn,email_error_user_unregistered:nIn,email_error_user_unconfirmed:iIn,email_error_invalid_contact_email:rIn,navigation:oIn,list_invoices:sIn,list_clients:aIn,list_quotes:lIn,list_tasks:cIn,list_expenses:uIn,list_recurring_invoices:dIn,list_payments:hIn,list_credits:fIn,tax_name:gIn,report_settings:pIn,new_user:mIn,new_product:_In,new_tax_rate:vIn,invoiced_amount:bIn,invoice_item_fields:yIn,custom_invoice_item_fields_help:CIn,recurring_invoice_number:wIn,recurring_invoice_number_prefix_help:SIn,enable_portal_password:EIn,enable_portal_password_help:xIn,send_portal_password:kIn,send_portal_password_help:TIn,expired:IIn,invalid_card_number:LIn,invalid_expiry:DIn,invalid_cvv:AIn,cost:RIn,create_invoice_for_sample:NIn,owner:OIn,administrator:PIn,administrator_help:MIn,user_create_all:FIn,user_view_all:BIn,user_edit_all:$In,partial_due:VIn,restore_vendor:HIn,restored_vendor:WIn,restored_expense:zIn,permissions:jIn,create_all_help:UIn,view_all_help:qIn,edit_all_help:KIn,view_payment:GIn,january:YIn,february:QIn,march:XIn,april:ZIn,may:JIn,june:eLn,july:tLn,august:nLn,september:iLn,october:rLn,november:oLn,december:sLn,documents_header:aLn,email_documents_header:lLn,email_documents_example_1:cLn,email_documents_example_2:uLn,quote_documents:dLn,invoice_documents:hLn,expense_documents:fLn,invoice_embed_documents:gLn,invoice_embed_documents_help:pLn,document_email_attachment:mLn,ubl_email_attachment:_Ln,download_documents:vLn,documents_from_expenses:bLn,dropzone_default_message:yLn,dropzone_default_message_disabled:CLn,dropzone_fallback_message:wLn,dropzone_fallback_text:SLn,dropzone_file_too_big:ELn,dropzone_invalid_file_type:xLn,dropzone_response_error:kLn,dropzone_cancel_upload:TLn,dropzone_cancel_upload_confirmation:ILn,dropzone_remove_file:LLn,documents:DLn,document_date:ALn,document_size:RLn,enable_client_portal:NLn,enable_client_portal_help:OLn,enable_client_portal_dashboard:PLn,enable_client_portal_dashboard_help:MLn,account_management:FLn,plan_status:BLn,plan_upgrade:$Ln,plan_change:VLn,pending_change_to:HLn,plan_changes_to:WLn,plan_term_changes_to:zLn,cancel_plan_change:jLn,plan:ULn,expires:qLn,renews:KLn,plan_expired:GLn,trial_expired:YLn,never:QLn,plan_free:XLn,plan_pro:ZLn,plan_enterprise:JLn,plan_white_label:eDn,plan_free_self_hosted:tDn,plan_trial:nDn,plan_term:iDn,plan_term_monthly:rDn,plan_term_yearly:oDn,plan_term_month:sDn,plan_term_year:aDn,plan_price_monthly:lDn,plan_price_yearly:cDn,updated_plan:uDn,plan_paid:dDn,plan_started:hDn,plan_expires:fDn,white_label_button:gDn,pro_plan_year_description:pDn,pro_plan_month_description:mDn,enterprise_plan_product:_Dn,enterprise_plan_year_description:vDn,enterprise_plan_month_description:bDn,plan_credit_product:yDn,plan_credit_description:CDn,plan_pending_monthly:wDn,plan_refunded:SDn,page_size:EDn,live_preview_disabled:xDn,invoice_number_padding:kDn,preview:TDn,list_vendors:IDn,add_users_not_supported:LDn,enterprise_plan_features:DDn,return_to_app:ADn,refund_payment:RDn,refund_max:NDn,refund:ODn,are_you_sure_refund:PDn,status_pending:MDn,status_completed:FDn,status_failed:BDn,status_partially_refunded:$Dn,status_partially_refunded_amount:VDn,status_refunded:HDn,status_voided:WDn,refunded_payment:zDn,activity_39:jDn,activity_40:UDn,card_expiration:qDn,card_creditcardother:KDn,card_americanexpress:GDn,card_carteblanche:YDn,card_unionpay:QDn,card_diners:XDn,card_discover:ZDn,card_jcb:JDn,card_laser:e2n,card_maestro:t2n,card_mastercard:n2n,card_solo:i2n,card_switch:r2n,card_visacard:o2n,card_ach:s2n,payment_type_stripe:a2n,ach:l2n,enable_ach:c2n,stripe_ach_help:u2n,ach_disabled:d2n,plaid:h2n,client_id:f2n,secret:g2n,public_key:p2n,plaid_optional:m2n,plaid_environment_help:_2n,other_providers:v2n,country_not_supported:b2n,invalid_routing_number:y2n,invalid_account_number:C2n,account_number_mismatch:w2n,missing_account_holder_type:S2n,missing_account_holder_name:E2n,routing_number:x2n,confirm_account_number:k2n,individual_account:T2n,company_account:I2n,account_holder_name:L2n,add_account:D2n,payment_methods:A2n,complete_verification:R2n,verification_amount1:N2n,verification_amount2:O2n,payment_method_verified:P2n,verification_failed:M2n,remove_payment_method:F2n,confirm_remove_payment_method:B2n,remove:$2n,payment_method_removed:V2n,bank_account_verification_help:H2n,bank_account_verification_next_steps:W2n,unknown_bank:z2n,ach_verification_delay_help:j2n,add_credit_card:U2n,payment_method_added:q2n,use_for_auto_bill:K2n,used_for_auto_bill:G2n,payment_method_set_as_default:Y2n,activity_41:Q2n,webhook_url:X2n,stripe_webhook_help:Z2n,stripe_webhook_help_link_text:J2n,gocardless_webhook_help_link_text:eAn,payment_method_error:tAn,notification_invoice_payment_failed_subject:nAn,notification_invoice_payment_failed:iAn,link_with_plaid:rAn,link_manually:oAn,secured_by_plaid:sAn,plaid_linked_status:aAn,add_payment_method:lAn,account_holder_type:cAn,ach_authorization:uAn,ach_authorization_required:dAn,off:hAn,opt_in:fAn,opt_out:gAn,always:pAn,opted_out:mAn,opted_in:_An,manage_auto_bill:vAn,enabled:bAn,paypal:yAn,braintree_enable_paypal:CAn,braintree_paypal_disabled_help:wAn,braintree_paypal_help:SAn,braintree_paypal_help_link_text:EAn,token_billing_braintree_paypal:xAn,add_paypal_account:kAn,no_payment_method_specified:TAn,chart_type:IAn,format:LAn,import_ofx:DAn,ofx_file:AAn,ofx_parse_failed:RAn,wepay:NAn,sign_up_with_wepay:OAn,use_another_provider:PAn,company_name:MAn,wepay_company_name_help:FAn,wepay_description_help:BAn,wepay_tos_agree:$An,wepay_tos_link_text:VAn,resend_confirmation_email:HAn,manage_account:WAn,action_required:zAn,finish_setup:jAn,created_wepay_confirmation_required:UAn,switch_to_wepay:qAn,switch:"Switch",restore_account_gateway:KAn,restored_account_gateway:GAn,united_states:YAn,canada:QAn,accept_debit_cards:XAn,debit_cards:ZAn,warn_start_date_changed:JAn,warn_start_date_changed_not_sent:eRn,original_start_date:tRn,new_start_date:nRn,security:iRn,see_whats_new:rRn,wait_for_upload:oRn,upgrade_for_permissions:sRn,enable_second_tax_rate:aRn,payment_file:lRn,expense_file:cRn,product_file:uRn,import_products:dRn,products_will_create:hRn,product_key:fRn,created_products:gRn,export_help:pRn,selfhost_export_help:mRn,JSON_file:_Rn,view_dashboard:vRn,client_session_expired:bRn,client_session_expired_message:yRn,auto_bill_notification:CRn,auto_bill_payment_method_bank_transfer:wRn,auto_bill_payment_method_credit_card:SRn,auto_bill_payment_method_paypal:ERn,auto_bill_notification_placeholder:xRn,payment_settings:kRn,on_send_date:TRn,on_due_date:IRn,auto_bill_ach_date_help:LRn,warn_change_auto_bill:DRn,bank_account:ARn,payment_processed_through_wepay:RRn,privacy_policy:NRn,ach_email_prompt:ORn,verification_pending:PRn,update_font_cache:MRn,more_options:FRn,credit_card:BRn,bank_transfer:$Rn,no_transaction_reference:VRn,use_bank_on_file:HRn,auto_bill_email_message:WRn,bitcoin:zRn,gocardless:jRn,added_on:URn,failed_remove_payment_method:qRn,gateway_exists:KRn,manual_entry:GRn,start_of_week:YRn,freq_inactive:QRn,freq_daily:XRn,freq_weekly:ZRn,freq_biweekly:JRn,freq_two_weeks:eNn,freq_four_weeks:tNn,freq_monthly:nNn,freq_three_months:iNn,freq_four_months:rNn,freq_six_months:oNn,freq_annually:sNn,freq_two_years:aNn,"payment_type_Apply Credit":"Apply Credit","payment_type_Bank Transfer":"Bank Transfer",payment_type_Cash:lNn,payment_type_Debit:cNn,payment_type_ACH:uNn,"payment_type_Visa Card":"Visa Card",payment_type_MasterCard:dNn,"payment_type_American Express":"American Express","payment_type_Discover Card":"Discover Card","payment_type_Diners Card":"Diners Card",payment_type_EuroCard:hNn,payment_type_Nova:fNn,"payment_type_Credit Card Other":"Credit Card Other",payment_type_PayPal:gNn,"payment_type_Google Wallet":"Google Wallet",payment_type_Check:pNn,"payment_type_Carte Blanche":"Carte Blanche",payment_type_UnionPay:mNn,payment_type_JCB:_Nn,payment_type_Laser:vNn,payment_type_Maestro:bNn,payment_type_Solo:yNn,payment_type_Switch:CNn,payment_type_iZettle:wNn,payment_type_Swish:SNn,payment_type_Alipay:ENn,payment_type_Sofort:xNn,payment_type_SEPA:kNn,payment_type_Bitcoin:TNn,payment_type_GoCardless:INn,payment_type_Zelle:LNn,country_Afghanistan:DNn,country_Albania:ANn,country_Antarctica:RNn,country_Algeria:NNn,"country_American Samoa":"American Samoa",country_Andorra:ONn,country_Angola:PNn,"country_Antigua and Barbuda":"Antigua and Barbuda",country_Azerbaijan:MNn,country_Argentina:FNn,country_Australia:BNn,country_Austria:$Nn,country_Bahamas:VNn,country_Bahrain:HNn,country_Bangladesh:WNn,country_Armenia:zNn,country_Barbados:jNn,country_Belgium:UNn,country_Bermuda:qNn,country_Bhutan:KNn,"country_Bolivia, Plurinational State of":"Bolivia, Plurinational State of","country_Bosnia and Herzegovina":"Bosnia and Herzegovina",country_Botswana:GNn,"country_Bouvet Island":"Bouvet Island",country_Brazil:YNn,country_Belize:QNn,"country_British Indian Ocean Territory":"British Indian Ocean Territory","country_Solomon Islands":"Solomon Islands","country_Virgin Islands, British":"Virgin Islands, British","country_Brunei Darussalam":"Brunei Darussalam",country_Bulgaria:XNn,country_Myanmar:ZNn,country_Burundi:JNn,country_Belarus:eOn,country_Cambodia:tOn,country_Cameroon:nOn,country_Canada:iOn,"country_Cape Verde":"Cape Verde","country_Cayman Islands":"Cayman Islands","country_Central African Republic":"Central African Republic","country_Sri Lanka":"Sri Lanka",country_Chad:rOn,country_Chile:oOn,country_China:sOn,"country_Taiwan, Province of China":"Taiwan, Province of China","country_Christmas Island":"Christmas Island","country_Cocos (Keeling) Islands":"Cocos (Keeling) Islands",country_Colombia:aOn,country_Comoros:lOn,country_Mayotte:cOn,country_Congo:uOn,"country_Congo, the Democratic Republic of the":"Congo, the Democratic Republic of the","country_Cook Islands":"Cook Islands","country_Costa Rica":"Costa Rica",country_Croatia:dOn,country_Cuba:hOn,country_Cyprus:fOn,"country_Czech Republic":"Czech Republic",country_Benin:gOn,country_Denmark:pOn,country_Dominica:mOn,"country_Dominican Republic":"Dominican Republic",country_Ecuador:_On,"country_El Salvador":"El Salvador","country_Equatorial Guinea":"Equatorial Guinea",country_Ethiopia:vOn,country_Eritrea:bOn,country_Estonia:yOn,"country_Faroe Islands":"Faroe Islands","country_Falkland Islands (Malvinas)":"Falkland Islands (Malvinas)","country_South Georgia and the South Sandwich Islands":"South Georgia and the South Sandwich Islands",country_Fiji:COn,country_Finland:wOn,"country_Åland Islands":"Åland Islands",country_France:SOn,"country_French Guiana":"French Guiana","country_French Polynesia":"French Polynesia","country_French Southern Territories":"French Southern Territories",country_Djibouti:EOn,country_Gabon:xOn,country_Georgia:kOn,country_Gambia:TOn,"country_Palestinian Territory, Occupied":"Palestinian Territory, Occupied",country_Germany:IOn,country_Ghana:LOn,country_Gibraltar:DOn,country_Kiribati:AOn,country_Greece:ROn,country_Greenland:NOn,country_Grenada:OOn,country_Guadeloupe:POn,country_Guam:MOn,country_Guatemala:FOn,country_Guinea:BOn,country_Guyana:$On,country_Haiti:VOn,"country_Heard Island and McDonald Islands":"Heard Island and McDonald Islands","country_Holy See (Vatican City State)":"Holy See (Vatican City State)",country_Honduras:HOn,"country_Hong Kong":"Hong Kong",country_Hungary:WOn,country_Iceland:zOn,country_India:jOn,country_Indonesia:UOn,"country_Iran, Islamic Republic of":"Iran, Islamic Republic of",country_Iraq:qOn,country_Ireland:KOn,country_Israel:GOn,country_Italy:YOn,"country_Côte d'Ivoire":"Côte d'Ivoire",country_Jamaica:QOn,country_Japan:XOn,country_Kazakhstan:ZOn,country_Jordan:JOn,country_Kenya:ePn,"country_Korea, Democratic People's Republic of":"Korea, Democratic People's Republic of","country_Korea, Republic of":"Korea, Republic of",country_Kuwait:tPn,country_Kyrgyzstan:nPn,"country_Lao People's Democratic Republic":"Lao People's Democratic Republic",country_Lebanon:iPn,country_Lesotho:rPn,country_Latvia:oPn,country_Liberia:sPn,country_Libya:aPn,country_Liechtenstein:lPn,country_Lithuania:cPn,country_Luxembourg:uPn,country_Macao:dPn,country_Madagascar:hPn,country_Malawi:fPn,country_Malaysia:gPn,country_Maldives:pPn,country_Mali:mPn,country_Malta:_Pn,country_Martinique:vPn,country_Mauritania:bPn,country_Mauritius:yPn,country_Mexico:CPn,country_Monaco:wPn,country_Mongolia:SPn,"country_Moldova, Republic of":"Moldova, Republic of",country_Montenegro:EPn,country_Montserrat:xPn,country_Morocco:kPn,country_Mozambique:TPn,country_Oman:IPn,country_Namibia:LPn,country_Nauru:DPn,country_Nepal:APn,country_Netherlands:RPn,country_Curaçao:"Curaçao",country_Aruba:NPn,"country_Sint Maarten (Dutch part)":"Sint Maarten (Dutch part)","country_Bonaire, Sint Eustatius and Saba":"Bonaire, Sint Eustatius and Saba","country_New Caledonia":"New Caledonia",country_Vanuatu:OPn,"country_New Zealand":"New Zealand",country_Nicaragua:PPn,country_Niger:MPn,country_Nigeria:FPn,country_Niue:BPn,"country_Norfolk Island":"Norfolk Island",country_Norway:$Pn,"country_Northern Mariana Islands":"Northern Mariana Islands","country_United States Minor Outlying Islands":"United States Minor Outlying Islands","country_Micronesia, Federated States of":"Micronesia, Federated States of","country_Marshall Islands":"Marshall Islands",country_Palau:VPn,country_Pakistan:HPn,country_Panama:WPn,"country_Papua New Guinea":"Papua New Guinea",country_Paraguay:zPn,country_Peru:jPn,country_Philippines:UPn,country_Pitcairn:qPn,country_Poland:KPn,country_Portugal:GPn,"country_Guinea-Bissau":"Guinea-Bissau","country_Timor-Leste":"Timor-Leste","country_Puerto Rico":"Puerto Rico",country_Qatar:YPn,country_Réunion:"Réunion",country_Romania:QPn,"country_Russian Federation":"Russian Federation",country_Rwanda:XPn,"country_Saint Barthélemy":"Saint Barthélemy","country_Saint Helena, Ascension and Tristan da Cunha":"Saint Helena, Ascension and Tristan da Cunha","country_Saint Kitts and Nevis":"Saint Kitts and Nevis",country_Anguilla:ZPn,"country_Saint Lucia":"Saint Lucia","country_Saint Martin (French part)":"Saint Martin (French part)","country_Saint Pierre and Miquelon":"Saint Pierre and Miquelon","country_Saint Vincent and the Grenadines":"Saint Vincent and the Grenadines","country_San Marino":"San Marino","country_Sao Tome and Principe":"Sao Tome and Principe","country_Saudi Arabia":"Saudi Arabia",country_Senegal:JPn,country_Serbia:eMn,country_Seychelles:tMn,"country_Sierra Leone":"Sierra Leone",country_Singapore:nMn,country_Slovakia:iMn,"country_Viet Nam":"Viet Nam",country_Slovenia:rMn,country_Somalia:oMn,"country_South Africa":"South Africa",country_Zimbabwe:sMn,country_Spain:aMn,"country_South Sudan":"South Sudan",country_Sudan:lMn,"country_Western Sahara":"Western Sahara",country_Suriname:cMn,"country_Svalbard and Jan Mayen":"Svalbard and Jan Mayen",country_Swaziland:uMn,country_Sweden:dMn,country_Switzerland:hMn,"country_Syrian Arab Republic":"Syrian Arab Republic",country_Tajikistan:fMn,country_Thailand:gMn,country_Togo:pMn,country_Tokelau:mMn,country_Tonga:_Mn,"country_Trinidad and Tobago":"Trinidad and Tobago","country_United Arab Emirates":"United Arab Emirates",country_Tunisia:vMn,country_Turkey:bMn,country_Turkmenistan:yMn,"country_Turks and Caicos Islands":"Turks and Caicos Islands",country_Tuvalu:CMn,country_Uganda:wMn,country_Ukraine:SMn,"country_Macedonia, the former Yugoslav Republic of":"Macedonia, the former Yugoslav Republic of",country_Egypt:EMn,"country_United Kingdom":"United Kingdom",country_Guernsey:xMn,country_Jersey:kMn,"country_Isle of Man":"Isle of Man","country_Tanzania, United Republic of":"Tanzania, United Republic of","country_United States":"United States","country_Virgin Islands, U.S.":"Virgin Islands, U.S.","country_Burkina Faso":"Burkina Faso",country_Uruguay:TMn,country_Uzbekistan:IMn,"country_Venezuela, Bolivarian Republic of":"Venezuela, Bolivarian Republic of","country_Wallis and Futuna":"Wallis and Futuna",country_Samoa:LMn,country_Yemen:DMn,country_Zambia:AMn,"lang_Brazilian Portuguese":"Brazilian Portuguese",lang_Croatian:RMn,lang_Czech:NMn,lang_Danish:OMn,lang_Dutch:PMn,lang_English:MMn,"lang_English - United States":"English",lang_French:FMn,"lang_French - Canada":"French - Canada",lang_German:BMn,lang_Italian:$Mn,lang_Japanese:VMn,lang_Lithuanian:HMn,lang_Norwegian:WMn,lang_Polish:zMn,lang_Spanish:jMn,"lang_Spanish - Spain":"Spanish - Spain",lang_Swedish:UMn,lang_Albanian:qMn,lang_Greek:KMn,"lang_English - United Kingdom":"English - United Kingdom","lang_English - Australia":"English - Australia",lang_Slovenian:GMn,lang_Finnish:YMn,lang_Romanian:QMn,"lang_Turkish - Turkey":"Turkish - Turkey","lang_Portuguese - Brazilian":"Portuguese - Brazilian","lang_Portuguese - Portugal":"Portuguese - Portugal",lang_Thai:XMn,lang_Macedonian:ZMn,"lang_Chinese - Taiwan":"Chinese - Taiwan",lang_Serbian:JMn,lang_Bulgarian:e4n,"lang_Russian (Russia)":"Russian (Russia)","industry_Accounting & Legal":"Accounting & Legal",industry_Advertising:t4n,industry_Aerospace:n4n,industry_Agriculture:i4n,industry_Automotive:r4n,"industry_Banking & Finance":"Banking & Finance",industry_Biotechnology:o4n,industry_Broadcasting:s4n,"industry_Business Services":"Business Services","industry_Commodities & Chemicals":"Commodities & Chemicals",industry_Communications:a4n,"industry_Computers & Hightech":"Computers & Hightech",industry_Defense:l4n,industry_Energy:c4n,industry_Entertainment:u4n,industry_Government:d4n,"industry_Healthcare & Life Sciences":"Healthcare & Life Sciences",industry_Insurance:h4n,industry_Manufacturing:f4n,industry_Marketing:g4n,industry_Media:p4n,"industry_Nonprofit & Higher Ed":"Nonprofit & Higher Ed",industry_Pharmaceuticals:m4n,"industry_Professional Services & Consulting":"Professional Services & Consulting","industry_Real Estate":"Real Estate","industry_Retail & Wholesale":"Retail & Wholesale",industry_Sports:_4n,industry_Transportation:v4n,"industry_Travel & Luxury":"Travel & Luxury",industry_Other:b4n,industry_Photography:y4n,view_client_portal:C4n,view_portal:w4n,vendor_contacts:S4n,all:E4n,selected:x4n,category:k4n,categories:T4n,new_expense_category:I4n,edit_category:L4n,archive_expense_category:D4n,expense_categories:A4n,list_expense_categories:R4n,updated_expense_category:N4n,created_expense_category:O4n,archived_expense_category:P4n,archived_expense_categories:M4n,restore_expense_category:F4n,restored_expense_category:B4n,apply_taxes:$4n,min_to_max_users:V4n,max_users_reached:H4n,buy_now_buttons:W4n,landing_page:z4n,payment_type:j4n,form:U4n,link:q4n,fields:K4n,dwolla:G4n,buy_now_buttons_warning:Y4n,buy_now_buttons_disabled:Q4n,enable_buy_now_buttons_help:X4n,changes_take_effect_immediately:Z4n,wepay_account_description:J4n,payment_error_code:e3n,standard_fees_apply:t3n,limit_import_rows:n3n,error_title:i3n,error_contact_text:r3n,no_undo:o3n,no_contact_selected:s3n,no_client_selected:a3n,gateway_config_error:l3n,payment_type_on_file:c3n,invoice_for_client:u3n,intent_not_found:d3n,intent_not_supported:h3n,client_not_found:f3n,not_allowed:g3n,bot_emailed_invoice:p3n,bot_emailed_notify_viewed:m3n,bot_emailed_notify_paid:_3n,add_product_to_invoice:v3n,not_authorized:b3n,email_not_found:y3n,invalid_code:C3n,list_products:w3n,include_item_taxes_inline:S3n,created_quotes:E3n,warning:x3n,"self-update":"Update",update_invoiceninja_title:k3n,update_invoiceninja_warning:T3n,update_invoiceninja_available:I3n,update_invoiceninja_unavailable:L3n,update_invoiceninja_update_start:D3n,update_invoiceninja_download_start:A3n,create_new:R3n,toggle_navigation:N3n,toggle_history:O3n,unassigned:P3n,task:M3n,contact_name:F3n,city_state_postal:B3n,postal_city:$3n,custom_field:V3n,account_fields:H3n,facebook_and_twitter:W3n,facebook_and_twitter_help:z3n,reseller_text:j3n,unnamed_client:U3n,day:q3n,week:K3n,month:G3n,inactive_logout:Y3n,reports:Q3n,total_profit:X3n,total_expenses:Z3n,quote_to:J3n,limit:e5n,min_limit:t5n,max_limit:n5n,no_limit:i5n,set_limits:r5n,enable_min:o5n,enable_max:s5n,min:a5n,max:l5n,limits_not_met:c5n,date_range:u5n,raw:d5n,raw_html:h5n,update:f5n,invoice_fields_help:g5n,new_category:p5n,restore_product:m5n,blank:_5n,invoice_save_error:v5n,enable_recurring:b5n,disable_recurring:y5n,text:C5n,expense_will_create:w5n,expenses_will_create:S5n,created_expenses:E5n,translate_app:x5n,expense_category:k5n,go_ninja_pro:T5n,go_enterprise:I5n,upgrade_for_features:L5n,pay_annually_discount:D5n,pro_upgrade_title:A5n,pro_upgrade_feature1:R5n,pro_upgrade_feature2:N5n,enterprise_upgrade_feature1:O5n,enterprise_upgrade_feature2:P5n,much_more:M5n,all_pro_fetaures:F5n,currency_symbol:B5n,currency_code:$5n,buy_license:V5n,apply_license:H5n,submit:W5n,white_label_license_key:z5n,invalid_white_label_license:j5n,created_by:U5n,modules:q5n,financial_year_start:K5n,authentication:G5n,checkbox:Y5n,invoice_signature:Q5n,show_accept_invoice_terms:X5n,show_accept_invoice_terms_help:Z5n,show_accept_quote_terms:J5n,show_accept_quote_terms_help:eFn,require_invoice_signature:tFn,require_invoice_signature_help:nFn,require_quote_signature:iFn,require_quote_signature_help:rFn,i_agree:oFn,sign_here:sFn,sign_here_ux_tip:aFn,authorization:lFn,signed:cFn,vendor_name:uFn,entity_state:dFn,client_created_at:hFn,postmark_error:fFn,project:gFn,projects:pFn,new_project:mFn,edit_project:_Fn,archive_project:vFn,list_projects:bFn,updated_project:yFn,created_project:CFn,archived_project:wFn,archived_projects:SFn,restore_project:EFn,restored_project:xFn,delete_project:kFn,deleted_project:TFn,deleted_projects:IFn,delete_expense_category:LFn,deleted_expense_category:DFn,delete_product:AFn,deleted_product:RFn,deleted_products:NFn,restored_product:OFn,update_credit:PFn,updated_credit:MFn,edit_credit:FFn,realtime_preview:BFn,realtime_preview_help:$Fn,live_preview_help:VFn,force_pdfjs_help:HFn,force_pdfjs:WFn,redirect_url:zFn,redirect_url_help:jFn,save_draft:UFn,refunded_credit_payment:qFn,keyboard_shortcuts:KFn,toggle_menu:GFn,"new_...":"New ...","list_...":"List ...",created_at:YFn,contact_us:QFn,user_guide:XFn,promo_message:ZFn,discount_message:JFn,mark_paid:e6n,marked_sent_invoice:t6n,marked_sent_invoices:n6n,invoice_name:i6n,product_will_create:r6n,contact_us_response:o6n,last_7_days:s6n,last_30_days:a6n,this_month:l6n,last_month:c6n,current_quarter:u6n,last_quarter:d6n,last_year:h6n,all_time:f6n,custom_range:g6n,url:p6n,debug:m6n,https:_6n,require:v6n,license_expiring:b6n,security_confirmation:y6n,white_label_expired:C6n,renew_license:w6n,iphone_app_message:S6n,iphone_app:E6n,android_app:x6n,logged_in:k6n,switch_to_primary:T6n,inclusive:I6n,exclusive:L6n,postal_city_state:D6n,phantomjs_help:A6n,phantomjs_local:R6n,client_number:N6n,client_number_help:O6n,next_client_number:P6n,generated_numbers:M6n,notes_reminder1:F6n,notes_reminder2:B6n,notes_reminder3:$6n,notes_reminder4:V6n,bcc_email:H6n,tax_quote:W6n,tax_invoice:z6n,emailed_invoices:j6n,emailed_quotes:U6n,website_url:q6n,domain:K6n,domain_help:G6n,domain_help_website:Y6n,import_invoices:Q6n,new_report:X6n,edit_report:Z6n,columns:J6n,filters:eBn,sort_by:tBn,draft:nBn,unpaid:iBn,aging:rBn,age:oBn,days:sBn,age_group_0:aBn,age_group_30:lBn,age_group_60:cBn,age_group_90:uBn,age_group_120:dBn,invoice_details:hBn,qty:fBn,profit_and_loss:gBn,revenue:pBn,profit:mBn,group_when_sorted:_Bn,group_dates_by:vBn,year:bBn,view_statement:yBn,statement:CBn,statement_date:wBn,mark_active:SBn,send_automatically:EBn,initial_email:xBn,invoice_not_emailed:kBn,quote_not_emailed:TBn,sent_by:IBn,recipients:LBn,save_as_default:DBn,start_of_week_help:ABn,financial_year_start_help:RBn,reports_help:NBn,this_year:OBn,ninja_tagline:PBn,login_or_existing:MBn,sign_up_now:FBn,not_a_member_yet:BBn,login_create_an_account:$Bn,invoice_from:VBn,full_name:HBn,month_year:WBn,valid_thru:zBn,product_fields:jBn,custom_product_fields_help:UBn,freq_two_months:qBn,freq_yearly:KBn,profile:GBn,industry_Construction:YBn,your_statement:QBn,statement_issued_to:XBn,statement_to:ZBn,customize_options:JBn,created_payment_term:e$n,updated_payment_term:t$n,archived_payment_term:n$n,resend_invite:i$n,credit_created_by:r$n,created_payment_and_credit:o$n,created_payment_and_credit_emailed_client:s$n,create_project:a$n,create_vendor:l$n,create_expense_category:c$n,pro_plan_reports:u$n,mark_ready:d$n,limits:h$n,fees:f$n,fee:g$n,set_limits_fees:p$n,fees_tax_help:m$n,fees_sample:_$n,discount_sample:v$n,no_fees:b$n,gateway_fees_disclaimer:y$n,percent:C$n,location:w$n,line_item:S$n,surcharge:E$n,location_first_surcharge:x$n,location_second_surcharge:k$n,location_line_item:T$n,online_payment_surcharge:I$n,gateway_fees:L$n,fees_disabled:D$n,gateway_fees_help:A$n,gateway:R$n,gateway_fee_change_warning:N$n,fees_surcharge_help:O$n,label_and_taxes:P$n,billable:M$n,logo_warning_too_large:F$n,logo_warning_fileinfo:B$n,logo_warning_invalid:$$n,error_refresh_page:V$n,data:H$n,imported_settings:W$n,reset_counter:z$n,next_reset:j$n,reset_counter_help:U$n,auto_bill_failed:q$n,online_payment_discount:K$n,created_new_company:G$n,fees_disabled_for_gateway:Y$n,logout_and_delete:Q$n,tax_rate_type_help:X$n,credit_note:Z$n,credit_issued_to:J$n,credit_to:e8n,your_credit:t8n,credit_number:n8n,create_credit_note:i8n,menu:r8n,error_incorrect_gateway_ids:o8n,purge_data:s8n,delete_data:a8n,purge_data_help:l8n,cancel_account_help:c8n,purge_successful:u8n,forbidden:d8n,purge_data_message:h8n,contact_phone:f8n,contact_email:g8n,reply_to_email:p8n,reply_to_email_help:m8n,bcc_email_help:_8n,import_complete:v8n,confirm_account_to_import:b8n,import_started:y8n,payment_type_Venmo:C8n,"payment_type_Money Order":"Money Order",archived_products:w8n,recommend_on:S8n,recommend_off:E8n,notes_auto_billed:x8n,surcharge_label:k8n,contact_fields:T8n,custom_contact_fields_help:I8n,datatable_info:L8n,credit_total:D8n,mark_billable:A8n,billed:R8n,company_variables:N8n,client_variables:O8n,invoice_variables:P8n,navigation_variables:M8n,custom_variables:F8n,invalid_file:B8n,add_documents_to_invoice:$8n,mark_expense_paid:V8n,white_label_license_error:H8n,plan_price:W8n,wrong_confirmation:z8n,oauth_taken:j8n,emailed_payment:U8n,email_payment:q8n,invoiceplane_import:K8n,duplicate_expense_warning:G8n,expense_link:Y8n,resume_task:Q8n,resumed_task:X8n,quote_design:Z8n,default_design:J8n,custom_design1:e9n,custom_design2:t9n,custom_design3:n9n,empty:i9n,load_design:r9n,accepted_card_logos:o9n,google_analytics:s9n,analytics_key:a9n,analytics_key_help:l9n,start_date_required:c9n,application_settings:u9n,database_connection:d9n,driver:h9n,host:f9n,database:g9n,test_connection:p9n,from_name:m9n,from_address:_9n,port:v9n,encryption:b9n,mailgun_domain:y9n,mailgun_private_key:C9n,brevo_domain:w9n,brevo_private_key:S9n,send_test_email:E9n,select_label:x9n,label:k9n,service:T9n,update_payment_details:I9n,updated_payment_details:L9n,update_credit_card:D9n,recurring_expenses:A9n,recurring_expense:R9n,new_recurring_expense:N9n,edit_recurring_expense:O9n,archive_recurring_expense:P9n,list_recurring_expense:M9n,updated_recurring_expense:F9n,created_recurring_expense:B9n,archived_recurring_expense:$9n,restore_recurring_expense:V9n,restored_recurring_expense:H9n,delete_recurring_expense:W9n,deleted_recurring_expense:z9n,view_recurring_expense:j9n,taxes_and_fees:U9n,import_failed:q9n,recurring_prefix:K9n,options:G9n,credit_number_help:Y9n,next_credit_number:Q9n,padding_help:X9n,import_warning_invalid_date:Z9n,product_notes:J9n,app_version:e7n,ofx_version:t7n,charge_late_fee:n7n,late_fee_amount:i7n,late_fee_percent:r7n,late_fee_added:o7n,download_invoice:s7n,download_quote:a7n,invoices_are_attached:l7n,downloaded_invoice:c7n,downloaded_quote:u7n,downloaded_invoices:d7n,downloaded_quotes:h7n,clone_expense:f7n,default_documents:g7n,send_email_to_client:p7n,refund_subject:m7n,refund_body:_7n,currency_us_dollar:v7n,currency_british_pound:b7n,currency_euro:y7n,currency_south_african_rand:C7n,currency_danish_krone:w7n,currency_israeli_shekel:S7n,currency_swedish_krona:E7n,currency_kenyan_shilling:x7n,currency_canadian_dollar:k7n,currency_philippine_peso:T7n,currency_indian_rupee:I7n,currency_australian_dollar:L7n,currency_singapore_dollar:D7n,currency_norske_kroner:A7n,currency_new_zealand_dollar:R7n,currency_vietnamese_dong:N7n,currency_swiss_franc:O7n,currency_guatemalan_quetzal:P7n,currency_malaysian_ringgit:M7n,currency_brazilian_real:F7n,currency_thai_baht:B7n,currency_nigerian_naira:$7n,currency_argentine_peso:V7n,currency_bangladeshi_taka:H7n,currency_united_arab_emirates_dirham:W7n,currency_hong_kong_dollar:z7n,currency_indonesian_rupiah:j7n,currency_mexican_peso:U7n,currency_egyptian_pound:q7n,currency_colombian_peso:K7n,currency_west_african_franc:G7n,currency_chinese_renminbi:Y7n,currency_rwandan_franc:Q7n,currency_tanzanian_shilling:X7n,currency_netherlands_antillean_guilder:Z7n,currency_trinidad_and_tobago_dollar:J7n,currency_east_caribbean_dollar:eVn,currency_ghanaian_cedi:tVn,currency_bulgarian_lev:nVn,currency_aruban_florin:iVn,currency_turkish_lira:rVn,currency_romanian_new_leu:oVn,currency_croatian_kuna:sVn,currency_saudi_riyal:aVn,currency_japanese_yen:lVn,currency_maldivian_rufiyaa:cVn,currency_costa_rican_colon:uVn,currency_pakistani_rupee:dVn,currency_polish_zloty:hVn,currency_sri_lankan_rupee:fVn,currency_czech_koruna:gVn,currency_uruguayan_peso:pVn,currency_namibian_dollar:mVn,currency_tunisian_dinar:_Vn,currency_russian_ruble:vVn,currency_mozambican_metical:bVn,currency_omani_rial:yVn,currency_ukrainian_hryvnia:CVn,currency_macanese_pataca:wVn,currency_taiwan_new_dollar:SVn,currency_dominican_peso:EVn,currency_chilean_peso:xVn,currency_icelandic_krona:kVn,currency_papua_new_guinean_kina:TVn,currency_jordanian_dinar:IVn,currency_myanmar_kyat:LVn,currency_peruvian_sol:DVn,currency_botswana_pula:AVn,currency_hungarian_forint:RVn,currency_ugandan_shilling:NVn,currency_barbadian_dollar:OVn,currency_brunei_dollar:PVn,currency_georgian_lari:MVn,currency_qatari_riyal:FVn,currency_honduran_lempira:BVn,currency_surinamese_dollar:$Vn,currency_bahraini_dinar:VVn,currency_venezuelan_bolivars:HVn,currency_south_korean_won:WVn,currency_moroccan_dirham:zVn,currency_jamaican_dollar:jVn,currency_angolan_kwanza:UVn,currency_haitian_gourde:qVn,currency_zambian_kwacha:KVn,currency_nepalese_rupee:GVn,currency_cfp_franc:YVn,currency_mauritian_rupee:QVn,currency_cape_verdean_escudo:XVn,currency_kuwaiti_dinar:ZVn,currency_algerian_dinar:JVn,currency_macedonian_denar:eHn,currency_fijian_dollar:tHn,currency_bolivian_boliviano:nHn,currency_albanian_lek:iHn,currency_serbian_dinar:rHn,currency_lebanese_pound:oHn,currency_armenian_dram:sHn,currency_azerbaijan_manat:aHn,currency_bosnia_and_herzegovina_convertible_mark:lHn,currency_belarusian_ruble:cHn,currency_moldovan_leu:uHn,currency_kazakhstani_tenge:dHn,currency_gibraltar_pound:hHn,currency_gambia_dalasi:fHn,currency_paraguayan_guarani:gHn,currency_malawi_kwacha:pHn,currency_zimbabwean_dollar:mHn,currency_cambodian_riel:_Hn,currency_vanuatu_vatu:vHn,currency_cuban_peso:bHn,currency_bz_dollar:yHn,currency_libyan_dinar:CHn,currency_silver_troy_ounce:wHn,currency_gold_troy_ounce:SHn,currency_nicaraguan_córdoba:"Nicaraguan Córdoba",currency_malagasy_ariary:EHn,currency_tongan_paanga:xHn,review_app_help:kHn,writing_a_review:THn,tax1:IHn,tax2:LHn,fee_help:DHn,format_export:AHn,custom1:RHn,custom2:NHn,contact_first_name:OHn,contact_last_name:PHn,contact_custom1:MHn,contact_custom2:FHn,currency:BHn,ofx_help:$Hn,comments:VHn,item_product:HHn,item_notes:WHn,item_cost:zHn,item_quantity:jHn,item_tax_rate:UHn,item_tax_name:qHn,item_tax1:KHn,item_tax2:GHn,delete_company:YHn,delete_company_help:QHn,delete_company_message:XHn,applied_discount:ZHn,applied_free_year:JHn,contact_us_help:eWn,include_errors:tWn,include_errors_help:nWn,recent_errors:iWn,customer:rWn,customers:oWn,created_customer:sWn,created_customers:aWn,purge_details:lWn,deleted_company:cWn,deleted_account:uWn,deleted_company_details:dWn,deleted_account_details:hWn,alipay:fWn,sofort:gWn,sepa:pWn,name_without_special_characters:mWn,enable_alipay:_Wn,enable_sofort:vWn,stripe_alipay_help:bWn,calendar:yWn,pro_plan_calendar:CWn,what_are_you_working_on:wWn,time_tracker:SWn,refresh:EWn,filter_sort:xWn,no_description:kWn,time_tracker_login:TWn,save_or_discard:IWn,discard_changes:LWn,tasks_not_enabled:DWn,started_task:AWn,create_client:RWn,download_desktop_app:NWn,download_iphone_app:OWn,download_android_app:PWn,time_tracker_mobile_help:MWn,stopped:FWn,ascending:BWn,descending:$Wn,sort_field:VWn,sort_direction:HWn,discard:WWn,time_am:zWn,time_pm:jWn,time_mins:UWn,time_hr:qWn,time_hrs:KWn,clear:GWn,warn_payment_gateway:YWn,task_rate:QWn,task_rate_help:XWn,past_due:ZWn,document:JWn,invoice_or_expense:ezn,invoice_pdfs:tzn,enable_sepa:nzn,enable_bitcoin:izn,iban:rzn,sepa_authorization:ozn,recover_license:szn,purchase:azn,recover:lzn,apply:czn,recover_white_label_header:uzn,apply_white_label_header:dzn,videos:hzn,video:fzn,return_to_invoice:gzn,partial_due_date:pzn,task_fields:mzn,product_fields_help:_zn,custom_value1:vzn,custom_value2:bzn,enable_two_factor:yzn,enable_two_factor_help:Czn,two_factor_setup:wzn,two_factor_setup_help:Szn,one_time_password:Ezn,set_phone_for_two_factor:xzn,enabled_two_factor:kzn,add_product:Tzn,email_will_be_sent_on:Izn,invoice_product:Lzn,self_host_login:Dzn,set_self_hoat_url:Azn,local_storage_required:Rzn,your_password_reset_link:Nzn,subdomain_taken:Ozn,client_login:Pzn,converted_amount:Mzn,default:"Default",shipping_address:Fzn,bllling_address:Bzn,billing_address1:$zn,billing_address2:Vzn,billing_city:Hzn,billing_state:Wzn,billing_postal_code:zzn,billing_country:jzn,shipping_address1:Uzn,shipping_address2:qzn,shipping_city:Kzn,shipping_state:Gzn,shipping_postal_code:Yzn,shipping_country:Qzn,classify:Xzn,show_shipping_address_help:Zzn,ship_to_billing_address:Jzn,delivery_note:ejn,show_tasks_in_portal:tjn,cancel_schedule:njn,scheduled_report:ijn,scheduled_report_help:rjn,created_scheduled_report:ojn,deleted_scheduled_report:sjn,scheduled_report_attached:ajn,scheduled_report_error:ljn,invalid_one_time_password:cjn,apple_pay:ujn,enable_apple_pay:djn,requires_subdomain:hjn,subdomain_is_set:fjn,verification_file:gjn,verification_file_missing:pjn,apple_pay_domain:mjn,apple_pay_not_supported:_jn,optional_payment_methods:vjn,add_subscription:bjn,target_url:yjn,target_url_help:Cjn,event:wjn,subscription_event_1:Sjn,subscription_event_2:Ejn,subscription_event_3:xjn,subscription_event_4:kjn,subscription_event_5:Tjn,subscription_event_6:Ijn,subscription_event_7:Ljn,subscription_event_8:Djn,subscription_event_9:Ajn,subscription_event_10:Rjn,subscription_event_11:Njn,subscription_event_12:Ojn,subscription_event_13:Pjn,subscription_event_14:Mjn,subscription_event_15:Fjn,subscription_event_16:Bjn,subscription_event_17:$jn,subscription_event_18:Vjn,subscription_event_19:Hjn,subscription_event_20:Wjn,subscription_event_21:zjn,subscriptions:jjn,updated_subscription:Ujn,created_subscription:qjn,edit_subscription:Kjn,archive_subscription:Gjn,archived_subscription:Yjn,project_error_multiple_clients:Qjn,invoice_project:Xjn,module_recurring_invoice:Zjn,module_credit:Jjn,module_quote:eUn,module_task:tUn,module_expense:nUn,module_ticket:iUn,reminders:rUn,send_client_reminders:oUn,can_view_tasks:sUn,is_not_sent_reminders:aUn,promotion_footer:lUn,unable_to_delete_primary:cUn,please_register:uUn,processing_request:dUn,mcrypt_warning:hUn,edit_times:fUn,inclusive_taxes_help:gUn,inclusive_taxes_notice:pUn,inclusive_taxes_warning:mUn,copy_shipping:_Un,copy_billing:vUn,quote_has_expired:bUn,empty_table_footer:yUn,do_not_trust:CUn,trust_for_30_days:wUn,trust_forever:SUn,kanban:EUn,backlog:xUn,ready_to_do:kUn,in_progress:TUn,add_status:IUn,archive_status:LUn,new_status:DUn,convert_products:AUn,convert_products_help:RUn,improve_client_portal_link:NUn,budgeted_hours:OUn,progress:PUn,view_project:MUn,summary:FUn,endless_reminder:BUn,signature_on_invoice_help:$Un,signature_on_pdf:VUn,signature_on_pdf_help:HUn,expired_white_label:WUn,return_to_login:zUn,convert_products_tip:jUn,amount_greater_than_balance:UUn,custom_fields_tip:qUn,client_information:KUn,updated_client_details:GUn,auto:YUn,tax_amount:QUn,tax_paid:XUn,none:ZUn,proposal_message_button:JUn,proposal:eqn,proposals:tqn,list_proposals:nqn,new_proposal:iqn,edit_proposal:rqn,archive_proposal:oqn,delete_proposal:sqn,created_proposal:aqn,updated_proposal:lqn,archived_proposal:cqn,deleted_proposal:uqn,archived_proposals:dqn,deleted_proposals:hqn,restored_proposal:fqn,restore_proposal:gqn,snippet:pqn,snippets:mqn,proposal_snippet:_qn,proposal_snippets:vqn,new_proposal_snippet:bqn,edit_proposal_snippet:yqn,archive_proposal_snippet:Cqn,delete_proposal_snippet:wqn,created_proposal_snippet:Sqn,updated_proposal_snippet:Eqn,archived_proposal_snippet:xqn,deleted_proposal_snippet:kqn,archived_proposal_snippets:Tqn,deleted_proposal_snippets:Iqn,restored_proposal_snippet:Lqn,restore_proposal_snippet:Dqn,template:Aqn,templates:Rqn,proposal_template:Nqn,proposal_templates:Oqn,new_proposal_template:Pqn,edit_proposal_template:Mqn,archive_proposal_template:Fqn,delete_proposal_template:Bqn,created_proposal_template:$qn,updated_proposal_template:Vqn,archived_proposal_template:Hqn,deleted_proposal_template:Wqn,archived_proposal_templates:zqn,deleted_proposal_templates:jqn,restored_proposal_template:Uqn,restore_proposal_template:qqn,proposal_category:Kqn,proposal_categories:Gqn,new_proposal_category:Yqn,edit_proposal_category:Qqn,archive_proposal_category:Xqn,delete_proposal_category:Zqn,created_proposal_category:Jqn,updated_proposal_category:eKn,archived_proposal_category:tKn,deleted_proposal_category:nKn,archived_proposal_categories:iKn,deleted_proposal_categories:rKn,restored_proposal_category:oKn,restore_proposal_category:sKn,delete_status:aKn,standard:lKn,icon:cKn,proposal_not_found:uKn,create_proposal_category:dKn,clone_proposal_template:hKn,proposal_email:fKn,proposal_subject:gKn,proposal_message:pKn,emailed_proposal:mKn,load_template:_Kn,no_assets:vKn,add_image:bKn,select_image:yKn,upgrade_to_upload_images:CKn,delete_image:wKn,delete_image_help:SKn,amount_variable_help:EKn,taxes_are_included_help:xKn,taxes_are_not_included_help:kKn,change_requires_purge:TKn,purging:IKn,warning_local_refund:LKn,email_address_changed:DKn,email_address_changed_message:AKn,test:RKn,beta:NKn,email_history:OKn,loading:PKn,no_messages_found:MKn,processing:FKn,reactivate:BKn,reactivated_email:$Kn,emails:VKn,opened:HKn,bounced:WKn,total_sent:zKn,total_opened:jKn,total_bounced:UKn,total_spam:qKn,platforms:KKn,email_clients:GKn,mobile:YKn,desktop:QKn,webmail:XKn,group:ZKn,subgroup:JKn,unset:eGn,received_new_payment:tGn,slack_webhook_help:nGn,slack_incoming_webhooks:iGn,accept:rGn,accepted_terms:oGn,invalid_url:sGn,workflow_settings:aGn,auto_email_invoice:lGn,auto_email_invoice_help:cGn,auto_archive_invoice:uGn,auto_archive_invoice_help:dGn,auto_archive_quote:hGn,auto_archive_quote_help:fGn,require_approve_quote:gGn,require_approve_quote_help:pGn,allow_approve_expired_quote:mGn,allow_approve_expired_quote_help:_Gn,invoice_workflow:vGn,quote_workflow:bGn,client_must_be_active:yGn,purge_client:CGn,purged_client:wGn,purge_client_warning:SGn,clone_product:EGn,item_details:xGn,send_item_details_help:kGn,view_proposal:TGn,view_in_portal:IGn,cookie_message:LGn,got_it:DGn,vendor_will_create:AGn,vendors_will_create:RGn,created_vendors:NGn,import_vendors:OGn,company:PGn,client_field:MGn,contact_field:FGn,product_field:BGn,task_field:$Gn,project_field:VGn,expense_field:HGn,vendor_field:WGn,company_field:zGn,invoice_field:jGn,invoice_surcharge:UGn,custom_task_fields_help:qGn,custom_project_fields_help:KGn,custom_expense_fields_help:GGn,custom_vendor_fields_help:YGn,messages:QGn,unpaid_invoice:XGn,paid_invoice:ZGn,unapproved_quote:JGn,unapproved_proposal:eYn,autofills_city_state:tYn,no_match_found:nYn,password_strength:iYn,strength_weak:rYn,strength_good:oYn,strength_strong:sYn,mark:aYn,updated_task_status:lYn,background_image:cYn,background_image_help:uYn,proposal_editor:dYn,background:hYn,guide:fYn,gateway_fee_item:gYn,gateway_fee_description:pYn,gateway_fee_discount_description:mYn,show_payments:_Yn,show_aging:vYn,reference:bYn,amount_paid:yYn,send_notifications_for:CYn,all_invoices:wYn,my_invoices:SYn,payment_reference:EYn,maximum:xYn,sort:kYn,refresh_complete:TYn,please_enter_your_email:IYn,please_enter_your_password:LYn,please_enter_your_url:DYn,please_enter_a_product_key:AYn,an_error_occurred:RYn,overview:NYn,copied_to_clipboard:OYn,error:PYn,could_not_launch:MYn,additional:FYn,ok:BYn,email_is_invalid:$Yn,items:VYn,partial_deposit:HYn,add_item:WYn,total_amount:zYn,pdf:jYn,invoice_status_id:UYn,click_plus_to_add_item:qYn,count_selected:KYn,dismiss:GYn,please_select_a_date:YYn,please_select_a_client:QYn,language:XYn,updated_at:ZYn,please_enter_an_invoice_number:JYn,please_enter_a_quote_number:eQn,clients_invoices:tQn,viewed:nQn,approved:iQn,invoice_status_1:rQn,invoice_status_2:oQn,invoice_status_3:sQn,invoice_status_4:aQn,invoice_status_5:lQn,invoice_status_6:cQn,marked_invoice_as_sent:uQn,please_enter_a_client_or_contact_name:dQn,restart_app_to_apply_change:hQn,refresh_data:fQn,blank_contact:gQn,no_records_found:pQn,industry:mQn,size:_Qn,net:vQn,show_tasks:bQn,email_reminders:yQn,reminder1:CQn,reminder2:wQn,reminder3:SQn,send:EQn,auto_billing:xQn,button:kQn,more:TQn,edit_recurring_invoice:IQn,edit_recurring_quote:LQn,quote_status:DQn,please_select_an_invoice:AQn,filtered_by:RQn,payment_status:NQn,payment_status_1:OQn,payment_status_2:PQn,payment_status_3:MQn,payment_status_4:FQn,payment_status_5:BQn,payment_status_6:$Qn,send_receipt_to_client:VQn,refunded:HQn,marked_quote_as_sent:WQn,custom_module_settings:zQn,open:jQn,new:"New",closed:UQn,reopened:qQn,priority:KQn,last_updated:GQn,comment:YQn,tags:QQn,linked_objects:XQn,low:ZQn,medium:JQn,high:eXn,no_due_date:tXn,assigned_to:nXn,reply:iXn,awaiting_reply:rXn,mark_spam:oXn,local_part:sXn,local_part_unavailable:aXn,local_part_available:lXn,local_part_invalid:cXn,local_part_help:uXn,from_name_help:dXn,local_part_placeholder:hXn,from_name_placeholder:fXn,attachments:gXn,client_upload:pXn,enable_client_upload_help:mXn,max_file_size_help:_Xn,max_file_size:vXn,mime_types:bXn,mime_types_placeholder:yXn,mime_types_help:CXn,ticket_number_start_help:wXn,new_ticket_template_id:SXn,new_ticket_autoresponder_help:EXn,update_ticket_template_id:xXn,update_ticket_autoresponder_help:kXn,close_ticket_template_id:TXn,close_ticket_autoresponder_help:IXn,default_priority:LXn,alert_new_comment_id:DXn,update_ticket_notification_list:AXn,comma_separated_values:RXn,default_agent:NXn,default_agent_help:OXn,show_agent_details:PXn,avatar:MXn,remove_avatar:FXn,add_template:BXn,archive_ticket_template:$Xn,restore_ticket_template:VXn,archived_ticket_template:HXn,restored_ticket_template:WXn,enter_ticket_message:zXn,show_hide_all:jXn,subject_required:UXn,mobile_refresh_warning:qXn,merge:KXn,merged:GXn,agent:YXn,include_in_filter:QXn,custom_client1:XXn,custom_client2:ZXn,compare:JXn,hosted_login:eZn,selfhost_login:tZn,google_login:nZn,thanks_for_patience:iZn,legacy_mobile_app:rZn,today:oZn,current:sZn,previous:aZn,current_period:lZn,comparison_period:cZn,previous_period:uZn,previous_year:dZn,compare_to:hZn,last_week:fZn,clone_to_invoice:gZn,clone_to_quote:pZn,convert:mZn,last7_days:_Zn,last30_days:vZn,custom_js:bZn,adjust_fee_percent_help:yZn,show_product_notes:CZn,show_product_notes_help:wZn,important:SZn,thank_you_for_using_our_app:EZn,if_you_like_it:xZn,to_rate_it:kZn,average:TZn,unapproved:IZn,authenticate_to_change_setting:LZn,locked:DZn,authenticate:AZn,please_authenticate:RZn,biometric_authentication:NZn,auto_start_tasks:OZn,budgeted:PZn,please_enter_a_name:MZn,click_plus_to_add_time:FZn,design:BZn,password_is_too_short:$Zn,failed_to_find_record:VZn,valid_until_days:HZn,valid_until_days_help:WZn,usually_pays_in_days:zZn,requires_an_enterprise_plan:jZn,take_picture:UZn,upload_file:qZn,new_document:KZn,edit_document:GZn,uploaded_document:YZn,updated_document:QZn,archived_document:XZn,deleted_document:ZZn,restored_document:JZn,no_history:eJn,expense_status_1:tJn,expense_status_2:nJn,expense_status_3:iJn,no_record_selected:rJn,error_unsaved_changes:oJn,thank_you_for_your_purchase:sJn,redeem:aJn,back:lJn,past_purchases:cJn,annual_subscription:uJn,pro_plan:dJn,enterprise_plan:hJn,count_users:fJn,upgrade:gJn,please_enter_a_first_name:pJn,please_enter_a_last_name:mJn,please_agree_to_terms_and_privacy:_Jn,i_agree_to_the:vJn,terms_of_service_link:bJn,privacy_policy_link:yJn,view_website:CJn,create_account:wJn,email_login:SJn,late_fees:EJn,payment_number:xJn,before_due_date:kJn,after_due_date:TJn,after_invoice_date:IJn,filtered_by_user:LJn,created_user:DJn,primary_font:AJn,secondary_font:RJn,number_padding:NJn,general:OJn,surcharge_field:PJn,company_value:MJn,credit_field:FJn,payment_field:BJn,group_field:$Jn,number_counter:VJn,number_pattern:HJn,custom_javascript:WJn,portal_mode:zJn,attach_pdf:jJn,attach_documents:UJn,attach_ubl:qJn,email_style:KJn,processed:GJn,fee_amount:YJn,fee_percent:QJn,fee_cap:XJn,limits_and_fees:ZJn,credentials:JJn,require_billing_address_help:eei,require_shipping_address_help:tei,deleted_tax_rate:nei,restored_tax_rate:iei,provider:rei,company_gateway:oei,company_gateways:sei,new_company_gateway:aei,edit_company_gateway:lei,created_company_gateway:cei,updated_company_gateway:uei,archived_company_gateway:dei,deleted_company_gateway:hei,restored_company_gateway:fei,continue_editing:gei,default_value:pei,currency_format:mei,first_day_of_the_week:_ei,first_month_of_the_year:vei,symbol:bei,ocde:yei,date_format:Cei,datetime_format:wei,send_reminders:Sei,timezone:Eei,filtered_by_group:xei,filtered_by_invoice:kei,filtered_by_client:Tei,filtered_by_vendor:Iei,group_settings:Lei,groups:Dei,new_group:Aei,edit_group:Rei,created_group:Nei,updated_group:Oei,archived_group:Pei,deleted_group:Mei,restored_group:Fei,upload_logo:Bei,uploaded_logo:$ei,saved_settings:Vei,device_settings:Hei,credit_cards_and_banks:Wei,price:zei,email_sign_up:jei,google_sign_up:Uei,sign_up_with_google:qei,long_press_multiselect:Kei,migrate_to_next_version:Gei,migrate_intro_text:Yei,start_the_migration:Qei,migration:Xei,welcome_to_the_new_version:Zei,next_step_data_download:Jei,download_data:eti,continue:"Continue",company1:tti,company2:nti,company3:iti,company4:rti,product1:oti,product2:sti,product3:ati,product4:lti,client1:cti,client2:uti,client3:dti,client4:hti,contact1:fti,contact2:gti,contact3:pti,contact4:mti,task1:_ti,task2:vti,task3:bti,task4:yti,project1:Cti,project2:wti,project3:Sti,project4:Eti,expense1:xti,expense2:kti,expense3:Tti,expense4:Iti,vendor1:Lti,vendor2:Dti,vendor3:Ati,vendor4:Rti,invoice1:Nti,invoice2:Oti,invoice3:Pti,invoice4:Mti,payment1:Fti,payment2:Bti,payment3:$ti,payment4:Vti,surcharge1:Hti,surcharge2:Wti,surcharge3:zti,surcharge4:jti,group1:Uti,group2:qti,group3:Kti,group4:Gti,number:Yti,count:Qti,is_active:Xti,contact_last_login:Zti,contact_full_name:Jti,contact_custom_value1:eni,contact_custom_value2:tni,contact_custom_value3:nni,contact_custom_value4:ini,assigned_to_id:rni,created_by_id:oni,add_column:sni,edit_columns:ani,to_learn_about_gogle_fonts:lni,refund_date:cni,multiselect:uni,verify_password:dni,applied:hni,include_recent_errors:fni,your_message_has_been_received:gni,show_product_details:pni,show_product_details_help:mni,pdf_min_requirements:_ni,adjust_fee_percent:vni,configure_settings:bni,about:yni,credit_email:Cni,domain_url:wni,password_is_too_easy:Sni,client_portal_tasks:Eni,client_portal_dashboard:xni,please_enter_a_value:kni,deleted_logo:Tni,generate_number:Ini,when_saved:Lni,when_sent:Dni,select_company:Ani,float:Rni,collapse:Nni,show_or_hide:Oni,menu_sidebar:Pni,history_sidebar:Mni,tablet:Fni,layout:Bni,module:$ni,first_custom:Vni,second_custom:Hni,third_custom:Wni,show_cost:zni,show_cost_help:jni,show_product_quantity:Uni,show_product_quantity_help:qni,show_invoice_quantity:Kni,show_invoice_quantity_help:Gni,default_quantity:Yni,default_quantity_help:Qni,one_tax_rate:Xni,two_tax_rates:Zni,three_tax_rates:Jni,default_tax_rate:eii,invoice_tax:tii,line_item_tax:nii,inclusive_taxes:iii,invoice_tax_rates:rii,item_tax_rates:oii,configure_rates:sii,tax_settings_rates:aii,accent_color:lii,comma_sparated_list:cii,single_line_text:uii,multi_line_text:dii,dropdown:hii,field_type:fii,recover_password_email_sent:gii,removed_user:pii,freq_three_years:mii,military_time_help:_ii,click_here_capital:vii,marked_invoice_as_paid:bii,marked_invoices_as_sent:yii,marked_invoices_as_paid:Cii,activity_57:wii,custom_value3:Sii,custom_value4:Eii,email_style_custom:xii,custom_message_dashboard:kii,custom_message_unpaid_invoice:Tii,custom_message_paid_invoice:Iii,custom_message_unapproved_quote:Lii,lock_sent_invoices:Dii,translations:Aii,task_number_pattern:Rii,task_number_counter:Nii,expense_number_pattern:Oii,expense_number_counter:Pii,vendor_number_pattern:Mii,vendor_number_counter:Fii,ticket_number_pattern:Bii,ticket_number_counter:$ii,payment_number_pattern:Vii,payment_number_counter:Hii,invoice_number_pattern:Wii,quote_number_pattern:zii,client_number_pattern:jii,client_number_counter:Uii,credit_number_pattern:qii,credit_number_counter:Kii,reset_counter_date:Gii,counter_padding:Yii,shared_invoice_quote_counter:Qii,default_tax_name_1:Xii,default_tax_rate_1:Zii,default_tax_name_2:Jii,default_tax_rate_2:eri,default_tax_name_3:tri,default_tax_rate_3:nri,email_subject_invoice:iri,email_subject_quote:rri,email_subject_payment:ori,switch_list_table:sri,client_city:ari,client_state:lri,client_country:cri,client_is_active:uri,client_balance:dri,client_address1:hri,client_address2:fri,client_shipping_address1:gri,client_shipping_address2:pri,tax_rate1:mri,tax_rate2:_ri,tax_rate3:vri,archived_at:bri,has_expenses:yri,custom_taxes1:Cri,custom_taxes2:wri,custom_taxes3:Sri,custom_taxes4:Eri,custom_surcharge1:xri,custom_surcharge2:kri,custom_surcharge3:Tri,custom_surcharge4:Iri,is_deleted:Lri,vendor_city:Dri,vendor_state:Ari,vendor_country:Rri,credit_footer:Nri,credit_terms:Ori,untitled_company:Pri,added_company:Mri,supported_events:Fri,custom3:Bri,custom4:$ri,optional:Vri,license:Hri,invoice_balance:Wri,saved_design:zri,client_details:jri,company_address:Uri,quote_details:qri,credit_details:Kri,product_columns:Gri,task_columns:Yri,add_field:Qri,all_events:Xri,owned:Zri,payment_success:Jri,payment_failure:eoi,quote_sent:toi,credit_sent:noi,invoice_viewed:ioi,quote_viewed:roi,credit_viewed:ooi,quote_approved:soi,receive_all_notifications:aoi,purchase_license:loi,enable_modules:coi,converted_quote:uoi,credit_design:doi,includes:hoi,css_framework:foi,custom_designs:goi,designs:poi,new_design:moi,edit_design:_oi,created_design:voi,updated_design:boi,archived_design:yoi,deleted_design:Coi,removed_design:woi,restored_design:Soi,recurring_tasks:Eoi,removed_credit:xoi,latest_version:koi,update_now:Toi,a_new_version_is_available:Ioi,update_available:Loi,app_updated:Doi,integrations:Aoi,tracking_id:Roi,slack_webhook_url:Noi,partial_payment:Ooi,partial_payment_email:Poi,clone_to_credit:Moi,emailed_credit:Foi,marked_credit_as_sent:Boi,email_subject_payment_partial:$oi,is_approved:Voi,migration_went_wrong:Hoi,cross_migration_message:Woi,email_credit:zoi,client_email_not_set:joi,ledger:Uoi,view_pdf:qoi,all_records:Koi,owned_by_user:Goi,credit_remaining:Yoi,use_default:Qoi,reminder_endless:Xoi,number_of_days:Zoi,configure_payment_terms:Joi,payment_term:esi,new_payment_term:tsi,deleted_payment_term:nsi,removed_payment_term:isi,restored_payment_term:rsi,full_width_editor:osi,full_height_filter:ssi,email_sign_in:asi,change:lsi,change_to_mobile_layout:csi,change_to_desktop_layout:usi,send_from_gmail:dsi,reversed:hsi,cancelled:fsi,quote_amount:gsi,hosted:psi,selfhosted:msi,hide_menu:_si,show_menu:vsi,partially_refunded:bsi,search_documents:ysi,search_designs:Csi,search_invoices:wsi,search_clients:Ssi,search_products:Esi,search_quotes:xsi,search_credits:ksi,search_vendors:Tsi,search_users:Isi,search_tax_rates:Lsi,search_tasks:Dsi,search_settings:Asi,search_projects:Rsi,search_expenses:Nsi,search_payments:Osi,search_groups:Psi,search_company:Msi,cancelled_invoice:Fsi,cancelled_invoices:Bsi,reversed_invoice:$si,reversed_invoices:Vsi,reverse:Hsi,filtered_by_project:Wsi,google_sign_in:zsi,activity_58:jsi,activity_59:Usi,payment_reconciliation_failure:qsi,payment_reconciliation_success:Ksi,gateway_success:Gsi,gateway_failure:Ysi,gateway_error:Qsi,email_send:Xsi,email_retry_queue:Zsi,failure:Jsi,quota_exceeded:eai,upstream_failure:tai,system_logs:nai,copy_link:iai,welcome_to_invoice_ninja:rai,optin:oai,optout:sai,auto_convert:aai,reminder1_sent:lai,reminder2_sent:cai,reminder3_sent:uai,reminder_last_sent:dai,pdf_page_info:hai,emailed_credits:fai,view_in_stripe:gai,rows_per_page:pai,apply_payment:mai,unapplied:_ai,custom_labels:vai,record_type:bai,record_name:yai,file_type:Cai,height:wai,width:Sai,health_check:Eai,last_login_at:xai,company_key:kai,storefront:Tai,storefront_help:Iai,count_records_selected:Lai,count_record_selected:Dai,client_created:Aai,online_payment_email:Rai,manual_payment_email:Nai,completed:Oai,gross:Pai,net_amount:Mai,net_balance:Fai,client_settings:Bai,selected_invoices:$ai,selected_payments:Vai,selected_quotes:Hai,selected_tasks:Wai,selected_expenses:zai,past_due_invoices:jai,create_payment:Uai,update_quote:qai,update_invoice:Kai,update_client:Gai,update_vendor:Yai,create_expense:Qai,update_expense:Xai,update_task:Zai,approve_quote:Jai,when_paid:eli,expires_on:tli,show_sidebar:nli,hide_sidebar:ili,event_type:rli,copy:oli,must_be_online:sli,crons_not_enabled:ali,api_webhooks:lli,search_webhooks:cli,search_webhook:uli,webhook:dli,webhooks:hli,new_webhook:fli,edit_webhook:gli,created_webhook:pli,updated_webhook:mli,archived_webhook:_li,deleted_webhook:vli,removed_webhook:bli,restored_webhook:yli,search_tokens:Cli,search_token:wli,new_token:Sli,removed_token:Eli,restored_token:xli,client_registration:kli,client_registration_help:Tli,customize_and_preview:Ili,search_document:Lli,search_design:Dli,search_invoice:Ali,search_client:Rli,search_product:Nli,search_quote:Oli,search_credit:Pli,search_vendor:Mli,search_user:Fli,search_tax_rate:Bli,search_task:$li,search_project:Vli,search_expense:Hli,search_payment:Wli,search_group:zli,created_on:jli,"payment_status_-1":"Unapplied",lock_invoices:Uli,show_table:qli,show_list:Kli,view_changes:Gli,force_update:Yli,force_update_help:Qli,mark_paid_help:Xli,mark_invoiceable_help:Zli,add_documents_to_invoice_help:Jli,convert_currency_help:eci,expense_settings:tci,clone_to_recurring:nci,crypto:ici,user_field:rci,variables:oci,show_password:sci,hide_password:aci,copy_error:lci,capture_card:cci,auto_bill_enabled:uci,total_taxes:dci,line_taxes:hci,total_fields:fci,stopped_recurring_invoice:gci,started_recurring_invoice:pci,resumed_recurring_invoice:mci,gateway_refund:_ci,gateway_refund_help:vci,due_date_days:bci,paused:yci,day_count:Cci,first_day_of_the_month:wci,last_day_of_the_month:Sci,use_payment_terms:Eci,endless:xci,next_send_date:kci,remaining_cycles:Tci,created_recurring_invoice:Ici,updated_recurring_invoice:Lci,removed_recurring_invoice:Dci,search_recurring_invoice:Aci,search_recurring_invoices:Rci,send_date:Nci,auto_bill_on:Oci,minimum_under_payment_amount:Pci,allow_over_payment:Mci,allow_over_payment_help:Fci,allow_under_payment:Bci,allow_under_payment_help:$ci,test_mode:Vci,calculated_rate:Hci,default_task_rate:Wci,clear_cache:zci,sort_order:jci,task_status:Uci,task_statuses:qci,new_task_status:Kci,edit_task_status:Gci,created_task_status:Yci,archived_task_status:Qci,deleted_task_status:Xci,removed_task_status:Zci,restored_task_status:Jci,search_task_status:eui,search_task_statuses:tui,show_tasks_table:nui,show_tasks_table_help:iui,invoice_task_timelog:rui,invoice_task_timelog_help:oui,auto_start_tasks_help:sui,configure_statuses:aui,task_settings:lui,configure_categories:cui,edit_expense_category:uui,removed_expense_category:dui,search_expense_category:hui,search_expense_categories:fui,use_available_credits:gui,show_option:pui,negative_payment_error:mui,should_be_invoiced_help:_ui,configure_gateways:vui,payment_partial:bui,is_running:yui,invoice_currency_id:Cui,tax_name1:wui,tax_name2:Sui,transaction_id:Eui,invoice_late:xui,quote_expired:kui,recurring_invoice_total:Tui,actions:Iui,expense_number:Lui,task_number:Dui,project_number:Aui,view_settings:Rui,company_disabled_warning:Nui,late_invoice:Oui,expired_quote:Pui,remind_invoice:Mui,client_phone:Fui,required_fields:Bui,enabled_modules:$ui,activity_60:Vui,activity_61:Hui,activity_62:Wui,activity_63:zui,activity_64:jui,activity_65:Uui,activity_66:qui,expense_category_id:Kui,view_licenses:Gui,fullscreen_editor:Yui,sidebar_editor:Qui,please_type_to_confirm:Xui,purge:Zui,clone_to:Jui,clone_to_other:edi,labels:tdi,add_custom:ndi,payment_tax:idi,white_label:rdi,sent_invoices_are_locked:odi,paid_invoices_are_locked:sdi,source_code:adi,app_platforms:ldi,archived_task_statuses:cdi,deleted_task_statuses:udi,restored_task_statuses:ddi,deleted_expense_categories:hdi,restored_expense_categories:fdi,archived_recurring_invoices:gdi,deleted_recurring_invoices:pdi,restored_recurring_invoices:mdi,archived_webhooks:_di,deleted_webhooks:vdi,removed_webhooks:bdi,restored_webhooks:ydi,api_docs:Cdi,archived_tokens:wdi,deleted_tokens:Sdi,restored_tokens:Edi,archived_payment_terms:xdi,deleted_payment_terms:kdi,restored_payment_terms:Tdi,archived_designs:Idi,deleted_designs:Ldi,restored_designs:Ddi,restored_credits:Adi,archived_users:Rdi,deleted_users:Ndi,removed_users:Odi,restored_users:Pdi,archived_tax_rates:Mdi,deleted_tax_rates:Fdi,restored_tax_rates:Bdi,archived_company_gateways:$di,deleted_company_gateways:Vdi,restored_company_gateways:Hdi,archived_groups:Wdi,deleted_groups:zdi,restored_groups:jdi,archived_documents:Udi,deleted_documents:qdi,restored_documents:Kdi,restored_vendors:Gdi,restored_expenses:Ydi,restored_tasks:Qdi,restored_projects:Xdi,restored_products:Zdi,restored_clients:Jdi,restored_invoices:ehi,restored_payments:thi,restored_quotes:nhi,update_app:ihi,started_import:rhi,duplicate_column_mapping:ohi,uses_inclusive_taxes:shi,is_amount_discount:ahi,map_to:lhi,first_row_as_column_names:chi,no_file_selected:uhi,import_type:dhi,draft_mode:hhi,draft_mode_help:fhi,show_product_discount:ghi,show_product_discount_help:phi,tax_name3:mhi,debug_mode_is_enabled:_hi,debug_mode_is_enabled_help:vhi,running_tasks:bhi,recent_tasks:yhi,recent_expenses:Chi,upcoming_expenses:whi,search_payment_term:Shi,search_payment_terms:Ehi,save_and_preview:xhi,save_and_email:khi,converted_balance:Thi,is_sent:Ihi,document_upload:Lhi,document_upload_help:Dhi,expense_total:Ahi,enter_taxes:Rhi,by_rate:Nhi,by_amount:Ohi,enter_amount:Phi,before_taxes:Mhi,after_taxes:Fhi,color:Bhi,show:$hi,empty_columns:Vhi,project_name:Hhi,counter_pattern_error:Whi,this_quarter:zhi,to_update_run:jhi,registration_url:Uhi,show_product_cost:qhi,complete:Khi,next:Ghi,next_step:Yhi,notification_credit_sent_subject:Qhi,notification_credit_viewed_subject:Xhi,notification_credit_sent:Zhi,notification_credit_viewed:Jhi,reset_password_text:efi,password_reset:tfi,account_login_text:nfi,request_cancellation:ifi,delete_payment_method:rfi,about_to_delete_payment_method:ofi,action_cant_be_reversed:sfi,profile_updated_successfully:afi,currency_ethiopian_birr:lfi,client_information_text:cfi,status_id:ufi,email_already_register:dfi,locations:hfi,freq_indefinitely:ffi,cycles_remaining:gfi,i_understand_delete:pfi,download_files:mfi,download_timeframe:_fi,new_signup:vfi,new_signup_text:bfi,notification_payment_paid_subject:yfi,notification_partial_payment_paid_subject:Cfi,notification_payment_paid:wfi,notification_partial_payment_paid:Sfi,notification_bot:Efi,invoice_number_placeholder:xfi,entity_number_placeholder:kfi,email_link_not_working:Tfi,display_log:Ifi,send_fail_logs_to_our_server:Lfi,setup:Dfi,quick_overview_statistics:Afi,update_your_personal_info:Rfi,name_website_logo:Nfi,make_sure_use_full_link:Ofi,personal_address:Pfi,enter_your_personal_address:Mfi,enter_your_shipping_address:Ffi,list_of_invoices:Bfi,with_selected:$fi,invoice_still_unpaid:Vfi,list_of_recurring_invoices:Hfi,details_of_recurring_invoice:Wfi,cancellation:zfi,about_cancellation:jfi,cancellation_warning:Ufi,cancellation_pending:qfi,list_of_payments:Kfi,payment_details:Gfi,list_of_payment_invoices:Yfi,list_of_payment_methods:Qfi,payment_method_details:Xfi,permanently_remove_payment_method:Zfi,warning_action_cannot_be_reversed:Jfi,confirmation:egi,list_of_quotes:tgi,waiting_for_approval:ngi,quote_still_not_approved:igi,list_of_credits:rgi,required_extensions:ogi,php_version:sgi,writable_env_file:agi,env_not_writable:lgi,minumum_php_version:cgi,satisfy_requirements:ugi,oops_issues:dgi,open_in_new_tab:hgi,complete_your_payment:fgi,authorize_for_future_use:ggi,page:pgi,per_page:mgi,of:_gi,view_credit:vgi,to_view_entity_password:bgi,showing_x_of:ygi,no_results:Cgi,payment_failed_subject:wgi,payment_failed_body:Sgi,register:Egi,register_label:xgi,password_confirmation:kgi,verification:Tgi,complete_your_bank_account_verification:Igi,checkout_com:Lgi,footer_label:Dgi,credit_card_invalid:Agi,month_invalid:Rgi,year_invalid:Ngi,https_required:Ogi,if_you_need_help:Pgi,update_password_on_confirm:Mgi,bank_account_not_linked:Fgi,application_settings_label:Bgi,recommended_in_production:$gi,enable_only_for_development:Vgi,test_pdf:Hgi,checkout_authorize_label:Wgi,sofort_authorize_label:zgi,node_status:jgi,npm_status:Ugi,node_status_not_found:qgi,npm_status_not_found:Kgi,locked_invoice:Ggi,downloads:Ygi,resource:Qgi,document_details:Xgi,hash:Zgi,resources:Jgi,allowed_file_types:epi,common_codes:tpi,payment_error_code_20087:npi,download_selected:ipi,to_pay_invoices:rpi,add_payment_method_first:opi,no_items_selected:spi,payment_due:api,account_balance:lpi,thanks:cpi,minimum_required_payment:upi,under_payments_disabled:dpi,over_payments_disabled:hpi,saved_at:fpi,credit_payment:gpi,credit_subject:ppi,credit_message:mpi,payment_type_Crypto:_pi,payment_type_Credit:vpi,store_for_future_use:bpi,pay_with_credit:ypi,payment_method_saving_failed:Cpi,pay_with:wpi,"n/a":"N/A",by_clicking_next_you_accept_terms:Spi,not_specified:Epi,before_proceeding_with_payment_warning:xpi,after_completing_go_back_to_previous_page:kpi,pay:Tpi,instructions:Ipi,notification_invoice_reminder1_sent_subject:Lpi,notification_invoice_reminder2_sent_subject:Dpi,notification_invoice_reminder3_sent_subject:Api,notification_invoice_custom_sent_subject:Rpi,notification_invoice_reminder_endless_sent_subject:Npi,assigned_user:Opi,setup_steps_notice:Ppi,setup_phantomjs_note:Mpi,minimum_payment:Fpi,no_action_provided:Bpi,no_payable_invoices_selected:$pi,required_payment_information:Vpi,required_payment_information_more:Hpi,required_client_info_save_label:Wpi,notification_credit_bounced:zpi,notification_credit_bounced_subject:jpi,save_payment_method_details:Upi,new_card:qpi,new_bank_account:Kpi,company_limit_reached:Gpi,credits_applied_validation:Ypi,credit_number_taken:Qpi,credit_not_found:Xpi,invoices_dont_match_client:Zpi,duplicate_credits_submitted:Jpi,duplicate_invoices_submitted:emi,credit_with_no_invoice:tmi,client_id_required:nmi,expense_number_taken:imi,invoice_number_taken:rmi,payment_id_required:omi,unable_to_retrieve_payment:smi,invoice_not_related_to_payment:ami,credit_not_related_to_payment:lmi,max_refundable_invoice:cmi,refund_without_invoices:umi,refund_without_credits:dmi,max_refundable_credit:hmi,project_client_do_not_match:fmi,quote_number_taken:gmi,recurring_invoice_number_taken:pmi,user_not_associated_with_account:mmi,amounts_do_not_balance:_mi,insufficient_applied_amount_remaining:vmi,insufficient_credit_balance:bmi,one_or_more_invoices_paid:ymi,invoice_cannot_be_refunded:Cmi,attempted_refund_failed:wmi,user_not_associated_with_this_account:Smi,migration_completed:Emi,migration_completed_description:xmi,api_404:kmi,large_account_update_parameter:Tmi,no_backup_exists:Imi,company_user_not_found:Lmi,no_credits_found:Dmi,action_unavailable:Ami,no_documents_found:Rmi,no_group_settings_found:Nmi,access_denied:Omi,invoice_cannot_be_marked_paid:Pmi,invoice_license_or_environment:Mmi,route_not_available:Fmi,invalid_design_object:Bmi,quote_not_found:$mi,quote_unapprovable:Vmi,scheduler_has_run:Hmi,scheduler_has_never_run:Wmi,self_update_not_available:zmi,user_detached:jmi,create_webhook_failure:Umi,payment_message_extended:qmi,online_payments_minimum_note:Kmi,payment_token_not_found:Gmi,vendor_address1:Ymi,vendor_address2:Qmi,partially_unapplied:Xmi,select_a_gmail_user:Zmi,list_long_press:Jmi,show_actions:e_i,start_multiselect:t_i,email_sent_to_confirm_email:n_i,converted_paid_to_date:i_i,converted_credit_balance:r_i,converted_total:o_i,reply_to_name:s_i,"payment_status_-2":"Partially Unapplied",color_theme:a_i,start_migration:l_i,recurring_cancellation_request:c_i,recurring_cancellation_request_body:u_i,hello:d_i,group_documents:h_i,quote_approval_confirmation_label:f_i,migration_select_company_label:g_i,force_migration:p_i,require_password_with_social_login:m_i,stay_logged_in:__i,session_about_to_expire:v_i,count_hours:b_i,count_day:y_i,count_days:C_i,web_session_timeout:w_i,security_settings:S_i,resend_email:E_i,confirm_your_email_address:x_i,freshbooks:k_i,invoice2go:T_i,invoicely:I_i,waveaccounting:L_i,zoho:D_i,accounting:A_i,required_files_missing:R_i,migration_auth_label:N_i,api_secret:O_i,migration_api_secret_notice:P_i,billing_coupon_notice:M_i,use_last_email:F_i,activate_company:B_i,activate_company_help:$_i,an_error_occurred_try_again:V_i,please_first_set_a_password:H_i,changing_phone_disables_two_factor:W_i,help_translate:z_i,please_select_a_country:j_i,disabled_two_factor:U_i,connected_google:q_i,disconnected_google:K_i,delivered:G_i,spam:Y_i,view_docs:Q_i,enter_phone_to_enable_two_factor:X_i,send_sms:Z_i,sms_code:J_i,connect_google:evi,disconnect_google:tvi,disable_two_factor:nvi,invoice_task_datelog:ivi,invoice_task_datelog_help:rvi,promo_code:ovi,recurring_invoice_issued_to:svi,subscription:avi,new_subscription:lvi,deleted_subscription:cvi,removed_subscription:uvi,restored_subscription:dvi,search_subscription:hvi,search_subscriptions:fvi,subdomain_is_not_available:gvi,connect_gmail:pvi,disconnect_gmail:mvi,connected_gmail:_vi,disconnected_gmail:vvi,update_fail_help:bvi,client_id_number:yvi,count_minutes:Cvi,password_timeout:wvi,shared_invoice_credit_counter:Svi,activity_80:Evi,activity_81:xvi,activity_82:kvi,activity_83:Tvi,activity_84:Ivi,amount_greater_than_balance_v5:Lvi,click_to_continue:Dvi,notification_invoice_created_body:Avi,notification_invoice_created_subject:Rvi,notification_quote_created_body:Nvi,notification_quote_created_subject:Ovi,notification_credit_created_body:Pvi,notification_credit_created_subject:Mvi,max_companies:Fvi,max_companies_desc:Bvi,migration_already_completed:$vi,migration_already_completed_desc:Vvi,payment_method_cannot_be_authorized_first:Hvi,new_account:Wvi,activity_100:zvi,activity_101:jvi,activity_102:Uvi,activity_103:qvi,activity_104:Kvi,new_login_detected:Gvi,new_login_description:Yvi,contact_details:Qvi,download_backup_subject:Xvi,account_passwordless_login:Zvi,user_duplicate_error:Jvi,user_cross_linked_error:ebi,ach_verification_notification_label:tbi,ach_verification_notification:nbi,login_link_requested_label:ibi,login_link_requested:rbi,invoices_backup_subject:obi,migration_failed_label:sbi,migration_failed:abi,client_email_company_contact_label:lbi,quote_was_approved_label:cbi,quote_was_approved:ubi,company_import_failure_subject:dbi,company_import_failure_body:hbi,recurring_invoice_due_date:fbi,amount_cents:gbi,default_payment_method_label:pbi,default_payment_method:mbi,already_default_payment_method:_bi,auto_bill_disabled:vbi,select_payment_method:bbi,login_without_password:ybi,email_sent:Cbi,one_time_purchases:wbi,recurring_purchases:Sbi,you_might_be_interested_in_following:Ebi,quotes_with_status_sent_can_be_approved:xbi,no_quotes_available_for_download:kbi,copyright:Tbi,user_created_user:Ibi,company_deleted:Lbi,company_deleted_body:Dbi,back_to:Abi,stripe_connect_migration_title:Rbi,stripe_connect_migration_desc:Nbi,email_quota_exceeded_subject:Obi,email_quota_exceeded_body:Pbi,auto_bill_option:Mbi,lang_Arabic:Fbi,lang_Persian:Bbi,lang_Latvian:$bi,expiry_date:Vbi,cardholder_name:Hbi,recurring_quote_number_taken:Wbi,account_type:zbi,locality:jbi,checking:Ubi,savings:qbi,unable_to_verify_payment_method:Kbi,generic_gateway_error:Gbi,my_documents:Ybi,payment_method_cannot_be_preauthorized:Qbi,kbc_cbc:Xbi,bancontact:Zbi,sepa_mandat:Jbi,ideal:eyi,bank_account_holder:tyi,aio_checkout:nyi,przelewy24:iyi,przelewy24_accept:ryi,giropay:oyi,giropay_law:syi,klarna:ayi,eps:lyi,becs:cyi,bacs:uyi,payment_type_BACS:dyi,missing_payment_method:hyi,becs_mandate:fyi,you_need_to_accept_the_terms_before_proceeding:gyi,direct_debit:pyi,clone_to_expense:myi,checkout:_yi,acss:vyi,invalid_amount:byi,client_payment_failure_body:yyi,browser_pay:Cyi,no_available_methods:wyi,gocardless_mandate_not_ready:Syi,payment_type_instant_bank_pay:Eyi,payment_type_iDEAL:xyi,payment_type_Przelewy24:kyi,"payment_type_Mollie Bank Transfer":"Mollie Bank Transfer","payment_type_KBC/CBC":"KBC/CBC","payment_type_Instant Bank Pay":"Instant Bank Pay","payment_type_Hosted Page":"Hosted Page",payment_type_GiroPay:Tyi,payment_type_EPS:Iyi,"payment_type_Direct Debit":"Direct Debit",payment_type_Bancontact:Lyi,payment_type_BECS:Dyi,payment_type_ACSS:Ayi,gross_line_total:Ryi,lang_Slovak:Nyi,normal:Oyi,large:Pyi,extra_large:Myi,show_pdf_preview:Fyi,show_pdf_preview_help:Byi,print_pdf:$yi,remind_me:Vyi,instant_bank_pay:Hyi,click_selected:Wyi,hide_preview:zyi,edit_record:jyi,credit_is_more_than_invoice:Uyi,please_set_a_password:qyi,recommend_desktop:Kyi,recommend_mobile:Gyi,disconnected_gateway:Yyi,disconnect:Qyi,add_to_invoices:Xyi,bulk_download:Zyi,persist_data_help:Jyi,persist_ui:e0i,persist_ui_help:t0i,client_postal_code:n0i,client_vat_number:i0i,has_tasks:r0i,registration:o0i,unauthorized_stripe_warning:s0i,update_all_records:a0i,set_default_company:l0i,updated_company:c0i,kbc:u0i,why_are_you_leaving:d0i,webhook_success:h0i,error_cross_client_tasks:f0i,error_cross_client_expenses:g0i,app:p0i,for_best_performance:m0i,bulk_email_invoice:_0i,bulk_email_quote:v0i,bulk_email_credit:b0i,removed_recurring_expense:y0i,search_recurring_expense:C0i,search_recurring_expenses:w0i,last_sent_date:S0i,include_drafts:E0i,include_drafts_help:x0i,is_invoiced:k0i,change_plan:T0i,persist_data:I0i,customer_count:L0i,verify_customers:D0i,google_analytics_tracking_id:A0i,decimal_comma:R0i,use_comma_as_decimal_place:N0i,select_method:O0i,select_platform:P0i,use_web_app_to_connect_gmail:M0i,expense_tax_help:F0i,enable_markdown:B0i,enable_markdown_help:$0i,add_second_contact:V0i,previous_page:H0i,next_page:W0i,export_colors:z0i,import_colors:j0i,clear_all:U0i,contrast:q0i,custom_colors:K0i,colors:G0i,sidebar_active_background_color:Y0i,sidebar_active_font_color:Q0i,sidebar_inactive_background_color:X0i,sidebar_inactive_font_color:Z0i,table_alternate_row_background_color:J0i,invoice_header_background_color:e1i,invoice_header_font_color:t1i,review_app:n1i,check_status:i1i,free_trial:r1i,free_trial_help:o1i,free_trial_ends_in_days:s1i,free_trial_ends_today:a1i,change_email:l1i,client_portal_domain_hint:c1i,tasks_shown_in_portal:u1i,uninvoiced:d1i,subdomain_guide:h1i,send_time:f1i,import_settings:g1i,json_file_missing:p1i,json_option_missing:m1i,json:_1i,no_payment_types_enabled:v1i,wait_for_data:b1i,net_total:y1i,has_taxes:C1i,import_customers:w1i,imported_customers:S1i,login_success:E1i,login_failure:x1i,exported_data:k1i,include_deleted_clients:T1i,include_deleted_clients_help:I1i,step_1_sign_in:L1i,step_2_authorize:D1i,account_id:A1i,migration_not_yet_completed:R1i,show_task_end_date:N1i,show_task_end_date_help:O1i,gateway_setup:P1i,preview_sidebar:M1i,years_data_shown:F1i,ended_all_sessions:B1i,end_all_sessions:$1i,count_session:V1i,count_sessions:H1i,invoice_created:W1i,quote_created:z1i,credit_created:j1i,enterprise:U1i,invoice_item:q1i,quote_item:K1i,order:G1i,search_kanban:Y1i,search_kanbans:Q1i,move_top:X1i,move_up:Z1i,move_down:J1i,move_bottom:eCi,body_variable_missing:tCi,add_body_variable_message:nCi,view_date_formats:iCi,is_viewed:rCi,letter:oCi,legal:sCi,page_layout:aCi,portrait:lCi,landscape:cCi,owner_upgrade_to_paid_plan:uCi,upgrade_to_paid_plan:dCi,invoice_payment_terms:hCi,quote_valid_until:fCi,no_headers:gCi,add_header:pCi,remove_header:mCi,return_url:_Ci,rest_method:vCi,header_key:bCi,header_value:yCi,recurring_products:CCi,promo_discount:wCi,allow_cancellation:SCi,per_seat_enabled:ECi,max_seats_limit:xCi,trial_enabled:kCi,trial_duration:TCi,allow_query_overrides:ICi,allow_plan_changes:LCi,plan_map:DCi,refund_period:ACi,webhook_configuration:RCi,purchase_page:NCi,email_bounced:OCi,email_spam_complaint:PCi,email_delivery:MCi,webhook_response:FCi,pdf_response:BCi,authentication_failure:$Ci,pdf_failed:VCi,pdf_success:HCi,modified:WCi,html_mode:zCi,html_mode_help:jCi,status_color_theme:UCi,load_color_theme:qCi,lang_Estonian:KCi,marked_credit_as_paid:GCi,marked_credits_as_paid:YCi,wait_for_loading:QCi,wait_for_saving:XCi,html_preview_warning:ZCi,remaining:JCi,invoice_paid:ewi,activity_120:twi,activity_121:nwi,activity_122:iwi,activity_123:rwi,activity_124:owi,fpx:swi,to_view_entity_set_password:awi,unsubscribe:lwi,unsubscribed:cwi,unsubscribed_text:uwi,client_shipping_state:dwi,client_shipping_city:hwi,client_shipping_postal_code:fwi,client_shipping_country:gwi,load_pdf:pwi,start_free_trial:mwi,start_free_trial_message:_wi,due_on_receipt:vwi,is_paid:bwi,age_group_paid:ywi,id:Cwi,convert_to:wwi,client_currency:Swi,company_currency:Ewi,custom_emails_disabled_help:xwi,upgrade_to_add_company:kwi,file_saved_in_downloads_folder:Twi,small:Iwi,quotes_backup_subject:Lwi,credits_backup_subject:Dwi,document_download_subject:Awi,reminder_message:Rwi,gmail_credentials_invalid_subject:Nwi,gmail_credentials_invalid_body:Owi,total_columns:Pwi,view_task:Mwi,cancel_invoice:Fwi,changed_status:Bwi,change_status:$wi,enable_touch_events:Vwi,enable_touch_events_help:Hwi,after_saving:Wwi,view_record:zwi,enable_email_markdown:jwi,enable_email_markdown_help:Uwi,enable_pdf_markdown:qwi,json_help:Kwi,release_notes:Gwi,upgrade_to_view_reports:Ywi,started_tasks:Qwi,stopped_tasks:Xwi,approved_quote:Zwi,approved_quotes:Jwi,client_website:eSi,invalid_time:tSi,signed_in_as:nSi,total_results:iSi,restore_company_gateway:rSi,archive_company_gateway:oSi,delete_company_gateway:sSi,exchange_currency:aSi,tax_amount1:lSi,tax_amount2:cSi,tax_amount3:uSi,update_project:dSi,auto_archive_invoice_cancelled:hSi,auto_archive_invoice_cancelled_help:fSi,no_invoices_found:gSi,created_record:pSi,auto_archive_paid_invoices:mSi,auto_archive_paid_invoices_help:_Si,auto_archive_cancelled_invoices:vSi,auto_archive_cancelled_invoices_help:bSi,alternate_pdf_viewer:ySi,alternate_pdf_viewer_help:CSi,currency_cayman_island_dollar:wSi,download_report_description:SSi,left:ESi,right:xSi,center:kSi,page_numbering:TSi,page_numbering_alignment:ISi,invoice_sent_notification_label:LSi,show_product_description:DSi,show_product_description_help:ASi,invoice_items:RSi,quote_items:NSi,profitloss:OSi,import_format:PSi,export_format:MSi,export_type:FSi,stop_on_unpaid:BSi,stop_on_unpaid_help:$Si,use_quote_terms:VSi,use_quote_terms_help:HSi,add_country:WSi,enable_tooltips:zSi,enable_tooltips_help:jSi,multiple_client_error:USi,login_label:qSi,purchase_order:KSi,purchase_order_number:GSi,purchase_order_number_short:YSi,inventory_notification_subject:QSi,inventory_notification_body:XSi,activity_130:ZSi,activity_131:JSi,activity_132:eEi,activity_133:tEi,activity_134:nEi,activity_135:iEi,activity_136:rEi,purchase_order_subject:oEi,purchase_order_message:sEi,view_purchase_order:aEi,purchase_orders_backup_subject:lEi,notification_purchase_order_viewed_subject:cEi,notification_purchase_order_viewed:uEi,purchase_order_date:dEi,purchase_orders:hEi,purchase_order_number_placeholder:fEi,accepted:gEi,activity_137:pEi,vendor_information:mEi,notification_purchase_order_accepted_subject:_Ei,notification_purchase_order_accepted:vEi,amount_received:bEi,purchase_order_already_expensed:yEi,convert_to_expense:CEi,add_to_inventory:wEi,added_purchase_order_to_inventory:SEi,added_purchase_orders_to_inventory:EEi,client_document_upload:xEi,vendor_document_upload:kEi,vendor_document_upload_help:TEi,are_you_enjoying_the_app:IEi,yes_its_great:LEi,not_so_much:DEi,would_you_rate_it:AEi,would_you_tell_us_more:REi,sure_happy_to:NEi,no_not_now:OEi,add:PEi,last_sent_template:MEi,enable_flexible_search:FEi,enable_flexible_search_help:BEi,vendor_details:$Ei,purchase_order_details:VEi,qr_iban:HEi,besr_id:WEi,clone_to_purchase_order:zEi,vendor_email_not_set:jEi,bulk_send_email:UEi,marked_purchase_order_as_sent:qEi,marked_purchase_orders_as_sent:KEi,accepted_purchase_order:GEi,accepted_purchase_orders:YEi,cancelled_purchase_order:QEi,cancelled_purchase_orders:XEi,please_select_a_vendor:ZEi,purchase_order_total:JEi,email_purchase_order:exi,bulk_email_purchase_order:txi,disconnected_email:nxi,connect_email:ixi,disconnect_email:rxi,use_web_app_to_connect_microsoft:oxi,email_provider:sxi,connect_microsoft:axi,disconnect_microsoft:lxi,connected_microsoft:cxi,disconnected_microsoft:uxi,microsoft_sign_in:dxi,microsoft_sign_up:hxi,emailed_purchase_order:fxi,emailed_purchase_orders:gxi,enable_react_app:pxi,purchase_order_design:mxi,purchase_order_terms:_xi,purchase_order_footer:vxi,require_purchase_order_signature:bxi,require_purchase_order_signature_help:yxi,new_purchase_order:Cxi,edit_purchase_order:wxi,created_purchase_order:Sxi,updated_purchase_order:Exi,archived_purchase_order:xxi,deleted_purchase_order:kxi,removed_purchase_order:Txi,restored_purchase_order:Ixi,search_purchase_order:Lxi,search_purchase_orders:Dxi,login_url:Axi,enable_applying_payments:Rxi,enable_applying_payments_help:Nxi,stock_quantity:Oxi,notification_threshold:Pxi,track_inventory:Mxi,track_inventory_help:Fxi,stock_notifications:Bxi,stock_notifications_help:$xi,vat:Vxi,view_map:Hxi,set_default_design:Wxi,purchase_order_issued_to:zxi,archive_task_status:jxi,delete_task_status:Uxi,restore_task_status:qxi,lang_Hebrew:Kxi,price_change_accepted:Gxi,price_change_failed:Yxi,restore_purchases:Qxi,activate:Xxi,connect_apple:Zxi,disconnect_apple:Jxi,disconnected_apple:eki,send_now:tki,received:nki,converted_to_expense:iki,converted_to_expenses:rki,entity_removed:oki,entity_removed_title:ski,field:aki,period:lki,fields_per_row:cki,total_active_invoices:uki,total_outstanding_invoices:dki,total_completed_payments:hki,total_refunded_payments:fki,total_active_quotes:gki,total_approved_quotes:pki,total_unapproved_quotes:mki,total_logged_tasks:_ki,total_invoiced_tasks:vki,total_paid_tasks:bki,total_logged_expenses:yki,total_pending_expenses:Cki,total_invoiced_expenses:wki,total_invoice_paid_expenses:Ski,vendor_portal:Eki,send_code:xki,save_to_upload_documents:kki,expense_tax_rates:Tki,invoice_item_tax_rates:Iki,verified_phone_number:Lki,code_was_sent:Dki,resend:Aki,verify:Rki,enter_phone_number:Nki,invalid_phone_number:Oki,verify_phone_number:Pki,verify_phone_number_help:Mki,merged_clients:Fki,merge_into:Bki,php81_required:$ki,bulk_email_purchase_orders:Vki,bulk_email_invoices:Hki,bulk_email_quotes:Wki,bulk_email_credits:zki,archive_purchase_order:jki,restore_purchase_order:Uki,delete_purchase_order:qki,connect:Kki,mark_paid_payment_email:Gki,convert_to_project:Yki,client_email:Qki,invoice_task_project:Xki,invoice_task_project_help:Zki,bulk_action:Jki,phone_validation_error:eTi,transaction:tTi,disable_2fa:nTi,change_number:iTi,resend_code:rTi,base_type:oTi,category_type:sTi,bank_transaction:aTi,bulk_print:lTi,vendor_postal_code:cTi,preview_location:uTi,bottom:dTi,side:hTi,pdf_preview:fTi,long_press_to_select:gTi,purchase_order_item:pTi,would_you_rate_the_app:mTi,include_deleted:_Ti,include_deleted_help:vTi,due_on:bTi,browser_pdf_viewer:yTi,browser_pdf_viewer_help:CTi,converted_transactions:wTi,default_category:STi,connect_accounts:ETi,manage_rules:xTi,search_category:kTi,search_categories:TTi,min_amount:ITi,max_amount:LTi,converted_transaction:DTi,convert_to_payment:ATi,deposit:RTi,withdrawal:NTi,deposits:OTi,withdrawals:PTi,matched:MTi,unmatched:FTi,create_credit:BTi,transactions:$Ti,new_transaction:VTi,edit_transaction:HTi,created_transaction:WTi,updated_transaction:zTi,archived_transaction:jTi,deleted_transaction:UTi,removed_transaction:qTi,restored_transaction:KTi,search_transaction:GTi,search_transactions:YTi,deleted_bank_account:QTi,removed_bank_account:XTi,restored_bank_account:ZTi,search_bank_account:JTi,search_bank_accounts:eIi,code_was_sent_to:tIi,verify_phone_number_2fa_help:nIi,enable_applying_payments_later:iIi,line_item_tax_rates:rIi,show_tasks_in_client_portal:oIi,notification_quote_expired_subject:sIi,notification_quote_expired:aIi,auto_sync:lIi,refresh_accounts:cIi,upgrade_to_connect_bank_account:uIi,click_here_to_connect_bank_account:dIi,include_tax:hIi,email_template_change:fIi,task_update_authorization_error:gIi,cash_vs_accrual:pIi,cash_vs_accrual_help:mIi,expense_paid_report:_Ii,expense_paid_report_help:vIi,online_payment_email_help:bIi,manual_payment_email_help:yIi,mark_paid_payment_email_help:CIi,linked_transaction:wIi,link_payment:SIi,link_expense:EIi,lock_invoiced_tasks:xIi,lock_invoiced_tasks_help:kIi,registration_required_help:TIi,use_inventory_management:IIi,use_inventory_management_help:LIi,optional_products:DIi,optional_recurring_products:AIi,convert_matched:RIi,auto_billed_invoice:NIi,auto_billed_invoices:OIi,operator:PIi,value:MIi,is:FIi,contains:BIi,starts_with:$Ii,is_empty:VIi,add_rule:HIi,match_all_rules:WIi,match_all_rules_help:zIi,auto_convert_help:jIi,rules:UIi,transaction_rule:qIi,transaction_rules:KIi,new_transaction_rule:GIi,edit_transaction_rule:YIi,created_transaction_rule:QIi,updated_transaction_rule:XIi,archived_transaction_rule:ZIi,deleted_transaction_rule:JIi,removed_transaction_rule:eLi,restored_transaction_rule:tLi,search_transaction_rule:nLi,search_transaction_rules:iLi,"payment_type_Interac E-Transfer":"Interac E-Transfer",delete_bank_account:rLi,archive_transaction:oLi,delete_transaction:sLi,otp_code_message:aLi,otp_code_subject:lLi,otp_code_body:cLi,delete_tax_rate:uLi,restore_tax_rate:dLi,company_backup_file:hLi,company_backup_file_help:fLi,backup_restore:gLi,export_company:pLi,backup:mLi,notification_purchase_order_created_body:_Li,notification_purchase_order_created_subject:vLi,notification_purchase_order_sent_subject:bLi,notification_purchase_order_sent:yLi,subscription_blocked:CLi,subscription_blocked_title:wLi,purchase_order_created:SLi,purchase_order_sent:ELi,purchase_order_viewed:xLi,purchase_order_accepted:kLi,credit_payment_error:TLi,convert_payment_currency_help:ILi,convert_expense_currency_help:LLi,matomo_url:DLi,matomo_id:ALi,action_add_to_invoice:RLi,danger_zone:NLi,import_completed:OLi,client_statement_body:PLi,email_queued:MLi,clone_to_recurring_invoice:FLi,inventory_threshold:BLi,emailed_statement:$Li,show_email_footer:VLi,invoice_task_hours:HLi,invoice_task_hours_help:WLi,auto_bill_standard_invoices:zLi,auto_bill_recurring_invoices:jLi,email_alignment:ULi,pdf_preview_location:qLi,mailgun:KLi,brevo:GLi,postmark:YLi,microsoft:QLi,click_plus_to_create_record:XLi,last365_days:ZLi,import_design:JLi,imported_design:eDi,invalid_design:tDi,setup_wizard_logo:nDi,installed_version:iDi,notify_vendor_when_paid:rDi,notify_vendor_when_paid_help:oDi,update_payment:sDi,markup:aDi,unlock_pro:lDi,upgrade_to_paid_plan_to_schedule:cDi,next_run:uDi,all_clients:dDi,show_aging_table:hDi,show_payments_table:fDi,only_clients_with_invoices:gDi,email_statement:pDi,once:mDi,schedules:_Di,new_schedule:vDi,edit_schedule:bDi,created_schedule:yDi,updated_schedule:CDi,archived_schedule:wDi,deleted_schedule:SDi,removed_schedule:EDi,restored_schedule:xDi,search_schedule:kDi,search_schedules:TDi,update_product:IDi,create_purchase_order:LDi,update_purchase_order:DDi,sent_invoice:ADi,sent_quote:RDi,sent_credit:NDi,sent_purchase_order:ODi,image_url:PDi,max_quantity:MDi,test_url:FDi,auto_bill_help_off:BDi,auto_bill_help_optin:$Di,auto_bill_help_optout:VDi,auto_bill_help_always:HDi,view_all:WDi,edit_all:zDi,accept_purchase_order_number:jDi,accept_purchase_order_number_help:UDi,from_email:qDi,show_preview:KDi,show_paid_stamp:GDi,show_shipping_address:YDi,no_documents_to_download:QDi,pixels:XDi,logo_size:ZDi,failed:JDi,client_contacts:e2i,sync_from:t2i,gateway_payment_text:n2i,gateway_payment_text_no_invoice:i2i,click_to_variables:r2i,ship_to:o2i,stripe_direct_debit_details:s2i,branch_name:a2i,branch_code:l2i,bank_name:c2i,bank_code:u2i,bic:d2i,change_plan_description:h2i,add_company_logo:f2i,add_stripe:g2i,invalid_coupon:p2i,no_assigned_tasks:m2i,authorization_failure:_2i,authorization_sms_failure:v2i,white_label_body:b2i,payment_type_Klarna:y2i,"payment_type_Interac E Transfer":"Interac E Transfer",xinvoice_payable:C2i,xinvoice_no_buyers_reference:w2i,xinvoice_online_payment:S2i,pre_payment:E2i,number_of_payments:x2i,number_of_payments_helper:k2i,pre_payment_indefinitely:T2i,notification_payment_emailed:I2i,notification_payment_emailed_subject:L2i,record_not_found:D2i,minimum_payment_amount:A2i,client_initiated_payments:R2i,client_initiated_payments_help:N2i,share_invoice_quote_columns:O2i,cc_email:P2i,payment_balance:M2i,view_report_permission:F2i,activity_138:B2i,one_time_products:$2i,optional_one_time_products:V2i,required:H2i,hidden:W2i,payment_links:z2i,payment_link:j2i,new_payment_link:U2i,edit_payment_link:q2i,created_payment_link:K2i,updated_payment_link:G2i,archived_payment_link:Y2i,deleted_payment_link:Q2i,removed_payment_link:X2i,restored_payment_link:Z2i,search_payment_link:J2i,search_payment_links:eAi,increase_prices:tAi,update_prices:nAi,incresed_prices:iAi,updated_prices:rAi,api_token:oAi,api_key:sAi,endpoint:aAi,not_billable:lAi,allow_billable_task_items:cAi,allow_billable_task_items_help:uAi,show_task_item_description:dAi,show_task_item_description_help:hAi,email_record:fAi,invoice_product_columns:gAi,quote_product_columns:pAi,vendors:mAi,product_sales:_Ai,user_sales_report_header:vAi,client_balance_report:bAi,client_sales_report:yAi,user_sales_report:CAi,aged_receivable_detailed_report:wAi,aged_receivable_summary_report:SAi,taxable_amount:EAi,tax_summary:xAi,oauth_mail:kAi,preferences:TAi,analytics:IAi,reduced_rate:LAi,tax_all:DAi,tax_selected:AAi,version:RAi,seller_subregion:NAi,calculate_taxes:OAi,calculate_taxes_help:PAi,link_expenses:MAi,converted_client_balance:FAi,converted_payment_balance:BAi,total_hours:$Ai,date_picker_hint:VAi,app_help_link:HAi,here:WAi,"industry_Restaurant & Catering":"Restaurant & Catering",show_credits_table:zAi,manual_payment:jAi,tax_summary_report:UAi,tax_category:qAi,physical_goods:KAi,digital_products:GAi,services:YAi,shipping:QAi,tax_exempt:XAi,late_fee_added_locked_invoice:ZAi,lang_Khmer:JAi,routing_id:eRi,enable_e_invoice:tRi,e_invoice_type:nRi,reduced_tax:iRi,override_tax:rRi,zero_rated:oRi,reverse_tax:sRi,updated_tax_category:aRi,updated_tax_categories:lRi,set_tax_category:cRi,payment_manual:uRi,expense_payment_type:dRi,"payment_type_Cash App":"Cash App",rename:hRi,renamed_document:fRi,e_invoice:gRi,light_dark_mode:pRi,activities:mRi,recent_transactions:_Ri,country_Palestine:vRi,country_Taiwan:bRi,duties:yRi,order_number:CRi,order_id:wRi,total_invoices_outstanding:SRi,recent_activity:ERi,enable_auto_bill:xRi,email_count_invoices:kRi,invoice_task_item_description:TRi,invoice_task_item_description_help:IRi,next_send_time:LRi,uploaded_certificate:DRi,certificate_set:ARi,certificate_not_set:RRi,passphrase_set:NRi,passphrase_not_set:ORi,upload_certificate:PRi,certificate_passphrase:MRi,valid_vat_number:FRi,react_notification_link:BRi,react_notification_link_help:$Ri,show_task_billable:VRi,credit_item:HRi,drop_file_here:WRi,files:zRi,camera:jRi,gallery:URi,project_location:qRi,add_gateway_help_message:KRi,lang_Hungarian:GRi,use_mobile_to_manage_plan:YRi,item_tax3:QRi,item_tax_rate1:XRi,item_tax_rate2:ZRi,item_tax_rate3:JRi,buy_price:eNi,country_Macedonia:tNi,admin_initiated_payments:nNi,admin_initiated_payments_help:iNi,paid_date:rNi,downloaded_entities:oNi,"lang_French - Swiss":"French - Swiss",currency_swazi_lilangeni:sNi,income:aNi,amount_received_help:lNi,vendor_phone:cNi,mercado_pago:uNi,mybank:dNi,paypal_paylater:hNi,district:fNi,region:gNi,county:pNi,tax_details:mNi,activity_10_online:_Ni,activity_10_manual:vNi,default_payment_type:bNi,number_precision:yNi,number_precision_help:CNi,is_tax_exempt:wNi,drop_files_here:SNi,upload_files:ENi,download_e_invoice:xNi,download_e_credit:kNi,download_e_quote:TNi,triangular_tax_info:INi,intracommunity_tax_info:LNi,reverse_tax_info:DNi,currency_nicaraguan_cordoba:ANi,public:"Public",private:"Private",image:RNi,other:NNi,linked_to:ONi,file_saved_in_path:PNi,unlinked_transactions:MNi,unlinked_transaction:FNi,view_dashboard_permission:BNi,marked_sent_credits:$Ni,show_document_preview:VNi,cash_accounting:HNi,click_or_drop_files_here:WNi,set_public:zNi,set_private:jNi,individual:UNi,business:qNi,partnership:KNi,trust:GNi,charity:YNi,government:QNi,in_stock_quantity:XNi,vendor_contact:ZNi,expense_status_4:JNi,expense_status_5:eOi,ziptax_help:tOi,cache_data:nOi,unknown:iOi,webhook_failure:rOi,email_opened:oOi,email_delivered:sOi,log:aOi,classification:lOi,stock_quantity_number:cOi,upcoming:uOi,client_contact:dOi,uncategorized:hOi,login_notification:fOi,login_notification_help:gOi,payment_refund_receipt:pOi,payment_receipt:mOi,load_template_description:_Oi,run_template:vOi,statement_design:bOi,delivery_note_design:yOi,payment_receipt_design:COi,payment_refund_design:wOi,task_extension_banner:SOi,watch_video:EOi,view_extension:xOi,reactivate_email:kOi,email_reactivated:TOi,template_help:IOi,quarter:LOi,item_description:DOi,task_item:AOi,record_state:ROi,save_files_to_this_folder:NOi,downloads_folder:OOi,total_invoiced_quotes:POi,total_invoice_paid_quotes:MOi,downloads_folder_does_not_exist:FOi,user_logged_in_notification:BOi,user_logged_in_notification_help:$Oi,payment_email_all_contacts:VOi,payment_email_all_contacts_help:HOi,add_line:WOi,activity_139:zOi,vendor_notification_subject:jOi,vendor_notification_body:UOi,receipt:qOi,charges:KOi,email_report:GOi,"payment_type_Pay Later":"Pay Later",payment_type_credit:YOi,payment_type_debit:QOi,send_emails_to:XOi,primary_contact:ZOi,all_contacts:JOi,insert_below:ePi,nordigen_handler_subtitle:tPi,nordigen_handler_error_heading_unknown:nPi,nordigen_handler_error_contents_unknown:iPi,nordigen_handler_error_heading_token_invalid:rPi,nordigen_handler_error_contents_token_invalid:oPi,nordigen_handler_error_heading_account_config_invalid:sPi,nordigen_handler_error_contents_account_config_invalid:aPi,nordigen_handler_error_heading_not_available:lPi,nordigen_handler_error_contents_not_available:cPi,nordigen_handler_error_heading_institution_invalid:uPi,nordigen_handler_error_contents_institution_invalid:dPi,nordigen_handler_error_heading_ref_invalid:hPi,nordigen_handler_error_contents_ref_invalid:fPi,nordigen_handler_error_heading_not_found:gPi,nordigen_handler_error_contents_not_found:pPi,nordigen_handler_error_heading_requisition_invalid_status:mPi,nordigen_handler_error_contents_requisition_invalid_status:_Pi,nordigen_handler_error_heading_requisition_no_accounts:vPi,nordigen_handler_error_contents_requisition_no_accounts:bPi,nordigen_handler_restart:yPi,nordigen_handler_return:CPi,lang_Lao:wPi,currency_lao_kip:SPi,yodlee_regions:EPi,nordigen_regions:xPi,select_provider:kPi,nordigen_requisition_subject:TPi,nordigen_requisition_body:IPi,participant:LPi,participant_name:DPi,client_unsubscribed:APi,client_unsubscribed_help:RPi,resubscribe:NPi,subscribe:OPi,subscribe_help:PPi,unsubscribe_help:MPi,notification_purchase_order_bounced:FPi,notification_purchase_order_bounced_subject:BPi,show_pdfhtml_on_mobile:$Pi,show_pdfhtml_on_mobile_help:VPi,please_select_an_invoice_or_credit:HPi,mobile_version:WPi,venmo:zPi,my_bank:jPi,pay_later:UPi,local_domain:qPi,verify_peer:KPi,nordigen_help:GPi,ar_detailed:YPi,ar_summary:QPi,client_sales:XPi,user_sales:ZPi,iframe_url:JPi,user_unsubscribed:eMi,out_of_stock:tMi,step_dependency_fail:nMi,step_dependency_order_fail:iMi,step_authentication_fail:rMi,"auth.login":"Login","auth.login-or-register":"Login or Register","auth.register":"Register",cart:oMi,methods:sMi,rff:aMi,add_step:lMi,steps:cMi,steps_order_help:uMi,other_steps:dMi,use_available_payments:hMi,test_email_sent:fMi,gateway_type:gMi,save_template_body:pMi,save_as_template:mMi,checkout_only_for_existing_customers:_Mi,checkout_only_for_new_customers:vMi,auto_bill_standard_invoices_help:bMi,auto_bill_on_help:yMi,use_available_credits_help:CMi,use_unapplied_payments:wMi,use_unapplied_payments_help:SMi,payment_terms_help:EMi,payment_type_help:xMi,quote_valid_until_help:kMi,expense_payment_type_help:TMi,paylater:IMi,payment_provider:LMi,select_email_provider:DMi,purchase_order_items:AMi,csv_rows_length:RMi,accept_payments_online:NMi,all_payment_gateways:OMi,product_cost:PMi,duration_words:MMi,upcoming_recurring_invoices:FMi,shipping_country_id:BMi,show_table_footer:$Mi,show_table_footer_help:VMi,total_invoices:HMi,add_to_group:WMi,check_credentials:zMi,valid_credentials:jMi,e_quote:UMi,e_credit:qMi,e_purchase_order:KMi,e_quote_type:GMi,unlock_unlimited_clients:YMi,download_e_purchase_order:QMi,flutter_web_warning:XMi,rappen_rounding:ZMi,rappen_rounding_help:JMi,assign_group:e4i,paypal_advanced_cards:t4i,local_domain_help:n4i,port_help:i4i,host_help:r4i,always_show_required_fields:o4i,always_show_required_fields_help:s4i,advanced_cards:a4i,activity_140:l4i,invoice_net_amount:c4i,round_to_minutes:u4i,"1_second":"1 Second","1_minute":"1 Minute","5_minutes":"5 Minutes","15_minutes":"15 Minutes","30_minutes":"30 Minutes","1_hour":"1 Hour","1_day":"1 Day",round_tasks:d4i,round_tasks_help:h4i,direction:f4i,round_up:g4i,round_down:p4i,task_round_to_nearest:m4i,task_round_to_nearest_help:_4i,bulk_updated:v4i,bulk_update:b4i,calculate:y4i,sum:C4i,money:w4i,web_app:S4i,desktop_app:E4i,disconnected:x4i,reconnect:k4i,e_invoice_settings:T4i,btcpay_refund_subject:I4i,btcpay_refund_body:L4i,currency_mauritanian_ouguiya:D4i,currency_bhutan_ngultrum:A4i,end_of_month:R4i,merge_e_invoice_to_pdf:N4i,task_assigned_subject:O4i,task_assigned_body:P4i,activity_141:M4i,quote_reminder_subject:F4i,quote_reminder_message:B4i,quote_reminder1:$4i,before_valid_until_date:V4i,after_valid_until_date:H4i,after_quote_date:W4i,remind_quote:z4i,tax_currency_mismatch:j4i,edocument_import_already_exists:U4i,before_valid_until:q4i,after_valid_until:K4i,task_assigned_notification:G4i,task_assigned_notification_help:Y4i,invoices_locked_end_of_month:Q4i,referral_url:X4i,add_comment:Z4i,added_comment:J4i,tickets:e3i,assigned_group:t3i,merge_to_pdf:n3i,latest_requires_php_version:i3i,auto_expand_product_table_notes:r3i,auto_expand_product_table_notes_help:o3i,institution_number:s3i,transit_number:a3i,personal:l3i,address_information:c3i,enter_the_information_for_the_bank_account:u3i,account_holder_information:d3i,enter_information_for_the_account_holder:h3i,customer_type:f3i,process_date:g3i,forever_free:p3i};function _3i({children:n}){return f(_t,{children:n})}function v3i(n){return{all:n=n||new Map,on:function(e,t){var i=n.get(e);i?i.push(t):n.set(e,[t])},off:function(e,t){var i=n.get(e);i&&(t?i.splice(i.indexOf(t)>>>0,1):n.set(e,[]))},emit:function(e,t){var i=n.get(e);i&&i.slice().map(function(r){r(t)}),(i=n.get("*"))&&i.slice().map(function(r){r(e,t)})}}}function b3i(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function YIe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function QIe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?YIe(Object(t),!0).forEach(function(i){b3i(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):YIe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function y3i(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}function C3i(n,e){if(n==null)return{};var t=y3i(n,e),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(r=0;r<o.length;r++)i=o[r],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(t[i]=n[i])}return t}function w3i(n,e){return S3i(n)||E3i(n,e)||x3i(n,e)||k3i()}function S3i(n){if(Array.isArray(n))return n}function E3i(n,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(n)))){var t=[],i=!0,r=!1,o=void 0;try{for(var s=n[Symbol.iterator](),a;!(i=(a=s.next()).done)&&(t.push(a.value),!(e&&t.length===e));i=!0);}catch(l){r=!0,o=l}finally{try{!i&&s.return!=null&&s.return()}finally{if(r)throw o}}return t}}function x3i(n,e){if(n){if(typeof n=="string")return XIe(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return XIe(n,e)}}function XIe(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function k3i(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T3i(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ZIe(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function JIe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ZIe(Object(t),!0).forEach(function(i){T3i(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ZIe(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function I3i(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return function(i){return e.reduceRight(function(r,o){return o(r)},i)}}function SN(n){return function e(){for(var t=this,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return r.length>=n.length?n.apply(this,r):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return e.apply(t,[].concat(r,a))}}}function bV(n){return{}.toString.call(n).includes("Object")}function L3i(n){return!Object.keys(n).length}function fM(n){return typeof n=="function"}function D3i(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function A3i(n,e){return bV(e)||TC("changeType"),Object.keys(e).some(function(t){return!D3i(n,t)})&&TC("changeField"),e}function R3i(n){fM(n)||TC("selectorType")}function N3i(n){fM(n)||bV(n)||TC("handlerType"),bV(n)&&Object.values(n).some(function(e){return!fM(e)})&&TC("handlersType")}function O3i(n){n||TC("initialIsRequired"),bV(n)||TC("initialType"),L3i(n)&&TC("initialContent")}function P3i(n,e){throw new Error(n[e]||n.default)}var M3i={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},TC=SN(P3i)(M3i),dB={changes:A3i,selector:R3i,handler:N3i,initial:O3i};function F3i(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};dB.initial(n),dB.handler(e);var t={current:n},i=SN(V3i)(t,e),r=SN($3i)(t),o=SN(dB.changes)(n),s=SN(B3i)(t);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return dB.selector(c),c(t.current)}function l(c){I3i(i,r,o,s)(c)}return[a,l]}function B3i(n,e){return fM(e)?e(n.current):e}function $3i(n,e){return n.current=JIe(JIe({},n.current),e),e}function V3i(n,e,t){return fM(e)?e(n.current):Object.keys(t).forEach(function(i){var r;return(r=e[i])===null||r===void 0?void 0:r.call(e,n.current[i])}),t}var H3i={create:F3i},W3i={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function z3i(n){return function e(){for(var t=this,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return r.length>=n.length?n.apply(this,r):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return e.apply(t,[].concat(r,a))}}}function j3i(n){return{}.toString.call(n).includes("Object")}function U3i(n){return n||eLe("configIsRequired"),j3i(n)||eLe("configType"),n.urls?(q3i(),{paths:{vs:n.urls.monacoBase}}):n}function q3i(){console.warn(lje.deprecation)}function K3i(n,e){throw new Error(n[e]||n.default)}var lje={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
You are using deprecated way of configuration.
Instead of using
monaco.config({ urls: { monacoBase: '...' } })
use
monaco.config({ paths: { vs: '...' } })
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
`},eLe=z3i(K3i)(lje),G3i={config:U3i},Y3i=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return function(r){return t.reduceRight(function(o,s){return s(o)},r)}};function cje(n,e){return Object.keys(e).forEach(function(t){e[t]instanceof Object&&n[t]&&Object.assign(e[t],cje(n[t],e[t]))}),QIe(QIe({},n),e)}var Q3i={type:"cancelation",msg:"operation is manually canceled"};function HX(n){var e=!1,t=new Promise(function(i,r){n.then(function(o){return e?r(Q3i):i(o)}),n.catch(r)});return t.cancel=function(){return e=!0},t}var X3i=H3i.create({config:W3i,isInitialized:!1,resolve:null,reject:null,monaco:null}),uje=w3i(X3i,2),l5=uje[0],xU=uje[1];function Z3i(n){var e=G3i.config(n),t=e.monaco,i=C3i(e,["monaco"]);xU(function(r){return{config:cje(r.config,i),monaco:t}})}function J3i(){var n=l5(function(e){var t=e.monaco,i=e.isInitialized,r=e.resolve;return{monaco:t,isInitialized:i,resolve:r}});if(!n.isInitialized){if(xU({isInitialized:!0}),n.monaco)return n.resolve(n.monaco),HX(WX);if(window.monaco&&window.monaco.editor)return dje(window.monaco),n.resolve(window.monaco),HX(WX);Y3i(e5i,n5i)(i5i)}return HX(WX)}function e5i(n){return document.body.appendChild(n)}function t5i(n){var e=document.createElement("script");return n&&(e.src=n),e}function n5i(n){var e=l5(function(i){var r=i.config,o=i.reject;return{config:r,reject:o}}),t=t5i("".concat(e.config.paths.vs,"/loader.js"));return t.onload=function(){return n()},t.onerror=e.reject,t}function i5i(){var n=l5(function(t){var i=t.config,r=t.resolve,o=t.reject;return{config:i,resolve:r,reject:o}}),e=window.require;e.config(n.config),e(["vs/editor/editor.main"],function(t){dje(t),n.resolve(t)},function(t){n.reject(t)})}function dje(n){l5().monaco||xU({monaco:n})}function r5i(){return l5(function(n){var e=n.monaco;return e})}var WX=new Promise(function(n,e){return xU({resolve:n,reject:e})}),kU={config:Z3i,init:J3i,__getMonacoInstance:r5i},o5i={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},zX=o5i,s5i={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},a5i=s5i;function l5i({children:n}){return te.createElement("div",{style:a5i.container},n)}var c5i=l5i,u5i=c5i;function d5i({width:n,height:e,isEditorReady:t,loading:i,_ref:r,className:o,wrapperProps:s}){return te.createElement("section",{style:{...zX.wrapper,width:n,height:e},...s},!t&&te.createElement(u5i,null,i),te.createElement("div",{ref:r,style:{...zX.fullWidth,...!t&&zX.hide},className:o}))}var h5i=d5i,hje=w.memo(h5i);function f5i(n){w.useEffect(n,[])}var fje=f5i;function g5i(n,e,t=!0){let i=w.useRef(!0);w.useEffect(i.current||!t?()=>{i.current=!1}:n,e)}var zf=g5i;function DO(){}function AI(n,e,t,i){return p5i(n,i)||m5i(n,e,t,i)}function p5i(n,e){return n.editor.getModel(gje(n,e))}function m5i(n,e,t,i){return n.editor.createModel(e,t,i?gje(n,i):void 0)}function gje(n,e){return n.Uri.parse(e)}function _5i({original:n,modified:e,language:t,originalLanguage:i,modifiedLanguage:r,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:d={},height:h="100%",width:g="100%",className:p,wrapperProps:m={},beforeMount:_=DO,onMount:v=DO}){let[b,y]=w.useState(!1),[C,x]=w.useState(!0),k=w.useRef(null),I=w.useRef(null),L=w.useRef(null),D=w.useRef(v),R=w.useRef(_),P=w.useRef(!1);fje(()=>{let F=kU.init();return F.then(H=>(I.current=H)&&x(!1)).catch(H=>(H==null?void 0:H.type)!=="cancelation"&&console.error("Monaco initialization: error:",H)),()=>k.current?B():F.cancel()}),zf(()=>{if(k.current&&I.current){let F=k.current.getOriginalEditor(),H=AI(I.current,n||"",i||t||"text",o||"");H!==F.getModel()&&F.setModel(H)}},[o],b),zf(()=>{if(k.current&&I.current){let F=k.current.getModifiedEditor(),H=AI(I.current,e||"",r||t||"text",s||"");H!==F.getModel()&&F.setModel(H)}},[s],b),zf(()=>{let F=k.current.getModifiedEditor();F.getOption(I.current.editor.EditorOption.readOnly)?F.setValue(e||""):e!==F.getValue()&&(F.executeEdits("",[{range:F.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),F.pushUndoStop())},[e],b),zf(()=>{var F,H;(H=(F=k.current)==null?void 0:F.getModel())==null||H.original.setValue(n||"")},[n],b),zf(()=>{let{original:F,modified:H}=k.current.getModel();I.current.editor.setModelLanguage(F,i||t||"text"),I.current.editor.setModelLanguage(H,r||t||"text")},[t,i,r],b),zf(()=>{var F;(F=I.current)==null||F.editor.setTheme(c)},[c],b),zf(()=>{var F;(F=k.current)==null||F.updateOptions(d)},[d],b);let M=w.useCallback(()=>{var V;if(!I.current)return;R.current(I.current);let F=AI(I.current,n||"",i||t||"text",o||""),H=AI(I.current,e||"",r||t||"text",s||"");(V=k.current)==null||V.setModel({original:F,modified:H})},[t,e,r,n,i,o,s]),O=w.useCallback(()=>{var F;!P.current&&L.current&&(k.current=I.current.editor.createDiffEditor(L.current,{automaticLayout:!0,...d}),M(),(F=I.current)==null||F.editor.setTheme(c),y(!0),P.current=!0)},[d,c,M]);w.useEffect(()=>{b&&D.current(k.current,I.current)},[b]),w.useEffect(()=>{!C&&!b&&O()},[C,b,O]);function B(){var H,V,$,j;let F=(H=k.current)==null?void 0:H.getModel();a||((V=F==null?void 0:F.original)==null||V.dispose()),l||(($=F==null?void 0:F.modified)==null||$.dispose()),(j=k.current)==null||j.dispose()}return te.createElement(hje,{width:g,height:h,isEditorReady:b,loading:u,_ref:L,className:p,wrapperProps:m})}var v5i=_5i;w.memo(v5i);function b5i(n){let e=w.useRef();return w.useEffect(()=>{e.current=n},[n]),e.current}var y5i=b5i,hB=new Map;function C5i({defaultValue:n,defaultLanguage:e,defaultPath:t,value:i,language:r,path:o,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:h=!1,width:g="100%",height:p="100%",className:m,wrapperProps:_={},beforeMount:v=DO,onMount:b=DO,onChange:y,onValidate:C=DO}){let[x,k]=w.useState(!1),[I,L]=w.useState(!0),D=w.useRef(null),R=w.useRef(null),P=w.useRef(null),M=w.useRef(b),O=w.useRef(v),B=w.useRef(),F=w.useRef(i),H=y5i(o),V=w.useRef(!1),$=w.useRef(!1);fje(()=>{let ne=kU.init();return ne.then(se=>(D.current=se)&&L(!1)).catch(se=>(se==null?void 0:se.type)!=="cancelation"&&console.error("Monaco initialization: error:",se)),()=>R.current?Y():ne.cancel()}),zf(()=>{var se,he,xe,_e;let ne=AI(D.current,n||i||"",e||r||"",o||t||"");ne!==((se=R.current)==null?void 0:se.getModel())&&(d&&hB.set(H,(he=R.current)==null?void 0:he.saveViewState()),(xe=R.current)==null||xe.setModel(ne),d&&((_e=R.current)==null||_e.restoreViewState(hB.get(o))))},[o],x),zf(()=>{var ne;(ne=R.current)==null||ne.updateOptions(c)},[c],x),zf(()=>{!R.current||i===void 0||(R.current.getOption(D.current.editor.EditorOption.readOnly)?R.current.setValue(i):i!==R.current.getValue()&&($.current=!0,R.current.executeEdits("",[{range:R.current.getModel().getFullModelRange(),text:i,forceMoveMarkers:!0}]),R.current.pushUndoStop(),$.current=!1))},[i],x),zf(()=>{var se,he;let ne=(se=R.current)==null?void 0:se.getModel();ne&&r&&((he=D.current)==null||he.editor.setModelLanguage(ne,r))},[r],x),zf(()=>{var ne;a!==void 0&&((ne=R.current)==null||ne.revealLine(a))},[a],x),zf(()=>{var ne;(ne=D.current)==null||ne.editor.setTheme(s)},[s],x);let j=w.useCallback(()=>{var ne;if(!(!P.current||!D.current)&&!V.current){O.current(D.current);let se=o||t,he=AI(D.current,i||n||"",e||r||"",se||"");R.current=(ne=D.current)==null?void 0:ne.editor.create(P.current,{model:he,automaticLayout:!0,...c},u),d&&R.current.restoreViewState(hB.get(se)),D.current.editor.setTheme(s),a!==void 0&&R.current.revealLine(a),k(!0),V.current=!0}},[n,e,t,i,r,o,c,u,d,s,a]);w.useEffect(()=>{x&&M.current(R.current,D.current)},[x]),w.useEffect(()=>{!I&&!x&&j()},[I,x,j]),F.current=i,w.useEffect(()=>{var ne,se;x&&y&&((ne=B.current)==null||ne.dispose(),B.current=(se=R.current)==null?void 0:se.onDidChangeModelContent(he=>{$.current||y(R.current.getValue(),he)}))},[x,y]),w.useEffect(()=>{if(x){let ne=D.current.editor.onDidChangeMarkers(se=>{var xe;let he=(xe=R.current.getModel())==null?void 0:xe.uri;if(he&&se.find(_e=>_e.path===he.path)){let _e=D.current.editor.getModelMarkers({resource:he});C==null||C(_e)}});return()=>{ne==null||ne.dispose()}}return()=>{}},[x,C]);function Y(){var ne,se;(ne=B.current)==null||ne.dispose(),h?d&&hB.set(o,R.current.saveViewState()):(se=R.current.getModel())==null||se.dispose(),R.current.dispose()}return te.createElement(hje,{width:g,height:p,isEditorReady:x,loading:l,_ref:P,className:m,wrapperProps:_})}var w5i=C5i,S5i=w.memo(w5i),gfr=S5i;function Pf(n,e=0){return n[n.length-(1+e)]}function E5i(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function Qs(n,e,t=(i,r)=>i===r){if(n===e)return!0;if(!n||!e||n.length!==e.length)return!1;for(let i=0,r=n.length;i<r;i++)if(!t(n[i],e[i]))return!1;return!0}function x5i(n,e){const t=n.length-1;e<t&&(n[e]=n[t]),n.pop()}function gM(n,e,t){return k5i(n.length,i=>t(n[i],e))}function k5i(n,e){let t=0,i=n-1;for(;t<=i;){const r=(t+i)/2|0,o=e(r);if(o<0)t=r+1;else if(o>0)i=r-1;else return r}return-(t+1)}function qre(n,e,t){if(n=n|0,n>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],r=[],o=[],s=[];for(const a of e){const l=t(a,i);l<0?r.push(a):l>0?o.push(a):s.push(a)}return n<r.length?qre(n,r,t):n<r.length+s.length?s[0]:qre(n-(r.length+s.length),o,t)}function tLe(n,e){const t=[];let i;for(const r of n.slice(0).sort(e))!i||e(i[0],r)!==0?(i=[r],t.push(i)):i.push(r);return t}function*pje(n,e){let t,i;for(const r of n)i!==void 0&&e(i,r)?t.push(r):(t&&(yield t),t=[r]),i=r;t&&(yield t)}function mje(n,e){for(let t=0;t<=n.length;t++)e(t===0?void 0:n[t-1],t===n.length?void 0:n[t])}function T5i(n,e){for(let t=0;t<n.length;t++)e(t===0?void 0:n[t-1],n[t],t+1===n.length?void 0:n[t+1])}function ob(n){return n.filter(e=>!!e)}function nLe(n){let e=0;for(let t=0;t<n.length;t++)n[t]&&(n[e]=n[t],e+=1);n.length=e}function _je(n){return!Array.isArray(n)||n.length===0}function Fc(n){return Array.isArray(n)&&n.length>0}function rw(n,e=t=>t){const t=new Set;return n.filter(i=>{const r=e(i);return t.has(r)?!1:(t.add(r),!0)})}function vje(n,e){return n.length>0?n[0]:e}function xu(n,e){let t=typeof e=="number"?n:0;typeof e=="number"?t=n:(t=0,e=n);const i=[];if(t<=e)for(let r=t;r<e;r++)i.push(r);else for(let r=t;r>e;r--)i.push(r);return i}function TU(n,e,t){const i=n.slice(0,e),r=n.slice(e);return i.concat(t,r)}function jX(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function fB(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function Kre(n,e){for(const t of e)n.push(t)}function pme(n){return Array.isArray(n)?n:[n]}function I5i(n,e,t){const i=bje(n,e),r=n.length,o=t.length;n.length=r+o;for(let s=r-1;s>=i;s--)n[s+o]=n[s];for(let s=0;s<o;s++)n[s+i]=t[s]}function iLe(n,e,t,i){const r=bje(n,e);let o=n.splice(r,t);return o===void 0&&(o=[]),I5i(n,r,i),o}function bje(n,e){return e<0?Math.max(e+n.length,0):Math.min(e,n.length)}var pM;(function(n){function e(o){return o<0}n.isLessThan=e;function t(o){return o<=0}n.isLessThanOrEqual=t;function i(o){return o>0}n.isGreaterThan=i;function r(o){return o===0}n.isNeitherLessOrGreaterThan=r,n.greaterThan=1,n.lessThan=-1,n.neitherLessOrGreaterThan=0})(pM||(pM={}));function fg(n,e){return(t,i)=>e(n(t),n(i))}function L5i(...n){return(e,t)=>{for(const i of n){const r=i(e,t);if(!pM.isNeitherLessOrGreaterThan(r))return r}return pM.neitherLessOrGreaterThan}}const Gy=(n,e)=>n-e,D5i=(n,e)=>Gy(n?1:0,e?1:0);function yje(n){return(e,t)=>-n(e,t)}class v0{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;const i=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,i}takeFromEndWhile(e){let t=this.lastIdx;for(;t>=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.length!==0)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}}class Yv{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new Yv(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new Yv(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(r=>((i||pM.isGreaterThan(e(r,t)))&&(i=!1,t=r),!0)),t}}Yv.empty=new Yv(n=>{});function Ku(n){return typeof n=="string"}function Vu(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function A5i(n){const e=Object.getPrototypeOf(Uint8Array);return typeof n=="object"&&n instanceof e}function ow(n){return typeof n=="number"&&!isNaN(n)}function rLe(n){return!!n&&typeof n[Symbol.iterator]=="function"}function Cje(n){return n===!0||n===!1}function Xd(n){return typeof n>"u"}function mM(n){return!Mh(n)}function Mh(n){return Xd(n)||n===null}function to(n,e){if(!n)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function xE(n){if(Mh(n))throw new Error("Assertion Failed: argument is undefined or null");return n}function _M(n){return typeof n=="function"}function R5i(n,e){const t=Math.min(n.length,e.length);for(let i=0;i<t;i++)N5i(n[i],e[i])}function N5i(n,e){if(Ku(e)){if(typeof n!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(_M(e)){try{if(n instanceof e)return}catch{}if(!Mh(n)&&n.constructor===e||e.length===1&&e.call(void 0,n)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function py(n){if(!n||typeof n!="object"||n instanceof RegExp)return n;const e=Array.isArray(n)?[]:{};return Object.entries(n).forEach(([t,i])=>{e[t]=i&&typeof i=="object"?py(i):i}),e}function O5i(n){if(!n||typeof n!="object")return n;const e=[n];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(wje.call(t,i)){const r=t[i];typeof r=="object"&&!Object.isFrozen(r)&&!A5i(r)&&e.push(r)}}return n}const wje=Object.prototype.hasOwnProperty;function Sje(n,e){return Gre(n,e,new Set)}function Gre(n,e,t){if(Mh(n))return n;const i=e(n);if(typeof i<"u")return i;if(Array.isArray(n)){const r=[];for(const o of n)r.push(Gre(o,e,t));return r}if(Vu(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const r={};for(const o in n)wje.call(n,o)&&(r[o]=Gre(n[o],e,t));return t.delete(n),r}return n}function IU(n,e,t=!0){return Vu(n)?(Vu(e)&&Object.keys(e).forEach(i=>{i in n?t&&(Vu(n[i])&&Vu(e[i])?IU(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function tf(n,e){if(n===e)return!0;if(n==null||e===null||e===void 0||typeof n!=typeof e||typeof n!="object"||Array.isArray(n)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(t=0;t<n.length;t++)if(!tf(n[t],e[t]))return!1}else{const r=[];for(i in n)r.push(i);r.sort();const o=[];for(i in e)o.push(i);if(o.sort(),!tf(r,o))return!1;for(t=0;t<r.length;t++)if(!tf(n[r[t]],e[r[t]]))return!1}return!0}function P5i(n){let e=[];for(;Object.prototype!==n;)e=e.concat(Object.getOwnPropertyNames(n)),n=Object.getPrototypeOf(n);return e}function mme(n){const e=[];for(const t of P5i(n))typeof n[t]=="function"&&e.push(t);return e}function M5i(n,e){const t=r=>function(){const o=Array.prototype.slice.call(arguments,0);return e(r,o)},i={};for(const r of n)i[r]=t(r);return i}globalThis&&globalThis.__awaiter;let F5i=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function B5i(n,e){let t;return e.length===0?t=n:t=n.replace(/\{(\d+)\}/g,(i,r)=>{const o=r[0],s=e[o];let a=i;return typeof s=="string"?a=s:(typeof s=="number"||typeof s=="boolean"||s===void 0||s===null)&&(a=String(s)),a}),F5i&&(t=""+t.replace(/[aouei]/g,"$&$&")+""),t}function E(n,e,...t){return B5i(e,t)}var UX;const RI="en";let yV=!1,CV=!1,S8=!1,Eje=!1,_me=!1,vme=!1,xje=!1,gB,E8=RI,oLe=RI,$5i,Sm;const Tp=typeof self=="object"?self:typeof global=="object"?global:{};let ku;typeof Tp.vscode<"u"&&typeof Tp.vscode.process<"u"?ku=Tp.vscode.process:typeof process<"u"&&(ku=process);const V5i=typeof((UX=ku==null?void 0:ku.versions)===null||UX===void 0?void 0:UX.electron)=="string",H5i=V5i&&(ku==null?void 0:ku.type)==="renderer";if(typeof navigator=="object"&&!H5i)Sm=navigator.userAgent,yV=Sm.indexOf("Windows")>=0,CV=Sm.indexOf("Macintosh")>=0,vme=(Sm.indexOf("Macintosh")>=0||Sm.indexOf("iPad")>=0||Sm.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,S8=Sm.indexOf("Linux")>=0,xje=(Sm==null?void 0:Sm.indexOf("Mobi"))>=0,_me=!0,E({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),gB=RI,E8=gB,oLe=navigator.language;else if(typeof ku=="object"){yV=ku.platform==="win32",CV=ku.platform==="darwin",S8=ku.platform==="linux",S8&&ku.env.SNAP&&ku.env.SNAP_REVISION,ku.env.CI||ku.env.BUILD_ARTIFACTSTAGINGDIRECTORY,gB=RI,E8=RI;const n=ku.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n),t=e.availableLanguages["*"];gB=e.locale,oLe=e.osLocale,E8=t||RI,$5i=e._translationsConfigFile}catch{}Eje=!0}else console.error("Unable to resolve platform.");const vc=yV,Qi=CV,fu=S8,h_=Eje,Qw=_me,W5i=_me&&typeof Tp.importScripts=="function",C_=vme,z5i=xje,sb=Sm,j5i=E8,U5i=typeof Tp.postMessage=="function"&&!Tp.importScripts,kje=(()=>{if(U5i){const n=[];Tp.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,r=n.length;i<r;i++){const o=n[i];if(o.id===t.data.vscodeScheduleAsyncWork){n.splice(i,1),o.callback();return}}});let e=0;return t=>{const i=++e;n.push({id:i,callback:t}),Tp.postMessage({vscodeScheduleAsyncWork:i},"*")}}return n=>setTimeout(n)})(),qh=CV||vme?2:yV?1:3;let sLe=!0,aLe=!1;function Tje(){if(!aLe){aLe=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,sLe=new Uint16Array(n.buffer)[0]===512+1}return sLe}const Ije=!!(sb&&sb.indexOf("Chrome")>=0),q5i=!!(sb&&sb.indexOf("Firefox")>=0),K5i=!!(!Ije&&sb&&sb.indexOf("Safari")>=0),G5i=!!(sb&&sb.indexOf("Edg/")>=0);sb&&sb.indexOf("Android")>=0;const Ac={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var Pi;(function(n){function e(b){return b&&typeof b=="object"&&typeof b[Symbol.iterator]=="function"}n.is=e;const t=Object.freeze([]);function i(){return t}n.empty=i;function*r(b){yield b}n.single=r;function o(b){return e(b)?b:r(b)}n.wrap=o;function s(b){return b||t}n.from=s;function*a(b){for(let y=b.length-1;y>=0;y--)yield b[y]}n.reverse=a;function l(b){return!b||b[Symbol.iterator]().next().done===!0}n.isEmpty=l;function c(b){return b[Symbol.iterator]().next().value}n.first=c;function u(b,y){for(const C of b)if(y(C))return!0;return!1}n.some=u;function d(b,y){for(const C of b)if(y(C))return C}n.find=d;function*h(b,y){for(const C of b)y(C)&&(yield C)}n.filter=h;function*g(b,y){let C=0;for(const x of b)yield y(x,C++)}n.map=g;function*p(...b){for(const y of b)for(const C of y)yield C}n.concat=p;function m(b,y,C){let x=C;for(const k of b)x=y(x,k);return x}n.reduce=m;function*_(b,y,C=b.length){for(y<0&&(y+=b.length),C<0?C+=b.length:C>b.length&&(C=b.length);y<C;y++)yield b[y]}n.slice=_;function v(b,y=Number.POSITIVE_INFINITY){const C=[];if(y===0)return[C,b];const x=b[Symbol.iterator]();for(let k=0;k<y;k++){const I=x.next();if(I.done)return[C,n.empty()];C.push(I.value)}return[C,{[Symbol.iterator](){return x}}]}n.consume=v})(Pi||(Pi={}));let Ia=class Yre{constructor(e){this.element=e,this.next=Yre.Undefined,this.prev=Yre.Undefined}};Ia.Undefined=new Ia(void 0);class Hu{constructor(){this._first=Ia.Undefined,this._last=Ia.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Ia.Undefined}clear(){let e=this._first;for(;e!==Ia.Undefined;){const t=e.next;e.prev=Ia.Undefined,e.next=Ia.Undefined,e=t}this._first=Ia.Undefined,this._last=Ia.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new Ia(e);if(this._first===Ia.Undefined)this._first=i,this._last=i;else if(t){const o=this._last;this._last=i,i.prev=o,o.next=i}else{const o=this._first;this._first=i,i.next=o,o.prev=i}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(i))}}shift(){if(this._first!==Ia.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ia.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Ia.Undefined&&e.next!==Ia.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Ia.Undefined&&e.next===Ia.Undefined?(this._first=Ia.Undefined,this._last=Ia.Undefined):e.next===Ia.Undefined?(this._last=this._last.prev,this._last.next=Ia.Undefined):e.prev===Ia.Undefined&&(this._first=this._first.next,this._first.prev=Ia.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ia.Undefined;)yield e.element,e=e.next}}const Lje="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function Y5i(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of Lje)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const bme=Y5i();function Dje(n){let e=bme;if(n&&n instanceof RegExp)if(n.global)e=n;else{let t="g";n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.unicode&&(t+="u"),e=new RegExp(n.source,t)}return e.lastIndex=0,e}const Aje=new Hu;Aje.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function vM(n,e,t,i,r){if(r||(r=Pi.first(Aje)),t.length>r.maxLen){let c=n-r.maxLen/2;return c<0?c=0:i+=c,t=t.substring(c,n+r.maxLen/2),vM(n,e,t,i,r)}const o=Date.now(),s=n-1-i;let a=-1,l=null;for(let c=1;!(Date.now()-o>=r.timeBudget);c++){const u=s-r.windowSize*c;e.lastIndex=Math.max(0,u);const d=Q5i(e,t,s,a);if(!d&&l||(l=d,u<=0))break;a=u}if(l){const c={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function Q5i(n,e,t,i){let r;for(;r=n.exec(e);){const o=r.index||0;if(o<=t&&n.lastIndex>=t)return r;if(i>0&&o>i)return null}return null}const l1=8;class Rje{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class Nje{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class us{constructor(e,t,i,r){this.id=e,this.name=t,this.defaultValue=i,this.schema=r}applyUpdate(e,t){return LU(e,t)}compute(e,t,i){return i}}class AO{constructor(e,t){this.newValue=e,this.didChange=t}}function LU(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new AO(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){const i=Array.isArray(n)&&Array.isArray(e)&&Qs(n,e);return new AO(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const r=LU(n[i],e[i]);r.didChange&&(n[i]=r.newValue,t=!0)}return new AO(n,t)}class c5{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return LU(e,t)}validate(e){return this.defaultValue}}class vA{constructor(e,t,i,r){this.id=e,this.name=t,this.defaultValue=i,this.schema=r}applyUpdate(e,t){return LU(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function _n(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}class er extends vA{constructor(e,t,i,r=void 0){typeof r<"u"&&(r.type="boolean",r.default=i),super(e,t,i,r)}validate(e){return _n(e,this.defaultValue)}}function US(n,e,t,i){if(typeof n>"u")return e;let r=parseInt(n,10);return isNaN(r)?e:(r=Math.max(t,r),r=Math.min(i,r),r|0)}class fo extends vA{static clampedInt(e,t,i,r){return US(e,t,i,r)}constructor(e,t,i,r,o,s=void 0){typeof s<"u"&&(s.type="integer",s.default=i,s.minimum=r,s.maximum=o),super(e,t,i,s),this.minimum=r,this.maximum=o}validate(e){return fo.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function X5i(n,e,t,i){if(typeof n>"u")return e;const r=vp.float(n,e);return vp.clamp(r,t,i)}class vp extends vA{static clamp(e,t,i){return e<t?t:e>i?i:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,r,o){typeof o<"u"&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=r}validate(e){return this.validationFn(vp.float(e,this.defaultValue))}}class Kd extends vA{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,r=void 0){typeof r<"u"&&(r.type="string",r.default=i),super(e,t,i,r)}validate(e){return Kd.string(e,this.defaultValue)}}function aa(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}class ks extends vA{constructor(e,t,i,r,o=void 0){typeof o<"u"&&(o.type="string",o.enum=r,o.default=i),super(e,t,i,o),this._allowedValues=r}validate(e){return aa(e,this.defaultValue,this._allowedValues)}}class pB extends us{constructor(e,t,i,r,o,s,a=void 0){typeof a<"u"&&(a.type="string",a.enum=o,a.default=r),super(e,t,i,a),this._allowedValues=o,this._convert=s}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function Z5i(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class J5i extends us{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[E("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached"),E("accessibilitySupport.on","Optimize for usage with a Screen Reader"),E("accessibilitySupport.off","Assume a screen reader is not attached")],default:"auto",tags:["accessibility"],description:E("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class eFi extends us{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:E("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:E("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:_n(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:_n(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function tFi(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var Hl;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(Hl||(Hl={}));function nFi(n){switch(n){case"line":return Hl.Line;case"block":return Hl.Block;case"underline":return Hl.Underline;case"line-thin":return Hl.LineThin;case"block-outline":return Hl.BlockOutline;case"underline-thin":return Hl.UnderlineThin}}class iFi extends c5{constructor(){super(140)}compute(e,t,i){const r=["monaco-editor"];return t.get(39)&&r.push(t.get(39)),e.extraEditorClassName&&r.push(e.extraEditorClassName),t.get(73)==="default"?r.push("mouse-default"):t.get(73)==="copy"&&r.push("mouse-copy"),t.get(110)&&r.push("showUnused"),t.get(138)&&r.push("showDeprecated"),r.join(" ")}}class rFi extends er{constructor(){super(37,"emptySelectionClipboard",!0,{description:E("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class oFi extends us{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:E("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:[E("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),E("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),E("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:E("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:[E("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),E("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),E("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:E("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:E("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:Qi},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:E("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:E("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||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:_n(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":aa(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":aa(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:_n(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:_n(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:_n(t.loop,this.defaultValue.loop)}}}class Fh extends us{constructor(){super(51,"fontLigatures",Fh.OFF,{anyOf:[{type:"boolean",description:E("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:E("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:E("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 typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?Fh.OFF:e==="true"?Fh.ON:e:e?Fh.ON:Fh.OFF}}Fh.OFF='"liga" off, "calt" off';Fh.ON='"liga" on, "calt" on';class Qm extends us{constructor(){super(54,"fontVariations",Qm.OFF,{anyOf:[{type:"boolean",description:E("fontVariations","Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:E("fontVariationSettings","Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:E("fontVariationsGeneral","Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?Qm.OFF:e==="true"?Qm.TRANSLATE:e:e?Qm.TRANSLATE:Qm.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}Qm.OFF="normal";Qm.TRANSLATE="translate";class sFi extends c5{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class aFi extends vA{constructor(){super(52,"fontSize",ih.fontSize,{type:"number",minimum:6,maximum:100,default:ih.fontSize,description:E("fontSize","Controls the font size in pixels.")})}validate(e){const t=vp.float(e,this.defaultValue);return t===0?ih.fontSize:vp.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class bv extends us{constructor(){super(53,"fontWeight",ih.fontWeight,{anyOf:[{type:"number",minimum:bv.MINIMUM_VALUE,maximum:bv.MAXIMUM_VALUE,errorMessage:E("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:bv.SUGGESTION_VALUES}],default:ih.fontWeight,description:E("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(fo.clampedInt(e,ih.fontWeight,bv.MINIMUM_VALUE,bv.MAXIMUM_VALUE))}}bv.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];bv.MINIMUM_VALUE=1;bv.MAXIMUM_VALUE=1e3;class lFi extends us{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:[E("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),E("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),E("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},i=["","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(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:E("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:E("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:E("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:E("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:E("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:E("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:i,description:E("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:i,description:E("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:i,description:E("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:i,description:E("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:i,description:E("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,r,o,s;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:aa(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:aa(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:aa(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(r=a.multipleDeclarations)!==null&&r!==void 0?r:aa(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=a.multipleImplementations)!==null&&o!==void 0?o:aa(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(s=a.multipleReferences)!==null&&s!==void 0?s:aa(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Kd.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Kd.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Kd.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Kd.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Kd.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class cFi extends us{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:E("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:E("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:E("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:E("hover.hidingDelay","Controls the delay in milliseconds after thich the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:E("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:_n(t.enabled,this.defaultValue.enabled),delay:fo.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:_n(t.sticky,this.defaultValue.sticky),hidingDelay:fo.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:_n(t.above,this.defaultValue.above)}}}class wL extends c5{constructor(){super(143)}compute(e,t,i){return wL.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,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let r=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(r=Math.max(r,t-1));const o=(i+e.viewLineCount+r)/(e.pixelRatio*e.height),s=Math.floor(e.viewLineCount/o);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:r,desiredRatio:o,minimapLineCount:s}}static _computeMinimapLayout(e,t){const i=e.outerWidth,r=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*r),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:r};const s=t.stableMinimapLayoutInput,a=s&&e.outerHeight===s.outerHeight&&e.lineHeight===s.lineHeight&&e.typicalHalfwidthCharacterWidth===s.typicalHalfwidthCharacterWidth&&e.pixelRatio===s.pixelRatio&&e.scrollBeyondLastLine===s.scrollBeyondLastLine&&e.paddingTop===s.paddingTop&&e.paddingBottom===s.paddingBottom&&e.minimap.enabled===s.minimap.enabled&&e.minimap.side===s.minimap.side&&e.minimap.size===s.minimap.size&&e.minimap.showSlider===s.minimap.showSlider&&e.minimap.renderCharacters===s.minimap.renderCharacters&&e.minimap.maxColumn===s.minimap.maxColumn&&e.minimap.scale===s.minimap.scale&&e.verticalScrollbarWidth===s.verticalScrollbarWidth&&e.isViewportWrapping===s.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,u=e.scrollBeyondLastLine,d=e.minimap.renderCharacters;let h=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const g=e.minimap.maxColumn,p=e.minimap.size,m=e.minimap.side,_=e.verticalScrollbarWidth,v=e.viewLineCount,b=e.remainingWidth,y=e.isViewportWrapping,C=d?2:3;let x=Math.floor(o*r);const k=x/o;let I=!1,L=!1,D=C*h,R=h/o,P=1;if(p==="fill"||p==="fit"){const{typicalViewportLineCount:$,extraLinesBeforeFirstLine:j,extraLinesBeyondLastLine:Y,desiredRatio:ne,minimapLineCount:se}=wL.computeContainedMinimapLineCount({viewLineCount:v,scrollBeyondLastLine:u,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:r,lineHeight:l,pixelRatio:o});if(v/se>1)I=!0,L=!0,h=1,D=1,R=h/o;else{let xe=!1,_e=h+1;if(p==="fit"){const Ie=Math.ceil((j+v+Y)*D);y&&a&&b<=t.stableFitRemainingWidth?(xe=!0,_e=t.stableFitMaxMinimapScale):xe=Ie>x}if(p==="fill"||xe){I=!0;const Ie=h;D=Math.min(l*o,Math.max(1,Math.floor(1/ne))),y&&a&&b<=t.stableFitRemainingWidth&&(_e=t.stableFitMaxMinimapScale),h=Math.min(_e,Math.max(1,Math.floor(D/C))),h>Ie&&(P=Math.min(2,h/Ie)),R=h/o/P,x=Math.ceil(Math.max($,j+v+Y)*D),y?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const M=Math.floor(g*R),O=Math.min(M,Math.max(0,Math.floor((b-_-2)*R/(c+R)))+l1);let B=Math.floor(o*O);const F=B/o;B=Math.floor(B*P);const H=d?1:2,V=m==="left"?0:i-O-_;return{renderMinimap:H,minimapLeft:V,minimapWidth:O,minimapHeightIsEditorHeight:I,minimapIsSampling:L,minimapScale:h,minimapLineHeight:D,minimapCanvasInnerWidth:B,minimapCanvasInnerHeight:x,minimapCanvasOuterWidth:F,minimapCanvasOuterHeight:k}}static computeLayout(e,t){const i=t.outerWidth|0,r=t.outerHeight|0,o=t.lineHeight|0,s=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,u=t.viewLineCount,d=e.get(135),h=d==="inherit"?e.get(134):d,g=h==="inherit"?e.get(130):h,p=e.get(133),m=t.isDominatedByLongLines,_=e.get(57),v=e.get(67).renderType!==0,b=e.get(68),y=e.get(104),C=e.get(83),x=e.get(72),k=e.get(102),I=k.verticalScrollbarSize,L=k.verticalHasArrows,D=k.arrowSize,R=k.horizontalScrollbarSize,P=e.get(43),M=e.get(109)!=="never";let O=e.get(65);P&&M&&(O+=16);let B=0;if(v){const Ye=Math.max(s,b);B=Math.round(Ye*l)}let F=0;_&&(F=o*t.glyphMarginDecorationLaneCount);let H=0,V=H+F,$=V+B,j=$+O;const Y=i-F-B-O;let ne=!1,se=!1,he=-1;h==="inherit"&&m?(ne=!0,se=!0):g==="on"||g==="bounded"?se=!0:g==="wordWrapColumn"&&(he=p);const xe=wL._computeMinimapLayout({outerWidth:i,outerHeight:r,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:y,paddingTop:C.top,paddingBottom:C.bottom,minimap:x,verticalScrollbarWidth:I,viewLineCount:u,remainingWidth:Y,isViewportWrapping:se},t.memory||new Nje);xe.renderMinimap!==0&&xe.minimapLeft===0&&(H+=xe.minimapWidth,V+=xe.minimapWidth,$+=xe.minimapWidth,j+=xe.minimapWidth);const _e=Y-xe.minimapWidth,Ie=Math.max(1,Math.floor((_e-I-2)/a)),Re=L?D:0;return se&&(he=Math.max(1,Ie),g==="bounded"&&(he=Math.min(he,p))),{width:i,height:r,glyphMarginLeft:H,glyphMarginWidth:F,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:V,lineNumbersWidth:B,decorationsLeft:$,decorationsWidth:O,contentLeft:j,contentWidth:_e,minimap:xe,viewportColumn:Ie,isWordWrapMinified:ne,isViewportWrapping:se,wrappingColumn:he,verticalScrollbarWidth:I,horizontalScrollbarHeight:R,overviewRuler:{top:Re,width:I,height:r-2*Re,right:0}}}}class uFi extends us{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[E("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."),E("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.")],type:"string",enum:["simple","advanced"],default:"simple",description:E("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return aa(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}class dFi extends us{constructor(){const e={enabled:!0};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:E("codeActions","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:_n(e.enabled,this.defaultValue.enabled)}}}class hFi extends us{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:E("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:10,description:E("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:E("editor.stickyScroll.defaultModel","Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:E("editor.stickyScroll.scrollWithEditor","Enable scrolling of the sticky scroll widget with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:_n(t.enabled,this.defaultValue.enabled),maxLineCount:fo.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:aa(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:_n(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class fFi extends us{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:E("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[E("editor.inlayHints.on","Inlay hints are enabled"),E("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",Qi?"Ctrl+Option":"Ctrl+Alt"),E("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",Qi?"Ctrl+Option":"Ctrl+Alt"),E("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:E("inlayHints.fontSize","Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:E("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:E("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:aa(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:fo.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Kd.string(t.fontFamily,this.defaultValue.fontFamily),padding:_n(t.padding,this.defaultValue.padding)}}}class gFi extends us{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):fo.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?fo.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class pFi extends vp{constructor(){super(66,"lineHeight",ih.lineHeight,e=>vp.clamp(e,0,150),{markdownDescription:E("lineHeight",`Controls the line height.
- Use 0 to automatically compute the line height from the font size.
- Values between 0 and 8 will be used as a multiplier with the font size.
- Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class mFi extends us{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(72,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:E("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:E("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[E("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),E("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),E("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:E("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:E("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:E("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:E("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:E("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:E("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:_n(t.enabled,this.defaultValue.enabled),autohide:_n(t.autohide,this.defaultValue.autohide),size:aa(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:aa(t.side,this.defaultValue.side,["right","left"]),showSlider:aa(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:_n(t.renderCharacters,this.defaultValue.renderCharacters),scale:fo.clampedInt(t.scale,1,1,3),maxColumn:fo.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function _Fi(n){return n==="ctrlCmd"?Qi?"metaKey":"ctrlKey":"altKey"}class vFi extends us{constructor(){super(83,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:E("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:E("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:fo.clampedInt(t.top,0,0,1e3),bottom:fo.clampedInt(t.bottom,0,0,1e3)}}}class bFi extends us{constructor(){const e={enabled:!0,cycle:!0};super(85,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:E("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:E("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:_n(t.enabled,this.defaultValue.enabled),cycle:_n(t.cycle,this.defaultValue.cycle)}}}class yFi extends c5{constructor(){super(141)}compute(e,t,i){return e.pixelRatio}}class CFi extends us{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[E("on","Quick suggestions show inside the suggest widget"),E("inline","Quick suggestions show as ghost text"),E("off","Quick suggestions are disabled")]}];super(88,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:E("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:E("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:E("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:E("quickSuggestions","Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the '{0}'-setting which controls if suggestions are triggered by special characters.","#editor.suggestOnTriggerCharacters#")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){const c=e?"on":"off";return{comments:c,strings:c,other:c}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:i,strings:r}=e,o=["on","inline","off"];let s,a,l;return typeof t=="boolean"?s=t?"on":"off":s=aa(t,this.defaultValue.other,o),typeof i=="boolean"?a=i?"on":"off":a=aa(i,this.defaultValue.comments,o),typeof r=="boolean"?l=r?"on":"off":l=aa(r,this.defaultValue.strings,o),{other:s,comments:a,strings:l}}}class wFi extends us{constructor(){super(67,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[E("lineNumbers.off","Line numbers are not rendered."),E("lineNumbers.on","Line numbers are rendered as absolute number."),E("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),E("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:E("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,i=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:i}}}function wV(n){const e=n.get(97);return e==="editable"?n.get(90):e!=="on"}class SFi extends us{constructor(){const e=[],t={type:"number",description:E("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(101,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:E("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:E("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(const i of e)if(typeof i=="number")t.push({column:fo.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const r=i;t.push({column:fo.clampedInt(r.column,0,0,1e4),color:r.color})}return t.sort((i,r)=>i.column-r.column),t}return this.defaultValue}}class EFi extends us{constructor(){super(91,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function lLe(n,e){if(typeof n!="string")return e;switch(n){case"hidden":return 2;case"visible":return 3;default:return 1}}let xFi=class extends us{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(102,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[E("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),E("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),E("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:E("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[E("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),E("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),E("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:E("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:E("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:E("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:E("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,i=fo.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),r=fo.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:fo.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:lLe(t.vertical,this.defaultValue.vertical),horizontal:lLe(t.horizontal,this.defaultValue.horizontal),useShadows:_n(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:_n(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:_n(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:_n(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:_n(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:fo.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:r,verticalSliderSize:fo.clampedInt(t.verticalSliderSize,r,0,1e3),scrollByPage:_n(t.scrollByPage,this.defaultValue.scrollByPage)}}};const Ih="inUntrustedWorkspace",yd={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 kFi extends us{constructor(){const e={nonBasicASCII:Ih,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Ih,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(124,"unicodeHighlight",e,{[yd.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Ih],default:e.nonBasicASCII,description:E("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.")},[yd.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:E("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[yd.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:E("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.")},[yd.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Ih],default:e.includeComments,description:E("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[yd.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Ih],default:e.includeStrings,description:E("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[yd.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:E("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[yd.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:E("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(tf(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),i=!0)),t.allowedLocales&&e&&(tf(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),i=!0));const r=super.applyUpdate(e,t);return i?new AO(r.newValue,!0):r}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:SL(t.nonBasicASCII,Ih,[!0,!1,Ih]),invisibleCharacters:_n(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:_n(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:SL(t.includeComments,Ih,[!0,!1,Ih]),includeStrings:SL(t.includeStrings,Ih,[!0,!1,Ih]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;const i={};for(const[r,o]of Object.entries(e))o===!0&&(i[r]=!0);return i}}class TFi extends us{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:E("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover"],enumDescriptions:[E("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),E("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion.")],description:E("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:E("inlineSuggest.suppressSuggestions","Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:_n(t.enabled,this.defaultValue.enabled),mode:aa(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:aa(t.showToolbar,this.defaultValue.showToolbar,["always","onHover"]),suppressSuggestions:_n(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:_n(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class IFi extends us{constructor(){const e={enabled:Ac.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:Ac.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:E("bracketPairColorization.enabled","Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:E("bracketPairColorization.independentColorPoolPerBracketType","Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:_n(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:_n(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class LFi extends us{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[E("editor.guides.bracketPairs.true","Enables bracket pair guides."),E("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),E("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:E("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[E("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),E("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),E("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:E("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:E("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:E("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[E("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),E("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),E("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:E("editor.guides.highlightActiveIndentation","Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{bracketPairs:SL(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:SL(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:_n(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:_n(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:SL(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function SL(n,e,t){const i=t.indexOf(n);return i===-1?e:t[i]}class DFi extends us{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!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(117,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[E("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),E("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:E("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:E("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:E("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:E("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[E("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),E("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),E("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),E("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:E("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:E("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:E("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:E("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:E("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:E("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:E("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:E("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:E("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.matchOnWordStartOnly","When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:E("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:aa(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:_n(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:_n(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:_n(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:_n(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:aa(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:_n(t.showIcons,this.defaultValue.showIcons),showStatusBar:_n(t.showStatusBar,this.defaultValue.showStatusBar),preview:_n(t.preview,this.defaultValue.preview),previewMode:aa(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:_n(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:_n(t.showMethods,this.defaultValue.showMethods),showFunctions:_n(t.showFunctions,this.defaultValue.showFunctions),showConstructors:_n(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:_n(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:_n(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:_n(t.showFields,this.defaultValue.showFields),showVariables:_n(t.showVariables,this.defaultValue.showVariables),showClasses:_n(t.showClasses,this.defaultValue.showClasses),showStructs:_n(t.showStructs,this.defaultValue.showStructs),showInterfaces:_n(t.showInterfaces,this.defaultValue.showInterfaces),showModules:_n(t.showModules,this.defaultValue.showModules),showProperties:_n(t.showProperties,this.defaultValue.showProperties),showEvents:_n(t.showEvents,this.defaultValue.showEvents),showOperators:_n(t.showOperators,this.defaultValue.showOperators),showUnits:_n(t.showUnits,this.defaultValue.showUnits),showValues:_n(t.showValues,this.defaultValue.showValues),showConstants:_n(t.showConstants,this.defaultValue.showConstants),showEnums:_n(t.showEnums,this.defaultValue.showEnums),showEnumMembers:_n(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:_n(t.showKeywords,this.defaultValue.showKeywords),showWords:_n(t.showWords,this.defaultValue.showWords),showColors:_n(t.showColors,this.defaultValue.showColors),showFiles:_n(t.showFiles,this.defaultValue.showFiles),showReferences:_n(t.showReferences,this.defaultValue.showReferences),showFolders:_n(t.showFolders,this.defaultValue.showFolders),showTypeParameters:_n(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:_n(t.showSnippets,this.defaultValue.showSnippets),showUsers:_n(t.showUsers,this.defaultValue.showUsers),showIssues:_n(t.showIssues,this.defaultValue.showIssues)}}}class AFi extends us{constructor(){super(112,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:E("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:E("selectSubwords","Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:_n(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:_n(e.selectSubwords,this.defaultValue.selectSubwords)}}}class RFi extends us{constructor(){super(136,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[E("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),E("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),E("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),E("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:E("wrappingIndent","Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return t.get(2)===2?0:i}}class NFi extends c5{constructor(){super(144)}compute(e,t,i){const r=t.get(143);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:r.isWordWrapMinified,isViewportWrapping:r.isViewportWrapping,wrappingColumn:r.wrappingColumn}}}class OFi extends us{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:E("dropIntoEditor.enabled","Controls whether you can drag and drop a file into a text editor by holding down `shift` (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:E("dropIntoEditor.showDropSelector","Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[E("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),E("dropIntoEditor.showDropSelector.never","Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:_n(t.enabled,this.defaultValue.enabled),showDropSelector:aa(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class PFi extends us{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(84,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:E("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:E("pasteAs.showPasteSelector","Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[E("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),E("pasteAs.showPasteSelector.never","Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:_n(t.enabled,this.defaultValue.enabled),showPasteSelector:aa(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const MFi="Consolas, 'Courier New', monospace",FFi="Menlo, Monaco, 'Courier New', monospace",BFi="'Droid Sans Mono', 'monospace', monospace",ih={fontFamily:Qi?FFi:fu?BFi:MFi,fontWeight:"normal",fontSize:Qi?12:14,lineHeight:0,letterSpacing:0},NI=[];function ct(n){return NI[n.id]=n,n}const A_={acceptSuggestionOnCommitCharacter:ct(new er(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:E("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:ct(new ks(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",E("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:E("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:ct(new J5i),accessibilityPageSize:ct(new fo(3,"accessibilityPageSize",10,1,1073741824,{description:E("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."),tags:["accessibility"]})),ariaLabel:ct(new Kd(4,"ariaLabel",E("editorViewAccessibleLabel","Editor content"))),ariaRequired:ct(new er(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:ct(new er(8,"screenReaderAnnounceInlineSuggestion",!0,{description:E("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:ct(new ks(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",E("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),E("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:E("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:ct(new ks(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",E("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),E("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:E("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:ct(new ks(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",E("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:E("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:ct(new ks(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",E("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:E("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:ct(new ks(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",E("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),E("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:E("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:ct(new pB(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],Z5i,{enumDescriptions:[E("editor.autoIndent.none","The editor will not insert indentation automatically."),E("editor.autoIndent.keep","The editor will keep the current line's indentation."),E("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),E("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),E("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:E("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:ct(new er(13,"automaticLayout",!1)),autoSurround:ct(new ks(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[E("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),E("editor.autoSurround.quotes","Surround with quotes but not brackets."),E("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:E("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:ct(new IFi),bracketPairGuides:ct(new LFi),stickyTabStops:ct(new er(115,"stickyTabStops",!1,{description:E("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:ct(new er(17,"codeLens",!0,{description:E("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:ct(new Kd(18,"codeLensFontFamily","",{description:E("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:ct(new fo(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:E("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:ct(new er(20,"colorDecorators",!0,{description:E("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:ct(new ks(146,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[E("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),E("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),E("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:E("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:ct(new fo(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:E("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:ct(new er(22,"columnSelection",!1,{description:E("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:ct(new eFi),contextmenu:ct(new er(24,"contextmenu",!0)),copyWithSyntaxHighlighting:ct(new er(25,"copyWithSyntaxHighlighting",!0,{description:E("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:ct(new pB(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],tFi,{description:E("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:ct(new ks(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[E("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),E("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),E("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:E("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:ct(new pB(28,"cursorStyle",Hl.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],nFi,{description:E("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:ct(new fo(29,"cursorSurroundingLines",0,0,1073741824,{description:E("cursorSurroundingLines","Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:ct(new ks(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[E("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),E("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:E("cursorSurroundingLinesStyle","Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:ct(new fo(31,"cursorWidth",0,0,1073741824,{markdownDescription:E("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:ct(new er(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:ct(new er(33,"disableMonospaceOptimizations",!1)),domReadOnly:ct(new er(34,"domReadOnly",!1)),dragAndDrop:ct(new er(35,"dragAndDrop",!0,{description:E("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:ct(new rFi),dropIntoEditor:ct(new OFi),stickyScroll:ct(new hFi),experimentalWhitespaceRendering:ct(new ks(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[E("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),E("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),E("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:E("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:ct(new Kd(39,"extraEditorClassName","")),fastScrollSensitivity:ct(new vp(40,"fastScrollSensitivity",5,n=>n<=0?5:n,{markdownDescription:E("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:ct(new oFi),fixedOverflowWidgets:ct(new er(42,"fixedOverflowWidgets",!1)),folding:ct(new er(43,"folding",!0,{description:E("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:ct(new ks(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[E("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),E("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:E("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:ct(new er(45,"foldingHighlight",!0,{description:E("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:ct(new er(46,"foldingImportsByDefault",!1,{description:E("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:ct(new fo(47,"foldingMaximumRegions",5e3,10,65e3,{description:E("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:ct(new er(48,"unfoldOnClickAfterEndOfLine",!1,{description:E("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:ct(new Kd(49,"fontFamily",ih.fontFamily,{description:E("fontFamily","Controls the font family.")})),fontInfo:ct(new sFi),fontLigatures2:ct(new Fh),fontSize:ct(new aFi),fontWeight:ct(new bv),fontVariations:ct(new Qm),formatOnPaste:ct(new er(55,"formatOnPaste",!1,{description:E("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:ct(new er(56,"formatOnType",!1,{description:E("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:ct(new er(57,"glyphMargin",!0,{description:E("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:ct(new lFi),hideCursorInOverviewRuler:ct(new er(59,"hideCursorInOverviewRuler",!1,{description:E("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:ct(new cFi),inDiffEditor:ct(new er(61,"inDiffEditor",!1)),letterSpacing:ct(new vp(63,"letterSpacing",ih.letterSpacing,n=>vp.clamp(n,-5,20),{description:E("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:ct(new dFi),lineDecorationsWidth:ct(new gFi),lineHeight:ct(new pFi),lineNumbers:ct(new wFi),lineNumbersMinChars:ct(new fo(68,"lineNumbersMinChars",5,1,300)),linkedEditing:ct(new er(69,"linkedEditing",!1,{description:E("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:ct(new er(70,"links",!0,{description:E("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:ct(new ks(71,"matchBrackets","always",["always","near","never"],{description:E("matchBrackets","Highlight matching brackets.")})),minimap:ct(new mFi),mouseStyle:ct(new ks(73,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:ct(new vp(74,"mouseWheelScrollSensitivity",1,n=>n===0?1:n,{markdownDescription:E("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:ct(new er(75,"mouseWheelZoom",!1,{markdownDescription:E("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:ct(new er(76,"multiCursorMergeOverlapping",!0,{description:E("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:ct(new pB(77,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],_Fi,{markdownEnumDescriptions:[E("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),E("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:E({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](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:ct(new ks(78,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[E("multiCursorPaste.spread","Each cursor pastes a single line of the text."),E("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:E("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:ct(new fo(79,"multiCursorLimit",1e4,1,1e5,{markdownDescription:E("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:ct(new er(80,"occurrencesHighlight",!0,{description:E("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:ct(new er(81,"overviewRulerBorder",!0,{description:E("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:ct(new fo(82,"overviewRulerLanes",3,0,3)),padding:ct(new vFi),pasteAs:ct(new PFi),parameterHints:ct(new bFi),peekWidgetDefaultFocus:ct(new ks(86,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[E("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),E("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:E("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:ct(new er(87,"definitionLinkOpensInPeek",!1,{description:E("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:ct(new CFi),quickSuggestionsDelay:ct(new fo(89,"quickSuggestionsDelay",10,0,1073741824,{description:E("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:ct(new er(90,"readOnly",!1)),readOnlyMessage:ct(new EFi),renameOnType:ct(new er(92,"renameOnType",!1,{description:E("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:E("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:ct(new er(93,"renderControlCharacters",!0,{description:E("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:ct(new ks(94,"renderFinalNewline",fu?"dimmed":"on",["off","on","dimmed"],{description:E("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:ct(new ks(95,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",E("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:E("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:ct(new er(96,"renderLineHighlightOnlyWhenFocus",!1,{description:E("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:ct(new ks(97,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:ct(new ks(98,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",E("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),E("renderWhitespace.selection","Render whitespace characters only on selected text."),E("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:E("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:ct(new fo(99,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:ct(new er(100,"roundedSelection",!0,{description:E("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:ct(new SFi),scrollbar:ct(new xFi),scrollBeyondLastColumn:ct(new fo(103,"scrollBeyondLastColumn",4,0,1073741824,{description:E("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:ct(new er(104,"scrollBeyondLastLine",!0,{description:E("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:ct(new er(105,"scrollPredominantAxis",!0,{description:E("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:ct(new er(106,"selectionClipboard",!0,{description:E("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:fu})),selectionHighlight:ct(new er(107,"selectionHighlight",!0,{description:E("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:ct(new er(108,"selectOnLineNumbers",!0)),showFoldingControls:ct(new ks(109,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[E("showFoldingControls.always","Always show the folding controls."),E("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),E("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:E("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:ct(new er(110,"showUnused",!0,{description:E("showUnused","Controls fading out of unused code.")})),showDeprecated:ct(new er(138,"showDeprecated",!0,{description:E("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:ct(new fFi),snippetSuggestions:ct(new ks(111,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[E("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),E("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),E("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),E("snippetSuggestions.none","Do not show snippet suggestions.")],description:E("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:ct(new AFi),smoothScrolling:ct(new er(113,"smoothScrolling",!1,{description:E("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:ct(new fo(116,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:ct(new DFi),inlineSuggest:ct(new TFi),inlineCompletionsAccessibilityVerbose:ct(new er(147,"inlineCompletionsAccessibilityVerbose",!1,{description:E("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:ct(new fo(118,"suggestFontSize",0,0,1e3,{markdownDescription:E("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:ct(new fo(119,"suggestLineHeight",0,0,1e3,{markdownDescription:E("suggestLineHeight","Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:ct(new er(120,"suggestOnTriggerCharacters",!0,{description:E("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:ct(new ks(121,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[E("suggestSelection.first","Always select the first suggestion."),E("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),E("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:E("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:ct(new ks(122,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[E("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),E("tabCompletion.off","Disable tab completions."),E("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:E("tabCompletion","Enables tab completions.")})),tabIndex:ct(new fo(123,"tabIndex",0,-1,1073741824)),unicodeHighlight:ct(new kFi),unusualLineTerminators:ct(new ks(125,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[E("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),E("unusualLineTerminators.off","Unusual line terminators are ignored."),E("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:E("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:ct(new er(126,"useShadowDOM",!0)),useTabStops:ct(new er(127,"useTabStops",!0,{description:E("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:ct(new ks(128,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[E("wordBreak.normal","Use the default line break rule."),E("wordBreak.keepAll","Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:E("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:ct(new Kd(129,"wordSeparators",Lje,{description:E("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:ct(new ks(130,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[E("wordWrap.off","Lines will never wrap."),E("wordWrap.on","Lines will wrap at the viewport width."),E({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),E({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:E({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:ct(new Kd(131,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:ct(new Kd(132,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥+")),wordWrapColumn:ct(new fo(133,"wordWrapColumn",80,1,1073741824,{markdownDescription:E({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:ct(new ks(134,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:ct(new ks(135,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:ct(new iFi),defaultColorDecorators:ct(new er(145,"defaultColorDecorators",!1,{markdownDescription:E("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:ct(new yFi),tabFocusMode:ct(new er(142,"tabFocusMode",!1,{markdownDescription:E("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:ct(new wL),wrappingInfo:ct(new NFi),wrappingIndent:ct(new RFi),wrappingStrategy:ct(new uFi)};class $Fi{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?zD.isErrorNoTelemetry(e)?new zD(e.message+`
`+e.stack):new Error(e.message+`
`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const Oje=new $Fi;function fi(n){R_(n)||Oje.onUnexpectedError(n)}function Sa(n){R_(n)||Oje.onUnexpectedExternalError(n)}function cLe(n){if(n instanceof Error){const{name:e,message:t}=n,i=n.stacktrace||n.stack;return{$isError:!0,name:e,message:t,stack:i,noTelemetry:zD.isErrorNoTelemetry(n)}}return n}const SV="Canceled";function R_(n){return n instanceof Xw?!0:n instanceof Error&&n.name===SV&&n.message===SV}class Xw extends Error{constructor(){super(SV),this.name=this.message}}function VFi(){const n=new Error(SV);return n.name=n.message,n}function gg(n){return n?new Error(`Illegal argument: ${n}`):new Error("Illegal argument")}function yme(n){return n?new Error(`Illegal state: ${n}`):new Error("Illegal state")}class HFi extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class zD extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof zD)return e;const t=new zD;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class ya extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,ya.prototype)}}function sw(n){const e=this;let t=!1,i;return function(){return t||(t=!0,i=n.apply(e,arguments)),i}}function Cme(n){return typeof n.dispose=="function"&&n.dispose.length===0}function Hr(n){if(Pi.is(n)){const e=[];for(const t of n)if(t)try{t.dispose()}catch(i){e.push(i)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}function Ip(...n){return Gn(()=>Hr(n))}function Gn(n){return{dispose:sw(()=>{n()})}}class nt{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Hr(this._toDispose)}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?nt.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}deleteAndLeak(e){e&&this._toDispose.has(e)&&this._toDispose.delete(e)}}nt.DISABLE_DISPOSED_WARNING=!1;class Ae{constructor(){this._store=new nt,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)}}Ae.None=Object.freeze({dispose(){}});class Zl{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)===null||t===void 0||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}}class WFi{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class zFi{constructor(e){this.object=e}dispose(){}}class wme{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{Hr(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var r;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||(r=this._store.get(e))===null||r===void 0||r.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))===null||t===void 0||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const jFi=globalThis.performance&&typeof globalThis.performance.now=="function";class $c{static create(e){return new $c(e)}constructor(e){this._now=jFi&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var Pt;(function(n){n.None=()=>Ae.None;function e(M,O){return d(M,()=>{},0,void 0,!0,void 0,O)}n.defer=e;function t(M){return(O,B=null,F)=>{let H=!1,V;return V=M($=>{if(!H)return V?V.dispose():H=!0,O.call(B,$)},null,F),H&&V.dispose(),V}}n.once=t;function i(M,O,B){return c((F,H=null,V)=>M($=>F.call(H,O($)),null,V),B)}n.map=i;function r(M,O,B){return c((F,H=null,V)=>M($=>{O($),F.call(H,$)},null,V),B)}n.forEach=r;function o(M,O,B){return c((F,H=null,V)=>M($=>O($)&&F.call(H,$),null,V),B)}n.filter=o;function s(M){return M}n.signal=s;function a(...M){return(O,B=null,F)=>{const H=Ip(...M.map(V=>V($=>O.call(B,$))));return u(H,F)}}n.any=a;function l(M,O,B,F){let H=B;return i(M,V=>(H=O(H,V),H),F)}n.reduce=l;function c(M,O){let B;const F={onWillAddFirstListener(){B=M(H.fire,H)},onDidRemoveLastListener(){B==null||B.dispose()}},H=new be(F);return O==null||O.add(H),H.event}function u(M,O){return O instanceof Array?O.push(M):O&&O.add(M),M}function d(M,O,B=100,F=!1,H=!1,V,$){let j,Y,ne,se=0,he;const xe={leakWarningThreshold:V,onWillAddFirstListener(){j=M(Ie=>{se++,Y=O(Y,Ie),F&&!ne&&(_e.fire(Y),Y=void 0),he=()=>{const Re=Y;Y=void 0,ne=void 0,(!F||se>1)&&_e.fire(Re),se=0},typeof B=="number"?(clearTimeout(ne),ne=setTimeout(he,B)):ne===void 0&&(ne=0,queueMicrotask(he))})},onWillRemoveListener(){H&&se>0&&(he==null||he())},onDidRemoveLastListener(){he=void 0,j.dispose()}},_e=new be(xe);return $==null||$.add(_e),_e.event}n.debounce=d;function h(M,O=0,B){return n.debounce(M,(F,H)=>F?(F.push(H),F):[H],O,void 0,!0,void 0,B)}n.accumulate=h;function g(M,O=(F,H)=>F===H,B){let F=!0,H;return o(M,V=>{const $=F||!O(V,H);return F=!1,H=V,$},B)}n.latch=g;function p(M,O,B){return[n.filter(M,O,B),n.filter(M,F=>!O(F),B)]}n.split=p;function m(M,O=!1,B=[],F){let H=B.slice(),V=M(Y=>{H?H.push(Y):j.fire(Y)});F&&F.add(V);const $=()=>{H==null||H.forEach(Y=>j.fire(Y)),H=null},j=new be({onWillAddFirstListener(){V||(V=M(Y=>j.fire(Y)),F&&F.add(V))},onDidAddFirstListener(){H&&(O?setTimeout($):$())},onDidRemoveLastListener(){V&&V.dispose(),V=null}});return F&&F.add(j),j.event}n.buffer=m;function _(M,O){return(F,H,V)=>{const $=O(new b);return M(function(j){const Y=$.evaluate(j);Y!==v&&F.call(H,Y)},void 0,V)}}n.chain=_;const v=Symbol("HaltChainable");class b{constructor(){this.steps=[]}map(O){return this.steps.push(O),this}forEach(O){return this.steps.push(B=>(O(B),B)),this}filter(O){return this.steps.push(B=>O(B)?B:v),this}reduce(O,B){let F=B;return this.steps.push(H=>(F=O(F,H),F)),this}latch(O=(B,F)=>B===F){let B=!0,F;return this.steps.push(H=>{const V=B||!O(H,F);return B=!1,F=H,V?H:v}),this}evaluate(O){for(const B of this.steps)if(O=B(O),O===v)break;return O}}function y(M,O,B=F=>F){const F=(...j)=>$.fire(B(...j)),H=()=>M.on(O,F),V=()=>M.removeListener(O,F),$=new be({onWillAddFirstListener:H,onDidRemoveLastListener:V});return $.event}n.fromNodeEventEmitter=y;function C(M,O,B=F=>F){const F=(...j)=>$.fire(B(...j)),H=()=>M.addEventListener(O,F),V=()=>M.removeEventListener(O,F),$=new be({onWillAddFirstListener:H,onDidRemoveLastListener:V});return $.event}n.fromDOMEventEmitter=C;function x(M){return new Promise(O=>t(M)(O))}n.toPromise=x;function k(M){const O=new be;return M.then(B=>{O.fire(B)},()=>{O.fire(void 0)}).finally(()=>{O.dispose()}),O.event}n.fromPromise=k;function I(M,O){return O(void 0),M(B=>O(B))}n.runAndSubscribe=I;function L(M,O){let B=null;function F(V){B==null||B.dispose(),B=new nt,O(V,B)}F(void 0);const H=M(V=>F(V));return Gn(()=>{H.dispose(),B==null||B.dispose()})}n.runAndSubscribeWithStore=L;class D{constructor(O,B){this._observable=O,this._counter=0,this._hasChanged=!1;const F={onWillAddFirstListener:()=>{O.addObserver(this)},onDidRemoveLastListener:()=>{O.removeObserver(this)}};this.emitter=new be(F),B&&B.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,B){this._hasChanged=!0}endUpdate(O){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function R(M,O){return new D(M,O).emitter.event}n.fromObservable=R;function P(M){return O=>{let B=0,F=!1;const H={beginUpdate(){B++},endUpdate(){B--,B===0&&(M.reportChanges(),F&&(F=!1,O()))},handlePossibleChange(){},handleChange(){F=!0}};return M.addObserver(H),M.reportChanges(),{dispose(){M.removeObserver(H)}}}}n.fromObservableLight=P})(Pt||(Pt={}));class jD{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${jD._idPool++}`,jD.all.add(this)}start(e){this._stopWatch=new $c,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}jD.all=new Set;jD._idPool=0;let UFi=-1;class qFi{constructor(e,t=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=t,this._warnCountdown=0}dispose(){var e;(e=this._stacks)===null||e===void 0||e.clear()}check(e,t){const i=this.threshold;if(i<=0||t<i)return;this._stacks||(this._stacks=new Map);const r=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,r+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=i*.5;let o,s=0;for(const[a,l]of this._stacks)(!o||s<l)&&(o=a,s=l);console.warn(`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${s}):`),console.warn(o)}return()=>{const o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}}class Sme{static create(){var e;return new Sme((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split(`
`).slice(2).join(`
`))}}class qX{constructor(e){this.value=e}}const KFi=2;let be=class{constructor(e){var t,i,r,o,s;this._size=0,this._options=e,this._leakageMon=!((t=this._options)===null||t===void 0)&&t.leakWarningThreshold?new qFi((r=(i=this._options)===null||i===void 0?void 0:i.leakWarningThreshold)!==null&&r!==void 0?r:UFi):void 0,this._perfMon=!((o=this._options)===null||o===void 0)&&o._profName?new jD(this._options._profName):void 0,this._deliveryQueue=(s=this._options)===null||s===void 0?void 0:s.deliveryQueue}dispose(){var e,t,i,r;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)===null||e===void 0?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(i=(t=this._options)===null||t===void 0?void 0:t.onDidRemoveLastListener)===null||i===void 0||i.call(t),(r=this._leakageMon)===null||r===void 0||r.dispose())}get event(){var e;return(e=this._event)!==null&&e!==void 0||(this._event=(t,i,r)=>{var o,s,a,l,c;if(this._leakageMon&&this._size>this._leakageMon.threshold*3)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),Ae.None;if(this._disposed)return Ae.None;i&&(t=t.bind(i));const u=new qX(t);let d;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(u.stack=Sme.create(),d=this._leakageMon.check(u.stack,this._size+1)),this._listeners?this._listeners instanceof qX?((c=this._deliveryQueue)!==null&&c!==void 0||(this._deliveryQueue=new Pje),this._listeners=[this._listeners,u]):this._listeners.push(u):((s=(o=this._options)===null||o===void 0?void 0:o.onWillAddFirstListener)===null||s===void 0||s.call(o,this),this._listeners=u,(l=(a=this._options)===null||a===void 0?void 0:a.onDidAddFirstListener)===null||l===void 0||l.call(a,this)),this._size++;const h=Gn(()=>{d==null||d(),this._removeListener(u)});return r instanceof nt?r.add(h):Array.isArray(r)&&r.push(h),h}),this._event}_removeListener(e){var t,i,r,o;if((i=(t=this._options)===null||t===void 0?void 0:t.onWillRemoveListener)===null||i===void 0||i.call(t,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(o=(r=this._options)===null||r===void 0?void 0:r.onDidRemoveLastListener)===null||o===void 0||o.call(r,this),this._size=0;return}const s=this._listeners,a=s.indexOf(e);if(a===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,s[a]=void 0;const l=this._deliveryQueue.current===this;if(this._size*KFi<=s.length){let c=0;for(let u=0;u<s.length;u++)s[u]?s[c++]=s[u]:l&&(this._deliveryQueue.end--,c<this._deliveryQueue.i&&this._deliveryQueue.i--);s.length=c}}_deliver(e,t){var i;if(!e)return;const r=((i=this._options)===null||i===void 0?void 0:i.onListenerError)||fi;if(!r){e.value(t);return}try{e.value(t)}catch(o){r(o)}}_deliverQueue(e){const t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,i,r,o;if(!((t=this._deliveryQueue)===null||t===void 0)&&t.current&&(this._deliverQueue(this._deliveryQueue),(i=this._perfMon)===null||i===void 0||i.stop()),(r=this._perfMon)===null||r===void 0||r.start(this._size),this._listeners)if(this._listeners instanceof qX)this._deliver(this._listeners,e);else{const s=this._deliveryQueue;s.enqueue(this,e,this._listeners.length),this._deliverQueue(s)}(o=this._perfMon)===null||o===void 0||o.stop()}hasListeners(){return this._size>0}};const GFi=()=>new Pje;class Pje{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class Lx extends be{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Hu,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class Mje extends Lx{constructor(e){var t;super(e),this._delay=(t=e.delay)!==null&&t!==void 0?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class YFi extends be{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e==null?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}}class QFi{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new be({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),Gn(sw(()=>{this.hasListeners&&this.unhook(t);const r=this.events.indexOf(t);this.events.splice(r,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){e.listener&&e.listener.dispose(),e.listener=null}dispose(){this.emitter.dispose()}}class Eme{constructor(){this.buffers=[]}wrapEvent(e){return(t,i,r)=>e(o=>{const s=this.buffers[this.buffers.length-1];s?s.push(()=>t.call(i,o)):t.call(i,o)},void 0,r)}bufferEvents(e){const t=[];this.buffers.push(t);const i=e();return this.buffers.pop(),t.forEach(r=>r()),i}}class uLe{constructor(){this.listening=!1,this.inputEvent=Pt.None,this.inputEventListener=Ae.None,this.emitter=new be({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{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()}}const Fje=Object.freeze(function(n,e){const t=setTimeout(n.bind(e),0);return{dispose(){clearTimeout(t)}}});var Mi;(function(n){function e(t){return t===n.None||t===n.Cancelled||t instanceof x8?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}n.isCancellationToken=e,n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Pt.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Fje})})(Mi||(Mi={}));class x8{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?Fje:(this._emitter||(this._emitter=new be),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let da=class{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 x8),this._token}cancel(){this._token?this._token instanceof x8&&this._token.cancel():this._token=Mi.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)===null||t===void 0||t.dispose(),this._token?this._token instanceof x8&&this._token.dispose():this._token=Mi.None}};class xme{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 k8=new xme,Qre=new xme,Xre=new xme,Bje=new Array(230),XFi=Object.create(null),ZFi=Object.create(null),kme=[];for(let n=0;n<=193;n++)kme[n]=-1;(function(){const n="",e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",n,n],[1,1,"Hyper",0,n,0,n,n,n],[1,2,"Super",0,n,0,n,n,n],[1,3,"Fn",0,n,0,n,n,n],[1,4,"FnLock",0,n,0,n,n,n],[1,5,"Suspend",0,n,0,n,n,n],[1,6,"Resume",0,n,0,n,n,n],[1,7,"Turbo",0,n,0,n,n,n],[1,8,"Sleep",0,n,0,"VK_SLEEP",n,n],[1,9,"WakeUp",0,n,0,n,n,n],[0,10,"KeyA",31,"A",65,"VK_A",n,n],[0,11,"KeyB",32,"B",66,"VK_B",n,n],[0,12,"KeyC",33,"C",67,"VK_C",n,n],[0,13,"KeyD",34,"D",68,"VK_D",n,n],[0,14,"KeyE",35,"E",69,"VK_E",n,n],[0,15,"KeyF",36,"F",70,"VK_F",n,n],[0,16,"KeyG",37,"G",71,"VK_G",n,n],[0,17,"KeyH",38,"H",72,"VK_H",n,n],[0,18,"KeyI",39,"I",73,"VK_I",n,n],[0,19,"KeyJ",40,"J",74,"VK_J",n,n],[0,20,"KeyK",41,"K",75,"VK_K",n,n],[0,21,"KeyL",42,"L",76,"VK_L",n,n],[0,22,"KeyM",43,"M",77,"VK_M",n,n],[0,23,"KeyN",44,"N",78,"VK_N",n,n],[0,24,"KeyO",45,"O",79,"VK_O",n,n],[0,25,"KeyP",46,"P",80,"VK_P",n,n],[0,26,"KeyQ",47,"Q",81,"VK_Q",n,n],[0,27,"KeyR",48,"R",82,"VK_R",n,n],[0,28,"KeyS",49,"S",83,"VK_S",n,n],[0,29,"KeyT",50,"T",84,"VK_T",n,n],[0,30,"KeyU",51,"U",85,"VK_U",n,n],[0,31,"KeyV",52,"V",86,"VK_V",n,n],[0,32,"KeyW",53,"W",87,"VK_W",n,n],[0,33,"KeyX",54,"X",88,"VK_X",n,n],[0,34,"KeyY",55,"Y",89,"VK_Y",n,n],[0,35,"KeyZ",56,"Z",90,"VK_Z",n,n],[0,36,"Digit1",22,"1",49,"VK_1",n,n],[0,37,"Digit2",23,"2",50,"VK_2",n,n],[0,38,"Digit3",24,"3",51,"VK_3",n,n],[0,39,"Digit4",25,"4",52,"VK_4",n,n],[0,40,"Digit5",26,"5",53,"VK_5",n,n],[0,41,"Digit6",27,"6",54,"VK_6",n,n],[0,42,"Digit7",28,"7",55,"VK_7",n,n],[0,43,"Digit8",29,"8",56,"VK_8",n,n],[0,44,"Digit9",30,"9",57,"VK_9",n,n],[0,45,"Digit0",21,"0",48,"VK_0",n,n],[1,46,"Enter",3,"Enter",13,"VK_RETURN",n,n],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",n,n],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",n,n],[1,49,"Tab",2,"Tab",9,"VK_TAB",n,n],[1,50,"Space",10,"Space",32,"VK_SPACE",n,n],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,n,0,n,n,n],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",n,n],[1,64,"F1",59,"F1",112,"VK_F1",n,n],[1,65,"F2",60,"F2",113,"VK_F2",n,n],[1,66,"F3",61,"F3",114,"VK_F3",n,n],[1,67,"F4",62,"F4",115,"VK_F4",n,n],[1,68,"F5",63,"F5",116,"VK_F5",n,n],[1,69,"F6",64,"F6",117,"VK_F6",n,n],[1,70,"F7",65,"F7",118,"VK_F7",n,n],[1,71,"F8",66,"F8",119,"VK_F8",n,n],[1,72,"F9",67,"F9",120,"VK_F9",n,n],[1,73,"F10",68,"F10",121,"VK_F10",n,n],[1,74,"F11",69,"F11",122,"VK_F11",n,n],[1,75,"F12",70,"F12",123,"VK_F12",n,n],[1,76,"PrintScreen",0,n,0,n,n,n],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",n,n],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",n,n],[1,79,"Insert",19,"Insert",45,"VK_INSERT",n,n],[1,80,"Home",14,"Home",36,"VK_HOME",n,n],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",n,n],[1,82,"Delete",20,"Delete",46,"VK_DELETE",n,n],[1,83,"End",13,"End",35,"VK_END",n,n],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",n,n],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",n],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",n],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",n],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",n],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",n,n],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",n,n],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",n,n],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",n,n],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",n,n],[1,94,"NumpadEnter",3,n,0,n,n,n],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",n,n],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",n,n],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",n,n],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",n,n],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",n,n],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",n,n],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",n,n],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",n,n],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",n,n],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",n,n],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",n,n],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",n,n],[1,107,"ContextMenu",58,"ContextMenu",93,n,n,n],[1,108,"Power",0,n,0,n,n,n],[1,109,"NumpadEqual",0,n,0,n,n,n],[1,110,"F13",71,"F13",124,"VK_F13",n,n],[1,111,"F14",72,"F14",125,"VK_F14",n,n],[1,112,"F15",73,"F15",126,"VK_F15",n,n],[1,113,"F16",74,"F16",127,"VK_F16",n,n],[1,114,"F17",75,"F17",128,"VK_F17",n,n],[1,115,"F18",76,"F18",129,"VK_F18",n,n],[1,116,"F19",77,"F19",130,"VK_F19",n,n],[1,117,"F20",78,"F20",131,"VK_F20",n,n],[1,118,"F21",79,"F21",132,"VK_F21",n,n],[1,119,"F22",80,"F22",133,"VK_F22",n,n],[1,120,"F23",81,"F23",134,"VK_F23",n,n],[1,121,"F24",82,"F24",135,"VK_F24",n,n],[1,122,"Open",0,n,0,n,n,n],[1,123,"Help",0,n,0,n,n,n],[1,124,"Select",0,n,0,n,n,n],[1,125,"Again",0,n,0,n,n,n],[1,126,"Undo",0,n,0,n,n,n],[1,127,"Cut",0,n,0,n,n,n],[1,128,"Copy",0,n,0,n,n,n],[1,129,"Paste",0,n,0,n,n,n],[1,130,"Find",0,n,0,n,n,n],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",n,n],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",n,n],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",n,n],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",n,n],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",n,n],[1,136,"KanaMode",0,n,0,n,n,n],[0,137,"IntlYen",0,n,0,n,n,n],[1,138,"Convert",0,n,0,n,n,n],[1,139,"NonConvert",0,n,0,n,n,n],[1,140,"Lang1",0,n,0,n,n,n],[1,141,"Lang2",0,n,0,n,n,n],[1,142,"Lang3",0,n,0,n,n,n],[1,143,"Lang4",0,n,0,n,n,n],[1,144,"Lang5",0,n,0,n,n,n],[1,145,"Abort",0,n,0,n,n,n],[1,146,"Props",0,n,0,n,n,n],[1,147,"NumpadParenLeft",0,n,0,n,n,n],[1,148,"NumpadParenRight",0,n,0,n,n,n],[1,149,"NumpadBackspace",0,n,0,n,n,n],[1,150,"NumpadMemoryStore",0,n,0,n,n,n],[1,151,"NumpadMemoryRecall",0,n,0,n,n,n],[1,152,"NumpadMemoryClear",0,n,0,n,n,n],[1,153,"NumpadMemoryAdd",0,n,0,n,n,n],[1,154,"NumpadMemorySubtract",0,n,0,n,n,n],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",n,n],[1,156,"NumpadClearEntry",0,n,0,n,n,n],[1,0,n,5,"Ctrl",17,"VK_CONTROL",n,n],[1,0,n,4,"Shift",16,"VK_SHIFT",n,n],[1,0,n,6,"Alt",18,"VK_MENU",n,n],[1,0,n,57,"Meta",91,"VK_COMMAND",n,n],[1,157,"ControlLeft",5,n,0,"VK_LCONTROL",n,n],[1,158,"ShiftLeft",4,n,0,"VK_LSHIFT",n,n],[1,159,"AltLeft",6,n,0,"VK_LMENU",n,n],[1,160,"MetaLeft",57,n,0,"VK_LWIN",n,n],[1,161,"ControlRight",5,n,0,"VK_RCONTROL",n,n],[1,162,"ShiftRight",4,n,0,"VK_RSHIFT",n,n],[1,163,"AltRight",6,n,0,"VK_RMENU",n,n],[1,164,"MetaRight",57,n,0,"VK_RWIN",n,n],[1,165,"BrightnessUp",0,n,0,n,n,n],[1,166,"BrightnessDown",0,n,0,n,n,n],[1,167,"MediaPlay",0,n,0,n,n,n],[1,168,"MediaRecord",0,n,0,n,n,n],[1,169,"MediaFastForward",0,n,0,n,n,n],[1,170,"MediaRewind",0,n,0,n,n,n],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",n,n],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",n,n],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",n,n],[1,174,"Eject",0,n,0,n,n,n],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",n,n],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",n,n],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",n,n],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",n,n],[1,179,"LaunchApp1",0,n,0,"VK_MEDIA_LAUNCH_APP1",n,n],[1,180,"SelectTask",0,n,0,n,n,n],[1,181,"LaunchScreenSaver",0,n,0,n,n,n],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",n,n],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",n,n],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",n,n],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",n,n],[1,186,"BrowserStop",0,n,0,"VK_BROWSER_STOP",n,n],[1,187,"BrowserRefresh",0,n,0,"VK_BROWSER_REFRESH",n,n],[1,188,"BrowserFavorites",0,n,0,"VK_BROWSER_FAVORITES",n,n],[1,189,"ZoomToggle",0,n,0,n,n,n],[1,190,"MailReply",0,n,0,n,n,n],[1,191,"MailForward",0,n,0,n,n,n],[1,192,"MailSend",0,n,0,n,n,n],[1,0,n,114,"KeyInComposition",229,n,n,n],[1,0,n,116,"ABNT_C2",194,"VK_ABNT_C2",n,n],[1,0,n,96,"OEM_8",223,"VK_OEM_8",n,n],[1,0,n,0,n,0,"VK_KANA",n,n],[1,0,n,0,n,0,"VK_HANGUL",n,n],[1,0,n,0,n,0,"VK_JUNJA",n,n],[1,0,n,0,n,0,"VK_FINAL",n,n],[1,0,n,0,n,0,"VK_HANJA",n,n],[1,0,n,0,n,0,"VK_KANJI",n,n],[1,0,n,0,n,0,"VK_CONVERT",n,n],[1,0,n,0,n,0,"VK_NONCONVERT",n,n],[1,0,n,0,n,0,"VK_ACCEPT",n,n],[1,0,n,0,n,0,"VK_MODECHANGE",n,n],[1,0,n,0,n,0,"VK_SELECT",n,n],[1,0,n,0,n,0,"VK_PRINT",n,n],[1,0,n,0,n,0,"VK_EXECUTE",n,n],[1,0,n,0,n,0,"VK_SNAPSHOT",n,n],[1,0,n,0,n,0,"VK_HELP",n,n],[1,0,n,0,n,0,"VK_APPS",n,n],[1,0,n,0,n,0,"VK_PROCESSKEY",n,n],[1,0,n,0,n,0,"VK_PACKET",n,n],[1,0,n,0,n,0,"VK_DBE_SBCSCHAR",n,n],[1,0,n,0,n,0,"VK_DBE_DBCSCHAR",n,n],[1,0,n,0,n,0,"VK_ATTN",n,n],[1,0,n,0,n,0,"VK_CRSEL",n,n],[1,0,n,0,n,0,"VK_EXSEL",n,n],[1,0,n,0,n,0,"VK_EREOF",n,n],[1,0,n,0,n,0,"VK_PLAY",n,n],[1,0,n,0,n,0,"VK_ZOOM",n,n],[1,0,n,0,n,0,"VK_NONAME",n,n],[1,0,n,0,n,0,"VK_PA1",n,n],[1,0,n,0,n,0,"VK_OEM_CLEAR",n,n]],t=[],i=[];for(const r of e){const[o,s,a,l,c,u,d,h,g]=r;if(i[s]||(i[s]=!0,XFi[a]=s,ZFi[a.toLowerCase()]=s,o&&(kme[s]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);k8.define(l,c),Qre.define(l,h||c),Xre.define(l,g||h||c)}u&&(Bje[u]=l)}})();var Cy;(function(n){function e(a){return k8.keyCodeToStr(a)}n.toString=e;function t(a){return k8.strToKeyCode(a)}n.fromString=t;function i(a){return Qre.keyCodeToStr(a)}n.toUserSettingsUS=i;function r(a){return Xre.keyCodeToStr(a)}n.toUserSettingsGeneral=r;function o(a){return Qre.strToKeyCode(a)||Xre.strToKeyCode(a)}n.fromUserSettings=o;function s(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return k8.keyCodeToStr(a)}n.toElectronAccelerator=s})(Cy||(Cy={}));function Ma(n,e){const t=(e&65535)<<16>>>0;return(n|t)>>>0}let EL;if(typeof Tp.vscode<"u"&&typeof Tp.vscode.process<"u"){const n=Tp.vscode.process;EL={get platform(){return n.platform},get arch(){return n.arch},get env(){return n.env},cwd(){return n.cwd()}}}else typeof process<"u"?EL={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:EL={get platform(){return vc?"win32":Qi?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const EV=EL.cwd,$je=EL.env,JFi=EL.platform,e6i=65,t6i=97,n6i=90,i6i=122,IC=46,Yc=47,Th=92,J0=58,r6i=63;class Vje extends Error{constructor(e,t,i){let r;typeof t=="string"&&t.indexOf("not ")===0?(r="must not be",t=t.replace(/^not /,"")):r="must be";const o=e.indexOf(".")!==-1?"property":"argument";let s=`The "${e}" ${o} ${r} of type ${t}`;s+=`. Received type ${typeof i}`,super(s),this.code="ERR_INVALID_ARG_TYPE"}}function o6i(n,e){if(n===null||typeof n!="object")throw new Vje(e,"Object",n)}function pl(n,e){if(typeof n!="string")throw new Vje(e,"string",n)}const Zw=JFi==="win32";function qr(n){return n===Yc||n===Th}function Zre(n){return n===Yc}function e1(n){return n>=e6i&&n<=n6i||n>=t6i&&n<=i6i}function xV(n,e,t,i){let r="",o=0,s=-1,a=0,l=0;for(let c=0;c<=n.length;++c){if(c<n.length)l=n.charCodeAt(c);else{if(i(l))break;l=Yc}if(i(l)){if(!(s===c-1||a===1))if(a===2){if(r.length<2||o!==2||r.charCodeAt(r.length-1)!==IC||r.charCodeAt(r.length-2)!==IC){if(r.length>2){const u=r.lastIndexOf(t);u===-1?(r="",o=0):(r=r.slice(0,u),o=r.length-1-r.lastIndexOf(t)),s=c,a=0;continue}else if(r.length!==0){r="",o=0,s=c,a=0;continue}}e&&(r+=r.length>0?`${t}..`:"..",o=2)}else r.length>0?r+=`${t}${n.slice(s+1,c)}`:r=n.slice(s+1,c),o=c-s-1;s=c,a=0}else l===IC&&a!==-1?++a:a=-1}return r}function Hje(n,e){o6i(e,"pathObject");const t=e.dir||e.root,i=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${i}`:`${t}${n}${i}`:i}const Zd={resolve(...n){let e="",t="",i=!1;for(let r=n.length-1;r>=-1;r--){let o;if(r>=0){if(o=n[r],pl(o,"path"),o.length===0)continue}else e.length===0?o=EV():(o=$je[`=${e}`]||EV(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===Th)&&(o=`${e}\\`));const s=o.length;let a=0,l="",c=!1;const u=o.charCodeAt(0);if(s===1)qr(u)&&(a=1,c=!0);else if(qr(u))if(c=!0,qr(o.charCodeAt(1))){let d=2,h=d;for(;d<s&&!qr(o.charCodeAt(d));)d++;if(d<s&&d!==h){const g=o.slice(h,d);for(h=d;d<s&&qr(o.charCodeAt(d));)d++;if(d<s&&d!==h){for(h=d;d<s&&!qr(o.charCodeAt(d));)d++;(d===s||d!==h)&&(l=`\\\\${g}\\${o.slice(h,d)}`,a=d)}}}else a=1;else e1(u)&&o.charCodeAt(1)===J0&&(l=o.slice(0,2),a=2,s>2&&qr(o.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(i){if(e.length>0)break}else if(t=`${o.slice(a)}\\${t}`,i=c,c&&e.length>0)break}return t=xV(t,!i,"\\",qr),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(n){pl(n,"path");const e=n.length;if(e===0)return".";let t=0,i,r=!1;const o=n.charCodeAt(0);if(e===1)return Zre(o)?"\\":n;if(qr(o))if(r=!0,qr(n.charCodeAt(1))){let a=2,l=a;for(;a<e&&!qr(n.charCodeAt(a));)a++;if(a<e&&a!==l){const c=n.slice(l,a);for(l=a;a<e&&qr(n.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!qr(n.charCodeAt(a));)a++;if(a===e)return`\\\\${c}\\${n.slice(l)}\\`;a!==l&&(i=`\\\\${c}\\${n.slice(l,a)}`,t=a)}}}else t=1;else e1(o)&&n.charCodeAt(1)===J0&&(i=n.slice(0,2),t=2,e>2&&qr(n.charCodeAt(2))&&(r=!0,t=3));let s=t<e?xV(n.slice(t),!r,"\\",qr):"";return s.length===0&&!r&&(s="."),s.length>0&&qr(n.charCodeAt(e-1))&&(s+="\\"),i===void 0?r?`\\${s}`:s:r?`${i}\\${s}`:`${i}${s}`},isAbsolute(n){pl(n,"path");const e=n.length;if(e===0)return!1;const t=n.charCodeAt(0);return qr(t)||e>2&&e1(t)&&n.charCodeAt(1)===J0&&qr(n.charCodeAt(2))},join(...n){if(n.length===0)return".";let e,t;for(let o=0;o<n.length;++o){const s=n[o];pl(s,"path"),s.length>0&&(e===void 0?e=t=s:e+=`\\${s}`)}if(e===void 0)return".";let i=!0,r=0;if(typeof t=="string"&&qr(t.charCodeAt(0))){++r;const o=t.length;o>1&&qr(t.charCodeAt(1))&&(++r,o>2&&(qr(t.charCodeAt(2))?++r:i=!1))}if(i){for(;r<e.length&&qr(e.charCodeAt(r));)r++;r>=2&&(e=`\\${e.slice(r)}`)}return Zd.normalize(e)},relative(n,e){if(pl(n,"from"),pl(e,"to"),n===e)return"";const t=Zd.resolve(n),i=Zd.resolve(e);if(t===i||(n=t.toLowerCase(),e=i.toLowerCase(),n===e))return"";let r=0;for(;r<n.length&&n.charCodeAt(r)===Th;)r++;let o=n.length;for(;o-1>r&&n.charCodeAt(o-1)===Th;)o--;const s=o-r;let a=0;for(;a<e.length&&e.charCodeAt(a)===Th;)a++;let l=e.length;for(;l-1>a&&e.charCodeAt(l-1)===Th;)l--;const c=l-a,u=s<c?s:c;let d=-1,h=0;for(;h<u;h++){const p=n.charCodeAt(r+h);if(p!==e.charCodeAt(a+h))break;p===Th&&(d=h)}if(h!==u){if(d===-1)return i}else{if(c>u){if(e.charCodeAt(a+h)===Th)return i.slice(a+h+1);if(h===2)return i.slice(a+h)}s>u&&(n.charCodeAt(r+h)===Th?d=h:h===2&&(d=3)),d===-1&&(d=0)}let g="";for(h=r+d+1;h<=o;++h)(h===o||n.charCodeAt(h)===Th)&&(g+=g.length===0?"..":"\\..");return a+=d,g.length>0?`${g}${i.slice(a,l)}`:(i.charCodeAt(a)===Th&&++a,i.slice(a,l))},toNamespacedPath(n){if(typeof n!="string"||n.length===0)return n;const e=Zd.resolve(n);if(e.length<=2)return n;if(e.charCodeAt(0)===Th){if(e.charCodeAt(1)===Th){const t=e.charCodeAt(2);if(t!==r6i&&t!==IC)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(e1(e.charCodeAt(0))&&e.charCodeAt(1)===J0&&e.charCodeAt(2)===Th)return`\\\\?\\${e}`;return n},dirname(n){pl(n,"path");const e=n.length;if(e===0)return".";let t=-1,i=0;const r=n.charCodeAt(0);if(e===1)return qr(r)?n:".";if(qr(r)){if(t=i=1,qr(n.charCodeAt(1))){let a=2,l=a;for(;a<e&&!qr(n.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&qr(n.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!qr(n.charCodeAt(a));)a++;if(a===e)return n;a!==l&&(t=i=a+1)}}}}else e1(r)&&n.charCodeAt(1)===J0&&(t=e>2&&qr(n.charCodeAt(2))?3:2,i=t);let o=-1,s=!0;for(let a=e-1;a>=i;--a)if(qr(n.charCodeAt(a))){if(!s){o=a;break}}else s=!1;if(o===-1){if(t===-1)return".";o=t}return n.slice(0,o)},basename(n,e){e!==void 0&&pl(e,"ext"),pl(n,"path");let t=0,i=-1,r=!0,o;if(n.length>=2&&e1(n.charCodeAt(0))&&n.charCodeAt(1)===J0&&(t=2),e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let s=e.length-1,a=-1;for(o=n.length-1;o>=t;--o){const l=n.charCodeAt(o);if(qr(l)){if(!r){t=o+1;break}}else a===-1&&(r=!1,a=o+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(i=o):(s=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(o=n.length-1;o>=t;--o)if(qr(n.charCodeAt(o))){if(!r){t=o+1;break}}else i===-1&&(r=!1,i=o+1);return i===-1?"":n.slice(t,i)},extname(n){pl(n,"path");let e=0,t=-1,i=0,r=-1,o=!0,s=0;n.length>=2&&n.charCodeAt(1)===J0&&e1(n.charCodeAt(0))&&(e=i=2);for(let a=n.length-1;a>=e;--a){const l=n.charCodeAt(a);if(qr(l)){if(!o){i=a+1;break}continue}r===-1&&(o=!1,r=a+1),l===IC?t===-1?t=a:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||r===-1||s===0||s===1&&t===r-1&&t===i+1?"":n.slice(t,r)},format:Hje.bind(null,"\\"),parse(n){pl(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.length;let i=0,r=n.charCodeAt(0);if(t===1)return qr(r)?(e.root=e.dir=n,e):(e.base=e.name=n,e);if(qr(r)){if(i=1,qr(n.charCodeAt(1))){let d=2,h=d;for(;d<t&&!qr(n.charCodeAt(d));)d++;if(d<t&&d!==h){for(h=d;d<t&&qr(n.charCodeAt(d));)d++;if(d<t&&d!==h){for(h=d;d<t&&!qr(n.charCodeAt(d));)d++;d===t?i=d:d!==h&&(i=d+1)}}}}else if(e1(r)&&n.charCodeAt(1)===J0){if(t<=2)return e.root=e.dir=n,e;if(i=2,qr(n.charCodeAt(2))){if(t===3)return e.root=e.dir=n,e;i=3}}i>0&&(e.root=n.slice(0,i));let o=-1,s=i,a=-1,l=!0,c=n.length-1,u=0;for(;c>=i;--c){if(r=n.charCodeAt(c),qr(r)){if(!l){s=c+1;break}continue}a===-1&&(l=!1,a=c+1),r===IC?o===-1?o=c:u!==1&&(u=1):o!==-1&&(u=-1)}return a!==-1&&(o===-1||u===0||u===1&&o===a-1&&o===s+1?e.base=e.name=n.slice(s,a):(e.name=n.slice(s,o),e.base=n.slice(s,a),e.ext=n.slice(o,a))),s>0&&s!==i?e.dir=n.slice(0,s-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},s6i=(()=>{if(Zw){const n=/\\/g;return()=>{const e=EV().replace(n,"/");return e.slice(e.indexOf("/"))}}return()=>EV()})(),Ra={resolve(...n){let e="",t=!1;for(let i=n.length-1;i>=-1&&!t;i--){const r=i>=0?n[i]:s6i();pl(r,"path"),r.length!==0&&(e=`${r}/${e}`,t=r.charCodeAt(0)===Yc)}return e=xV(e,!t,"/",Zre),t?`/${e}`:e.length>0?e:"."},normalize(n){if(pl(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===Yc,t=n.charCodeAt(n.length-1)===Yc;return n=xV(n,!e,"/",Zre),n.length===0?e?"/":t?"./":".":(t&&(n+="/"),e?`/${n}`:n)},isAbsolute(n){return pl(n,"path"),n.length>0&&n.charCodeAt(0)===Yc},join(...n){if(n.length===0)return".";let e;for(let t=0;t<n.length;++t){const i=n[t];pl(i,"path"),i.length>0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":Ra.normalize(e)},relative(n,e){if(pl(n,"from"),pl(e,"to"),n===e||(n=Ra.resolve(n),e=Ra.resolve(e),n===e))return"";const t=1,i=n.length,r=i-t,o=1,s=e.length-o,a=r<s?r:s;let l=-1,c=0;for(;c<a;c++){const d=n.charCodeAt(t+c);if(d!==e.charCodeAt(o+c))break;d===Yc&&(l=c)}if(c===a)if(s>a){if(e.charCodeAt(o+c)===Yc)return e.slice(o+c+1);if(c===0)return e.slice(o+c)}else r>a&&(n.charCodeAt(t+c)===Yc?l=c:c===0&&(l=0));let u="";for(c=t+l+1;c<=i;++c)(c===i||n.charCodeAt(c)===Yc)&&(u+=u.length===0?"..":"/..");return`${u}${e.slice(o+l)}`},toNamespacedPath(n){return n},dirname(n){if(pl(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===Yc;let t=-1,i=!0;for(let r=n.length-1;r>=1;--r)if(n.charCodeAt(r)===Yc){if(!i){t=r;break}}else i=!1;return t===-1?e?"/":".":e&&t===1?"//":n.slice(0,t)},basename(n,e){e!==void 0&&pl(e,"ext"),pl(n,"path");let t=0,i=-1,r=!0,o;if(e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let s=e.length-1,a=-1;for(o=n.length-1;o>=0;--o){const l=n.charCodeAt(o);if(l===Yc){if(!r){t=o+1;break}}else a===-1&&(r=!1,a=o+1),s>=0&&(l===e.charCodeAt(s)?--s===-1&&(i=o):(s=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(o=n.length-1;o>=0;--o)if(n.charCodeAt(o)===Yc){if(!r){t=o+1;break}}else i===-1&&(r=!1,i=o+1);return i===-1?"":n.slice(t,i)},extname(n){pl(n,"path");let e=-1,t=0,i=-1,r=!0,o=0;for(let s=n.length-1;s>=0;--s){const a=n.charCodeAt(s);if(a===Yc){if(!r){t=s+1;break}continue}i===-1&&(r=!1,i=s+1),a===IC?e===-1?e=s:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||i===-1||o===0||o===1&&e===i-1&&e===t+1?"":n.slice(e,i)},format:Hje.bind(null,"/"),parse(n){pl(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.charCodeAt(0)===Yc;let i;t?(e.root="/",i=1):i=0;let r=-1,o=0,s=-1,a=!0,l=n.length-1,c=0;for(;l>=i;--l){const u=n.charCodeAt(l);if(u===Yc){if(!a){o=l+1;break}continue}s===-1&&(a=!1,s=l+1),u===IC?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}if(s!==-1){const u=o===0&&t?1:o;r===-1||c===0||c===1&&r===s-1&&r===o+1?e.base=e.name=n.slice(u,s):(e.name=n.slice(u,r),e.base=n.slice(u,s),e.ext=n.slice(r,s))}return o>0?e.dir=n.slice(0,o-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Ra.win32=Zd.win32=Zd;Ra.posix=Zd.posix=Ra;const Wje=Zw?Zd.normalize:Ra.normalize,a6i=Zw?Zd.resolve:Ra.resolve,l6i=Zw?Zd.relative:Ra.relative,zje=Zw?Zd.dirname:Ra.dirname,LC=Zw?Zd.basename:Ra.basename,c6i=Zw?Zd.extname:Ra.extname,f_=Zw?Zd.sep:Ra.sep,u6i=/^\w[\w\d+.-]*$/,d6i=/^\//,h6i=/^\/\//;function f6i(n,e){if(!n.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${n.authority}", path: "${n.path}", query: "${n.query}", fragment: "${n.fragment}"}`);if(n.scheme&&!u6i.test(n.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(n.path){if(n.authority){if(!d6i.test(n.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(h6i.test(n.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function g6i(n,e){return!n&&!e?"file":n}function p6i(n,e){switch(n){case"https":case"http":case"file":e?e[0]!==jm&&(e=jm+e):e=jm;break}return e}const na="",jm="/",m6i=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class Tn{static isUri(e){return e instanceof Tn?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}constructor(e,t,i,r,o,s=!1){typeof e=="object"?(this.scheme=e.scheme||na,this.authority=e.authority||na,this.path=e.path||na,this.query=e.query||na,this.fragment=e.fragment||na):(this.scheme=g6i(e,s),this.authority=t||na,this.path=p6i(this.scheme,i||na),this.query=r||na,this.fragment=o||na,f6i(this,s))}get fsPath(){return kV(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:r,query:o,fragment:s}=e;return t===void 0?t=this.scheme:t===null&&(t=na),i===void 0?i=this.authority:i===null&&(i=na),r===void 0?r=this.path:r===null&&(r=na),o===void 0?o=this.query:o===null&&(o=na),s===void 0?s=this.fragment:s===null&&(s=na),t===this.scheme&&i===this.authority&&r===this.path&&o===this.query&&s===this.fragment?this:new IT(t,i,r,o,s)}static parse(e,t=!1){const i=m6i.exec(e);return i?new IT(i[2]||na,mB(i[4]||na),mB(i[5]||na),mB(i[7]||na),mB(i[9]||na),t):new IT(na,na,na,na,na)}static file(e){let t=na;if(vc&&(e=e.replace(/\\/g,jm)),e[0]===jm&&e[1]===jm){const i=e.indexOf(jm,2);i===-1?(t=e.substring(2),e=jm):(t=e.substring(2,i),e=e.substring(i)||jm)}return new IT("file",t,e,na,na)}static from(e,t){return new IT(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return vc&&e.scheme==="file"?i=Tn.file(Zd.join(kV(e,!0),...t)).path:i=Ra.join(e.path,...t),e.with({path:i})}toString(e=!1){return Jre(this,e)}toJSON(){return this}static revive(e){var t,i;if(e){if(e instanceof Tn)return e;{const r=new IT(e);return r._formatted=(t=e.external)!==null&&t!==void 0?t:null,r._fsPath=e._sep===jje&&(i=e.fsPath)!==null&&i!==void 0?i:null,r}}else return e}}const jje=vc?1:void 0;let IT=class extends Tn{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=kV(this,!1)),this._fsPath}toString(e=!1){return e?Jre(this,!0):(this._formatted||(this._formatted=Jre(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=jje),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 Uje={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 dLe(n,e,t){let i,r=-1;for(let o=0;o<n.length;o++){const s=n.charCodeAt(o);if(s>=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||s===45||s===46||s===95||s===126||e&&s===47||t&&s===91||t&&s===93||t&&s===58)r!==-1&&(i+=encodeURIComponent(n.substring(r,o)),r=-1),i!==void 0&&(i+=n.charAt(o));else{i===void 0&&(i=n.substr(0,o));const a=Uje[s];a!==void 0?(r!==-1&&(i+=encodeURIComponent(n.substring(r,o)),r=-1),i+=a):r===-1&&(r=o)}}return r!==-1&&(i+=encodeURIComponent(n.substring(r))),i!==void 0?i:n}function _6i(n){let e;for(let t=0;t<n.length;t++){const i=n.charCodeAt(t);i===35||i===63?(e===void 0&&(e=n.substr(0,t)),e+=Uje[i]):e!==void 0&&(e+=n[t])}return e!==void 0?e:n}function kV(n,e){let t;return n.authority&&n.path.length>1&&n.scheme==="file"?t=`//${n.authority}${n.path}`:n.path.charCodeAt(0)===47&&(n.path.charCodeAt(1)>=65&&n.path.charCodeAt(1)<=90||n.path.charCodeAt(1)>=97&&n.path.charCodeAt(1)<=122)&&n.path.charCodeAt(2)===58?e?t=n.path.substr(1):t=n.path[1].toLowerCase()+n.path.substr(2):t=n.path,vc&&(t=t.replace(/\//g,"\\")),t}function Jre(n,e){const t=e?_6i:dLe;let i="",{scheme:r,authority:o,path:s,query:a,fragment:l}=n;if(r&&(i+=r,i+=":"),(o||r==="file")&&(i+=jm,i+=jm),o){let c=o.indexOf("@");if(c!==-1){const u=o.substr(0,c);o=o.substr(c+1),c=u.lastIndexOf(":"),c===-1?i+=t(u,!1,!1):(i+=t(u.substr(0,c),!1,!1),i+=":",i+=t(u.substr(c+1),!1,!0)),i+="@"}o=o.toLowerCase(),c=o.lastIndexOf(":"),c===-1?i+=t(o,!1,!0):(i+=t(o.substr(0,c),!1,!0),i+=o.substr(c))}if(s){if(s.length>=3&&s.charCodeAt(0)===47&&s.charCodeAt(2)===58){const c=s.charCodeAt(1);c>=65&&c<=90&&(s=`/${String.fromCharCode(c+32)}:${s.substr(3)}`)}else if(s.length>=2&&s.charCodeAt(1)===58){const c=s.charCodeAt(0);c>=65&&c<=90&&(s=`${String.fromCharCode(c+32)}:${s.substr(2)}`)}i+=t(s,!0,!1)}return a&&(i+="?",i+=t(a,!1,!1)),l&&(i+="#",i+=e?l:dLe(l,!1,!1)),i}function qje(n){try{return decodeURIComponent(n)}catch{return n.length>3?n.substr(0,3)+qje(n.substr(3)):n}}const hLe=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function mB(n){return n.match(hLe)?n.replace(hLe,e=>qje(e)):n}let Ce=class qS{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 qS(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return qS.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return qS.isBefore(this,e)}static isBefore(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<t.column}isBeforeOrEqual(e){return qS.isBeforeOrEqual(this,e)}static isBeforeOrEqual(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<=t.column}static compare(e,t){const i=e.lineNumber|0,r=t.lineNumber|0;if(i===r){const o=e.column|0,s=t.column|0;return o-s}return i-r}clone(){return new qS(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(e){return new qS(e.lineNumber,e.column)}static isIPosition(e){return e&&typeof e.lineNumber=="number"&&typeof e.column=="number"}},q=class Rl{constructor(e,t,i,r){e>i||e===i&&t>r?(this.startLineNumber=i,this.startColumn=r,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=r)}isEmpty(){return Rl.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return Rl.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 Rl.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 Rl.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 Rl.plusRange(this,e)}static plusRange(e,t){let i,r,o,s;return t.startLineNumber<e.startLineNumber?(i=t.startLineNumber,r=t.startColumn):t.startLineNumber===e.startLineNumber?(i=t.startLineNumber,r=Math.min(t.startColumn,e.startColumn)):(i=e.startLineNumber,r=e.startColumn),t.endLineNumber>e.endLineNumber?(o=t.endLineNumber,s=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,s=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,s=e.endColumn),new Rl(i,r,o,s)}intersectRanges(e){return Rl.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,r=e.startColumn,o=e.endLineNumber,s=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,u=t.endColumn;return i<a?(i=a,r=l):i===a&&(r=Math.max(r,l)),o>c?(o=c,s=u):o===c&&(s=Math.min(s,u)),i>o||i===o&&r>s?null:new Rl(i,r,o,s)}equalsRange(e){return Rl.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return Rl.getEndPosition(this)}static getEndPosition(e){return new Ce(e.endLineNumber,e.endColumn)}getStartPosition(){return Rl.getStartPosition(this)}static getStartPosition(e){return new Ce(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new Rl(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new Rl(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return Rl.collapseToStart(this)}static collapseToStart(e){return new Rl(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return Rl.collapseToEnd(this)}static collapseToEnd(e){return new Rl(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new Rl(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new Rl(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new Rl(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}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 o=e.startLineNumber|0,s=t.startLineNumber|0;if(o===s){const a=e.startColumn|0,l=t.startColumn|0;if(a===l){const c=e.endLineNumber|0,u=t.endLineNumber|0;if(c===u){const d=e.endColumn|0,h=t.endColumn|0;return d-h}return c-u}return a-l}return o-s}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}},ln=class sp extends q{constructor(e,t,i,r){super(e,t,i,r),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=r}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return sp.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 this.getDirection()===0?new sp(this.startLineNumber,this.startColumn,e,t):new sp(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new Ce(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new Ce(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new sp(e,t,this.endLineNumber,this.endColumn):new sp(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new sp(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new sp(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new sp(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new sp(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 i=0,r=e.length;i<r;i++)if(!this.selectionsEqual(e[i],t[i]))return!1;return!0}static isISelection(e){return e&&typeof e.selectionStartLineNumber=="number"&&typeof e.selectionStartColumn=="number"&&typeof e.positionLineNumber=="number"&&typeof e.positionColumn=="number"}static createWithDirection(e,t,i,r,o){return o===0?new sp(e,t,i,r):new sp(i,r,e,t)}};const eoe=Object.create(null);function z(n,e){if(Ku(e)){const t=eoe[e];if(t===void 0)throw new Error(`${n} references an unknown codicon: ${e}`);e=t}return eoe[n]=e,{id:n}}function Kje(){return eoe}const Ct={add:z("add",6e4),plus:z("plus",6e4),gistNew:z("gist-new",6e4),repoCreate:z("repo-create",6e4),lightbulb:z("lightbulb",60001),lightBulb:z("light-bulb",60001),repo:z("repo",60002),repoDelete:z("repo-delete",60002),gistFork:z("gist-fork",60003),repoForked:z("repo-forked",60003),gitPullRequest:z("git-pull-request",60004),gitPullRequestAbandoned:z("git-pull-request-abandoned",60004),recordKeys:z("record-keys",60005),keyboard:z("keyboard",60005),tag:z("tag",60006),tagAdd:z("tag-add",60006),tagRemove:z("tag-remove",60006),gitPullRequestLabel:z("git-pull-request-label",60006),person:z("person",60007),personFollow:z("person-follow",60007),personOutline:z("person-outline",60007),personFilled:z("person-filled",60007),gitBranch:z("git-branch",60008),gitBranchCreate:z("git-branch-create",60008),gitBranchDelete:z("git-branch-delete",60008),sourceControl:z("source-control",60008),mirror:z("mirror",60009),mirrorPublic:z("mirror-public",60009),star:z("star",60010),starAdd:z("star-add",60010),starDelete:z("star-delete",60010),starEmpty:z("star-empty",60010),comment:z("comment",60011),commentAdd:z("comment-add",60011),alert:z("alert",60012),warning:z("warning",60012),search:z("search",60013),searchSave:z("search-save",60013),logOut:z("log-out",60014),signOut:z("sign-out",60014),logIn:z("log-in",60015),signIn:z("sign-in",60015),eye:z("eye",60016),eyeUnwatch:z("eye-unwatch",60016),eyeWatch:z("eye-watch",60016),circleFilled:z("circle-filled",60017),primitiveDot:z("primitive-dot",60017),closeDirty:z("close-dirty",60017),debugBreakpoint:z("debug-breakpoint",60017),debugBreakpointDisabled:z("debug-breakpoint-disabled",60017),debugHint:z("debug-hint",60017),primitiveSquare:z("primitive-square",60018),edit:z("edit",60019),pencil:z("pencil",60019),info:z("info",60020),issueOpened:z("issue-opened",60020),gistPrivate:z("gist-private",60021),gitForkPrivate:z("git-fork-private",60021),lock:z("lock",60021),mirrorPrivate:z("mirror-private",60021),close:z("close",60022),removeClose:z("remove-close",60022),x:z("x",60022),repoSync:z("repo-sync",60023),sync:z("sync",60023),clone:z("clone",60024),desktopDownload:z("desktop-download",60024),beaker:z("beaker",60025),microscope:z("microscope",60025),vm:z("vm",60026),deviceDesktop:z("device-desktop",60026),file:z("file",60027),fileText:z("file-text",60027),more:z("more",60028),ellipsis:z("ellipsis",60028),kebabHorizontal:z("kebab-horizontal",60028),mailReply:z("mail-reply",60029),reply:z("reply",60029),organization:z("organization",60030),organizationFilled:z("organization-filled",60030),organizationOutline:z("organization-outline",60030),newFile:z("new-file",60031),fileAdd:z("file-add",60031),newFolder:z("new-folder",60032),fileDirectoryCreate:z("file-directory-create",60032),trash:z("trash",60033),trashcan:z("trashcan",60033),history:z("history",60034),clock:z("clock",60034),folder:z("folder",60035),fileDirectory:z("file-directory",60035),symbolFolder:z("symbol-folder",60035),logoGithub:z("logo-github",60036),markGithub:z("mark-github",60036),github:z("github",60036),terminal:z("terminal",60037),console:z("console",60037),repl:z("repl",60037),zap:z("zap",60038),symbolEvent:z("symbol-event",60038),error:z("error",60039),stop:z("stop",60039),variable:z("variable",60040),symbolVariable:z("symbol-variable",60040),array:z("array",60042),symbolArray:z("symbol-array",60042),symbolModule:z("symbol-module",60043),symbolPackage:z("symbol-package",60043),symbolNamespace:z("symbol-namespace",60043),symbolObject:z("symbol-object",60043),symbolMethod:z("symbol-method",60044),symbolFunction:z("symbol-function",60044),symbolConstructor:z("symbol-constructor",60044),symbolBoolean:z("symbol-boolean",60047),symbolNull:z("symbol-null",60047),symbolNumeric:z("symbol-numeric",60048),symbolNumber:z("symbol-number",60048),symbolStructure:z("symbol-structure",60049),symbolStruct:z("symbol-struct",60049),symbolParameter:z("symbol-parameter",60050),symbolTypeParameter:z("symbol-type-parameter",60050),symbolKey:z("symbol-key",60051),symbolText:z("symbol-text",60051),symbolReference:z("symbol-reference",60052),goToFile:z("go-to-file",60052),symbolEnum:z("symbol-enum",60053),symbolValue:z("symbol-value",60053),symbolRuler:z("symbol-ruler",60054),symbolUnit:z("symbol-unit",60054),activateBreakpoints:z("activate-breakpoints",60055),archive:z("archive",60056),arrowBoth:z("arrow-both",60057),arrowDown:z("arrow-down",60058),arrowLeft:z("arrow-left",60059),arrowRight:z("arrow-right",60060),arrowSmallDown:z("arrow-small-down",60061),arrowSmallLeft:z("arrow-small-left",60062),arrowSmallRight:z("arrow-small-right",60063),arrowSmallUp:z("arrow-small-up",60064),arrowUp:z("arrow-up",60065),bell:z("bell",60066),bold:z("bold",60067),book:z("book",60068),bookmark:z("bookmark",60069),debugBreakpointConditionalUnverified:z("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:z("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:z("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:z("debug-breakpoint-data-unverified",60072),debugBreakpointData:z("debug-breakpoint-data",60073),debugBreakpointDataDisabled:z("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:z("debug-breakpoint-log-unverified",60074),debugBreakpointLog:z("debug-breakpoint-log",60075),debugBreakpointLogDisabled:z("debug-breakpoint-log-disabled",60075),briefcase:z("briefcase",60076),broadcast:z("broadcast",60077),browser:z("browser",60078),bug:z("bug",60079),calendar:z("calendar",60080),caseSensitive:z("case-sensitive",60081),check:z("check",60082),checklist:z("checklist",60083),chevronDown:z("chevron-down",60084),dropDownButton:z("drop-down-button",60084),chevronLeft:z("chevron-left",60085),chevronRight:z("chevron-right",60086),chevronUp:z("chevron-up",60087),chromeClose:z("chrome-close",60088),chromeMaximize:z("chrome-maximize",60089),chromeMinimize:z("chrome-minimize",60090),chromeRestore:z("chrome-restore",60091),circle:z("circle",60092),circleOutline:z("circle-outline",60092),debugBreakpointUnverified:z("debug-breakpoint-unverified",60092),circleSlash:z("circle-slash",60093),circuitBoard:z("circuit-board",60094),clearAll:z("clear-all",60095),clippy:z("clippy",60096),closeAll:z("close-all",60097),cloudDownload:z("cloud-download",60098),cloudUpload:z("cloud-upload",60099),code:z("code",60100),collapseAll:z("collapse-all",60101),colorMode:z("color-mode",60102),commentDiscussion:z("comment-discussion",60103),compareChanges:z("compare-changes",60157),creditCard:z("credit-card",60105),dash:z("dash",60108),dashboard:z("dashboard",60109),database:z("database",60110),debugContinue:z("debug-continue",60111),debugDisconnect:z("debug-disconnect",60112),debugPause:z("debug-pause",60113),debugRestart:z("debug-restart",60114),debugStart:z("debug-start",60115),debugStepInto:z("debug-step-into",60116),debugStepOut:z("debug-step-out",60117),debugStepOver:z("debug-step-over",60118),debugStop:z("debug-stop",60119),debug:z("debug",60120),deviceCameraVideo:z("device-camera-video",60121),deviceCamera:z("device-camera",60122),deviceMobile:z("device-mobile",60123),diffAdded:z("diff-added",60124),diffIgnored:z("diff-ignored",60125),diffModified:z("diff-modified",60126),diffRemoved:z("diff-removed",60127),diffRenamed:z("diff-renamed",60128),diff:z("diff",60129),discard:z("discard",60130),editorLayout:z("editor-layout",60131),emptyWindow:z("empty-window",60132),exclude:z("exclude",60133),extensions:z("extensions",60134),eyeClosed:z("eye-closed",60135),fileBinary:z("file-binary",60136),fileCode:z("file-code",60137),fileMedia:z("file-media",60138),filePdf:z("file-pdf",60139),fileSubmodule:z("file-submodule",60140),fileSymlinkDirectory:z("file-symlink-directory",60141),fileSymlinkFile:z("file-symlink-file",60142),fileZip:z("file-zip",60143),files:z("files",60144),filter:z("filter",60145),flame:z("flame",60146),foldDown:z("fold-down",60147),foldUp:z("fold-up",60148),fold:z("fold",60149),folderActive:z("folder-active",60150),folderOpened:z("folder-opened",60151),gear:z("gear",60152),gift:z("gift",60153),gistSecret:z("gist-secret",60154),gist:z("gist",60155),gitCommit:z("git-commit",60156),gitCompare:z("git-compare",60157),gitMerge:z("git-merge",60158),githubAction:z("github-action",60159),githubAlt:z("github-alt",60160),globe:z("globe",60161),grabber:z("grabber",60162),graph:z("graph",60163),gripper:z("gripper",60164),heart:z("heart",60165),home:z("home",60166),horizontalRule:z("horizontal-rule",60167),hubot:z("hubot",60168),inbox:z("inbox",60169),issueClosed:z("issue-closed",60324),issueReopened:z("issue-reopened",60171),issues:z("issues",60172),italic:z("italic",60173),jersey:z("jersey",60174),json:z("json",60175),bracket:z("bracket",60175),kebabVertical:z("kebab-vertical",60176),key:z("key",60177),law:z("law",60178),lightbulbAutofix:z("lightbulb-autofix",60179),linkExternal:z("link-external",60180),link:z("link",60181),listOrdered:z("list-ordered",60182),listUnordered:z("list-unordered",60183),liveShare:z("live-share",60184),loading:z("loading",60185),location:z("location",60186),mailRead:z("mail-read",60187),mail:z("mail",60188),markdown:z("markdown",60189),megaphone:z("megaphone",60190),mention:z("mention",60191),milestone:z("milestone",60192),gitPullRequestMilestone:z("git-pull-request-milestone",60192),mortarBoard:z("mortar-board",60193),move:z("move",60194),multipleWindows:z("multiple-windows",60195),mute:z("mute",60196),noNewline:z("no-newline",60197),note:z("note",60198),octoface:z("octoface",60199),openPreview:z("open-preview",60200),package:z("package",60201),paintcan:z("paintcan",60202),pin:z("pin",60203),play:z("play",60204),run:z("run",60204),plug:z("plug",60205),preserveCase:z("preserve-case",60206),preview:z("preview",60207),project:z("project",60208),pulse:z("pulse",60209),question:z("question",60210),quote:z("quote",60211),radioTower:z("radio-tower",60212),reactions:z("reactions",60213),references:z("references",60214),refresh:z("refresh",60215),regex:z("regex",60216),remoteExplorer:z("remote-explorer",60217),remote:z("remote",60218),remove:z("remove",60219),replaceAll:z("replace-all",60220),replace:z("replace",60221),repoClone:z("repo-clone",60222),repoForcePush:z("repo-force-push",60223),repoPull:z("repo-pull",60224),repoPush:z("repo-push",60225),report:z("report",60226),requestChanges:z("request-changes",60227),rocket:z("rocket",60228),rootFolderOpened:z("root-folder-opened",60229),rootFolder:z("root-folder",60230),rss:z("rss",60231),ruby:z("ruby",60232),saveAll:z("save-all",60233),saveAs:z("save-as",60234),save:z("save",60235),screenFull:z("screen-full",60236),screenNormal:z("screen-normal",60237),searchStop:z("search-stop",60238),server:z("server",60240),settingsGear:z("settings-gear",60241),settings:z("settings",60242),shield:z("shield",60243),smiley:z("smiley",60244),sortPrecedence:z("sort-precedence",60245),splitHorizontal:z("split-horizontal",60246),splitVertical:z("split-vertical",60247),squirrel:z("squirrel",60248),starFull:z("star-full",60249),starHalf:z("star-half",60250),symbolClass:z("symbol-class",60251),symbolColor:z("symbol-color",60252),symbolCustomColor:z("symbol-customcolor",60252),symbolConstant:z("symbol-constant",60253),symbolEnumMember:z("symbol-enum-member",60254),symbolField:z("symbol-field",60255),symbolFile:z("symbol-file",60256),symbolInterface:z("symbol-interface",60257),symbolKeyword:z("symbol-keyword",60258),symbolMisc:z("symbol-misc",60259),symbolOperator:z("symbol-operator",60260),symbolProperty:z("symbol-property",60261),wrench:z("wrench",60261),wrenchSubaction:z("wrench-subaction",60261),symbolSnippet:z("symbol-snippet",60262),tasklist:z("tasklist",60263),telescope:z("telescope",60264),textSize:z("text-size",60265),threeBars:z("three-bars",60266),thumbsdown:z("thumbsdown",60267),thumbsup:z("thumbsup",60268),tools:z("tools",60269),triangleDown:z("triangle-down",60270),triangleLeft:z("triangle-left",60271),triangleRight:z("triangle-right",60272),triangleUp:z("triangle-up",60273),twitter:z("twitter",60274),unfold:z("unfold",60275),unlock:z("unlock",60276),unmute:z("unmute",60277),unverified:z("unverified",60278),verified:z("verified",60279),versions:z("versions",60280),vmActive:z("vm-active",60281),vmOutline:z("vm-outline",60282),vmRunning:z("vm-running",60283),watch:z("watch",60284),whitespace:z("whitespace",60285),wholeWord:z("whole-word",60286),window:z("window",60287),wordWrap:z("word-wrap",60288),zoomIn:z("zoom-in",60289),zoomOut:z("zoom-out",60290),listFilter:z("list-filter",60291),listFlat:z("list-flat",60292),listSelection:z("list-selection",60293),selection:z("selection",60293),listTree:z("list-tree",60294),debugBreakpointFunctionUnverified:z("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:z("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:z("debug-breakpoint-function-disabled",60296),debugStackframeActive:z("debug-stackframe-active",60297),circleSmallFilled:z("circle-small-filled",60298),debugStackframeDot:z("debug-stackframe-dot",60298),debugStackframe:z("debug-stackframe",60299),debugStackframeFocused:z("debug-stackframe-focused",60299),debugBreakpointUnsupported:z("debug-breakpoint-unsupported",60300),symbolString:z("symbol-string",60301),debugReverseContinue:z("debug-reverse-continue",60302),debugStepBack:z("debug-step-back",60303),debugRestartFrame:z("debug-restart-frame",60304),callIncoming:z("call-incoming",60306),callOutgoing:z("call-outgoing",60307),menu:z("menu",60308),expandAll:z("expand-all",60309),feedback:z("feedback",60310),gitPullRequestReviewer:z("git-pull-request-reviewer",60310),groupByRefType:z("group-by-ref-type",60311),ungroupByRefType:z("ungroup-by-ref-type",60312),account:z("account",60313),gitPullRequestAssignee:z("git-pull-request-assignee",60313),bellDot:z("bell-dot",60314),debugConsole:z("debug-console",60315),library:z("library",60316),output:z("output",60317),runAll:z("run-all",60318),syncIgnored:z("sync-ignored",60319),pinned:z("pinned",60320),githubInverted:z("github-inverted",60321),debugAlt:z("debug-alt",60305),serverProcess:z("server-process",60322),serverEnvironment:z("server-environment",60323),pass:z("pass",60324),stopCircle:z("stop-circle",60325),playCircle:z("play-circle",60326),record:z("record",60327),debugAltSmall:z("debug-alt-small",60328),vmConnect:z("vm-connect",60329),cloud:z("cloud",60330),merge:z("merge",60331),exportIcon:z("export",60332),graphLeft:z("graph-left",60333),magnet:z("magnet",60334),notebook:z("notebook",60335),redo:z("redo",60336),checkAll:z("check-all",60337),pinnedDirty:z("pinned-dirty",60338),passFilled:z("pass-filled",60339),circleLargeFilled:z("circle-large-filled",60340),circleLarge:z("circle-large",60341),circleLargeOutline:z("circle-large-outline",60341),combine:z("combine",60342),gather:z("gather",60342),table:z("table",60343),variableGroup:z("variable-group",60344),typeHierarchy:z("type-hierarchy",60345),typeHierarchySub:z("type-hierarchy-sub",60346),typeHierarchySuper:z("type-hierarchy-super",60347),gitPullRequestCreate:z("git-pull-request-create",60348),runAbove:z("run-above",60349),runBelow:z("run-below",60350),notebookTemplate:z("notebook-template",60351),debugRerun:z("debug-rerun",60352),workspaceTrusted:z("workspace-trusted",60353),workspaceUntrusted:z("workspace-untrusted",60354),workspaceUnspecified:z("workspace-unspecified",60355),terminalCmd:z("terminal-cmd",60356),terminalDebian:z("terminal-debian",60357),terminalLinux:z("terminal-linux",60358),terminalPowershell:z("terminal-powershell",60359),terminalTmux:z("terminal-tmux",60360),terminalUbuntu:z("terminal-ubuntu",60361),terminalBash:z("terminal-bash",60362),arrowSwap:z("arrow-swap",60363),copy:z("copy",60364),personAdd:z("person-add",60365),filterFilled:z("filter-filled",60366),wand:z("wand",60367),debugLineByLine:z("debug-line-by-line",60368),inspect:z("inspect",60369),layers:z("layers",60370),layersDot:z("layers-dot",60371),layersActive:z("layers-active",60372),compass:z("compass",60373),compassDot:z("compass-dot",60374),compassActive:z("compass-active",60375),azure:z("azure",60376),issueDraft:z("issue-draft",60377),gitPullRequestClosed:z("git-pull-request-closed",60378),gitPullRequestDraft:z("git-pull-request-draft",60379),debugAll:z("debug-all",60380),debugCoverage:z("debug-coverage",60381),runErrors:z("run-errors",60382),folderLibrary:z("folder-library",60383),debugContinueSmall:z("debug-continue-small",60384),beakerStop:z("beaker-stop",60385),graphLine:z("graph-line",60386),graphScatter:z("graph-scatter",60387),pieChart:z("pie-chart",60388),bracketDot:z("bracket-dot",60389),bracketError:z("bracket-error",60390),lockSmall:z("lock-small",60391),azureDevops:z("azure-devops",60392),verifiedFilled:z("verified-filled",60393),newLine:z("newline",60394),layout:z("layout",60395),layoutActivitybarLeft:z("layout-activitybar-left",60396),layoutActivitybarRight:z("layout-activitybar-right",60397),layoutPanelLeft:z("layout-panel-left",60398),layoutPanelCenter:z("layout-panel-center",60399),layoutPanelJustify:z("layout-panel-justify",60400),layoutPanelRight:z("layout-panel-right",60401),layoutPanel:z("layout-panel",60402),layoutSidebarLeft:z("layout-sidebar-left",60403),layoutSidebarRight:z("layout-sidebar-right",60404),layoutStatusbar:z("layout-statusbar",60405),layoutMenubar:z("layout-menubar",60406),layoutCentered:z("layout-centered",60407),layoutSidebarRightOff:z("layout-sidebar-right-off",60416),layoutPanelOff:z("layout-panel-off",60417),layoutSidebarLeftOff:z("layout-sidebar-left-off",60418),target:z("target",60408),indent:z("indent",60409),recordSmall:z("record-small",60410),errorSmall:z("error-small",60411),arrowCircleDown:z("arrow-circle-down",60412),arrowCircleLeft:z("arrow-circle-left",60413),arrowCircleRight:z("arrow-circle-right",60414),arrowCircleUp:z("arrow-circle-up",60415),heartFilled:z("heart-filled",60420),map:z("map",60421),mapFilled:z("map-filled",60422),circleSmall:z("circle-small",60423),bellSlash:z("bell-slash",60424),bellSlashDot:z("bell-slash-dot",60425),commentUnresolved:z("comment-unresolved",60426),gitPullRequestGoToChanges:z("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:z("git-pull-request-new-changes",60428),searchFuzzy:z("search-fuzzy",60429),commentDraft:z("comment-draft",60430),send:z("send",60431),sparkle:z("sparkle",60432),insert:z("insert",60433),mic:z("mic",60434),dialogError:z("dialog-error","error"),dialogWarning:z("dialog-warning","warning"),dialogInfo:z("dialog-info","info"),dialogClose:z("dialog-close","close"),treeItemExpanded:z("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:z("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:z("tree-filter-on-type-off","list-selection"),treeFilterClear:z("tree-filter-clear","close"),treeItemLoading:z("tree-item-loading","loading"),menuSelection:z("menu-selection","check"),menuSubmenu:z("menu-submenu","chevron-right"),menuBarMore:z("menubar-more","more"),scrollbarButtonLeft:z("scrollbar-button-left","triangle-left"),scrollbarButtonRight:z("scrollbar-button-right","triangle-right"),scrollbarButtonUp:z("scrollbar-button-up","triangle-up"),scrollbarButtonDown:z("scrollbar-button-down","triangle-down"),toolBarMore:z("toolbar-more","more"),quickInputBack:z("quick-input-back","arrow-left")};var toe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let v6i=class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new be,this.onDidChange=this._onDidChange.event,this._colorMap=null}handleChange(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._tokenizationSupports.set(e,t),this.handleChange([e]),Gn(()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var i;(i=this._factories.get(e))===null||i===void 0||i.dispose();const r=new b6i(this,e,t);return this._factories.set(e,r),Gn(()=>{const o=this._factories.get(e);!o||o!==r||(this._factories.delete(e),o.dispose())})}getOrCreate(e){return toe(this,void 0,void 0,function*(){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(yield i.resolve(),this.get(e))})}isResolved(e){if(this.get(e))return!0;const i=this._factories.get(e);return!!(!i||i.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}};class b6i extends Ae{get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}resolve(){return toe(this,void 0,void 0,function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise})}_create(){return toe(this,void 0,void 0,function*(){const e=yield this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))})}}let bM=class{constructor(e,t,i){this.offset=e,this.type=t,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}};class Tme{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class DU{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var yM;(function(n){const e=new Map;e.set(0,Ct.symbolMethod),e.set(1,Ct.symbolFunction),e.set(2,Ct.symbolConstructor),e.set(3,Ct.symbolField),e.set(4,Ct.symbolVariable),e.set(5,Ct.symbolClass),e.set(6,Ct.symbolStruct),e.set(7,Ct.symbolInterface),e.set(8,Ct.symbolModule),e.set(9,Ct.symbolProperty),e.set(10,Ct.symbolEvent),e.set(11,Ct.symbolOperator),e.set(12,Ct.symbolUnit),e.set(13,Ct.symbolValue),e.set(15,Ct.symbolEnum),e.set(14,Ct.symbolConstant),e.set(15,Ct.symbolEnum),e.set(16,Ct.symbolEnumMember),e.set(17,Ct.symbolKeyword),e.set(27,Ct.symbolSnippet),e.set(18,Ct.symbolText),e.set(19,Ct.symbolColor),e.set(20,Ct.symbolFile),e.set(21,Ct.symbolReference),e.set(22,Ct.symbolCustomColor),e.set(23,Ct.symbolFolder),e.set(24,Ct.symbolTypeParameter),e.set(25,Ct.account),e.set(26,Ct.issues);function t(o){let s=e.get(o);return s||(console.info("No codicon found for CompletionItemKind "+o),s=Ct.symbolProperty),s}n.toIcon=t;const i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",27),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26);function r(o,s){let a=i.get(o);return typeof a>"u"&&!s&&(a=9),a}n.fromString=r})(yM||(yM={}));var Yy;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(Yy||(Yy={}));class Gje{constructor(e,t,i,r){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=r}equals(e){return q.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var Qv;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(Qv||(Qv={}));var CM;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(CM||(CM={}));function y6i(n){return n&&Tn.isUri(n.uri)&&q.isIRange(n.range)&&(q.isIRange(n.originSelectionRange)||q.isIRange(n.targetSelectionRange))}const C6i={17:E("Array","array"),16:E("Boolean","boolean"),4:E("Class","class"),13:E("Constant","constant"),8:E("Constructor","constructor"),9:E("Enum","enumeration"),21:E("EnumMember","enumeration member"),23:E("Event","event"),7:E("Field","field"),0:E("File","file"),11:E("Function","function"),10:E("Interface","interface"),19:E("Key","key"),5:E("Method","method"),1:E("Module","module"),2:E("Namespace","namespace"),20:E("Null","null"),15:E("Number","number"),18:E("Object","object"),24:E("Operator","operator"),3:E("Package","package"),6:E("Property","property"),14:E("String","string"),22:E("Struct","struct"),25:E("TypeParameter","type parameter"),12:E("Variable","variable")};function w6i(n,e){return E("symbolAriaLabel","{0} ({1})",n,C6i[e])}var TV;(function(n){const e=new Map;e.set(0,Ct.symbolFile),e.set(1,Ct.symbolModule),e.set(2,Ct.symbolNamespace),e.set(3,Ct.symbolPackage),e.set(4,Ct.symbolClass),e.set(5,Ct.symbolMethod),e.set(6,Ct.symbolProperty),e.set(7,Ct.symbolField),e.set(8,Ct.symbolConstructor),e.set(9,Ct.symbolEnum),e.set(10,Ct.symbolInterface),e.set(11,Ct.symbolFunction),e.set(12,Ct.symbolVariable),e.set(13,Ct.symbolConstant),e.set(14,Ct.symbolString),e.set(15,Ct.symbolNumber),e.set(16,Ct.symbolBoolean),e.set(17,Ct.symbolArray),e.set(18,Ct.symbolObject),e.set(19,Ct.symbolKey),e.set(20,Ct.symbolNull),e.set(21,Ct.symbolEnumMember),e.set(22,Ct.symbolStruct),e.set(23,Ct.symbolEvent),e.set(24,Ct.symbolOperator),e.set(25,Ct.symbolTypeParameter);function t(i){let r=e.get(i);return r||(console.info("No codicon found for SymbolKind "+i),r=Ct.symbolProperty),r}n.toIcon=t})(TV||(TV={}));class Wu{static fromValue(e){switch(e){case"comment":return Wu.Comment;case"imports":return Wu.Imports;case"region":return Wu.Region}return new Wu(e)}constructor(e){this.value=e}}Wu.Comment=new Wu("comment");Wu.Imports=new Wu("imports");Wu.Region=new Wu("region");var noe;(function(n){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}n.is=e})(noe||(noe={}));var IV;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(IV||(IV={}));class S6i{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}const ps=new v6i;var ioe;(function(n){n[n.Unknown=0]="Unknown",n[n.Disabled=1]="Disabled",n[n.Enabled=2]="Enabled"})(ioe||(ioe={}));var roe;(function(n){n[n.Invoke=1]="Invoke",n[n.Auto=2]="Auto"})(roe||(roe={}));var ooe;(function(n){n[n.None=0]="None",n[n.KeepWhitespace=1]="KeepWhitespace",n[n.InsertAsSnippet=4]="InsertAsSnippet"})(ooe||(ooe={}));var soe;(function(n){n[n.Method=0]="Method",n[n.Function=1]="Function",n[n.Constructor=2]="Constructor",n[n.Field=3]="Field",n[n.Variable=4]="Variable",n[n.Class=5]="Class",n[n.Struct=6]="Struct",n[n.Interface=7]="Interface",n[n.Module=8]="Module",n[n.Property=9]="Property",n[n.Event=10]="Event",n[n.Operator=11]="Operator",n[n.Unit=12]="Unit",n[n.Value=13]="Value",n[n.Constant=14]="Constant",n[n.Enum=15]="Enum",n[n.EnumMember=16]="EnumMember",n[n.Keyword=17]="Keyword",n[n.Text=18]="Text",n[n.Color=19]="Color",n[n.File=20]="File",n[n.Reference=21]="Reference",n[n.Customcolor=22]="Customcolor",n[n.Folder=23]="Folder",n[n.TypeParameter=24]="TypeParameter",n[n.User=25]="User",n[n.Issue=26]="Issue",n[n.Snippet=27]="Snippet"})(soe||(soe={}));var aoe;(function(n){n[n.Deprecated=1]="Deprecated"})(aoe||(aoe={}));var loe;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(loe||(loe={}));var coe;(function(n){n[n.EXACT=0]="EXACT",n[n.ABOVE=1]="ABOVE",n[n.BELOW=2]="BELOW"})(coe||(coe={}));var uoe;(function(n){n[n.NotSet=0]="NotSet",n[n.ContentFlush=1]="ContentFlush",n[n.RecoverFromMarkers=2]="RecoverFromMarkers",n[n.Explicit=3]="Explicit",n[n.Paste=4]="Paste",n[n.Undo=5]="Undo",n[n.Redo=6]="Redo"})(uoe||(uoe={}));var doe;(function(n){n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(doe||(doe={}));var hoe;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(hoe||(hoe={}));var foe;(function(n){n[n.None=0]="None",n[n.Keep=1]="Keep",n[n.Brackets=2]="Brackets",n[n.Advanced=3]="Advanced",n[n.Full=4]="Full"})(foe||(foe={}));var goe;(function(n){n[n.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",n[n.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",n[n.accessibilitySupport=2]="accessibilitySupport",n[n.accessibilityPageSize=3]="accessibilityPageSize",n[n.ariaLabel=4]="ariaLabel",n[n.ariaRequired=5]="ariaRequired",n[n.autoClosingBrackets=6]="autoClosingBrackets",n[n.autoClosingComments=7]="autoClosingComments",n[n.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",n[n.autoClosingDelete=9]="autoClosingDelete",n[n.autoClosingOvertype=10]="autoClosingOvertype",n[n.autoClosingQuotes=11]="autoClosingQuotes",n[n.autoIndent=12]="autoIndent",n[n.automaticLayout=13]="automaticLayout",n[n.autoSurround=14]="autoSurround",n[n.bracketPairColorization=15]="bracketPairColorization",n[n.guides=16]="guides",n[n.codeLens=17]="codeLens",n[n.codeLensFontFamily=18]="codeLensFontFamily",n[n.codeLensFontSize=19]="codeLensFontSize",n[n.colorDecorators=20]="colorDecorators",n[n.colorDecoratorsLimit=21]="colorDecoratorsLimit",n[n.columnSelection=22]="columnSelection",n[n.comments=23]="comments",n[n.contextmenu=24]="contextmenu",n[n.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",n[n.cursorBlinking=26]="cursorBlinking",n[n.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",n[n.cursorStyle=28]="cursorStyle",n[n.cursorSurroundingLines=29]="cursorSurroundingLines",n[n.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",n[n.cursorWidth=31]="cursorWidth",n[n.disableLayerHinting=32]="disableLayerHinting",n[n.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",n[n.domReadOnly=34]="domReadOnly",n[n.dragAndDrop=35]="dragAndDrop",n[n.dropIntoEditor=36]="dropIntoEditor",n[n.emptySelectionClipboard=37]="emptySelectionClipboard",n[n.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",n[n.extraEditorClassName=39]="extraEditorClassName",n[n.fastScrollSensitivity=40]="fastScrollSensitivity",n[n.find=41]="find",n[n.fixedOverflowWidgets=42]="fixedOverflowWidgets",n[n.folding=43]="folding",n[n.foldingStrategy=44]="foldingStrategy",n[n.foldingHighlight=45]="foldingHighlight",n[n.foldingImportsByDefault=46]="foldingImportsByDefault",n[n.foldingMaximumRegions=47]="foldingMaximumRegions",n[n.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",n[n.fontFamily=49]="fontFamily",n[n.fontInfo=50]="fontInfo",n[n.fontLigatures=51]="fontLigatures",n[n.fontSize=52]="fontSize",n[n.fontWeight=53]="fontWeight",n[n.fontVariations=54]="fontVariations",n[n.formatOnPaste=55]="formatOnPaste",n[n.formatOnType=56]="formatOnType",n[n.glyphMargin=57]="glyphMargin",n[n.gotoLocation=58]="gotoLocation",n[n.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",n[n.hover=60]="hover",n[n.inDiffEditor=61]="inDiffEditor",n[n.inlineSuggest=62]="inlineSuggest",n[n.letterSpacing=63]="letterSpacing",n[n.lightbulb=64]="lightbulb",n[n.lineDecorationsWidth=65]="lineDecorationsWidth",n[n.lineHeight=66]="lineHeight",n[n.lineNumbers=67]="lineNumbers",n[n.lineNumbersMinChars=68]="lineNumbersMinChars",n[n.linkedEditing=69]="linkedEditing",n[n.links=70]="links",n[n.matchBrackets=71]="matchBrackets",n[n.minimap=72]="minimap",n[n.mouseStyle=73]="mouseStyle",n[n.mouseWheelScrollSensitivity=74]="mouseWheelScrollSensitivity",n[n.mouseWheelZoom=75]="mouseWheelZoom",n[n.multiCursorMergeOverlapping=76]="multiCursorMergeOverlapping",n[n.multiCursorModifier=77]="multiCursorModifier",n[n.multiCursorPaste=78]="multiCursorPaste",n[n.multiCursorLimit=79]="multiCursorLimit",n[n.occurrencesHighlight=80]="occurrencesHighlight",n[n.overviewRulerBorder=81]="overviewRulerBorder",n[n.overviewRulerLanes=82]="overviewRulerLanes",n[n.padding=83]="padding",n[n.pasteAs=84]="pasteAs",n[n.parameterHints=85]="parameterHints",n[n.peekWidgetDefaultFocus=86]="peekWidgetDefaultFocus",n[n.definitionLinkOpensInPeek=87]="definitionLinkOpensInPeek",n[n.quickSuggestions=88]="quickSuggestions",n[n.quickSuggestionsDelay=89]="quickSuggestionsDelay",n[n.readOnly=90]="readOnly",n[n.readOnlyMessage=91]="readOnlyMessage",n[n.renameOnType=92]="renameOnType",n[n.renderControlCharacters=93]="renderControlCharacters",n[n.renderFinalNewline=94]="renderFinalNewline",n[n.renderLineHighlight=95]="renderLineHighlight",n[n.renderLineHighlightOnlyWhenFocus=96]="renderLineHighlightOnlyWhenFocus",n[n.renderValidationDecorations=97]="renderValidationDecorations",n[n.renderWhitespace=98]="renderWhitespace",n[n.revealHorizontalRightPadding=99]="revealHorizontalRightPadding",n[n.roundedSelection=100]="roundedSelection",n[n.rulers=101]="rulers",n[n.scrollbar=102]="scrollbar",n[n.scrollBeyondLastColumn=103]="scrollBeyondLastColumn",n[n.scrollBeyondLastLine=104]="scrollBeyondLastLine",n[n.scrollPredominantAxis=105]="scrollPredominantAxis",n[n.selectionClipboard=106]="selectionClipboard",n[n.selectionHighlight=107]="selectionHighlight",n[n.selectOnLineNumbers=108]="selectOnLineNumbers",n[n.showFoldingControls=109]="showFoldingControls",n[n.showUnused=110]="showUnused",n[n.snippetSuggestions=111]="snippetSuggestions",n[n.smartSelect=112]="smartSelect",n[n.smoothScrolling=113]="smoothScrolling",n[n.stickyScroll=114]="stickyScroll",n[n.stickyTabStops=115]="stickyTabStops",n[n.stopRenderingLineAfter=116]="stopRenderingLineAfter",n[n.suggest=117]="suggest",n[n.suggestFontSize=118]="suggestFontSize",n[n.suggestLineHeight=119]="suggestLineHeight",n[n.suggestOnTriggerCharacters=120]="suggestOnTriggerCharacters",n[n.suggestSelection=121]="suggestSelection",n[n.tabCompletion=122]="tabCompletion",n[n.tabIndex=123]="tabIndex",n[n.unicodeHighlighting=124]="unicodeHighlighting",n[n.unusualLineTerminators=125]="unusualLineTerminators",n[n.useShadowDOM=126]="useShadowDOM",n[n.useTabStops=127]="useTabStops",n[n.wordBreak=128]="wordBreak",n[n.wordSeparators=129]="wordSeparators",n[n.wordWrap=130]="wordWrap",n[n.wordWrapBreakAfterCharacters=131]="wordWrapBreakAfterCharacters",n[n.wordWrapBreakBeforeCharacters=132]="wordWrapBreakBeforeCharacters",n[n.wordWrapColumn=133]="wordWrapColumn",n[n.wordWrapOverride1=134]="wordWrapOverride1",n[n.wordWrapOverride2=135]="wordWrapOverride2",n[n.wrappingIndent=136]="wrappingIndent",n[n.wrappingStrategy=137]="wrappingStrategy",n[n.showDeprecated=138]="showDeprecated",n[n.inlayHints=139]="inlayHints",n[n.editorClassName=140]="editorClassName",n[n.pixelRatio=141]="pixelRatio",n[n.tabFocusMode=142]="tabFocusMode",n[n.layoutInfo=143]="layoutInfo",n[n.wrappingInfo=144]="wrappingInfo",n[n.defaultColorDecorators=145]="defaultColorDecorators",n[n.colorDecoratorsActivatedOn=146]="colorDecoratorsActivatedOn",n[n.inlineCompletionsAccessibilityVerbose=147]="inlineCompletionsAccessibilityVerbose"})(goe||(goe={}));var poe;(function(n){n[n.TextDefined=0]="TextDefined",n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(poe||(poe={}));var moe;(function(n){n[n.LF=0]="LF",n[n.CRLF=1]="CRLF"})(moe||(moe={}));var _oe;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(_oe||(_oe={}));var voe;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(voe||(voe={}));var boe;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(boe||(boe={}));var yoe;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(yoe||(yoe={}));var Coe;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(Coe||(Coe={}));var woe;(function(n){n[n.DependsOnKbLayout=-1]="DependsOnKbLayout",n[n.Unknown=0]="Unknown",n[n.Backspace=1]="Backspace",n[n.Tab=2]="Tab",n[n.Enter=3]="Enter",n[n.Shift=4]="Shift",n[n.Ctrl=5]="Ctrl",n[n.Alt=6]="Alt",n[n.PauseBreak=7]="PauseBreak",n[n.CapsLock=8]="CapsLock",n[n.Escape=9]="Escape",n[n.Space=10]="Space",n[n.PageUp=11]="PageUp",n[n.PageDown=12]="PageDown",n[n.End=13]="End",n[n.Home=14]="Home",n[n.LeftArrow=15]="LeftArrow",n[n.UpArrow=16]="UpArrow",n[n.RightArrow=17]="RightArrow",n[n.DownArrow=18]="DownArrow",n[n.Insert=19]="Insert",n[n.Delete=20]="Delete",n[n.Digit0=21]="Digit0",n[n.Digit1=22]="Digit1",n[n.Digit2=23]="Digit2",n[n.Digit3=24]="Digit3",n[n.Digit4=25]="Digit4",n[n.Digit5=26]="Digit5",n[n.Digit6=27]="Digit6",n[n.Digit7=28]="Digit7",n[n.Digit8=29]="Digit8",n[n.Digit9=30]="Digit9",n[n.KeyA=31]="KeyA",n[n.KeyB=32]="KeyB",n[n.KeyC=33]="KeyC",n[n.KeyD=34]="KeyD",n[n.KeyE=35]="KeyE",n[n.KeyF=36]="KeyF",n[n.KeyG=37]="KeyG",n[n.KeyH=38]="KeyH",n[n.KeyI=39]="KeyI",n[n.KeyJ=40]="KeyJ",n[n.KeyK=41]="KeyK",n[n.KeyL=42]="KeyL",n[n.KeyM=43]="KeyM",n[n.KeyN=44]="KeyN",n[n.KeyO=45]="KeyO",n[n.KeyP=46]="KeyP",n[n.KeyQ=47]="KeyQ",n[n.KeyR=48]="KeyR",n[n.KeyS=49]="KeyS",n[n.KeyT=50]="KeyT",n[n.KeyU=51]="KeyU",n[n.KeyV=52]="KeyV",n[n.KeyW=53]="KeyW",n[n.KeyX=54]="KeyX",n[n.KeyY=55]="KeyY",n[n.KeyZ=56]="KeyZ",n[n.Meta=57]="Meta",n[n.ContextMenu=58]="ContextMenu",n[n.F1=59]="F1",n[n.F2=60]="F2",n[n.F3=61]="F3",n[n.F4=62]="F4",n[n.F5=63]="F5",n[n.F6=64]="F6",n[n.F7=65]="F7",n[n.F8=66]="F8",n[n.F9=67]="F9",n[n.F10=68]="F10",n[n.F11=69]="F11",n[n.F12=70]="F12",n[n.F13=71]="F13",n[n.F14=72]="F14",n[n.F15=73]="F15",n[n.F16=74]="F16",n[n.F17=75]="F17",n[n.F18=76]="F18",n[n.F19=77]="F19",n[n.F20=78]="F20",n[n.F21=79]="F21",n[n.F22=80]="F22",n[n.F23=81]="F23",n[n.F24=82]="F24",n[n.NumLock=83]="NumLock",n[n.ScrollLock=84]="ScrollLock",n[n.Semicolon=85]="Semicolon",n[n.Equal=86]="Equal",n[n.Comma=87]="Comma",n[n.Minus=88]="Minus",n[n.Period=89]="Period",n[n.Slash=90]="Slash",n[n.Backquote=91]="Backquote",n[n.BracketLeft=92]="BracketLeft",n[n.Backslash=93]="Backslash",n[n.BracketRight=94]="BracketRight",n[n.Quote=95]="Quote",n[n.OEM_8=96]="OEM_8",n[n.IntlBackslash=97]="IntlBackslash",n[n.Numpad0=98]="Numpad0",n[n.Numpad1=99]="Numpad1",n[n.Numpad2=100]="Numpad2",n[n.Numpad3=101]="Numpad3",n[n.Numpad4=102]="Numpad4",n[n.Numpad5=103]="Numpad5",n[n.Numpad6=104]="Numpad6",n[n.Numpad7=105]="Numpad7",n[n.Numpad8=106]="Numpad8",n[n.Numpad9=107]="Numpad9",n[n.NumpadMultiply=108]="NumpadMultiply",n[n.NumpadAdd=109]="NumpadAdd",n[n.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",n[n.NumpadSubtract=111]="NumpadSubtract",n[n.NumpadDecimal=112]="NumpadDecimal",n[n.NumpadDivide=113]="NumpadDivide",n[n.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",n[n.ABNT_C1=115]="ABNT_C1",n[n.ABNT_C2=116]="ABNT_C2",n[n.AudioVolumeMute=117]="AudioVolumeMute",n[n.AudioVolumeUp=118]="AudioVolumeUp",n[n.AudioVolumeDown=119]="AudioVolumeDown",n[n.BrowserSearch=120]="BrowserSearch",n[n.BrowserHome=121]="BrowserHome",n[n.BrowserBack=122]="BrowserBack",n[n.BrowserForward=123]="BrowserForward",n[n.MediaTrackNext=124]="MediaTrackNext",n[n.MediaTrackPrevious=125]="MediaTrackPrevious",n[n.MediaStop=126]="MediaStop",n[n.MediaPlayPause=127]="MediaPlayPause",n[n.LaunchMediaPlayer=128]="LaunchMediaPlayer",n[n.LaunchMail=129]="LaunchMail",n[n.LaunchApp2=130]="LaunchApp2",n[n.Clear=131]="Clear",n[n.MAX_VALUE=132]="MAX_VALUE"})(woe||(woe={}));var Soe;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(Soe||(Soe={}));var Eoe;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(Eoe||(Eoe={}));var xoe;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(xoe||(xoe={}));var koe;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.TEXTAREA=1]="TEXTAREA",n[n.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",n[n.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",n[n.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",n[n.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",n[n.CONTENT_TEXT=6]="CONTENT_TEXT",n[n.CONTENT_EMPTY=7]="CONTENT_EMPTY",n[n.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",n[n.CONTENT_WIDGET=9]="CONTENT_WIDGET",n[n.OVERVIEW_RULER=10]="OVERVIEW_RULER",n[n.SCROLLBAR=11]="SCROLLBAR",n[n.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",n[n.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(koe||(koe={}));var Toe;(function(n){n[n.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",n[n.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",n[n.TOP_CENTER=2]="TOP_CENTER"})(Toe||(Toe={}));var Ioe;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(Ioe||(Ioe={}));var Loe;(function(n){n[n.Left=0]="Left",n[n.Right=1]="Right",n[n.None=2]="None",n[n.LeftOfInjectedText=3]="LeftOfInjectedText",n[n.RightOfInjectedText=4]="RightOfInjectedText"})(Loe||(Loe={}));var Doe;(function(n){n[n.Off=0]="Off",n[n.On=1]="On",n[n.Relative=2]="Relative",n[n.Interval=3]="Interval",n[n.Custom=4]="Custom"})(Doe||(Doe={}));var Aoe;(function(n){n[n.None=0]="None",n[n.Text=1]="Text",n[n.Blocks=2]="Blocks"})(Aoe||(Aoe={}));var Roe;(function(n){n[n.Smooth=0]="Smooth",n[n.Immediate=1]="Immediate"})(Roe||(Roe={}));var Noe;(function(n){n[n.Auto=1]="Auto",n[n.Hidden=2]="Hidden",n[n.Visible=3]="Visible"})(Noe||(Noe={}));var Ooe;(function(n){n[n.LTR=0]="LTR",n[n.RTL=1]="RTL"})(Ooe||(Ooe={}));var Poe;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(Poe||(Poe={}));var Moe;(function(n){n[n.File=0]="File",n[n.Module=1]="Module",n[n.Namespace=2]="Namespace",n[n.Package=3]="Package",n[n.Class=4]="Class",n[n.Method=5]="Method",n[n.Property=6]="Property",n[n.Field=7]="Field",n[n.Constructor=8]="Constructor",n[n.Enum=9]="Enum",n[n.Interface=10]="Interface",n[n.Function=11]="Function",n[n.Variable=12]="Variable",n[n.Constant=13]="Constant",n[n.String=14]="String",n[n.Number=15]="Number",n[n.Boolean=16]="Boolean",n[n.Array=17]="Array",n[n.Object=18]="Object",n[n.Key=19]="Key",n[n.Null=20]="Null",n[n.EnumMember=21]="EnumMember",n[n.Struct=22]="Struct",n[n.Event=23]="Event",n[n.Operator=24]="Operator",n[n.TypeParameter=25]="TypeParameter"})(Moe||(Moe={}));var Foe;(function(n){n[n.Deprecated=1]="Deprecated"})(Foe||(Foe={}));var Boe;(function(n){n[n.Hidden=0]="Hidden",n[n.Blink=1]="Blink",n[n.Smooth=2]="Smooth",n[n.Phase=3]="Phase",n[n.Expand=4]="Expand",n[n.Solid=5]="Solid"})(Boe||(Boe={}));var $oe;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})($oe||($oe={}));var Voe;(function(n){n[n.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",n[n.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",n[n.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",n[n.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(Voe||(Voe={}));var Hoe;(function(n){n[n.None=0]="None",n[n.Same=1]="Same",n[n.Indent=2]="Indent",n[n.DeepIndent=3]="DeepIndent"})(Hoe||(Hoe={}));let u5=class{static chord(e,t){return Ma(e,t)}};u5.CtrlCmd=2048;u5.Shift=1024;u5.Alt=512;u5.WinCtrl=256;function Yje(){return{editor:void 0,languages:void 0,CancellationTokenSource:da,Emitter:be,KeyCode:woe,KeyMod:u5,Position:Ce,Range:q,Selection:ln,SelectionDirection:Ooe,MarkerSeverity:Soe,MarkerTag:Eoe,Uri:Tn,Token:bM}}class E6i{constructor(e){this.fn=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.fn(e)),this.lastCache}}class fLe{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}class Jw{constructor(e){this.executor=e,this._didRun=!1}get value(){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 UD;function Qje(n){return!n||typeof n!="string"?!0:n.trim().length===0}const x6i=/{(\d+)}/g;function Dx(n,...e){return e.length===0?n:n.replace(x6i,function(t,i){const r=parseInt(i,10);return isNaN(r)||r<0||r>=e.length?t:e[r]})}function LV(n){return n.replace(/[<>&]/g,function(e){switch(e){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return e}})}function hf(n){return n.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function k6i(n,e=" "){const t=d5(n,e);return Xje(t,e)}function d5(n,e){if(!n||!e)return n;const t=e.length;if(t===0||n.length===0)return n;let i=0;for(;n.indexOf(e,i)===i;)i=i+t;return n.substring(i)}function Xje(n,e){if(!n||!e)return n;const t=e.length,i=n.length;if(t===0||i===0)return n;let r=i,o=-1;for(;o=n.lastIndexOf(e,r-1),!(o===-1||o+t!==r);){if(o===0)return"";r=o}return n.substring(0,r)}function T6i(n){return n.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function I6i(n){return n.replace(/\*/g,"")}function Zje(n,e,t={}){if(!n)throw new Error("Cannot create regex from empty string");e||(n=hf(n)),t.wholeWord&&(/\B/.test(n.charAt(0))||(n="\\b"+n),/\B/.test(n.charAt(n.length-1))||(n=n+"\\b"));let i="";return t.global&&(i+="g"),t.matchCase||(i+="i"),t.multiline&&(i+="m"),t.unicode&&(i+="u"),new RegExp(n,i)}function L6i(n){return n.source==="^"||n.source==="^$"||n.source==="$"||n.source==="^\\s*$"?!1:!!(n.exec("")&&n.lastIndex===0)}function ab(n){return n.split(/\r\n|\r|\n/)}function cu(n){for(let e=0,t=n.length;e<t;e++){const i=n.charCodeAt(e);if(i!==32&&i!==9)return e}return-1}function go(n,e=0,t=n.length){for(let i=e;i<t;i++){const r=n.charCodeAt(i);if(r!==32&&r!==9)return n.substring(e,i)}return n.substring(e,t)}function g_(n,e=n.length-1){for(let t=e;t>=0;t--){const i=n.charCodeAt(t);if(i!==32&&i!==9)return t}return-1}function wM(n,e){return n<e?-1:n>e?1:0}function Ime(n,e,t=0,i=n.length,r=0,o=e.length){for(;t<i&&r<o;t++,r++){const l=n.charCodeAt(t),c=e.charCodeAt(r);if(l<c)return-1;if(l>c)return 1}const s=i-t,a=o-r;return s<a?-1:s>a?1:0}function Woe(n,e){return h5(n,e,0,n.length,0,e.length)}function h5(n,e,t=0,i=n.length,r=0,o=e.length){for(;t<i&&r<o;t++,r++){let l=n.charCodeAt(t),c=e.charCodeAt(r);if(l===c)continue;if(l>=128||c>=128)return Ime(n.toLowerCase(),e.toLowerCase(),t,i,r,o);G1(l)&&(l-=32),G1(c)&&(c-=32);const u=l-c;if(u!==0)return u}const s=i-t,a=o-r;return s<a?-1:s>a?1:0}function _B(n){return n>=48&&n<=57}function G1(n){return n>=97&&n<=122}function dv(n){return n>=65&&n<=90}function OI(n,e){return n.length===e.length&&h5(n,e)===0}function Lme(n,e){const t=e.length;return e.length>n.length?!1:h5(n,e,0,t)===0}function Ax(n,e){const t=Math.min(n.length,e.length);let i;for(i=0;i<t;i++)if(n.charCodeAt(i)!==e.charCodeAt(i))return i;return t}function DV(n,e){const t=Math.min(n.length,e.length);let i;const r=n.length-1,o=e.length-1;for(i=0;i<t;i++)if(n.charCodeAt(r-i)!==e.charCodeAt(o-i))return i;return t}function Za(n){return 55296<=n&&n<=56319}function Rx(n){return 56320<=n&&n<=57343}function Dme(n,e){return(n-55296<<10)+(e-56320)+65536}function AV(n,e,t){const i=n.charCodeAt(t);if(Za(i)&&t+1<e){const r=n.charCodeAt(t+1);if(Rx(r))return Dme(i,r)}return i}function D6i(n,e){const t=n.charCodeAt(e-1);if(Rx(t)&&e>1){const i=n.charCodeAt(e-2);if(Za(i))return Dme(i,t)}return t}class Ame{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=D6i(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=AV(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class RV{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new Ame(e,t)}nextGraphemeLength(){const e=Y1.getInstance(),t=this._iterator,i=t.offset;let r=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const o=t.offset,s=e.getGraphemeBreakType(t.nextCodePoint());if(gLe(r,s)){t.setOffset(o);break}r=s}return t.offset-i}prevGraphemeLength(){const e=Y1.getInstance(),t=this._iterator,i=t.offset;let r=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const o=t.offset,s=e.getGraphemeBreakType(t.prevCodePoint());if(gLe(s,r)){t.setOffset(o);break}r=s}return i-t.offset}eol(){return this._iterator.eol()}}function Rme(n,e){return new RV(n,e).nextGraphemeLength()}function Jje(n,e){return new RV(n,e).prevGraphemeLength()}function A6i(n,e){e>0&&Rx(n.charCodeAt(e))&&e--;const t=e+Rme(n,e);return[t-Jje(n,t),t]}let KX;function R6i(){return/(?:[\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 qD(n){return KX||(KX=R6i()),KX.test(n)}const N6i=/^[\t\n\r\x20-\x7E]*$/;function f5(n){return N6i.test(n)}const eUe=/[\u2028\u2029]/;function tUe(n){return eUe.test(n)}function aw(n){return n>=11904&&n<=55215||n>=63744&&n<=64255||n>=65281&&n<=65374}function Nme(n){return n>=127462&&n<=127487||n===8986||n===8987||n===9200||n===9203||n>=9728&&n<=10175||n===11088||n===11093||n>=127744&&n<=128591||n>=128640&&n<=128764||n>=128992&&n<=129008||n>=129280&&n<=129535||n>=129648&&n<=129782}const O6i=String.fromCharCode(65279);function Ome(n){return!!(n&&n.length>0&&n.charCodeAt(0)===65279)}function P6i(n,e=!1){return n?(e&&(n=n.replace(/\\./g,"")),n.toLowerCase()!==n):!1}function nUe(n){return n=n%(2*26),n<26?String.fromCharCode(97+n):String.fromCharCode(65+n-26)}function gLe(n,e){return n===0?e!==5&&e!==7:n===2&&e===3?!1:n===4||n===2||n===3||e===4||e===2||e===3?!0:!(n===8&&(e===8||e===9||e===11||e===12)||(n===11||n===9)&&(e===9||e===10)||(n===12||n===10)&&e===10||e===5||e===13||e===7||n===1||n===13&&e===14||n===6&&e===6)}class Y1{static getInstance(){return Y1._INSTANCE||(Y1._INSTANCE=new Y1),Y1._INSTANCE}constructor(){this._data=M6i()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let r=1;for(;r<=i;)if(e<t[3*r])r=2*r;else if(e>t[3*r+1])r=2*r+1;else return t[3*r+2];return 0}}Y1._INSTANCE=null;function M6i(){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 F6i(n,e){if(n===0)return 0;const t=B6i(n,e);if(t!==void 0)return t;const i=new Ame(e,n);return i.prevCodePoint(),i.offset}function B6i(n,e){const t=new Ame(e,n);let i=t.prevCodePoint();for(;$6i(i)||i===65039||i===8419;){if(t.offset===0)return;i=t.prevCodePoint()}if(!Nme(i))return;let r=t.offset;return r>0&&t.prevCodePoint()===8205&&(r=t.offset),r}function $6i(n){return 127995<=n&&n<=127999}const iUe=" ";class Nx{static getInstance(e){return UD.cache.get(Array.from(e))}static getLocales(){return UD._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}UD=Nx;Nx.ambiguousCharacterData=new Jw(()=>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,119846,109],"_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]}'));Nx.cache=new E6i(n=>{function e(c){const u=new Map;for(let d=0;d<c.length;d+=2)u.set(c[d],c[d+1]);return u}function t(c,u){const d=new Map(c);for(const[h,g]of u)d.set(h,g);return d}function i(c,u){if(!c)return u;const d=new Map;for(const[h,g]of c)u.has(h)&&d.set(h,g);return d}const r=UD.ambiguousCharacterData.value;let o=n.filter(c=>!c.startsWith("_")&&c in r);o.length===0&&(o=["_default"]);let s;for(const c of o){const u=e(r[c]);s=i(s,u)}const a=e(r._common),l=t(a,s);return new UD(l)});Nx._locales=new Jw(()=>Object.keys(UD.ambiguousCharacterData.value).filter(n=>!n.startsWith("_")));class Xv{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(Xv.getRawData())),this._data}static isInvisibleCharacter(e){return Xv.getData().has(e)}static get codePoints(){return Xv.getData()}}Xv._data=void 0;class zoe{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}zoe.INSTANCE=new zoe;class V6i extends Ae{constructor(){super(),this._onDidChange=this._register(new be),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(!0),this._mediaQueryList=null,this._handleChange(!1)}_handleChange(e){var t;(t=this._mediaQueryList)===null||t===void 0||t.removeEventListener("change",this._listener),this._mediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class H6i extends Ae{get value(){return this._value}constructor(){super(),this._onDidChange=this._register(new be),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new V6i);this._register(e.onDidChange(()=>{this._value=this._getPixelRatio(),this._onDidChange.fire(this._value)}))}_getPixelRatio(){const e=document.createElement("canvas").getContext("2d"),t=window.devicePixelRatio||1,i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/i}}class W6i{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=new H6i),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}}function rUe(n,e){typeof n=="string"&&(n=window.matchMedia(n)),n.addEventListener("change",e)}const SM=new W6i;function z6i(){return zoe.INSTANCE.getZoomFactor()}const bA=navigator.userAgent,wg=bA.indexOf("Firefox")>=0,YE=bA.indexOf("AppleWebKit")>=0,Pme=bA.indexOf("Chrome")>=0,b0=!Pme&&bA.indexOf("Safari")>=0,oUe=!Pme&&!b0&&YE;bA.indexOf("Electron/")>=0;const pLe=bA.indexOf("Android")>=0;let T8=!1;if(window.matchMedia){const n=window.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=window.matchMedia("(display-mode: fullscreen)");T8=n.matches,rUe(n,({matches:t})=>{T8&&e.matches||(T8=t)})}function j6i(){return T8}class sUe{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){const t=vm(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=vm(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=vm(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=vm(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=vm(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=vm(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=vm(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=vm(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}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){const t=vm(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}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)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=vm(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=vm(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}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 vm(n){return typeof n=="number"?`${n}px`:n}function Or(n){return new sUe(n)}function mc(n,e){n instanceof sUe?(n.setFontFamily(e.getMassagedFontFamily()),n.setFontWeight(e.fontWeight),n.setFontSize(e.fontSize),n.setFontFeatureSettings(e.fontFeatureSettings),n.setFontVariationSettings(e.fontVariationSettings),n.setLineHeight(e.lineHeight),n.setLetterSpacing(e.letterSpacing)):(n.style.fontFamily=e.getMassagedFontFamily(),n.style.fontWeight=e.fontWeight,n.style.fontSize=e.fontSize+"px",n.style.fontFeatureSettings=e.fontFeatureSettings,n.style.fontVariationSettings=e.fontVariationSettings,n.style.lineHeight=e.lineHeight+"px",n.style.letterSpacing=e.letterSpacing+"px")}class U6i{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class Mme{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");mc(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");mc(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const r=document.createElement("div");mc(r,this._bareFontInfo),r.style.fontStyle="italic",e.appendChild(r);const o=[];for(const s of this._requests){let a;s.type===0&&(a=t),s.type===2&&(a=i),s.type===1&&(a=r),a.appendChild(document.createElement("br"));const l=document.createElement("span");Mme._render(l,s),a.appendChild(l),o.push(l)}this._container=e,this._testElements=o}static _render(e,t){if(t.chr===" "){let i=" ";for(let r=0;r<8;r++)i+=i;e.innerText=i}else{let i=t.chr;for(let r=0;r<8;r++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e<t;e++){const i=this._requests[e],r=this._testElements[e];i.fulfill(r.offsetWidth/256)}}}function q6i(n,e){new Mme(n,e).read()}const Yf=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new be,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(n){n=Math.min(Math.max(-5,n),20),this._zoomLevel!==n&&(this._zoomLevel=n,this._onDidChangeZoomLevel.fire(this._zoomLevel))}},K6i=Qi?1.5:1.35,GX=8;class QE{static createFromValidatedSettings(e,t,i){const r=e.get(49),o=e.get(53),s=e.get(52),a=e.get(51),l=e.get(54),c=e.get(66),u=e.get(63);return QE._create(r,o,s,a,l,c,u,t,i)}static _create(e,t,i,r,o,s,a,l,c){s===0?s=K6i*i:s<GX&&(s=s*i),s=Math.round(s),s<GX&&(s=GX);const u=1+(c?0:Yf.getZoomLevel()*.1);return i*=u,s*=u,o===Qm.TRANSLATE&&(t==="normal"||t==="bold"?o=Qm.OFF:(o=`'wght' ${parseInt(t,10)}`,t="normal")),new QE({pixelRatio:l,fontFamily:e,fontWeight:t,fontSize:i,fontFeatureSettings:r,fontVariationSettings:o,lineHeight:s,letterSpacing:a})}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.fontVariationSettings=e.fontVariationSettings,this.lineHeight=e.lineHeight|0,this.letterSpacing=e.letterSpacing}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){const e=ih.fontFamily,t=QE._wrapInQuotes(this.fontFamily);return e&&this.fontFamily!==e?`${t}, ${e}`:t}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}}const G6i=2;class joe extends QE{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=G6i,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.fontVariationSettings===e.fontVariationSettings&&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 Y6i extends Ae{constructor(){super(),this._onDidChange=this._register(new be),this.onDidChange=this._onDidChange.event,this._cache=new mLe,this._evictUntrustedReadingsTimeout=-1}dispose(){this._evictUntrustedReadingsTimeout!==-1&&(window.clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache=new mLe,this._onDidChange.fire()}_writeToCache(e,t){this._cache.put(e,t),!t.isTrusted&&this._evictUntrustedReadingsTimeout===-1&&(this._evictUntrustedReadingsTimeout=window.setTimeout(()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()},5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const i of e)i.isTrusted||(t=!0,this._cache.remove(i));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 joe({pixelRatio:SM.value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,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,i,r){const o=new U6i(e,t);return i.push(o),r==null||r.push(o),o}_actualReadFontInfo(e){const t=[],i=[],r=this._createRequest("n",0,t,i),o=this._createRequest("",0,t,null),s=this._createRequest(" ",0,t,i),a=this._createRequest("0",0,t,i),l=this._createRequest("1",0,t,i),c=this._createRequest("2",0,t,i),u=this._createRequest("3",0,t,i),d=this._createRequest("4",0,t,i),h=this._createRequest("5",0,t,i),g=this._createRequest("6",0,t,i),p=this._createRequest("7",0,t,i),m=this._createRequest("8",0,t,i),_=this._createRequest("9",0,t,i),v=this._createRequest("→",0,t,i),b=this._createRequest("→",0,t,null),y=this._createRequest("·",0,t,i),C=this._createRequest(String.fromCharCode(11825),0,t,null),x="|/-_ilm%";for(let R=0,P=x.length;R<P;R++)this._createRequest(x.charAt(R),0,t,i),this._createRequest(x.charAt(R),1,t,i),this._createRequest(x.charAt(R),2,t,i);q6i(e,t);const k=Math.max(a.width,l.width,c.width,u.width,d.width,h.width,g.width,p.width,m.width,_.width);let I=e.fontFeatureSettings===Fh.OFF;const L=i[0].width;for(let R=1,P=i.length;I&&R<P;R++){const M=L-i[R].width;if(M<-.001||M>.001){I=!1;break}}let D=!0;return I&&b.width!==L&&(D=!1),b.width>v.width&&(D=!1),new joe({pixelRatio:SM.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,fontVariationSettings:e.fontVariationSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:I,typicalHalfwidthCharacterWidth:r.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:D,spaceWidth:s.width,middotWidth:y.width,wsmiddotWidth:C.width,maxDigitWidth:k},!0)}}class mLe{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 i=e.getId();this._keys[i]=e,this._values[i]=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 Uoe=new Y6i;var i_;(function(n){n.serviceIds=new Map,n.DI_TARGET="$di$target",n.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[n.DI_DEPENDENCIES]||[]}n.getServiceDependencies=e})(i_||(i_={}));const Un=Vi("instantiationService");function Q6i(n,e,t){e[i_.DI_TARGET]===e?e[i_.DI_DEPENDENCIES].push({id:n,index:t}):(e[i_.DI_DEPENDENCIES]=[{id:n,index:t}],e[i_.DI_TARGET]=e)}function Vi(n){if(i_.serviceIds.has(n))return i_.serviceIds.get(n);const e=function(t,i,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Q6i(e,t,r)};return e.toString=()=>n,i_.serviceIds.set(n,e),e}const Lr=Vi("codeEditorService"),ts=Vi("modelService"),Pd=Vi("textModelService");var KD=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Gu extends Ae{constructor(e,t="",i="",r=!0,o){super(),this._onDidChange=this._register(new be),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=r,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 KD(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(e))})}}class GD extends Ae{constructor(){super(...arguments),this._onWillRun=this._register(new be),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new be),this.onDidRun=this._onDidRun.event}run(e,t){return KD(this,void 0,void 0,function*(){if(!e.enabled)return;this._onWillRun.fire({action:e});let i;try{yield this.runAction(e,t)}catch(r){i=r}this._onDidRun.fire({action:e,error:i})})}runAction(e,t){return KD(this,void 0,void 0,function*(){yield e.run(t)})}}class El{constructor(){this.id=El.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const i of e)i.length&&(t.length?t=[...t,new El,...i]:t=i);return t}run(){return KD(this,void 0,void 0,function*(){})}}El.ID="vs.actions.separator";class YD{get actions(){return this._actions}constructor(e,t,i,r){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=r,this._actions=i}run(){return KD(this,void 0,void 0,function*(){})}}class AU extends Gu{constructor(){super(AU.ID,E("submenu.empty","(empty)"),void 0,!1)}}AU.ID="vs.actions.empty";function xL(n){var e,t;return{id:n.id,label:n.label,class:void 0,enabled:(e=n.enabled)!==null&&e!==void 0?e:!0,checked:(t=n.checked)!==null&&t!==void 0?t:!1,run:(...i)=>KD(this,void 0,void 0,function*(){return n.run(...i)}),tooltip:n.label}}var qoe;(function(n){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}n.isThemeColor=e})(qoe||(qoe={}));var In;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9-]+",n.iconModifierExpression="~[A-Za-z]+",n.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function t(h){const g=e.exec(h.id);if(!g)return t(Ct.error);const[,p,m]=g,_=["codicon","codicon-"+p];return m&&_.push("codicon-modifier-"+m.substring(1)),_}n.asClassNameArray=t;function i(h){return t(h).join(" ")}n.asClassName=i;function r(h){return"."+t(h).join(".")}n.asCSSSelector=r;function o(h){return h&&typeof h=="object"&&typeof h.id=="string"&&(typeof h.color>"u"||qoe.isThemeColor(h.color))}n.isThemeIcon=o;const s=new RegExp(`^\\$\\((${n.iconNameExpression}(?:${n.iconModifierExpression})?)\\)$`);function a(h){const g=s.exec(h);if(!g)return;const[,p]=g;return{id:p}}n.fromString=a;function l(h){return{id:h}}n.fromId=l;function c(h,g){let p=h.id;const m=p.lastIndexOf("~");return m!==-1&&(p=p.substring(0,m)),g&&(p=`${p}~${g}`),{id:p}}n.modify=c;function u(h){const g=h.id.lastIndexOf("~");if(g!==-1)return h.id.substring(g+1)}n.getModifier=u;function d(h,g){var p,m;return h.id===g.id&&((p=h.color)===null||p===void 0?void 0:p.id)===((m=g.color)===null||m===void 0?void 0:m.id)}n.isEqual=d})(In||(In={}));const Fs=Vi("commandService"),Xi=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new be,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,e){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:n,handler:e})}if(n.description){const s=[];for(const l of n.description.args)s.push(l.constraint);const a=n.handler;n.handler=function(l,...c){return R5i(c,s),a(l,...c)}}const{id:t}=n;let i=this._commands.get(t);i||(i=new Hu,this._commands.set(t,i));const r=i.unshift(n),o=Gn(()=>{r();const s=this._commands.get(t);s!=null&&s.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(n,e){return Xi.registerCommand(n,(t,...i)=>t.get(Fs).executeCommand(e,...i))}getCommand(n){const e=this._commands.get(n);if(!(!e||e.isEmpty()))return Pi.first(e)}getCommands(){const n=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&n.set(e,t)}return n}};Xi.registerCommand("noop",()=>{});function YX(...n){switch(n.length){case 1:return E("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",n[0]);case 2:return E("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",n[0],n[1]);case 3:return E("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",n[0],n[1],n[2]);default:return}}const X6i=E("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),Z6i=E("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");let rE=class Koe{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw yme(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(YX("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(YX("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(YX("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,i=this._input.substring(this._start,this._current),r={type:19,offset:this._start,lexeme:i};this._errors.push({offset:t,lexeme:i,additionalInfo:e}),this._tokens.push(r)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),i=Koe._keywords.get(t);i?this._addToken(i):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(X6i);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,t=!1,i=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(Z6i);return}const o=this._input.charCodeAt(e);if(t)t=!1;else if(o===47&&!i){e++;break}else o===91?i=!0:o===92?t=!0:o===93&&(i=!1);e++}for(;e<this._input.length&&Koe._regexFlags.has(this._input.charCodeAt(e));)e++;this._current=e;const r=this._input.substring(this._start,this._current);this._tokens.push({type:10,lexeme:r,offset:this._start})}_isAtEnd(){return this._current>=this._input.length}};rE._regexFlags=new Set(["i","g","s","m","y","u"].map(n=>n.charCodeAt(0)));rE._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const Vc=new Map;Vc.set("false",!1);Vc.set("true",!0);Vc.set("isMac",Qi);Vc.set("isLinux",fu);Vc.set("isWindows",vc);Vc.set("isWeb",Qw);Vc.set("isMacNative",Qi&&!Qw);Vc.set("isEdge",G5i);Vc.set("isFirefox",q5i);Vc.set("isChrome",Ije);Vc.set("isSafari",K5i);const J6i=Object.prototype.hasOwnProperty,eBi={regexParsingWithErrorRecovery:!0},tBi=E("contextkey.parser.error.emptyString","Empty context key expression"),nBi=E("contextkey.parser.error.emptyString.hint","Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),iBi=E("contextkey.parser.error.noInAfterNot","'in' after 'not'."),_Le=E("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),rBi=E("contextkey.parser.error.unexpectedToken","Unexpected token"),oBi=E("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),sBi=E("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),aBi=E("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");let aUe=class EN{constructor(e=eBi){this._config=e,this._scanner=new rE,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:tBi,offset:0,lexeme:"",additionalInfo:nBi});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const i=this._peek(),r=i.type===17?oBi:void 0;throw this._parsingErrors.push({message:rBi,offset:i.offset,lexeme:rE.getLexeme(i),additionalInfo:r}),EN._parseError}return t}catch(t){if(t!==EN._parseError)throw t;return}}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return e.length===1?e[0]:Ke.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:Ke.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),Qu.INSTANCE;case 12:return this._advance(),Id.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,_Le),t==null?void 0:t.negate()}case 17:return this._advance(),Ak.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),Ke.true();case 12:return this._advance(),Ke.false();case 0:{this._advance();const t=this._expr();return this._consume(1,_Le),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const r=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),r.type!==10)throw this._errExpectedButGot("REGEX",r);const o=r.lexeme,s=o.lastIndexOf("/"),a=s===o.length-1?void 0:this._removeFlagsGY(o.substring(s+1));let l;try{l=new RegExp(o.substring(1,s),a)}catch{throw this._errExpectedButGot("REGEX",r)}return EM.create(t,l)}switch(r.type){case 10:case 19:{const o=[r.lexeme];this._advance();let s=this._peek(),a=0;for(let h=0;h<r.lexeme.length;h++)r.lexeme.charCodeAt(h)===40?a++:r.lexeme.charCodeAt(h)===41&&a--;for(;!this._isAtEnd()&&s.type!==15&&s.type!==16;){switch(s.type){case 0:a++;break;case 1:a--;break;case 10:case 18:for(let h=0;h<s.lexeme.length;h++)s.lexeme.charCodeAt(h)===40?a++:r.lexeme.charCodeAt(h)===41&&a--}if(a<0)break;o.push(rE.getLexeme(s)),this._advance(),s=this._peek()}const l=o.join(""),c=l.lastIndexOf("/"),u=c===l.length-1?void 0:this._removeFlagsGY(l.substring(c+1));let d;try{d=new RegExp(l.substring(1,c),u)}catch{throw this._errExpectedButGot("REGEX",r)}return Ke.regex(t,d)}case 18:{const o=r.lexeme;this._advance();let s=null;if(!Qje(o)){const a=o.indexOf("/"),l=o.lastIndexOf("/");if(a!==l&&a>=0){const c=o.slice(a+1,l),u=o[l+1]==="i"?"i":"";try{s=new RegExp(c,u)}catch{throw this._errExpectedButGot("REGEX",r)}}}if(s===null)throw this._errExpectedButGot("REGEX",r);return EM.create(t,s)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,iBi);const r=this._value();return Ke.notIn(t,r)}switch(this._peek().type){case 3:{this._advance();const r=this._value();if(this._previous().type===18)return Ke.equals(t,r);switch(r){case"true":return Ke.has(t);case"false":return Ke.not(t);default:return Ke.equals(t,r)}}case 4:{this._advance();const r=this._value();if(this._previous().type===18)return Ke.notEquals(t,r);switch(r){case"true":return Ke.not(t);case"false":return Ke.has(t);default:return Ke.notEquals(t,r)}}case 5:return this._advance(),BU.create(t,this._value());case 6:return this._advance(),$U.create(t,this._value());case 7:return this._advance(),MU.create(t,this._value());case 8:return this._advance(),FU.create(t,this._value());case 13:return this._advance(),Ke.in(t,this._value());default:return Ke.has(t)}}case 20:throw this._parsingErrors.push({message:sBi,offset:e.offset,lexeme:"",additionalInfo:aBi}),EN._parseError;default:throw this._errExpectedButGot(`true | false | KEY
| KEY '=~' REGEX
| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,i){const r=E("contextkey.parser.error.expectedButGot",`Expected: {0}
Received: '{1}'.`,e,rE.getLexeme(t)),o=t.offset,s=rE.getLexeme(t);return this._parsingErrors.push({message:r,offset:o,lexeme:s,additionalInfo:i}),EN._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};aUe._parseError=new Error;class Ke{static false(){return Qu.INSTANCE}static true(){return Id.INSTANCE}static has(e){return Dk.create(e)}static equals(e,t){return yA.create(e,t)}static notEquals(e,t){return OU.create(e,t)}static regex(e,t){return EM.create(e,t)}static in(e,t){return RU.create(e,t)}static notIn(e,t){return NU.create(e,t)}static not(e){return Ak.create(e)}static and(...e){return kE.create(e,null,!0)}static or(...e){return wy.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}Ke._parser=new aUe({regexParsingWithErrorRecovery:!1});function lBi(n,e){const t=n?n.substituteConstants():void 0,i=e?e.substituteConstants():void 0;return!t&&!i?!0:!t||!i?!1:t.equals(i)}function RO(n,e){return n.cmp(e)}class Qu{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 Id.INSTANCE}}Qu.INSTANCE=new Qu;class Id{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 Qu.INSTANCE}}Id.INSTANCE=new Id;class Dk{static create(e,t=null){const i=Vc.get(e);return typeof i=="boolean"?i?Id.INSTANCE:Qu.INSTANCE:new Dk(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:cUe(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Vc.get(this.key);return typeof e=="boolean"?e?Id.INSTANCE:Qu.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=Ak.create(this.key,this)),this.negated}}class yA{static create(e,t,i=null){if(typeof t=="boolean")return t?Dk.create(e,i):Ak.create(e,i);const r=Vc.get(e);return typeof r=="boolean"?t===(r?"true":"false")?Id.INSTANCE:Qu.INSTANCE:new yA(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:Rk(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=Vc.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Id.INSTANCE:Qu.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=OU.create(this.key,this.value,this)),this.negated}}class RU{static create(e,t){return new RU(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:Rk(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):typeof i=="string"&&typeof t=="object"&&t!==null?J6i.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=NU.create(this.key,this.valueKey)),this.negated}}class NU{static create(e,t){return new NU(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=RU.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class OU{static create(e,t,i=null){if(typeof t=="boolean")return t?Ak.create(e,i):Dk.create(e,i);const r=Vc.get(e);return typeof r=="boolean"?t===(r?"true":"false")?Qu.INSTANCE:Id.INSTANCE:new OU(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:Rk(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=Vc.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Qu.INSTANCE:Id.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=yA.create(this.key,this.value,this)),this.negated}}class Ak{static create(e,t=null){const i=Vc.get(e);return typeof i=="boolean"?i?Qu.INSTANCE:Id.INSTANCE:new Ak(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:cUe(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Vc.get(this.key);return typeof e=="boolean"?e?Qu.INSTANCE:Id.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Dk.create(this.key,this)),this.negated}}function PU(n,e){if(typeof n=="string"){const t=parseFloat(n);isNaN(t)||(n=t)}return typeof n=="string"||typeof n=="number"?e(n):Qu.INSTANCE}class MU{static create(e,t,i=null){return PU(t,r=>new MU(e,r,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:Rk(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=$U.create(this.key,this.value,this)),this.negated}}class FU{static create(e,t,i=null){return PU(t,r=>new FU(e,r,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:Rk(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=BU.create(this.key,this.value,this)),this.negated}}class BU{static create(e,t,i=null){return PU(t,r=>new BU(e,r,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:Rk(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=FU.create(this.key,this.value,this)),this.negated}}class $U{static create(e,t,i=null){return PU(t,r=>new $U(e,r,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:Rk(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=MU.create(this.key,this.value,this)),this.negated}}class EM{static create(e,t){return new EM(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}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:"",i=e.regexp?e.regexp.source:"";return t<i?-1:t>i?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Fme.create(this)),this.negated}}class Fme{static create(e){return new Fme(e)}constructor(e){this._actual=e,this.type=8}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):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function lUe(n){let e=null;for(let t=0,i=n.length;t<i;t++){const r=n[t].substituteConstants();if(n[t]!==r&&e===null){e=[];for(let o=0;o<t;o++)e[o]=n[o]}e!==null&&(e[t]=r)}return e===null?n:e}class kE{static create(e,t,i){return kE._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=6}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,i=this.expr.length;t<i;t++){const r=RO(this.expr[t],e.expr[t]);if(r!==0)return r}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=lUe(this.expr);return e===this.expr?this:kE.create(e,this.negated,!1)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].evaluate(e))return!1;return!0}static _normalizeArr(e,t,i){const r=[];let o=!1;for(const s of e)if(s){if(s.type===1){o=!0;continue}if(s.type===0)return Qu.INSTANCE;if(s.type===6){r.push(...s.expr);continue}r.push(s)}if(r.length===0&&o)return Id.INSTANCE;if(r.length!==0){if(r.length===1)return r[0];r.sort(RO);for(let s=1;s<r.length;s++)r[s-1].equals(r[s])&&(r.splice(s,1),s--);if(r.length===1)return r[0];for(;r.length>1;){const s=r[r.length-1];if(s.type!==9)break;r.pop();const a=r.pop(),l=r.length===0,c=wy.create(s.expr.map(u=>kE.create([u,a],null,i)),null,l);c&&(r.push(c),r.sort(RO))}if(r.length===1)return r[0];if(i){for(let s=0;s<r.length;s++)for(let a=s+1;a<r.length;a++)if(r[s].negate().equals(r[a]))return Qu.INSTANCE;if(r.length===1)return r[0]}return new kE(r,t)}}serialize(){return this.expr.map(e=>e.serialize()).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=wy.create(e,this,!0)}return this.negated}}class wy{static create(e,t,i){return wy._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}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,i=this.expr.length;t<i;t++){const r=RO(this.expr[t],e.expr[t]);if(r!==0)return r}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,i=this.expr.length;t<i;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){const e=lUe(this.expr);return e===this.expr?this:wy.create(e,this.negated,!1)}evaluate(e){for(let t=0,i=this.expr.length;t<i;t++)if(this.expr[t].evaluate(e))return!0;return!1}static _normalizeArr(e,t,i){let r=[],o=!1;if(e){for(let s=0,a=e.length;s<a;s++){const l=e[s];if(l){if(l.type===0){o=!0;continue}if(l.type===1)return Id.INSTANCE;if(l.type===9){r=r.concat(l.expr);continue}r.push(l)}}if(r.length===0&&o)return Qu.INSTANCE;r.sort(RO)}if(r.length!==0){if(r.length===1)return r[0];for(let s=1;s<r.length;s++)r[s-1].equals(r[s])&&(r.splice(s,1),s--);if(r.length===1)return r[0];if(i){for(let s=0;s<r.length;s++)for(let a=s+1;a<r.length;a++)if(r[s].negate().equals(r[a]))return Id.INSTANCE;if(r.length===1)return r[0]}return new wy(r,t)}}serialize(){return this.expr.map(e=>e.serialize()).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),r=[];for(const o of bLe(t))for(const s of bLe(i))r.push(kE.create([o,s],null,!1));e.unshift(wy.create(r,null,!1))}this.negated=wy.create(e,this,!0)}return this.negated}}class Ft extends Dk{static all(){return Ft._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,typeof i=="object"?Ft._info.push(Object.assign(Object.assign({},i),{key:e})):i!==!0&&Ft._info.push({key:e,description:i,type:t!=null?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return yA.create(this.key,e)}}Ft._info=[];const Yn=Vi("contextKeyService");function cUe(n,e){return n<e?-1:n>e?1:0}function Rk(n,e,t,i){return n<t?-1:n>t?1:e<i?-1:e>i?1:0}function Goe(n,e){if(n.type===0||e.type===1)return!0;if(n.type===9)return e.type===9?vLe(n.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(Goe(n,t))return!0;return!1}if(n.type===6){if(e.type===6)return vLe(e.expr,n.expr);for(const t of n.expr)if(Goe(t,e))return!0;return!1}return n.equals(e)}function vLe(n,e){let t=0,i=0;for(;t<n.length&&i<e.length;){const r=n[t].cmp(e[i]);if(r<0)return!1;r===0&&t++,i++}return t===n.length}function bLe(n){return n.type===9?n.expr:[n]}function Yoe(n,e){if(typeof n=="number"){if(n===0)return null;const t=(n&65535)>>>0,i=(n&4294901760)>>>16;return i!==0?new QX([vB(t,e),vB(i,e)]):new QX([vB(t,e)])}else{const t=[];for(let i=0;i<n.length;i++)t.push(vB(n[i],e));return new QX(t)}}function vB(n,e){const t=!!(n&2048),i=!!(n&256),r=e===2?i:t,o=!!(n&1024),s=!!(n&512),a=e===2?t:i,l=n&255;return new y0(r,o,s,a,l)}class y0{constructor(e,t,i,r,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=r,this.keyCode=o}equals(e){return e instanceof y0&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}}class QX{constructor(e){if(e.length===0)throw gg("chords");this.chords=e}}class cBi{constructor(e,t,i,r,o,s){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=r,this.keyLabel=o,this.keyAriaLabel=s}}class uBi{}function XX(n,e){if(!n)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function VU(n,e="Unreachable"){throw new Error(e)}function xM(n){if(!n()){debugger;n(),fi(new ya("Assertion Failed"))}}function uUe(n,e){let t=0;for(;t<n.length-1;){const i=n[t],r=n[t+1];if(!e(i,r))return!1;t++}return!0}class dBi{constructor(){this.data=new Map}add(e,t){XX(Ku(e)),XX(Vu(t)),XX(!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 ds=new dBi;class Bme{constructor(){this._coreKeybindings=new Hu,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(qh===1){if(e&&e.win)return e.win}else if(qh===2){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=Bme.bindToCurrentPlatform(e),i=new nt;if(t&&t.primary){const r=Yoe(t.primary,qh);r&&i.add(this._registerDefaultKeybinding(r,e.id,e.args,e.weight,0,e.when))}if(t&&Array.isArray(t.secondary))for(let r=0,o=t.secondary.length;r<o;r++){const s=t.secondary[r],a=Yoe(s,qh);a&&i.add(this._registerDefaultKeybinding(a,e.id,e.args,e.weight,-r-1,e.when))}return i}registerCommandAndKeybindingRule(e){return Ip(this.registerKeybindingRule(e),Xi.registerCommand(e))}_registerDefaultKeybinding(e,t,i,r,o,s){const a=this._coreKeybindings.push({keybinding:e,command:t,commandArgs:i,when:s,weight1:r,weight2:o,extensionId:null,isBuiltinExtension:!1});return this._cachedMergedKeybindings=null,Gn(()=>{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(fBi)),this._cachedMergedKeybindings.slice(0)}}const Ld=new Bme,hBi={EditorModes:"platform.keybindingsRegistry"};ds.add(hBi.EditorModes,Ld);function fBi(n,e){if(n.weight1!==e.weight1)return n.weight1-e.weight1;if(n.command&&e.command){if(n.command<e.command)return-1;if(n.command>e.command)return 1}return n.weight2-e.weight2}var gBi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},yLe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},pBi=globalThis&&globalThis.__rest||function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t},I8;function PI(n){return n.command!==void 0}function mBi(n){return n.submenu!==void 0}class J{constructor(e){if(J._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);J._instances.set(e,this),this.id=e}}J._instances=new Map;J.CommandPalette=new J("CommandPalette");J.DebugBreakpointsContext=new J("DebugBreakpointsContext");J.DebugCallStackContext=new J("DebugCallStackContext");J.DebugConsoleContext=new J("DebugConsoleContext");J.DebugVariablesContext=new J("DebugVariablesContext");J.DebugWatchContext=new J("DebugWatchContext");J.DebugToolBar=new J("DebugToolBar");J.DebugToolBarStop=new J("DebugToolBarStop");J.EditorContext=new J("EditorContext");J.SimpleEditorContext=new J("SimpleEditorContext");J.EditorContent=new J("EditorContent");J.EditorLineNumberContext=new J("EditorLineNumberContext");J.EditorContextCopy=new J("EditorContextCopy");J.EditorContextPeek=new J("EditorContextPeek");J.EditorContextShare=new J("EditorContextShare");J.EditorTitle=new J("EditorTitle");J.EditorTitleRun=new J("EditorTitleRun");J.EditorTitleContext=new J("EditorTitleContext");J.EditorTitleContextShare=new J("EditorTitleContextShare");J.EmptyEditorGroup=new J("EmptyEditorGroup");J.EmptyEditorGroupContext=new J("EmptyEditorGroupContext");J.EditorTabsBarContext=new J("EditorTabsBarContext");J.ExplorerContext=new J("ExplorerContext");J.ExplorerContextShare=new J("ExplorerContextShare");J.ExtensionContext=new J("ExtensionContext");J.GlobalActivity=new J("GlobalActivity");J.CommandCenter=new J("CommandCenter");J.CommandCenterCenter=new J("CommandCenterCenter");J.LayoutControlMenuSubmenu=new J("LayoutControlMenuSubmenu");J.LayoutControlMenu=new J("LayoutControlMenu");J.MenubarMainMenu=new J("MenubarMainMenu");J.MenubarAppearanceMenu=new J("MenubarAppearanceMenu");J.MenubarDebugMenu=new J("MenubarDebugMenu");J.MenubarEditMenu=new J("MenubarEditMenu");J.MenubarCopy=new J("MenubarCopy");J.MenubarFileMenu=new J("MenubarFileMenu");J.MenubarGoMenu=new J("MenubarGoMenu");J.MenubarHelpMenu=new J("MenubarHelpMenu");J.MenubarLayoutMenu=new J("MenubarLayoutMenu");J.MenubarNewBreakpointMenu=new J("MenubarNewBreakpointMenu");J.PanelAlignmentMenu=new J("PanelAlignmentMenu");J.PanelPositionMenu=new J("PanelPositionMenu");J.MenubarPreferencesMenu=new J("MenubarPreferencesMenu");J.MenubarRecentMenu=new J("MenubarRecentMenu");J.MenubarSelectionMenu=new J("MenubarSelectionMenu");J.MenubarShare=new J("MenubarShare");J.MenubarSwitchEditorMenu=new J("MenubarSwitchEditorMenu");J.MenubarSwitchGroupMenu=new J("MenubarSwitchGroupMenu");J.MenubarTerminalMenu=new J("MenubarTerminalMenu");J.MenubarViewMenu=new J("MenubarViewMenu");J.MenubarHomeMenu=new J("MenubarHomeMenu");J.OpenEditorsContext=new J("OpenEditorsContext");J.OpenEditorsContextShare=new J("OpenEditorsContextShare");J.ProblemsPanelContext=new J("ProblemsPanelContext");J.SCMChangeContext=new J("SCMChangeContext");J.SCMResourceContext=new J("SCMResourceContext");J.SCMResourceContextShare=new J("SCMResourceContextShare");J.SCMResourceFolderContext=new J("SCMResourceFolderContext");J.SCMResourceGroupContext=new J("SCMResourceGroupContext");J.SCMSourceControl=new J("SCMSourceControl");J.SCMTitle=new J("SCMTitle");J.SearchContext=new J("SearchContext");J.SearchActionMenu=new J("SearchActionContext");J.StatusBarWindowIndicatorMenu=new J("StatusBarWindowIndicatorMenu");J.StatusBarRemoteIndicatorMenu=new J("StatusBarRemoteIndicatorMenu");J.StickyScrollContext=new J("StickyScrollContext");J.TestItem=new J("TestItem");J.TestItemGutter=new J("TestItemGutter");J.TestMessageContext=new J("TestMessageContext");J.TestMessageContent=new J("TestMessageContent");J.TestPeekElement=new J("TestPeekElement");J.TestPeekTitle=new J("TestPeekTitle");J.TouchBarContext=new J("TouchBarContext");J.TitleBarContext=new J("TitleBarContext");J.TitleBarTitleContext=new J("TitleBarTitleContext");J.TunnelContext=new J("TunnelContext");J.TunnelPrivacy=new J("TunnelPrivacy");J.TunnelProtocol=new J("TunnelProtocol");J.TunnelPortInline=new J("TunnelInline");J.TunnelTitle=new J("TunnelTitle");J.TunnelLocalAddressInline=new J("TunnelLocalAddressInline");J.TunnelOriginInline=new J("TunnelOriginInline");J.ViewItemContext=new J("ViewItemContext");J.ViewContainerTitle=new J("ViewContainerTitle");J.ViewContainerTitleContext=new J("ViewContainerTitleContext");J.ViewTitle=new J("ViewTitle");J.ViewTitleContext=new J("ViewTitleContext");J.CommentEditorActions=new J("CommentEditorActions");J.CommentThreadTitle=new J("CommentThreadTitle");J.CommentThreadActions=new J("CommentThreadActions");J.CommentThreadAdditionalActions=new J("CommentThreadAdditionalActions");J.CommentThreadTitleContext=new J("CommentThreadTitleContext");J.CommentThreadCommentContext=new J("CommentThreadCommentContext");J.CommentTitle=new J("CommentTitle");J.CommentActions=new J("CommentActions");J.InteractiveToolbar=new J("InteractiveToolbar");J.InteractiveCellTitle=new J("InteractiveCellTitle");J.InteractiveCellDelete=new J("InteractiveCellDelete");J.InteractiveCellExecute=new J("InteractiveCellExecute");J.InteractiveInputExecute=new J("InteractiveInputExecute");J.NotebookToolbar=new J("NotebookToolbar");J.NotebookStickyScrollContext=new J("NotebookStickyScrollContext");J.NotebookCellTitle=new J("NotebookCellTitle");J.NotebookCellDelete=new J("NotebookCellDelete");J.NotebookCellInsert=new J("NotebookCellInsert");J.NotebookCellBetween=new J("NotebookCellBetween");J.NotebookCellListTop=new J("NotebookCellTop");J.NotebookCellExecute=new J("NotebookCellExecute");J.NotebookCellExecutePrimary=new J("NotebookCellExecutePrimary");J.NotebookDiffCellInputTitle=new J("NotebookDiffCellInputTitle");J.NotebookDiffCellMetadataTitle=new J("NotebookDiffCellMetadataTitle");J.NotebookDiffCellOutputsTitle=new J("NotebookDiffCellOutputsTitle");J.NotebookOutputToolbar=new J("NotebookOutputToolbar");J.NotebookEditorLayoutConfigure=new J("NotebookEditorLayoutConfigure");J.NotebookKernelSource=new J("NotebookKernelSource");J.BulkEditTitle=new J("BulkEditTitle");J.BulkEditContext=new J("BulkEditContext");J.TimelineItemContext=new J("TimelineItemContext");J.TimelineTitle=new J("TimelineTitle");J.TimelineTitleContext=new J("TimelineTitleContext");J.TimelineFilterSubMenu=new J("TimelineFilterSubMenu");J.AccountsContext=new J("AccountsContext");J.PanelTitle=new J("PanelTitle");J.AuxiliaryBarTitle=new J("AuxiliaryBarTitle");J.TerminalInstanceContext=new J("TerminalInstanceContext");J.TerminalEditorInstanceContext=new J("TerminalEditorInstanceContext");J.TerminalNewDropdownContext=new J("TerminalNewDropdownContext");J.TerminalTabContext=new J("TerminalTabContext");J.TerminalTabEmptyAreaContext=new J("TerminalTabEmptyAreaContext");J.WebviewContext=new J("WebviewContext");J.InlineCompletionsActions=new J("InlineCompletionsActions");J.NewFile=new J("NewFile");J.MergeInput1Toolbar=new J("MergeToolbar1Toolbar");J.MergeInput2Toolbar=new J("MergeToolbar2Toolbar");J.MergeBaseToolbar=new J("MergeBaseToolbar");J.MergeInputResultToolbar=new J("MergeToolbarResultToolbar");J.InlineSuggestionToolbar=new J("InlineSuggestionToolbar");J.ChatContext=new J("ChatContext");J.ChatCodeBlock=new J("ChatCodeblock");J.ChatMessageTitle=new J("ChatMessageTitle");J.ChatExecute=new J("ChatExecute");J.ChatInputSide=new J("ChatInputSide");J.AccessibleView=new J("AccessibleView");const kb=Vi("menuService");class Sy{static for(e){let t=this._all.get(e);return t||(t=new Sy(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof Sy&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}}Sy._all=new Map;const jl=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new YFi({merge:Sy.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(n){return this._commands.set(n.id,n),this._onDidChangeMenu.fire(Sy.for(J.CommandPalette)),Gn(()=>{this._commands.delete(n.id)&&this._onDidChangeMenu.fire(Sy.for(J.CommandPalette))})}getCommand(n){return this._commands.get(n)}getCommands(){const n=new Map;return this._commands.forEach((e,t)=>n.set(t,e)),n}appendMenuItem(n,e){let t=this._menuItems.get(n);t||(t=new Hu,this._menuItems.set(n,t));const i=t.push(e);return this._onDidChangeMenu.fire(Sy.for(n)),Gn(()=>{i(),this._onDidChangeMenu.fire(Sy.for(n))})}appendMenuItems(n){const e=new nt;for(const{id:t,item:i}of n)e.add(this.appendMenuItem(t,i));return e}getMenuItems(n){let e;return this._menuItems.has(n)?e=[...this._menuItems.get(n)]:e=[],n===J.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(n){const e=new Set;for(const t of n)PI(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||n.push({command:t})})}};class kM extends YD{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let qp=I8=class{static label(e,t){return t!=null&&t.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,t,i,r,o,s){var a,l;this.hideActions=r,this._commandService=s,this.id=e.id,this.label=I8.label(e,i),this.tooltip=(l=typeof e.tooltip=="string"?e.tooltip:(a=e.tooltip)===null||a===void 0?void 0:a.value)!==null&&l!==void 0?l:"",this.enabled=!e.precondition||o.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const u=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=o.contextMatchesRules(u.condition),this.checked&&u.tooltip&&(this.tooltip=typeof u.tooltip=="string"?u.tooltip:u.tooltip.value),this.checked&&In.isThemeIcon(u.icon)&&(c=u.icon),this.checked&&u.title&&(this.label=typeof u.title=="string"?u.title:u.title.value)}c||(c=In.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new I8(t,void 0,i,r,o,s):void 0,this._options=i,this.class=c&&In.asClassName(c)}run(...e){var t,i;let r=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(r=[...r,this._options.arg]),!((i=this._options)===null||i===void 0)&&i.shouldForwardArgs&&(r=[...r,...e]),this._commandService.executeCommand(this.id,...r)}};qp=I8=gBi([yLe(4,Yn),yLe(5,Fs)],qp);class Cf{constructor(e){this.desc=e}}function jo(n){const e=new nt,t=new n,i=t.desc,{f1:r,menu:o,keybinding:s,description:a}=i,l=pBi(i,["f1","menu","keybinding","description"]);if(e.add(Xi.registerCommand({id:l.id,handler:(c,...u)=>t.run(c,...u),description:a})),Array.isArray(o))for(const c of o)e.add(jl.appendMenuItem(c.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:c.precondition===null?void 0:l.precondition})},c)));else o&&e.add(jl.appendMenuItem(o.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:o.precondition===null?void 0:l.precondition})},o)));if(r&&(e.add(jl.appendMenuItem(J.CommandPalette,{command:l,when:l.precondition})),e.add(jl.addCommand(l))),Array.isArray(s))for(const c of s)e.add(Ld.registerKeybindingRule(Object.assign(Object.assign({},c),{id:l.id,when:l.precondition?Ke.and(l.precondition,c.when):c.when})));else s&&e.add(Ld.registerKeybindingRule(Object.assign(Object.assign({},s),{id:l.id,when:l.precondition?Ke.and(l.precondition,s.when):s.when})));return e}const wf=Vi("telemetryService"),Sf=Vi("logService");var uc;(function(n){n[n.Off=0]="Off",n[n.Trace=1]="Trace",n[n.Debug=2]="Debug",n[n.Info=3]="Info",n[n.Warning=4]="Warning",n[n.Error=5]="Error"})(uc||(uc={}));const dUe=uc.Info;class hUe extends Ae{constructor(){super(...arguments),this.level=dUe,this._onDidChangeLogLevel=this._register(new be),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==uc.Off&&this.level<=e}}class _Bi extends hUe{constructor(e=dUe,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(uc.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(uc.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(uc.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(uc.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(uc.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}dispose(){}}class vBi extends hUe{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}warn(e,...t){for(const i of this.loggers)i.warn(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose()}}function bBi(n){switch(n){case uc.Trace:return"trace";case uc.Debug:return"debug";case uc.Info:return"info";case uc.Warning:return"warn";case uc.Error:return"error";case uc.Off:return"off"}}new Ft("logLevel",bBi(uc.Info));const $me={clipboard:{writeText:h_||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:h_||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:(()=>h_||j6i()?0:navigator.keyboard||b0?1:2)(),touch:"ontouchstart"in window||navigator.maxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0)};function yBi(n){if(n.charCode){const t=String.fromCharCode(n.charCode).toUpperCase();return Cy.fromString(t)}const e=n.keyCode;if(e===3)return 7;if(wg)switch(e){case 59:return 85;case 60:if(fu)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Qi)return 57;break}else if(YE){if(Qi&&e===93)return 57;if(!Qi&&e===92)return 57}return Bje[e]||0}const CBi=Qi?256:2048,wBi=512,SBi=1024,EBi=Qi?2048:256;class Oo{constructor(e){this._standardKeyboardEventBrand=!0;const 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.altGraphKey=t.getModifierState("AltGraph"),this.keyCode=yBi(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=CBi),this.altKey&&(t|=wBi),this.shiftKey&&(t|=SBi),this.metaKey&&(t|=EBi),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new y0(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let CLe=!1,RR=null;function xBi(n){if(!n.parent||n.parent===n)return null;try{const e=n.location,t=n.parent.location;if(e.origin!=="null"&&t.origin!=="null"&&e.origin!==t.origin)return CLe=!0,null}catch{return CLe=!0,null}return n.parent}class kBi{static getSameOriginWindowChain(){if(!RR){RR=[];let e=window,t;do t=xBi(e),t?RR.push({window:e,iframeElement:e.frameElement||null}):RR.push({window:e,iframeElement:null}),e=t;while(e)}return RR.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,r=0;const o=this.getSameOriginWindowChain();for(const s of o){if(i+=s.window.scrollY,r+=s.window.scrollX,s.window===t||!s.iframeElement)break;const a=s.iframeElement.getBoundingClientRect();i+=a.top,r+=a.left}return{top:i,left:r}}}class og{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=e.button===0,this.middleButton=e.button===1,this.rightButton=e.button===2,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,e.type==="dblclick"&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,typeof e.pageX=="number"?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=e.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const t=kBi.getPositionOfChildWindowRelativeToAncestorWindow(window,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class Ox{constructor(e,t=0,i=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t,e){const r=e,o=e;if(typeof r.wheelDeltaY<"u")this.deltaY=r.wheelDeltaY/120;else if(typeof o.VERTICAL_AXIS<"u"&&o.axis===o.VERTICAL_AXIS)this.deltaY=-o.detail/3;else if(e.type==="wheel"){const s=e;s.deltaMode===s.DOM_DELTA_LINE?wg&&!Qi?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof r.wheelDeltaX<"u")b0&&vc?this.deltaX=-(r.wheelDeltaX/120):this.deltaX=r.wheelDeltaX/120;else if(typeof o.HORIZONTAL_AXIS<"u"&&o.axis===o.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){const s=e;s.deltaMode===s.DOM_DELTA_LINE?wg&&!Qi?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)===null||e===void 0||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)===null||e===void 0||e.stopPropagation()}}/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:fUe,setPrototypeOf:wLe,isFrozen:TBi,getPrototypeOf:IBi,getOwnPropertyDescriptor:LBi}=Object;let{freeze:dh,seal:w_,create:DBi}=Object,{apply:Qoe,construct:Xoe}=typeof Reflect<"u"&&Reflect;Qoe||(Qoe=function(e,t,i){return e.apply(t,i)});dh||(dh=function(e){return e});w_||(w_=function(e){return e});Xoe||(Xoe=function(e,t){return new e(...t)});const ABi=Kp(Array.prototype.forEach),SLe=Kp(Array.prototype.pop),NR=Kp(Array.prototype.push),L8=Kp(String.prototype.toLowerCase),ZX=Kp(String.prototype.toString),RBi=Kp(String.prototype.match),bm=Kp(String.prototype.replace),NBi=Kp(String.prototype.indexOf),OBi=Kp(String.prototype.trim),Mf=Kp(RegExp.prototype.test),OR=PBi(TypeError);function Kp(n){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return Qoe(n,e,i)}}function PBi(n){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return Xoe(n,t)}}function Xr(n,e,t){var i;t=(i=t)!==null&&i!==void 0?i:L8,wLe&&wLe(n,null);let r=e.length;for(;r--;){let o=e[r];if(typeof o=="string"){const s=t(o);s!==o&&(TBi(e)||(e[r]=s),o=s)}n[o]=!0}return n}function LT(n){const e=DBi(null);for(const[t,i]of fUe(n))e[t]=i;return e}function bB(n,e){for(;n!==null;){const i=LBi(n,e);if(i){if(i.get)return Kp(i.get);if(typeof i.value=="function")return Kp(i.value)}n=IBi(n)}function t(i){return console.warn("fallback value for",i),null}return t}const ELe=dh(["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"]),JX=dh(["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"]),eZ=dh(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),MBi=dh(["animate","color-profile","cursor","discard","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"]),tZ=dh(["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","mprescripts"]),FBi=dh(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xLe=dh(["#text"]),kLe=dh(["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","nonce","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"]),nZ=dh(["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","transform-origin","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"]),TLe=dh(["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"]),yB=dh(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),BBi=w_(/\{\{[\w\W]*|[\w\W]*\}\}/gm),$Bi=w_(/<%[\w\W]*|[\w\W]*%>/gm),VBi=w_(/\${[\w\W]*}/gm),HBi=w_(/^data-[\-\w.\u00B7-\uFFFF]/),WBi=w_(/^aria-[\-\w]+$/),gUe=w_(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),zBi=w_(/^(?:\w+script|data):/i),jBi=w_(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),pUe=w_(/^html$/i);var ILe=Object.freeze({__proto__:null,MUSTACHE_EXPR:BBi,ERB_EXPR:$Bi,TMPLIT_EXPR:VBi,DATA_ATTR:HBi,ARIA_ATTR:WBi,IS_ALLOWED_URI:gUe,IS_SCRIPT_OR_DATA:zBi,ATTR_WHITESPACE:jBi,DOCTYPE_NAME:pUe});const UBi=()=>typeof window>"u"?null:window,qBi=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(i=t.getAttribute(r));const o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function mUe(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:UBi();const e=Je=>mUe(Je);if(e.version="3.0.5",e.removed=[],!n||!n.document||n.document.nodeType!==9)return e.isSupported=!1,e;const t=n.document,i=t.currentScript;let{document:r}=n;const{DocumentFragment:o,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:g}=n,p=l.prototype,m=bB(p,"cloneNode"),_=bB(p,"nextSibling"),v=bB(p,"childNodes"),b=bB(p,"parentNode");if(typeof s=="function"){const Je=r.createElement("template");Je.content&&Je.content.ownerDocument&&(r=Je.content.ownerDocument)}let y,C="";const{implementation:x,createNodeIterator:k,createDocumentFragment:I,getElementsByTagName:L}=r,{importNode:D}=t;let R={};e.isSupported=typeof fUe=="function"&&typeof b=="function"&&x&&x.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:P,ERB_EXPR:M,TMPLIT_EXPR:O,DATA_ATTR:B,ARIA_ATTR:F,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:V}=ILe;let{IS_ALLOWED_URI:$}=ILe,j=null;const Y=Xr({},[...ELe,...JX,...eZ,...tZ,...xLe]);let ne=null;const se=Xr({},[...kLe,...nZ,...TLe,...yB]);let he=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),xe=null,_e=null,Ie=!0,Re=!0,Ye=!1,Ze=!0,tt=!1,Be=!1,kt=!1,Vt=!1,xt=!1,Kt=!1,cn=!1,wn=!0,on=!1;const Zt="user-content-";let pe=!0,me=!1,Z={},G=null;const K=Xr({},["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"]);let oe=null;const le=Xr({},["audio","video","img","source","image","track"]);let we=null;const Me=Xr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ft="http://www.w3.org/1998/Math/MathML",Nt="http://www.w3.org/2000/svg",Yt="http://www.w3.org/1999/xhtml";let He=Yt,Dt=!1,ae=null;const Se=Xr({},[ft,Nt,Yt],ZX);let Xe;const wt=["application/xhtml+xml","text/html"],Tt="text/html";let zt,Mt=null;const On=r.createElement("form"),Ni=function(ve){return ve instanceof RegExp||ve instanceof Function},xn=function(ve){if(!(Mt&&Mt===ve)){if((!ve||typeof ve!="object")&&(ve={}),ve=LT(ve),Xe=wt.indexOf(ve.PARSER_MEDIA_TYPE)===-1?Xe=Tt:Xe=ve.PARSER_MEDIA_TYPE,zt=Xe==="application/xhtml+xml"?ZX:L8,j="ALLOWED_TAGS"in ve?Xr({},ve.ALLOWED_TAGS,zt):Y,ne="ALLOWED_ATTR"in ve?Xr({},ve.ALLOWED_ATTR,zt):se,ae="ALLOWED_NAMESPACES"in ve?Xr({},ve.ALLOWED_NAMESPACES,ZX):Se,we="ADD_URI_SAFE_ATTR"in ve?Xr(LT(Me),ve.ADD_URI_SAFE_ATTR,zt):Me,oe="ADD_DATA_URI_TAGS"in ve?Xr(LT(le),ve.ADD_DATA_URI_TAGS,zt):le,G="FORBID_CONTENTS"in ve?Xr({},ve.FORBID_CONTENTS,zt):K,xe="FORBID_TAGS"in ve?Xr({},ve.FORBID_TAGS,zt):{},_e="FORBID_ATTR"in ve?Xr({},ve.FORBID_ATTR,zt):{},Z="USE_PROFILES"in ve?ve.USE_PROFILES:!1,Ie=ve.ALLOW_ARIA_ATTR!==!1,Re=ve.ALLOW_DATA_ATTR!==!1,Ye=ve.ALLOW_UNKNOWN_PROTOCOLS||!1,Ze=ve.ALLOW_SELF_CLOSE_IN_ATTR!==!1,tt=ve.SAFE_FOR_TEMPLATES||!1,Be=ve.WHOLE_DOCUMENT||!1,xt=ve.RETURN_DOM||!1,Kt=ve.RETURN_DOM_FRAGMENT||!1,cn=ve.RETURN_TRUSTED_TYPE||!1,Vt=ve.FORCE_BODY||!1,wn=ve.SANITIZE_DOM!==!1,on=ve.SANITIZE_NAMED_PROPS||!1,pe=ve.KEEP_CONTENT!==!1,me=ve.IN_PLACE||!1,$=ve.ALLOWED_URI_REGEXP||gUe,He=ve.NAMESPACE||Yt,he=ve.CUSTOM_ELEMENT_HANDLING||{},ve.CUSTOM_ELEMENT_HANDLING&&Ni(ve.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(he.tagNameCheck=ve.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ve.CUSTOM_ELEMENT_HANDLING&&Ni(ve.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(he.attributeNameCheck=ve.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ve.CUSTOM_ELEMENT_HANDLING&&typeof ve.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(he.allowCustomizedBuiltInElements=ve.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),tt&&(Re=!1),Kt&&(xt=!0),Z&&(j=Xr({},[...xLe]),ne=[],Z.html===!0&&(Xr(j,ELe),Xr(ne,kLe)),Z.svg===!0&&(Xr(j,JX),Xr(ne,nZ),Xr(ne,yB)),Z.svgFilters===!0&&(Xr(j,eZ),Xr(ne,nZ),Xr(ne,yB)),Z.mathMl===!0&&(Xr(j,tZ),Xr(ne,TLe),Xr(ne,yB))),ve.ADD_TAGS&&(j===Y&&(j=LT(j)),Xr(j,ve.ADD_TAGS,zt)),ve.ADD_ATTR&&(ne===se&&(ne=LT(ne)),Xr(ne,ve.ADD_ATTR,zt)),ve.ADD_URI_SAFE_ATTR&&Xr(we,ve.ADD_URI_SAFE_ATTR,zt),ve.FORBID_CONTENTS&&(G===K&&(G=LT(G)),Xr(G,ve.FORBID_CONTENTS,zt)),pe&&(j["#text"]=!0),Be&&Xr(j,["html","head","body"]),j.table&&(Xr(j,["tbody"]),delete xe.tbody),ve.TRUSTED_TYPES_POLICY){if(typeof ve.TRUSTED_TYPES_POLICY.createHTML!="function")throw OR('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ve.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw OR('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=ve.TRUSTED_TYPES_POLICY,C=y.createHTML("")}else y===void 0&&(y=qBi(g,i)),y!==null&&typeof C=="string"&&(C=y.createHTML(""));dh&&dh(ve),Mt=ve}},un=Xr({},["mi","mo","mn","ms","mtext"]),ei=Xr({},["foreignobject","desc","title","annotation-xml"]),li=Xr({},["title","style","font","a","script"]),xi=Xr({},JX);Xr(xi,eZ),Xr(xi,MBi);const br=Xr({},tZ);Xr(br,FBi);const Wr=function(ve){let je=b(ve);(!je||!je.tagName)&&(je={namespaceURI:He,tagName:"template"});const Le=L8(ve.tagName),fe=L8(je.tagName);return ae[ve.namespaceURI]?ve.namespaceURI===Nt?je.namespaceURI===Yt?Le==="svg":je.namespaceURI===ft?Le==="svg"&&(fe==="annotation-xml"||un[fe]):!!xi[Le]:ve.namespaceURI===ft?je.namespaceURI===Yt?Le==="math":je.namespaceURI===Nt?Le==="math"&&ei[fe]:!!br[Le]:ve.namespaceURI===Yt?je.namespaceURI===Nt&&!ei[fe]||je.namespaceURI===ft&&!un[fe]?!1:!br[Le]&&(li[Le]||!xi[Le]):!!(Xe==="application/xhtml+xml"&&ae[ve.namespaceURI]):!1},ko=function(ve){NR(e.removed,{element:ve});try{ve.parentNode.removeChild(ve)}catch{ve.remove()}},oo=function(ve,je){try{NR(e.removed,{attribute:je.getAttributeNode(ve),from:je})}catch{NR(e.removed,{attribute:null,from:je})}if(je.removeAttribute(ve),ve==="is"&&!ne[ve])if(xt||Kt)try{ko(je)}catch{}else try{je.setAttribute(ve,"")}catch{}},ea=function(ve){let je,Le;if(Vt)ve="<remove></remove>"+ve;else{const ot=RBi(ve,/^[\r\n\t ]+/);Le=ot&&ot[0]}Xe==="application/xhtml+xml"&&He===Yt&&(ve='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ve+"</body></html>");const fe=y?y.createHTML(ve):ve;if(He===Yt)try{je=new h().parseFromString(fe,Xe)}catch{}if(!je||!je.documentElement){je=x.createDocument(He,"template",null);try{je.documentElement.innerHTML=Dt?C:fe}catch{}}const Fe=je.body||je.documentElement;return ve&&Le&&Fe.insertBefore(r.createTextNode(Le),Fe.childNodes[0]||null),He===Yt?L.call(je,Be?"html":"body")[0]:Be?je.documentElement:Fe},xr=function(ve){return k.call(ve.ownerDocument||ve,ve,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Hi=function(ve){return ve instanceof d&&(typeof ve.nodeName!="string"||typeof ve.textContent!="string"||typeof ve.removeChild!="function"||!(ve.attributes instanceof u)||typeof ve.removeAttribute!="function"||typeof ve.setAttribute!="function"||typeof ve.namespaceURI!="string"||typeof ve.insertBefore!="function"||typeof ve.hasChildNodes!="function")},Ht=function(ve){return typeof a=="object"?ve instanceof a:ve&&typeof ve=="object"&&typeof ve.nodeType=="number"&&typeof ve.nodeName=="string"},Qn=function(ve,je,Le){R[ve]&&ABi(R[ve],fe=>{fe.call(e,je,Le,Mt)})},Fr=function(ve){let je;if(Qn("beforeSanitizeElements",ve,null),Hi(ve))return ko(ve),!0;const Le=zt(ve.nodeName);if(Qn("uponSanitizeElement",ve,{tagName:Le,allowedTags:j}),ve.hasChildNodes()&&!Ht(ve.firstElementChild)&&(!Ht(ve.content)||!Ht(ve.content.firstElementChild))&&Mf(/<[/\w]/g,ve.innerHTML)&&Mf(/<[/\w]/g,ve.textContent))return ko(ve),!0;if(!j[Le]||xe[Le]){if(!xe[Le]&&lt(Le)&&(he.tagNameCheck instanceof RegExp&&Mf(he.tagNameCheck,Le)||he.tagNameCheck instanceof Function&&he.tagNameCheck(Le)))return!1;if(pe&&!G[Le]){const fe=b(ve)||ve.parentNode,Fe=v(ve)||ve.childNodes;if(Fe&&fe){const ot=Fe.length;for(let Ue=ot-1;Ue>=0;--Ue)fe.insertBefore(m(Fe[Ue],!0),_(ve))}}return ko(ve),!0}return ve instanceof l&&!Wr(ve)||(Le==="noscript"||Le==="noembed"||Le==="noframes")&&Mf(/<\/no(script|embed|frames)/i,ve.innerHTML)?(ko(ve),!0):(tt&&ve.nodeType===3&&(je=ve.textContent,je=bm(je,P," "),je=bm(je,M," "),je=bm(je,O," "),ve.textContent!==je&&(NR(e.removed,{element:ve.cloneNode()}),ve.textContent=je)),Qn("afterSanitizeElements",ve,null),!1)},Oe=function(ve,je,Le){if(wn&&(je==="id"||je==="name")&&(Le in r||Le in On))return!1;if(!(Re&&!_e[je]&&Mf(B,je))){if(!(Ie&&Mf(F,je))){if(!ne[je]||_e[je]){if(!(lt(ve)&&(he.tagNameCheck instanceof RegExp&&Mf(he.tagNameCheck,ve)||he.tagNameCheck instanceof Function&&he.tagNameCheck(ve))&&(he.attributeNameCheck instanceof RegExp&&Mf(he.attributeNameCheck,je)||he.attributeNameCheck instanceof Function&&he.attributeNameCheck(je))||je==="is"&&he.allowCustomizedBuiltInElements&&(he.tagNameCheck instanceof RegExp&&Mf(he.tagNameCheck,Le)||he.tagNameCheck instanceof Function&&he.tagNameCheck(Le))))return!1}else if(!we[je]){if(!Mf($,bm(Le,V,""))){if(!((je==="src"||je==="xlink:href"||je==="href")&&ve!=="script"&&NBi(Le,"data:")===0&&oe[ve])){if(!(Ye&&!Mf(H,bm(Le,V,"")))){if(Le)return!1}}}}}}return!0},lt=function(ve){return ve.indexOf("-")>0},It=function(ve){let je,Le,fe,Fe;Qn("beforeSanitizeAttributes",ve,null);const{attributes:ot}=ve;if(!ot)return;const Ue={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ne};for(Fe=ot.length;Fe--;){je=ot[Fe];const{name:Qt,namespaceURI:gn}=je;if(Le=Qt==="value"?je.value:OBi(je.value),fe=zt(Qt),Ue.attrName=fe,Ue.attrValue=Le,Ue.keepAttr=!0,Ue.forceKeepAttr=void 0,Qn("uponSanitizeAttribute",ve,Ue),Le=Ue.attrValue,Ue.forceKeepAttr||(oo(Qt,ve),!Ue.keepAttr))continue;if(!Ze&&Mf(/\/>/i,Le)){oo(Qt,ve);continue}tt&&(Le=bm(Le,P," "),Le=bm(Le,M," "),Le=bm(Le,O," "));const Pn=zt(ve.nodeName);if(Oe(Pn,fe,Le)){if(on&&(fe==="id"||fe==="name")&&(oo(Qt,ve),Le=Zt+Le),y&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!gn)switch(g.getAttributeType(Pn,fe)){case"TrustedHTML":{Le=y.createHTML(Le);break}case"TrustedScriptURL":{Le=y.createScriptURL(Le);break}}try{gn?ve.setAttributeNS(gn,Qt,Le):ve.setAttribute(Qt,Le),SLe(e.removed)}catch{}}}Qn("afterSanitizeAttributes",ve,null)},tn=function Je(ve){let je;const Le=xr(ve);for(Qn("beforeSanitizeShadowDOM",ve,null);je=Le.nextNode();)Qn("uponSanitizeShadowNode",je,null),!Fr(je)&&(je.content instanceof o&&Je(je.content),It(je));Qn("afterSanitizeShadowDOM",ve,null)};return e.sanitize=function(Je){let ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},je,Le,fe,Fe;if(Dt=!Je,Dt&&(Je="<!-->"),typeof Je!="string"&&!Ht(Je))if(typeof Je.toString=="function"){if(Je=Je.toString(),typeof Je!="string")throw OR("dirty is not a string, aborting")}else throw OR("toString is not a function");if(!e.isSupported)return Je;if(kt||xn(ve),e.removed=[],typeof Je=="string"&&(me=!1),me){if(Je.nodeName){const Qt=zt(Je.nodeName);if(!j[Qt]||xe[Qt])throw OR("root node is forbidden and cannot be sanitized in-place")}}else if(Je instanceof a)je=ea("<!---->"),Le=je.ownerDocument.importNode(Je,!0),Le.nodeType===1&&Le.nodeName==="BODY"||Le.nodeName==="HTML"?je=Le:je.appendChild(Le);else{if(!xt&&!tt&&!Be&&Je.indexOf("<")===-1)return y&&cn?y.createHTML(Je):Je;if(je=ea(Je),!je)return xt?null:cn?C:""}je&&Vt&&ko(je.firstChild);const ot=xr(me?Je:je);for(;fe=ot.nextNode();)Fr(fe)||(fe.content instanceof o&&tn(fe.content),It(fe));if(me)return Je;if(xt){if(Kt)for(Fe=I.call(je.ownerDocument);je.firstChild;)Fe.appendChild(je.firstChild);else Fe=je;return(ne.shadowroot||ne.shadowrootmode)&&(Fe=D.call(t,Fe,!0)),Fe}let Ue=Be?je.outerHTML:je.innerHTML;return Be&&j["!doctype"]&&je.ownerDocument&&je.ownerDocument.doctype&&je.ownerDocument.doctype.name&&Mf(pUe,je.ownerDocument.doctype.name)&&(Ue="<!DOCTYPE "+je.ownerDocument.doctype.name+`>
`+Ue),tt&&(Ue=bm(Ue,P," "),Ue=bm(Ue,M," "),Ue=bm(Ue,O," ")),y&&cn?y.createHTML(Ue):Ue},e.setConfig=function(Je){xn(Je),kt=!0},e.clearConfig=function(){Mt=null,kt=!1},e.isValidAttribute=function(Je,ve,je){Mt||xn({});const Le=zt(Je),fe=zt(ve);return Oe(Le,fe,je)},e.addHook=function(Je,ve){typeof ve=="function"&&(R[Je]=R[Je]||[],NR(R[Je],ve))},e.removeHook=function(Je){if(R[Je])return SLe(R[Je])},e.removeHooks=function(Je){R[Je]&&(R[Je]=[])},e.removeAllHooks=function(){R={}},e}var Tb=mUe();Tb.version;Tb.isSupported;const _Ue=Tb.sanitize;Tb.setConfig;Tb.clearConfig;Tb.isValidAttribute;const vUe=Tb.addHook,bUe=Tb.removeHook;Tb.removeHooks;Tb.removeAllHooks;var Si;(function(n){n.inMemory="inmemory",n.vscode="vscode",n.internal="private",n.walkThrough="walkThrough",n.walkThroughSnippet="walkThroughSnippet",n.http="http",n.https="https",n.file="file",n.mailto="mailto",n.untitled="untitled",n.data="data",n.command="command",n.vscodeRemote="vscode-remote",n.vscodeRemoteResource="vscode-remote-resource",n.vscodeManagedRemoteResource="vscode-managed-remote-resource",n.vscodeUserData="vscode-userdata",n.vscodeCustomEditor="vscode-custom-editor",n.vscodeNotebookCell="vscode-notebook-cell",n.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",n.vscodeNotebookCellOutput="vscode-notebook-cell-output",n.vscodeInteractiveInput="vscode-interactive-input",n.vscodeSettings="vscode-settings",n.vscodeWorkspaceTrust="vscode-workspace-trust",n.vscodeTerminal="vscode-terminal",n.vscodeChatSesssion="vscode-chat-editor",n.webviewPanel="webview-panel",n.vscodeWebview="vscode-webview",n.extension="extension",n.vscodeFileResource="vscode-file",n.tmp="tmp",n.vsls="vsls",n.vscodeSourceControl="vscode-scm"})(Si||(Si={}));const KBi="tkn";class GBi{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${Si.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return fi(a),e}const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);const r=this._ports[t],o=this._connectionTokens[t];let s=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(s+=`&${KBi}=${encodeURIComponent(o)}`),Tn.from({scheme:Qw?this._preferredWebSchema:Si.vscodeRemoteResource,authority:`${i}:${r}`,path:this._remoteResourcesPath,query:s})}}const yUe=new GBi;class TM{uriToBrowserUri(e){return e.scheme===Si.vscodeRemote?yUe.rewrite(e):e.scheme===Si.file&&(h_||W5i&&Tp.origin===`${Si.vscodeFileResource}://${TM.FALLBACK_AUTHORITY}`)?e.with({scheme:Si.vscodeFileResource,authority:e.authority||TM.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}TM.FALLBACK_AUTHORITY="vscode-app";const CUe=new TM;var LLe;(function(n){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);n.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function i(o){let s;typeof o=="string"?s=new URL(o).searchParams:o instanceof URL?s=o.searchParams:Tn.isUri(o)&&(s=new URL(o.toString(!0)).searchParams);const a=s==null?void 0:s.get(t);if(a)return e.get(a)}n.getHeadersFromQuery=i;function r(o,s,a){if(!globalThis.crossOriginIsolated)return;const l=s&&a?"3":a?"2":"1";o instanceof URLSearchParams?o.set(t,l):o[t]=l}n.addSearchParam=r})(LLe||(LLe={}));const{registerWindow:Sfr,getWindows:YBi,onDidCreateWindow:Efr}=function(){const n=[],e=new be;return{onDidCreateWindow:e.event,registerWindow(t){n.push(t);const i=new nt;return i.add(Gn(()=>{const r=n.indexOf(t);r!==-1&&n.splice(r,1)})),e.fire({window:t,disposableStore:i}),i},getWindows(){return n}}}();function Gl(n){for(;n.firstChild;)n.firstChild.remove()}function Vme(n){var e;return(e=n==null?void 0:n.isConnected)!==null&&e!==void 0?e:!1}class QBi{constructor(e,t,i,r){this._node=e,this._type=t,this._handler=i,this._options=r||!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 We(n,e,t,i){return new QBi(n,e,t,i)}function wUe(n){return function(e){return n(new og(e))}}function XBi(n){return function(e){return n(new Oo(e))}}const ua=function(e,t,i,r){let o=i;return t==="click"||t==="mousedown"?o=wUe(i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=XBi(i)),We(e,t,o,r)},ZBi=function(e,t,i){const r=wUe(t);return JBi(e,r,i)};function JBi(n,e,t){return We(n,C_&&$me.pointerEvents?Lt.POINTER_DOWN:Lt.MOUSE_DOWN,e,t)}let NV,Sg;class iZ{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(e){fi(e)}}static sort(e,t){return t.priority-e.priority}}(function(){let n=[],e=null,t=!1,i=!1;const r=()=>{for(t=!1,e=n,n=[],i=!0;e.length>0;)e.sort(iZ.sort),e.shift().execute();i=!1};Sg=(o,s=0)=>{const a=new iZ(o,s);return n.push(a),t||(t=!0,requestAnimationFrame(r)),a},NV=(o,s)=>{if(i){const a=new iZ(o,s);return e.push(a),a}else return Sg(o,s)}})();function HU(n){return n.ownerDocument.defaultView.getComputedStyle(n,null)}function CA(n){var e;const t=n.ownerDocument,i=(e=t.defaultView)===null||e===void 0?void 0:e.window;if(n!==t.body)return new vr(n.clientWidth,n.clientHeight);if(C_&&(i!=null&&i.visualViewport))return new vr(i.visualViewport.width,i.visualViewport.height);if(i!=null&&i.innerWidth&&i.innerHeight)return new vr(i.innerWidth,i.innerHeight);if(t.body&&t.body.clientWidth&&t.body.clientHeight)return new vr(t.body.clientWidth,t.body.clientHeight);if(t.documentElement&&t.documentElement.clientWidth&&t.documentElement.clientHeight)return new vr(t.documentElement.clientWidth,t.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class zs{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const r=HU(e),o=r?r.getPropertyValue(t):"0";return zs.convertToPixels(e,o)}static getBorderLeftWidth(e){return zs.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return zs.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return zs.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return zs.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return zs.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return zs.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return zs.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return zs.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return zs.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return zs.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return zs.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return zs.getDimension(e,"margin-bottom","marginBottom")}}class vr{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new vr(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof vr?e:new vr(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}vr.None=new vr(0,0);function SUe(n){let e=n.offsetParent,t=n.offsetTop,i=n.offsetLeft;for(;(n=n.parentNode)!==null&&n!==n.ownerDocument.body&&n!==n.ownerDocument.documentElement;){t-=n.scrollTop;const r=EUe(n)?null:HU(n);r&&(i-=r.direction!=="rtl"?n.scrollLeft:-n.scrollLeft),n===e&&(i+=zs.getBorderLeftWidth(n),t+=zs.getBorderTopWidth(n),t+=n.offsetTop,i+=n.offsetLeft,e=n.offsetParent)}return{left:i,top:t}}function e$i(n,e,t){typeof e=="number"&&(n.style.width=`${e}px`),typeof t=="number"&&(n.style.height=`${t}px`)}function Oa(n){var e,t,i,r;const o=n.getBoundingClientRect();return{left:o.left+((t=(e=n.ownerDocument.defaultView)===null||e===void 0?void 0:e.scrollX)!==null&&t!==void 0?t:0),top:o.top+((r=(i=n.ownerDocument.defaultView)===null||i===void 0?void 0:i.scrollY)!==null&&r!==void 0?r:0),width:o.width,height:o.height}}function t$i(n){let e=n,t=1;do{const i=HU(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function _d(n){const e=zs.getMarginLeft(n)+zs.getMarginRight(n);return n.offsetWidth+e}function rZ(n){const e=zs.getBorderLeftWidth(n)+zs.getBorderRightWidth(n),t=zs.getPaddingLeft(n)+zs.getPaddingRight(n);return n.offsetWidth-e-t}function n$i(n){const e=zs.getBorderTopWidth(n)+zs.getBorderBottomWidth(n),t=zs.getPaddingTop(n)+zs.getPaddingBottom(n);return n.offsetHeight-e-t}function TE(n){const e=zs.getMarginTop(n)+zs.getMarginBottom(n);return n.offsetHeight+e}function gc(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function i$i(n,e,t){for(;n&&n.nodeType===n.ELEMENT_NODE;){if(n.classList.contains(e))return n;if(t){if(typeof t=="string"){if(n.classList.contains(t))return null}else if(n===t)return null}n=n.parentNode}return null}function oZ(n,e,t){return!!i$i(n,e,t)}function EUe(n){return n&&!!n.host&&!!n.mode}function OV(n){return!!Px(n)}function Px(n){for(var e;n.parentNode;){if(n===((e=n.ownerDocument)===null||e===void 0?void 0:e.body))return null;n=n.parentNode}return EUe(n)?n:null}function Lp(){let n=WU().activeElement;for(;n!=null&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function WU(){var n;return(n=[document,...YBi().map(t=>t.document)].find(t=>t.hasFocus()))!==null&&n!==void 0?n:document}function Eg(n=document.getElementsByTagName("head")[0],e){const t=document.createElement("style");return t.type="text/css",t.media="screen",e==null||e(t),n.appendChild(t),t}let sZ=null;function xUe(){return sZ||(sZ=Eg()),sZ}function r$i(n){var e,t;return!((e=n==null?void 0:n.sheet)===null||e===void 0)&&e.rules?n.sheet.rules:!((t=n==null?void 0:n.sheet)===null||t===void 0)&&t.cssRules?n.sheet.cssRules:[]}function Zoe(n,e,t=xUe()){!t||!e||t.sheet.insertRule(n+"{"+e+"}",0)}function DLe(n,e=xUe()){if(!e)return;const t=r$i(e),i=[];for(let r=0;r<t.length;r++)t[r].selectorText.indexOf(n)!==-1&&i.push(r);for(let r=i.length-1;r>=0;r--)e.sheet.deleteRule(i[r])}function Hme(n){return typeof HTMLElement=="object"?n instanceof HTMLElement:n&&typeof n=="object"&&n.nodeType===1&&typeof n.nodeName=="string"}const Lt={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",POINTER_LEAVE:"pointerleave",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:YE?"webkitAnimationStart":"animationstart",ANIMATION_END:YE?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:YE?"webkitAnimationIteration":"animationiteration"};function o$i(n){const e=n;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const yi={stop:(n,e)=>(n.preventDefault(),e&&n.stopPropagation(),n)};function s$i(n){const e=[];for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)e[t]=n.scrollTop,n=n.parentNode;return e}function a$i(n,e){for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)n.scrollTop!==e[t]&&(n.scrollTop=e[t]),n=n.parentNode}class PV extends Ae{static hasFocusWithin(e){if(Hme(e)){const t=Px(e),i=t?t.activeElement:e.ownerDocument.activeElement;return gc(i,e)}else return gc(window.document.activeElement,window.document)}constructor(e){super(),this._onDidFocus=this._register(new be),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new be),this.onDidBlur=this._onDidBlur.event;let t=PV.hasFocusWithin(e),i=!1;const r=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,window.setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{PV.hasFocusWithin(e)!==t&&(t?o():r())},this._register(We(e,Lt.FOCUS,r,!0)),this._register(We(e,Lt.BLUR,o,!0)),e instanceof HTMLElement&&(this._register(We(e,Lt.FOCUS_IN,()=>this._refreshStateHandler())),this._register(We(e,Lt.FOCUS_OUT,()=>this._refreshStateHandler())))}}function lb(n){return new PV(n)}function Ge(n,...e){if(n.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function kUe(n,e){return n.insertBefore(e,n.firstChild),e}function Yl(n,...e){n.innerText="",Ge(n,...e)}const l$i=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var IM;(function(n){n.HTML="http://www.w3.org/1999/xhtml",n.SVG="http://www.w3.org/2000/svg"})(IM||(IM={}));function TUe(n,e,t,...i){const r=l$i.exec(e);if(!r)throw new Error("Bad use of emmet");const o=r[1]||"div";let s;return n!==IM.HTML?s=document.createElementNS(n,o):s=document.createElement(o),r[3]&&(s.id=r[3]),r[4]&&(s.className=r[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?s[a]=l:a==="selected"?l&&s.setAttribute(a,"true"):s.setAttribute(a,l))}),s.append(...i),s}function at(n,e,...t){return TUe(IM.HTML,n,e,...t)}at.SVG=function(n,e,...t){return TUe(IM.SVG,n,e,...t)};function c$i(n,...e){n?Yd(...e):Au(...e)}function Yd(...n){for(const e of n)e.style.display="",e.removeAttribute("aria-hidden")}function Au(...n){for(const e of n)e.style.display="none",e.setAttribute("aria-hidden","true")}function ALe(n){const e=window.devicePixelRatio*n;return Math.max(1,Math.floor(e))/window.devicePixelRatio}function IUe(n){window.open(n,"_blank","noopener")}function u$i(n){const e=()=>{n(),t=Sg(e)};let t=Sg(e);return Gn(()=>t.dispose())}yUe.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");function lw(n){return n?`url('${CUe.uriToBrowserUri(n).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function RLe(n){return`'${n.replace(/'/g,"%27")}'`}function XE(n,e){if(n!==void 0){const t=n.match(/^\s*var\((.+)\)$/);if(t){const i=t[1].split(",",2);return i.length===2&&(e=XE(i[1].trim(),e)),`var(${i[0]}, ${e})`}return n}return e}function d$i(n,e=!1){const t=document.createElement("a");return vUe("afterSanitizeAttributes",i=>{for(const r of["href","src"])if(i.hasAttribute(r)){const o=i.getAttribute(r);if(r==="href"&&o.startsWith("#"))continue;if(t.href=o,!n.includes(t.protocol.replace(/:$/,""))){if(e&&r==="src"&&t.href.startsWith("data:"))continue;i.removeAttribute(r)}}}),Gn(()=>{bUe("afterSanitizeAttributes")})}const h$i=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);class Oy extends be{constructor(){super(),this._subscriptions=new nt,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(We(window,"keydown",e=>{if(e.defaultPrevented)return;const t=new Oo(e);if(!(t.keyCode===6&&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(t.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;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(We(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(We(document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(We(document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(We(document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),this._subscriptions.add(We(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 Oy.instance||(Oy.instance=new Oy),Oy.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class f$i extends Ae{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this._register(We(this.element,Lt.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter(e)})),this._register(We(this.element,Lt.DRAG_OVER,e=>{var t,i;e.preventDefault(),(i=(t=this.callbacks).onDragOver)===null||i===void 0||i.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(We(this.element,Lt.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave(e))})),this._register(We(this.element,Lt.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd(e)})),this._register(We(this.element,Lt.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop(e)}))}}const g$i=/(?<tag>[\w\-]+)?(?:#(?<id>[\w\-]+))?(?<class>(?:\.(?:[\w\-]+))*)(?:@(?<name>(?:[\w\_])+))?/;function Fl(n,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const r=g$i.exec(n);if(!r||!r.groups)throw new Error("Bad use of h");const o=r.groups.tag||"div",s=document.createElement(o);r.groups.id&&(s.id=r.groups.id);const a=[];if(r.groups.class)for(const c of r.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(const c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(s.className=a.join(" "));const l={};if(r.groups.name&&(l[r.groups.name]=s),i)for(const c of i)c instanceof HTMLElement?s.appendChild(c):typeof c=="string"?s.append(c):"root"in c&&(Object.assign(l,c),s.appendChild(c.root));for(const[c,u]of Object.entries(t))if(c!=="className")if(c==="style")for(const[d,h]of Object.entries(u))s.style.setProperty(NLe(d),typeof h=="number"?h+"px":""+h);else c==="tabIndex"?s.tabIndex=u:s.setAttribute(NLe(c),u.toString());return l.root=s,l}function NLe(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class zU{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 i=t.kbExpr;this.precondition&&(i?i=Ke.and(i,this.precondition):i=this.precondition);const r={id:this.id,weight:t.weight,args:t.args,when:i,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};Ld.registerKeybindingRule(r)}}Xi.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){jl.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 wA extends zU{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,r){return this._implementations.push({priority:e,name:t,implementation:i,when:r}),this._implementations.sort((o,s)=>s.priority-o.priority),{dispose:()=>{for(let o=0;o<this._implementations.length;o++)if(this._implementations[o].implementation===i){this._implementations.splice(o,1);return}}}}runCommand(e,t){const i=e.get(Sf),r=e.get(Yn);i.trace(`Executing Command '${this.id}' which has ${this._implementations.length} bound.`);for(const o of this._implementations){if(o.when){const a=r.getContext(Lp());if(!o.when.evaluate(a))continue}const s=o.implementation(e,t);if(s)return i.trace(`Command '${this.id}' was handled by '${o.name}'.`),typeof s=="boolean"?void 0:s}i.trace(`The Command '${this.id}' was not handled by any implementation.`)}}class LUe extends zU{constructor(e,t){super(t),this.command=e}runCommand(e,t){return this.command.runCommand(e,t)}}class kl extends zU{static bindToContribution(e){return class extends kl{constructor(i){super(i),this._callback=i.handler}runEditorCommand(i,r,o){const s=e(r);s&&this._callback(s,o)}}}static runEditorCommand(e,t,i,r){const o=e.get(Lr),s=o.getFocusedCodeEditor()||o.getActiveCodeEditor();if(s)return s.invokeWithinContext(a=>{if(a.get(Yn).contextMatchesRules(i??void 0))return r(a,s,t)})}runCommand(e,t){return kl.runEditorCommand(e,t,this.precondition,(i,r,o)=>this.runEditorCommand(i,r,o))}}class Gt extends kl{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(r){return r.menuId||(r.menuId=J.EditorContext),r.title||(r.title=e.label),r.when=Ke.and(e.precondition,r.when),r}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(Gt.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(wf).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class DUe extends Gt{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,r)=>r[0]-i[0]),{dispose:()=>{for(let i=0;i<this._implementations.length;i++)if(this._implementations[i][1]===t){this._implementations.splice(i,1);return}}}}run(e,t,i){for(const r of this._implementations){const o=r[1](e,t,i);if(o)return typeof o=="boolean"?void 0:o}}}class N_ extends Cf{run(e,...t){const i=e.get(Lr),r=i.getFocusedCodeEditor()||i.getActiveCodeEditor();if(r)return r.invokeWithinContext(o=>{var s,a;const l=o.get(Yn),c=o.get(Sf);if(!l.contextMatchesRules((s=this.desc.precondition)!==null&&s!==void 0?s:void 0)){c.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,(a=this.desc.precondition)===null||a===void 0?void 0:a.serialize());return}return this.runEditorCommand(o,r,...t)})}}function Ib(n,e){Xi.registerCommand(n,function(t,...i){const r=t.get(Un),[o,s]=i;to(Tn.isUri(o)),to(Ce.isIPosition(s));const a=t.get(ts).getModel(o);if(a){const l=Ce.lift(s);return r.invokeFunction(e,a,l,...i.slice(2))}return t.get(Pd).createModelReference(o).then(l=>new Promise((c,u)=>{try{const d=r.invokeFunction(e,l.object.textEditorModel,Ce.lift(s),i.slice(2));c(d)}catch(d){u(d)}}).finally(()=>{l.dispose()}))})}function Et(n){return Qf.INSTANCE.registerEditorCommand(n),n}function ht(n){const e=new n;return Qf.INSTANCE.registerEditorAction(e),e}function AUe(n){return Qf.INSTANCE.registerEditorAction(n),n}function p$i(n){Qf.INSTANCE.registerEditorAction(n)}function gr(n,e,t){Qf.INSTANCE.registerEditorContribution(n,e,t)}var kL;(function(n){function e(s){return Qf.INSTANCE.getEditorCommand(s)}n.getEditorCommand=e;function t(){return Qf.INSTANCE.getEditorActions()}n.getEditorActions=t;function i(){return Qf.INSTANCE.getEditorContributions()}n.getEditorContributions=i;function r(s){return Qf.INSTANCE.getEditorContributions().filter(a=>s.indexOf(a.id)>=0)}n.getSomeEditorContributions=r;function o(){return Qf.INSTANCE.getDiffEditorContributions()}n.getDiffEditorContributions=o})(kL||(kL={}));const m$i={EditorCommonContributions:"editor.contributions"};class Qf{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}Qf.INSTANCE=new Qf;ds.add(m$i.EditorCommonContributions,Qf.INSTANCE);function g5(n){return n.register(),n}const RUe=g5(new wA({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:J.MenubarEditMenu,group:"1_do",title:E({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:J.CommandPalette,group:"",title:E("undo","Undo"),order:1}]}));g5(new LUe(RUe,{id:"default:undo",precondition:void 0}));const NUe=g5(new wA({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:J.MenubarEditMenu,group:"1_do",title:E({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:J.CommandPalette,group:"",title:E("redo","Redo"),order:1}]}));g5(new LUe(NUe,{id:"default:redo",precondition:void 0}));const _$i=g5(new wA({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:J.MenubarSelectionMenu,group:"1_basic",title:E({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:J.CommandPalette,group:"",title:E("selectAll","Select All"),order:1}]})),OUe=Symbol("MicrotaskDelay");var Vf=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},xN=globalThis&&globalThis.__asyncValues||function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof __values=="function"?__values(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=n[o]&&function(s){return new Promise(function(a,l){s=n[o](s),r(a,l,s.done,s.value)})}}function r(o,s,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},s)}};function Joe(n){return!!n&&typeof n.then=="function"}function za(n){const e=new da,t=n(e.token),i=new Promise((r,o)=>{const s=e.token.onCancellationRequested(()=>{s.dispose(),e.dispose(),o(new Xw)});Promise.resolve(t).then(a=>{s.dispose(),e.dispose(),r(a)},a=>{s.dispose(),e.dispose(),o(a)})});return new class{cancel(){e.cancel()}then(r,o){return i.then(r,o)}catch(r){return this.then(void 0,r)}finally(r){return i.finally(r)}}}function jU(n,e,t){return new Promise((i,r)=>{const o=e.onCancellationRequested(()=>{o.dispose(),i(t)});n.then(i,r).finally(()=>o.dispose())})}class v$i{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{if(this.queuedPromise=null,this.isDisposed)return;const i=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,i};this.queuedPromise=new Promise(i=>{this.activePromise.then(t,t).then(i)})}return new Promise((t,i)=>{this.queuedPromise.then(t,i)})}return this.activePromise=e(),new Promise((t,i)=>{this.activePromise.then(r=>{this.activePromise=null,t(r)},r=>{this.activePromise=null,i(r)})})}dispose(){this.isDisposed=!0}}const b$i=(n,e)=>{let t=!0;const i=setTimeout(()=>{t=!1,e()},n);return{isTriggered:()=>t,dispose:()=>{clearTimeout(i),t=!1}}},y$i=n=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,n())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class Gp{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((r,o)=>{this.doResolve=r,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const r=this.task;return this.task=null,r()}}));const i=()=>{var r;this.deferred=null,(r=this.doResolve)===null||r===void 0||r.call(this,null)};return this.deferred=t===OUe?y$i(i):b$i(t,i),this.completionPromise}isTriggered(){var e;return!!(!((e=this.deferred)===null||e===void 0)&&e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&((e=this.doReject)===null||e===void 0||e.call(this,new Xw),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class PUe{constructor(e){this.delayer=new Gp(e),this.throttler=new v$i}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function cw(n,e){return e?new Promise((t,i)=>{const r=setTimeout(()=>{o.dispose(),t()},n),o=e.onCancellationRequested(()=>{clearTimeout(r),o.dispose(),i(new Xw)})}):za(t=>cw(n,t))}function uw(n,e=0,t){const i=setTimeout(()=>{n(),t&&r.dispose()},e),r=Gn(()=>{clearTimeout(i),t==null||t.deleteAndLeak(r)});return t==null||t.add(r),r}function MUe(n,e=i=>!!i,t=null){let i=0;const r=n.length,o=()=>{if(i>=r)return Promise.resolve(t);const s=n[i++];return Promise.resolve(s()).then(l=>e(l)?Promise.resolve(l):o())};return o()}class nm{constructor(e,t){this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class p5{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval(()=>{e()},t)}}class so{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 this.timeoutToken!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;(e=this.runner)===null||e===void 0||e.call(this)}}let Py;(function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?Py=n=>{kje(()=>{if(e)return;const t=Date.now()+15;n(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,t-Date.now())}}))});let e=!1;return{dispose(){e||(e=!0)}}}:Py=(n,e)=>{const t=requestIdleCallback(n,typeof e=="number"?{timeout:e}:void 0);let i=!1;return{dispose(){i||(i=!0,cancelIdleCallback(t))}}}})();class D8{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=Py(()=>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 UU{get isRejected(){var e;return((e=this.outcome)===null||e===void 0?void 0:e.outcome)===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new Xw)}}var ese;(function(n){function e(i){return Vf(this,void 0,void 0,function*(){let r;const o=yield Promise.all(i.map(s=>s.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return o})}n.settled=e;function t(i){return new Promise((r,o)=>Vf(this,void 0,void 0,function*(){try{yield i(r,o)}catch(s){o(s)}}))}n.withAsyncBody=t})(ese||(ese={}));class ba{static fromArray(e){return new ba(t=>{t.emitMany(e)})}static fromPromise(e){return new ba(t=>Vf(this,void 0,void 0,function*(){t.emitMany(yield e)}))}static fromPromises(e){return new ba(t=>Vf(this,void 0,void 0,function*(){yield Promise.all(e.map(i=>Vf(this,void 0,void 0,function*(){return t.emitOne(yield i)})))}))}static merge(e){return new ba(t=>Vf(this,void 0,void 0,function*(){yield Promise.all(e.map(i=>{var r,o,s;return Vf(this,void 0,void 0,function*(){var a,l,c,u;try{for(r=!0,o=xN(i);s=yield o.next(),a=s.done,!a;r=!0){u=s.value,r=!1;const d=u;t.emitOne(d)}}catch(d){l={error:d}}finally{try{!r&&!a&&(c=o.return)&&(yield c.call(o))}finally{if(l)throw l.error}}})}))}))}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new be,queueMicrotask(()=>Vf(this,void 0,void 0,function*(){const t={emitOne:i=>this.emitOne(i),emitMany:i=>this.emitMany(i),reject:i=>this.reject(i)};try{yield Promise.resolve(e(t)),this.resolve()}catch(i){this.reject(i)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}}))}[Symbol.asyncIterator](){let e=0;return{next:()=>Vf(this,void 0,void 0,function*(){do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};yield Pt.toPromise(this._onStateChanged.event)}while(!0)})}}static map(e,t){return new ba(i=>Vf(this,void 0,void 0,function*(){var r,o,s,a;try{for(var l=!0,c=xN(e),u;u=yield c.next(),r=u.done,!r;l=!0){a=u.value,l=!1;const d=a;i.emitOne(t(d))}}catch(d){o={error:d}}finally{try{!l&&!r&&(s=c.return)&&(yield s.call(c))}finally{if(o)throw o.error}}}))}map(e){return ba.map(this,e)}static filter(e,t){return new ba(i=>Vf(this,void 0,void 0,function*(){var r,o,s,a;try{for(var l=!0,c=xN(e),u;u=yield c.next(),r=u.done,!r;l=!0){a=u.value,l=!1;const d=a;t(d)&&i.emitOne(d)}}catch(d){o={error:d}}finally{try{!l&&!r&&(s=c.return)&&(yield s.call(c))}finally{if(o)throw o.error}}}))}filter(e){return ba.filter(this,e)}static coalesce(e){return ba.filter(e,t=>!!t)}coalesce(){return ba.coalesce(this)}static toPromise(e){var t,i,r,o,s,a,l;return Vf(this,void 0,void 0,function*(){const c=[];try{for(t=!0,i=xN(e);r=yield i.next(),o=r.done,!o;t=!0){l=r.value,t=!1;const u=l;c.push(u)}}catch(u){s={error:u}}finally{try{!t&&!o&&(a=i.return)&&(yield a.call(i))}finally{if(s)throw s.error}}return c})}toPromise(){return ba.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}}ba.EMPTY=ba.fromArray([]);class C$i extends ba{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function w$i(n){const e=new da,t=n(e.token);return new C$i(e,i=>Vf(this,void 0,void 0,function*(){var r,o,s,a;const l=e.token.onCancellationRequested(()=>{l.dispose(),e.dispose(),i.reject(new Xw)});try{try{for(var c=!0,u=xN(t),d;d=yield u.next(),r=d.done,!r;c=!0){a=d.value,c=!1;const h=a;if(e.token.isCancellationRequested)return;i.emitOne(h)}}catch(h){o={error:h}}finally{try{!c&&!r&&(s=u.return)&&(yield s.call(u))}finally{if(o)throw o.error}}l.dispose(),e.dispose()}catch(h){l.dispose(),e.dispose(),i.reject(h)}}))}const S$i="$initialize";let OLe=!1;function tse(n){Qw&&(OLe||(OLe=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(n.message))}class E$i{constructor(e,t,i,r){this.vsWorker=e,this.req=t,this.method=i,this.args=r,this.type=0}}class PLe{constructor(e,t,i,r){this.vsWorker=e,this.seq=t,this.res=i,this.err=r,this.type=1}}class x$i{constructor(e,t,i,r){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=r,this.type=2}}class k$i{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class T$i{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class I$i{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 i=String(++this._lastSentReq);return new Promise((r,o)=>{this._pendingReplies[i]={resolve:r,reject:o},this._send(new E$i(this._workerId,i,e,t))})}listen(e,t){let i=null;const r=new be({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,r),this._send(new x$i(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new T$i(this._workerId,i)),i=null}});return r.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&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]){console.warn("Got reply to unknown seq");return}const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),t.reject(i);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(r=>{this._send(new PLe(this._workerId,t,r,void 0))},r=>{r.detail instanceof Error&&(r.detail=cLe(r.detail)),this._send(new PLe(this._workerId,t,void 0,cLe(r)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(r=>{this._send(new k$i(this._workerId,t,r))});this._pendingEvents.set(t,i)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){const t=[];if(e.type===0)for(let i=0;i<e.args.length;i++)e.args[i]instanceof ArrayBuffer&&t.push(e.args[i]);else e.type===1&&e.res instanceof ArrayBuffer&&t.push(e.res);this._handler.sendMessage(e,t)}}class L$i extends Ae{constructor(e,t,i){super();let r=null;this._worker=this._register(e.create("vs/base/common/worker/simpleWorker",u=>{this._protocol.handleMessage(u)},u=>{r==null||r(u)})),this._protocol=new I$i({sendMessage:(u,d)=>{this._worker.postMessage(u,d)},handleMessage:(u,d)=>{if(typeof i[u]!="function")return Promise.reject(new Error("Missing method "+u+" on main thread host."));try{return Promise.resolve(i[u].apply(i,d))}catch(h){return Promise.reject(h)}},handleEvent:(u,d)=>{if(BUe(u)){const h=i[u].call(i,d);if(typeof h!="function")throw new Error(`Missing dynamic event ${u} on main thread host.`);return h}if(FUe(u)){const h=i[u];if(typeof h!="function")throw new Error(`Missing event ${u} on main thread host.`);return h}throw new Error(`Malformed event name ${u}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;const s=globalThis.require;typeof s<"u"&&typeof s.getConfig=="function"?o=s.getConfig():typeof globalThis.requirejs<"u"&&(o=globalThis.requirejs.s.contexts._.config);const a=mme(i);this._onModuleLoaded=this._protocol.sendMessage(S$i,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,a]);const l=(u,d)=>this._request(u,d),c=(u,d)=>this._protocol.listen(u,d);this._lazyProxy=new Promise((u,d)=>{r=d,this._onModuleLoaded.then(h=>{u(D$i(h,l,c))},h=>{d(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((i,r)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(i,r)},r)})}_onError(e,t){console.error(e),console.info(t)}}function FUe(n){return n[0]==="o"&&n[1]==="n"&&dv(n.charCodeAt(2))}function BUe(n){return/^onDynamic/.test(n)&&dv(n.charCodeAt(9))}function D$i(n,e,t){const i=s=>function(){const a=Array.prototype.slice.call(arguments,0);return e(s,a)},r=s=>function(a){return t(s,a)},o={};for(const s of n){if(BUe(s)){o[s]=r(s);continue}if(FUe(s)){o[s]=t(s,void 0);continue}o[s]=i(s)}return o}function R0(n,e){var t;const i=globalThis.MonacoEnvironment;if(i!=null&&i.createTrustedTypesPolicy)try{return i.createTrustedTypesPolicy(n,e)}catch(r){fi(r);return}try{return(t=window.trustedTypes)===null||t===void 0?void 0:t.createPolicy(n,e)}catch(r){fi(r);return}}const MLe=R0("defaultWorkerFactory",{createScriptURL:n=>n});function A$i(n){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",n);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",n);return new Worker(MLe?MLe.createScriptURL(t):t,{name:n})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function R$i(n){return typeof n.then=="function"}class N$i{constructor(e,t,i,r,o){this.id=t,this.label=i;const s=A$i(i);R$i(s)?this.worker=s:this.worker=Promise.resolve(s),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(l){r(l.data)},a.onmessageerror=o,typeof a.addEventListener=="function"&&a.addEventListener("error",o)})}getId(){return this.id}postMessage(e,t){var i;(i=this.worker)===null||i===void 0||i.then(r=>{try{r.postMessage(e,t)}catch(o){fi(o),fi(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:o}))}})}dispose(){var e;(e=this.worker)===null||e===void 0||e.then(t=>t.terminate()),this.worker=null}}class qU{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const r=++qU.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new N$i(e,r,this._label||"anonymous"+r,t,o=>{tse(o),this._webWorkerFailedBeforeError=o,i(o)})}}qU.LAST_WORKER_ID=0;var Ca;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(Ca||(Ca={}));class aZ{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,i=e.notIn.length;t<i;t++)switch(e.notIn[t]){case"string":this._inString=!1;break;case"comment":this._inComment=!1;break;case"regex":this._inRegEx=!1;break}}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(e.getTokenCount()===0)return!0;const i=e.findTokenIndexAtOffset(t-2),r=e.getStandardTokenType(i);return this.isOK(r)}_findNeutralCharacterInRange(e,t){for(let i=e;i<=t;i++){const r=String.fromCharCode(i);if(!this.open.includes(r)&&!this.close.includes(r))return r}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 O$i{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)PR(this.autoClosingPairsOpenByStart,t.open.charAt(0),t),PR(this.autoClosingPairsOpenByEnd,t.open.charAt(t.open.length-1),t),PR(this.autoClosingPairsCloseByStart,t.close.charAt(0),t),PR(this.autoClosingPairsCloseByEnd,t.close.charAt(t.close.length-1),t),t.close.length===1&&t.open.length===1&&PR(this.autoClosingPairsCloseSingleChar,t.close,t)}}function PR(n,e,t){n.has(e)?n.get(e).push(t):n.set(e,[t])}function KU(n,e){const t=n.getCount(),i=n.findTokenIndexAtOffset(e),r=n.getLanguageId(i);let o=i;for(;o+1<t&&n.getLanguageId(o+1)===r;)o++;let s=i;for(;s>0&&n.getLanguageId(s-1)===r;)s--;return new P$i(n,r,s,o+1,n.getStartOffset(s),n.getEndOffset(o))}class P$i{constructor(e,t,i,r,o,s){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=r,this.firstCharOffset=o,this._lastCharOffset=s}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 X_(n){return(n&3)!==0}class QD{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new aZ(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new aZ({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new aZ({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:QD.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:QD.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}QD.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])>
`;QD.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])>
`;const FLe=typeof Buffer<"u";let lZ;class GU{static wrap(e){return FLe&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new GU(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return FLe?this.buffer.toString():(lZ||(lZ=new TextDecoder),lZ.decode(this.buffer))}}function M$i(n,e){return n[e+0]<<0>>>0|n[e+1]<<8>>>0}function F$i(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255}function Dm(n,e){return n[e]*Math.pow(2,24)+n[e+1]*Math.pow(2,16)+n[e+2]*Math.pow(2,8)+n[e+3]}function Am(n,e,t){n[t+3]=e,e=e>>>8,n[t+2]=e,e=e>>>8,n[t+1]=e,e=e>>>8,n[t]=e}function BLe(n,e){return n[e]}function $Le(n,e,t){n[t]=e}let cZ;function $Ue(){return cZ||(cZ=new TextDecoder("UTF-16LE")),cZ}let uZ;function B$i(){return uZ||(uZ=new TextDecoder("UTF-16BE")),uZ}let dZ;function VUe(){return dZ||(dZ=Tje()?$Ue():B$i()),dZ}function $$i(n,e,t){const i=new Uint16Array(n.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?V$i(n,e,t):$Ue().decode(i)}function V$i(n,e,t){const i=[];let r=0;for(let o=0;o<t;o++){const s=M$i(n,e);e+=2,i[r++]=String.fromCharCode(s)}return i.join("")}class SA{constructor(e){this._capacity=e|0,this._buffer=new Uint16Array(this._capacity),this._completedStrings=null,this._bufferLength=0}reset(){this._completedStrings=null,this._bufferLength=0}build(){return this._completedStrings!==null?(this._flushBuffer(),this._completedStrings.join("")):this._buildBuffer()}_buildBuffer(){if(this._bufferLength===0)return"";const e=new Uint16Array(this._buffer.buffer,0,this._bufferLength);return VUe().decode(e)}_flushBuffer(){const e=this._buildBuffer();this._bufferLength=0,this._completedStrings===null?this._completedStrings=[e]:this._completedStrings[this._completedStrings.length]=e}appendCharCode(e){const t=this._capacity-this._bufferLength;t<=1&&(t===0||Za(e))&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendASCIICharCode(e){this._bufferLength===this._capacity&&this._flushBuffer(),this._buffer[this._bufferLength++]=e}appendString(e){const t=e.length;if(this._bufferLength+t>=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i<t;i++)this._buffer[this._bufferLength++]=e.charCodeAt(i)}}class MV{constructor(e,t,i,r,o,s){this._richEditBracketBrand=void 0,this.languageId=e,this.index=t,this.open=i,this.close=r,this.forwardRegex=o,this.reversedRegex=s,this._openSet=MV._toSet(this.open),this._closeSet=MV._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 i of e)t.add(i);return t}}function H$i(n){const e=n.length;n=n.map(s=>[s[0].toLowerCase(),s[1].toLowerCase()]);const t=[];for(let s=0;s<e;s++)t[s]=s;const i=(s,a)=>{const[l,c]=s,[u,d]=a;return l===u||l===d||c===u||c===d},r=(s,a)=>{const l=Math.min(s,a),c=Math.max(s,a);for(let u=0;u<e;u++)t[u]===c&&(t[u]=l)};for(let s=0;s<e;s++){const a=n[s];for(let l=s+1;l<e;l++){const c=n[l];i(a,c)&&r(t[s],t[l])}}const o=[];for(let s=0;s<e;s++){const a=[],l=[];for(let c=0;c<e;c++)if(t[c]===s){const[u,d]=n[c];a.push(u),l.push(d)}a.length>0&&o.push({open:a,close:l})}return o}class W$i{constructor(e,t){this._richEditBracketsBrand=void 0;const i=H$i(t);this.brackets=i.map((r,o)=>new MV(e,o,r.open,r.close,z$i(r.open,r.close,i,o),j$i(r.open,r.close,i,o))),this.forwardRegex=U$i(this.brackets),this.reversedRegex=q$i(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const r of this.brackets){for(const o of r.open)this.textIsBracket[o]=r,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of r.close)this.textIsBracket[o]=r,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function HUe(n,e,t,i){for(let r=0,o=e.length;r<o;r++){if(r===t)continue;const s=e[r];for(const a of s.open)a.indexOf(n)>=0&&i.push(a);for(const a of s.close)a.indexOf(n)>=0&&i.push(a)}}function WUe(n,e){return n.length-e.length}function YU(n){if(n.length<=1)return n;const e=[],t=new Set;for(const i of n)t.has(i)||(e.push(i),t.add(i));return e}function z$i(n,e,t,i){let r=[];r=r.concat(n),r=r.concat(e);for(let o=0,s=r.length;o<s;o++)HUe(r[o],t,i,r);return r=YU(r),r.sort(WUe),r.reverse(),QU(r)}function j$i(n,e,t,i){let r=[];r=r.concat(n),r=r.concat(e);for(let o=0,s=r.length;o<s;o++)HUe(r[o],t,i,r);return r=YU(r),r.sort(WUe),r.reverse(),QU(r.map(Wme))}function U$i(n){let e=[];for(const t of n){for(const i of t.open)e.push(i);for(const i of t.close)e.push(i)}return e=YU(e),QU(e)}function q$i(n){let e=[];for(const t of n){for(const i of t.open)e.push(i);for(const i of t.close)e.push(i)}return e=YU(e),QU(e.map(Wme))}function K$i(n){const e=/^[\w ]+$/.test(n);return n=hf(n),e?`\\b${n}\\b`:n}function QU(n){const e=`(${n.map(K$i).join(")|(")})`;return Zje(e,!0)}const Wme=function(){function n(i){const r=new Uint16Array(i.length);let o=0;for(let s=i.length-1;s>=0;s--)r[o++]=i.charCodeAt(s);return VUe().decode(r)}let e=null,t=null;return function(r){return e!==r&&(e=r,t=n(e)),t}}();class ap{static _findPrevBracketInText(e,t,i,r){const o=i.match(e);if(!o)return null;const s=i.length-(o.index||0),a=o[0].length,l=r+s;return new q(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,r,o){const a=Wme(i).substring(i.length-o,i.length-r);return this._findPrevBracketInText(e,t,a,r)}static findNextBracketInText(e,t,i,r){const o=i.match(e);if(!o)return null;const s=o.index||0,a=o[0].length;if(a===0)return null;const l=r+s;return new q(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,i,r,o){const s=i.substring(r,o);return this.findNextBracketInText(e,t,s,r)}}class G$i{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const r=i.charAt(i.length-1);e.push(r)}return rw(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const r=t.findTokenIndexAtOffset(i-1);if(X_(t.getStandardTokenType(r)))return null;const o=this._richEditBrackets.reversedRegex,s=t.getLineContent().substring(0,i-1)+e,a=ap.findPrevBracketInRange(o,1,s,0,s.length);if(!a)return null;const l=s.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;const u=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(u)?{matchOpenBracket:l}:null}}function CB(n){return n.global&&(n.lastIndex=0),!0}class Y$i{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&CB(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&CB(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&CB(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&CB(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 MI{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=MI._createOpenBracketRegExp(t[0]),r=MI._createCloseBracketRegExp(t[1]);i&&r&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:r})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,r){if(e>=3)for(let o=0,s=this._regExpRules.length;o<s;o++){const a=this._regExpRules[o];if([{reg:a.beforeText,text:i},{reg:a.afterText,text:r},{reg:a.previousLineText,text:t}].every(c=>c.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&i.length>0&&r.length>0)for(let o=0,s=this._brackets.length;o<s;o++){const a=this._brackets[o];if(a.openRegExp.test(i)&&a.closeRegExp.test(r))return{indentAction:Ca.IndentOutdent}}if(e>=2&&i.length>0){for(let o=0,s=this._brackets.length;o<s;o++)if(this._brackets[o].openRegExp.test(i))return{indentAction:Ca.Indent}}return null}static _createOpenBracketRegExp(e){let t=hf(e);return/\B/.test(t.charAt(0))||(t="\\b"+t),t+="\\s*$",MI._safeRegExp(t)}static _createCloseBracketRegExp(e){let t=hf(e);return/\B/.test(t.charAt(t.length-1))||(t=t+"\\b"),t="^\\s*"+t,MI._safeRegExp(t)}static _safeRegExp(e){try{return new RegExp(e)}catch(t){return fi(t),null}}}const Ui=Vi("configurationService");function nse(n,e){const t=Object.create(null);for(const i in n)zUe(t,i,n[i],e);return t}function zUe(n,e,t,i){const r=e.split("."),o=r.pop();let s=n;for(let a=0;a<r.length;a++){const l=r[a];let c=s[l];switch(typeof c){case"undefined":c=s[l]=Object.create(null);break;case"object":break;default:i(`Ignoring ${e} as ${r.slice(0,a+1).join(".")} is ${JSON.stringify(c)}`);return}s=c}if(typeof s=="object"&&s!==null)try{s[o]=t}catch{i(`Ignoring ${e} as ${r.join(".")} is ${JSON.stringify(s)}`)}else i(`Ignoring ${e} as ${r.join(".")} is ${JSON.stringify(s)}`)}function Q$i(n,e){const t=e.split(".");jUe(n,t)}function jUe(n,e){const t=e.shift();if(e.length===0){delete n[t];return}if(Object.keys(n).indexOf(t)!==-1){const i=n[t];typeof i=="object"&&!Array.isArray(i)&&(jUe(i,e),Object.keys(i).length===0&&delete n[t])}}function VLe(n,e,t){function i(s,a){let l=s;for(const c of a){if(typeof l!="object"||l===null)return;l=l[c]}return l}const r=e.split("."),o=i(n,r);return typeof o>"u"?t:o}function X$i(n){return n.replace(/[\[\]]/g,"")}const Qo=Vi("languageService");class hv{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const UUe=[];function Zi(n,e,t){e instanceof hv||(e=new hv(e,[],!!t)),UUe.push([n,e])}function HLe(){return UUe}const Ks=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),XU={JSONContribution:"base.contributions.json"};function Z$i(n){return n.length>0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}class J$i{constructor(){this._onDidChangeSchema=new be,this.schemasById={}}registerSchema(e,t){this.schemasById[Z$i(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const e8i=new J$i;ds.add(XU.JSONContribution,e8i);const O_={Configuration:"base.contributions.configuration"},MR="vscode://schemas/settings/resourceLanguage",WLe=ds.as(XU.JSONContribution);class t8i{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new be,this._onDidUpdateConfiguration=new be,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:E("defaultLanguageConfigurationOverrides.title","Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},WLe.registerSchema(MR,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),WLe.registerSchema(MR,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var i;const r=[];for(const{overrides:o,source:s}of e)for(const a in o)if(t.add(a),dw.test(a)){const l=this.configurationDefaultsOverrides.get(a),c=(i=l==null?void 0:l.valuesSources)!==null&&i!==void 0?i:new Map;if(s)for(const g of Object.keys(o[a]))c.set(g,s);const u=Object.assign(Object.assign({},(l==null?void 0:l.value)||{}),o[a]);this.configurationDefaultsOverrides.set(a,{source:s,value:u,valuesSources:c});const d=X$i(a),h={type:"object",default:u,description:E("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",d),$ref:MR,defaultDefaultValue:u,source:Ku(s)?void 0:s,defaultValueSource:s};r.push(...FV(a)),this.configurationProperties[a]=h,this.defaultLanguageConfigurationOverridesNode.properties[a]=h}else{this.configurationDefaultsOverrides.set(a,{value:o[a],source:s});const l=this.configurationProperties[a];l&&(this.updatePropertyDefaultValue(a,l),this.updateSchema(a,l))}this.doRegisterOverrideIdentifiers(r)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(r=>{this.validateAndRegisterProperties(r,t,r.extensionInfo,r.restrictedProperties,void 0,i),this.configurationContributors.push(r),this.registerJSONConfiguration(r)})}validateAndRegisterProperties(e,t=!0,i,r,o=3,s){var a;o=Mh(e.scope)?o:e.scope;const l=e.properties;if(l)for(const u in l){const d=l[u];if(t&&r8i(u,d)){delete l[u];continue}if(d.source=i,d.defaultDefaultValue=l[u].default,this.updatePropertyDefaultValue(u,d),dw.test(u)?d.scope=void 0:(d.scope=Mh(d.scope)?o:d.scope,d.restricted=Mh(d.restricted)?!!(r!=null&&r.includes(u)):d.restricted),l[u].hasOwnProperty("included")&&!l[u].included){this.excludedConfigurationProperties[u]=l[u],delete l[u];continue}else this.configurationProperties[u]=l[u],!((a=l[u].policy)===null||a===void 0)&&a.name&&this.policyConfigurations.set(l[u].policy.name,u);!l[u].deprecationMessage&&l[u].markdownDeprecationMessage&&(l[u].deprecationMessage=l[u].markdownDeprecationMessage),s.add(u)}const c=e.allOf;if(c)for(const u of c)this.validateAndRegisterProperties(u,t,i,r,o,s)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=i=>{const r=i.properties;if(r)for(const s in r)this.updateSchema(s,r[s]);const o=i.allOf;o==null||o.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:E("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:E("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:MR};this.updatePropertyDefaultValue(t,i)}}registerOverridePropertyPatternKey(){E("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),E("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e);let r=i==null?void 0:i.value,o=i==null?void 0:i.source;Xd(r)&&(r=t.defaultDefaultValue,o=void 0),Xd(r)&&(r=i8i(t.type)),t.default=r,t.defaultValueSource=o}}const qUe="\\[([^\\]]+)\\]",zLe=new RegExp(qUe,"g"),n8i=`^(${qUe})+$`,dw=new RegExp(n8i);function FV(n){const e=[];if(dw.test(n)){let t=zLe.exec(n);for(;t!=null&&t.length;){const i=t[1].trim();i&&e.push(i),t=zLe.exec(n)}}return rw(e)}function i8i(n){switch(Array.isArray(n)?n[0]:n){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const A8=new t8i;ds.add(O_.Configuration,A8);function r8i(n,e){var t,i,r,o;return n.trim()?dw.test(n)?E("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",n):A8.getConfigurationProperties()[n]!==void 0?E("config.property.duplicate","Cannot register '{0}'. This property is already registered.",n):!((t=e.policy)===null||t===void 0)&&t.name&&A8.getPolicyConfigurations().get((i=e.policy)===null||i===void 0?void 0:i.name)!==void 0?E("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",n,(r=e.policy)===null||r===void 0?void 0:r.name,A8.getPolicyConfigurations().get((o=e.policy)===null||o===void 0?void 0:o.name)):null:E("config.property.empty","Cannot register an empty property")}const o8i={ModesRegistry:"editor.modesRegistry"};class s8i{constructor(){this._onDidChangeLanguages=new be,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t<i;t++)if(this._languages[t]===e){this._languages.splice(t,1);return}}}}getLanguages(){return this._languages}}const XD=new s8i;ds.add(o8i.ModesRegistry,XD);const nf="plaintext",a8i=".txt";XD.registerLanguage({id:nf,extensions:[a8i],aliases:[E("plainText.alias","Plain Text"),"text"],mimetypes:[Ks.text]});ds.as(O_.Configuration).registerDefaultConfigurations([{overrides:{"[plaintext]":{"editor.unicodeHighlight.ambiguousCharacters":!1,"editor.unicodeHighlight.invisibleCharacters":!1}}}]);class l8i{constructor(e,t){this.languageId=e;const i=t.brackets?jLe(t.brackets):[],r=new fLe(a=>{const l=new Set;return{info:new c8i(this,a,l),closing:l}}),o=new fLe(a=>{const l=new Set,c=new Set;return{info:new u8i(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of i){const c=r.get(a),u=o.get(l);c.closing.add(u.info),u.opening.add(c.info)}const s=t.colorizedBracketPairs?jLe(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of s){const c=r.get(a),u=o.get(l);c.closing.add(u.info),u.openingColorized.add(c.info),u.opening.add(c.info)}this._openingBrackets=new Map([...r.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...o.cachedValues].map(([a,l])=>[a,l.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}}function jLe(n){return n.filter(([e,t])=>e!==""&&t!=="")}class KUe{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class c8i extends KUe{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class u8i extends KUe{constructor(e,t,i,r){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=r,this.isOpeningBracket=!1}closes(e){return e.config!==this.config?!1:this.openingBrackets.has(e)}closesColorized(e){return e.config!==this.config?!1:this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}var d8i=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ULe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class hZ{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const xo=Vi("languageConfigurationService");let ise=class extends Ae{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new p8i),this.onDidChangeEmitter=this._register(new be),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(rse));this._register(this.configurationService.onDidChangeConfiguration(r=>{const o=r.change.keys.some(a=>i.has(a)),s=r.change.overrides.filter(([a,l])=>l.some(c=>i.has(c))).map(([a])=>a);if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new hZ(void 0));else for(const a of s)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new hZ(a)))})),this._register(this._registry.onDidChange(r=>{this.configurations.delete(r.languageId),this.onDidChangeEmitter.fire(new hZ(r.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=h8i(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};ise=d8i([ULe(0,Ui),ULe(1,Qo)],ise);function h8i(n,e,t,i){let r=e.getLanguageConfiguration(n);if(!r){if(!i.isRegisteredLanguageId(n))return new IL(n,{});r=new IL(n,{})}const o=f8i(r.languageId,t),s=YUe([r.underlyingConfig,o]);return new IL(r.languageId,s)}const rse={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function f8i(n,e){const t=e.getValue(rse.brackets,{overrideIdentifier:n}),i=e.getValue(rse.colorizedBracketPairs,{overrideIdentifier:n});return{brackets:qLe(t),colorizedBracketPairs:qLe(i)}}function qLe(n){if(Array.isArray(n))return n.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function GUe(n,e,t){const i=n.getLineContent(e);let r=go(i);return r.length>t-1&&(r=r.substring(0,t-1)),r}function TL(n,e,t){n.tokenization.forceTokenization(e);const i=n.tokenization.getLineTokens(e),r=typeof t>"u"?n.getLineMaxColumn(e)-1:t-1;return KU(i,r)}class g8i{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new KLe(e,t,++this._order);return this._entries.push(i),this._resolved=null,Gn(()=>{for(let r=0;r<this._entries.length;r++)if(this._entries[r]===i){this._entries.splice(r,1),this._resolved=null;break}})}getResolvedConfiguration(){if(!this._resolved){const e=this._resolve();e&&(this._resolved=new IL(this.languageId,e))}return this._resolved}_resolve(){return this._entries.length===0?null:(this._entries.sort(KLe.cmp),YUe(this._entries.map(e=>e.configuration)))}}function YUe(n){let e={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 t of n)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}class KLe{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class GLe{constructor(e){this.languageId=e}}class p8i extends Ae{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new be),this.onDidChange=this._onDidChange.event,this._register(this.register(nf,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let r=this._entries.get(e);r||(r=new g8i(e),this._entries.set(e,r));const o=r.register(t,i);return this._onDidChange.fire(new GLe(e)),Gn(()=>{o.dispose(),this._onDidChange.fire(new GLe(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class IL{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 MI(this.underlyingConfig):null,this.comments=IL._handleComments(this.underlyingConfig),this.characterPair=new QD(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||bme,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new Y$i(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new l8i(e,this.underlyingConfig)}getWordDefinition(){return Dje(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new W$i(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new G$i(this.brackets)),this._electricCharacter}onEnter(e,t,i,r){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,r):null}getAutoClosingPairs(){return new O$i(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){const[r,o]=t.blockComment;i.blockCommentStartToken=r,i.blockCommentEndToken=o}return i}}Zi(xo,ise,1);class c1{constructor(e,t,i,r){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=r}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}function QUe(n){return ZU(n,0)}function ZU(n,e){switch(typeof n){case"object":return n===null?My(349,e):Array.isArray(n)?_8i(n,e):v8i(n,e);case"string":return zme(n,e);case"boolean":return m8i(n,e);case"number":return My(n,e);case"undefined":return My(937,e);default:return My(617,e)}}function My(n,e){return(e<<5)-e+n|0}function m8i(n,e){return My(n?433:863,e)}function zme(n,e){e=My(149417,e);for(let t=0,i=n.length;t<i;t++)e=My(n.charCodeAt(t),e);return e}function _8i(n,e){return e=My(104579,e),n.reduce((t,i)=>ZU(i,t),e)}function v8i(n,e){return e=My(181387,e),Object.keys(n).sort().reduce((t,i)=>(t=zme(i,t),ZU(n[i],t)),e)}function fZ(n,e,t=32){const i=t-e,r=~((1<<i)-1);return(n<<e|(r&n)>>>i)>>>0}function YLe(n,e=0,t=n.byteLength,i=0){for(let r=0;r<t;r++)n[e+r]=i}function b8i(n,e,t="0"){for(;n.length<e;)n=t+n;return n}function FR(n,e=32){return n instanceof ArrayBuffer?Array.from(new Uint8Array(n)).map(t=>t.toString(16).padStart(2,"0")).join(""):b8i((n>>>0).toString(16),e/4)}class JU{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(64+3),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(t===0)return;const i=this._buff;let r=this._buffLen,o=this._leftoverHighSurrogate,s,a;for(o!==0?(s=o,a=-1,o=0):(s=e.charCodeAt(0),a=0);;){let l=s;if(Za(s))if(a+1<t){const c=e.charCodeAt(a+1);Rx(c)?(a++,l=Dme(s,c)):l=65533}else{o=s;break}else Rx(s)&&(l=65533);if(r=this._push(i,r,l),a++,a<t)s=e.charCodeAt(a);else break}this._buffLen=r,this._leftoverHighSurrogate=o}_push(e,t,i){return i<128?e[t++]=i:i<2048?(e[t++]=192|(i&1984)>>>6,e[t++]=128|(i&63)>>>0):i<65536?(e[t++]=224|(i&61440)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0):(e[t++]=240|(i&1835008)>>>18,e[t++]=128|(i&258048)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64+0],e[1]=e[64+1],e[2]=e[64+2]),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()),FR(this._h0)+FR(this._h1)+FR(this._h2)+FR(this._h3)+FR(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,YLe(this._buff,this._buffLen),this._buffLen>56&&(this._step(),YLe(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=JU._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,fZ(e.getUint32(d-12,!1)^e.getUint32(d-32,!1)^e.getUint32(d-56,!1)^e.getUint32(d-64,!1),1),!1);let i=this._h0,r=this._h1,o=this._h2,s=this._h3,a=this._h4,l,c,u;for(let d=0;d<80;d++)d<20?(l=r&o|~r&s,c=1518500249):d<40?(l=r^o^s,c=1859775393):d<60?(l=r&o|r&s|o&s,c=2400959708):(l=r^o^s,c=3395469782),u=fZ(i,5)+l+a+c+e.getUint32(d*4,!1)&4294967295,a=s,s=o,o=fZ(r,30),r=i,i=u;this._h0=this._h0+i&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+s&4294967295,this._h4=this._h4+a&4294967295}}JU._bigBlock32=new DataView(new ArrayBuffer(320));class QLe{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,r=e.length;i<r;i++)t[i]=e.charCodeAt(i);return t}}function y8i(n,e,t){return new yv(new QLe(n),new QLe(e)).ComputeDiff(t).changes}class DT{static Assert(e,t){if(!e)throw new Error(t)}}class AT{static Copy(e,t,i,r,o){for(let s=0;s<o;s++)i[r+s]=e[t+s]}static Copy2(e,t,i,r,o){for(let s=0;s<o;s++)i[r+s]=e[t+s]}}class XLe{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 c1(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 yv{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[r,o,s]=yv._getElements(e),[a,l,c]=yv._getElements(t);this._hasStrings=s&&c,this._originalStringElements=r,this._originalElementsOrHash=o,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(yv._isStringArray(t)){const i=new Int32Array(t.length);for(let r=0,o=t.length;r<o;r++)i[r]=zme(t[r],0);return[t,i,!0]}return t instanceof Int32Array?[[],t,!1]:[[],new Int32Array(t),!1]}ElementsAreEqual(e,t){return this._originalElementsOrHash[e]!==this._modifiedElementsOrHash[t]?!1:this._hasStrings?this._originalStringElements[e]===this._modifiedStringElements[t]:!0}ElementsAreStrictEqual(e,t){if(!this.ElementsAreEqual(e,t))return!1;const i=yv._getStrictElement(this._originalSequence,e),r=yv._getStrictElement(this._modifiedSequence,t);return i===r}static _getStrictElement(e,t){return typeof e.getStrictElement=="function"?e.getStrictElement(t):null}OriginalElementsAreEqual(e,t){return this._originalElementsOrHash[e]!==this._originalElementsOrHash[t]?!1:this._hasStrings?this._originalStringElements[e]===this._originalStringElements[t]:!0}ModifiedElementsAreEqual(e,t){return this._modifiedElementsOrHash[e]!==this._modifiedElementsOrHash[t]?!1:this._hasStrings?this._modifiedStringElements[e]===this._modifiedStringElements[t]:!0}ComputeDiff(e){return this._ComputeDiff(0,this._originalElementsOrHash.length-1,0,this._modifiedElementsOrHash.length-1,e)}_ComputeDiff(e,t,i,r,o){const s=[!1];let a=this.ComputeDiffRecursive(e,t,i,r,s);return o&&(a=this.PrettifyChanges(a)),{quitEarly:s[0],changes:a}}ComputeDiffRecursive(e,t,i,r,o){for(o[0]=!1;e<=t&&i<=r&&this.ElementsAreEqual(e,i);)e++,i++;for(;t>=e&&r>=i&&this.ElementsAreEqual(t,r);)t--,r--;if(e>t||i>r){let d;return i<=r?(DT.Assert(e===t+1,"originalStart should only be one more than originalEnd"),d=[new c1(e,0,i,r-i+1)]):e<=t?(DT.Assert(i===r+1,"modifiedStart should only be one more than modifiedEnd"),d=[new c1(e,t-e+1,i,0)]):(DT.Assert(e===t+1,"originalStart should only be one more than originalEnd"),DT.Assert(i===r+1,"modifiedStart should only be one more than modifiedEnd"),d=[]),d}const s=[0],a=[0],l=this.ComputeRecursionPoint(e,t,i,r,s,a,o),c=s[0],u=a[0];if(l!==null)return l;if(!o[0]){const d=this.ComputeDiffRecursive(e,c,i,u,o);let h=[];return o[0]?h=[new c1(c+1,t-(c+1)+1,u+1,r-(u+1)+1)]:h=this.ComputeDiffRecursive(c+1,t,u+1,r,o),this.ConcatenateChanges(d,h)}return[new c1(e,t-e+1,i,r-i+1)]}WALKTRACE(e,t,i,r,o,s,a,l,c,u,d,h,g,p,m,_,v,b){let y=null,C=null,x=new XLe,k=t,I=i,L=g[0]-_[0]-r,D=-1073741824,R=this.m_forwardHistory.length-1;do{const P=L+e;P===k||P<I&&c[P-1]<c[P+1]?(d=c[P+1],p=d-L-r,d<D&&x.MarkNextChange(),D=d,x.AddModifiedElement(d+1,p),L=P+1-e):(d=c[P-1]+1,p=d-L-r,d<D&&x.MarkNextChange(),D=d-1,x.AddOriginalElement(d,p+1),L=P-1-e),R>=0&&(c=this.m_forwardHistory[R],e=c[0],k=1,I=c.length-1)}while(--R>=-1);if(y=x.getReverseChanges(),b[0]){let P=g[0]+1,M=_[0]+1;if(y!==null&&y.length>0){const O=y[y.length-1];P=Math.max(P,O.getOriginalEnd()),M=Math.max(M,O.getModifiedEnd())}C=[new c1(P,h-P+1,M,m-M+1)]}else{x=new XLe,k=s,I=a,L=g[0]-_[0]-l,D=1073741824,R=v?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const P=L+o;P===k||P<I&&u[P-1]>=u[P+1]?(d=u[P+1]-1,p=d-L-l,d>D&&x.MarkNextChange(),D=d+1,x.AddOriginalElement(d+1,p+1),L=P+1-o):(d=u[P-1],p=d-L-l,d>D&&x.MarkNextChange(),D=d,x.AddModifiedElement(d+1,p+1),L=P-1-o),R>=0&&(u=this.m_reverseHistory[R],o=u[0],k=1,I=u.length-1)}while(--R>=-1);C=x.getChanges()}return this.ConcatenateChanges(y,C)}ComputeRecursionPoint(e,t,i,r,o,s,a){let l=0,c=0,u=0,d=0,h=0,g=0;e--,i--,o[0]=0,s[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const p=t-e+(r-i),m=p+1,_=new Int32Array(m),v=new Int32Array(m),b=r-i,y=t-e,C=e-i,x=t-r,I=(y-b)%2===0;_[b]=e,v[y]=t,a[0]=!1;for(let L=1;L<=p/2+1;L++){let D=0,R=0;u=this.ClipDiagonalBound(b-L,L,b,m),d=this.ClipDiagonalBound(b+L,L,b,m);for(let M=u;M<=d;M+=2){M===u||M<d&&_[M-1]<_[M+1]?l=_[M+1]:l=_[M-1]+1,c=l-(M-b)-C;const O=l;for(;l<t&&c<r&&this.ElementsAreEqual(l+1,c+1);)l++,c++;if(_[M]=l,l+c>D+R&&(D=l,R=c),!I&&Math.abs(M-y)<=L-1&&l>=v[M])return o[0]=l,s[0]=c,O<=v[M]&&1447>0&&L<=1447+1?this.WALKTRACE(b,u,d,C,y,h,g,x,_,v,l,t,o,c,r,s,I,a):null}const P=(D-e+(R-i)-L)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(D,P))return a[0]=!0,o[0]=D,s[0]=R,P>0&&1447>0&&L<=1447+1?this.WALKTRACE(b,u,d,C,y,h,g,x,_,v,l,t,o,c,r,s,I,a):(e++,i++,[new c1(e,t-e+1,i,r-i+1)]);h=this.ClipDiagonalBound(y-L,L,y,m),g=this.ClipDiagonalBound(y+L,L,y,m);for(let M=h;M<=g;M+=2){M===h||M<g&&v[M-1]>=v[M+1]?l=v[M+1]-1:l=v[M-1],c=l-(M-y)-x;const O=l;for(;l>e&&c>i&&this.ElementsAreEqual(l,c);)l--,c--;if(v[M]=l,I&&Math.abs(M-b)<=L&&l<=_[M])return o[0]=l,s[0]=c,O>=_[M]&&1447>0&&L<=1447+1?this.WALKTRACE(b,u,d,C,y,h,g,x,_,v,l,t,o,c,r,s,I,a):null}if(L<=1447){let M=new Int32Array(d-u+2);M[0]=b-u+1,AT.Copy2(_,u,M,1,d-u+1),this.m_forwardHistory.push(M),M=new Int32Array(g-h+2),M[0]=y-h+1,AT.Copy2(v,h,M,1,g-h+1),this.m_reverseHistory.push(M)}}return this.WALKTRACE(b,u,d,C,y,h,g,x,_,v,l,t,o,c,r,s,I,a)}PrettifyChanges(e){for(let t=0;t<e.length;t++){const i=e[t],r=t<e.length-1?e[t+1].originalStart:this._originalElementsOrHash.length,o=t<e.length-1?e[t+1].modifiedStart:this._modifiedElementsOrHash.length,s=i.originalLength>0,a=i.modifiedLength>0;for(;i.originalStart+i.originalLength<r&&i.modifiedStart+i.modifiedLength<o&&(!s||this.OriginalElementsAreEqual(i.originalStart,i.originalStart+i.originalLength))&&(!a||this.ModifiedElementsAreEqual(i.modifiedStart,i.modifiedStart+i.modifiedLength));){const c=this.ElementsAreStrictEqual(i.originalStart,i.modifiedStart);if(this.ElementsAreStrictEqual(i.originalStart+i.originalLength,i.modifiedStart+i.modifiedLength)&&!c)break;i.originalStart++,i.modifiedStart++}const l=[null];if(t<e.length-1&&this.ChangesOverlap(e[t],e[t+1],l)){e[t]=l[0],e.splice(t+1,1),t--;continue}}for(let t=e.length-1;t>=0;t--){const i=e[t];let r=0,o=0;if(t>0){const d=e[t-1];r=d.originalStart+d.originalLength,o=d.modifiedStart+d.modifiedLength}const s=i.originalLength>0,a=i.modifiedLength>0;let l=0,c=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let d=1;;d++){const h=i.originalStart-d,g=i.modifiedStart-d;if(h<r||g<o||s&&!this.OriginalElementsAreEqual(h,h+i.originalLength)||a&&!this.ModifiedElementsAreEqual(g,g+i.modifiedLength))break;const m=(h===r&&g===o?5:0)+this._boundaryScore(h,i.originalLength,g,i.modifiedLength);m>c&&(c=m,l=d)}i.originalStart-=l,i.modifiedStart-=l;const u=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],u)){e[t-1]=u[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t<i;t++){const r=e[t-1],o=e[t],s=o.originalStart-r.originalStart-r.originalLength,a=r.originalStart,l=o.originalStart+o.originalLength,c=l-a,u=r.modifiedStart,d=o.modifiedStart+o.modifiedLength,h=d-u;if(s<5&&c<20&&h<20){const g=this._findBetterContiguousSequence(a,c,u,h,s);if(g){const[p,m]=g;(p!==r.originalStart+r.originalLength||m!==r.modifiedStart+r.modifiedLength)&&(r.originalLength=p-r.originalStart,r.modifiedLength=m-r.modifiedStart,o.originalStart=p+s,o.modifiedStart=m+s,o.originalLength=l-o.originalStart,o.modifiedLength=d-o.modifiedStart)}}}return e}_findBetterContiguousSequence(e,t,i,r,o){if(t<o||r<o)return null;const s=e+t-o+1,a=i+r-o+1;let l=0,c=0,u=0;for(let d=e;d<s;d++)for(let h=i;h<a;h++){const g=this._contiguousSequenceScore(d,h,o);g>0&&g>l&&(l=g,c=d,u=h)}return l>0?[c,u]:null}_contiguousSequenceScore(e,t,i){let r=0;for(let o=0;o<i;o++){if(!this.ElementsAreEqual(e+o,t+o))return 0;r+=this._originalStringElements[e+o].length}return r}_OriginalIsBoundary(e){return e<=0||e>=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,r){const o=this._OriginalRegionIsBoundary(e,t)?1:0,s=this._ModifiedRegionIsBoundary(i,r)?1:0;return o+s}ConcatenateChanges(e,t){const i=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const r=new Array(e.length+t.length-1);return AT.Copy(e,0,r,0,e.length-1),r[e.length-1]=i[0],AT.Copy(t,1,r,e.length,t.length-1),r}else{const r=new Array(e.length+t.length);return AT.Copy(e,0,r,0,e.length),AT.Copy(t,0,r,e.length,t.length),r}}ChangesOverlap(e,t,i){if(DT.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),DT.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 r=e.originalStart;let o=e.originalLength;const s=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new c1(r,o,s,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,r){if(e>=0&&e<r)return e;const o=i,s=r-i-1,a=t%2===0;if(e<0){const l=o%2===0;return a===l?0:1}else{const l=s%2===0;return a===l?r-1:r-2}}}function BV(n){return n<0?0:n>255?255:n|0}function RT(n){return n<0?0:n>4294967295?4294967295:n|0}class C8i{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=RT(e);const i=this.values,r=this.prefixSum,o=t.length;return o===0?!1:(this.values=new Uint32Array(i.length+o),this.values.set(i.subarray(0,e),0),this.values.set(i.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(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=RT(e),t=RT(t),this.values[e]===t?!1:(this.values[e]=t,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,t){e=RT(e),t=RT(t);const i=this.values,r=this.prefixSum;if(e>=i.length)return!1;const o=i.length-e;return t>=o&&(t=o),t===0?!1:(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.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(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=RT(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,r=0,o=0,s=0;for(;t<=i;)if(r=t+(i-t)/2|0,o=this.prefixSum[r],s=o-this.values[r],e<s)i=r-1;else if(e>=o)t=r+1;else break;return new XUe(r,e-s)}}class w8i{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(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new XUe(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=TU(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 i=this._values[e],r=e>0?this._prefixSum[e-1]:0;this._prefixSum[e]=r+i;for(let o=0;o<i;o++)this._indexBySum[r+o]=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 XUe{constructor(e,t){this.index=e,this.remainder=t,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}}class S8i{constructor(e,t,i,r){this._uri=e,this._lines=t,this._eol=i,this._versionId=r,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}get version(){return this._versionId}getText(){return this._cachedTextValue===null&&(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 i of t)this._acceptDeleteRange(i.range),this._acceptInsertText(new Ce(i.range.startLineNumber,i.range.startColumn),i.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){const e=this._eol.length,t=this._lines.length,i=new Uint32Array(t);for(let r=0;r<t;r++)i[r]=this._lines[r].length+e;this._lineStarts=new C8i(i)}}_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){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));return}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)}_acceptInsertText(e,t){if(t.length===0)return;const i=ab(t);if(i.length===1){this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+i[0]+this._lines[e.lineNumber-1].substring(e.column-1));return}i[i.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)+i[0]);const r=new Uint32Array(i.length-1);for(let o=1;o<i.length;o++)this._lines.splice(e.lineNumber+o-1,0,i[o]),r[o-1]=i[o].length+this._eol.length;this._lineStarts&&this._lineStarts.insertValues(e.lineNumber,r)}}class EA{constructor(e){const t=BV(e);this._defaultValue=t,this._asciiMap=EA._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){const t=new Uint8Array(256);return t.fill(e),t}set(e,t){const i=BV(t);e>=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class $V{constructor(){this._actual=new EA(0)}add(e){this._actual.set(e,1)}has(e){return this._actual.get(e)===1}clear(){return this._actual.clear()}}class E8i{constructor(e,t,i){const r=new Uint8Array(e*t);for(let o=0,s=e*t;o<s;o++)r[o]=i;this._data=r,this.rows=e,this.cols=t}get(e,t){return this._data[e*this.cols+t]}set(e,t,i){this._data[e*this.cols+t]=i}}class x8i{constructor(e){let t=0,i=0;for(let o=0,s=e.length;o<s;o++){const[a,l,c]=e[o];l>t&&(t=l),a>i&&(i=a),c>i&&(i=c)}t++,i++;const r=new E8i(i,t,0);for(let o=0,s=e.length;o<s;o++){const[a,l,c]=e[o];r.set(a,l,c)}this._states=r,this._maxCharCode=t}nextState(e,t){return t<0||t>=this._maxCharCode?0:this._states.get(e,t)}}let gZ=null;function k8i(){return gZ===null&&(gZ=new x8i([[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]])),gZ}let BR=null;function T8i(){if(BR===null){BR=new EA(0);const n=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;t<n.length;t++)BR.set(n.charCodeAt(t),1);const e=".,;:";for(let t=0;t<e.length;t++)BR.set(e.charCodeAt(t),2)}return BR}class VV{static _createLink(e,t,i,r,o){let s=o-1;do{const a=t.charCodeAt(s);if(e.get(a)!==2)break;s--}while(s>r);if(r>0){const a=t.charCodeAt(r-1),l=t.charCodeAt(s);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&s--}return{range:{startLineNumber:i,startColumn:r+1,endLineNumber:i,endColumn:s+2},url:t.substring(r,s+1)}}static computeLinks(e,t=k8i()){const i=T8i(),r=[];for(let o=1,s=e.getLineCount();o<=s;o++){const a=e.getLineContent(o),l=a.length;let c=0,u=0,d=0,h=1,g=!1,p=!1,m=!1,_=!1;for(;c<l;){let v=!1;const b=a.charCodeAt(c);if(h===13){let y;switch(b){case 40:g=!0,y=0;break;case 41:y=g?0:1;break;case 91:m=!0,p=!0,y=0;break;case 93:m=!1,y=p?0:1;break;case 123:_=!0,y=0;break;case 125:y=_?0:1;break;case 39:case 34:case 96:d===b?y=1:d===39||d===34||d===96?y=0:y=1;break;case 42:y=d===42?1:0;break;case 124:y=d===124?1:0;break;case 32:y=m?0:1;break;default:y=i.get(b)}y===1&&(r.push(VV._createLink(i,a,o,u,c)),v=!0)}else if(h===12){let y;b===91?(p=!0,y=0):y=i.get(b),y===1?v=!0:h=13}else h=t.nextState(h,b),h===0&&(v=!0);v&&(h=1,g=!1,p=!1,_=!1,u=c+1,d=b),c++}h===13&&r.push(VV._createLink(i,a,o,u,l))}return r}}function I8i(n){return!n||typeof n.getLineCount!="function"||typeof n.getLineContent!="function"?[]:VV.computeLinks(n)}class ose{constructor(){this._defaultValueSet=[["true","false"],["True","False"],["Private","Public","Friend","ReadOnly","Partial","Protected","WriteOnly"],["public","protected","private"]]}navigateValueSet(e,t,i,r,o){if(e&&t){const s=this.doNavigateValueSet(t,o);if(s)return{range:e,value:s}}if(i&&r){const s=this.doNavigateValueSet(r,o);if(s)return{range:i,value:s}}return null}doNavigateValueSet(e,t){const i=this.numberReplace(e,t);return i!==null?i:this.textReplace(e,t)}numberReplace(e,t){const i=Math.pow(10,e.length-(e.lastIndexOf(".")+1));let r=Number(e);const o=parseFloat(e);return!isNaN(r)&&!isNaN(o)&&r===o?r===0&&!t?null:(r=Math.floor(r*i),r+=t?i:-i,String(r/i)):null}textReplace(e,t){return this.valueSetsReplace(this._defaultValueSet,e,t)}valueSetsReplace(e,t,i){let r=null;for(let o=0,s=e.length;r===null&&o<s;o++)r=this.valueSetReplace(e[o],t,i);return r}valueSetReplace(e,t,i){let r=e.indexOf(t);return r>=0?(r+=i?1:-1,r<0?r=e.length-1:r%=e.length,e[r]):null}}ose.INSTANCE=new ose;class L8i extends EA{constructor(e){super(0);for(let t=0,i=e.length;t<i;t++)this.set(e.charCodeAt(t),2);this.set(32,1),this.set(9,1)}}function D8i(n){const e={};return t=>(e.hasOwnProperty(t)||(e[t]=n(t)),e[t])}const xg=D8i(n=>new L8i(n));var ff;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(ff||(ff={}));var LL;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(LL||(LL={}));var rh;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(rh||(rh={}));var r_;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(r_||(r_={}));class R8{get originalIndentSize(){return this._indentSizeIsTabSize?"tabSize":this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,e.tabSize|0),e.indentSize==="tabSize"?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,e.indentSize|0),this._indentSizeIsTabSize=!1),this.insertSpaces=!!e.insertSpaces,this.defaultEOL=e.defaultEOL|0,this.trimAutoWhitespace=!!e.trimAutoWhitespace,this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&tf(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 LM{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}function A8i(n){return n&&typeof n.read=="function"}class pZ{constructor(e,t,i,r,o,s){this.identifier=e,this.range=t,this.text=i,this.forceMoveMarkers=r,this.isAutoWhitespaceEdit=o,this._isTracked=s}}class R8i{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}class N8i{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}function O8i(n){return!n.isTooLargeForSyncing()&&!n.isForSimpleWidget}const P8i=999;class KS{constructor(e,t,i,r){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=r}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=M8i(this.searchString):e=this.searchString.indexOf(`
`)>=0;let t=null;try{t=Zje(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new R8i(t,this.wordSeparators?xg(this.wordSeparators):null,i?this.searchString:null)}}function M8i(n){if(!n||n.length===0)return!1;for(let e=0,t=n.length;e<t;e++){const i=n.charCodeAt(e);if(i===10)return!0;if(i===92){if(e++,e>=t)break;const r=n.charCodeAt(e);if(r===110||r===114||r===87)return!0}}return!1}function oE(n,e,t){if(!t)return new LM(n,null);const i=[];for(let r=0,o=e.length;r<o;r++)i[r]=e[r];return new LM(n,i)}class ZLe{constructor(e){const t=[];let i=0;for(let r=0,o=e.length;r<o;r++)e.charCodeAt(r)===10&&(t[i++]=r);this._lineFeedsOffsets=t}findLineFeedCountBeforeOffset(e){const t=this._lineFeedsOffsets;let i=0,r=t.length-1;if(r===-1||e<=t[0])return 0;for(;i<r;){const o=i+((r-i)/2>>0);t[o]>=e?r=o-1:t[o+1]>=e?(i=o,r=o):i=o+1}return i+1}}class wB{static findMatches(e,t,i,r,o){const s=t.parseSearchRequest();return s?s.regex.multiline?this._doFindMatchesMultiline(e,i,new FI(s.wordSeparators,s.regex),r,o):this._doFindMatchesLineByLine(e,i,s,r,o):[]}static _getMultilineMatchRange(e,t,i,r,o,s){let a,l=0;r?(l=r.findLineFeedCountBeforeOffset(o),a=t+o+l):a=t+o;let c;if(r){const g=r.findLineFeedCountBeforeOffset(o+s.length)-l;c=a+s.length+g}else c=a+s.length;const u=e.getPositionAt(a),d=e.getPositionAt(c);return new q(u.lineNumber,u.column,d.lineNumber,d.column)}static _doFindMatchesMultiline(e,t,i,r,o){const s=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r
`?new ZLe(a):null,c=[];let u=0,d;for(i.reset(0);d=i.next(a);)if(c[u++]=oE(this._getMultilineMatchRange(e,s,a,l,d.index,d[0]),d,r),u>=o)return c;return c}static _doFindMatchesLineByLine(e,t,i,r,o){const s=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,s,r,o),s}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,s,r,o);for(let c=t.startLineNumber+1;c<t.endLineNumber&&a<o;c++)a=this._findMatchesInLine(i,e.getLineContent(c),c,0,a,s,r,o);if(a<o){const c=e.getLineContent(t.endLineNumber).substring(0,t.endColumn-1);a=this._findMatchesInLine(i,c,t.endLineNumber,0,a,s,r,o)}return s}static _findMatchesInLine(e,t,i,r,o,s,a,l){const c=e.wordSeparators;if(!a&&e.simpleSearch){const h=e.simpleSearch,g=h.length,p=t.length;let m=-g;for(;(m=t.indexOf(h,m+g))!==-1;)if((!c||jme(c,t,p,m,g))&&(s[o++]=new LM(new q(i,m+1+r,i,m+1+g+r),null),o>=l))return o;return o}const u=new FI(e.wordSeparators,e.regex);let d;u.reset(0);do if(d=u.next(t),d&&(s[o++]=oE(new q(i,d.index+1+r,i,d.index+1+d[0].length+r),d,a),o>=l))return o;while(d);return o}static findNextMatch(e,t,i,r){const o=t.parseSearchRequest();if(!o)return null;const s=new FI(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,s,r):this._doFindNextMatchLineByLine(e,i,s,r)}static _doFindNextMatchMultiline(e,t,i,r){const o=new Ce(t.lineNumber,1),s=e.getOffsetAt(o),a=e.getLineCount(),l=e.getValueInRange(new q(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r
`?new ZLe(l):null;i.reset(t.column-1);const u=i.next(l);return u?oE(this._getMultilineMatchRange(e,s,l,c,u.index,u[0]),u,r):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new Ce(1,1),i,r):null}static _doFindNextMatchLineByLine(e,t,i,r){const o=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s),l=this._findFirstMatchInLine(i,a,s,t.column,r);if(l)return l;for(let c=1;c<=o;c++){const u=(s+c-1)%o,d=e.getLineContent(u+1),h=this._findFirstMatchInLine(i,d,u+1,1,r);if(h)return h}return null}static _findFirstMatchInLine(e,t,i,r,o){e.reset(r-1);const s=e.next(t);return s?oE(new q(i,s.index+1,i,s.index+1+s[0].length),s,o):null}static findPreviousMatch(e,t,i,r){const o=t.parseSearchRequest();if(!o)return null;const s=new FI(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,s,r):this._doFindPreviousMatchLineByLine(e,i,s,r)}static _doFindPreviousMatchMultiline(e,t,i,r){const o=this._doFindMatchesMultiline(e,new q(1,1,t.lineNumber,t.column),i,r,10*P8i);if(o.length>0)return o[o.length-1];const s=e.getLineCount();return t.lineNumber!==s||t.column!==e.getLineMaxColumn(s)?this._doFindPreviousMatchMultiline(e,new Ce(s,e.getLineMaxColumn(s)),i,r):null}static _doFindPreviousMatchLineByLine(e,t,i,r){const o=e.getLineCount(),s=t.lineNumber,a=e.getLineContent(s).substring(0,t.column-1),l=this._findLastMatchInLine(i,a,s,r);if(l)return l;for(let c=1;c<=o;c++){const u=(o+s-c-1)%o,d=e.getLineContent(u+1),h=this._findLastMatchInLine(i,d,u+1,r);if(h)return h}return null}static _findLastMatchInLine(e,t,i,r){let o=null,s;for(e.reset(0);s=e.next(t);)o=oE(new q(i,s.index+1,i,s.index+1+s[0].length),s,r);return o}}function F8i(n,e,t,i,r){if(i===0)return!0;const o=e.charCodeAt(i-1);if(n.get(o)!==0||o===13||o===10)return!0;if(r>0){const s=e.charCodeAt(i);if(n.get(s)!==0)return!0}return!1}function B8i(n,e,t,i,r){if(i+r===t)return!0;const o=e.charCodeAt(i+r);if(n.get(o)!==0||o===13||o===10)return!0;if(r>0){const s=e.charCodeAt(i+r-1);if(n.get(s)!==0)return!0}return!1}function jme(n,e,t,i,r){return F8i(n,e,t,i,r)&&B8i(n,e,t,i,r)}class FI{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 i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(i=this._searchRegex.exec(e),!i))return null;const r=i.index,o=i[0].length;if(r===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){AV(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=r,this._prevMatchLength=o,!this._wordSeparators||jme(this._wordSeparators,e,t,r,o))return i}while(i);return null}}class Ume{static computeUnicodeHighlights(e,t,i){const r=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),s=new JLe(t),a=s.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${$8i(Array.from(a))}`,"g");const c=new FI(null,l),u=[];let d=!1,h,g=0,p=0,m=0;e:for(let _=r,v=o;_<=v;_++){const b=e.getLineContent(_),y=b.length;c.reset(0);do if(h=c.next(b),h){let C=h.index,x=h.index+h[0].length;if(C>0){const D=b.charCodeAt(C-1);Za(D)&&C--}if(x+1<y){const D=b.charCodeAt(x-1);Za(D)&&x++}const k=b.substring(C,x);let I=vM(C+1,bme,b,0);I&&I.endColumn<=C+1&&(I=null);const L=s.shouldHighlightNonBasicASCII(k,I?I.word:null);if(L!==0){L===3?g++:L===2?p++:L===1?m++:VU();const D=1e3;if(u.length>=D){d=!0;break e}u.push(new q(_,C+1,_,x+1))}}while(h)}return{ranges:u,hasMore:d,ambiguousCharacterCount:g,invisibleCharacterCount:p,nonBasicAsciiCharacterCount:m}}static computeUnicodeHighlightReason(e,t){const i=new JLe(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const o=e.codePointAt(0),s=i.ambiguousCharacters.getPrimaryConfusable(o),a=Nx.getLocales().filter(l=>!Nx.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(o));return{kind:0,confusableWith:String.fromCodePoint(s),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function $8i(n,e){return`[${hf(n.map(i=>String.fromCodePoint(i)).join(""))}]`}class JLe{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=Nx.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of Xv.codePoints)eDe(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 i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return 0;if(this.options.nonBasicASCII)return 1;let r=!1,o=!1;if(t)for(const s of t){const a=s.codePointAt(0),l=f5(s);r=r||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!Xv.isInvisibleCharacter(a)&&(o=!0)}return!r&&o?0:this.options.invisibleCharacters&&!eDe(e)&&Xv.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function eDe(n){return n===" "||n===`
`||n===" "}class N8{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class ZUe{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class Bi{static addRange(e,t){let i=0;for(;i<t.length&&t[i].endExclusive<e.start;)i++;let r=i;for(;r<t.length&&t[r].start<=e.endExclusive;)r++;if(i===r)t.splice(i,0,e);else{const o=Math.min(e.start,t[i].start),s=Math.max(e.endExclusive,t[r-1].endExclusive);t.splice(i,r-i,new Bi(o,s))}}static tryCreate(e,t){if(!(e>t))return new Bi(e,t)}static ofLength(e){return new Bi(0,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new ya(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Bi(this.start+e,this.endExclusive+e)}deltaStart(e){return new Bi(this.start+e,this.endExclusive)}deltaEnd(e){return new Bi(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new Bi(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){const t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);if(t<=i)return new Bi(t,i)}slice(e){return e.slice(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new ya(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new ya(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;t<this.endExclusive;t++)e(t)}}class qme{constructor(){this._sortedRanges=[]}addRange(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<e.start;)t++;let i=t;for(;i<this._sortedRanges.length&&this._sortedRanges[i].start<=e.endExclusive;)i++;if(t===i)this._sortedRanges.splice(t,0,e);else{const r=Math.min(e.start,this._sortedRanges[t].start),o=Math.max(e.endExclusive,this._sortedRanges[i-1].endExclusive);this._sortedRanges.splice(t,i-t,new Bi(r,o))}}toString(){return this._sortedRanges.map(e=>e.toString()).join(", ")}intersectsStrict(e){let t=0;for(;t<this._sortedRanges.length&&this._sortedRanges[t].endExclusive<=e.start;)t++;return t<this._sortedRanges.length&&this._sortedRanges[t].start<e.endExclusive}intersectWithRange(e){const t=new qme;for(const i of this._sortedRanges){const r=i.intersect(e);r&&t.addRange(r)}return t}intersectWithRangeLength(e){return this.intersectWithRange(e).length}get length(){return this._sortedRanges.reduce((e,t)=>e+t.length,0)}}function HV(n,e,t){const i=V8i(n,e);if(i!==-1)return n[i]}function V8i(n,e,t=n.length-1){for(let i=t;i>=0;i--){const r=n[i];if(e(r))return i}return-1}function DM(n,e){const t=AM(n,e);return t===-1?void 0:n[t]}function AM(n,e,t=0,i=n.length){let r=t,o=i;for(;r<o;){const s=Math.floor((r+o)/2);e(n[s])?r=s+1:o=s}return r-1}function H8i(n,e){const t=RM(n,e);return t===n.length?void 0:n[t]}function RM(n,e,t=0,i=n.length){let r=t,o=i;for(;r<o;){const s=Math.floor((r+o)/2);e(n[s])?o=s:r=s+1}return r}class m5{constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(e){if(m5.assertInvariants){if(this._prevFindLastPredicate){for(const i of this._array)if(this._prevFindLastPredicate(i)&&!e(i))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=e}const t=AM(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=t+1,t===-1?void 0:this._array[t]}}m5.assertInvariants=!1;function JUe(n,e){if(n.length===0)return;let t=n[0];for(let i=1;i<n.length;i++){const r=n[i];e(r,t)>0&&(t=r)}return t}function W8i(n,e){if(n.length===0)return;let t=n[0];for(let i=1;i<n.length;i++){const r=n[i];e(r,t)>=0&&(t=r)}return t}function z8i(n,e){return JUe(n,(t,i)=>-e(t,i))}function j8i(n,e){if(n.length===0)return-1;let t=0;for(let i=1;i<n.length;i++){const r=n[i];e(r,n[t])>0&&(t=i)}return t}function U8i(n,e){for(const t of n){const i=e(t);if(i!==void 0)return i}}let zi=class u1{static fromRange(e){return new u1(e.startLineNumber,e.endLineNumber)}static joinMany(e){if(e.length===0)return[];let t=new Cv(e[0].slice());for(let i=1;i<e.length;i++)t=t.getUnion(new Cv(e[i].slice()));return t.ranges}static ofLength(e,t){return new u1(e,e+t)}static deserialize(e){return new u1(e[0],e[1])}constructor(e,t){if(e>t)throw new ya(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&e<this.endLineNumberExclusive}get isEmpty(){return this.startLineNumber===this.endLineNumberExclusive}delta(e){return new u1(this.startLineNumber+e,this.endLineNumberExclusive+e)}deltaLength(e){return new u1(this.startLineNumber,this.endLineNumberExclusive+e)}get length(){return this.endLineNumberExclusive-this.startLineNumber}join(e){return new u1(Math.min(this.startLineNumber,e.startLineNumber),Math.max(this.endLineNumberExclusive,e.endLineNumberExclusive))}toString(){return`[${this.startLineNumber},${this.endLineNumberExclusive})`}intersect(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumberExclusive,e.endLineNumberExclusive);if(t<=i)return new u1(t,i)}intersectsStrict(e){return this.startLineNumber<e.endLineNumberExclusive&&e.startLineNumber<this.endLineNumberExclusive}overlapOrTouch(e){return this.startLineNumber<=e.endLineNumberExclusive&&e.startLineNumber<=this.endLineNumberExclusive}equals(e){return this.startLineNumber===e.startLineNumber&&this.endLineNumberExclusive===e.endLineNumberExclusive}toInclusiveRange(){return this.isEmpty?null:new q(this.startLineNumber,1,this.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER)}toExclusiveRange(){return new q(this.startLineNumber,1,this.endLineNumberExclusive,1)}mapToLineArray(e){const t=[];for(let i=this.startLineNumber;i<this.endLineNumberExclusive;i++)t.push(e(i));return t}forEach(e){for(let t=this.startLineNumber;t<this.endLineNumberExclusive;t++)e(t)}serialize(){return[this.startLineNumber,this.endLineNumberExclusive]}includes(e){return this.startLineNumber<=e&&e<this.endLineNumberExclusive}toOffsetRange(){return new Bi(this.startLineNumber-1,this.endLineNumberExclusive-1)}};class Cv{constructor(e=[]){this._normalizedRanges=e}get ranges(){return this._normalizedRanges}addRange(e){if(e.length===0)return;const t=RM(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=AM(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const r=this._normalizedRanges[t];this._normalizedRanges[t]=r.join(e)}else{const r=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,r)}}contains(e){const t=DM(this._normalizedRanges,i=>i.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let i=0,r=0,o=null;for(;i<this._normalizedRanges.length||r<e._normalizedRanges.length;){let s=null;if(i<this._normalizedRanges.length&&r<e._normalizedRanges.length){const a=this._normalizedRanges[i],l=e._normalizedRanges[r];a.startLineNumber<l.startLineNumber?(s=a,i++):(s=l,r++)}else i<this._normalizedRanges.length?(s=this._normalizedRanges[i],i++):(s=e._normalizedRanges[r],r++);o===null?o=s:o.endLineNumberExclusive>=s.startLineNumber?o=new zi(o.startLineNumber,Math.max(o.endLineNumberExclusive,s.endLineNumberExclusive)):(t.push(o),o=s)}return o!==null&&t.push(o),new Cv(t)}subtractFrom(e){const t=RM(this._normalizedRanges,s=>s.endLineNumberExclusive>=e.startLineNumber),i=AM(this._normalizedRanges,s=>s.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new Cv([e]);const r=[];let o=e.startLineNumber;for(let s=t;s<i;s++){const a=this._normalizedRanges[s];a.startLineNumber>o&&r.push(new zi(o,a.startLineNumber)),o=a.endLineNumberExclusive}return o<e.endLineNumberExclusive&&r.push(new zi(o,e.endLineNumberExclusive)),new Cv(r)}toString(){return this._normalizedRanges.map(e=>e.toString()).join(", ")}getIntersection(e){const t=[];let i=0,r=0;for(;i<this._normalizedRanges.length&&r<e._normalizedRanges.length;){const o=this._normalizedRanges[i],s=e._normalizedRanges[r],a=o.intersect(s);a&&!a.isEmpty&&t.push(a),o.endLineNumberExclusive<s.endLineNumberExclusive?i++:r++}return new Cv(t)}getWithDelta(e){return new Cv(this._normalizedRanges.map(t=>t.delta(e)))}}class cb{static inverse(e,t,i){const r=[];let o=1,s=1;for(const l of e){const c=new kg(new zi(o,l.original.startLineNumber),new zi(s,l.modified.startLineNumber),void 0);c.modified.isEmpty||r.push(c),o=l.original.endLineNumberExclusive,s=l.modified.endLineNumberExclusive}const a=new kg(new zi(o,t+1),new zi(s,i+1),void 0);return a.modified.isEmpty||r.push(a),r}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new cb(this.modified,this.original)}join(e){return new cb(this.original.join(e.original),this.modified.join(e.modified))}}class kg extends cb{constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){var e;return new kg(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}}class hw{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new hw(this.modifiedRange,this.originalRange)}}const q8i=3;class K8i{computeDiff(e,t,i){var r;const s=new Q8i(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let l=null;for(const c of s.changes){let u;c.originalEndLineNumber===0?u=new zi(c.originalStartLineNumber+1,c.originalStartLineNumber+1):u=new zi(c.originalStartLineNumber,c.originalEndLineNumber+1);let d;c.modifiedEndLineNumber===0?d=new zi(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):d=new zi(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new kg(u,d,(r=c.charChanges)===null||r===void 0?void 0:r.map(g=>new hw(new q(g.originalStartLineNumber,g.originalStartColumn,g.originalEndLineNumber,g.originalEndColumn),new q(g.modifiedStartLineNumber,g.modifiedStartColumn,g.modifiedEndLineNumber,g.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===h.modified.startLineNumber||l.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new kg(l.original.join(h.original),l.modified.join(h.modified),l.innerChanges&&h.innerChanges?l.innerChanges.concat(h.innerChanges):void 0),a.pop()),a.push(h),l=h}return xM(()=>uUe(a,(c,u)=>u.original.startLineNumber-c.original.endLineNumberExclusive===u.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive<u.original.startLineNumber&&c.modified.endLineNumberExclusive<u.modified.startLineNumber)),new N8(a,[],s.quitEarly)}}function eqe(n,e,t,i){return new yv(n,e,t).ComputeDiff(i)}let tDe=class{constructor(e){const t=[],i=[];for(let r=0,o=e.length;r<o;r++)t[r]=sse(e[r],1),i[r]=ase(e[r],1);this.lines=e,this._startColumns=t,this._endColumns=i}getElements(){const e=[];for(let t=0,i=this.lines.length;t<i;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,i){const r=[],o=[],s=[];let a=0;for(let l=t;l<=i;l++){const c=this.lines[l],u=e?this._startColumns[l]:1,d=e?this._endColumns[l]:c.length+1;for(let h=u;h<d;h++)r[a]=c.charCodeAt(h-1),o[a]=l+1,s[a]=h,a++;!e&&l<i&&(r[a]=10,o[a]=l+1,s[a]=c.length+1,a++)}return new G8i(r,o,s)}};class G8i{constructor(e,t,i){this._charCodes=e,this._lineNumbers=t,this._columns=i}toString(){return"["+this._charCodes.map((e,t)=>(e===10?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===10?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===10?1:this._columns[e]+1)}}class DL{constructor(e,t,i,r,o,s,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=r,this.modifiedStartLineNumber=o,this.modifiedStartColumn=s,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,i){const r=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),s=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),l=i.getStartLineNumber(e.modifiedStart),c=i.getStartColumn(e.modifiedStart),u=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),d=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new DL(r,o,s,a,l,c,u,d)}}function Y8i(n){if(n.length<=1)return n;const e=[n[0]];let t=e[0];for(let i=1,r=n.length;i<r;i++){const o=n[i],s=o.originalStart-(t.originalStart+t.originalLength),a=o.modifiedStart-(t.modifiedStart+t.modifiedLength);Math.min(s,a)<q8i?(t.originalLength=o.originalStart+o.originalLength-t.originalStart,t.modifiedLength=o.modifiedStart+o.modifiedLength-t.modifiedStart):(e.push(o),t=o)}return e}class NO{constructor(e,t,i,r,o){this.originalStartLineNumber=e,this.originalEndLineNumber=t,this.modifiedStartLineNumber=i,this.modifiedEndLineNumber=r,this.charChanges=o}static createFromDiffResult(e,t,i,r,o,s,a){let l,c,u,d,h;if(t.originalLength===0?(l=i.getStartLineNumber(t.originalStart)-1,c=0):(l=i.getStartLineNumber(t.originalStart),c=i.getEndLineNumber(t.originalStart+t.originalLength-1)),t.modifiedLength===0?(u=r.getStartLineNumber(t.modifiedStart)-1,d=0):(u=r.getStartLineNumber(t.modifiedStart),d=r.getEndLineNumber(t.modifiedStart+t.modifiedLength-1)),s&&t.originalLength>0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const g=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),p=r.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(g.getElements().length>0&&p.getElements().length>0){let m=eqe(g,p,o,!0).changes;a&&(m=Y8i(m)),h=[];for(let _=0,v=m.length;_<v;_++)h.push(DL.createFromDiffChange(m[_],g,p))}}return new NO(l,c,u,d,h)}}class Q8i{constructor(e,t,i){this.shouldComputeCharChanges=i.shouldComputeCharChanges,this.shouldPostProcessCharChanges=i.shouldPostProcessCharChanges,this.shouldIgnoreTrimWhitespace=i.shouldIgnoreTrimWhitespace,this.shouldMakePrettyDiff=i.shouldMakePrettyDiff,this.originalLines=e,this.modifiedLines=t,this.original=new tDe(e),this.modified=new tDe(t),this.continueLineDiff=nDe(i.maxComputationTime),this.continueCharDiff=nDe(i.maxComputationTime===0?0:Math.min(i.maxComputationTime,5e3))}computeDiff(){if(this.original.lines.length===1&&this.original.lines[0].length===0)return this.modified.lines.length===1&&this.modified.lines[0].length===0?{quitEarly:!1,changes:[]}:{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:1,modifiedStartLineNumber:1,modifiedEndLineNumber:this.modified.lines.length,charChanges:void 0}]};if(this.modified.lines.length===1&&this.modified.lines[0].length===0)return{quitEarly:!1,changes:[{originalStartLineNumber:1,originalEndLineNumber:this.original.lines.length,modifiedStartLineNumber:1,modifiedEndLineNumber:1,charChanges:void 0}]};const e=eqe(this.original,this.modified,this.continueLineDiff,this.shouldMakePrettyDiff),t=e.changes,i=e.quitEarly;if(this.shouldIgnoreTrimWhitespace){const a=[];for(let l=0,c=t.length;l<c;l++)a.push(NO.createFromDiffResult(this.shouldIgnoreTrimWhitespace,t[l],this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges));return{quitEarly:i,changes:a}}const r=[];let o=0,s=0;for(let a=-1,l=t.length;a<l;a++){const c=a+1<l?t[a+1]:null,u=c?c.originalStart:this.originalLines.length,d=c?c.modifiedStart:this.modifiedLines.length;for(;o<u&&s<d;){const h=this.originalLines[o],g=this.modifiedLines[s];if(h!==g){{let p=sse(h,1),m=sse(g,1);for(;p>1&&m>1;){const _=h.charCodeAt(p-2),v=g.charCodeAt(m-2);if(_!==v)break;p--,m--}(p>1||m>1)&&this._pushTrimWhitespaceCharChange(r,o+1,1,p,s+1,1,m)}{let p=ase(h,1),m=ase(g,1);const _=h.length+1,v=g.length+1;for(;p<_&&m<v;){const b=h.charCodeAt(p-1),y=h.charCodeAt(m-1);if(b!==y)break;p++,m++}(p<_||m<v)&&this._pushTrimWhitespaceCharChange(r,o+1,p,_,s+1,m,v)}}o++,s++}c&&(r.push(NO.createFromDiffResult(this.shouldIgnoreTrimWhitespace,c,this.original,this.modified,this.continueCharDiff,this.shouldComputeCharChanges,this.shouldPostProcessCharChanges)),o+=c.originalLength,s+=c.modifiedLength)}return{quitEarly:i,changes:r}}_pushTrimWhitespaceCharChange(e,t,i,r,o,s,a){if(this._mergeTrimWhitespaceCharChange(e,t,i,r,o,s,a))return;let l;this.shouldComputeCharChanges&&(l=[new DL(t,i,t,r,o,s,o,a)]),e.push(new NO(t,t,o,o,l))}_mergeTrimWhitespaceCharChange(e,t,i,r,o,s,a){const l=e.length;if(l===0)return!1;const c=e[l-1];return c.originalEndLineNumber===0||c.modifiedEndLineNumber===0?!1:c.originalEndLineNumber===t&&c.modifiedEndLineNumber===o?(this.shouldComputeCharChanges&&c.charChanges&&c.charChanges.push(new DL(t,i,t,r,o,s,o,a)),!0):c.originalEndLineNumber+1===t&&c.modifiedEndLineNumber+1===o?(c.originalEndLineNumber=t,c.modifiedEndLineNumber=o,this.shouldComputeCharChanges&&c.charChanges&&c.charChanges.push(new DL(t,i,t,r,o,s,o,a)),!0):!1}}function sse(n,e){const t=cu(n);return t===-1?e:t+1}function ase(n,e){const t=g_(n);return t===-1?e:t+2}function nDe(n){if(n===0)return()=>!0;const e=Date.now();return()=>Date.now()-e<n}class Qy{static trivial(e,t){return new Qy([new Bl(Bi.ofLength(e.length),Bi.ofLength(t.length))],!1)}static trivialTimedOut(e,t){return new Qy([new Bl(Bi.ofLength(e.length),Bi.ofLength(t.length))],!0)}constructor(e,t){this.diffs=e,this.hitTimeout=t}}class Bl{static invert(e,t){const i=[];return mje(e,(r,o)=>{i.push(Bl.fromOffsetPairs(r?r.getEndExclusives():Rv.zero,o?o.getStarts():new Rv(t,(r?r.seq2Range.endExclusive-r.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new Bl(new Bi(e.offset1,t.offset1),new Bi(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new Bl(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new Bl(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new Bl(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new Bl(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new Bl(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(!(!t||!i))return new Bl(t,i)}getStarts(){return new Rv(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Rv(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class Rv{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}}Rv.zero=new Rv(0,0);Rv.max=new Rv(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class NM{isValid(){return!0}}NM.instance=new NM;class X8i{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new ya("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime<this.timeout)&&this.valid){this.valid=!1;debugger}return this.valid}}class mZ{constructor(e,t){this.width=e,this.height=t,this.array=[],this.array=new Array(e*t)}get(e,t){return this.array[e+t*this.width]}set(e,t,i){this.array[e+t*this.width]=i}}function lse(n){return n===32||n===9}class ZD{static getKey(e){let t=this.chrKeys.get(e);return t===void 0&&(t=this.chrKeys.size,this.chrKeys.set(e,t)),t}constructor(e,t,i){this.range=e,this.lines=t,this.source=i,this.histogram=[];let r=0;for(let o=e.startLineNumber-1;o<e.endLineNumberExclusive-1;o++){const s=t[o];for(let l=0;l<s.length;l++){r++;const c=s[l],u=ZD.getKey(c);this.histogram[u]=(this.histogram[u]||0)+1}r++;const a=ZD.getKey(`
`);this.histogram[a]=(this.histogram[a]||0)+1}this.totalCount=r}computeSimilarity(e){var t,i;let r=0;const o=Math.max(this.histogram.length,e.histogram.length);for(let s=0;s<o;s++)r+=Math.abs(((t=this.histogram[s])!==null&&t!==void 0?t:0)-((i=e.histogram[s])!==null&&i!==void 0?i:0));return 1-r/(this.totalCount+e.totalCount)}}ZD.chrKeys=new Map;class Z8i{compute(e,t,i=NM.instance,r){if(e.length===0||t.length===0)return Qy.trivial(e,t);const o=new mZ(e.length,t.length),s=new mZ(e.length,t.length),a=new mZ(e.length,t.length);for(let p=0;p<e.length;p++)for(let m=0;m<t.length;m++){if(!i.isValid())return Qy.trivialTimedOut(e,t);const _=p===0?0:o.get(p-1,m),v=m===0?0:o.get(p,m-1);let b;e.getElement(p)===t.getElement(m)?(p===0||m===0?b=0:b=o.get(p-1,m-1),p>0&&m>0&&s.get(p-1,m-1)===3&&(b+=a.get(p-1,m-1)),b+=r?r(p,m):1):b=-1;const y=Math.max(_,v,b);if(y===b){const C=p>0&&m>0?a.get(p-1,m-1):0;a.set(p,m,C+1),s.set(p,m,3)}else y===_?(a.set(p,m,0),s.set(p,m,1)):y===v&&(a.set(p,m,0),s.set(p,m,2));o.set(p,m,y)}const l=[];let c=e.length,u=t.length;function d(p,m){(p+1!==c||m+1!==u)&&l.push(new Bl(new Bi(p+1,c),new Bi(m+1,u))),c=p,u=m}let h=e.length-1,g=t.length-1;for(;h>=0&&g>=0;)s.get(h,g)===3?(d(h,g),h--,g--):s.get(h,g)===1?h--:g--;return d(-1,-1),l.reverse(),new Qy(l,!1)}}class tqe{compute(e,t,i=NM.instance){if(e.length===0||t.length===0)return Qy.trivial(e,t);const r=e,o=t;function s(m,_){for(;m<r.length&&_<o.length&&r.getElement(m)===o.getElement(_);)m++,_++;return m}let a=0;const l=new J8i;l.set(0,s(0,0));const c=new e9i;c.set(0,l.get(0)===0?null:new iDe(null,0,0,l.get(0)));let u=0;e:for(;;){if(a++,!i.isValid())return Qy.trivialTimedOut(r,o);const m=-Math.min(a,o.length+a%2),_=Math.min(a,r.length+a%2);for(u=m;u<=_;u+=2){const v=u===_?-1:l.get(u+1),b=u===m?-1:l.get(u-1)+1,y=Math.min(Math.max(v,b),r.length),C=y-u;if(y>r.length||C>o.length)continue;const x=s(y,C);l.set(u,x);const k=y===v?c.get(u+1):c.get(u-1);if(c.set(u,x!==y?new iDe(k,y,C,x-y):k),l.get(u)===r.length&&l.get(u)-u===o.length)break e}}let d=c.get(u);const h=[];let g=r.length,p=o.length;for(;;){const m=d?d.x+d.length:0,_=d?d.y+d.length:0;if((m!==g||_!==p)&&h.push(new Bl(new Bi(m,g),new Bi(_,p))),!d)break;g=d.x,p=d.y,d=d.prev}return h.reverse(),new Qy(h,!1)}}class iDe{constructor(e,t,i,r){this.prev=e,this.x=t,this.y=i,this.length=r}}class J8i{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[e]=t}}}class e9i{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}var rDe,oDe;class t9i{constructor(e,t){this.uri=e,this.value=t}}function n9i(n){return Array.isArray(n)}class Rc{constructor(e,t){if(this[rDe]="ResourceMap",e instanceof Rc)this.map=new Map(e.map),this.toKey=t??Rc.defaultToKey;else if(n9i(e)){this.map=new Map,this.toKey=t??Rc.defaultToKey;for(const[i,r]of e)this.set(i,r)}else this.map=new Map,this.toKey=e??Rc.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new t9i(e,t)),this}get(e){var t;return(t=this.map.get(this.toKey(e)))===null||t===void 0?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){typeof t<"u"&&(e=e.bind(t));for(const[i,r]of this.map)e(r.value,r.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(rDe=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}Rc.defaultToKey=n=>n.toString();class i9i{constructor(){this[oDe]="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(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return t!==0&&this.touch(i,t),i.value}set(e,t,i=0){let r=this._map.get(e);if(r)r.value=t,i!==0&&this.touch(r,i);else{switch(r={key:e,value:t,next:void 0,previous:void 0},i){case 0:this.addItemLast(r);break;case 1:this.addItemFirst(r);break;case 2:this.addItemLast(r);break;default:this.addItemLast(r);break}this._map.set(e,r),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 i=this._state;let r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){const e=this,t=this._state;let i=this._head;const r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:i.key,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return r}values(){const e=this,t=this._state;let i=this._head;const r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:i.value,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return r}entries(){const e=this,t=this._state;let i=this._head;const r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:[i.key,i.value],done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return r}[(oDe=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");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,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.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(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;const i=e.next,r=e.previous;e===this._tail?(r.next=void 0,this._tail=r):(i.previous=r,r.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;const i=e.next,r=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=r,r.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}class eS extends i9i{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))}}class r9i{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,i]of e)this.set(t,i)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return t===void 0?!1:(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class Kme{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}get(e){const t=this.map.get(e);return t||new Set}}class WV{constructor(e,t,i){this.lines=e,this.considerWhitespaceChanges=i,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let r=!1;t.start>0&&t.endExclusive>=e.length&&(t=new Bi(t.start-1,t.endExclusive),r=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let o=this.lineRange.start;o<this.lineRange.endExclusive;o++){let s=e[o],a=0;if(r)a=s.length,s="",r=!1;else if(!i){const l=s.trimStart();a=s.length-l.length,s=l.trimEnd()}this.additionalOffsetByLine.push(a);for(let l=0;l<s.length;l++)this.elements.push(s.charCodeAt(l));o<e.length-1&&(this.elements.push(`
`.charCodeAt(0)),this.firstCharOffsetByLine[o-this.lineRange.start+1]=this.elements.length)}this.additionalOffsetByLine.push(0)}toString(){return`Slice: "${this.text}"`}get text(){return this.getText(new Bi(0,this.length))}getText(e){return this.elements.slice(e.start,e.endExclusive).map(t=>String.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=aDe(e>0?this.elements[e-1]:-1),i=aDe(e<this.elements.length?this.elements[e]:-1);if(t===6&&i===7)return 0;let r=0;return t!==i&&(r+=10,t===0&&i===1&&(r+=1)),r+=sDe(t),r+=sDe(i),r}translateOffset(e){if(this.lineRange.isEmpty)return new Ce(this.lineRange.start+1,1);const t=AM(this.firstCharOffsetByLine,i=>i<=e);return new Ce(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return q.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!_Z(this.elements[e]))return;let t=e;for(;t>0&&_Z(this.elements[t-1]);)t--;let i=e;for(;i<this.elements.length&&_Z(this.elements[i]);)i++;return new Bi(t,i)}countLinesIn(e){return this.translateOffset(e.endExclusive).lineNumber-this.translateOffset(e.start).lineNumber}isStronglyEqual(e,t){return this.elements[e]===this.elements[t]}extendToFullLines(e){var t,i;const r=(t=DM(this.firstCharOffsetByLine,s=>s<=e.start))!==null&&t!==void 0?t:0,o=(i=H8i(this.firstCharOffsetByLine,s=>e.endExclusive<=s))!==null&&i!==void 0?i:this.elements.length;return new Bi(r,o)}}function _Z(n){return n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57}const o9i={0:0,1:0,2:0,3:10,4:2,5:3,6:10,7:10};function sDe(n){return o9i[n]}function aDe(n){return n===10?7:n===13?6:lse(n)?5:n>=97&&n<=122?0:n>=65&&n<=90?1:n>=48&&n<=57?2:n===-1?3:4}function s9i(n,e,t,i,r,o){let{moves:s,excludedChanges:a}=a9i(n,e,t,o);if(!o.isValid())return[];const l=n.filter(u=>!a.has(u)),c=l9i(l,i,r,e,t,o);return Kre(s,c),s=c9i(s),s=s.filter(u=>u.original.toOffsetRange().slice(e).map(h=>h.trim()).join(`
`).length>=10),s=u9i(n,s),s}function a9i(n,e,t,i){const r=[],o=n.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new ZD(l.original,e,l)),s=new Set(n.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new ZD(l.modified,t,l))),a=new Set;for(const l of o){let c=-1,u;for(const d of s){const h=l.computeSimilarity(d);h>c&&(c=h,u=d)}if(c>.9&&u&&(s.delete(u),r.push(new cb(l.range,u.range)),a.add(l.source),a.add(u.source)),!i.isValid())return{moves:r,excludedChanges:a}}return{moves:r,excludedChanges:a}}function l9i(n,e,t,i,r,o){const s=[],a=new Kme;for(const h of n)for(let g=h.original.startLineNumber;g<h.original.endLineNumberExclusive-2;g++){const p=`${e[g-1]}:${e[g+1-1]}:${e[g+2-1]}`;a.add(p,{range:new zi(g,g+3)})}const l=[];n.sort(fg(h=>h.modified.startLineNumber,Gy));for(const h of n){let g=[];for(let p=h.modified.startLineNumber;p<h.modified.endLineNumberExclusive-2;p++){const m=`${t[p-1]}:${t[p+1-1]}:${t[p+2-1]}`,_=new zi(p,p+3),v=[];a.forEach(m,({range:b})=>{for(const C of g)if(C.originalLineRange.endLineNumberExclusive+1===b.endLineNumberExclusive&&C.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){C.originalLineRange=new zi(C.originalLineRange.startLineNumber,b.endLineNumberExclusive),C.modifiedLineRange=new zi(C.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),v.push(C);return}const y={modifiedLineRange:_,originalLineRange:b};l.push(y),v.push(y)}),g=v}if(!o.isValid())return[]}l.sort(yje(fg(h=>h.modifiedLineRange.length,Gy)));const c=new Cv,u=new Cv;for(const h of l){const g=h.modifiedLineRange.startLineNumber-h.originalLineRange.startLineNumber,p=c.subtractFrom(h.modifiedLineRange),m=u.subtractFrom(h.originalLineRange).getWithDelta(g),_=p.getIntersection(m);for(const v of _.ranges){if(v.length<3)continue;const b=v,y=v.delta(-g);s.push(new cb(y,b)),c.addRange(b),u.addRange(y)}}s.sort(fg(h=>h.original.startLineNumber,Gy));const d=new m5(n);for(let h=0;h<s.length;h++){const g=s[h],p=d.findLastMonotonous(k=>k.original.startLineNumber<=g.original.startLineNumber),m=DM(n,k=>k.modified.startLineNumber<=g.modified.startLineNumber),_=Math.max(g.original.startLineNumber-p.original.startLineNumber,g.modified.startLineNumber-m.modified.startLineNumber),v=d.findLastMonotonous(k=>k.original.startLineNumber<g.original.endLineNumberExclusive),b=DM(n,k=>k.modified.startLineNumber<g.modified.endLineNumberExclusive),y=Math.max(v.original.endLineNumberExclusive-g.original.endLineNumberExclusive,b.modified.endLineNumberExclusive-g.modified.endLineNumberExclusive);let C;for(C=0;C<_;C++){const k=g.original.startLineNumber-C-1,I=g.modified.startLineNumber-C-1;if(k>i.length||I>r.length||c.contains(I)||u.contains(k)||!lDe(i[k-1],r[I-1],o))break}C>0&&(u.addRange(new zi(g.original.startLineNumber-C,g.original.startLineNumber)),c.addRange(new zi(g.modified.startLineNumber-C,g.modified.startLineNumber)));let x;for(x=0;x<y;x++){const k=g.original.endLineNumberExclusive+x,I=g.modified.endLineNumberExclusive+x;if(k>i.length||I>r.length||c.contains(I)||u.contains(k)||!lDe(i[k-1],r[I-1],o))break}x>0&&(u.addRange(new zi(g.original.endLineNumberExclusive,g.original.endLineNumberExclusive+x)),c.addRange(new zi(g.modified.endLineNumberExclusive,g.modified.endLineNumberExclusive+x))),(C>0||x>0)&&(s[h]=new cb(new zi(g.original.startLineNumber-C,g.original.endLineNumberExclusive+x),new zi(g.modified.startLineNumber-C,g.modified.endLineNumberExclusive+x)))}return s}function lDe(n,e,t){if(n.trim()===e.trim())return!0;if(n.length>300&&e.length>300)return!1;const r=new tqe().compute(new WV([n],new Bi(0,1),!1),new WV([e],new Bi(0,1),!1),t);let o=0;const s=Bl.invert(r.diffs,n.length);for(const u of s)u.seq1Range.forEach(d=>{lse(n.charCodeAt(d))||o++});function a(u){let d=0;for(let h=0;h<n.length;h++)lse(u.charCodeAt(h))||d++;return d}const l=a(n.length>e.length?n:e);return o/l>.6&&l>10}function c9i(n){if(n.length===0)return n;n.sort(fg(t=>t.original.startLineNumber,Gy));const e=[n[0]];for(let t=1;t<n.length;t++){const i=e[e.length-1],r=n[t],o=r.original.startLineNumber-i.original.endLineNumberExclusive,s=r.modified.startLineNumber-i.modified.endLineNumberExclusive;if(o>=0&&s>=0&&o+s<=2){e[e.length-1]=i.join(r);continue}e.push(r)}return e}function u9i(n,e){const t=new m5(n);return e=e.filter(i=>{const r=t.findLastMonotonous(a=>a.original.endLineNumberExclusive<i.original.endLineNumberExclusive)||new cb(new zi(1,1),new zi(1,1)),o=DM(n,a=>a.modified.endLineNumberExclusive<i.modified.endLineNumberExclusive);return r!==o}),e}function cse(n,e,t){let i=t;return i=d9i(n,e,i),i=h9i(n,e,i),i}function d9i(n,e,t){if(t.length===0)return t;const i=[];i.push(t[0]);for(let o=1;o<t.length;o++){const s=i[i.length-1];let a=t[o];if(a.seq1Range.isEmpty||a.seq2Range.isEmpty){const l=a.seq1Range.start-s.seq1Range.endExclusive;let c;for(c=1;c<=l&&!(n.getElement(a.seq1Range.start-c)!==n.getElement(a.seq1Range.endExclusive-c)||e.getElement(a.seq2Range.start-c)!==e.getElement(a.seq2Range.endExclusive-c));c++);if(c--,c===l){i[i.length-1]=new Bl(new Bi(s.seq1Range.start,a.seq1Range.endExclusive-l),new Bi(s.seq2Range.start,a.seq2Range.endExclusive-l));continue}a=a.delta(-c)}i.push(a)}const r=[];for(let o=0;o<i.length-1;o++){const s=i[o+1];let a=i[o];if(a.seq1Range.isEmpty||a.seq2Range.isEmpty){const l=s.seq1Range.start-a.seq1Range.endExclusive;let c;for(c=0;c<l&&!(!n.isStronglyEqual(a.seq1Range.start+c,a.seq1Range.endExclusive+c)||!e.isStronglyEqual(a.seq2Range.start+c,a.seq2Range.endExclusive+c));c++);if(c===l){i[o+1]=new Bl(new Bi(a.seq1Range.start+l,s.seq1Range.endExclusive),new Bi(a.seq2Range.start+l,s.seq2Range.endExclusive));continue}c>0&&(a=a.delta(c))}r.push(a)}return i.length>0&&r.push(i[i.length-1]),r}function h9i(n,e,t){if(!n.getBoundaryScore||!e.getBoundaryScore)return t;for(let i=0;i<t.length;i++){const r=i>0?t[i-1]:void 0,o=t[i],s=i+1<t.length?t[i+1]:void 0,a=new Bi(r?r.seq1Range.start+1:0,s?s.seq1Range.endExclusive-1:n.length),l=new Bi(r?r.seq2Range.start+1:0,s?s.seq2Range.endExclusive-1:e.length);o.seq1Range.isEmpty?t[i]=cDe(o,n,e,a,l):o.seq2Range.isEmpty&&(t[i]=cDe(o.swap(),e,n,l,a).swap())}return t}function cDe(n,e,t,i,r){let s=1;for(;n.seq1Range.start-s>=i.start&&n.seq2Range.start-s>=r.start&&t.isStronglyEqual(n.seq2Range.start-s,n.seq2Range.endExclusive-s)&&s<100;)s++;s--;let a=0;for(;n.seq1Range.start+a<i.endExclusive&&n.seq2Range.endExclusive+a<r.endExclusive&&t.isStronglyEqual(n.seq2Range.start+a,n.seq2Range.endExclusive+a)&&a<100;)a++;if(s===0&&a===0)return n;let l=0,c=-1;for(let u=-s;u<=a;u++){const d=n.seq2Range.start+u,h=n.seq2Range.endExclusive+u,g=n.seq1Range.start+u,p=e.getBoundaryScore(g)+t.getBoundaryScore(d)+t.getBoundaryScore(h);p>c&&(c=p,l=u)}return n.delta(l)}function f9i(n,e,t){const i=[];for(const r of t){const o=i[i.length-1];if(!o){i.push(r);continue}r.seq1Range.start-o.seq1Range.endExclusive<=2||r.seq2Range.start-o.seq2Range.endExclusive<=2?i[i.length-1]=new Bl(o.seq1Range.join(r.seq1Range),o.seq2Range.join(r.seq2Range)):i.push(r)}return i}function g9i(n,e,t){const i=[];let r;function o(){if(!r)return;const a=r.s1Range.length-r.deleted;r.s2Range.length-r.added,Math.max(r.deleted,r.added)+(r.count-1)>a&&i.push(new Bl(r.s1Range,r.s2Range)),r=void 0}for(const a of t){let l=function(g,p){var m,_,v,b;if(!r||!r.s1Range.containsRange(g)||!r.s2Range.containsRange(p))if(r&&!(r.s1Range.endExclusive<g.start&&r.s2Range.endExclusive<p.start)){const x=Bi.tryCreate(r.s1Range.endExclusive,g.start),k=Bi.tryCreate(r.s2Range.endExclusive,p.start);r.deleted+=(m=x==null?void 0:x.length)!==null&&m!==void 0?m:0,r.added+=(_=k==null?void 0:k.length)!==null&&_!==void 0?_:0,r.s1Range=r.s1Range.join(g),r.s2Range=r.s2Range.join(p)}else o(),r={added:0,deleted:0,count:0,s1Range:g,s2Range:p};const y=g.intersect(a.seq1Range),C=p.intersect(a.seq2Range);r.count++,r.deleted+=(v=y==null?void 0:y.length)!==null&&v!==void 0?v:0,r.added+=(b=C==null?void 0:C.length)!==null&&b!==void 0?b:0};const c=n.findWordContaining(a.seq1Range.start-1),u=e.findWordContaining(a.seq2Range.start-1),d=n.findWordContaining(a.seq1Range.endExclusive),h=e.findWordContaining(a.seq2Range.endExclusive);c&&d&&u&&h&&c.equals(d)&&u.equals(h)?l(c,u):(c&&u&&l(c,u),d&&h&&l(d,h))}return o(),p9i(t,i)}function p9i(n,e){const t=[];for(;n.length>0||e.length>0;){const i=n[0],r=e[0];let o;i&&(!r||i.seq1Range.start<r.seq1Range.start)?o=n.shift():o=e.shift(),t.length>0&&t[t.length-1].seq1Range.endExclusive>=o.seq1Range.start?t[t.length-1]=t[t.length-1].join(o):t.push(o)}return t}function m9i(n,e,t){let i=t;if(i.length===0)return i;let r=0,o;do{o=!1;const s=[i[0]];for(let a=1;a<i.length;a++){let u=function(h,g){const p=new Bi(c.seq1Range.endExclusive,l.seq1Range.start);return n.getText(p).replace(/\s/g,"").length<=4&&(h.seq1Range.length+h.seq2Range.length>5||g.seq1Range.length+g.seq2Range.length>5)};const l=i[a],c=s[s.length-1];u(c,l)?(o=!0,s[s.length-1]=s[s.length-1].join(l)):s.push(l)}i=s}while(r++<10&&o);return i}function _9i(n,e,t){let i=t;if(i.length===0)return i;let r=0,o;do{o=!1;const a=[i[0]];for(let l=1;l<i.length;l++){let d=function(g,p){const m=new Bi(u.seq1Range.endExclusive,c.seq1Range.start);if(n.countLinesIn(m)>5||m.length>500)return!1;const v=n.getText(m).trim();if(v.length>20||v.split(/\r\n|\r|\n/).length>1)return!1;const b=n.countLinesIn(g.seq1Range),y=g.seq1Range.length,C=e.countLinesIn(g.seq2Range),x=g.seq2Range.length,k=n.countLinesIn(p.seq1Range),I=p.seq1Range.length,L=e.countLinesIn(p.seq2Range),D=p.seq2Range.length,R=2*40+50;function P(M){return Math.min(M,R)}return Math.pow(Math.pow(P(b*40+y),1.5)+Math.pow(P(C*40+x),1.5),1.5)+Math.pow(Math.pow(P(k*40+I),1.5)+Math.pow(P(L*40+D),1.5),1.5)>Math.pow(Math.pow(R,1.5),1.5)*1.3};const c=i[l],u=a[a.length-1];d(u,c)?(o=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}i=a}while(r++<10&&o);const s=[];return T5i(i,(a,l,c)=>{let u=l;function d(v){return v.length>0&&v.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const h=n.extendToFullLines(l.seq1Range),g=n.getText(new Bi(h.start,l.seq1Range.start));d(g)&&(u=u.deltaStart(-g.length));const p=n.getText(new Bi(l.seq1Range.endExclusive,h.endExclusive));d(p)&&(u=u.deltaEnd(p.length));const m=Bl.fromOffsetPairs(a?a.getEndExclusives():Rv.zero,c?c.getStarts():Rv.max),_=u.intersect(m);s.push(_)}),s}class uDe{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){const t=e===0?0:dDe(this.lines[e-1]),i=e===this.lines.length?0:dDe(this.lines[e]);return 1e3-(t+i)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(`
`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function dDe(n){let e=0;for(;e<n.length&&(n.charCodeAt(e)===32||n.charCodeAt(e)===9);)e++;return e}class nqe{constructor(){this.dynamicProgrammingDiffing=new Z8i,this.myersDiffingAlgorithm=new tqe}computeDiff(e,t,i){if(e.length<=1&&Qs(e,t,(x,k)=>x===k))return new N8([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new N8([new kg(new zi(1,e.length+1),new zi(1,t.length+1),[new hw(new q(1,1,e.length,e[0].length+1),new q(1,1,t.length,t[0].length+1))])],[],!1);const r=i.maxComputationTimeMs===0?NM.instance:new X8i(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,s=new Map;function a(x){let k=s.get(x);return k===void 0&&(k=s.size,s.set(x,k)),k}const l=e.map(x=>a(x.trim())),c=t.map(x=>a(x.trim())),u=new uDe(l,e),d=new uDe(c,t),h=(()=>u.length+d.length<1700?this.dynamicProgrammingDiffing.compute(u,d,r,(x,k)=>e[x]===t[k]?t[k].length===0?.1:1+Math.log(1+t[k].length):.99):this.myersDiffingAlgorithm.compute(u,d))();let g=h.diffs,p=h.hitTimeout;g=cse(u,d,g),g=m9i(u,d,g);const m=[],_=x=>{if(o)for(let k=0;k<x;k++){const I=v+k,L=b+k;if(e[I]!==t[L]){const D=this.refineDiff(e,t,new Bl(new Bi(I,I+1),new Bi(L,L+1)),r,o);for(const R of D.mappings)m.push(R);D.hitTimeout&&(p=!0)}}};let v=0,b=0;for(const x of g){xM(()=>x.seq1Range.start-v===x.seq2Range.start-b);const k=x.seq1Range.start-v;_(k),v=x.seq1Range.endExclusive,b=x.seq2Range.endExclusive;const I=this.refineDiff(e,t,x,r,o);I.hitTimeout&&(p=!0);for(const L of I.mappings)m.push(L)}_(e.length-v);const y=hDe(m,e,t);let C=[];return i.computeMoves&&(C=this.computeMoves(y,e,t,l,c,r,o)),xM(()=>{function x(I,L){if(I.lineNumber<1||I.lineNumber>L.length)return!1;const D=L[I.lineNumber-1];return!(I.column<1||I.column>D.length+1)}function k(I,L){return!(I.startLineNumber<1||I.startLineNumber>L.length+1||I.endLineNumberExclusive<1||I.endLineNumberExclusive>L.length+1)}for(const I of y){if(!I.innerChanges)return!1;for(const L of I.innerChanges)if(!(x(L.modifiedRange.getStartPosition(),t)&&x(L.modifiedRange.getEndPosition(),t)&&x(L.originalRange.getStartPosition(),e)&&x(L.originalRange.getEndPosition(),e)))return!1;if(!k(I.modified,t)||!k(I.original,e))return!1}return!0}),new N8(y,C,p)}computeMoves(e,t,i,r,o,s,a){return s9i(e,t,i,r,o,s).map(u=>{const d=this.refineDiff(t,i,new Bl(u.original.toOffsetRange(),u.modified.toOffsetRange()),s,a),h=hDe(d.mappings,t,i,!0);return new ZUe(u,h)})}refineDiff(e,t,i,r,o){const s=new WV(e,i.seq1Range,o),a=new WV(t,i.seq2Range,o),l=s.length+a.length<500?this.dynamicProgrammingDiffing.compute(s,a,r):this.myersDiffingAlgorithm.compute(s,a,r);let c=l.diffs;return c=cse(s,a,c),c=g9i(s,a,c),c=f9i(s,a,c),c=_9i(s,a,c),{mappings:c.map(d=>new hw(s.translateRange(d.seq1Range),a.translateRange(d.seq2Range))),hitTimeout:l.hitTimeout}}}function hDe(n,e,t,i=!1){const r=[];for(const o of pje(n.map(s=>v9i(s,e,t)),(s,a)=>s.original.overlapOrTouch(a.original)||s.modified.overlapOrTouch(a.modified))){const s=o[0],a=o[o.length-1];r.push(new kg(s.original.join(a.original),s.modified.join(a.modified),o.map(l=>l.innerChanges[0])))}return xM(()=>!i&&r.length>0&&r[0].original.startLineNumber!==r[0].modified.startLineNumber?!1:uUe(r,(o,s)=>s.original.startLineNumber-o.original.endLineNumberExclusive===s.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive<s.original.startLineNumber&&o.modified.endLineNumberExclusive<s.modified.startLineNumber)),r}function v9i(n,e,t){let i=0,r=0;n.modifiedRange.endColumn===1&&n.originalRange.endColumn===1&&n.originalRange.startLineNumber+i<=n.originalRange.endLineNumber&&n.modifiedRange.startLineNumber+i<=n.modifiedRange.endLineNumber&&(r=-1),n.modifiedRange.startColumn-1>=t[n.modifiedRange.startLineNumber-1].length&&n.originalRange.startColumn-1>=e[n.originalRange.startLineNumber-1].length&&n.originalRange.startLineNumber<=n.originalRange.endLineNumber+r&&n.modifiedRange.startLineNumber<=n.modifiedRange.endLineNumber+r&&(i=1);const o=new zi(n.originalRange.startLineNumber+i,n.originalRange.endLineNumber+1+r),s=new zi(n.modifiedRange.startLineNumber+i,n.modifiedRange.endLineNumber+1+r);return new kg(o,s,[n])}const fDe={getLegacy:()=>new K8i,getDefault:()=>new nqe};function DC(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}class Yi{constructor(e,t,i,r=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=DC(Math.max(Math.min(1,r),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class fp{constructor(e,t,i,r){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=DC(Math.max(Math.min(1,t),0),3),this.l=DC(Math.max(Math.min(1,i),0),3),this.a=DC(Math.max(Math.min(1,r),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,i=e.g/255,r=e.b/255,o=e.a,s=Math.max(t,i,r),a=Math.min(t,i,r);let l=0,c=0;const u=(a+s)/2,d=s-a;if(d>0){switch(c=Math.min(u<=.5?d/(2*u):d/(2-2*u),1),s){case t:l=(i-r)/d+(i<r?6:0);break;case i:l=(r-t)/d+2;break;case r:l=(t-i)/d+4;break}l*=60,l=Math.round(l)}return new fp(l,c,u,o)}static _hue2rgb(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:r,a:o}=e;let s,a,l;if(i===0)s=a=l=r;else{const c=r<.5?r*(1+i):r+i-r*i,u=2*r-c;s=fp._hue2rgb(u,c,t+1/3),a=fp._hue2rgb(u,c,t),l=fp._hue2rgb(u,c,t-1/3)}return new Yi(Math.round(s*255),Math.round(a*255),Math.round(l*255),o)}}class Nv{constructor(e,t,i,r){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=DC(Math.max(Math.min(1,t),0),3),this.v=DC(Math.max(Math.min(1,i),0),3),this.a=DC(Math.max(Math.min(1,r),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,i=e.g/255,r=e.b/255,o=Math.max(t,i,r),s=Math.min(t,i,r),a=o-s,l=o===0?0:a/o;let c;return a===0?c=0:o===t?c=((i-r)/a%6+6)%6:o===i?c=(r-t)/a+2:c=(t-i)/a+4,new Nv(Math.round(c*60),l,o,e.a)}static toRGBA(e){const{h:t,s:i,v:r,a:o}=e,s=r*i,a=s*(1-Math.abs(t/60%2-1)),l=r-s;let[c,u,d]=[0,0,0];return t<60?(c=s,u=a):t<120?(c=a,u=s):t<180?(u=s,d=a):t<240?(u=a,d=s):t<300?(c=a,d=s):t<=360&&(c=s,d=a),c=Math.round((c+l)*255),u=Math.round((u+l)*255),d=Math.round((d+l)*255),new Yi(c,u,d,o)}}class De{static fromHex(e){return De.Format.CSS.parseHex(e)||De.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:fp.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:Nv.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof Yi)this.rgba=e;else if(e instanceof fp)this._hsla=e,this.rgba=fp.toRGBA(e);else if(e instanceof Nv)this._hsva=e,this.rgba=Nv.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&Yi.equals(this.rgba,e.rgba)&&fp.equals(this.hsla,e.hsla)&&Nv.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=De._relativeLuminanceForComponent(this.rgba.r),t=De._relativeLuminanceForComponent(this.rgba.g),i=De._relativeLuminanceForComponent(this.rgba.b),r=.2126*e+.7152*t+.0722*i;return DC(r,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t<i}lighten(e){return new De(new fp(this.hsla.h,this.hsla.s,this.hsla.l+this.hsla.l*e,this.hsla.a))}darken(e){return new De(new fp(this.hsla.h,this.hsla.s,this.hsla.l-this.hsla.l*e,this.hsla.a))}transparent(e){const{r:t,g:i,b:r,a:o}=this.rgba;return new De(new Yi(t,i,r,o*e))}isTransparent(){return this.rgba.a===0}isOpaque(){return this.rgba.a===1}opposite(){return new De(new Yi(255-this.rgba.r,255-this.rgba.g,255-this.rgba.b,this.rgba.a))}makeOpaque(e){if(this.isOpaque()||e.rgba.a!==1)return this;const{r:t,g:i,b:r,a:o}=this.rgba;return new De(new Yi(e.rgba.r-o*(e.rgba.r-t),e.rgba.g-o*(e.rgba.g-i),e.rgba.b-o*(e.rgba.b-r),1))}toString(){return this._toString||(this._toString=De.Format.CSS.format(this)),this._toString}static getLighterColor(e,t,i){if(e.isLighterThan(t))return e;i=i||.5;const r=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(o-r)/o,e.lighten(i)}static getDarkerColor(e,t,i){if(e.isDarkerThan(t))return e;i=i||.5;const r=e.getRelativeLuminance(),o=t.getRelativeLuminance();return i=i*(r-o)/r,e.darken(i)}}De.white=new De(new Yi(255,255,255,1));De.black=new De(new Yi(0,0,0,1));De.red=new De(new Yi(255,0,0,1));De.blue=new De(new Yi(0,0,255,1));De.green=new De(new Yi(0,255,0,1));De.cyan=new De(new Yi(0,255,255,1));De.lightgrey=new De(new Yi(211,211,211,1));De.transparent=new De(new Yi(0,0,0,0));(function(n){(function(e){(function(t){function i(g){return g.rgba.a===1?`rgb(${g.rgba.r}, ${g.rgba.g}, ${g.rgba.b})`:n.Format.CSS.formatRGBA(g)}t.formatRGB=i;function r(g){return`rgba(${g.rgba.r}, ${g.rgba.g}, ${g.rgba.b}, ${+g.rgba.a.toFixed(2)})`}t.formatRGBA=r;function o(g){return g.hsla.a===1?`hsl(${g.hsla.h}, ${(g.hsla.s*100).toFixed(2)}%, ${(g.hsla.l*100).toFixed(2)}%)`:n.Format.CSS.formatHSLA(g)}t.formatHSL=o;function s(g){return`hsla(${g.hsla.h}, ${(g.hsla.s*100).toFixed(2)}%, ${(g.hsla.l*100).toFixed(2)}%, ${g.hsla.a.toFixed(2)})`}t.formatHSLA=s;function a(g){const p=g.toString(16);return p.length!==2?"0"+p:p}function l(g){return`#${a(g.rgba.r)}${a(g.rgba.g)}${a(g.rgba.b)}`}t.formatHex=l;function c(g,p=!1){return p&&g.rgba.a===1?n.Format.CSS.formatHex(g):`#${a(g.rgba.r)}${a(g.rgba.g)}${a(g.rgba.b)}${a(Math.round(g.rgba.a*255))}`}t.formatHexA=c;function u(g){return g.isOpaque()?n.Format.CSS.formatHex(g):n.Format.CSS.formatRGBA(g)}t.format=u;function d(g){const p=g.length;if(p===0||g.charCodeAt(0)!==35)return null;if(p===7){const m=16*h(g.charCodeAt(1))+h(g.charCodeAt(2)),_=16*h(g.charCodeAt(3))+h(g.charCodeAt(4)),v=16*h(g.charCodeAt(5))+h(g.charCodeAt(6));return new n(new Yi(m,_,v,1))}if(p===9){const m=16*h(g.charCodeAt(1))+h(g.charCodeAt(2)),_=16*h(g.charCodeAt(3))+h(g.charCodeAt(4)),v=16*h(g.charCodeAt(5))+h(g.charCodeAt(6)),b=16*h(g.charCodeAt(7))+h(g.charCodeAt(8));return new n(new Yi(m,_,v,b/255))}if(p===4){const m=h(g.charCodeAt(1)),_=h(g.charCodeAt(2)),v=h(g.charCodeAt(3));return new n(new Yi(16*m+m,16*_+_,16*v+v))}if(p===5){const m=h(g.charCodeAt(1)),_=h(g.charCodeAt(2)),v=h(g.charCodeAt(3)),b=h(g.charCodeAt(4));return new n(new Yi(16*m+m,16*_+_,16*v+v,(16*b+b)/255))}return null}t.parseHex=d;function h(g){switch(g){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:return 10;case 65:return 10;case 98:return 11;case 66:return 11;case 99:return 12;case 67:return 12;case 100:return 13;case 68:return 13;case 101:return 14;case 69:return 14;case 102:return 15;case 70:return 15}return 0}})(e.CSS||(e.CSS={}))})(n.Format||(n.Format={}))})(De||(De={}));function iqe(n){const e=[];for(const t of n){const i=Number(t);(i||i===0&&t.replace(/\s/g,"")!=="")&&e.push(i)}return e}function Gme(n,e,t,i){return{red:n/255,blue:t/255,green:e/255,alpha:i}}function $R(n,e){const t=e.index,i=e[0].length;if(!t)return;const r=n.positionAt(t);return{startLineNumber:r.lineNumber,startColumn:r.column,endLineNumber:r.lineNumber,endColumn:r.column+i}}function b9i(n,e){if(!n)return;const t=De.Format.CSS.parseHex(e);if(t)return{range:n,color:Gme(t.rgba.r,t.rgba.g,t.rgba.b,t.rgba.a)}}function gDe(n,e,t){if(!n||e.length!==1)return;const r=e[0].values(),o=iqe(r);return{range:n,color:Gme(o[0],o[1],o[2],t?o[3]:1)}}function pDe(n,e,t){if(!n||e.length!==1)return;const r=e[0].values(),o=iqe(r),s=new De(new fp(o[0],o[1]/100,o[2]/100,t?o[3]:1));return{range:n,color:Gme(s.rgba.r,s.rgba.g,s.rgba.b,s.rgba.a)}}function VR(n,e){return typeof n=="string"?[...n.matchAll(e)]:n.findMatches(e)}function y9i(n){const e=[],i=VR(n,/\b(rgb|rgba|hsl|hsla)(\([0-9\s,.\%]*\))|(#)([A-Fa-f0-9]{3})\b|(#)([A-Fa-f0-9]{4})\b|(#)([A-Fa-f0-9]{6})\b|(#)([A-Fa-f0-9]{8})\b/gm);if(i.length>0)for(const r of i){const o=r.filter(c=>c!==void 0),s=o[1],a=o[2];if(!a)continue;let l;if(s==="rgb"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;l=gDe($R(n,r),VR(a,c),!1)}else if(s==="rgba"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=gDe($R(n,r),VR(a,c),!0)}else if(s==="hsl"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;l=pDe($R(n,r),VR(a,c),!1)}else if(s==="hsla"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=pDe($R(n,r),VR(a,c),!0)}else s==="#"&&(l=b9i($R(n,r),s+a));l&&e.push(l)}return e}function C9i(n){return!n||typeof n.getValue!="function"||typeof n.positionAt!="function"?[]:y9i(n)}var t1=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class w9i extends S8i{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let i=0;i<this._lines.length;i++){const r=this._lines[i],o=this.offsetAt(new Ce(i+1,1)),s=r.matchAll(e);for(const a of s)(a.index||a.index===0)&&(a.index=a.index+o),t.push(a)}return t}getLinesContent(){return this._lines.slice(0)}getLineCount(){return this._lines.length}getLineContent(e){return this._lines[e-1]}getWordAtPosition(e,t){const i=vM(e.column,Dje(t),this._lines[e.lineNumber-1],0);return i?new q(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn):null}words(e){const t=this._lines,i=this._wordenize.bind(this);let r=0,o="",s=0,a=[];return{*[Symbol.iterator](){for(;;)if(s<a.length){const l=o.substring(a[s].start,a[s].end);s+=1,yield l}else if(r<t.length)o=t[r],a=i(o,e),s=0,r+=1;else break}}}getLineWords(e,t){const i=this._lines[e-1],r=this._wordenize(i,t),o=[];for(const s of r)o.push({word:i.substring(s.start,s.end),startColumn:s.start+1,endColumn:s.end+1});return o}_wordenize(e,t){const i=[];let r;for(t.lastIndex=0;(r=t.exec(e))&&r[0].length!==0;)i.push({start:r.index,end:r.index+r[0].length});return i}getValueInRange(e){if(e=this._validateRange(e),e.startLineNumber===e.endLineNumber)return this._lines[e.startLineNumber-1].substring(e.startColumn-1,e.endColumn-1);const t=this._eol,i=e.startLineNumber-1,r=e.endLineNumber-1,o=[];o.push(this._lines[i].substring(e.startColumn-1));for(let s=i+1;s<r;s++)o.push(this._lines[s]);return o.push(this._lines[r].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),i=this._lines[t.index].length;return{lineNumber:1+t.index,column:1+Math.min(t.remainder,i)}}_validateRange(e){const t=this._validatePosition({lineNumber:e.startLineNumber,column:e.startColumn}),i=this._validatePosition({lineNumber:e.endLineNumber,column:e.endColumn});return t.lineNumber!==e.startLineNumber||t.column!==e.startColumn||i.lineNumber!==e.endLineNumber||i.column!==e.endColumn?{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}:e}_validatePosition(e){if(!Ce.isIPosition(e))throw new Error("bad position");let{lineNumber:t,column:i}=e,r=!1;if(t<1)t=1,i=1,r=!0;else if(t>this._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,r=!0;else{const o=this._lines[t-1].length+1;i<1?(i=1,r=!0):i>o&&(i=o,r=!0)}return r?{lineNumber:t,column:i}:e}}class AC{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 w9i(Tn.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,i){return t1(this,void 0,void 0,function*(){const r=this._getModel(e);return r?Ume.computeUnicodeHighlights(r,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}})}computeDiff(e,t,i,r){return t1(this,void 0,void 0,function*(){const o=this._getModel(e),s=this._getModel(t);return!o||!s?null:AC.computeDiff(o,s,i,r)})}static computeDiff(e,t,i,r){const o=r==="advanced"?fDe.getDefault():fDe.getLegacy(),s=e.getLinesContent(),a=t.getLinesContent(),l=o.computeDiff(s,a,i),c=l.changes.length>0?!1:this._modelsAreIdentical(e,t);function u(d){return d.map(h=>{var g;return[h.original.startLineNumber,h.original.endLineNumberExclusive,h.modified.startLineNumber,h.modified.endLineNumberExclusive,(g=h.innerChanges)===null||g===void 0?void 0:g.map(p=>[p.originalRange.startLineNumber,p.originalRange.startColumn,p.originalRange.endLineNumber,p.originalRange.endColumn,p.modifiedRange.startLineNumber,p.modifiedRange.startColumn,p.modifiedRange.endLineNumber,p.modifiedRange.endColumn])]})}return{identical:c,quitEarly:l.hitTimeout,changes:u(l.changes),moves:l.moves.map(d=>[d.lineRangeMapping.original.startLineNumber,d.lineRangeMapping.original.endLineNumberExclusive,d.lineRangeMapping.modified.startLineNumber,d.lineRangeMapping.modified.endLineNumberExclusive,u(d.changes)])}}static _modelsAreIdentical(e,t){const i=e.getLineCount(),r=t.getLineCount();if(i!==r)return!1;for(let o=1;o<=i;o++){const s=e.getLineContent(o),a=t.getLineContent(o);if(s!==a)return!1}return!0}computeMoreMinimalEdits(e,t,i){return t1(this,void 0,void 0,function*(){const r=this._getModel(e);if(!r)return t;const o=[];let s;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return q.compareRangesUsingStarts(l.range,c.range);const u=l.range?0:1,d=c.range?0:1;return u-d});let a=0;for(let l=1;l<t.length;l++)q.getEndPosition(t[a].range).equals(q.getStartPosition(t[l].range))?(t[a].range=q.fromPositions(q.getStartPosition(t[a].range),q.getEndPosition(t[l].range)),t[a].text+=t[l].text):(a++,t[a]=t[l]);t.length=a+1;for(let{range:l,text:c,eol:u}of t){if(typeof u=="number"&&(s=u),q.isEmpty(l)&&!c)continue;const d=r.getValueInRange(l);if(c=c.replace(/\r\n|\n|\r/g,r.eol),d===c)continue;if(Math.max(c.length,d.length)>AC._diffLimit){o.push({range:l,text:c});continue}const h=y8i(d,c,i),g=r.offsetAt(q.lift(l).getStartPosition());for(const p of h){const m=r.positionAt(g+p.originalStart),_=r.positionAt(g+p.originalStart+p.originalLength),v={text:c.substr(p.modifiedStart,p.modifiedLength),range:{startLineNumber:m.lineNumber,startColumn:m.column,endLineNumber:_.lineNumber,endColumn:_.column}};r.getValueInRange(v.range)!==v.text&&o.push(v)}}return typeof s=="number"&&o.push({eol:s,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o})}computeLinks(e){return t1(this,void 0,void 0,function*(){const t=this._getModel(e);return t?I8i(t):null})}computeDefaultDocumentColors(e){return t1(this,void 0,void 0,function*(){const t=this._getModel(e);return t?C9i(t):null})}textualSuggest(e,t,i,r){return t1(this,void 0,void 0,function*(){const o=new $c,s=new RegExp(i,r),a=new Set;e:for(const l of e){const c=this._getModel(l);if(c){for(const u of c.words(s))if(!(u===t||!isNaN(Number(u)))&&(a.add(u),a.size>AC._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}})}computeWordRanges(e,t,i,r){return t1(this,void 0,void 0,function*(){const o=this._getModel(e);if(!o)return Object.create(null);const s=new RegExp(i,r),a=Object.create(null);for(let l=t.startLineNumber;l<t.endLineNumber;l++){const c=o.getLineWords(l,s);for(const u of c){if(!isNaN(Number(u.word)))continue;let d=a[u.word];d||(d=[],a[u.word]=d),d.push({startLineNumber:l,startColumn:u.startColumn,endLineNumber:l,endColumn:u.endColumn})}}return a})}navigateValueSet(e,t,i,r,o){return t1(this,void 0,void 0,function*(){const s=this._getModel(e);if(!s)return null;const a=new RegExp(r,o);t.startColumn===t.endColumn&&(t={startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn+1});const l=s.getValueInRange(t),c=s.getWordAtPosition({lineNumber:t.startLineNumber,column:t.startColumn},a);if(!c)return null;const u=s.getValueInRange(c);return ose.INSTANCE.navigateValueSet(t,l,c,u,i)})}loadForeignModule(e,t,i){const s={host:M5i(i,(a,l)=>this._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(s,t),Promise.resolve(mme(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(i){return Promise.reject(i)}}}AC._diffLimit=1e5;AC._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=Yje());const Yme=Vi("textResourceConfigurationService"),rqe=Vi("textResourcePropertiesService"),en=Vi("ILanguageFeaturesService");var S9i=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},HR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},zV=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const mDe=60*1e3,_De=5*60*1e3;function sE(n,e){const t=n.getModel(e);return!(!t||t.isTooLargeForSyncing())}let use=class extends Ae{constructor(e,t,i,r,o){super(),this._modelService=e,this._workerManager=this._register(new x9i(this._modelService,r)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(s,a)=>sE(this._modelService,s.uri)?this._workerManager.withWorker().then(l=>l.computeLinks(s.uri)).then(l=>l&&{links:l}):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new E9i(this._workerManager,t,this._modelService,r)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return sE(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then(r=>r.computedUnicodeHighlights(e,t,i))}computeDiff(e,t,i,r){return zV(this,void 0,void 0,function*(){const o=yield this._workerManager.withWorker().then(l=>l.computeDiff(e,t,i,r));if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:a(o.changes),moves:o.moves.map(l=>new ZUe(new cb(new zi(l[0],l[1]),new zi(l[2],l[3])),a(l[4])))};function a(l){return l.map(c=>{var u;return new kg(new zi(c[0],c[1]),new zi(c[2],c[3]),(u=c[4])===null||u===void 0?void 0:u.map(d=>new hw(new q(d[0],d[1],d[2],d[3]),new q(d[4],d[5],d[6],d[7]))))})}})}computeMoreMinimalEdits(e,t,i=!1){if(Fc(t)){if(!sE(this._modelService,e))return Promise.resolve(t);const r=$c.create(),o=this._workerManager.withWorker().then(s=>s.computeMoreMinimalEdits(e,t,i));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),r.elapsed())),Promise.race([o,cw(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return sE(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(r=>r.navigateValueSet(e,t,i))}canComputeWordRanges(e){return sE(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}};use=S9i([HR(0,ts),HR(1,Yme),HR(2,Sf),HR(3,xo),HR(4,en)],use);class E9i{constructor(e,t,i,r){this.languageConfigurationService=r,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return zV(this,void 0,void 0,function*(){const i=this._configurationService.getValue(e.uri,t,"editor");if(!i.wordBasedSuggestions)return;const r=[];if(i.wordBasedSuggestionsMode==="currentDocument")sE(this._modelService,e.uri)&&r.push(e.uri);else for(const d of this._modelService.getModels())sE(this._modelService,d.uri)&&(d===e?r.unshift(d.uri):(i.wordBasedSuggestionsMode==="allDocuments"||d.getLanguageId()===e.getLanguageId())&&r.push(d.uri));if(r.length===0)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),s=e.getWordAtPosition(t),a=s?new q(t.lineNumber,s.startColumn,t.lineNumber,s.endColumn):q.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),u=yield(yield this._workerManager.withWorker()).textualSuggest(r,s==null?void 0:s.word,o);if(u)return{duration:u.duration,suggestions:u.words.map(d=>({kind:18,label:d,insertText:d,range:{insert:l,replace:a}}))}})}}class x9i extends Ae{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new p5).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(_De/2)),this._register(this._modelService.onModelRemoved(r=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>_De&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new Qme(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class k9i extends Ae{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const r=new p5;r.cancelAndSet(()=>this._checkStopModelSync(),Math.round(mDe/2)),this._register(r)}}dispose(){for(const e in this._syncedModels)Hr(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const r=i.toString();this._syncedModels[r]||this._beginModelSync(i,t),this._syncedModels[r]&&(this._syncedModelsLastUsedTime[r]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>mDe&&t.push(i);for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i||!t&&i.isTooLargeForSyncing())return;const r=e.toString();this._proxy.acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const o=new nt;o.add(i.onDidChangeContent(s=>{this._proxy.acceptModelChanged(r.toString(),s)})),o.add(i.onWillDispose(()=>{this._stopModelSync(r)})),o.add(Gn(()=>{this._proxy.acceptRemovedModel(r)})),this._syncedModels[r]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],Hr(t)}}class vDe{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class vZ{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class Qme extends Ae{constructor(e,t,i,r){super(),this.languageConfigurationService=r,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new qU(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new L$i(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new vZ(this)))}catch(e){tse(e),this._worker=new vDe(new AC(new vZ(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(tse(e),this._worker=new vDe(new AC(new vZ(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new k9i(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return zV(this,void 0,void 0,function*(){return this._disposed?Promise.reject(VFi()):this._getProxy().then(i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i))})}computedUnicodeHighlights(e,t,i){return this._withSyncedResources([e]).then(r=>r.computeUnicodeHighlights(e.toString(),t,i))}computeDiff(e,t,i,r){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),i,r))}computeMoreMinimalEdits(e,t,i){return this._withSyncedResources([e]).then(r=>r.computeMoreMinimalEdits(e.toString(),t,i))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}textualSuggest(e,t,i){return zV(this,void 0,void 0,function*(){const r=yield this._withSyncedResources(e),o=i.source,s=i.flags;return r.textualSuggest(e.map(a=>a.toString()),t,o,s)})}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{const r=this._modelService.getModel(e);if(!r)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId()).getWordDefinition(),s=o.source,a=o.flags;return i.computeWordRanges(e.toString(),t,s,a)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(r=>{const o=this._modelService.getModel(e);if(!o)return null;const s=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),a=s.source,l=s.flags;return r.navigateValueSet(e.toString(),t,i,a,l)})}dispose(){super.dispose(),this._disposed=!0}}function T9i(n,e,t){return new I9i(n,e,t)}class I9i extends Qme{constructor(e,t,i){super(e,i.keepIdleModels||!1,i.label,t),this._foreignModuleId=i.moduleId,this._foreignModuleCreateData=i.createData||null,this._foreignModuleHost=i.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")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(i){return Promise.reject(i)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?mme(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const r=(a,l)=>e.fmr(a,l),o=(a,l)=>function(){const c=Array.prototype.slice.call(arguments,0);return l(a,c)},s={};for(const a of i)s[a]=o(a,r);return s})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}const _5={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},JD=new class{clone(){return this}equals(n){return this===n}};function Xme(n,e){return new Tme([new bM(0,"",n)],e)}function eq(n,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(n<<0|0|0|32768|2<<24)>>>0,new DU(t,e===null?JD:e)}class dc{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e);const r=this.getFontStyle(e);return r&1&&(i+=" mtki"),r&2&&(i+=" mtkb"),r&4&&(i+=" mtku"),r&8&&(i+=" mtks"),i}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),r=this.getFontStyle(e);let o=`color: ${t[i]};`;r&1&&(o+="font-style: italic;"),r&2&&(o+="font-weight: bold;");let s="";return r&4&&(s+=" underline"),r&8&&(s+=" line-through"),s&&(o+=`text-decoration:${s};`),o}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:!!(i&1),bold:!!(i&2),underline:!!(i&4),strikethrough:!!(i&8)}}}class el{static createEmpty(e,t){const i=el.defaultTokenMetadata,r=new Uint32Array(2);return r[0]=e.length,r[1]=i,new el(r,e,t)}constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=i}equals(e){return e instanceof el?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const r=t<<1,o=r+(i<<1);for(let s=r;s<o;s++)if(this._tokens[s]!==e._tokens[s])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[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],i=dc.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return dc.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return dc.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return dc.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return dc.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return dc.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return el.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new Zme(this,e,t,i)}static convertToEndOffset(e,t){const r=(e.length>>>1)-1;for(let o=0;o<r;o++)e[o<<1]=e[o+1<<1];e[r<<1]=t}static findIndexInTokensArray(e,t){if(e.length<=2)return 0;let i=0,r=(e.length>>>1)-1;for(;i<r;){const o=i+Math.floor((r-i)/2),s=e[o<<1];if(s===t)return o+1;s<t?i=o+1:s>t&&(r=o)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,r="";const o=new Array;let s=0;for(;;){const a=t<this._tokensCount?this._tokens[t<<1]:-1,l=i<e.length?e[i]:null;if(a!==-1&&(l===null||a<=l.offset)){r+=this._text.substring(s,a);const c=this._tokens[(t<<1)+1];o.push(r.length,c),t++,s=a}else if(l){if(l.offset>s){r+=this._text.substring(s,l.offset);const c=this._tokens[(t<<1)+1];o.push(r.length,c),s=l.offset}r+=l.text,o.push(r.length,l.tokenMetadata),i++}else break}return new el(new Uint32Array(o),r,this._languageIdCodec)}}el.defaultTokenMetadata=(32768|2<<24)>>>0;class Zme{constructor(e,t,i,r){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=r,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let o=this._firstTokenIndex,s=e.getCount();o<s&&!(e.getStartOffset(o)>=i);o++)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 Zme?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}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}}class Jd{constructor(e,t,i,r){this.startColumn=e,this.endColumn=t,this.className=i,this.type=r,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 i=e.length,r=t.length;if(i!==r)return!1;for(let o=0;o<i;o++)if(!Jd._equals(e[o],t[o]))return!1;return!0}static extractWrapped(e,t,i){if(e.length===0)return e;const r=t+1,o=i+1,s=i-t,a=[];let l=0;for(const c of e)c.endColumn<=r||c.startColumn>=o||(a[l++]=new Jd(Math.max(1,c.startColumn-r+1),Math.min(s+1,c.endColumn-r+1),c.className,c.type));return a}static filter(e,t,i,r){if(e.length===0)return[];const o=[];let s=0;for(let a=0,l=e.length;a<l;a++){const c=e[a],u=c.range;if(u.endLineNumber<t||u.startLineNumber>t||u.isEmpty()&&(c.type===0||c.type===3))continue;const d=u.startLineNumber===t?u.startColumn:i,h=u.endLineNumber===t?u.endColumn:r;o[s++]=new Jd(d,h,c.inlineClassName,c.type)}return o}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[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 i=Jd._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className<t.className?-1:1:0}}class bDe{constructor(e,t,i,r){this.startOffset=e,this.endOffset=t,this.className=i,this.metadata=r}}class jV{constructor(){this.stopOffsets=[],this.classNames=[],this.metadata=[],this.count=0}static _metadata(e){let t=0;for(let i=0,r=e.length;i<r;i++)t|=e[i];return t}consumeLowerThan(e,t,i){for(;this.count>0&&this.stopOffsets[0]<e;){let r=0;for(;r+1<this.count&&this.stopOffsets[r]===this.stopOffsets[r+1];)r++;i.push(new bDe(t,this.stopOffsets[r],this.classNames.join(" "),jV._metadata(this.metadata))),t=this.stopOffsets[r]+1,this.stopOffsets.splice(0,r+1),this.classNames.splice(0,r+1),this.metadata.splice(0,r+1),this.count-=r+1}return this.count>0&&t<e&&(i.push(new bDe(t,e-1,this.classNames.join(" "),jV._metadata(this.metadata))),t=e),t}insert(e,t,i){if(this.count===0||this.stopOffsets[this.count-1]<=e)this.stopOffsets.push(e),this.classNames.push(t),this.metadata.push(i);else for(let r=0;r<this.count;r++)if(this.stopOffsets[r]>=e){this.stopOffsets.splice(r,0,e),this.classNames.splice(r,0,t),this.metadata.splice(r,0,i);break}this.count++}}class L9i{static normalize(e,t){if(t.length===0)return[];const i=[],r=new jV;let o=0;for(let s=0,a=t.length;s<a;s++){const l=t[s];let c=l.startColumn,u=l.endColumn;const d=l.className,h=l.type===1?2:l.type===2?4:0;if(c>1){const m=e.charCodeAt(c-2);Za(m)&&c--}if(u>1){const m=e.charCodeAt(u-2);Za(m)&&u--}const g=c-1,p=u-2;o=r.consumeLowerThan(g,o,i),r.count===0&&(o=g),r.insert(p,d,h)}return r.consumeLowerThan(1073741824,o,i),i}}class bl{constructor(e,t,i,r){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=r,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class oqe{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class tS{constructor(e,t,i,r,o,s,a,l,c,u,d,h,g,p,m,_,v,b,y){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=r,this.isBasicASCII=o,this.containsRTL=s,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(Jd.compare),this.tabSize=u,this.startVisibleColumn=d,this.spaceWidth=h,this.stopRenderingLineAfter=m,this.renderWhitespace=_==="all"?4:_==="boundary"?1:_==="selection"?2:_==="trailing"?3:0,this.renderControlCharacters=v,this.fontLigatures=b,this.selectionsOnLine=y&&y.sort((k,I)=>k.startOffset<I.startOffset?-1:1);const C=Math.abs(p-h),x=Math.abs(g-h);C<x?(this.renderSpaceWidth=p,this.renderSpaceCharCode=11825):(this.renderSpaceWidth=g,this.renderSpaceCharCode=183)}sameSelection(e){if(this.selectionsOnLine===null)return e===null;if(e===null||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&&Jd.equalsArr(this.lineDecorations,e.lineDecorations)&&this.lineTokens.equals(e.lineTokens)&&this.sameSelection(e.selectionsOnLine)}}class sqe{constructor(e,t){this.partIndex=e,this.charIndex=t}}class fv{static getPartIndex(e){return(e&4294901760)>>>16}static getCharIndex(e){return(e&65535)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,r){const o=(t<<16|i<<0)>>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=r}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?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),i=fv.getPartIndex(t),r=fv.getCharIndex(t);return new sqe(i,r)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;const r=(e<<16|i<<0)>>>0;let o=0,s=this.length-1;for(;o+1<s;){const m=o+s>>>1,_=this._data[m];if(_===r)return m;_>r?s=m:o=m}if(o===s)return o;const a=this._data[o],l=this._data[s];if(a===r)return o;if(l===r)return s;const c=fv.getPartIndex(a),u=fv.getCharIndex(a),d=fv.getPartIndex(l);let h;c!==d?h=t:h=fv.getCharIndex(l);const g=i-u,p=h-i;return g<=p?o:s}}class dse{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function v5(n,e){if(n.lineContent.length===0){if(n.lineDecorations.length>0){e.appendString("<span>");let t=0,i=0,r=0;for(const s of n.lineDecorations)(s.type===1||s.type===2)&&(e.appendString('<span class="'),e.appendString(s.className),e.appendString('"></span>'),s.type===1&&(r|=1,t++),s.type===2&&(r|=2,i++));e.appendString("</span>");const o=new fv(1,t+i);return o.setColumnInfo(1,t,0,0),new dse(o,!1,r)}return e.appendString("<span><span></span></span>"),new dse(new fv(0,0),!1,0)}return B9i(R9i(n),e)}class D9i{constructor(e,t,i,r){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=r}}function tq(n){const e=new SA(1e4),t=v5(n,e);return new D9i(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class A9i{constructor(e,t,i,r,o,s,a,l,c,u,d,h,g,p,m,_){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=r,this.isOverflowing=o,this.overflowingCharCount=s,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=u,this.startVisibleColumn=d,this.containsRTL=h,this.spaceWidth=g,this.renderSpaceCharCode=p,this.renderWhitespace=m,this.renderControlCharacters=_}}function R9i(n){const e=n.lineContent;let t,i,r;n.stopRenderingLineAfter!==-1&&n.stopRenderingLineAfter<e.length?(t=!0,i=e.length-n.stopRenderingLineAfter,r=n.stopRenderingLineAfter):(t=!1,i=0,r=e.length);let o=N9i(e,n.containsRTL,n.lineTokens,n.fauxIndentLength,r);n.renderControlCharacters&&!n.isBasicASCII&&(o=P9i(e,o)),(n.renderWhitespace===4||n.renderWhitespace===1||n.renderWhitespace===2&&n.selectionsOnLine||n.renderWhitespace===3&&!n.continuesWithWrappedLine)&&(o=M9i(n,e,r,o));let s=0;if(n.lineDecorations.length>0){for(let a=0,l=n.lineDecorations.length;a<l;a++){const c=n.lineDecorations[a];c.type===3||c.type===1?s|=1:c.type===2&&(s|=2)}o=F9i(e,r,o,n.lineDecorations)}return n.containsRTL||(o=O9i(e,o,!n.isBasicASCII||n.fontLigatures)),new A9i(n.useMonospaceOptimizations,n.canUseHalfwidthRightwardsArrow,e,r,t,i,o,s,n.fauxIndentLength,n.tabSize,n.startVisibleColumn,n.containsRTL,n.spaceWidth,n.renderSpaceCharCode,n.renderWhitespace,n.renderControlCharacters)}function N9i(n,e,t,i,r){const o=[];let s=0;i>0&&(o[s++]=new bl(i,"",0,!1));let a=i;for(let l=0,c=t.getCount();l<c;l++){const u=t.getEndOffset(l);if(u<=i)continue;const d=t.getClassName(l);if(u>=r){const g=e?qD(n.substring(a,r)):!1;o[s++]=new bl(r,d,0,g);break}const h=e?qD(n.substring(a,u)):!1;o[s++]=new bl(u,d,0,h),a=u}return o}function O9i(n,e,t){let i=0;const r=[];let o=0;if(t)for(let s=0,a=e.length;s<a;s++){const l=e[s],c=l.endIndex;if(i+50<c){const u=l.type,d=l.metadata,h=l.containsRTL;let g=-1,p=i;for(let m=i;m<c;m++)n.charCodeAt(m)===32&&(g=m),g!==-1&&m-p>=50&&(r[o++]=new bl(g+1,u,d,h),p=g+1,g=-1);p!==c&&(r[o++]=new bl(c,u,d,h))}else r[o++]=l;i=c}else for(let s=0,a=e.length;s<a;s++){const l=e[s],c=l.endIndex,u=c-i;if(u>50){const d=l.type,h=l.metadata,g=l.containsRTL,p=Math.ceil(u/50);for(let m=1;m<p;m++){const _=i+m*50;r[o++]=new bl(_,d,h,g)}r[o++]=new bl(c,d,h,g)}else r[o++]=l;i=c}return r}function aqe(n){return n<32?n!==9:n===127||n>=8234&&n<=8238||n>=8294&&n<=8297||n>=8206&&n<=8207||n===1564}function P9i(n,e){const t=[];let i=new bl(0,"",0,!1),r=0;for(const o of e){const s=o.endIndex;for(;r<s;r++){const a=n.charCodeAt(r);aqe(a)&&(r>i.endIndex&&(i=new bl(r,o.type,o.metadata,o.containsRTL),t.push(i)),i=new bl(r+1,"mtkcontrol",o.metadata,!1),t.push(i))}r>i.endIndex&&(i=new bl(s,o.type,o.metadata,o.containsRTL),t.push(i))}return t}function M9i(n,e,t,i){const r=n.continuesWithWrappedLine,o=n.fauxIndentLength,s=n.tabSize,a=n.startVisibleColumn,l=n.useMonospaceOptimizations,c=n.selectionsOnLine,u=n.renderWhitespace===1,d=n.renderWhitespace===3,h=n.renderSpaceWidth!==n.spaceWidth,g=[];let p=0,m=0,_=i[m].type,v=i[m].containsRTL,b=i[m].endIndex;const y=i.length;let C=!1,x=cu(e),k;x===-1?(C=!0,x=t,k=t):k=g_(e);let I=!1,L=0,D=c&&c[L],R=a%s;for(let M=o;M<t;M++){const O=e.charCodeAt(M);D&&M>=D.endOffset&&(L++,D=c&&c[L]);let B;if(M<x||M>k)B=!0;else if(O===9)B=!0;else if(O===32)if(u)if(I)B=!0;else{const F=M+1<t?e.charCodeAt(M+1):0;B=F===32||F===9}else B=!0;else B=!1;if(B&&c&&(B=!!D&&D.startOffset<=M&&D.endOffset>M),B&&d&&(B=C||M>k),B&&v&&M>=x&&M<=k&&(B=!1),I){if(!B||!l&&R>=s){if(h){const F=p>0?g[p-1].endIndex:o;for(let H=F+1;H<=M;H++)g[p++]=new bl(H,"mtkw",1,!1)}else g[p++]=new bl(M,"mtkw",1,!1);R=R%s}}else(M===b||B&&M>o)&&(g[p++]=new bl(M,_,0,v),R=R%s);for(O===9?R=s:aw(O)?R+=2:R++,I=B;M===b&&(m++,m<y);)_=i[m].type,v=i[m].containsRTL,b=i[m].endIndex}let P=!1;if(I)if(r&&u){const M=t>0?e.charCodeAt(t-1):0,O=t>1?e.charCodeAt(t-2):0;M===32&&O!==32&&O!==9||(P=!0)}else P=!0;if(P)if(h){const M=p>0?g[p-1].endIndex:o;for(let O=M+1;O<=t;O++)g[p++]=new bl(O,"mtkw",1,!1)}else g[p++]=new bl(t,"mtkw",1,!1);else g[p++]=new bl(t,_,0,v);return g}function F9i(n,e,t,i){i.sort(Jd.compare);const r=L9i.normalize(n,i),o=r.length;let s=0;const a=[];let l=0,c=0;for(let d=0,h=t.length;d<h;d++){const g=t[d],p=g.endIndex,m=g.type,_=g.metadata,v=g.containsRTL;for(;s<o&&r[s].startOffset<p;){const b=r[s];if(b.startOffset>c&&(c=b.startOffset,a[l++]=new bl(c,m,_,v)),b.endOffset+1<=p)c=b.endOffset+1,a[l++]=new bl(c,m+" "+b.className,_|b.metadata,v),s++;else{c=p,a[l++]=new bl(c,m+" "+b.className,_|b.metadata,v);break}}p>c&&(c=p,a[l++]=new bl(c,m,_,v))}const u=t[t.length-1].endIndex;if(s<o&&r[s].startOffset===u)for(;s<o&&r[s].startOffset===u;){const d=r[s];a[l++]=new bl(c,d.className,d.metadata,!1),s++}return a}function B9i(n,e){const t=n.fontIsMonospace,i=n.canUseHalfwidthRightwardsArrow,r=n.containsForeignElements,o=n.lineContent,s=n.len,a=n.isOverflowing,l=n.overflowingCharCount,c=n.parts,u=n.fauxIndentLength,d=n.tabSize,h=n.startVisibleColumn,g=n.containsRTL,p=n.spaceWidth,m=n.renderSpaceCharCode,_=n.renderWhitespace,v=n.renderControlCharacters,b=new fv(s+1,c.length);let y=!1,C=0,x=h,k=0,I=0,L=0;g?e.appendString('<span dir="ltr">'):e.appendString("<span>");for(let D=0,R=c.length;D<R;D++){const P=c[D],M=P.endIndex,O=P.type,B=P.containsRTL,F=_!==0&&P.isWhitespace(),H=F&&!t&&(O==="mtkw"||!r),V=C===M&&P.isPseudoAfter();if(k=0,e.appendString("<span "),B&&e.appendString('style="unicode-bidi:isolate" '),e.appendString('class="'),e.appendString(H?"mtkz":O),e.appendASCIICharCode(34),F){let $=0;{let j=C,Y=x;for(;j<M;j++){const se=(o.charCodeAt(j)===9?d-Y%d:1)|0;$+=se,j>=u&&(Y+=se)}}for(H&&(e.appendString(' style="width:'),e.appendString(String(p*$)),e.appendString('px"')),e.appendASCIICharCode(62);C<M;C++){b.setColumnInfo(C+1,D-L,k,I),L=0;const j=o.charCodeAt(C);let Y,ne;if(j===9){Y=d-x%d|0,ne=Y,!i||ne>1?e.appendCharCode(8594):e.appendCharCode(65515);for(let se=2;se<=ne;se++)e.appendCharCode(160)}else Y=2,ne=1,e.appendCharCode(m),e.appendCharCode(8204);k+=Y,I+=ne,C>=u&&(x+=ne)}}else for(e.appendASCIICharCode(62);C<M;C++){b.setColumnInfo(C+1,D-L,k,I),L=0;const $=o.charCodeAt(C);let j=1,Y=1;switch($){case 9:j=d-x%d,Y=j;for(let ne=1;ne<=j;ne++)e.appendCharCode(160);break;case 32:e.appendCharCode(160);break;case 60:e.appendString("&lt;");break;case 62:e.appendString("&gt;");break;case 38:e.appendString("&amp;");break;case 0:v?e.appendCharCode(9216):e.appendString("&#00;");break;case 65279:case 8232:case 8233:case 133:e.appendCharCode(65533);break;default:aw($)&&Y++,v&&$<32?e.appendCharCode(9216+$):v&&$===127?e.appendCharCode(9249):v&&aqe($)?(e.appendString("[U+"),e.appendString($9i($)),e.appendString("]"),j=8,Y=j):e.appendCharCode($)}k+=j,I+=Y,C>=u&&(x+=Y)}V?L++:L=0,C>=s&&!y&&P.isPseudoAfter()&&(y=!0,b.setColumnInfo(C+1,D,k,I)),e.appendString("</span>")}return y||b.setColumnInfo(s+1,c.length-1,k,I),a&&(e.appendString('<span class="mtkoverflow">'),e.appendString(E("showMore","Show more ({0})",V9i(l))),e.appendString("</span>")),e.appendString("</span>"),new dse(b,g,r)}function $9i(n){return n.toString(16).toUpperCase().padStart(4,"0")}function V9i(n){return n<1024?E("overflow.chars","{0} chars",n):n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/1024/1024).toFixed(1)} MB`}class yDe{constructor(e,t,i,r){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=i|0,this.height=r|0}}class H9i{constructor(e,t){this.tabSize=e,this.data=t}}class Jme{constructor(e,t,i,r,o,s,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=r,this.startVisibleColumn=o,this.tokens=s,this.inlineDecorations=a}}class gf{constructor(e,t,i,r,o,s,a,l,c,u){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=r,this.isBasicASCII=gf.isBasicASCII(i,s),this.containsRTL=gf.containsRTL(i,this.isBasicASCII,o),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=u}static isBasicASCII(e,t){return t?f5(e):!0}static containsRTL(e,t,i){return!t&&i?qD(e):!1}}class OO{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class W9i{constructor(e,t,i,r){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=r}toInlineDecoration(e){return new OO(new q(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class lqe{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class OM{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.color<t.color?-1:e.color>t.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Qs(e.data,t.data)}static equalsArr(e,t){return Qs(e,t,OM.equals)}}function z9i(n){return Array.isArray(n)}function j9i(n){return!z9i(n)}function cqe(n){return typeof n=="string"}function CDe(n){return!cqe(n)}function nI(n){return!n}function RC(n,e){return n.ignoreCase&&e?e.toLowerCase():e}function wDe(n){return n.replace(/[&<>'"_]/g,"-")}function U9i(n,e){console.log(`${n.languageId}: ${e}`)}function $o(n,e){return new Error(`${n.languageId}: ${e}`)}function R1(n,e,t,i,r){const o=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let s=null;return e.replace(o,function(a,l,c,u,d,h,g,p,m){return nI(c)?nI(u)?!nI(d)&&d<i.length?RC(n,i[d]):!nI(g)&&n&&typeof n[g]=="string"?n[g]:(s===null&&(s=r.split("."),s.unshift(r)),!nI(h)&&h<s.length?RC(n,s[h]):""):RC(n,t):"$"})}function SB(n,e){let t=e;for(;t&&t.length>0;){const i=n.tokenizer[t];if(i)return i;const r=t.lastIndexOf(".");r<0?t=null:t=t.substr(0,r)}return null}function q9i(n,e){let t=e;for(;t&&t.length>0;){if(n.stateNames[t])return!0;const r=t.lastIndexOf(".");r<0?t=null:t=t.substr(0,r)}return!1}var K9i=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},G9i=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},hse;const uqe=5;class PM{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new AL(e,t);let i=AL.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let r=this._entries[i];return r||(r=new AL(e,t),this._entries[i]=r,r)}}PM._INSTANCE=new PM(uqe);class AL{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}equals(e){return AL._equals(this,e)}push(e){return PM.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return PM.create(this.parent,e)}}class BI{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 BI(this.languageId,this.state)}}class N1{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(t!==null)return new PO(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new PO(e,t);const i=AL.getStackElementId(e);let r=this._entries[i];return r||(r=new PO(e,null),this._entries[i]=r,r)}}N1._INSTANCE=new N1(uqe);class PO{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:N1.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof PO)||!this.stack.equals(e.stack)?!1:this.embeddedLanguageData===null&&e.embeddedLanguageData===null?!0:this.embeddedLanguageData===null||e.embeddedLanguageData===null?!1:this.embeddedLanguageData.equals(e.embeddedLanguageData)}}class Y9i{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 bM(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,r){const o=i.languageId,s=i.state,a=ps.get(o);if(!a)return this.enterLanguage(o),this.emit(r,""),s;const l=a.tokenize(e,t,s);if(r!==0)for(const c of l.tokens)this._tokens.push(new bM(c.offset+r,c.type,c.language));else this._tokens=this._tokens.concat(l.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,l.endState}finalize(e){return new Tme(this._tokens,e)}}class UV{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 i=this._theme.match(this._currentLanguageId,t)|1024;this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const r=e!==null?e.length:0,o=t.length,s=i!==null?i.length:0;if(r===0&&o===0&&s===0)return new Uint32Array(0);if(r===0&&o===0)return i;if(o===0&&s===0)return e;const a=new Uint32Array(r+o+s);e!==null&&a.set(e);for(let l=0;l<o;l++)a[r+l]=t[l];return i!==null&&a.set(i,r+o),a}nestedLanguageTokenize(e,t,i,r){const o=i.languageId,s=i.state,a=ps.get(o);if(!a)return this.enterLanguage(o),this.emit(r,""),s;const l=a.tokenizeEncoded(e,t,s);if(r!==0)for(let c=0,u=l.tokens.length;c<u;c+=2)l.tokens[c]+=r;return this._prependTokens=UV._merge(this._prependTokens,this._tokens,l.tokens),this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0,l.endState}finalize(e){return new DU(UV._merge(this._prependTokens,this._tokens,null),e)}}let MM=hse=class extends Ae{constructor(e,t,i,r,o){super(),this._configurationService=o,this._languageService=e,this._standaloneThemeService=t,this._languageId=i,this._lexer=r,this._embeddedLanguages=Object.create(null),this.embeddedLoaded=Promise.resolve(void 0);let s=!1;this._register(ps.onDidChange(a=>{if(s)return;let l=!1;for(let c=0,u=a.changedLanguages.length;c<u;c++){const d=a.changedLanguages[c];if(this._embeddedLanguages[d]){l=!0;break}}l&&(s=!0,ps.handleChange([this._languageId]),s=!1)})),this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}),this._register(this._configurationService.onDidChangeConfiguration(a=>{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=ps.get(t);if(i){if(i instanceof hse){const r=i.getLoadStatus();r.loaded===!1&&e.push(r.promise)}continue}ps.isResolved(t)||e.push(ps.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=PM.create(null,this._lexer.start);return N1.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return Xme(this._languageId,i);const r=new Y9i,o=this._tokenize(e,t,i,r);return r.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return eq(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const r=new UV(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,r);return r.finalize(o)}_tokenize(e,t,i,r){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,r):this._myTokenize(e,t,i,0,r)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=SB(this._lexer,t.stack.state),!i))throw $o(this._lexer,"tokenizer state is not defined: "+t.stack.state);let r=-1,o=!1;for(const s of i){if(!CDe(s.action)||s.action.nextEmbedded!=="@pop")continue;o=!0;let a=s.regex;const l=s.regex.source;if(l.substr(0,4)==="^(?:"&&l.substr(l.length-1,1)===")"){const u=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),u)}const c=e.search(a);c===-1||c!==0&&s.matchOnlyAtLineStart||(r===-1||c<r)&&(r=c)}if(!o)throw $o(this._lexer,'no rule containing nextEmbedded: "@pop" in tokenizer embedded state: '+t.stack.state);return r}_nestedTokenize(e,t,i,r,o){const s=this._findLeavingNestedLanguageOffset(e,i);if(s===-1){const c=o.nestedLanguageTokenize(e,t,i.embeddedLanguageData,r);return N1.create(i.stack,new BI(i.embeddedLanguageData.languageId,c))}const a=e.substring(0,s);a.length>0&&o.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,r);const l=e.substring(s);return this._myTokenize(l,t,i,r+s,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,r,o){o.enterLanguage(this._languageId);const s=e.length,a=t&&this._lexer.includeLF?e+`
`:e,l=a.length;let c=i.embeddedLanguageData,u=i.stack,d=0,h=null,g=!0;for(;g||d<l;){const p=d,m=u.depth,_=h?h.groups.length:0,v=u.state;let b=null,y=null,C=null,x=null,k=null;if(h){b=h.matches;const D=h.groups.shift();y=D.matched,C=D.action,x=h.rule,h.groups.length===0&&(h=null)}else{if(!g&&d>=l)break;g=!1;let D=this._lexer.tokenizer[v];if(!D&&(D=SB(this._lexer,v),!D))throw $o(this._lexer,"tokenizer state is not defined: "+v);const R=a.substr(d);for(const P of D)if((d===0||!P.matchOnlyAtLineStart)&&(b=R.match(P.regex),b)){y=b[0],C=P.action;break}}if(b||(b=[""],y=""),C||(d<l&&(b=[a.charAt(d)],y=b[0]),C=this._lexer.defaultToken),y===null)break;for(d+=y.length;j9i(C)&&CDe(C)&&C.test;)C=C.test(y,b,v,d===l);let I=null;if(typeof C=="string"||Array.isArray(C))I=C;else if(C.group)I=C.group;else if(C.token!==null&&C.token!==void 0){if(C.tokenSubst?I=R1(this._lexer,C.token,y,b,v):I=C.token,C.nextEmbedded)if(C.nextEmbedded==="@pop"){if(!c)throw $o(this._lexer,"cannot pop embedded language if not inside one");c=null}else{if(c)throw $o(this._lexer,"cannot enter embedded language from within an embedded language");k=R1(this._lexer,C.nextEmbedded,y,b,v)}if(C.goBack&&(d=Math.max(0,d-C.goBack)),C.switchTo&&typeof C.switchTo=="string"){let D=R1(this._lexer,C.switchTo,y,b,v);if(D[0]==="@"&&(D=D.substr(1)),SB(this._lexer,D))u=u.switchTo(D);else throw $o(this._lexer,"trying to switch to a state '"+D+"' that is undefined in rule: "+this._safeRuleName(x))}else{if(C.transform&&typeof C.transform=="function")throw $o(this._lexer,"action.transform not supported");if(C.next)if(C.next==="@push"){if(u.depth>=this._lexer.maxStack)throw $o(this._lexer,"maximum tokenizer stack size reached: ["+u.state+","+u.parent.state+",...]");u=u.push(v)}else if(C.next==="@pop"){if(u.depth<=1)throw $o(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(x));u=u.pop()}else if(C.next==="@popall")u=u.popall();else{let D=R1(this._lexer,C.next,y,b,v);if(D[0]==="@"&&(D=D.substr(1)),SB(this._lexer,D))u=u.push(D);else throw $o(this._lexer,"trying to set a next state '"+D+"' that is undefined in rule: "+this._safeRuleName(x))}}C.log&&typeof C.log=="string"&&U9i(this._lexer,this._lexer.languageId+": "+R1(this._lexer,C.log,y,b,v))}if(I===null)throw $o(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(x));const L=D=>{const R=this._languageService.getLanguageIdByLanguageName(D)||this._languageService.getLanguageIdByMimeType(D)||D,P=this._getNestedEmbeddedLanguageData(R);if(d<l){const M=e.substr(d);return this._nestedTokenize(M,t,N1.create(u,P),r+d,o)}else return N1.create(u,P)};if(Array.isArray(I)){if(h&&h.groups.length>0)throw $o(this._lexer,"groups cannot be nested: "+this._safeRuleName(x));if(b.length!==I.length+1)throw $o(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(x));let D=0;for(let R=1;R<b.length;R++)D+=b[R].length;if(D!==y.length)throw $o(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(x));h={rule:x,matches:b,groups:[]};for(let R=0;R<I.length;R++)h.groups[R]={action:I[R],matched:b[R+1]};d-=y.length;continue}else{if(I==="@rematch"&&(d-=y.length,y="",b=null,I="",k!==null))return L(k);if(y.length===0){if(l===0||m!==u.depth||v!==u.state||(h?h.groups.length:0)!==_)continue;throw $o(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(x))}let D=null;if(cqe(I)&&I.indexOf("@brackets")===0){const R=I.substr(9),P=Q9i(this._lexer,y);if(!P)throw $o(this._lexer,"@brackets token returned but no bracket defined as: "+y);D=wDe(P.token+R)}else{const R=I===""?"":I+this._lexer.tokenPostfix;D=wDe(R)}p<s&&o.emit(p+r,D)}if(k!==null)return L(k)}return N1.create(u,c)}_getNestedEmbeddedLanguageData(e){if(!this._languageService.isRegisteredLanguageId(e))return new BI(e,JD);e!==this._languageId&&(this._languageService.requestBasicLanguageFeatures(e),ps.getOrCreate(e),this._embeddedLanguages[e]=!0);const t=ps.get(e);return t?new BI(e,t.getInitialState()):new BI(e,JD)}};MM=hse=K9i([G9i(4,Ui)],MM);function Q9i(n,e){if(!e)return null;e=RC(n,e);const t=n.brackets;for(const i of t){if(i.open===e)return{token:i.token,bracketType:1};if(i.close===e)return{token:i.token,bracketType:-1}}return null}var X9i=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const bZ=R0("standaloneColorizer",{createHTML:n=>n});class e_e{static colorizeElement(e,t,i,r){r=r||{};const o=r.theme||"vs",s=r.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!s)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(s)||s;e.setTheme(o);const l=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+o;const c=u=>{var d;const h=(d=bZ==null?void 0:bZ.createHTML(u))!==null&&d!==void 0?d:u;i.innerHTML=h};return this.colorize(t,l||"",a,r).then(c,u=>console.error(u))}static colorize(e,t,i,r){return X9i(this,void 0,void 0,function*(){const o=e.languageIdCodec;let s=4;r&&typeof r.tabSize=="number"&&(s=r.tabSize),Ome(t)&&(t=t.substr(1));const a=ab(t);if(!e.isRegisteredLanguageId(i))return SDe(a,s,o);const l=yield ps.getOrCreate(i);return l?Z9i(a,s,l,o):SDe(a,s,o)})}static colorizeLine(e,t,i,r,o=4){const s=gf.isBasicASCII(e,t),a=gf.containsRTL(e,s,i);return tq(new tS(!1,!0,e,!1,s,a,0,r,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){const r=e.getLineContent(t);e.tokenization.forceTokenization(t);const s=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(r,e.mightContainNonBasicASCII(),e.mightContainRTL(),s,i)}}function Z9i(n,e,t,i){return new Promise((r,o)=>{const s=()=>{const a=J9i(n,e,t,i);if(t instanceof MM){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(s,o);return}}r(a)};s()})}function SDe(n,e,t){let i=[];const o=new Uint32Array(2);o[0]=0,o[1]=33587200;for(let s=0,a=n.length;s<a;s++){const l=n[s];o[0]=l.length;const c=new el(o,l,t),u=gf.isBasicASCII(l,!0),d=gf.containsRTL(l,u,!0),h=tq(new tS(!1,!0,l,!1,u,d,0,c,[],e,0,0,0,0,-1,"none",!1,!1,null));i=i.concat(h.html),i.push("<br/>")}return i.join("")}function J9i(n,e,t,i){let r=[],o=t.getInitialState();for(let s=0,a=n.length;s<a;s++){const l=n[s],c=t.tokenizeEncoded(l,!0,o);el.convertToEndOffset(c.tokens,l.length);const u=new el(c.tokens,l,i),d=gf.isBasicASCII(l,!0),h=gf.containsRTL(l,d,!0),g=tq(new tS(!1,!0,l,!1,d,h,0,u.inflate(),[],e,0,0,0,0,-1,"none",!1,!1,null));r=r.concat(g.html),r.push("<br/>"),o=c.endState}return r.join("")}const EDe=2e4;let aE,O8,fse,P8,gse;function e7i(n){aE=document.createElement("div"),aE.className="monaco-aria-container";const e=()=>{const i=document.createElement("div");return i.className="monaco-alert",i.setAttribute("role","alert"),i.setAttribute("aria-atomic","true"),aE.appendChild(i),i};O8=e(),fse=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),aE.appendChild(i),i};P8=t(),gse=t(),n.appendChild(aE)}function Pc(n){aE&&(O8.textContent!==n?(Gl(fse),qV(O8,n)):(Gl(O8),qV(fse,n)))}function fw(n){aE&&(P8.textContent!==n?(Gl(gse),qV(P8,n)):(Gl(P8),qV(gse,n)))}function qV(n,e){Gl(n),e.length>EDe&&(e=e.substr(0,EDe)),n.textContent=e,n.style.visibility="hidden",n.style.visibility="visible"}const t_e=Vi("markerDecorationsService");var t7i=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},n7i=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let FM=class{constructor(e,t){}dispose(){}};FM.ID="editor.contrib.markerDecorations";FM=t7i([n7i(1,t_e)],FM);gr(FM.ID,FM,0);class dqe extends Ae{constructor(e,t){super(),this._onDidChange=this._register(new be),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(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let i=!1,r=!1;const o=()=>{if(i&&!r)try{i=!1,r=!0,t()}finally{requestAnimationFrame(()=>{r=!1,o()})}};this._resizeObserver=new ResizeObserver(s=>{e=s&&s[0]&&s[0].contentRect?s[0].contentRect:null,i=!0,o()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,r=0;t?(i=t.width,r=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,r=this._referenceDomElement.clientHeight),i=Math.max(5,i),r=Math.max(5,r),(this._width!==i||this._height!==r)&&(this._width=i,this._height=r,e&&this._onDidChange.fire())}}class NC{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=NC._read(e,this.key),i=o=>NC._read(e,o),r=(o,s)=>NC._write(e,o,s);this.migrate(t,i,r)}static _read(e,t){if(typeof e>"u")return;const i=t.indexOf(".");if(i>=0){const r=t.substring(0,i);return this._read(e[r],t.substring(i+1))}return e[t]}static _write(e,t,i){const r=t.indexOf(".");if(r>=0){const o=t.substring(0,r);e[o]=e[o]||{},this._write(e[o],t.substring(r+1),i);return}e[t]=i}}NC.items=[];function nS(n,e){NC.items.push(new NC(n,e))}function Mg(n,e){nS(n,(t,i,r)=>{if(typeof t<"u"){for(const[o,s]of e)if(t===o){r(n,s);return}}})}function i7i(n){NC.items.forEach(e=>e.apply(n))}Mg("wordWrap",[[!0,"on"],[!1,"off"]]);Mg("lineNumbers",[[!0,"on"],[!1,"off"]]);Mg("cursorBlinking",[["visible","solid"]]);Mg("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);Mg("renderLineHighlight",[[!0,"line"],[!1,"none"]]);Mg("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);Mg("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);Mg("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Mg("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Mg("autoIndent",[[!1,"advanced"],[!0,"full"]]);Mg("matchBrackets",[[!0,"always"],[!1,"never"]]);Mg("renderFinalNewline",[[!0,"on"],[!1,"off"]]);Mg("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);nS("autoClosingBrackets",(n,e,t)=>{n===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});nS("renderIndentGuides",(n,e,t)=>{typeof n<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!n))});nS("highlightActiveIndentGuide",(n,e,t)=>{typeof n<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!n))});const r7i={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"};nS("suggest.filteredTypes",(n,e,t)=>{if(n&&typeof n=="object"){for(const i of Object.entries(r7i))n[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});nS("quickSuggestions",(n,e,t)=>{if(typeof n=="boolean"){const i=n?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});nS("experimental.stickyScroll.enabled",(n,e,t)=>{typeof n=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",n))});nS("experimental.stickyScroll.maxLineCount",(n,e,t)=>{typeof n=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",n))});class o7i{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new be,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const e2=new o7i,N0=Vi("accessibilityService"),b5=new Ft("accessibilityModeEnabled",!1);var s7i=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},a7i=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let pse=class extends Ae{constructor(e,t,i,r){super(),this._accessibilityService=r,this._onDidChange=this._register(new be),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new be),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new Nje,this.isSimpleWidget=e,this._containerObserver=this._register(new dqe(i,t.dimension)),this._rawOptions=xDe(t),this._validatedOptions=O1.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(Yf.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(e2.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(Uoe.onDidChange(()=>this._recomputeOptions())),this._register(SM.onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=O1.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=QE.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),r={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:e2.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return O1.computeOptions(this._validatedOptions,r)}_readEnvConfiguration(){return{extraEditorClassName:c7i(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:YE||wg,pixelRatio:SM.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return Uoe.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=xDe(e);O1.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=O1.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=l7i(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())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};pse=s7i([a7i(3,N0)],pse);function l7i(n){let e=0;for(;n;)n=Math.floor(n/10),e++;return e||1}function c7i(){let n="";return!b0&&!oUe&&(n+="no-user-select "),b0&&(n+="no-minimap-shadow ",n+="enable-user-select "),Qi&&(n+="mac "),n}class u7i{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class d7i{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 O1{static validateOptions(e){const t=new u7i;for(const i of NI){const r=i.name==="_never_"?void 0:e[i.name];t._write(i.id,i.validate(r))}return t}static computeOptions(e,t){const i=new d7i;for(const r of NI)i._write(r.id,r.compute(t,i,e._read(r.id)));return i}static _deepEquals(e,t){if(typeof e!="object"||typeof t!="object"||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)?Qs(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!O1._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let r=!1;for(const o of NI){const s=!O1._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=s,s&&(r=!0)}return r?new Rje(i):null}static applyUpdate(e,t){let i=!1;for(const r of NI)if(t.hasOwnProperty(r.name)){const o=r.applyUpdate(e[r.name],t[r.name]);e[r.name]=o.newValue,i=i||o.didChange}return i}}function xDe(n){const e=py(n);return i7i(e),e}function fa(n,e,t){let i=null,r=null;if(typeof t.value=="function"?(i="value",r=t.value,r.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(i="get",r=t.get),!r)throw new Error("not supported");const o=`$memoize$${e}`;t[i]=function(...s){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,s)}),this[o]}}var h7i=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},yo;(function(n){n.Tap="-monaco-gesturetap",n.Change="-monaco-gesturechange",n.Start="-monaco-gesturestart",n.End="-monaco-gesturesend",n.Contextmenu="-monaco-gesturecontextmenu"})(yo||(yo={}));class bo extends Ae{constructor(){super(),this.dispatched=!1,this.targets=new Hu,this.ignoreTargets=new Hu,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(We(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(We(document,"touchend",e=>this.onTouchEnd(e))),this._register(We(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){if(!bo.isTouchDevice())return Ae.None;bo.INSTANCE||(bo.INSTANCE=new bo);const t=bo.INSTANCE.targets.push(e);return Gn(t)}static ignoreTarget(e){if(!bo.isTouchDevice())return Ae.None;bo.INSTANCE||(bo.INSTANCE=new bo);const t=bo.INSTANCE.ignoreTargets.push(e);return Gn(t)}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,r=e.targetTouches.length;i<r;i++){const o=e.targetTouches.item(i);this.activeTouches[o.identifier]={id:o.identifier,initialTarget:o.target,initialTimeStamp:t,initialPageX:o.pageX,initialPageY:o.pageY,rollingTimestamps:[t],rollingPageX:[o.pageX],rollingPageY:[o.pageY]};const s=this.newGestureEvent(yo.Start,o.target);s.pageX=o.pageX,s.pageY=o.pageY,this.dispatchEvent(s)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e){const t=Date.now(),i=Object.keys(this.activeTouches).length;for(let r=0,o=e.changedTouches.length;r<o;r++){const s=e.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(s.identifier))){console.warn("move of an UNKNOWN touch",s);continue}const a=this.activeTouches[s.identifier],l=Date.now()-a.initialTimeStamp;if(l<bo.HOLD_DELAY&&Math.abs(a.initialPageX-Pf(a.rollingPageX))<30&&Math.abs(a.initialPageY-Pf(a.rollingPageY))<30){const c=this.newGestureEvent(yo.Tap,a.initialTarget);c.pageX=Pf(a.rollingPageX),c.pageY=Pf(a.rollingPageY),this.dispatchEvent(c)}else if(l>=bo.HOLD_DELAY&&Math.abs(a.initialPageX-Pf(a.rollingPageX))<30&&Math.abs(a.initialPageY-Pf(a.rollingPageY))<30){const c=this.newGestureEvent(yo.Contextmenu,a.initialTarget);c.pageX=Pf(a.rollingPageX),c.pageY=Pf(a.rollingPageY),this.dispatchEvent(c)}else if(i===1){const c=Pf(a.rollingPageX),u=Pf(a.rollingPageY),d=Pf(a.rollingTimestamps)-a.rollingTimestamps[0],h=c-a.rollingPageX[0],g=u-a.rollingPageY[0],p=[...this.targets].filter(m=>a.initialTarget instanceof Node&&m.contains(a.initialTarget));this.inertia(p,t,Math.abs(h)/d,h>0?1:-1,c,Math.abs(g)/d,g>0?1:-1,u)}this.dispatchEvent(this.newGestureEvent(yo.End,a.initialTarget)),delete this.activeTouches[s.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===yo.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>bo.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===yo.Change||e.type===yo.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;for(const t of this.targets)t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}}inertia(e,t,i,r,o,s,a,l){this.handle=Sg(()=>{const c=Date.now(),u=c-t;let d=0,h=0,g=!0;i+=bo.SCROLL_FRICTION*u,s+=bo.SCROLL_FRICTION*u,i>0&&(g=!1,d=r*i*u),s>0&&(g=!1,h=a*s*u);const p=this.newGestureEvent(yo.Change);p.translationX=d,p.translationY=h,e.forEach(m=>m.dispatchEvent(p)),g||this.inertia(e,c,i,r,o+d,s,a,l+h)})}onTouchMove(e){const t=Date.now();for(let i=0,r=e.changedTouches.length;i<r;i++){const o=e.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn("end of an UNKNOWN touch",o);continue}const s=this.activeTouches[o.identifier],a=this.newGestureEvent(yo.Change,s.initialTarget);a.translationX=o.pageX-Pf(s.rollingPageX),a.translationY=o.pageY-Pf(s.rollingPageY),a.pageX=o.pageX,a.pageY=o.pageY,this.dispatchEvent(a),s.rollingPageX.length>3&&(s.rollingPageX.shift(),s.rollingPageY.shift(),s.rollingTimestamps.shift()),s.rollingPageX.push(o.pageX),s.rollingPageY.push(o.pageY),s.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}bo.SCROLL_FRICTION=-.005;bo.HOLD_DELAY=700;bo.CLEAR_TAP_COUNT_TIME=400;h7i([fa],bo,"isTouchDevice",null);class xA{constructor(){this._hooks=new nt,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,r,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=o;let s=e;try{e.setPointerCapture(t),this._hooks.add(Gn(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{s=window}this._hooks.add(We(s,Lt.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(We(s,Lt.POINTER_UP,a=>this.stopMonitoring(!0)))}}function n_e(n){return`--vscode-${n.replace(/\./g,"-")}`}function Bt(n){return`var(${n_e(n)})`}function f7i(n,e){return`var(${n_e(n)}, ${e})`}const hqe={ColorContribution:"base.contributions.colors"};class g7i{constructor(){this._onDidChangeSchema=new be,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,r=!1,o){const s={id:e,description:i,defaults:t,needsTransparency:r,deprecationMessage:o};this.colorsById[e]=s;const a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults){const r=i.defaults[t.type];return Em(r,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,i)=>{const r=t.indexOf(".")===-1?0:1,o=i.indexOf(".")===-1?0:1;return r!==o?r-o:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(`
`)}}const nq=new g7i;ds.add(hqe.ColorContribution,nq);function re(n,e,t,i,r){return nq.registerColor(n,e,t,i,r)}const pt=re("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},E("foreground","Overall foreground color. This color is only used if not overridden by a component."));re("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},E("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));const p7i=re("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},E("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));re("descriptionForeground",{light:"#717171",dark:mn(pt,.7),hcDark:mn(pt,.7),hcLight:mn(pt,.7)},E("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const Q1=re("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},E("iconForeground","The default color for icons in the workbench.")),Kh=re("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},E("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),ji=re("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},E("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),Ho=re("contrastActiveBorder",{light:null,dark:null,hcDark:Kh,hcLight:Kh},E("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));re("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},E("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."));re("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:De.black,hcLight:"#292929"},E("textSeparatorForeground","Color for text separators."));const m7i=re("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},E("textLinkForeground","Foreground color for links in text."));re("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},E("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));re("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},E("textPreformatForeground","Foreground color for preformatted text segments."));re("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},E("textBlockQuoteBackground","Background color for block quotes in text."));re("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:De.white,hcLight:"#292929"},E("textBlockQuoteBorder","Border color for block quotes in text."));re("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:De.black,hcLight:"#F2F2F2"},E("textCodeBlockBackground","Background color for code blocks in text."));const Ov=re("widget.shadow",{dark:mn(De.black,.36),light:mn(De.black,.16),hcDark:null,hcLight:null},E("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),i_e=re("widget.border",{dark:null,light:null,hcDark:ji,hcLight:ji},E("widgetBorder","Border color of widgets such as find/replace inside the editor.")),fqe=re("input.background",{dark:"#3C3C3C",light:De.white,hcDark:De.black,hcLight:De.white},E("inputBoxBackground","Input box background.")),gqe=re("input.foreground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("inputBoxForeground","Input box foreground.")),pqe=re("input.border",{dark:null,light:null,hcDark:ji,hcLight:ji},E("inputBoxBorder","Input box border.")),r_e=re("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:ji,hcLight:ji},E("inputBoxActiveOptionBorder","Border color of activated options in input fields."));re("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},E("inputOption.hoverBackground","Background color of activated options in input fields."));const IE=re("inputOption.activeBackground",{dark:mn(Kh,.4),light:mn(Kh,.2),hcDark:De.transparent,hcLight:De.transparent},E("inputOption.activeBackground","Background hover color of options in input fields.")),o_e=re("inputOption.activeForeground",{dark:De.white,light:De.black,hcDark:pt,hcLight:pt},E("inputOption.activeForeground","Foreground color of activated options in input fields."));re("input.placeholderForeground",{light:mn(pt,.5),dark:mn(pt,.5),hcDark:mn(pt,.7),hcLight:mn(pt,.7)},E("inputPlaceholderForeground","Input box foreground color for placeholder text."));const _7i=re("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:De.black,hcLight:De.white},E("inputValidationInfoBackground","Input validation background color for information severity.")),v7i=re("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:pt},E("inputValidationInfoForeground","Input validation foreground color for information severity.")),b7i=re("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:ji,hcLight:ji},E("inputValidationInfoBorder","Input validation border color for information severity.")),y7i=re("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:De.black,hcLight:De.white},E("inputValidationWarningBackground","Input validation background color for warning severity.")),C7i=re("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:pt},E("inputValidationWarningForeground","Input validation foreground color for warning severity.")),w7i=re("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:ji,hcLight:ji},E("inputValidationWarningBorder","Input validation border color for warning severity.")),S7i=re("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:De.black,hcLight:De.white},E("inputValidationErrorBackground","Input validation background color for error severity.")),E7i=re("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:pt},E("inputValidationErrorForeground","Input validation foreground color for error severity.")),x7i=re("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:ji,hcLight:ji},E("inputValidationErrorBorder","Input validation border color for error severity.")),Pv=re("dropdown.background",{dark:"#3C3C3C",light:De.white,hcDark:De.black,hcLight:De.white},E("dropdownBackground","Dropdown background.")),k7i=re("dropdown.listBackground",{dark:null,light:null,hcDark:De.black,hcLight:De.white},E("dropdownListBackground","Dropdown list background.")),Fy=re("dropdown.foreground",{dark:"#F0F0F0",light:pt,hcDark:De.white,hcLight:pt},E("dropdownForeground","Dropdown foreground.")),$I=re("dropdown.border",{dark:Pv,light:"#CECECE",hcDark:ji,hcLight:ji},E("dropdownBorder","Dropdown border.")),kN=re("button.foreground",{dark:De.white,light:De.white,hcDark:De.white,hcLight:De.white},E("buttonForeground","Button foreground color.")),T7i=re("button.separator",{dark:mn(kN,.4),light:mn(kN,.4),hcDark:mn(kN,.4),hcLight:mn(kN,.4)},E("buttonSeparator","Button separator color.")),TN=re("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},E("buttonBackground","Button background color.")),I7i=re("button.hoverBackground",{dark:p_(TN,.2),light:Nk(TN,.2),hcDark:TN,hcLight:TN},E("buttonHoverBackground","Button background color when hovering.")),L7i=re("button.border",{dark:ji,light:ji,hcDark:ji,hcLight:ji},E("buttonBorder","Button border color.")),D7i=re("button.secondaryForeground",{dark:De.white,light:De.white,hcDark:De.white,hcLight:pt},E("buttonSecondaryForeground","Secondary button foreground color.")),mse=re("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:De.white},E("buttonSecondaryBackground","Secondary button background color.")),A7i=re("button.secondaryHoverBackground",{dark:p_(mse,.2),light:Nk(mse,.2),hcDark:null,hcLight:null},E("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),M8=re("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:De.black,hcLight:"#0F4A85"},E("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),R7i=re("badge.foreground",{dark:De.white,light:"#333",hcDark:De.white,hcLight:De.white},E("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),N7i=re("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},E("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),IN=re("scrollbarSlider.background",{dark:De.fromHex("#797979").transparent(.4),light:De.fromHex("#646464").transparent(.4),hcDark:mn(ji,.6),hcLight:mn(ji,.4)},E("scrollbarSliderBackground","Scrollbar slider background color.")),LN=re("scrollbarSlider.hoverBackground",{dark:De.fromHex("#646464").transparent(.7),light:De.fromHex("#646464").transparent(.7),hcDark:mn(ji,.8),hcLight:mn(ji,.8)},E("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),DN=re("scrollbarSlider.activeBackground",{dark:De.fromHex("#BFBFBF").transparent(.4),light:De.fromHex("#000000").transparent(.6),hcDark:ji,hcLight:ji},E("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),O7i=re("progressBar.background",{dark:De.fromHex("#0E70C0"),light:De.fromHex("#0E70C0"),hcDark:ji,hcLight:ji},E("progressBarBackground","Background color of the progress bar that can show for long running operations."));re("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},E("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Mv=re("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},E("editorError.foreground","Foreground color of error squigglies in the editor.")),P7i=re("editorError.border",{dark:null,light:null,hcDark:De.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},E("errorBorder","If set, color of double underlines for errors in the editor."));re("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},E("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Gh=re("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},E("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),BM=re("editorWarning.border",{dark:null,light:null,hcDark:De.fromHex("#FFCC00").transparent(.8),hcLight:De.fromHex("#FFCC00").transparent(.8)},E("warningBorder","If set, color of double underlines for warnings in the editor."));re("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},E("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const xd=re("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},E("editorInfo.foreground","Foreground color of info squigglies in the editor.")),$M=re("editorInfo.border",{dark:null,light:null,hcDark:De.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},E("infoBorder","If set, color of double underlines for infos in the editor.")),M7i=re("editorHint.foreground",{dark:De.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},E("editorHint.foreground","Foreground color of hint squigglies in the editor."));re("editorHint.border",{dark:null,light:null,hcDark:De.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},E("hintBorder","If set, color of double underlines for hints in the editor."));re("sash.hoverBorder",{dark:Kh,light:Kh,hcDark:Kh,hcLight:Kh},E("sashActiveBorder","Border color of active sashes."));const tl=re("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:De.black,hcLight:De.white},E("editorBackground","Editor background color.")),bp=re("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:De.white,hcLight:pt},E("editorForeground","Editor default foreground color."));re("editorStickyScroll.background",{light:tl,dark:tl,hcDark:tl,hcLight:tl},E("editorStickyScrollBackground","Sticky scroll background color for the editor"));re("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:De.fromHex("#0F4A85").transparent(.1)},E("editorStickyScrollHoverBackground","Sticky scroll on hover background color for the editor"));const As=re("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:De.white},E("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Fv=re("editorWidget.foreground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Bv=re("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:ji,hcLight:ji},E("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.")),F7i=re("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},E("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.")),kDe=re("quickInput.background",{dark:As,light:As,hcDark:As,hcLight:As},E("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),B7i=re("quickInput.foreground",{dark:Fv,light:Fv,hcDark:Fv,hcLight:Fv},E("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),$7i=re("quickInputTitle.background",{dark:new De(new Yi(255,255,255,.105)),light:new De(new Yi(0,0,0,.06)),hcDark:"#000000",hcLight:De.white},E("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),mqe=re("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:De.white,hcLight:"#0F4A85"},E("pickerGroupForeground","Quick picker color for grouping labels.")),V7i=re("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:De.white,hcLight:"#0F4A85"},E("pickerGroupBorder","Quick picker color for grouping borders.")),H7i=re("keybindingLabel.background",{dark:new De(new Yi(128,128,128,.17)),light:new De(new Yi(221,221,221,.4)),hcDark:De.transparent,hcLight:De.transparent},E("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),W7i=re("keybindingLabel.foreground",{dark:De.fromHex("#CCCCCC"),light:De.fromHex("#555555"),hcDark:De.white,hcLight:pt},E("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),z7i=re("keybindingLabel.border",{dark:new De(new Yi(51,51,51,.6)),light:new De(new Yi(204,204,204,.4)),hcDark:new De(new Yi(111,195,223)),hcLight:ji},E("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),j7i=re("keybindingLabel.bottomBorder",{dark:new De(new Yi(68,68,68,.6)),light:new De(new Yi(187,187,187,.4)),hcDark:new De(new Yi(111,195,223)),hcLight:pt},E("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),X1=re("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},E("editorSelectionBackground","Color of the editor selection.")),U7i=re("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:De.white},E("editorSelectionForeground","Color of the selected text for high contrast.")),_qe=re("editor.inactiveSelectionBackground",{light:mn(X1,.5),dark:mn(X1,.5),hcDark:mn(X1,.7),hcLight:mn(X1,.5)},E("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),s_e=re("editor.selectionHighlightBackground",{light:NDe(X1,tl,.3,.6),dark:NDe(X1,tl,.3,.6),hcDark:null,hcLight:null},E("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);re("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:Ho,hcLight:Ho},E("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));const q7i=re("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},E("editorFindMatch","Color of the current search match.")),$v=re("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},E("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),K7i=re("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},E("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),G7i=re("editor.findMatchBorder",{light:null,dark:null,hcDark:Ho,hcLight:Ho},E("editorFindMatchBorder","Border color of the current search match.")),Z1=re("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Ho,hcLight:Ho},E("findMatchHighlightBorder","Border color of the other search matches.")),Y7i=re("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:mn(Ho,.4),hcLight:mn(Ho,.4)},E("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);re("searchEditor.findMatchBackground",{light:mn($v,.66),dark:mn($v,.66),hcDark:$v,hcLight:$v},E("searchEditor.queryMatch","Color of the Search Editor query matches."));re("searchEditor.findMatchBorder",{light:mn(Z1,.66),dark:mn(Z1,.66),hcDark:Z1,hcLight:Z1},E("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));re("search.resultsInfoForeground",{light:pt,dark:mn(pt,.65),hcDark:pt,hcLight:pt},E("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));re("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},E("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);const KV=re("editorHoverWidget.background",{light:As,dark:As,hcDark:As,hcLight:As},E("hoverBackground","Background color of the editor hover."));re("editorHoverWidget.foreground",{light:Fv,dark:Fv,hcDark:Fv,hcLight:Fv},E("hoverForeground","Foreground color of the editor hover."));const Q7i=re("editorHoverWidget.border",{light:Bv,dark:Bv,hcDark:Bv,hcLight:Bv},E("hoverBorder","Border color of the editor hover."));re("editorHoverWidget.statusBarBackground",{dark:p_(KV,.2),light:Nk(KV,.05),hcDark:As,hcLight:As},E("statusBarBackground","Background color of the editor hover status bar."));const X7i=re("editorLink.activeForeground",{dark:"#4E94CE",light:De.blue,hcDark:De.cyan,hcLight:"#292929"},E("activeLinkForeground","Color of active links.")),By=re("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:De.white,hcLight:De.black},E("editorInlayHintForeground","Foreground color of inline hints")),$y=re("editorInlayHint.background",{dark:mn(M8,.1),light:mn(M8,.1),hcDark:mn(De.white,.1),hcLight:mn(M8,.1)},E("editorInlayHintBackground","Background color of inline hints")),Z7i=re("editorInlayHint.typeForeground",{dark:By,light:By,hcDark:By,hcLight:By},E("editorInlayHintForegroundTypes","Foreground color of inline hints for types")),J7i=re("editorInlayHint.typeBackground",{dark:$y,light:$y,hcDark:$y,hcLight:$y},E("editorInlayHintBackgroundTypes","Background color of inline hints for types")),eVi=re("editorInlayHint.parameterForeground",{dark:By,light:By,hcDark:By,hcLight:By},E("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters")),tVi=re("editorInlayHint.parameterBackground",{dark:$y,light:$y,hcDark:$y,hcLight:$y},E("editorInlayHintBackgroundParameter","Background color of inline hints for parameters"));re("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},E("editorLightBulbForeground","The color used for the lightbulb actions icon."));re("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},E("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));const _se=new De(new Yi(155,185,85,.2)),vse=new De(new Yi(255,0,0,.2)),nVi=re("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},E("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),iVi=re("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},E("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);re("diffEditor.insertedLineBackground",{dark:_se,light:_se,hcDark:null,hcLight:null},E("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);re("diffEditor.removedLineBackground",{dark:vse,light:vse,hcDark:null,hcLight:null},E("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);re("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},E("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));re("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},E("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const rVi=re("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},E("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),oVi=re("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},E("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));re("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},E("diffEditorInsertedOutline","Outline color for the text that got inserted."));re("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},E("diffEditorRemovedOutline","Outline color for text that got removed."));re("diffEditor.border",{dark:null,light:null,hcDark:ji,hcLight:ji},E("diffEditorBorder","Border color between the two text editors."));re("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},E("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));re("diffEditor.unchangedRegionBackground",{dark:"#3e3e3e",light:"#e4e4e4",hcDark:null,hcLight:null},E("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));re("diffEditor.unchangedRegionForeground",{dark:"#a3a2a2",light:"#4d4c4c",hcDark:null,hcLight:null},E("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));re("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},E("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const sVi=re("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},E("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.")),aVi=re("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},E("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.")),lVi=re("list.focusOutline",{dark:Kh,light:Kh,hcDark:Ho,hcLight:Ho},E("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.")),cVi=re("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},E("listFocusAndSelectionOutline","List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),Vy=re("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:De.fromHex("#0F4A85").transparent(.1)},E("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.")),Vv=re("list.activeSelectionForeground",{dark:De.white,light:De.white,hcDark:null,hcLight:null},E("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.")),AN=re("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},E("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.")),uVi=re("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:De.fromHex("#0F4A85").transparent(.1)},E("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.")),dVi=re("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},E("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.")),hVi=re("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},E("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.")),fVi=re("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},E("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.")),gVi=re("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},E("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.")),vqe=re("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:De.white.transparent(.1),hcLight:De.fromHex("#0F4A85").transparent(.1)},E("listHoverBackground","List/Tree background when hovering over items using the mouse.")),bqe=re("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},E("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),pVi=re("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},E("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),yp=re("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Kh,hcLight:Kh},E("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree.")),EB=re("list.focusHighlightForeground",{dark:yp,light:UVi(Vy,yp,"#BBE7FF"),hcDark:yp,hcLight:yp},E("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));re("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},E("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));re("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},E("listErrorForeground","Foreground color of list items containing errors."));re("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},E("listWarningForeground","Foreground color of list items containing warnings."));const mVi=re("listFilterWidget.background",{light:Nk(As,0),dark:p_(As,0),hcDark:As,hcLight:As},E("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),_Vi=re("listFilterWidget.outline",{dark:De.transparent,light:De.transparent,hcDark:"#f38518",hcLight:"#007ACC"},E("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),vVi=re("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:ji,hcLight:ji},E("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),bVi=re("listFilterWidget.shadow",{dark:Ov,light:Ov,hcDark:Ov,hcLight:Ov},E("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));re("list.filterMatchBackground",{dark:$v,light:$v,hcDark:null,hcLight:null},E("listFilterMatchHighlight","Background color of the filtered match."));re("list.filterMatchBorder",{dark:Z1,light:Z1,hcDark:ji,hcLight:Ho},E("listFilterMatchHighlightBorder","Border color of the filtered match."));const RN=re("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},E("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),yVi=re("tree.inactiveIndentGuidesStroke",{dark:mn(RN,.4),light:mn(RN,.4),hcDark:mn(RN,.4),hcLight:mn(RN,.4)},E("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),CVi=re("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},E("tableColumnsBorder","Table border color between columns.")),wVi=re("tree.tableOddRowsBackground",{dark:mn(pt,.04),light:mn(pt,.04),hcDark:null,hcLight:null},E("tableOddRowsBackgroundColor","Background color for odd table rows."));re("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},E("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. "));const SVi=re("checkbox.background",{dark:Pv,light:Pv,hcDark:Pv,hcLight:Pv},E("checkbox.background","Background color of checkbox widget."));re("checkbox.selectBackground",{dark:As,light:As,hcDark:As,hcLight:As},E("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const EVi=re("checkbox.foreground",{dark:Fy,light:Fy,hcDark:Fy,hcLight:Fy},E("checkbox.foreground","Foreground color of checkbox widget.")),xVi=re("checkbox.border",{dark:$I,light:$I,hcDark:$I,hcLight:$I},E("checkbox.border","Border color of checkbox widget."));re("checkbox.selectBorder",{dark:Q1,light:Q1,hcDark:Q1,hcLight:Q1},E("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const TDe=re("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,E("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),LE=re("quickInputList.focusForeground",{dark:Vv,light:Vv,hcDark:Vv,hcLight:Vv},E("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),VI=re("quickInputList.focusIconForeground",{dark:AN,light:AN,hcDark:AN,hcLight:AN},E("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),DE=re("quickInputList.focusBackground",{dark:VM(TDe,Vy),light:VM(TDe,Vy),hcDark:null,hcLight:null},E("quickInput.listFocusBackground","Quick picker background color for the focused item.")),kVi=re("menu.border",{dark:null,light:null,hcDark:ji,hcLight:ji},E("menuBorder","Border color of menus.")),TVi=re("menu.foreground",{dark:Fy,light:Fy,hcDark:Fy,hcLight:Fy},E("menuForeground","Foreground color of menu items.")),IVi=re("menu.background",{dark:Pv,light:Pv,hcDark:Pv,hcLight:Pv},E("menuBackground","Background color of menu items.")),LVi=re("menu.selectionForeground",{dark:Vv,light:Vv,hcDark:Vv,hcLight:Vv},E("menuSelectionForeground","Foreground color of the selected menu item in menus.")),DVi=re("menu.selectionBackground",{dark:Vy,light:Vy,hcDark:Vy,hcLight:Vy},E("menuSelectionBackground","Background color of the selected menu item in menus.")),AVi=re("menu.selectionBorder",{dark:null,light:null,hcDark:Ho,hcLight:Ho},E("menuSelectionBorder","Border color of the selected menu item in menus.")),RVi=re("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:ji,hcLight:ji},E("menuSeparatorBackground","Color of a separator menu item in menus.")),bse=re("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},E("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));re("toolbar.hoverOutline",{dark:null,light:null,hcDark:Ho,hcLight:Ho},E("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));re("toolbar.activeBackground",{dark:p_(bse,.1),light:Nk(bse,.1),hcDark:null,hcLight:null},E("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));re("editor.snippetTabstopHighlightBackground",{dark:new De(new Yi(124,124,124,.3)),light:new De(new Yi(10,50,100,.2)),hcDark:new De(new Yi(124,124,124,.3)),hcLight:new De(new Yi(10,50,100,.2))},E("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));re("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},E("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));re("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},E("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));re("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new De(new Yi(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},E("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const NVi=re("breadcrumb.foreground",{light:mn(pt,.8),dark:mn(pt,.8),hcDark:mn(pt,.8),hcLight:mn(pt,.8)},E("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),OVi=re("breadcrumb.background",{light:tl,dark:tl,hcDark:tl,hcLight:tl},E("breadcrumbsBackground","Background color of breadcrumb items.")),IDe=re("breadcrumb.focusForeground",{light:Nk(pt,.2),dark:p_(pt,.1),hcDark:p_(pt,.1),hcLight:p_(pt,.1)},E("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),PVi=re("breadcrumb.activeSelectionForeground",{light:Nk(pt,.2),dark:p_(pt,.1),hcDark:p_(pt,.1),hcLight:p_(pt,.1)},E("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));re("breadcrumbPicker.background",{light:As,dark:As,hcDark:As,hcLight:As},E("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const yqe=.5,LDe=De.fromHex("#40C8AE").transparent(yqe),DDe=De.fromHex("#40A6FF").transparent(yqe),ADe=De.fromHex("#606060").transparent(.4),Cp=.4,t2=1,HI=re("merge.currentHeaderBackground",{dark:LDe,light:LDe,hcDark:null,hcLight:null},E("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);re("merge.currentContentBackground",{dark:mn(HI,Cp),light:mn(HI,Cp),hcDark:mn(HI,Cp),hcLight:mn(HI,Cp)},E("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const WI=re("merge.incomingHeaderBackground",{dark:DDe,light:DDe,hcDark:null,hcLight:null},E("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);re("merge.incomingContentBackground",{dark:mn(WI,Cp),light:mn(WI,Cp),hcDark:mn(WI,Cp),hcLight:mn(WI,Cp)},E("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const zI=re("merge.commonHeaderBackground",{dark:ADe,light:ADe,hcDark:null,hcLight:null},E("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);re("merge.commonContentBackground",{dark:mn(zI,Cp),light:mn(zI,Cp),hcDark:mn(zI,Cp),hcLight:mn(zI,Cp)},E("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const n2=re("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},E("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));re("editorOverviewRuler.currentContentForeground",{dark:mn(HI,t2),light:mn(HI,t2),hcDark:n2,hcLight:n2},E("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));re("editorOverviewRuler.incomingContentForeground",{dark:mn(WI,t2),light:mn(WI,t2),hcDark:n2,hcLight:n2},E("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));re("editorOverviewRuler.commonContentForeground",{dark:mn(zI,t2),light:mn(zI,t2),hcDark:n2,hcLight:n2},E("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const a_e=re("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},E("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),NN=re("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},E("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),jI=re("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},E("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),iq=re("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},E("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),RDe=re("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},E("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),MVi=re("minimap.infoHighlight",{dark:xd,light:xd,hcDark:$M,hcLight:$M},E("minimapInfo","Minimap marker color for infos.")),FVi=re("minimap.warningHighlight",{dark:Gh,light:Gh,hcDark:BM,hcLight:BM},E("overviewRuleWarning","Minimap marker color for warnings.")),BVi=re("minimap.errorHighlight",{dark:new De(new Yi(255,18,18,.7)),light:new De(new Yi(255,18,18,.7)),hcDark:new De(new Yi(255,50,50,1)),hcLight:"#B5200D"},E("minimapError","Minimap marker color for errors.")),$Vi=re("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},E("minimapBackground","Minimap background color.")),VVi=re("minimap.foregroundOpacity",{dark:De.fromHex("#000f"),light:De.fromHex("#000f"),hcDark:De.fromHex("#000f"),hcLight:De.fromHex("#000f")},E("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));re("minimapSlider.background",{light:mn(IN,.5),dark:mn(IN,.5),hcDark:mn(IN,.5),hcLight:mn(IN,.5)},E("minimapSliderBackground","Minimap slider background color."));re("minimapSlider.hoverBackground",{light:mn(LN,.5),dark:mn(LN,.5),hcDark:mn(LN,.5),hcLight:mn(LN,.5)},E("minimapSliderHoverBackground","Minimap slider background color when hovering."));re("minimapSlider.activeBackground",{light:mn(DN,.5),dark:mn(DN,.5),hcDark:mn(DN,.5),hcLight:mn(DN,.5)},E("minimapSliderActiveBackground","Minimap slider background color when clicked on."));const HVi=re("problemsErrorIcon.foreground",{dark:Mv,light:Mv,hcDark:Mv,hcLight:Mv},E("problemsErrorIconForeground","The color used for the problems error icon.")),WVi=re("problemsWarningIcon.foreground",{dark:Gh,light:Gh,hcDark:Gh,hcLight:Gh},E("problemsWarningIconForeground","The color used for the problems warning icon.")),zVi=re("problemsInfoIcon.foreground",{dark:xd,light:xd,hcDark:xd,hcLight:xd},E("problemsInfoIconForeground","The color used for the problems info icon."));re("charts.foreground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("chartsForeground","The foreground color used in charts."));re("charts.lines",{dark:mn(pt,.5),light:mn(pt,.5),hcDark:mn(pt,.5),hcLight:mn(pt,.5)},E("chartsLines","The color used for horizontal lines in charts."));re("charts.red",{dark:Mv,light:Mv,hcDark:Mv,hcLight:Mv},E("chartsRed","The red color used in chart visualizations."));re("charts.blue",{dark:xd,light:xd,hcDark:xd,hcLight:xd},E("chartsBlue","The blue color used in chart visualizations."));re("charts.yellow",{dark:Gh,light:Gh,hcDark:Gh,hcLight:Gh},E("chartsYellow","The yellow color used in chart visualizations."));re("charts.orange",{dark:jI,light:jI,hcDark:jI,hcLight:jI},E("chartsOrange","The orange color used in chart visualizations."));re("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},E("chartsGreen","The green color used in chart visualizations."));re("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},E("chartsPurple","The purple color used in chart visualizations."));function jVi(n,e){var t,i,r,o;switch(n.op){case 0:return(t=Em(n.value,e))===null||t===void 0?void 0:t.darken(n.factor);case 1:return(i=Em(n.value,e))===null||i===void 0?void 0:i.lighten(n.factor);case 2:return(r=Em(n.value,e))===null||r===void 0?void 0:r.transparent(n.factor);case 3:{const s=Em(n.background,e);return s?(o=Em(n.value,e))===null||o===void 0?void 0:o.makeOpaque(s):Em(n.value,e)}case 4:for(const s of n.values){const a=Em(s,e);if(a)return a}return;case 6:return Em(e.defines(n.if)?n.then:n.else,e);case 5:{const s=Em(n.value,e);if(!s)return;const a=Em(n.background,e);return a?s.isDarkerThan(a)?De.getLighterColor(s,a,n.factor).transparent(n.transparency):De.getDarkerColor(s,a,n.factor).transparent(n.transparency):s.transparent(n.factor*n.transparency)}default:throw VU()}}function Nk(n,e){return{op:0,value:n,factor:e}}function p_(n,e){return{op:1,value:n,factor:e}}function mn(n,e){return{op:2,value:n,factor:e}}function VM(...n){return{op:4,values:n}}function UVi(n,e,t){return{op:6,if:n,then:e,else:t}}function NDe(n,e,t,i){return{op:5,value:n,background:e,factor:t,transparency:i}}function Em(n,e){if(n!==null){if(typeof n=="string")return n[0]==="#"?De.fromHex(n):e.getColor(n);if(n instanceof De)return n;if(typeof n=="object")return jVi(n,e)}}const Cqe="vscode://schemas/workbench-colors",wqe=ds.as(XU.JSONContribution);wqe.registerSchema(Cqe,nq.getColorSchema());const ODe=new so(()=>wqe.notifySchemaChanged(Cqe),200);nq.onDidChangeSchema(()=>{ODe.isScheduled()||ODe.schedule()});class rq{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new Sqe(this.x-window.scrollX,this.y-window.scrollY)}}class Sqe{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new rq(this.clientX+window.scrollX,this.clientY+window.scrollY)}}class qVi{constructor(e,t,i,r){this.x=e,this.y=t,this.width=i,this.height=r,this._editorPagePositionBrand=void 0}}class KVi{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function l_e(n){const e=Oa(n);return new qVi(e.left,e.top,e.width,e.height)}function c_e(n,e,t){const i=e.width/n.offsetWidth,r=e.height/n.offsetHeight,o=(t.x-e.x)/i,s=(t.y-e.y)/r;return new KVi(o,s)}class gw extends og{constructor(e,t,i){super(e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new rq(this.posx,this.posy),this.editorPos=l_e(i),this.relativePos=c_e(i,this.editorPos,this.pos)}}class GVi{constructor(e){this._editorViewDomNode=e}_create(e){return new gw(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return We(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return We(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return We(e,Lt.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return We(e,Lt.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return We(e,Lt.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return We(e,"mousemove",i=>t(this._create(i)))}}class YVi{constructor(e){this._editorViewDomNode=e}_create(e){return new gw(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return We(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return We(e,Lt.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return We(e,Lt.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return We(e,"pointermove",i=>t(this._create(i)))}}class QVi extends Ae{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new xA),this._keydownListener=null}startMonitoring(e,t,i,r,o){this._keydownListener=ua(e.ownerDocument,"keydown",s=>{s.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,s.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,s=>{r(new gw(s,!0,this._editorViewDomNode))},s=>{this._keydownListener.dispose(),o(s)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class y5{constructor(e){this._editor=e,this._instanceId=++y5._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new so(()=>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 i=this._rules.get(t);if(!i){const r=this._counter++;i=new XVi(t,`dyn-rule-${this._instanceId}-${r}`,OV(this._editor.getContainerDomNode())?this._editor.getContainerDomNode():void 0,e),this._rules.set(t,i)}return i}computeUniqueKey(e){return JSON.stringify(e)}garbageCollect(){for(const e of this._rules.values())e.hasReferences()||(this._rules.delete(e.key),e.dispose())}}y5._idPool=0;class XVi{constructor(e,t,i,r){this.key=e,this.className=t,this.properties=r,this._referenceCount=0,this._styleElement=Eg(i),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const r in t){const o=t[r];let s;typeof o=="object"?s=Bt(o.id):s=o;const a=ZVi(r);i+=`
${a}: ${s};`}return i+=`
}`,i}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function ZVi(n){return n.replace(/(^[A-Z])/,([e])=>e.toLowerCase()).replace(/([A-Z])/g,([e])=>`-${e.toLowerCase()}`)}class C5 extends Ae{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 i=0,r=e.length;i<r;i++){const o=e[i];switch(o.type){case 0:this.onCompositionStart(o)&&(t=!0);break;case 1:this.onCompositionEnd(o)&&(t=!0);break;case 2:this.onConfigurationChanged(o)&&(t=!0);break;case 3:this.onCursorStateChanged(o)&&(t=!0);break;case 4:this.onDecorationsChanged(o)&&(t=!0);break;case 5:this.onFlushed(o)&&(t=!0);break;case 6:this.onFocusChanged(o)&&(t=!0);break;case 7:this.onLanguageConfigurationChanged(o)&&(t=!0);break;case 8:this.onLineMappingChanged(o)&&(t=!0);break;case 9:this.onLinesChanged(o)&&(t=!0);break;case 10:this.onLinesDeleted(o)&&(t=!0);break;case 11:this.onLinesInserted(o)&&(t=!0);break;case 12:this.onRevealRangeRequest(o)&&(t=!0);break;case 13:this.onScrollChanged(o)&&(t=!0);break;case 15:this.onTokensChanged(o)&&(t=!0);break;case 14:this.onThemeChanged(o)&&(t=!0);break;case 16:this.onTokensColorsChanged(o)&&(t=!0);break;case 17:this.onZonesChanged(o)&&(t=!0);break;default:console.info("View received unknown event: "),console.info(o)}}t&&(this._shouldRender=!0)}}class ph extends C5{constructor(e){super(),this._context=e,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}}class ub{static write(e,t){e.setAttribute("data-mprt",String(t))}static read(e){const t=e.getAttribute("data-mprt");return t===null?0:parseInt(t,10)}static collect(e,t){const i=[];let r=0;for(;e&&e!==e.ownerDocument.body&&e!==t;)e.nodeType===e.ELEMENT_NODE&&(i[r++]=this.read(e)),e=e.parentElement;const o=new Uint8Array(r);for(let s=0;s<r;s++)o[s]=i[r-s-1];return o}}class JVi{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 i=this._viewLayout.getCurrentViewport();this.scrollTop=i.top,this.scrollLeft=i.left,this.viewportWidth=i.width,this.viewportHeight=i.height}getScrolledTopFromAbsoluteTop(e){return e-this.scrollTop}getVerticalOffsetForLineNumber(e,t){return this._viewLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t){return this._viewLayout.getVerticalOffsetAfterLineNumber(e,t)}getDecorationsInViewport(){return this.viewportData.getDecorationsInViewport()}}class eHi extends JVi{constructor(e,t,i){super(e,t),this._renderingContextBrand=void 0,this._viewLines=i}linesVisibleRangesForRange(e,t){return this._viewLines.linesVisibleRangesForRange(e,t)}visibleRangeForPosition(e){return this._viewLines.visibleRangeForPosition(e)}}class tHi{constructor(e,t,i,r){this.outsideRenderedLine=e,this.lineNumber=t,this.ranges=i,this.continuesOnNextLine=r}}class oq{static from(e){const t=new Array(e.length);for(let i=0,r=e.length;i<r;i++){const o=e[i];t[i]=new oq(o.left,o.width)}return t}constructor(e,t){this._horizontalRangeBrand=void 0,this.left=Math.round(e),this.width=Math.round(t)}toString(){return`[${this.left},${this.width}]`}}class ZE{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 nHi{constructor(e,t){this.outsideRenderedLine=e,this.originalLeft=t,this.left=Math.round(this.originalLeft)}}class PDe{constructor(e,t){this.outsideRenderedLine=e,this.ranges=t}}class F8{static _createRange(){return this._handyReadyRange||(this._handyReadyRange=document.createRange()),this._handyReadyRange}static _detachRange(e,t){e.selectNodeContents(t)}static _readClientRects(e,t,i,r,o){const s=this._createRange();try{return s.setStart(e,t),s.setEnd(i,r),s.getClientRects()}catch{return null}finally{this._detachRange(s,o)}}static _mergeAdjacentRanges(e){if(e.length===1)return e;e.sort(ZE.compare);const t=[];let i=0,r=e[0];for(let o=1,s=e.length;o<s;o++){const a=e[o];r.left+r.width+.9>=a.left?r.width=Math.max(r.width,a.left+a.width-r.left):(t[i++]=r,r=a)}return t[i++]=r,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||e.length===0)return null;const r=[];for(let o=0,s=e.length;o<s;o++){const a=e[o];r[o]=new ZE(Math.max(0,(a.left-t)/i),a.width/i)}return this._mergeAdjacentRanges(r)}static readHorizontalRanges(e,t,i,r,o,s){const l=e.children.length-1;if(0>l)return null;if(t=Math.min(l,Math.max(0,t)),r=Math.min(l,Math.max(0,r)),t===r&&i===o&&i===0&&!e.children[t].firstChild){const h=e.children[t].getClientRects();return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,s.clientRectDeltaLeft,s.clientRectScale)}t!==r&&r>0&&o===0&&(r--,o=1073741824);let c=e.children[t].firstChild,u=e.children[r].firstChild;if((!c||!u)&&(!c&&i===0&&t>0&&(c=e.children[t-1].firstChild,i=1073741824),!u&&o===0&&r>0&&(u=e.children[r-1].firstChild,o=1073741824)),!c||!u)return null;i=Math.min(c.textContent.length,Math.max(0,i)),o=Math.min(u.textContent.length,Math.max(0,o));const d=this._readClientRects(c,i,u,o,s.endNode);return s.markDidDomLayout(),this._createHorizontalRangesFromClientRects(d,s.clientRectDeltaLeft,s.clientRectScale)}}var sg;(function(n){n.DARK="dark",n.LIGHT="light",n.HIGH_CONTRAST_DARK="hcDark",n.HIGH_CONTRAST_LIGHT="hcLight"})(sg||(sg={}));function m_(n){return n===sg.HIGH_CONTRAST_DARK||n===sg.HIGH_CONTRAST_LIGHT}function i2(n){return n===sg.DARK||n===sg.HIGH_CONTRAST_DARK}const iHi=function(){return h_?!0:!(fu||wg||b0)}();let RL=!0;class MDe{constructor(e,t){this.themeType=t;const i=e.options,r=i.get(50);i.get(38)==="off"?this.renderWhitespace=i.get(98):this.renderWhitespace="none",this.renderControlCharacters=i.get(93),this.spaceWidth=r.spaceWidth,this.middotWidth=r.middotWidth,this.wsmiddotWidth=r.wsmiddotWidth,this.useMonospaceOptimizations=r.isMonospace&&!i.get(33),this.canUseHalfwidthRightwardsArrow=r.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(66),this.stopRenderingLineAfter=i.get(116),this.fontLigatures=i.get(51)}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 wv{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)this._renderedViewLine.domNode=Or(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return m_(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,r){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const o=i.getViewLineRenderingData(e),s=this._options,a=Jd.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let l=null;if(m_(s.themeType)||this._options.renderWhitespace==="selection"){const h=i.selections;for(const g of h){if(g.endLineNumber<e||g.startLineNumber>e)continue;const p=g.startLineNumber===e?g.startColumn:o.minColumn,m=g.endLineNumber===e?g.endColumn:o.maxColumn;p<m&&(m_(s.themeType)&&a.push(new Jd(p,m,"inline-selected-text",0)),this._options.renderWhitespace==="selection"&&(l||(l=[]),l.push(new oqe(p-1,m-1))))}}const c=new tS(s.useMonospaceOptimizations,s.canUseHalfwidthRightwardsArrow,o.content,o.continuesWithWrappedLine,o.isBasicASCII,o.containsRTL,o.minColumn-1,o.tokens,a,o.tabSize,o.startVisibleColumn,s.spaceWidth,s.middotWidth,s.wsmiddotWidth,s.stopRenderingLineAfter,s.renderWhitespace,s.renderControlCharacters,s.fontLigatures!==Fh.OFF,l);if(this._renderedViewLine&&this._renderedViewLine.input.equals(c))return!1;r.appendString('<div style="top:'),r.appendString(String(t)),r.appendString("px;height:"),r.appendString(String(this._options.lineHeight)),r.appendString('px;" class="'),r.appendString(wv.CLASS_NAME),r.appendString('">');const u=v5(c,r);r.appendString("</div>");let d=null;return RL&&iHi&&o.isBasicASCII&&s.useMonospaceOptimizations&&u.containsForeignElements===0&&(d=new xB(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping)),d||(d=xqe(this._renderedViewLine?this._renderedViewLine.domNode:null,c,u.characterMapping,u.containsRTL,u.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(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof xB:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof xB?this._renderedViewLine.monospaceAssumptionsAreValid():RL}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof xB&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,r){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(o!==-1&&t>o+1&&i>o+1)return new PDe(!0,[new ZE(this.getWidth(r),0)]);o!==-1&&t>o+1&&(t=o+1),o!==-1&&i>o+1&&(i=o+1);const s=this._renderedViewLine.getVisibleRangesForRange(e,t,i,r);return s&&s.length>0?new PDe(!1,s):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}wv.CLASS_NAME="view-line";class xB{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const r=Math.floor(t.lineContent.length/300);if(r>0){this._keyColumnPixelOffsetCache=new Float32Array(r);for(let o=0;o<r;o++)this._keyColumnPixelOffsetCache[o]=-1}else this._keyColumnPixelOffsetCache=null;this._characterMapping=i,this._charWidth=t.spaceWidth}getWidth(e){if(!this.domNode||this.input.lineContent.length<300){const t=this._characterMapping.getHorizontalOffset(this._characterMapping.length);return Math.round(this._charWidth*t)}return this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e==null||e.markDidDomLayout()),this._cachedWidth}getWidthIsFast(){return this.input.lineContent.length<300||this._cachedWidth!==-1}monospaceAssumptionsAreValid(){if(!this.domNode)return RL;if(this.input.lineContent.length<300){const e=this.getWidth(null),t=this.domNode.domNode.firstChild.offsetWidth;Math.abs(e-t)>=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),RL=!1)}return RL}toSlowRenderedLine(){return xqe(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,r){const o=this._getColumnPixelOffset(e,t,r),s=this._getColumnPixelOffset(e,i,r);return[new ZE(o,s-o)]}_getColumnPixelOffset(e,t,i){if(t<=300){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const r=Math.floor((t-1)/300)-1,o=(r+1)*300+1;let s=-1;if(this._keyColumnPixelOffsetCache&&(s=this._keyColumnPixelOffsetCache[r],s===-1&&(s=this._actualReadPixelOffset(e,o,i),this._keyColumnPixelOffsetCache[r]=s)),s===-1){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const a=this._characterMapping.getHorizontalOffset(o),l=this._characterMapping.getHorizontalOffset(t);return s+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const r=this._characterMapping.getDomPosition(t),o=F8.readHorizontalRanges(this._getReadingTarget(this.domNode),r.partIndex,r.charIndex,r.partIndex,r.charIndex,i);return!o||o.length===0?-1:o[0].left}getColumnOfNodeOffset(e,t){return u_e(this._characterMapping,e,t)}}class Eqe{constructor(e,t,i,r,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!r||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let s=0,a=this._characterMapping.length;s<=a;s++)this._pixelOffsetCache[s]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e==null||e.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,i,r){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,t,r);if(o===-1)return null;const s=this._readPixelOffset(this.domNode,e,i,r);return s===-1?null:[new ZE(o,s-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,r)}_readVisibleRangesForRange(e,t,i,r,o){if(i===r){const s=this._readPixelOffset(e,t,i,o);return s===-1?null:[new ZE(s,0)]}else return this._readRawVisibleRangesForRange(e,i,r,o)}_readPixelOffset(e,t,i,r){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(r);const o=this._getReadingTarget(e);return o.firstChild?(r.markDidDomLayout(),o.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const o=this._pixelOffsetCache[i];if(o!==-1)return o;const s=this._actualReadPixelOffset(e,t,i,r);return this._pixelOffsetCache[i]=s,s}return this._actualReadPixelOffset(e,t,i,r)}_actualReadPixelOffset(e,t,i,r){if(this._characterMapping.length===0){const l=F8.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,r);return!l||l.length===0?-1:l[0].left}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(r);const o=this._characterMapping.getDomPosition(i),s=F8.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,r);if(!s||s.length===0)return-1;const a=s[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getHorizontalOffset(i),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,i,r){if(t===1&&i===this._characterMapping.length)return[new ZE(0,this.getWidth(r))];const o=this._characterMapping.getDomPosition(t),s=this._characterMapping.getDomPosition(i);return F8.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,s.partIndex,s.charIndex,r)}getColumnOfNodeOffset(e,t){return u_e(this._characterMapping,e,t)}}class rHi extends Eqe{_readVisibleRangesForRange(e,t,i,r,o){const s=super._readVisibleRangesForRange(e,t,i,r,o);if(!s||s.length===0||i===r||i===1&&r===this._characterMapping.length)return s;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,r,o);if(a!==-1){const l=s[s.length-1];l.left<a&&(l.width=a-l.left)}}return s}}const xqe=function(){return YE?oHi:sHi}();function oHi(n,e,t,i,r){return new rHi(n,e,t,i,r)}function sHi(n,e,t,i,r){return new Eqe(n,e,t,i,r)}function u_e(n,e,t){const i=e.textContent.length;let r=-1;for(;e;)e=e.previousSibling,r++;return n.getColumn(new sqe(r,t),i)}class Va{static _nextVisibleColumn(e,t,i){return e===9?Va.nextRenderTabStop(t,i):aw(e)||Nme(e)?t+2:t+1}static visibleColumnFromColumn(e,t,i){const r=Math.min(t-1,e.length),o=e.substring(0,r),s=new RV(o);let a=0;for(;!s.eol();){const l=AV(o,r,s.offset);s.nextGraphemeLength(),a=this._nextVisibleColumn(l,a,i)}return a}static columnFromVisibleColumn(e,t,i){if(t<=0)return 1;const r=e.length,o=new RV(e);let s=0,a=1;for(;!o.eol();){const l=AV(e,r,o.offset);o.nextGraphemeLength();const c=this._nextVisibleColumn(l,s,i),u=o.offset+1;if(c>=t){const d=t-s;return c-t<d?u:a}s=c,a=u}return r+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)}}class HM{static whitespaceVisibleColumn(e,t,i){const r=e.length;let o=0,s=-1,a=-1;for(let l=0;l<r;l++){if(l===t)return[s,a,o];switch(o%i===0&&(s=l,a=o),e.charCodeAt(l)){case 32:o+=1;break;case 9:o=Va.nextRenderTabStop(o,i);break;default:return[-1,-1,-1]}}return t===r?[s,a,o]:[-1,-1,-1]}static atomicPosition(e,t,i,r){const o=e.length,[s,a,l]=HM.whitespaceVisibleColumn(e,t,i);if(l===-1)return-1;let c;switch(r){case 0:c=!0;break;case 1:c=!1;break;case 2:if(l%i===0)return t;c=l%i<=i/2;break}if(c){if(s===-1)return-1;let h=a;for(let g=s;g<o;++g){if(h===a+i)return s;switch(e.charCodeAt(g)){case 32:h+=1;break;case 9:h=Va.nextRenderTabStop(h,i);break;default:return-1}}return h===a+i?s:-1}const u=Va.nextRenderTabStop(l,i);let d=l;for(let h=t;h<o;h++){if(d===u)return h;switch(e.charCodeAt(h)){case 32:d+=1;break;case 9:d=Va.nextRenderTabStop(d,i);break;default:return-1}}return d===u?o:-1}}class d1{constructor(e=null){this.hitTarget=e,this.type=0}}class kqe{constructor(e,t,i){this.position=e,this.spanNode=t,this.injectedText=i,this.type=1}}var lE;(function(n){function e(t,i,r){const o=t.getPositionFromDOMInfo(i,r);return o?new kqe(o,i,null):new d1(i)}n.createFromDOMInfo=e})(lE||(lE={}));class aHi{constructor(e,t){this.lastViewCursorsRenderData=e,this.lastTextareaPosition=t}}class tu{static _deduceRage(e,t=null){return!t&&e?new q(e.lineNumber,e.column,e.lineNumber,e.column):t??null}static createUnknown(e,t,i){return{type:0,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createTextarea(e,t){return{type:1,element:e,mouseColumn:t,position:null,range:null}}static createMargin(e,t,i,r,o,s){return{type:e,element:t,mouseColumn:i,position:r,range:o,detail:s}}static createViewZone(e,t,i,r,o){return{type:e,element:t,mouseColumn:i,position:r,range:this._deduceRage(r),detail:o}}static createContentText(e,t,i,r,o){return{type:6,element:e,mouseColumn:t,position:i,range:this._deduceRage(i,r),detail:o}}static createContentEmpty(e,t,i,r){return{type:7,element:e,mouseColumn:t,position:i,range:this._deduceRage(i),detail:r}}static createContentWidget(e,t,i){return{type:9,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createScrollbar(e,t,i){return{type:11,element:e,mouseColumn:t,position:i,range:this._deduceRage(i)}}static createOverlayWidget(e,t,i){return{type:12,element:e,mouseColumn:t,position:null,range:null,detail:i}}static createOutsideEditor(e,t,i,r){return{type:13,element:null,mouseColumn:e,position:t,range:this._deduceRage(t),outsidePosition:i,outsideDistance:r}}static _typeToString(e){return e===1?"TEXTAREA":e===2?"GUTTER_GLYPH_MARGIN":e===3?"GUTTER_LINE_NUMBERS":e===4?"GUTTER_LINE_DECORATIONS":e===5?"GUTTER_VIEW_ZONE":e===6?"CONTENT_TEXT":e===7?"CONTENT_EMPTY":e===8?"CONTENT_VIEW_ZONE":e===9?"CONTENT_WIDGET":e===10?"OVERVIEW_RULER":e===11?"SCROLLBAR":e===12?"OVERLAY_WIDGET":"UNKNOWN"}static toString(e){return this._typeToString(e.type)+": "+e.position+" - "+e.range+" - "+JSON.stringify(e.detail)}}class Eh{static isTextArea(e){return e.length===2&&e[0]===3&&e[1]===6}static isChildOfViewLines(e){return e.length>=4&&e[0]===3&&e[3]===7}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===7}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===5}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===8}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===3}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}}class r2{constructor(e,t,i){this.viewModel=e.viewModel;const r=e.configuration.options;this.layoutInfo=r.get(143),this.viewDomNode=t.viewDomNode,this.lineHeight=r.get(66),this.stickyTabStops=r.get(115),this.typicalHalfwidthCharacterWidth=r.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return r2.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const r=i.verticalOffset+i.height/2,o=e.viewModel.getLineCount();let s=null,a,l=null;return i.afterLineNumber!==o&&(l=new Ce(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(s=new Ce(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),l===null?a=s:s===null?a=l:t<r?a=s:a=l,{viewZoneId:i.id,afterLineNumber:i.afterLineNumber,positionBefore:s,positionAfter:l,position:a}}return null}getFullLineRangeAtCoord(e){if(this._context.viewLayout.isAfterLines(e)){const r=this._context.viewModel.getLineCount(),o=this._context.viewModel.getLineMaxColumn(r);return{range:new q(r,o,r,o),isAfterLines:!0}}const t=this._context.viewLayout.getLineNumberAtVerticalOffset(e),i=this._context.viewModel.getLineMaxColumn(t);return{range:new q(t,1,t,i),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 r2._findAttribute(e,t,this._viewHelper.viewDomNode)}static _findAttribute(e,t,i){for(;e&&e!==e.ownerDocument.body;){if(e.hasAttribute&&e.hasAttribute(t))return e.getAttribute(t);if(e===i)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 lHi{constructor(e,t,i,r){this.editorPos=t,this.pos=i,this.relativePos=r,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,rc._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class d_e extends lHi{constructor(e,t,i,r,o){super(e,t,i,r),this._ctx=e,o?(this.target=o,this.targetPath=ub.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}
target: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.column<this._ctx.viewModel.getLineMaxColumn(e.lineNumber)?Va.visibleColumnFromColumn(this._ctx.viewModel.getLineContent(e.lineNumber),e.column,this._ctx.viewModel.model.getOptions().tabSize)+1:this.mouseColumn}fulfillUnknown(e=null){return tu.createUnknown(this.target,this._getMouseColumn(e),e)}fulfillTextarea(){return tu.createTextarea(this.target,this._getMouseColumn())}fulfillMargin(e,t,i,r){return tu.createMargin(e,this.target,this._getMouseColumn(t),t,i,r)}fulfillViewZone(e,t,i){return tu.createViewZone(e,this.target,this._getMouseColumn(t),t,i)}fulfillContentText(e,t,i){return tu.createContentText(this.target,this._getMouseColumn(e),e,t,i)}fulfillContentEmpty(e,t){return tu.createContentEmpty(this.target,this._getMouseColumn(e),e,t)}fulfillContentWidget(e){return tu.createContentWidget(this.target,this._getMouseColumn(),e)}fulfillScrollbar(e){return tu.createScrollbar(this.target,this._getMouseColumn(e),e)}fulfillOverlayWidget(e){return tu.createOverlayWidget(this.target,this._getMouseColumn(),e)}withTarget(e){return new d_e(this._ctx,this.editorPos,this.pos,this.relativePos,e)}}const FDe={isAfterLines:!0};function yZ(n){return{isAfterLines:!1,horizontalDistanceToText:n}}class rc{constructor(e,t){this._context=e,this._viewHelper=t}mouseTargetIsWidget(e){const t=e.target,i=ub.collect(t,this._viewHelper.viewDomNode);return!!(Eh.isChildOfContentWidgets(i)||Eh.isChildOfOverflowingContentWidgets(i)||Eh.isChildOfOverlayWidgets(i))}createMouseTarget(e,t,i,r,o){const s=new r2(this._context,this._viewHelper,e),a=new d_e(s,t,i,r,o);try{const l=rc._createMouseTarget(s,a,!1);if(l.type===6&&s.stickyTabStops&&l.position!==null){const c=rc._snapToSoftTabBoundary(l.position,s.viewModel),u=q.fromPositions(c,c).plusRange(l.range);return a.fulfillContentText(c,u,l.detail)}return l}catch{return a.fulfillUnknown()}}static _createMouseTarget(e,t,i){if(t.target===null){if(i)return t.fulfillUnknown();const s=rc._doHitTest(e,t);return s.type===1?rc.createMouseTargetFromHitTestPosition(e,t,s.spanNode,s.position,s.injectedText):this._createMouseTarget(e,t.withTarget(s.hitTarget),!0)}const r=t;let o=null;return!Eh.isChildOfOverflowGuard(t.targetPath)&&!Eh.isChildOfOverflowingContentWidgets(t.targetPath)&&(o=o||t.fulfillUnknown()),o=o||rc._hitTestContentWidget(e,r),o=o||rc._hitTestOverlayWidget(e,r),o=o||rc._hitTestMinimap(e,r),o=o||rc._hitTestScrollbarSlider(e,r),o=o||rc._hitTestViewZone(e,r),o=o||rc._hitTestMargin(e,r),o=o||rc._hitTestViewCursor(e,r),o=o||rc._hitTestTextArea(e,r),o=o||rc._hitTestViewLines(e,r,i),o=o||rc._hitTestScrollbar(e,r),o||t.fulfillUnknown()}static _hitTestContentWidget(e,t){if(Eh.isChildOfContentWidgets(t.targetPath)||Eh.isChildOfOverflowingContentWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillContentWidget(i):t.fulfillUnknown()}return null}static _hitTestOverlayWidget(e,t){if(Eh.isChildOfOverlayWidgets(t.targetPath)){const i=e.findAttribute(t.target,"widgetId");return i?t.fulfillOverlayWidget(i):t.fulfillUnknown()}return null}static _hitTestViewCursor(e,t){if(t.target){const i=e.lastRenderData.lastViewCursorsRenderData;for(const r of i)if(t.target===r.domNode)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}if(t.isInContentArea){const i=e.lastRenderData.lastViewCursorsRenderData,r=t.mouseContentHorizontalOffset,o=t.mouseVerticalOffset;for(const s of i){if(r<s.contentLeft||r>s.contentLeft+s.width)continue;const a=e.getVerticalOffsetForLineNumber(s.position.lineNumber);if(a<=o&&o<=a+s.height)return t.fulfillContentText(s.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const r=t.isInContentArea?8:5;return t.fulfillViewZone(r,i.position,i)}return null}static _hitTestTextArea(e,t){return Eh.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 i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),r=i.range.getStartPosition();let o=Math.abs(t.relativePos.x);const s={isAfterLines:i.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,r,i.range,s):(o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,r,i.range,s):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,r,i.range,s)))}return null}static _hitTestViewLines(e,t,i){if(!Eh.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new Ce(1,1),FDe);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const o=e.viewModel.getLineCount(),s=e.viewModel.getLineMaxColumn(o);return t.fulfillContentEmpty(new Ce(o,s),FDe)}if(i){if(Eh.isStrictChildOfViewLines(t.targetPath)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(o)===0){const a=e.getLineWidth(o),l=yZ(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(new Ce(o,1),l)}const s=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>=s){const a=yZ(t.mouseContentHorizontalOffset-s),l=new Ce(o,e.viewModel.getLineMaxColumn(o));return t.fulfillContentEmpty(l,a)}}return t.fulfillUnknown()}const r=rc._doHitTest(e,t);return r.type===1?rc.createMouseTargetFromHitTestPosition(e,t,r.spanNode,r.position,r.injectedText):this._createMouseTarget(e,t.withTarget(r.hitTarget),!0)}static _hitTestMinimap(e,t){if(Eh.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Ce(i,r))}return null}static _hitTestScrollbarSlider(e,t){if(Eh.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const r=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(r);return t.fulfillScrollbar(new Ce(r,o))}}return null}static _hitTestScrollbar(e,t){if(Eh.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Ce(i,r))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(143),r=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return rc._getMouseColumn(r,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,r,o){const s=r.lineNumber,a=r.column,l=e.getLineWidth(s);if(t.mouseContentHorizontalOffset>l){const v=yZ(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(r,v)}const c=e.visibleRangeForPosition(s,a);if(!c)return t.fulfillUnknown(r);const u=c.left;if(Math.abs(t.mouseContentHorizontalOffset-u)<1)return t.fulfillContentText(r,null,{mightBeForeignElement:!!o,injectedText:o});const d=[];if(d.push({offset:c.left,column:a}),a>1){const v=e.visibleRangeForPosition(s,a-1);v&&d.push({offset:v.left,column:a-1})}const h=e.viewModel.getLineMaxColumn(s);if(a<h){const v=e.visibleRangeForPosition(s,a+1);v&&d.push({offset:v.left,column:a+1})}d.sort((v,b)=>v.offset-b.offset);const g=t.pos.toClientCoordinates(),p=i.getBoundingClientRect(),m=p.left<=g.clientX&&g.clientX<=p.right;let _=null;for(let v=1;v<d.length;v++){const b=d[v-1],y=d[v];if(b.offset<=t.mouseContentHorizontalOffset&&t.mouseContentHorizontalOffset<=y.offset){_=new q(s,b.column,s,y.column);const C=Math.abs(b.offset-t.mouseContentHorizontalOffset),x=Math.abs(y.offset-t.mouseContentHorizontalOffset);r=C<x?new Ce(s,b.column):new Ce(s,y.column);break}}return t.fulfillContentText(r,_,{mightBeForeignElement:!m||!!o,injectedText:o})}static _doHitTestWithCaretRangeFromPoint(e,t){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),r=e.getVerticalOffsetForLineNumber(i),o=r+e.lineHeight;if(!(i===e.viewModel.getLineCount()&&t.mouseVerticalOffset>o)){const a=Math.floor((r+o)/2);let l=t.pos.y+(a-t.mouseVerticalOffset);l<=t.editorPos.y&&(l=t.editorPos.y+1),l>=t.editorPos.y+t.editorPos.height&&(l=t.editorPos.y+t.editorPos.height-1);const c=new rq(t.pos.x,l),u=this._actualDoHitTestWithCaretRangeFromPoint(e,c.toClientCoordinates());if(u.type===1)return u}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=Px(e.viewDomNode);let r;if(i?typeof i.caretRangeFromPoint>"u"?r=cHi(i,t.clientX,t.clientY):r=i.caretRangeFromPoint(t.clientX,t.clientY):r=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!r||!r.startContainer)return new d1;const o=r.startContainer;if(o.nodeType===o.TEXT_NODE){const s=o.parentNode,a=s?s.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===wv.CLASS_NAME?lE.createFromDOMInfo(e,s,r.startOffset):new d1(o.parentNode)}else if(o.nodeType===o.ELEMENT_NODE){const s=o.parentNode,a=s?s.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===wv.CLASS_NAME?lE.createFromDOMInfo(e,o,o.textContent.length):new d1(o)}return new d1}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const r=i.offsetNode.parentNode,o=r?r.parentNode:null,s=o?o.parentNode:null;return(s&&s.nodeType===s.ELEMENT_NODE?s.className:null)===wv.CLASS_NAME?lE.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new d1(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const r=i.offsetNode.parentNode,o=r&&r.nodeType===r.ELEMENT_NODE?r.className:null,s=r?r.parentNode:null,a=s&&s.nodeType===s.ELEMENT_NODE?s.className:null;if(o===wv.CLASS_NAME){const l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return lE.createFromDOMInfo(e,l,0)}else if(a===wv.CLASS_NAME)return lE.createFromDOMInfo(e,i.offsetNode,0)}return new d1(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:r}=t.model.getOptions(),o=HM.atomicPosition(i,e.column-1,r,2);return o!==-1?new Ce(e.lineNumber,o+1):e}static _doHitTest(e,t){let i=new d1;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates())),i.type===1){const r=e.viewModel.getInjectedTextAt(i.position),o=e.viewModel.normalizePosition(i.position,2);(r||!o.equals(i.position))&&(i=new kqe(o,i.spanNode,r))}return i}}function cHi(n,e,t){const i=document.createRange();let r=n.elementFromPoint(e,t);if(r!==null){for(;r&&r.firstChild&&r.firstChild.nodeType!==r.firstChild.TEXT_NODE&&r.lastChild&&r.lastChild.firstChild;)r=r.lastChild;const o=r.getBoundingClientRect(),s=window.getComputedStyle(r,null).getPropertyValue("font-style"),a=window.getComputedStyle(r,null).getPropertyValue("font-variant"),l=window.getComputedStyle(r,null).getPropertyValue("font-weight"),c=window.getComputedStyle(r,null).getPropertyValue("font-size"),u=window.getComputedStyle(r,null).getPropertyValue("line-height"),d=window.getComputedStyle(r,null).getPropertyValue("font-family"),h=`${s} ${a} ${l} ${c}/${u} ${d}`,g=r.innerText;let p=o.left,m=0,_;if(e>o.left+o.width)m=g.length;else{const v=AE.getInstance();for(let b=0;b<g.length+1;b++){if(_=v.getCharWidth(g.charAt(b),h)/2,p+=_,e<p){m=b;break}p+=_}}i.setStart(r.firstChild,m),i.setEnd(r.firstChild,m)}return i}class AE{static getInstance(){return AE._INSTANCE||(AE._INSTANCE=new AE),AE._INSTANCE}constructor(){this._cache={},this._canvas=document.createElement("canvas")}getCharWidth(e,t){const i=e+t;if(this._cache[i])return this._cache[i];const r=this._canvas.getContext("2d");r.font=t;const s=r.measureText(e).width;return this._cache[i]=s,s}}AE._INSTANCE=null;let im=class extends Ae{onclick(e,t){this._register(We(e,Lt.CLICK,i=>t(new og(i))))}onmousedown(e,t){this._register(We(e,Lt.MOUSE_DOWN,i=>t(new og(i))))}onmouseover(e,t){this._register(We(e,Lt.MOUSE_OVER,i=>t(new og(i))))}onmouseleave(e,t){this._register(We(e,Lt.MOUSE_LEAVE,i=>t(new og(i))))}onkeydown(e,t){this._register(We(e,Lt.KEY_DOWN,i=>t(new Oo(i))))}onkeyup(e,t){this._register(We(e,Lt.KEY_UP,i=>t(new Oo(i))))}oninput(e,t){this._register(We(e,Lt.INPUT,t))}onblur(e,t){this._register(We(e,Lt.BLUR,t))}onfocus(e,t){this._register(We(e,Lt.FOCUS,t))}ignoreGesture(e){return bo.ignoreTarget(e)}};const o2=11;class uHi extends im{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",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...In.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=o2+"px",this.domNode.style.height=o2+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new xA),this._register(ua(this.bgDomNode,Lt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(ua(this.domNode,Lt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new p5),this._pointerdownScheduleRepeatTimer=this._register(new nm)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24)};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class dHi extends Ae{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new nm)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0: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(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)===null||e===void 0||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)===null||t===void 0||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}const hHi=140;class Tqe extends im{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 dHi(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new xA),this._shouldRender=!0,this.domNode=Or(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(We(this.domNode.domNode,Lt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new uHi(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,r){this.slider=Or(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(We(this.slider.domNode,Lt.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.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()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);i<=o&&o<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{const o=Oa(this.domNode.domNode);t=e.pageX-o.left,i=e.pageY-o.top}const r=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{const s=this._sliderOrthogonalPointerPosition(o),a=Math.abs(s-i);if(vc&&a>hHi){this._setDesiredScrollPositionNow(r.getScrollPosition());return}const c=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),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 fHi=20;class s2{constructor(e,t,i,r,o,s){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=o,this._scrollPosition=s,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new s2(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):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,r,o){const s=Math.max(0,i-e),a=Math.max(0,s-2*t),l=r>0&&r>i;if(!l)return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const c=Math.round(Math.max(fHi,Math.floor(i*a/r))),u=(a-c)/(r-i),d=o*u;return{computedAvailableSize:Math.round(s),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:u,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){const e=s2._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 i=this._scrollPosition;return t<this._computedSliderPosition?i-=this._visibleSize:i+=this._visibleSize,i}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;const t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}}class gHi extends Tqe{constructor(e,t,i){const r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new s2(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,o.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows){const s=(t.arrowSize-o2)/2,a=(t.horizontalScrollbarSize-o2)/2;this._createArrow({className:"scra",icon:Ct.scrollbarButtonLeft,top:a,left:s,bottom:void 0,right:void 0,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Ox(null,1,0))}),this._createArrow({className:"scra",icon:Ct.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:s,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Ox(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}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class pHi extends Tqe{constructor(e,t,i){const r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new s2(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const s=(t.arrowSize-o2)/2,a=(t.verticalScrollbarSize-o2)/2;this._createArrow({className:"scra",icon:Ct.scrollbarButtonUp,top:s,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Ox(null,0,1))}),this._createArrow({className:"scra",icon:Ct.scrollbarButtonDown,top:void 0,left:a,bottom:s,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Ox(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}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class GV{constructor(e,t,i,r,o,s,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,i=i|0,r=r|0,o=o|0,s=s|0,a=a|0),this.rawScrollLeft=r,this.rawScrollTop=a,t<0&&(t=0),r+t>i&&(r=i-t),r<0&&(r=0),o<0&&(o=0),a+o>s&&(a=s-o),a<0&&(a=0),this.width=t,this.scrollWidth=i,this.scrollLeft=r,this.height=o,this.scrollHeight=s,this.scrollTop=a}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 GV(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new GV(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,s=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=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:i,scrollWidthChanged:r,scrollLeftChanged:o,heightChanged:s,scrollHeightChanged:a,scrollTopChanged:l}}}class w5 extends Ae{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new be),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new GV(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){var i;const r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),(i=this._smoothScrolling)===null||i===void 0||i.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(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let r;t?r=new WM(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):r=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{const i=this._state.withScrollPosition(e);this._smoothScrolling=WM.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class BDe{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function CZ(n,e){const t=e-n;return function(i){return n+t*vHi(i)}}function mHi(n,e,t){return function(i){return i<t?n(i/t):e((i-t)/(1-t))}}class WM{constructor(e,t,i,r){this.from=e,this.to=t,this.duration=r,this.startTime=i,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,i){if(Math.abs(e-t)>2.5*i){let o,s;return e<t?(o=e+.75*i,s=t-.75*i):(o=e-.75*i,s=t+.75*i),mHi(CZ(e,o),CZ(s,t),.33)}return CZ(e,t)}dispose(){this.animationFrameDisposable!==null&&(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 i=this.scrollLeft(t),r=this.scrollTop(t);return new BDe(i,r,!1)}return new BDe(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,t,i){return WM.start(e,t,i)}static start(e,t,i){i=i+10;const r=Date.now()-10;return new WM(e,t,r,i)}}function _Hi(n){return Math.pow(n,3)}function vHi(n){return 1-_Hi(1-n)}const bHi=500,$De=50;class yHi{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}}class YV{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,i=1,r=this._rear;do{const o=r===this._front?e:Math.pow(2,-i);if(e-=o,t+=this._memory[r].score*o,r===this._front)break;r=(this._capacity+r-1)%this._capacity,i++}while(!0);return t<=.5}acceptStandardWheelEvent(e){const t=window.devicePixelRatio/z6i();vc||fu?this.accept(Date.now(),e.deltaX/t,e.deltaY/t):this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,i){const r=new yHi(e,t,i);r.score=this._computeScore(r),this._front===-1&&this._rear===-1?(this._memory[0]=r,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]=r)}_computeScore(e){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return this._front===-1&&this._rear===-1||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}}YV.INSTANCE=new YV;class h_e extends im{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new be),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new be),e.style.overflow="hidden",this._options=CHi(t),this._scrollable=i,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const r={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new pHi(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new gHi(this._scrollable,this._options,r)),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=Or(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Or(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Or(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,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new nm),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=Hr(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Qi&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Ox(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Hr(this._mouseWheelToDispose),e)){const i=r=>{this._onMouseWheel(new Ox(r))};this._mouseWheelToDispose.push(We(this._listenOnDomNode,Lt.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;const i=YV.INSTANCE;i.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+s===0?a=s=0:Math.abs(s)>=Math.abs(a)?a=0:s=0),this._options.flipAxes&&([s,a]=[a,s]);const l=!Qi&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let u={};if(s){const d=$De*s,h=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(u,h)}if(a){const d=$De*a,h=c.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(u,h)}u=this._scrollable.validateScrollPosition(u),(c.scrollLeft!==u.scrollLeft||c.scrollTop!==u.scrollTop)&&(this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(u):this._scrollable.setScrollPositionNow(u),r=!0)}let o=r;!o&&this._options.alwaysConsumeMouseWheel&&(o=!0),!o&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(o=!0),o&&(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,i=e.scrollLeft>0,r=i?" left":"",o=t?" top":"",s=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${s}${o}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(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(),bHi)}}class Iqe extends h_e{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new w5({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:r=>Sg(r)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class f_e extends h_e{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class S5 extends h_e{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new w5({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:r=>Sg(r)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(r=>{r.scrollTopChanged&&(this._element.scrollTop=r.scrollTop),r.scrollLeftChanged&&(this._element.scrollLeft=r.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 CHi(n){const e={lazyRender:typeof n.lazyRender<"u"?n.lazyRender:!1,className:typeof n.className<"u"?n.className:"",useShadows:typeof n.useShadows<"u"?n.useShadows:!0,handleMouseWheel:typeof n.handleMouseWheel<"u"?n.handleMouseWheel:!0,flipAxes:typeof n.flipAxes<"u"?n.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof n.consumeMouseWheelIfScrollbarIsNeeded<"u"?n.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof n.alwaysConsumeMouseWheel<"u"?n.alwaysConsumeMouseWheel:!1,scrollYToX:typeof n.scrollYToX<"u"?n.scrollYToX:!1,mouseWheelScrollSensitivity:typeof n.mouseWheelScrollSensitivity<"u"?n.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof n.fastScrollSensitivity<"u"?n.fastScrollSensitivity:5,scrollPredominantAxis:typeof n.scrollPredominantAxis<"u"?n.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof n.mouseWheelSmoothScroll<"u"?n.mouseWheelSmoothScroll:!0,arrowSize:typeof n.arrowSize<"u"?n.arrowSize:11,listenOnDomNode:typeof n.listenOnDomNode<"u"?n.listenOnDomNode:null,horizontal:typeof n.horizontal<"u"?n.horizontal:1,horizontalScrollbarSize:typeof n.horizontalScrollbarSize<"u"?n.horizontalScrollbarSize:10,horizontalSliderSize:typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:0,horizontalHasArrows:typeof n.horizontalHasArrows<"u"?n.horizontalHasArrows:!1,vertical:typeof n.vertical<"u"?n.vertical:1,verticalScrollbarSize:typeof n.verticalScrollbarSize<"u"?n.verticalScrollbarSize:10,verticalHasArrows:typeof n.verticalHasArrows<"u"?n.verticalHasArrows:!1,verticalSliderSize:typeof n.verticalSliderSize<"u"?n.verticalSliderSize:0,scrollByPage:typeof n.scrollByPage<"u"?n.scrollByPage:!1};return e.horizontalSliderSize=typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof n.verticalSliderSize<"u"?n.verticalSliderSize:e.verticalScrollbarSize,Qi&&(e.className+=" mac"),e}class g_e extends C5{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new rc(this._context,i),this._mouseDownOperation=this._register(new wHi(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(s,a)=>this._createMouseTarget(s,a),s=>this._getMouseColumn(s))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(143).height;const r=new GVi(this.viewHelper.viewDomNode);this._register(r.onContextMenu(this.viewHelper.viewDomNode,s=>this._onContextMenu(s,!0))),this._register(r.onMouseMove(this.viewHelper.viewDomNode,s=>{this._onMouseMove(s),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=We(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new gw(a,!1,this.viewHelper.viewDomNode))}))})),this._register(r.onMouseUp(this.viewHelper.viewDomNode,s=>this._onMouseUp(s))),this._register(r.onMouseLeave(this.viewHelper.viewDomNode,s=>this._onMouseLeave(s)));let o=0;this._register(r.onPointerDown(this.viewHelper.viewDomNode,(s,a)=>{o=a})),this._register(We(this.viewHelper.viewDomNode,Lt.POINTER_UP,s=>{this._mouseDownOperation.onPointerUp()})),this._register(r.onMouseDown(this.viewHelper.viewDomNode,s=>this._onMouseDown(s,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=YV.INSTANCE;let t=0,i=Yf.getZoomLevel(),r=!1,o=0;const s=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(75))return;const c=new Ox(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const u=Yf.getZoomLevel(),d=c.deltaY>0?1:-1;Yf.setZoomLevel(u+d),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(i=Yf.getZoomLevel(),r=a(l),o=0),t=Date.now(),o+=c.deltaY,r&&(Yf.setZoomLevel(i+o/5),c.preventDefault(),c.stopPropagation())};this._register(We(this.viewHelper.viewDomNode,Lt.MOUSE_WHEEL,s,{capture:!0,passive:!1}));function a(l){return Qi?(l.metaKey||l.ctrlKey)&&!l.shiftKey&&!l.altKey:l.ctrlKey&&!l.metaKey&&!l.shiftKey&&!l.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(143)){const t=this._context.configuration.options.get(143).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const r=new Sqe(e,t).toPageCoordinates(),o=l_e(this.viewHelper.viewDomNode);if(r.y<o.y||r.y>o.y+o.height||r.x<o.x||r.x>o.x+o.width)return null;const s=c_e(this.viewHelper.viewDomNode,o,r);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,r,s,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const r=Px(this.viewHelper.viewDomNode);r&&(i=r.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp<this.lastMouseLeaveTime)&&this.viewController.emitMouseMove({event:e,target:this._createMouseTarget(e,!0)})}_onMouseLeave(e){this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),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,t){const i=this._createMouseTarget(e,!0),r=i.type===6||i.type===7,o=i.type===2||i.type===3||i.type===4,s=i.type===3,a=this._context.configuration.options.get(108),l=i.type===8||i.type===5,c=i.type===9;let u=e.leftButton||e.middleButton;Qi&&e.leftButton&&e.ctrlKey&&(u=!1);const d=()=>{e.preventDefault(),this.viewHelper.focusTextArea()};if(u&&(r||s&&a))d(),this._mouseDownOperation.start(i.type,e,t);else if(o)e.preventDefault();else if(l){const h=i.detail;u&&this.viewHelper.shouldSuppressMouseDownOnViewZone(h.viewZoneId)&&(d(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(d(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class wHi extends Ae{constructor(e,t,i,r,o,s){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=r,this._createMouseTarget=o,this._getMouseColumn=s,this._mouseMoveMonitor=this._register(new QVi(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new SHi(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new sq,this._currentSelection=new ln(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,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===13&&(t.outsidePosition==="above"||t.outsidePosition==="below")?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const r=this._findMousePosition(t,!0);if(!r||!r.position)return;this._mouseState.trySetCount(t.detail,r.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(90)&&o.get(35)&&!o.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&r.type===6&&r.position&&this._currentSelection.containsPosition(r.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,s=>this._onMouseDownThenMove(s),s=>{const a=this._findMousePosition(this._lastMouseEvent,!1);s&&s instanceof KeyboardEvent?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:a?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(r,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,s=>this._onMouseDownThenMove(s),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,r=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posy<t.y){const a=t.y-e.posy,l=Math.max(r.getCurrentScrollTop()-a,0),c=r2.getZoneAtCoord(this._context,l);if(c){const d=this._helpPositionJumpOverViewZone(c);if(d)return tu.createOutsideEditor(o,d,"above",a)}const u=r.getLineNumberAtVerticalOffset(l);return tu.createOutsideEditor(o,new Ce(u,1),"above",a)}if(e.posy>t.y+t.height){const a=e.posy-t.y-t.height,l=r.getCurrentScrollTop()+e.relativePos.y,c=r2.getZoneAtCoord(this._context,l);if(c){const d=this._helpPositionJumpOverViewZone(c);if(d)return tu.createOutsideEditor(o,d,"below",a)}const u=r.getLineNumberAtVerticalOffset(l);return tu.createOutsideEditor(o,new Ce(u,i.getLineMaxColumn(u)),"below",a)}const s=r.getLineNumberAtVerticalOffset(r.getCurrentScrollTop()+e.relativePos.y);if(e.posx<t.x){const a=t.x-e.posx;return tu.createOutsideEditor(o,new Ce(s,1),"left",a)}if(e.posx>t.x+t.width){const a=e.posx-t.x-t.width;return tu.createOutsideEditor(o,new Ce(s,i.getLineMaxColumn(s)),"right",a)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const r=this._createMouseTarget(e,t);if(!r.position)return null;if(r.type===8||r.type===5){const s=this._helpPositionJumpOverViewZone(r.detail);if(s)return tu.createViewZone(r.type,r.element,r.mouseColumn,s,r.detail)}return r}_helpPositionJumpOverViewZone(e){const t=new Ce(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,r=e.positionAfter;return i&&r?i.isBefore(t)?i:r:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,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:e.type===6&&e.detail.injectedText!==null})}}class SHi extends Ae{constructor(e,t,i,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=r,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new EHi(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class EHi extends Ae{constructor(e,t,i,r,o,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=r,this._position=o,this._mouseEvent=s,this._lastTime=Date.now(),this._animationFrameDisposable=Sg(()=>this._execute())}dispose(){this._animationFrameDisposable.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){const e=this._context.configuration.options.get(66),t=this._context.configuration.options.get(143).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(66),t=this._getScrollSpeed(),i=this._tick(),r=t*(i/1e3)*e,o=this._position.outsidePosition==="above"?-r:r;this._context.viewModel.viewLayout.deltaScrollNow(0,o),this._viewHelper.renderNow();const s=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?s.startLineNumber:s.endLineNumber;let l;{const c=l_e(this._viewHelper.viewDomNode),u=this._context.configuration.options.get(143).horizontalScrollbarHeight,d=new rq(this._mouseEvent.pos.x,c.y+c.height-u-.1),h=c_e(this._viewHelper.viewDomNode,c,d);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),c,d,h,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=tu.createOutsideEditor(this._position.mouseColumn,new Ce(a,1),"above",this._position.outsideDistance):l=tu.createOutsideEditor(this._position.mouseColumn,new Ce(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=Sg(()=>this._execute())}}class sq{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}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 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 i=new Date().getTime();i-this._lastSetMouseDownCountTime>sq.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,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)}}sq.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class Wi{get event(){return this.emitter.event}constructor(e,t,i){const r=o=>this.emitter.fire(o);this.emitter=new be({onWillAddFirstListener:()=>e.addEventListener(t,r,i),onDidRemoveLastListener:()=>e.removeEventListener(t,r,i)})}dispose(){this.emitter.dispose()}}var J1;(function(n){const e={total:0,min:Number.MAX_VALUE,max:0},t=Object.assign({},e),i=Object.assign({},e),r=Object.assign({},e);let o=0;const s={keydown:0,input:0,render:0};function a(){v(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),s.keydown=1,queueMicrotask(l)}n.onKeyDown=a;function l(){s.keydown===1&&(performance.mark("keydown/end"),s.keydown=2)}function c(){performance.mark("input/start"),s.input=1,_()}n.onBeforeInput=c;function u(){s.input===0&&c(),queueMicrotask(d)}n.onInput=u;function d(){s.input===1&&(performance.mark("input/end"),s.input=2)}function h(){v()}n.onKeyUp=h;function g(){v()}n.onSelectionChange=g;function p(){s.keydown===2&&s.input===2&&s.render===0&&(performance.mark("render/start"),s.render=1,queueMicrotask(m),_())}n.onRenderStart=p;function m(){s.render===1&&(performance.mark("render/end"),s.render=2)}function _(){setTimeout(v)}function v(){s.keydown===2&&s.input===2&&s.render===2&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),b("keydown",e),b("input",t),b("render",i),b("inputlatency",r),o++,y())}function b(I,L){const D=performance.getEntriesByName(I)[0].duration;L.total+=D,L.min=Math.min(L.min,D),L.max=Math.max(L.max,D)}function y(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),s.keydown=0,s.input=0,s.render=0}function C(){if(o===0)return;const I={keydown:x(e),input:x(t),render:x(i),total:x(r),sampleCount:o};return k(e),k(t),k(i),k(r),o=0,I}n.getAndClearMeasurements=C;function x(I){return{average:I.total/o,max:I.max,min:I.min}}function k(I){I.total=0,I.min=Number.MAX_VALUE,I.max=0}})(J1||(J1={}));class Ml{constructor(e,t,i,r,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=r,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),r=e.getSelectionStart(),o=e.getSelectionEnd();let s;if(t){const a=i.substring(0,r),l=t.value.substring(0,t.selectionStart);a===l&&(s=t.newlineCountBeforeSelection)}return new Ml(i,r,o,null,s)}collapseSelection(){return this.selectionStart===this.value.length?this:new Ml(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,i,r,o,s,a,l,c;if(e<=this.selectionStart){const h=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition((i=(t=this.selection)===null||t===void 0?void 0:t.getStartPosition())!==null&&i!==void 0?i:null,h,-1)}if(e>=this.selectionEnd){const h=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition((o=(r=this.selection)===null||r===void 0?void 0:r.getEndPosition())!==null&&o!==void 0?o:null,h,1)}const u=this.value.substring(this.selectionStart,e);if(u.indexOf(String.fromCharCode(8230))===-1)return this._finishDeduceEditorPosition((a=(s=this.selection)===null||s===void 0?void 0:s.getStartPosition())!==null&&a!==void 0?a:null,u,1);const d=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition((c=(l=this.selection)===null||l===void 0?void 0:l.getEndPosition())!==null&&c!==void 0?c:null,d,-1)}_finishDeduceEditorPosition(e,t,i){let r=0,o=-1;for(;(o=t.indexOf(`
`,o+1))!==-1;)r++;return[e,i*t.length,r]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const r=Math.min(Ax(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(DV(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(r,e.value.length-o);const s=t.value.substring(r,t.value.length-o),a=e.selectionStart-r,l=e.selectionEnd-r,c=t.selectionStart-r,u=t.selectionEnd-r;if(c===u){const h=e.selectionStart-r;return{text:s,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}const d=l-a;return{text:s,replacePrevCharCnt:d,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 i=Math.min(Ax(e.value,t.value),e.selectionEnd),r=Math.min(DV(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-r),s=t.value.substring(i,t.value.length-r);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const l=t.selectionEnd-i;return{text:s,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:l-s.length}}}Ml.EMPTY=new Ml("",0,0,null,void 0);class UI{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,r=i+1,o=i+t;return new q(r,1,o+1,1)}static fromEditorSelection(e,t,i,r){const s=UI._getPageOfLine(t.startLineNumber,i),a=UI._getRangeForPage(s,i),l=UI._getPageOfLine(t.endLineNumber,i),c=UI._getRangeForPage(l,i);let u=a.intersectRanges(new q(1,1,t.startLineNumber,t.startColumn));if(r&&e.getValueLengthInRange(u,1)>500){const v=e.modifyPosition(u.getEndPosition(),-500);u=q.fromPositions(v,u.getEndPosition())}const d=e.getValueInRange(u,1),h=e.getLineCount(),g=e.getLineMaxColumn(h);let p=c.intersectRanges(new q(t.endLineNumber,t.endColumn,h,g));if(r&&e.getValueLengthInRange(p,1)>500){const v=e.modifyPosition(p.getStartPosition(),500);p=q.fromPositions(p.getStartPosition(),v)}const m=e.getValueInRange(p,1);let _;if(s===l||s+1===l)_=e.getValueInRange(t,1);else{const v=a.intersectRanges(t),b=c.intersectRanges(t);_=e.getValueInRange(v,1)+String.fromCharCode(8230)+e.getValueInRange(b,1)}return r&&_.length>2*500&&(_=_.substring(0,500)+String.fromCharCode(8230)+_.substring(_.length-500,_.length)),new Ml(d+_+m,d.length,d.length+_.length,t,u.endLineNumber-u.startLineNumber)}}var QV;(function(n){n.Tap="-monaco-textarea-synthetic-tap"})(QV||(QV={}));const yse={forceCopyWithSyntaxHighlighting:!1};class zM{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)}}zM.INSTANCE=new zM;class xHi{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}class kHi extends Ae{get textAreaState(){return this._textAreaState}constructor(e,t,i,r){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=r,this._onFocus=this._register(new be),this.onFocus=this._onFocus.event,this._onBlur=this._register(new be),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new be),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new be),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new be),this.onCut=this._onCut.event,this._onPaste=this._register(new be),this.onPaste=this._onPaste.event,this._onType=this._register(new be),this.onType=this._onType.event,this._onCompositionStart=this._register(new be),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new be),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new be),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new be),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new so(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new so(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=Ml.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._currentComposition=null;let o=null;this._register(this._textArea.onKeyDown(s=>{const a=new Oo(s);(a.keyCode===114||this._currentComposition&&a.keyCode===1)&&a.stopPropagation(),a.equals(9)&&a.preventDefault(),o=a,this._onKeyDown.fire(a)})),this._register(this._textArea.onKeyUp(s=>{const a=new Oo(s);this._onKeyUp.fire(a)})),this._register(this._textArea.onCompositionStart(s=>{const a=new xHi;if(this._currentComposition){this._currentComposition=a;return}if(this._currentComposition=a,this._OS===2&&o&&o.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===s.data&&(o.code==="ArrowRight"||o.code==="ArrowLeft")){a.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:s.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:s.data});return}this._onCompositionStart.fire({data:s.data})})),this._register(this._textArea.onCompositionUpdate(s=>{const a=this._currentComposition;if(!a)return;if(this._browser.isAndroid){const c=Ml.readFromTextArea(this._textArea,this._textAreaState),u=Ml.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(u),this._onCompositionUpdate.fire(s);return}const l=a.handleCompositionUpdate(s.data);this._textAreaState=Ml.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionUpdate.fire(s)})),this._register(this._textArea.onCompositionEnd(s=>{const a=this._currentComposition;if(!a)return;if(this._currentComposition=null,this._browser.isAndroid){const c=Ml.readFromTextArea(this._textArea,this._textAreaState),u=Ml.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(u),this._onCompositionEnd.fire();return}const l=a.handleCompositionUpdate(s.data);this._textAreaState=Ml.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(s=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const a=Ml.readFromTextArea(this._textArea,this._textAreaState),l=Ml.deduceInput(this._textAreaState,a,this._OS===2);l.replacePrevCharCnt===0&&l.text.length===1&&(Za(l.text.charCodeAt(0))||l.text.charCodeAt(0)===127)||(this._textAreaState=a,(l.text!==""||l.replacePrevCharCnt!==0||l.replaceNextCharCnt!==0||l.positionDelta!==0)&&this._onType.fire(l))})),this._register(this._textArea.onCut(s=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(s),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(s=>{this._ensureClipboardGetsEditorSelection(s)})),this._register(this._textArea.onPaste(s=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),s.preventDefault(),!s.clipboardData)return;let[a,l]=Cse.getTextData(s.clipboardData);a&&(l=l||zM.INSTANCE.get(a),this._onPaste.fire({text:a,metadata:l}))})),this._register(this._textArea.onFocus(()=>{const s=this._hasFocus;this._setHasFocus(!0),this._browser.isSafari&&!s&&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 We(this._textArea.ownerDocument,"selectionchange",t=>{if(J1.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const i=Date.now(),r=i-e;if(e=i,r<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100||!this._textAreaState.selection)return;const s=this._textArea.getValue();if(this._textAreaState.value!==s)return;const a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;const c=this._textAreaState.deduceEditorPosition(a),u=this._host.deduceModelPosition(c[0],c[1],c[2]),d=this._textAreaState.deduceEditorPosition(l),h=this._host.deduceModelPosition(d[0],d[1],d[2]),g=new ln(u.lineNumber,u.column,h.lineNumber,h.column);this._onSelectionChangeRequest.fire(g)})}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())}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};zM.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,`
`):t.text,i),e.preventDefault(),e.clipboardData&&Cse.setTextData(e.clipboardData,t.text,t.html,i)}}const Cse={getTextData(n){const e=n.getData(Ks.text);let t=null;const i=n.getData("vscode-editor-data");if(typeof i=="string")try{t=JSON.parse(i),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&n.files.length>0?[Array.prototype.slice.call(n.files,0).map(o=>o.name).join(`
`),null]:[e,t]},setTextData(n,e,t,i){n.setData(Ks.text,e),typeof t=="string"&&n.setData("text/html",t),n.setData("vscode-editor-data",JSON.stringify(i))}};class THi extends Ae{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new Wi(this._actual,"keydown")).event,this.onKeyUp=this._register(new Wi(this._actual,"keyup")).event,this.onCompositionStart=this._register(new Wi(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new Wi(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new Wi(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new Wi(this._actual,"beforeinput")).event,this.onInput=this._register(new Wi(this._actual,"input")).event,this.onCut=this._register(new Wi(this._actual,"cut")).event,this.onCopy=this._register(new Wi(this._actual,"copy")).event,this.onPaste=this._register(new Wi(this._actual,"paste")).event,this.onFocus=this._register(new Wi(this._actual,"focus")).event,this.onBlur=this._register(new Wi(this._actual,"blur")).event,this._onSyntheticTap=this._register(new be),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>J1.onKeyDown())),this._register(this.onBeforeInput(()=>J1.onBeforeInput())),this._register(this.onInput(()=>J1.onInput())),this._register(this.onKeyUp(()=>J1.onKeyUp())),this._register(We(this._actual,QV.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=Px(this._actual);return e?e.activeElement===this._actual:Vme(this._actual)?this._actual.ownerDocument.activeElement===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const r=this._actual;let o=null;const s=Px(r);s?o=s.activeElement:o=r.ownerDocument.activeElement;const a=o===r,l=r.selectionStart,c=r.selectionEnd;if(a&&l===t&&c===i){wg&&window.parent!==window&&r.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),r.setSelectionRange(t,i),wg&&window.parent!==window&&r.focus();return}try{const u=s$i(r);this.setIgnoreSelectionChangeTime("setSelectionRange"),r.focus(),r.setSelectionRange(t,i),a$i(r,u)}catch{}}}class IHi extends g_e{constructor(e,t,i){super(e,t,i),this._register(bo.addTarget(this.viewHelper.linesContentDomNode)),this._register(We(this.viewHelper.linesContentDomNode,yo.Tap,o=>this.onTap(o))),this._register(We(this.viewHelper.linesContentDomNode,yo.Change,o=>this.onChange(o))),this._register(We(this.viewHelper.linesContentDomNode,yo.Contextmenu,o=>this._onContextMenu(new gw(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(We(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const s=o.pointerType;if(s==="mouse"){this._lastPointerType="mouse";return}else s==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const r=new YVi(this.viewHelper.viewDomNode);this._register(r.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMove(o))),this._register(r.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(r.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(r.onPointerDown(this.viewHelper.viewDomNode,(o,s)=>this._onMouseDown(o,s)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new gw(e,!1,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:t.type===6&&t.detail.injectedText!==null})}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class LHi extends g_e{constructor(e,t,i){super(e,t,i),this._register(bo.addTarget(this.viewHelper.linesContentDomNode)),this._register(We(this.viewHelper.linesContentDomNode,yo.Tap,r=>this.onTap(r))),this._register(We(this.viewHelper.linesContentDomNode,yo.Change,r=>this.onChange(r))),this._register(We(this.viewHelper.linesContentDomNode,yo.Contextmenu,r=>this._onContextMenu(new gw(r,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new gw(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(QV.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class DHi extends Ae{constructor(e,t,i){super(),C_&&$me.pointerEvents?this.handler=this._register(new IHi(e,t,i)):window.TouchEvent?this.handler=this._register(new LHi(e,t,i)):this.handler=this._register(new g_e(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class Ok extends C5{}const ll=Vi("themeService");function ms(n){return{id:n}}function wse(n){switch(n){case sg.DARK:return"vs-dark";case sg.HIGH_CONTRAST_DARK:return"hc-black";case sg.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const Lqe={ThemingContribution:"base.contributions.theming"};class AHi{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new be}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Gn(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const Dqe=new AHi;ds.add(Lqe.ThemingContribution,Dqe);function rm(n){return Dqe.onColorThemeChange(n)}class RHi extends Ae{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const Aqe=re("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},E("lineHighlight","Background color for the highlight of line at the cursor position.")),VDe=re("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:ji},E("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));re("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},E("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);re("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Ho,hcLight:Ho},E("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0);re("editor.symbolHighlightBackground",{dark:$v,light:$v,hcDark:null,hcLight:null},E("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);re("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Ho,hcLight:Ho},E("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0);const Rqe=re("editorCursor.foreground",{dark:"#AEAFAD",light:De.black,hcDark:De.white,hcLight:"#0F4A85"},E("caret","Color of the editor cursor.")),NHi=re("editorCursor.background",null,E("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),Hy=re("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},E("editorWhitespaces","Color of whitespace characters in the editor.")),OHi=re("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:De.white,hcLight:"#292929"},E("editorLineNumbers","Color of editor line numbers.")),kB=re("editorIndentGuide.background",{dark:Hy,light:Hy,hcDark:Hy,hcLight:Hy},E("editorIndentGuides","Color of the editor indentation guides."),!1,E("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),TB=re("editorIndentGuide.activeBackground",{dark:Hy,light:Hy,hcDark:Hy,hcLight:Hy},E("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,E("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),E5=re("editorIndentGuide.background1",{dark:kB,light:kB,hcDark:kB,hcLight:kB},E("editorIndentGuides1","Color of the editor indentation guides (1).")),PHi=re("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorIndentGuides2","Color of the editor indentation guides (2).")),MHi=re("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorIndentGuides3","Color of the editor indentation guides (3).")),FHi=re("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorIndentGuides4","Color of the editor indentation guides (4).")),BHi=re("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorIndentGuides5","Color of the editor indentation guides (5).")),$Hi=re("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorIndentGuides6","Color of the editor indentation guides (6).")),x5=re("editorIndentGuide.activeBackground1",{dark:TB,light:TB,hcDark:TB,hcLight:TB},E("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),VHi=re("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),HHi=re("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),WHi=re("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),zHi=re("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),jHi=re("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),IB=re("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Ho,hcLight:Ho},E("editorActiveLineNumber","Color of editor active line number"),!1,E("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));re("editorLineNumber.activeForeground",{dark:IB,light:IB,hcDark:IB,hcLight:IB},E("editorActiveLineNumber","Color of editor active line number"));const UHi=re("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},E("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));re("editorRuler.foreground",{dark:"#5A5A5A",light:De.lightgrey,hcDark:De.white,hcLight:"#292929"},E("editorRuler","Color of the editor rulers."));re("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},E("editorCodeLensForeground","Foreground color of editor CodeLens"));re("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},E("editorBracketMatchBackground","Background color behind matching brackets"));re("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:ji,hcLight:ji},E("editorBracketMatchBorder","Color for matching brackets boxes"));const qHi=re("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},E("editorOverviewRulerBorder","Color of the overview ruler border.")),KHi=re("editorOverviewRuler.background",null,E("editorOverviewRulerBackground","Background color of the editor overview ruler."));re("editorGutter.background",{dark:tl,light:tl,hcDark:tl,hcLight:tl},E("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));re("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:De.fromHex("#fff").transparent(.8),hcLight:ji},E("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const GHi=re("editorUnnecessaryCode.opacity",{dark:De.fromHex("#000a"),light:De.fromHex("#0007"),hcDark:null,hcLight:null},E("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.`));re("editorGhostText.border",{dark:null,light:null,hcDark:De.fromHex("#fff").transparent(.8),hcLight:De.fromHex("#292929").transparent(.8)},E("editorGhostTextBorder","Border color of ghost text in the editor."));re("editorGhostText.foreground",{dark:De.fromHex("#ffffff56"),light:De.fromHex("#0007"),hcDark:null,hcLight:null},E("editorGhostTextForeground","Foreground color of the ghost text in the editor."));re("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},E("editorGhostTextBackground","Background color of the ghost text in the editor."));const LB=new De(new Yi(0,122,204,.6)),Nqe=re("editorOverviewRuler.rangeHighlightForeground",{dark:LB,light:LB,hcDark:LB,hcLight:LB},E("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),YHi=re("editorOverviewRuler.errorForeground",{dark:new De(new Yi(255,18,18,.7)),light:new De(new Yi(255,18,18,.7)),hcDark:new De(new Yi(255,50,50,1)),hcLight:"#B5200D"},E("overviewRuleError","Overview ruler marker color for errors.")),QHi=re("editorOverviewRuler.warningForeground",{dark:Gh,light:Gh,hcDark:BM,hcLight:BM},E("overviewRuleWarning","Overview ruler marker color for warnings.")),XHi=re("editorOverviewRuler.infoForeground",{dark:xd,light:xd,hcDark:$M,hcLight:$M},E("overviewRuleInfo","Overview ruler marker color for infos.")),Oqe=re("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},E("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),Pqe=re("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},E("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),Mqe=re("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},E("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),Fqe=re("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),Bqe=re("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),$qe=re("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),ZHi=re("editorBracketHighlight.unexpectedBracket.foreground",{dark:new De(new Yi(255,18,18,.8)),light:new De(new Yi(255,18,18,.8)),hcDark:new De(new Yi(255,50,50,1)),hcLight:""},E("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),JHi=re("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),eWi=re("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),tWi=re("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),nWi=re("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),iWi=re("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),rWi=re("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),oWi=re("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),sWi=re("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),aWi=re("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),lWi=re("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),cWi=re("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),uWi=re("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},E("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));re("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hcDark:"#ff0000",hcLight:"#CEA33D"},E("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));re("editorUnicodeHighlight.background",{dark:"#bd9b0326",light:"#cea33d14",hcDark:"#00000000",hcLight:"#cea33d14"},E("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));rm((n,e)=>{const t=n.getColor(tl),i=n.getColor(Aqe),r=i&&!i.isTransparent()?i:t;r&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${r}; }`)});class k5 extends Ok{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new Ce(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(66);const t=e.get(67);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(94);const i=e.get(143);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.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 i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(i=!0),i}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 Ce(e,1));if(t.column!==1)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===2){const r=Math.abs(this._lastCursorModelPosition.lineNumber-i);return r===0?'<span class="relative-current-line-number">'+i+"</span>":String(r)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===i||i%10===0?String(i):"":String(i)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=fu?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,o=this._context.viewModel.getLineCount(),s=[];for(let a=i;a<=r;a++){const l=a-i,c=this._getLineRenderLineNumber(a);if(!c){s[l]="";continue}let u="";if(a===o&&this._context.viewModel.getLineLength(a)===0){if(this._renderFinalNewline==="off"){s[l]="";continue}this._renderFinalNewline==="dimmed"&&(u=" dimmed-line-number")}a===this._activeLineNumber&&(u=" active-line-number"),s[l]=`<div class="${k5.CLASS_NAME}${t}${u}" style="left:${this._lineNumbersLeft}px;width:${this._lineNumbersWidth}px;">${c}</div>`}this._renderResult=s}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}k5.CLASS_NAME="line-numbers";rm((n,e)=>{const t=n.getColor(OHi),i=n.getColor(UHi);i?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});class Mx extends ph{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=Or(document.createElement("div")),this._domNode.setClassName(Mx.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=Or(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(Mx.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.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 i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}Mx.CLASS_NAME="glyph-margin";Mx.OUTER_CLASS_NAME="margin";const NL="monaco-mouse-cursor-text";class dWi{constructor(){this._onDidChange=new be,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}}const MO=new dWi,mo=Vi("keybindingService");var hWi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},fWi=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class gWi{constructor(e,t,i,r,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=r,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 Ce(this.modelLineNumber,this.distanceToModelLineStart+1),i=new Ce(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(i),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||(e?this._previousPresentation=e:this._previousPresentation={foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const wZ=wg;let Sse=class extends ph{constructor(e,t,i,r){super(e),this._keybindingService=r,this._primaryCursorPosition=new Ce(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const o=this._context.configuration.options,s=o.get(143);this._setAccessibilityOptions(o),this._contentLeft=s.contentLeft,this._contentWidth=s.contentWidth,this._contentHeight=s.height,this._fontInfo=o.get(50),this._lineHeight=o.get(66),this._emptySelectionClipboard=o.get(37),this._copyWithSyntaxHighlighting=o.get(25),this._visibleTextArea=null,this._selections=[new ln(1,1,1,1)],this._modelSelections=[new ln(1,1,1,1)],this._lastRenderPosition=null,this.textArea=Or(document.createElement("textarea")),ub.write(this.textArea,6),this.textArea.setClassName(`inputarea ${NL}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:a}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${a*this._fontInfo.spaceWidth}px`,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(o)),this.textArea.setAttribute("aria-required",o.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(o.get(123))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",E("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",o.get(90)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=Or(document.createElement("div")),this.textAreaCover.setPosition("absolute");const l={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:d=>this._context.viewModel.getLineMaxColumn(d),getValueInRange:(d,h)=>this._context.viewModel.getValueInRange(d,h),getValueLengthInRange:(d,h)=>this._context.viewModel.getValueLengthInRange(d,h),modifyPosition:(d,h)=>this._context.viewModel.modifyPosition(d,h)},c={getDataToCopy:()=>{const d=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,vc),h=this._context.viewModel.model.getEOL(),g=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),p=Array.isArray(d)?d:null,m=Array.isArray(d)?d.join(h):d;let _,v=null;if(yse.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&m.length<65536){const b=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);b&&(_=b.html,v=b.mode)}return{isFromEmptySelection:g,multicursorText:p,text:m,html:_,mode:v}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const d=this._selections[0];if(Qi&&d.isEmpty()){const g=d.getStartPosition();let p=this._getWordBeforePosition(g);if(p.length===0&&(p=this._getCharacterBeforePosition(g)),p.length>0)return new Ml(p,p.length,p.length,q.fromPositions(g),0)}const h=500;if(Qi&&!d.isEmpty()&&l.getValueLengthInRange(d,0)<h){const g=l.getValueInRange(d,0);return new Ml(g,0,g.length,d,0)}if(b0&&!d.isEmpty()){const g="vscode-placeholder";return new Ml(g,0,g.length,null,void 0)}return Ml.EMPTY}if(pLe){const d=this._selections[0];if(d.isEmpty()){const h=d.getStartPosition(),[g,p]=this._getAndroidWordAtPosition(h);if(g.length>0)return new Ml(g,p,p,q.fromPositions(h),0)}return Ml.EMPTY}return UI.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(d,h,g)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(d,h,g)},u=this._register(new THi(this.textArea.domNode));this._textAreaInput=this._register(new kHi(c,u,qh,{isAndroid:pLe,isChrome:Pme,isFirefox:wg,isSafari:b0})),this._register(this._textAreaInput.onKeyDown(d=>{this._viewController.emitKeyDown(d)})),this._register(this._textAreaInput.onKeyUp(d=>{this._viewController.emitKeyUp(d)})),this._register(this._textAreaInput.onPaste(d=>{let h=!1,g=null,p=null;d.metadata&&(h=this._emptySelectionClipboard&&!!d.metadata.isFromEmptySelection,g=typeof d.metadata.multicursorText<"u"?d.metadata.multicursorText:null,p=d.metadata.mode),this._viewController.paste(d.text,h,g,p)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(d=>{d.replacePrevCharCnt||d.replaceNextCharCnt||d.positionDelta?this._viewController.compositionType(d.text,d.replacePrevCharCnt,d.replaceNextCharCnt,d.positionDelta):this._viewController.type(d.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(d=>{this._viewController.setSelection(d)})),this._register(this._textAreaInput.onCompositionStart(d=>{const h=this.textArea.domNode,g=this._modelSelections[0],{distanceToModelLineStart:p,widthOfHiddenTextBefore:m}=(()=>{const v=h.value.substring(0,Math.min(h.selectionStart,h.selectionEnd)),b=v.lastIndexOf(`
`),y=v.substring(b+1),C=y.lastIndexOf(" "),x=y.length-C-1,k=g.getStartPosition(),I=Math.min(k.column-1,x),L=k.column-1-I,D=y.substring(0,y.length-I),{tabSize:R}=this._context.viewModel.model.getOptions(),P=pWi(this.textArea.domNode.ownerDocument,D,this._fontInfo,R);return{distanceToModelLineStart:L,widthOfHiddenTextBefore:P}})(),{distanceToModelLineEnd:_}=(()=>{const v=h.value.substring(Math.max(h.selectionStart,h.selectionEnd)),b=v.indexOf(`
`),y=b===-1?v:v.substring(0,b),C=y.indexOf(" "),x=C===-1?y.length:y.length-C-1,k=g.getEndPosition(),I=Math.min(this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column,x);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(k.lineNumber)-k.column-I}})();this._context.viewModel.revealRange("keyboard",!0,q.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new gWi(this._context,g.startLineNumber,p,m,_),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${NL} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(d=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${NL}`),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)})),this._register(MO.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeScreenReaderContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),r=xg(t);let o=!0,s=e.column,a=!0,l=e.column,c=0;for(;c<50&&(o||a);){if(o&&s<=1&&(o=!1),o){const u=i.charCodeAt(s-2);r.get(u)!==0?o=!1:s--}if(a&&l>i.length&&(a=!1),a){const u=i.charCodeAt(l-1);r.get(u)!==0?a=!1:l++}c++}return[i.substring(s-1,l-1),e.column-s]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=xg(this._context.configuration.options.get(129));let r=e.column,o=0;for(;r>1;){const s=t.charCodeAt(r-2);if(i.get(s)!==0||o>50)return t.substring(r-1,e.column-1);o++,r--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!Za(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){var t,i,r;if(e.get(2)===1){const s=(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))===null||t===void 0?void 0:t.getAriaLabel(),a=(i=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))===null||i===void 0?void 0:i.getAriaLabel(),l=(r=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))===null||r===void 0?void 0:r.getAriaLabel(),c=E("accessibilityModeOff","The editor is not accessible at this time.");return s?E("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",c,s):a?E("accessibilityOffAriaLabelNoKb","{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",c,a):l?E("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",c,l):c}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===A_.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const r=e.get(143).wrappingColumn;if(r!==-1&&this._accessibilitySupport!==1){const o=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(r*o.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=wZ?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(50),this._lineHeight=t.get(66),this._emptySelectionClipboard=t.get(37),this._copyWithSyntaxHighlighting=t.get(25),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:r}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${r*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("aria-required",t.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(123))),(e.hasChanged(34)||e.hasChanged(90))&&this._ensureReadOnlyAttribute(),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)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!MO.enabled||e.get(34)&&e.get(90)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new Ce(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),(t=this._visibleTextArea)===null||t===void 0||t.prepareRender(e)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){const r=this._visibleTextArea.visibleTextareaStart,o=this._visibleTextArea.visibleTextareaEnd,s=this._visibleTextArea.startPosition,a=this._visibleTextArea.endPosition;if(s&&a&&r&&o&&o.left>=this._scrollLeft&&r.left<=this._scrollLeft+this._contentWidth){const l=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,c=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let u=this._visibleTextArea.widthOfHiddenLineTextBefore,d=this._contentLeft+r.left-this._scrollLeft,h=o.left-r.left+1;if(d<this._contentLeft){const b=this._contentLeft-d;d+=b,u+=b,h-=b}h>this._contentWidth&&(h=this._contentWidth);const g=this._context.viewModel.getViewLineData(s.lineNumber),p=g.tokens.findTokenIndexAtOffset(s.column-1),m=g.tokens.findTokenIndexAtOffset(a.column-1),_=p===m,v=this._visibleTextArea.definePresentation(_?g.tokens.getPresentation(p):null);this.textArea.domNode.scrollTop=c*this._lineHeight,this.textArea.domNode.scrollLeft=u,this._doRender({lastRenderPosition:null,top:l,left:d,width:h,height:this._lineHeight,useCover:!1,color:(ps.getColorMap()||[])[v.foreground],italic:v.italic,bold:v.bold,underline:v.underline,strikethrough:v.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const t=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(t<this._contentLeft||t>this._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const i=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(i<0||i>this._contentHeight){this._renderAtTopLeft();return}if(Qi){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const r=(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)!==null&&e!==void 0?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=r*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:wZ?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;do{if(i=e.indexOf(`
`,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:wZ?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;mc(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?De.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const r=this._context.configuration.options;r.get(57)?i.setClassName("monaco-editor-background textAreaCover "+Mx.OUTER_CLASS_NAME):r.get(67).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+k5.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};Sse=hWi([fWi(3,mo)],Sse);function pWi(n,e,t,i){if(e.length===0)return 0;const r=n.createElement("div");r.style.position="absolute",r.style.top="-50000px",r.style.width="50000px";const o=n.createElement("span");mc(o,t),o.style.whiteSpace="pre",o.style.tabSize=`${i*t.spaceWidth}px`,o.append(e),r.appendChild(o),n.body.appendChild(r);const s=o.offsetWidth;return n.body.removeChild(r),s}function mWi(n,e,t){let i=0;for(let o=0;o<n.length;o++)n.charAt(o)===" "?i=Va.nextIndentTabStop(i,e):i++;let r="";if(!t){const o=Math.floor(i/e);i=i%e;for(let s=0;s<o;s++)r+=" "}for(let o=0;o<i;o++)r+=" ";return r}function XV(n,e,t){let i=cu(n);return i===-1&&(i=n.length),mWi(n.substring(0,i),e,t)+n.substring(i)}const _Wi=()=>!0,vWi=()=>!1,bWi=n=>n===" "||n===" ";class NT{static shouldRecreate(e){return e.hasChanged(143)||e.hasChanged(129)||e.hasChanged(37)||e.hasChanged(76)||e.hasChanged(78)||e.hasChanged(79)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(127)||e.hasChanged(50)||e.hasChanged(90)}constructor(e,t,i,r){var o;this.languageConfigurationService=r,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const s=i.options,a=s.get(143),l=s.get(50);this.readOnly=s.get(90),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=s.get(115),this.lineHeight=l.lineHeight,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=s.get(127),this.wordSeparators=s.get(129),this.emptySelectionClipboard=s.get(37),this.copyWithSyntaxHighlighting=s.get(25),this.multiCursorMergeOverlapping=s.get(76),this.multiCursorPaste=s.get(78),this.multiCursorLimit=s.get(79),this.autoClosingBrackets=s.get(6),this.autoClosingComments=s.get(7),this.autoClosingQuotes=s.get(11),this.autoClosingDelete=s.get(9),this.autoClosingOvertype=s.get(10),this.autoSurround=s.get(14),this.autoIndent=s.get(12),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const c=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(c)for(const d of c)this.surroundingPairs[d.open]=d.close;const u=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(o=u==null?void 0:u.blockCommentStartToken)!==null&&o!==void 0?o:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)===null||e===void 0?void 0:e.getElectricCharacters();if(t)for(const i of t)this._electricChars[i]=!0}return this._electricChars}onElectricCharacter(e,t,i){const r=KU(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(r.languageId).electricCharacter;return o?o.onElectricCharacter(e,r,i-r.firstCharOffset):null}normalizeIndentation(e){return XV(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return bWi;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return _Wi;case"never":return vWi}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return r=>i.indexOf(r)!==-1}visibleColumnFromColumn(e,t){return Va.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const r=Va.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(r<o)return o;const s=e.getLineMaxColumn(t);return r>s?s:r}}let lr=class Vqe{static fromModelState(e){return new yWi(e)}static fromViewState(e){return new CWi(e)}static fromModelSelection(e){const t=ln.liftSelection(e),i=new $l(q.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return Vqe.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,r=e.length;i<r;i++)t[i]=this.fromModelSelection(e[i]);return t}constructor(e,t){this._cursorStateBrand=void 0,this.modelState=e,this.viewState=t}equals(e){return this.viewState.equals(e.viewState)&&this.modelState.equals(e.modelState)}};class yWi{constructor(e){this.modelState=e,this.viewState=null}}class CWi{constructor(e){this.modelState=null,this.viewState=e}}class $l{constructor(e,t,i,r,o){this.selectionStart=e,this.selectionStartKind=t,this.selectionStartLeftoverVisibleColumns=i,this.position=r,this.leftoverVisibleColumns=o,this._singleCursorStateBrand=void 0,this.selection=$l._computeSelection(this.selectionStart,this.position)}equals(e){return this.selectionStartLeftoverVisibleColumns===e.selectionStartLeftoverVisibleColumns&&this.leftoverVisibleColumns===e.leftoverVisibleColumns&&this.selectionStartKind===e.selectionStartKind&&this.position.equals(e.position)&&this.selectionStart.equalsRange(e.selectionStart)}hasSelection(){return!this.selection.isEmpty()||!this.selectionStart.isEmpty()}move(e,t,i,r){return e?new $l(this.selectionStart,this.selectionStartKind,this.selectionStartLeftoverVisibleColumns,new Ce(t,i),r):new $l(new q(t,i,t,i),0,r,new Ce(t,i),r)}static _computeSelection(e,t){return e.isEmpty()||!t.isBeforeOrEqual(e.getStartPosition())?ln.fromPositions(e.getStartPosition(),t):ln.fromPositions(e.getEndPosition(),t)}}class hd{constructor(e,t,i){this._editOperationResultBrand=void 0,this.type=e,this.commands=t,this.shouldPushStackElementBefore=i.shouldPushStackElementBefore,this.shouldPushStackElementAfter=i.shouldPushStackElementAfter}}function h1(n){return n==="'"||n==='"'||n==="`"}class cE{static columnSelect(e,t,i,r,o,s){const a=Math.abs(o-i)+1,l=i>o,c=r>s,u=r<s,d=[];for(let h=0;h<a;h++){const g=i+(l?-h:h),p=e.columnFromVisibleColumn(t,g,r),m=e.columnFromVisibleColumn(t,g,s),_=e.visibleColumnFromColumn(t,new Ce(g,p)),v=e.visibleColumnFromColumn(t,new Ce(g,m));u&&(_>s||v<r)||c&&(v>r||_<s)||d.push(new $l(new q(g,p,g,p),0,0,new Ce(g,m),0))}if(d.length===0)for(let h=0;h<a;h++){const g=i+(l?-h:h),p=t.getLineMaxColumn(g);d.push(new $l(new q(g,p,g,p),0,0,new Ce(g,p),0))}return{viewStates:d,reversed:l,fromLineNumber:i,fromVisualColumn:r,toLineNumber:o,toVisualColumn:s}}static columnSelectLeft(e,t,i){let r=i.toViewVisualColumn;return r>0&&r--,cE.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,r)}static columnSelectRight(e,t,i){let r=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),s=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let l=o;l<=s;l++){const c=t.getLineMaxColumn(l),u=e.visibleColumnFromColumn(t,new Ce(l,c));r=Math.max(r,u)}let a=i.toViewVisualColumn;return a<r&&a++,this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,a)}static columnSelectUp(e,t,i,r){const o=r?e.pageSize:1,s=Math.max(1,i.toViewLineNumber-o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,s,i.toViewVisualColumn)}static columnSelectDown(e,t,i,r){const o=r?e.pageSize:1,s=Math.min(t.getLineCount(),i.toViewLineNumber+o);return this.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,s,i.toViewVisualColumn)}}class oc{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return ln.fromPositions(r.getEndPosition())}}class wWi{constructor(e,t){this._range=e,this._text=t}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return ln.fromRange(r,0)}}class DB{constructor(e,t,i=!1){this._range=e,this._text=t,this.insertsAutoWhitespace=i}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return ln.fromPositions(r.getStartPosition())}}class B8{constructor(e,t,i,r,o=!1){this._range=e,this._text=t,this._columnDeltaOffset=r,this._lineNumberDeltaOffset=i,this.insertsAutoWhitespace=o}getEditOperations(e,t){t.addTrackedEditOperation(this._range,this._text)}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return ln.fromPositions(r.getEndPosition().delta(this._lineNumberDeltaOffset,this._columnDeltaOffset))}}class p_e{constructor(e,t,i,r=!1){this._range=e,this._text=t,this._initialSelection=i,this._forceMoveMarkers=r,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 SZ{constructor(e,t,i){this._cursorPositionBrand=void 0,this.lineNumber=e,this.column=t,this.leftoverVisibleColumns=i}}class Mr{static leftPosition(e,t){if(t.column>e.getLineMinColumn(t.lineNumber))return t.delta(void 0,-Jje(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new Ce(i,e.getLineMaxColumn(i))}else return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const r=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),s=HM.atomicPosition(o,t.column-1,i,0);if(s!==-1&&s+1>=r)return new Ce(t.lineNumber,s+1)}return this.leftPosition(e,t)}static left(e,t,i){const r=e.stickyTabStops?Mr.leftPositionAtomicSoftTabs(t,i,e.tabSize):Mr.leftPosition(t,i);return new SZ(r.lineNumber,r.column,0)}static moveLeft(e,t,i,r,o){let s,a;if(i.hasSelection()&&!r)s=i.selection.startLineNumber,a=i.selection.startColumn;else{const l=i.position.delta(void 0,-(o-1)),c=t.normalizePosition(Mr.clipPositionColumn(l,t),0),u=Mr.left(e,t,c);s=u.lineNumber,a=u.column}return i.move(r,s,a,0)}static clipPositionColumn(e,t){return new Ce(e.lineNumber,Mr.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return e<t?t:e>i?i:e}static rightPosition(e,t,i){return i<e.getLineMaxColumn(t)?i=i+Rme(e.getLineContent(t),i-1):t<e.getLineCount()&&(t=t+1,i=e.getLineMinColumn(t)),new Ce(t,i)}static rightPositionAtomicSoftTabs(e,t,i,r,o){if(i<e.getLineIndentColumn(t)){const s=e.getLineContent(t),a=HM.atomicPosition(s,i-1,r,1);if(a!==-1)return new Ce(t,a+1)}return this.rightPosition(e,t,i)}static right(e,t,i){const r=e.stickyTabStops?Mr.rightPositionAtomicSoftTabs(t,i.lineNumber,i.column,e.tabSize,e.indentSize):Mr.rightPosition(t,i.lineNumber,i.column);return new SZ(r.lineNumber,r.column,0)}static moveRight(e,t,i,r,o){let s,a;if(i.hasSelection()&&!r)s=i.selection.endLineNumber,a=i.selection.endColumn;else{const l=i.position.delta(void 0,o-1),c=t.normalizePosition(Mr.clipPositionColumn(l,t),1),u=Mr.right(e,t,c);s=u.lineNumber,a=u.column}return i.move(r,s,a,0)}static vertical(e,t,i,r,o,s,a,l){const c=Va.visibleColumnFromColumn(t.getLineContent(i),r,e.tabSize)+o,u=t.getLineCount(),d=i===1&&r===1,h=i===u&&r===t.getLineMaxColumn(i),g=s<i?d:h;if(i=s,i<1?(i=1,a?r=t.getLineMinColumn(i):r=Math.min(t.getLineMaxColumn(i),r)):i>u?(i=u,a?r=t.getLineMaxColumn(i):r=Math.min(t.getLineMaxColumn(i),r)):r=e.columnFromVisibleColumn(t,i,c),g?o=0:o=c-Va.visibleColumnFromColumn(t.getLineContent(i),r,e.tabSize),l!==void 0){const p=new Ce(i,r),m=t.normalizePosition(p,l);o=o+(r-m.column),i=m.lineNumber,r=m.column}return new SZ(i,r,o)}static down(e,t,i,r,o,s,a){return this.vertical(e,t,i,r,o,i+s,a,4)}static moveDown(e,t,i,r,o){let s,a;i.hasSelection()&&!r?(s=i.selection.endLineNumber,a=i.selection.endColumn):(s=i.position.lineNumber,a=i.position.column);let l=0,c;do if(c=Mr.down(e,t,s+l,a,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new Ce(c.lineNumber,c.column),2).lineNumber>s)break;while(l++<10&&s+l<t.getLineCount());return i.move(r,c.lineNumber,c.column,c.leftoverVisibleColumns)}static translateDown(e,t,i){const r=i.selection,o=Mr.down(e,t,r.selectionStartLineNumber,r.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=Mr.down(e,t,r.positionLineNumber,r.positionColumn,i.leftoverVisibleColumns,1,!1);return new $l(new q(o.lineNumber,o.column,o.lineNumber,o.column),0,o.leftoverVisibleColumns,new Ce(s.lineNumber,s.column),s.leftoverVisibleColumns)}static up(e,t,i,r,o,s,a){return this.vertical(e,t,i,r,o,i-s,a,3)}static moveUp(e,t,i,r,o){let s,a;i.hasSelection()&&!r?(s=i.selection.startLineNumber,a=i.selection.startColumn):(s=i.position.lineNumber,a=i.position.column);const l=Mr.up(e,t,s,a,i.leftoverVisibleColumns,o,!0);return i.move(r,l.lineNumber,l.column,l.leftoverVisibleColumns)}static translateUp(e,t,i){const r=i.selection,o=Mr.up(e,t,r.selectionStartLineNumber,r.selectionStartColumn,i.selectionStartLeftoverVisibleColumns,1,!1),s=Mr.up(e,t,r.positionLineNumber,r.positionColumn,i.leftoverVisibleColumns,1,!1);return new $l(new q(o.lineNumber,o.column,o.lineNumber,o.column),0,o.leftoverVisibleColumns,new Ce(s.lineNumber,s.column),s.leftoverVisibleColumns)}static _isBlankLine(e,t){return e.getLineFirstNonWhitespaceColumn(t)===0}static moveToPrevBlankLine(e,t,i,r){let o=i.position.lineNumber;for(;o>1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(r,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,r){const o=t.getLineCount();let s=i.position.lineNumber;for(;s<o&&this._isBlankLine(t,s);)s++;for(;s<o&&!this._isBlankLine(t,s);)s++;return i.move(r,s,t.getLineMinColumn(s),0)}static moveToBeginningOfLine(e,t,i,r){const o=i.position.lineNumber,s=t.getLineMinColumn(o),a=t.getLineFirstNonWhitespaceColumn(o)||s;let l;return i.position.column===a?l=s:l=a,i.move(r,o,l,0)}static moveToEndOfLine(e,t,i,r,o){const s=i.position.lineNumber,a=t.getLineMaxColumn(s);return i.move(r,s,a,o?1073741824-a:0)}static moveToBeginningOfBuffer(e,t,i,r){return i.move(r,1,1,0)}static moveToEndOfBuffer(e,t,i,r){const o=t.getLineCount(),s=t.getLineMaxColumn(o);return i.move(r,o,s,0)}}class Fx{static deleteRight(e,t,i,r){const o=[];let s=e!==3;for(let a=0,l=r.length;a<l;a++){const c=r[a];let u=c;if(u.isEmpty()){const d=c.getPosition(),h=Mr.right(t,i,d);u=new q(h.lineNumber,h.column,d.lineNumber,d.column)}if(u.isEmpty()){o[a]=null;continue}u.startLineNumber!==u.endLineNumber&&(s=!0),o[a]=new oc(u,"")}return[s,o]}static isAutoClosingPairDelete(e,t,i,r,o,s,a){if(t==="never"&&i==="never"||e==="never")return!1;for(let l=0,c=s.length;l<c;l++){const u=s[l],d=u.getPosition();if(!u.isEmpty())return!1;const h=o.getLineContent(d.lineNumber);if(d.column<2||d.column>=h.length+1)return!1;const g=h.charAt(d.column-2),p=r.get(g);if(!p)return!1;if(h1(g)){if(i==="never")return!1}else if(t==="never")return!1;const m=h.charAt(d.column-1);let _=!1;for(const v of p)v.open===g&&v.close===m&&(_=!0);if(!_)return!1;if(e==="auto"){let v=!1;for(let b=0,y=a.length;b<y;b++){const C=a[b];if(d.lineNumber===C.startLineNumber&&d.column===C.startColumn){v=!0;break}}if(!v)return!1}}return!0}static _runAutoClosingPairDelete(e,t,i){const r=[];for(let o=0,s=i.length;o<s;o++){const a=i[o].getPosition(),l=new q(a.lineNumber,a.column-1,a.lineNumber,a.column+1);r[o]=new oc(l,"")}return[!0,r]}static deleteLeft(e,t,i,r,o){if(this.isAutoClosingPairDelete(t.autoClosingDelete,t.autoClosingBrackets,t.autoClosingQuotes,t.autoClosingPairs.autoClosingPairsOpenByEnd,i,r,o))return this._runAutoClosingPairDelete(t,i,r);const s=[];let a=e!==2;for(let l=0,c=r.length;l<c;l++){const u=Fx.getDeleteRange(r[l],i,t);if(u.isEmpty()){s[l]=null;continue}u.startLineNumber!==u.endLineNumber&&(a=!0),s[l]=new oc(u,"")}return[a,s]}static getDeleteRange(e,t,i){if(!e.isEmpty())return e;const r=e.getPosition();if(i.useTabStops&&r.column>1){const o=t.getLineContent(r.lineNumber),s=cu(o),a=s===-1?o.length+1:s+1;if(r.column<=a){const l=i.visibleColumnFromColumn(t,r),c=Va.prevIndentTabStop(l,i.indentSize),u=i.columnFromVisibleColumn(t,r.lineNumber,c);return new q(r.lineNumber,u,r.lineNumber,r.column)}}return q.fromPositions(Fx.getPositionAfterDeleteLeft(r,t),r)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=F6i(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}else if(e.lineNumber>1){const i=e.lineNumber-1;return new Ce(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const r=[];let o=null;i.sort((s,a)=>Ce.compare(s.getStartPosition(),a.getEndPosition()));for(let s=0,a=i.length;s<a;s++){const l=i[s];if(l.isEmpty())if(e.emptySelectionClipboard){const c=l.getPosition();let u,d,h,g;c.lineNumber<t.getLineCount()?(u=c.lineNumber,d=1,h=c.lineNumber+1,g=1):c.lineNumber>1&&(o==null?void 0:o.endLineNumber)!==c.lineNumber?(u=c.lineNumber-1,d=t.getLineMaxColumn(c.lineNumber-1),h=c.lineNumber,g=t.getLineMaxColumn(c.lineNumber)):(u=c.lineNumber,d=1,h=c.lineNumber,g=t.getLineMaxColumn(c.lineNumber));const p=new q(u,d,h,g);o=p,p.isEmpty()?r[s]=null:r[s]=new oc(p,"")}else r[s]=null;else r[s]=new oc(l,"")}return new hd(0,r,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class Tr{static _createWord(e,t,i,r,o){return{start:r,end:o,wordType:t,nextCharClass:i}}static _findPreviousWordOnLine(e,t,i){const r=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(r,e,i)}static _doFindPreviousWordOnLine(e,t,i){let r=0;for(let o=i.column-2;o>=0;o--){const s=e.charCodeAt(o),a=t.get(s);if(a===0){if(r===2)return this._createWord(e,r,a,o+1,this._findEndOfWord(e,t,r,o+1));r=1}else if(a===2){if(r===1)return this._createWord(e,r,a,o+1,this._findEndOfWord(e,t,r,o+1));r=2}else if(a===1&&r!==0)return this._createWord(e,r,a,o+1,this._findEndOfWord(e,t,r,o+1))}return r!==0?this._createWord(e,r,1,0,this._findEndOfWord(e,t,r,0)):null}static _findEndOfWord(e,t,i,r){const o=e.length;for(let s=r;s<o;s++){const a=e.charCodeAt(s),l=t.get(a);if(l===1||i===1&&l===2||i===2&&l===0)return s}return o}static _findNextWordOnLine(e,t,i){const r=t.getLineContent(i.lineNumber);return this._doFindNextWordOnLine(r,e,i)}static _doFindNextWordOnLine(e,t,i){let r=0;const o=e.length;for(let s=i.column-1;s<o;s++){const a=e.charCodeAt(s),l=t.get(a);if(l===0){if(r===2)return this._createWord(e,r,l,this._findStartOfWord(e,t,r,s-1),s);r=1}else if(l===2){if(r===1)return this._createWord(e,r,l,this._findStartOfWord(e,t,r,s-1),s);r=2}else if(l===1&&r!==0)return this._createWord(e,r,l,this._findStartOfWord(e,t,r,s-1),s)}return r!==0?this._createWord(e,r,1,this._findStartOfWord(e,t,r,o-1),o):null}static _findStartOfWord(e,t,i,r){for(let o=r;o>=0;o--){const s=e.charCodeAt(o),a=t.get(s);if(a===1||i===1&&a===2||i===2&&a===0)return o+1}return 0}static moveWordLeft(e,t,i,r){let o=i.lineNumber,s=i.column;s===1&&o>1&&(o=o-1,s=t.getLineMaxColumn(o));let a=Tr._findPreviousWordOnLine(e,t,new Ce(o,s));if(r===0)return new Ce(o,a?a.start+1:1);if(r===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=Tr._findPreviousWordOnLine(e,t,new Ce(o,a.start+1))),new Ce(o,a?a.start+1:1);if(r===3){for(;a&&a.wordType===2;)a=Tr._findPreviousWordOnLine(e,t,new Ce(o,a.start+1));return new Ce(o,a?a.start+1:1)}return a&&s<=a.end+1&&(a=Tr._findPreviousWordOnLine(e,t,new Ce(o,a.start+1))),new Ce(o,a?a.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,r=e.getLineMaxColumn(i);if(t.column===1)return i>1?new Ce(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let s=t.column-1;s>1;s--){const a=o.charCodeAt(s-2),l=o.charCodeAt(s-1);if(a===95&&l!==95)return new Ce(i,s);if(a===45&&l!==45)return new Ce(i,s);if((G1(a)||_B(a))&&dv(l))return new Ce(i,s);if(dv(a)&&dv(l)&&s+1<r){const c=o.charCodeAt(s);if(G1(c)||_B(c))return new Ce(i,s)}}return new Ce(i,1)}static moveWordRight(e,t,i,r){let o=i.lineNumber,s=i.column,a=!1;s===t.getLineMaxColumn(o)&&o<t.getLineCount()&&(a=!0,o=o+1,s=1);let l=Tr._findNextWordOnLine(e,t,new Ce(o,s));if(r===2)l&&l.wordType===2&&l.end-l.start===1&&l.nextCharClass===0&&(l=Tr._findNextWordOnLine(e,t,new Ce(o,l.end+1))),l?s=l.end+1:s=t.getLineMaxColumn(o);else if(r===3){for(a&&(s=0);l&&(l.wordType===2||l.start+1<=s);)l=Tr._findNextWordOnLine(e,t,new Ce(o,l.end+1));l?s=l.start+1:s=t.getLineMaxColumn(o)}else l&&!a&&s>=l.start+1&&(l=Tr._findNextWordOnLine(e,t,new Ce(o,l.end+1))),l?s=l.start+1:s=t.getLineMaxColumn(o);return new Ce(o,s)}static _moveWordPartRight(e,t){const i=t.lineNumber,r=e.getLineMaxColumn(i);if(t.column===r)return i<e.getLineCount()?new Ce(i+1,1):t;const o=e.getLineContent(i);for(let s=t.column+1;s<r;s++){const a=o.charCodeAt(s-2),l=o.charCodeAt(s-1);if(a!==95&&l===95)return new Ce(i,s);if(a!==45&&l===45)return new Ce(i,s);if((G1(a)||_B(a))&&dv(l))return new Ce(i,s);if(dv(a)&&dv(l)&&s+1<r){const c=o.charCodeAt(s);if(G1(c)||_B(c))return new Ce(i,s)}}return new Ce(i,r)}static _deleteWordLeftWhitespace(e,t){const i=e.getLineContent(t.lineNumber),r=t.column-2,o=g_(i,r);return o+1<r?new q(t.lineNumber,o+2,t.lineNumber,t.column):null}static deleteWordLeft(e,t){const i=e.wordSeparators,r=e.model,o=e.selection,s=e.whitespaceHeuristics;if(!o.isEmpty())return o;if(Fx.isAutoClosingPairDelete(e.autoClosingDelete,e.autoClosingBrackets,e.autoClosingQuotes,e.autoClosingPairs.autoClosingPairsOpenByEnd,e.model,[e.selection],e.autoClosedCharacters)){const d=e.selection.getPosition();return new q(d.lineNumber,d.column-1,d.lineNumber,d.column+1)}const a=new Ce(o.positionLineNumber,o.positionColumn);let l=a.lineNumber,c=a.column;if(l===1&&c===1)return null;if(s){const d=this._deleteWordLeftWhitespace(r,a);if(d)return d}let u=Tr._findPreviousWordOnLine(i,r,a);return t===0?u?c=u.start+1:c>1?c=1:(l--,c=r.getLineMaxColumn(l)):(u&&c<=u.end+1&&(u=Tr._findPreviousWordOnLine(i,r,new Ce(l,u.start+1))),u?c=u.end+1:c>1?c=1:(l--,c=r.getLineMaxColumn(l))),new q(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const r=new Ce(i.positionLineNumber,i.positionColumn),o=this._deleteInsideWordWhitespace(t,r);return o||this._deleteInsideWordDetermineDeleteRange(e,t,r)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return i===32||i===9}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),r=i.length;if(r===0)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let s=Math.min(t.column-1,r-1);if(!this._charAtIsWhitespace(i,s))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;s+1<r&&this._charAtIsWhitespace(i,s+1);)s++;return new q(t.lineNumber,o+1,t.lineNumber,s+2)}static _deleteInsideWordDetermineDeleteRange(e,t,i){const r=t.getLineContent(i.lineNumber),o=r.length;if(o===0)return i.lineNumber>1?new q(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumber<t.getLineCount()?new q(i.lineNumber,1,i.lineNumber+1,1):new q(i.lineNumber,1,i.lineNumber,1);const s=d=>d.start+1<=i.column&&i.column<=d.end+1,a=(d,h)=>(d=Math.min(d,i.column),h=Math.max(h,i.column),new q(i.lineNumber,d,i.lineNumber,h)),l=d=>{let h=d.start+1,g=d.end+1,p=!1;for(;g-1<o&&this._charAtIsWhitespace(r,g-1);)p=!0,g++;if(!p)for(;h>1&&this._charAtIsWhitespace(r,h-2);)h--;return a(h,g)},c=Tr._findPreviousWordOnLine(e,t,i);if(c&&s(c))return l(c);const u=Tr._findNextWordOnLine(e,t,i);return u&&s(u)?l(u):c&&u?a(c.end+1,u.start+1):c?a(c.start+1,c.end+1):u?a(u.start+1,u.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),r=Tr._moveWordPartLeft(e,i);return new q(i.lineNumber,i.column,r.lineNumber,r.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let r=t;r<i;r++){const o=e.charAt(r);if(o!==" "&&o!==" ")return r}return i}static _deleteWordRightWhitespace(e,t){const i=e.getLineContent(t.lineNumber),r=t.column-1,o=this._findFirstNonWhitespaceChar(i,r);return r+1<o?new q(t.lineNumber,t.column,t.lineNumber,o+1):null}static deleteWordRight(e,t){const i=e.wordSeparators,r=e.model,o=e.selection,s=e.whitespaceHeuristics;if(!o.isEmpty())return o;const a=new Ce(o.positionLineNumber,o.positionColumn);let l=a.lineNumber,c=a.column;const u=r.getLineCount(),d=r.getLineMaxColumn(l);if(l===u&&c===d)return null;if(s){const g=this._deleteWordRightWhitespace(r,a);if(g)return g}let h=Tr._findNextWordOnLine(i,r,a);return t===2?h?c=h.end+1:c<d||l===u?c=d:(l++,h=Tr._findNextWordOnLine(i,r,new Ce(l,1)),h?c=h.start+1:c=r.getLineMaxColumn(l)):(h&&c>=h.start+1&&(h=Tr._findNextWordOnLine(i,r,new Ce(l,h.end+1))),h?c=h.start+1:c<d||l===u?c=d:(l++,h=Tr._findNextWordOnLine(i,r,new Ce(l,1)),h?c=h.start+1:c=r.getLineMaxColumn(l))),new q(l,c,a.lineNumber,a.column)}static _deleteWordPartRight(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),r=Tr._moveWordPartRight(e,i);return new q(i.lineNumber,i.column,r.lineNumber,r.column)}static _createWordAtPosition(e,t,i){const r=new q(t,i.start+1,t,i.end+1);return{word:e.getValueInRange(r),startColumn:r.startColumn,endColumn:r.endColumn}}static getWordAtPosition(e,t,i){const r=xg(t),o=Tr._findPreviousWordOnLine(r,e,i);if(o&&o.wordType===1&&o.start<=i.column-1&&i.column-1<=o.end)return Tr._createWordAtPosition(e,i.lineNumber,o);const s=Tr._findNextWordOnLine(r,e,i);return s&&s.wordType===1&&s.start<=i.column-1&&i.column-1<=s.end?Tr._createWordAtPosition(e,i.lineNumber,s):null}static word(e,t,i,r,o){const s=xg(e.wordSeparators),a=Tr._findPreviousWordOnLine(s,t,o),l=Tr._findNextWordOnLine(s,t,o);if(!r){let g,p;return a&&a.wordType===1&&a.start<=o.column-1&&o.column-1<=a.end?(g=a.start+1,p=a.end+1):l&&l.wordType===1&&l.start<=o.column-1&&o.column-1<=l.end?(g=l.start+1,p=l.end+1):(a?g=a.end+1:g=1,l?p=l.start+1:p=t.getLineMaxColumn(o.lineNumber)),new $l(new q(o.lineNumber,g,o.lineNumber,p),1,0,new Ce(o.lineNumber,p),0)}let c,u;a&&a.wordType===1&&a.start<o.column-1&&o.column-1<a.end?(c=a.start+1,u=a.end+1):l&&l.wordType===1&&l.start<o.column-1&&o.column-1<l.end?(c=l.start+1,u=l.end+1):(c=o.column,u=o.column);const d=o.lineNumber;let h;if(i.selectionStart.containsPosition(o))h=i.selectionStart.endColumn;else if(o.isBeforeOrEqual(i.selectionStart.getStartPosition())){h=c;const g=new Ce(d,h);i.selectionStart.containsPosition(g)&&(h=i.selectionStart.endColumn)}else{h=u;const g=new Ce(d,h);i.selectionStart.containsPosition(g)&&(h=i.selectionStart.startColumn)}return i.move(!0,d,h,0)}}class aq extends Tr{static deleteWordPartLeft(e){const t=AB([Tr.deleteWordLeft(e,0),Tr.deleteWordLeft(e,2),Tr._deleteWordPartLeft(e.model,e.selection)]);return t.sort(q.compareRangesUsingEnds),t[2]}static deleteWordPartRight(e){const t=AB([Tr.deleteWordRight(e,0),Tr.deleteWordRight(e,2),Tr._deleteWordPartRight(e.model,e.selection)]);return t.sort(q.compareRangesUsingStarts),t[0]}static moveWordPartLeft(e,t,i){const r=AB([Tr.moveWordLeft(e,t,i,0),Tr.moveWordLeft(e,t,i,2),Tr._moveWordPartLeft(t,i)]);return r.sort(Ce.compare),r[2]}static moveWordPartRight(e,t,i){const r=AB([Tr.moveWordRight(e,t,i,0),Tr.moveWordRight(e,t,i,2),Tr._moveWordPartRight(t,i)]);return r.sort(Ce.compare),r[0]}}function AB(n){return n.filter(e=>!!e)}class Nl{static addCursorDown(e,t,i){const r=[];let o=0;for(let s=0,a=t.length;s<a;s++){const l=t[s];r[o++]=new lr(l.modelState,l.viewState),i?r[o++]=lr.fromModelState(Mr.translateDown(e.cursorConfig,e.model,l.modelState)):r[o++]=lr.fromViewState(Mr.translateDown(e.cursorConfig,e,l.viewState))}return r}static addCursorUp(e,t,i){const r=[];let o=0;for(let s=0,a=t.length;s<a;s++){const l=t[s];r[o++]=new lr(l.modelState,l.viewState),i?r[o++]=lr.fromModelState(Mr.translateUp(e.cursorConfig,e.model,l.modelState)):r[o++]=lr.fromViewState(Mr.translateUp(e.cursorConfig,e,l.viewState))}return r}static moveToBeginningOfLine(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o];r[o]=this._moveToLineStart(e,a,i)}return r}static _moveToLineStart(e,t,i){const r=t.viewState.position.column,o=t.modelState.position.column,s=r===o,a=t.viewState.position.lineNumber,l=e.getLineFirstNonWhitespaceColumn(a);return!s&&!(r===l)?this._moveToLineStartByView(e,t,i):this._moveToLineStartByModel(e,t,i)}static _moveToLineStartByView(e,t,i){return lr.fromViewState(Mr.moveToBeginningOfLine(e.cursorConfig,e,t.viewState,i))}static _moveToLineStartByModel(e,t,i){return lr.fromModelState(Mr.moveToBeginningOfLine(e.cursorConfig,e.model,t.modelState,i))}static moveToEndOfLine(e,t,i,r){const o=[];for(let s=0,a=t.length;s<a;s++){const l=t[s];o[s]=this._moveToLineEnd(e,l,i,r)}return o}static _moveToLineEnd(e,t,i,r){const o=t.viewState.position,s=e.getLineMaxColumn(o.lineNumber),a=o.column===s,l=t.modelState.position,c=e.model.getLineMaxColumn(l.lineNumber),u=s-o.column===c-l.column;return a||u?this._moveToLineEndByModel(e,t,i,r):this._moveToLineEndByView(e,t,i,r)}static _moveToLineEndByView(e,t,i,r){return lr.fromViewState(Mr.moveToEndOfLine(e.cursorConfig,e,t.viewState,i,r))}static _moveToLineEndByModel(e,t,i,r){return lr.fromModelState(Mr.moveToEndOfLine(e.cursorConfig,e.model,t.modelState,i,r))}static expandLineSelection(e,t){const i=[];for(let r=0,o=t.length;r<o;r++){const s=t[r],a=s.modelState.selection.startLineNumber,l=e.model.getLineCount();let c=s.modelState.selection.endLineNumber,u;c===l?u=e.model.getLineMaxColumn(l):(c++,u=1),i[r]=lr.fromModelState(new $l(new q(a,1,a,1),0,0,new Ce(c,u),0))}return i}static moveToBeginningOfBuffer(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o];r[o]=lr.fromModelState(Mr.moveToBeginningOfBuffer(e.cursorConfig,e.model,a.modelState,i))}return r}static moveToEndOfBuffer(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o];r[o]=lr.fromModelState(Mr.moveToEndOfBuffer(e.cursorConfig,e.model,a.modelState,i))}return r}static selectAll(e,t){const i=e.model.getLineCount(),r=e.model.getLineMaxColumn(i);return lr.fromModelState(new $l(new q(1,1,1,1),0,0,new Ce(i,r),0))}static line(e,t,i,r,o){const s=e.model.validatePosition(r),a=o?e.coordinatesConverter.validateViewPosition(new Ce(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);if(!i){const c=e.model.getLineCount();let u=s.lineNumber+1,d=1;return u>c&&(u=c,d=e.model.getLineMaxColumn(u)),lr.fromModelState(new $l(new q(s.lineNumber,1,u,d),2,0,new Ce(u,d),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(s.lineNumber<l)return lr.fromViewState(t.viewState.move(!0,a.lineNumber,1,0));if(s.lineNumber>l){const c=e.getLineCount();let u=a.lineNumber+1,d=1;return u>c&&(u=c,d=e.getLineMaxColumn(u)),lr.fromViewState(t.viewState.move(!0,u,d,0))}else{const c=t.modelState.selectionStart.getEndPosition();return lr.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,i,r){const o=e.model.validatePosition(r);return lr.fromModelState(Tr.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new lr(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,r=t.viewState.position.column;return lr.fromViewState(new $l(new q(i,r,i,r),0,0,new Ce(i,r),0))}static moveTo(e,t,i,r,o){if(i){if(t.modelState.selectionStartKind===1)return this.word(e,t,i,r);if(t.modelState.selectionStartKind===2)return this.line(e,t,i,r,o)}const s=e.model.validatePosition(r),a=o?e.coordinatesConverter.validateViewPosition(new Ce(o.lineNumber,o.column),s):e.coordinatesConverter.convertModelPositionToViewPosition(s);return lr.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,r,o,s){switch(i){case 0:return s===4?this._moveHalfLineLeft(e,t,r):this._moveLeft(e,t,r,o);case 1:return s===4?this._moveHalfLineRight(e,t,r):this._moveRight(e,t,r,o);case 2:return s===2?this._moveUpByViewLines(e,t,r,o):this._moveUpByModelLines(e,t,r,o);case 3:return s===2?this._moveDownByViewLines(e,t,r,o):this._moveDownByModelLines(e,t,r,o);case 4:return s===2?t.map(a=>lr.fromViewState(Mr.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,r))):t.map(a=>lr.fromModelState(Mr.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,r)));case 5:return s===2?t.map(a=>lr.fromViewState(Mr.moveToNextBlankLine(e.cursorConfig,e,a.viewState,r))):t.map(a=>lr.fromModelState(Mr.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,r)));case 6:return this._moveToViewMinColumn(e,t,r);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,r);case 8:return this._moveToViewCenterColumn(e,t,r);case 9:return this._moveToViewMaxColumn(e,t,r);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,r);default:return null}}static viewportMove(e,t,i,r,o){const s=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(s);switch(i){case 11:{const l=this._firstLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],r,l,c)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],r,l,c)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],r,l,c)]}case 14:{const l=[];for(let c=0,u=t.length;c<u;c++){const d=t[c];l[c]=this.findPositionInViewportIfOutside(e,d,s,r)}return l}default:return null}}static findPositionInViewportIfOutside(e,t,i,r){const o=t.viewState.position.lineNumber;if(i.startLineNumber<=o&&o<=i.endLineNumber-1)return new lr(t.modelState,t.viewState);{let s;o>i.endLineNumber-1?s=i.endLineNumber-1:o<i.startLineNumber?s=i.startLineNumber:s=o;const a=Mr.vertical(e.cursorConfig,e,o,t.viewState.position.column,t.viewState.leftoverVisibleColumns,s,!1);return lr.fromViewState(t.viewState.move(r,a.lineNumber,a.column,a.leftoverVisibleColumns))}}static _firstLineNumberInRange(e,t,i){let r=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(r)&&r++,Math.min(t.endLineNumber,r+i-1)}static _lastLineNumberInRange(e,t,i){let r=t.startLineNumber;return t.startColumn!==e.getLineMinColumn(r)&&r++,Math.max(r,t.endLineNumber-i+1)}static _moveLeft(e,t,i,r){return t.map(o=>lr.fromViewState(Mr.moveLeft(e.cursorConfig,e,o.viewState,i,r)))}static _moveHalfLineLeft(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o],l=a.viewState.position.lineNumber,c=Math.round(e.getLineContent(l).length/2);r[o]=lr.fromViewState(Mr.moveLeft(e.cursorConfig,e,a.viewState,i,c))}return r}static _moveRight(e,t,i,r){return t.map(o=>lr.fromViewState(Mr.moveRight(e.cursorConfig,e,o.viewState,i,r)))}static _moveHalfLineRight(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o],l=a.viewState.position.lineNumber,c=Math.round(e.getLineContent(l).length/2);r[o]=lr.fromViewState(Mr.moveRight(e.cursorConfig,e,a.viewState,i,c))}return r}static _moveDownByViewLines(e,t,i,r){const o=[];for(let s=0,a=t.length;s<a;s++){const l=t[s];o[s]=lr.fromViewState(Mr.moveDown(e.cursorConfig,e,l.viewState,i,r))}return o}static _moveDownByModelLines(e,t,i,r){const o=[];for(let s=0,a=t.length;s<a;s++){const l=t[s];o[s]=lr.fromModelState(Mr.moveDown(e.cursorConfig,e.model,l.modelState,i,r))}return o}static _moveUpByViewLines(e,t,i,r){const o=[];for(let s=0,a=t.length;s<a;s++){const l=t[s];o[s]=lr.fromViewState(Mr.moveUp(e.cursorConfig,e,l.viewState,i,r))}return o}static _moveUpByModelLines(e,t,i,r){const o=[];for(let s=0,a=t.length;s<a;s++){const l=t[s];o[s]=lr.fromModelState(Mr.moveUp(e.cursorConfig,e.model,l.modelState,i,r))}return o}static _moveToViewPosition(e,t,i,r,o){return lr.fromViewState(t.viewState.move(i,r,o,0))}static _moveToModelPosition(e,t,i,r,o){return lr.fromModelState(t.modelState.move(i,r,o,0))}static _moveToViewMinColumn(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o],l=a.viewState.position.lineNumber,c=e.getLineMinColumn(l);r[o]=this._moveToViewPosition(e,a,i,l,c)}return r}static _moveToViewFirstNonWhitespaceColumn(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o],l=a.viewState.position.lineNumber,c=e.getLineFirstNonWhitespaceColumn(l);r[o]=this._moveToViewPosition(e,a,i,l,c)}return r}static _moveToViewCenterColumn(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o],l=a.viewState.position.lineNumber,c=Math.round((e.getLineMaxColumn(l)+e.getLineMinColumn(l))/2);r[o]=this._moveToViewPosition(e,a,i,l,c)}return r}static _moveToViewMaxColumn(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o],l=a.viewState.position.lineNumber,c=e.getLineMaxColumn(l);r[o]=this._moveToViewPosition(e,a,i,l,c)}return r}static _moveToViewLastNonWhitespaceColumn(e,t,i){const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o],l=a.viewState.position.lineNumber,c=e.getLineLastNonWhitespaceColumn(l);r[o]=this._moveToViewPosition(e,a,i,l,c)}return r}}var ZV;(function(n){const e=function(i){if(!Vu(i))return!1;const r=i;return!(!Ku(r.to)||!Xd(r.select)&&!Cje(r.select)||!Xd(r.by)&&!Ku(r.by)||!Xd(r.value)&&!ow(r.value))};n.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:
* 'to': A mandatory logical position value providing where to move the cursor.
\`\`\`
'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',
'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'
'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'
'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'
\`\`\`
* 'by': Unit to move. Default is computed based on 'to' value.
\`\`\`
'line', 'wrappedLine', 'character', 'halfLine'
\`\`\`
* 'value': Number of units to move. Default is '1'.
* 'select': If 'true' makes the selection. Default is 'false'.
`,constraint:e,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}}}}]},n.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"},n.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(i){if(!i.to)return null;let r;switch(i.to){case n.RawDirection.Left:r=0;break;case n.RawDirection.Right:r=1;break;case n.RawDirection.Up:r=2;break;case n.RawDirection.Down:r=3;break;case n.RawDirection.PrevBlankLine:r=4;break;case n.RawDirection.NextBlankLine:r=5;break;case n.RawDirection.WrappedLineStart:r=6;break;case n.RawDirection.WrappedLineFirstNonWhitespaceCharacter:r=7;break;case n.RawDirection.WrappedLineColumnCenter:r=8;break;case n.RawDirection.WrappedLineEnd:r=9;break;case n.RawDirection.WrappedLineLastNonWhitespaceCharacter:r=10;break;case n.RawDirection.ViewPortTop:r=11;break;case n.RawDirection.ViewPortBottom:r=13;break;case n.RawDirection.ViewPortCenter:r=12;break;case n.RawDirection.ViewPortIfOutside:r=14;break;default:return null}let o=0;switch(i.by){case n.RawUnit.Line:o=1;break;case n.RawUnit.WrappedLine:o=2;break;case n.RawUnit.Character:o=3;break;case n.RawUnit.HalfLine:o=4;break}return{direction:r,unit:o,select:!!i.select,value:i.value||1}}n.parse=t})(ZV||(ZV={}));function OL(n,e,t,i){const r=TL(e,t.startLineNumber,t.startColumn),o=i.getLanguageConfiguration(r.languageId);if(!o)return null;const s=r.getLineContent(),a=s.substr(0,t.startColumn-1-r.firstCharOffset);let l;t.isEmpty()?l=s.substr(t.startColumn-1-r.firstCharOffset):l=TL(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset);let c="";if(t.startLineNumber>1&&r.firstCharOffset===0){const m=TL(e,t.startLineNumber-1);m.languageId===r.languageId&&(c=m.getLineContent())}const u=o.onEnter(n,c,a,l);if(!u)return null;const d=u.indentAction;let h=u.appendText;const g=u.removeText||0;h?d===Ca.Indent&&(h=" "+h):d===Ca.Indent||d===Ca.IndentOutdent?h=" ":h="";let p=GUe(e,t.startLineNumber,t.startColumn);return g&&(p=p.substring(0,p.length-g)),{indentAction:d,appendText:h,removeText:g,indentation:p}}var SWi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},EWi=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},$8;const EZ=Object.create(null);function xS(n,e){if(e<=0)return"";EZ[n]||(EZ[n]=["",n]);const t=EZ[n];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+n;return t[e]}let Xf=$8=class{static unshiftIndent(e,t,i,r,o){const s=Va.visibleColumnFromColumn(e,t,i);if(o){const a=xS(" ",r),c=Va.prevIndentTabStop(s,r)/r;return xS(a,c)}else{const a=" ",c=Va.prevRenderTabStop(s,i)/i;return xS(a,c)}}static shiftIndent(e,t,i,r,o){const s=Va.visibleColumnFromColumn(e,t,i);if(o){const a=xS(" ",r),c=Va.nextIndentTabStop(s,r)/r;return xS(a,c)}else{const a=" ",c=Va.nextRenderTabStop(s,i)/i;return xS(a,c)}}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let r=this._selection.endLineNumber;this._selection.endColumn===1&&i!==r&&(r=r-1);const{tabSize:o,indentSize:s,insertSpaces:a}=this._opts,l=i===r;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,u=0;for(let d=i;d<=r;d++,c=u){u=0;const h=e.getLineContent(d);let g=cu(h);if(this._opts.isUnshift&&(h.length===0||g===0)||!l&&!this._opts.isUnshift&&h.length===0)continue;if(g===-1&&(g=h.length),d>1&&Va.visibleColumnFromColumn(h,g+1,o)%s!==0&&e.tokenization.isCheapToTokenize(d-1)){const _=OL(this._opts.autoIndent,e,new q(d-1,e.getLineMaxColumn(d-1),d-1,e.getLineMaxColumn(d-1)),this._languageConfigurationService);if(_){if(u=c,_.appendText)for(let v=0,b=_.appendText.length;v<b&&u<s&&_.appendText.charCodeAt(v)===32;v++)u++;_.removeText&&(u=Math.max(0,u-_.removeText));for(let v=0;v<u&&!(g===0||h.charCodeAt(g-1)!==32);v++)g--}}if(this._opts.isUnshift&&g===0)continue;let p;this._opts.isUnshift?p=$8.unshiftIndent(h,g+1,o,s,a):p=$8.shiftIndent(h,g+1,o,s,a),this._addEditOperation(t,new q(d,1,d,g+1),p),d===i&&!this._selection.isEmpty()&&(this._selectionStartColumnStaysPut=this._selection.startColumn<=g+1)}}else{!this._opts.isUnshift&&this._selection.isEmpty()&&e.getLineLength(i)===0&&(this._useLastEditRangeForCursorEndPosition=!0);const c=a?xS(" ",s):" ";for(let u=i;u<=r;u++){const d=e.getLineContent(u);let h=cu(d);if(!(this._opts.isUnshift&&(d.length===0||h===0))&&!(!l&&!this._opts.isUnshift&&d.length===0)&&(h===-1&&(h=d.length),!(this._opts.isUnshift&&h===0)))if(this._opts.isUnshift){h=Math.min(h,s);for(let g=0;g<h;g++)if(d.charCodeAt(g)===9){h=g+1;break}this._addEditOperation(t,new q(u,1,u,h+1),"")}else this._addEditOperation(t,new q(u,1,u,1),c),u===i&&!this._selection.isEmpty()&&(this._selectionStartColumnStaysPut=this._selection.startColumn===1)}}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){if(this._useLastEditRangeForCursorEndPosition){const r=t.getInverseEditOperations()[0];return new ln(r.range.endLineNumber,r.range.endColumn,r.range.endLineNumber,r.range.endColumn)}const i=t.getTrackedSelection(this._selectionId);if(this._selectionStartColumnStaysPut){const r=this._selection.startColumn;return i.startColumn<=r?i:i.getDirection()===0?new ln(i.startLineNumber,r,i.endLineNumber,i.endColumn):new ln(i.endLineNumber,i.endColumn,i.startLineNumber,r)}return i}};Xf=$8=SWi([EWi(2,xo)],Xf);class xWi{constructor(e,t,i){this._range=e,this._charBeforeSelection=t,this._charAfterSelection=i}getEditOperations(e,t){t.addTrackedEditOperation(new q(this._range.startLineNumber,this._range.startColumn,this._range.startLineNumber,this._range.startColumn),this._charBeforeSelection),t.addTrackedEditOperation(new q(this._range.endLineNumber,this._range.endColumn,this._range.endLineNumber,this._range.endColumn),this._charAfterSelection)}computeCursorState(e,t){const i=t.getInverseEditOperations(),r=i[0].range,o=i[1].range;return new ln(r.endLineNumber,r.endColumn,o.endLineNumber,o.endColumn-this._charAfterSelection.length)}}class kWi{constructor(e,t,i){this._position=e,this._text=t,this._charAfter=i}getEditOperations(e,t){t.addTrackedEditOperation(new q(this._position.lineNumber,this._position.column,this._position.lineNumber,this._position.column),this._text+this._charAfter)}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return new ln(r.endLineNumber,r.startColumn,r.endLineNumber,r.endColumn-this._charAfter.length)}}function TWi(n,e,t){const i=n.tokenization.getLanguageIdAtPosition(e,0);if(e>1){let r,o=-1;for(r=e-1;r>=1;r--){if(n.tokenization.getLanguageIdAtPosition(r,0)!==i)return o;const s=n.getLineContent(r);if(t.shouldIgnore(s)||/^\s+$/.test(s)||s===""){o=r;continue}return r}}return-1}function lq(n,e,t,i=!0,r){if(n<4)return null;const o=r.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!o)return null;if(t<=1)return{indentation:"",action:null};for(let l=t-1;l>0&&e.getLineContent(l)==="";l--)if(l===1)return{indentation:"",action:null};const s=TWi(e,t,o);if(s<0)return null;if(s<1)return{indentation:"",action:null};const a=e.getLineContent(s);if(o.shouldIncrease(a)||o.shouldIndentNextLine(a))return{indentation:go(a),action:Ca.Indent,line:s};if(o.shouldDecrease(a))return{indentation:go(a),action:null,line:s};{if(s===1)return{indentation:go(e.getLineContent(s)),action:null,line:s};const l=s-1,c=o.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let u=0;for(let d=l-1;d>0;d--)if(!o.shouldIndentNextLine(e.getLineContent(d))){u=d;break}return{indentation:go(e.getLineContent(u+1)),action:null,line:u+1}}if(i)return{indentation:go(e.getLineContent(s)),action:null,line:s};for(let u=s;u>0;u--){const d=e.getLineContent(u);if(o.shouldIncrease(d))return{indentation:go(d),action:Ca.Indent,line:u};if(o.shouldIndentNextLine(d)){let h=0;for(let g=u-1;g>0;g--)if(!o.shouldIndentNextLine(e.getLineContent(u))){h=g;break}return{indentation:go(e.getLineContent(h+1)),action:null,line:h+1}}else if(o.shouldDecrease(d))return{indentation:go(d),action:null,line:u}}return{indentation:go(e.getLineContent(1)),action:null,line:1}}}function FO(n,e,t,i,r,o){if(n<4)return null;const s=o.getLanguageConfiguration(t);if(!s)return null;const a=o.getLanguageConfiguration(t).indentRulesSupport;if(!a)return null;const l=lq(n,e,i,void 0,o),c=e.getLineContent(i);if(l){const u=l.line;if(u!==void 0){let d=!0;for(let h=u;h<i-1;h++)if(!/^\s*$/.test(e.getLineContent(h))){d=!1;break}if(d){const h=s.onEnter(n,"",e.getLineContent(u),"");if(h){let g=go(e.getLineContent(u));return h.removeText&&(g=g.substring(0,g.length-h.removeText)),h.indentAction===Ca.Indent||h.indentAction===Ca.IndentOutdent?g=r.shiftIndent(g):h.indentAction===Ca.Outdent&&(g=r.unshiftIndent(g)),a.shouldDecrease(c)&&(g=r.unshiftIndent(g)),h.appendText&&(g+=h.appendText),go(g)}}}return a.shouldDecrease(c)?l.action===Ca.Indent?l.indentation:r.unshiftIndent(l.indentation):l.action===Ca.Indent?r.shiftIndent(l.indentation):l.indentation}return null}function IWi(n,e,t,i,r){if(n<4)return null;e.tokenization.forceTokenization(t.startLineNumber);const o=e.tokenization.getLineTokens(t.startLineNumber),s=KU(o,t.startColumn-1),a=s.getLineContent();let l=!1,c;s.firstCharOffset>0&&o.getLanguageId(0)!==s.languageId?(l=!0,c=a.substr(0,t.startColumn-1-s.firstCharOffset)):c=o.getLineContent().substring(0,t.startColumn-1);let u;t.isEmpty()?u=a.substr(t.startColumn-1-s.firstCharOffset):u=TL(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset);const d=r.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!d)return null;const h=c,g=go(c),p={tokenization:{getLineTokens:b=>e.tokenization.getLineTokens(b),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(b,y)=>e.getLanguageIdAtPosition(b,y)},getLineContent:b=>b===t.startLineNumber?h:e.getLineContent(b)},m=go(o.getLineContent()),_=lq(n,p,t.startLineNumber+1,void 0,r);if(!_){const b=l?m:g;return{beforeEnter:b,afterEnter:b}}let v=l?m:_.indentation;return _.action===Ca.Indent&&(v=i.shiftIndent(v)),d.shouldDecrease(u)&&(v=i.unshiftIndent(v)),{beforeEnter:l?m:g,afterEnter:v}}function LWi(n,e,t,i,r,o){if(n<4)return null;const s=TL(e,t.startLineNumber,t.startColumn);if(s.firstCharOffset)return null;const a=o.getLanguageConfiguration(s.languageId).indentRulesSupport;if(!a)return null;const l=s.getLineContent(),c=l.substr(0,t.startColumn-1-s.firstCharOffset);let u;if(t.isEmpty()?u=l.substr(t.startColumn-1-s.firstCharOffset):u=TL(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset),!a.shouldDecrease(c+u)&&a.shouldDecrease(c+i+u)){const d=lq(n,e,t.startLineNumber,!1,o);if(!d)return null;let h=d.indentation;return d.action!==Ca.Indent&&(h=r.unshiftIndent(h)),h}return null}function Hqe(n,e,t){const i=t.getLanguageConfiguration(n.getLanguageId()).indentRulesSupport;return!i||e<1||e>n.getLineCount()?null:i.getIndentMetadata(n.getLineContent(e))}class ls{static indent(e,t,i){if(t===null||i===null)return[];const r=[];for(let o=0,s=i.length;o<s;o++)r[o]=new Xf(i[o],{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return r}static outdent(e,t,i){const r=[];for(let o=0,s=i.length;o<s;o++)r[o]=new Xf(i[o],{isUnshift:!0,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService);return r}static shiftIndent(e,t,i){return i=i||1,Xf.shiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static unshiftIndent(e,t,i){return i=i||1,Xf.unshiftIndent(t,t.length+i,e.tabSize,e.indentSize,e.insertSpaces)}static _distributedPaste(e,t,i,r){const o=[];for(let s=0,a=i.length;s<a;s++)o[s]=new oc(i[s],r[s]);return new hd(0,o,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _simplePaste(e,t,i,r,o){const s=[];for(let a=0,l=i.length;a<l;a++){const c=i[a],u=c.getPosition();if(o&&!c.isEmpty()&&(o=!1),o&&r.indexOf(`
`)!==r.length-1&&(o=!1),o){const d=new q(u.lineNumber,1,u.lineNumber,1);s[a]=new p_e(d,r,c,!0)}else s[a]=new oc(c,r)}return new hd(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _distributePasteToCursors(e,t,i,r,o){if(r||t.length===1)return null;if(o&&o.length===t.length)return o;if(e.multiCursorPaste==="spread"){i.charCodeAt(i.length-1)===10&&(i=i.substr(0,i.length-1)),i.charCodeAt(i.length-1)===13&&(i=i.substr(0,i.length-1));const s=ab(i);if(s.length===t.length)return s}return null}static paste(e,t,i,r,o,s){const a=this._distributePasteToCursors(e,i,r,o,s);return a?(i=i.sort(q.compareRangesUsingStarts),this._distributedPaste(e,t,i,a)):this._simplePaste(e,t,i,r,o)}static _goodIndentForLine(e,t,i){let r=null,o="";const s=lq(e.autoIndent,t,i,!1,e.languageConfigurationService);if(s)r=s.action,o=s.indentation;else if(i>1){let a;for(a=i-1;a>=1;a--){const u=t.getLineContent(a);if(g_(u)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=OL(e.autoIndent,t,new q(a,l,a,l),e.languageConfigurationService);c&&(o=c.indentation+c.appendText)}return r&&(r===Ca.Indent&&(o=ls.shiftIndent(e,o)),r===Ca.Outdent&&(o=ls.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,r){let o="";const s=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,s),l=e.indentSize,c=l-a%l;for(let u=0;u<c;u++)o+=" "}else o=" ";return new oc(i,o,r)}static tab(e,t,i){const r=[];for(let o=0,s=i.length;o<s;o++){const a=i[o];if(a.isEmpty()){const l=t.getLineContent(a.startLineNumber);if(/^\s*$/.test(l)&&t.tokenization.isCheapToTokenize(a.startLineNumber)){let c=this._goodIndentForLine(e,t,a.startLineNumber);c=c||" ";const u=e.normalizeIndentation(c);if(!l.startsWith(u)){r[o]=new oc(new q(a.startLineNumber,1,a.startLineNumber,l.length+1),u,!0);continue}}r[o]=this._replaceJumpToNextIndent(e,t,a,!0)}else{if(a.startLineNumber===a.endLineNumber){const l=t.getLineMaxColumn(a.startLineNumber);if(a.startColumn!==1||a.endColumn!==l){r[o]=this._replaceJumpToNextIndent(e,t,a,!1);continue}}r[o]=new Xf(a,{isUnshift:!1,tabSize:e.tabSize,indentSize:e.indentSize,insertSpaces:e.insertSpaces,useTabStops:e.useTabStops,autoIndent:e.autoIndent},e.languageConfigurationService)}}return r}static compositionType(e,t,i,r,o,s,a,l){const c=r.map(u=>this._compositionType(i,u,o,s,a,l));return new hd(4,c,{shouldPushStackElementBefore:RB(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,r,o,s){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-r),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),u=new q(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(u)===i&&s===0?null:new B8(u,i,0,s)}static _typeCommand(e,t,i){return i?new DB(e,t,!0):new oc(e,t,!0)}static _enter(e,t,i,r){if(e.autoIndent===0)return ls._typeCommand(r,`
`,i);if(!t.tokenization.isCheapToTokenize(r.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(r.startLineNumber),c=go(l).substring(0,r.startColumn-1);return ls._typeCommand(r,`
`+e.normalizeIndentation(c),i)}const o=OL(e.autoIndent,t,r,e.languageConfigurationService);if(o){if(o.indentAction===Ca.None)return ls._typeCommand(r,`
`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Ca.Indent)return ls._typeCommand(r,`
`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===Ca.IndentOutdent){const l=e.normalizeIndentation(o.indentation),c=e.normalizeIndentation(o.indentation+o.appendText),u=`
`+c+`
`+l;return i?new DB(r,u,!0):new B8(r,u,-1,c.length-l.length,!0)}else if(o.indentAction===Ca.Outdent){const l=ls.unshiftIndent(e,o.indentation);return ls._typeCommand(r,`
`+e.normalizeIndentation(l+o.appendText),i)}}const s=t.getLineContent(r.startLineNumber),a=go(s).substring(0,r.startColumn-1);if(e.autoIndent>=4){const l=IWi(e.autoIndent,t,r,{unshiftIndent:c=>ls.unshiftIndent(e,c),shiftIndent:c=>ls.shiftIndent(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,r.getEndPosition());const u=r.endColumn,d=t.getLineContent(r.endLineNumber),h=cu(d);if(h>=0?r=r.setEndPosition(r.endLineNumber,Math.max(r.endColumn,h+1)):r=r.setEndPosition(r.endLineNumber,t.getLineMaxColumn(r.endLineNumber)),i)return new DB(r,`
`+e.normalizeIndentation(l.afterEnter),!0);{let g=0;return u<=h+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),g=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new B8(r,`
`+e.normalizeIndentation(l.afterEnter),0,g,!0)}}}return ls._typeCommand(r,`
`+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let r=0,o=i.length;r<o;r++)if(!t.tokenization.isCheapToTokenize(i[r].getEndPosition().lineNumber))return!1;return!0}static _runAutoIndentType(e,t,i,r){const o=GUe(t,i.startLineNumber,i.startColumn),s=LWi(e.autoIndent,t,i,r,{shiftIndent:a=>ls.shiftIndent(e,a),unshiftIndent:a=>ls.unshiftIndent(e,a)},e.languageConfigurationService);if(s===null)return null;if(s!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?ls._typeCommand(new q(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+r,!1):ls._typeCommand(new q(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(s)+t.getLineContent(i.startLineNumber).substring(a-1,i.startColumn-1)+r,!1)}return null}static _isAutoClosingOvertype(e,t,i,r,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let s=0,a=i.length;s<a;s++){const l=i[s];if(!l.isEmpty())return!1;const c=l.getPosition(),u=t.getLineContent(c.lineNumber);if(u.charAt(c.column-1)!==o)return!1;const h=h1(o);if((c.column>2?u.charCodeAt(c.column-2):0)===92&&h)return!1;if(e.autoClosingOvertype==="auto"){let p=!1;for(let m=0,_=r.length;m<_;m++){const v=r[m];if(c.lineNumber===v.startLineNumber&&c.column===v.startColumn){p=!0;break}}if(!p)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,r,o){const s=[];for(let a=0,l=r.length;a<l;a++){const u=r[a].getPosition(),d=new q(u.lineNumber,u.column,u.lineNumber,u.column+1);s[a]=new oc(d,o)}return new hd(4,s,{shouldPushStackElementBefore:RB(e,4),shouldPushStackElementAfter:!1})}static _isBeforeClosingBrace(e,t){const i=t.charAt(0),r=e.autoClosingPairs.autoClosingPairsOpenByStart.get(i)||[],o=e.autoClosingPairs.autoClosingPairsCloseByStart.get(i)||[],s=r.some(l=>t.startsWith(l.open)),a=o.some(l=>t.startsWith(l.close));return!s&&a}static _findAutoClosingPairOpen(e,t,i,r){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(r);if(!o)return null;let s=null;for(const a of o)if(s===null||a.open.length>s.open.length){let l=!0;for(const c of i)if(t.getValueInRange(new q(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+r!==a.open){l=!1;break}l&&(s=a)}return s}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),r=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const s of r)s.open!==t.open&&t.open.includes(s.open)&&t.close.endsWith(s.close)&&(!o||s.open.length>o.open.length)&&(o=s);return o}static _getAutoClosingPairClose(e,t,i,r,o){for(const p of i)if(!p.isEmpty())return null;const s=i.map(p=>{const m=p.getPosition();return o?{lineNumber:m.lineNumber,beforeColumn:m.column-r.length,afterColumn:m.column}:{lineNumber:m.lineNumber,beforeColumn:m.column,afterColumn:m.column}}),a=this._findAutoClosingPairOpen(e,t,s.map(p=>new Ce(p.lineNumber,p.beforeColumn)),r);if(!a)return null;let l,c;if(h1(r)?(l=e.autoClosingQuotes,c=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,c=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,c=e.shouldAutoCloseBefore.bracket),l==="never")return null;const d=this._findContainedAutoClosingPair(e,a),h=d?d.close:"";let g=!0;for(const p of s){const{lineNumber:m,beforeColumn:_,afterColumn:v}=p,b=t.getLineContent(m),y=b.substring(0,_-1),C=b.substring(v-1);if(C.startsWith(h)||(g=!1),C.length>0){const L=C.charAt(0);if(!ls._isBeforeClosingBrace(e,C)&&!c(L))return null}if(a.open.length===1&&(r==="'"||r==='"')&&l!=="always"){const L=xg(e.wordSeparators);if(y.length>0){const D=y.charCodeAt(y.length-1);if(L.get(D)===0)return null}}if(!t.tokenization.isCheapToTokenize(m))return null;t.tokenization.forceTokenization(m);const x=t.tokenization.getLineTokens(m),k=KU(x,_-1);if(!a.shouldAutoClose(k,_-k.firstCharOffset))return null;const I=a.findNeutralCharacter();if(I){const L=t.tokenization.getTokenTypeIfInsertingCharacter(m,_,I);if(!a.isOK(L))return null}}return g?a.close.substring(0,a.close.length-h.length):a.close}static _runAutoClosingOpenCharType(e,t,i,r,o,s,a){const l=[];for(let c=0,u=r.length;c<u;c++){const d=r[c];l[c]=new Wqe(d,o,!s,a)}return new hd(4,l,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}static _shouldSurroundChar(e,t){return h1(t)?e.autoSurround==="quotes"||e.autoSurround==="languageDefined":e.autoSurround==="brackets"||e.autoSurround==="languageDefined"}static _isSurroundSelectionType(e,t,i,r){if(!ls._shouldSurroundChar(e,r)||!e.surroundingPairs.hasOwnProperty(r))return!1;const o=h1(r);for(const s of i){if(s.isEmpty())return!1;let a=!0;for(let l=s.startLineNumber;l<=s.endLineNumber;l++){const c=t.getLineContent(l),u=l===s.startLineNumber?s.startColumn-1:0,d=l===s.endLineNumber?s.endColumn-1:c.length,h=c.substring(u,d);if(/[^ \t]/.test(h)){a=!1;break}}if(a)return!1;if(o&&s.startLineNumber===s.endLineNumber&&s.startColumn+1===s.endColumn){const l=t.getValueInRange(s);if(h1(l))return!1}}return!0}static _runSurroundSelectionType(e,t,i,r,o){const s=[];for(let a=0,l=r.length;a<l;a++){const c=r[a],u=t.surroundingPairs[o];s[a]=new xWi(c,o,u)}return new hd(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}static _isTypeInterceptorElectricChar(e,t,i){return!!(i.length===1&&t.tokenization.isCheapToTokenize(i[0].getEndPosition().lineNumber))}static _typeInterceptorElectricChar(e,t,i,r,o){if(!t.electricChars.hasOwnProperty(o)||!r.isEmpty())return null;const s=r.getPosition();i.tokenization.forceTokenization(s.lineNumber);const a=i.tokenization.getLineTokens(s.lineNumber);let l;try{l=t.onElectricCharacter(o,a,s.column)}catch(c){return fi(c),null}if(!l)return null;if(l.matchOpenBracket){const c=(a.getLineContent()+o).lastIndexOf(l.matchOpenBracket)+1,u=i.bracketPairs.findMatchingBracketUp(l.matchOpenBracket,{lineNumber:s.lineNumber,column:c},500);if(u){if(u.startLineNumber===s.lineNumber)return null;const d=i.getLineContent(u.startLineNumber),h=go(d),g=t.normalizeIndentation(h),p=i.getLineContent(s.lineNumber),m=i.getLineFirstNonWhitespaceColumn(s.lineNumber)||s.column,_=p.substring(m-1,s.column-1),v=g+_+o,b=new q(s.lineNumber,1,s.lineNumber,s.column),y=new oc(b,v);return new hd(xZ(v,e),[y],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!0})}}return null}static compositionEndWithInterceptors(e,t,i,r,o,s){if(!r)return null;let a=null;for(const d of r)if(a===null)a=d.insertedText;else if(a!==d.insertedText)return null;if(!a||a.length!==1)return null;const l=a;let c=!1;for(const d of r)if(d.deletedText.length!==0){c=!0;break}if(c){if(!ls._shouldSurroundChar(t,l)||!t.surroundingPairs.hasOwnProperty(l))return null;const d=h1(l);for(const p of r)if(p.deletedSelectionStart!==0||p.deletedSelectionEnd!==p.deletedText.length||/^[ \t]+$/.test(p.deletedText)||d&&h1(p.deletedText))return null;const h=[];for(const p of o){if(!p.isEmpty())return null;h.push(p.getPosition())}if(h.length!==r.length)return null;const g=[];for(let p=0,m=h.length;p<m;p++)g.push(new kWi(h[p],r[p].deletedText,t.surroundingPairs[l]));return new hd(4,g,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(t,i,o,s,l)){const d=o.map(h=>new oc(new q(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new hd(4,d,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const u=this._getAutoClosingPairClose(t,i,o,l,!0);return u!==null?this._runAutoClosingOpenCharType(e,t,i,o,l,!0,u):null}static typeWithInterceptors(e,t,i,r,o,s,a){if(!e&&a===`
`){const u=[];for(let d=0,h=o.length;d<h;d++)u[d]=ls._enter(i,r,!1,o[d]);return new hd(4,u,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(!e&&this._isAutoIndentType(i,r,o)){const u=[];let d=!1;for(let h=0,g=o.length;h<g;h++)if(u[h]=this._runAutoIndentType(i,r,o[h],a),!u[h]){d=!0;break}if(!d)return new hd(4,u,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}if(this._isAutoClosingOvertype(i,r,o,s,a))return this._runAutoClosingOvertype(t,i,r,o,a);if(!e){const u=this._getAutoClosingPairClose(i,r,o,a,!1);if(u)return this._runAutoClosingOpenCharType(t,i,r,o,a,!1,u)}if(!e&&this._isSurroundSelectionType(i,r,o,a))return this._runSurroundSelectionType(t,i,r,o,a);if(!e&&this._isTypeInterceptorElectricChar(i,r,o)){const u=this._typeInterceptorElectricChar(t,i,r,o[0],a);if(u)return u}const l=[];for(let u=0,d=o.length;u<d;u++)l[u]=new oc(o[u],a);const c=xZ(a,t);return new hd(c,l,{shouldPushStackElementBefore:RB(t,c),shouldPushStackElementAfter:!1})}static typeWithoutInterceptors(e,t,i,r,o){const s=[];for(let l=0,c=r.length;l<c;l++)s[l]=new oc(r[l],o);const a=xZ(o,e);return new hd(a,s,{shouldPushStackElementBefore:RB(e,a),shouldPushStackElementAfter:!1})}static lineInsertBefore(e,t,i){if(t===null||i===null)return[];const r=[];for(let o=0,s=i.length;o<s;o++){let a=i[o].positionLineNumber;if(a===1)r[o]=new DB(new q(1,1,1,1),`
`);else{a--;const l=t.getLineMaxColumn(a);r[o]=this._enter(e,t,!1,new q(a,l,a,l))}}return r}static lineInsertAfter(e,t,i){if(t===null||i===null)return[];const r=[];for(let o=0,s=i.length;o<s;o++){const a=i[o].positionLineNumber,l=t.getLineMaxColumn(a);r[o]=this._enter(e,t,!1,new q(a,l,a,l))}return r}static lineBreakInsert(e,t,i){const r=[];for(let o=0,s=i.length;o<s;o++)r[o]=this._enter(e,t,!0,i[o]);return r}}class Wqe extends B8{constructor(e,t,i,r){super(e,(i?t:"")+r,0,-r.length),this._openCharacter=t,this._closeCharacter=r,this.closeCharacterRange=null,this.enclosingRange=null}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return this.closeCharacterRange=new q(r.startLineNumber,r.endColumn-this._closeCharacter.length,r.endLineNumber,r.endColumn),this.enclosingRange=new q(r.startLineNumber,r.endColumn-this._openCharacter.length-this._closeCharacter.length,r.endLineNumber,r.endColumn),super.computeCursorState(e,t)}}class DWi{constructor(e,t,i,r,o,s){this.deletedText=e,this.deletedSelectionStart=t,this.deletedSelectionEnd=i,this.insertedText=r,this.insertedSelectionStart=o,this.insertedSelectionEnd=s}}function xZ(n,e){return n===" "?e===5||e===6?6:5:4}function RB(n,e){return WDe(n)&&!WDe(e)?!0:n===5?!1:HDe(n)!==HDe(e)}function HDe(n){return n===6||n===5?"space":n}function WDe(n){return n===4||n===5||n===6}var ee;(function(n){n.editorSimpleInput=new Ft("editorSimpleInput",!1,!0),n.editorTextFocus=new Ft("editorTextFocus",!1,E("editorTextFocus","Whether the editor text has focus (cursor is blinking)")),n.focus=new Ft("editorFocus",!1,E("editorFocus","Whether the editor or an editor widget has focus (e.g. focus is in the find widget)")),n.textInputFocus=new Ft("textInputFocus",!1,E("textInputFocus","Whether an editor or a rich text input has focus (cursor is blinking)")),n.readOnly=new Ft("editorReadonly",!1,E("editorReadonly","Whether the editor is read-only")),n.inDiffEditor=new Ft("inDiffEditor",!1,E("inDiffEditor","Whether the context is a diff editor")),n.isEmbeddedDiffEditor=new Ft("isEmbeddedDiffEditor",!1,E("isEmbeddedDiffEditor","Whether the context is an embedded diff editor")),n.comparingMovedCode=new Ft("comparingMovedCode",!1,E("comparingMovedCode","Whether a moved code block is selected for comparison")),n.accessibleDiffViewerVisible=new Ft("accessibleDiffViewerVisible",!1,E("accessibleDiffViewerVisible","Whether the accessible diff viewer is visible")),n.diffEditorRenderSideBySideInlineBreakpointReached=new Ft("diffEditorRenderSideBySideInlineBreakpointReached",!1,E("diffEditorRenderSideBySideInlineBreakpointReached","Whether the diff editor render side by side inline breakpoint is reached")),n.columnSelection=new Ft("editorColumnSelection",!1,E("editorColumnSelection","Whether `editor.columnSelection` is enabled")),n.writable=n.readOnly.toNegated(),n.hasNonEmptySelection=new Ft("editorHasSelection",!1,E("editorHasSelection","Whether the editor has text selected")),n.hasOnlyEmptySelection=n.hasNonEmptySelection.toNegated(),n.hasMultipleSelections=new Ft("editorHasMultipleSelections",!1,E("editorHasMultipleSelections","Whether the editor has multiple selections")),n.hasSingleSelection=n.hasMultipleSelections.toNegated(),n.tabMovesFocus=new Ft("editorTabMovesFocus",!1,E("editorTabMovesFocus","Whether `Tab` will move focus out of the editor")),n.tabDoesNotMoveFocus=n.tabMovesFocus.toNegated(),n.isInWalkThroughSnippet=new Ft("isInEmbeddedEditor",!1,!0),n.canUndo=new Ft("canUndo",!1,!0),n.canRedo=new Ft("canRedo",!1,!0),n.hoverVisible=new Ft("editorHoverVisible",!1,E("editorHoverVisible","Whether the editor hover is visible")),n.hoverFocused=new Ft("editorHoverFocused",!1,E("editorHoverFocused","Whether the editor hover is focused")),n.stickyScrollFocused=new Ft("stickyScrollFocused",!1,E("stickyScrollFocused","Whether the sticky scroll is focused")),n.stickyScrollVisible=new Ft("stickyScrollVisible",!1,E("stickyScrollVisible","Whether the sticky scroll is visible")),n.standaloneColorPickerVisible=new Ft("standaloneColorPickerVisible",!1,E("standaloneColorPickerVisible","Whether the standalone color picker is visible")),n.standaloneColorPickerFocused=new Ft("standaloneColorPickerFocused",!1,E("standaloneColorPickerFocused","Whether the standalone color picker is focused")),n.inCompositeEditor=new Ft("inCompositeEditor",void 0,E("inCompositeEditor","Whether the editor is part of a larger editor (e.g. notebooks)")),n.notInCompositeEditor=n.inCompositeEditor.toNegated(),n.languageId=new Ft("editorLangId","",E("editorLangId","The language identifier of the editor")),n.hasCompletionItemProvider=new Ft("editorHasCompletionItemProvider",!1,E("editorHasCompletionItemProvider","Whether the editor has a completion item provider")),n.hasCodeActionsProvider=new Ft("editorHasCodeActionsProvider",!1,E("editorHasCodeActionsProvider","Whether the editor has a code actions provider")),n.hasCodeLensProvider=new Ft("editorHasCodeLensProvider",!1,E("editorHasCodeLensProvider","Whether the editor has a code lens provider")),n.hasDefinitionProvider=new Ft("editorHasDefinitionProvider",!1,E("editorHasDefinitionProvider","Whether the editor has a definition provider")),n.hasDeclarationProvider=new Ft("editorHasDeclarationProvider",!1,E("editorHasDeclarationProvider","Whether the editor has a declaration provider")),n.hasImplementationProvider=new Ft("editorHasImplementationProvider",!1,E("editorHasImplementationProvider","Whether the editor has an implementation provider")),n.hasTypeDefinitionProvider=new Ft("editorHasTypeDefinitionProvider",!1,E("editorHasTypeDefinitionProvider","Whether the editor has a type definition provider")),n.hasHoverProvider=new Ft("editorHasHoverProvider",!1,E("editorHasHoverProvider","Whether the editor has a hover provider")),n.hasDocumentHighlightProvider=new Ft("editorHasDocumentHighlightProvider",!1,E("editorHasDocumentHighlightProvider","Whether the editor has a document highlight provider")),n.hasDocumentSymbolProvider=new Ft("editorHasDocumentSymbolProvider",!1,E("editorHasDocumentSymbolProvider","Whether the editor has a document symbol provider")),n.hasReferenceProvider=new Ft("editorHasReferenceProvider",!1,E("editorHasReferenceProvider","Whether the editor has a reference provider")),n.hasRenameProvider=new Ft("editorHasRenameProvider",!1,E("editorHasRenameProvider","Whether the editor has a rename provider")),n.hasSignatureHelpProvider=new Ft("editorHasSignatureHelpProvider",!1,E("editorHasSignatureHelpProvider","Whether the editor has a signature help provider")),n.hasInlayHintsProvider=new Ft("editorHasInlayHintsProvider",!1,E("editorHasInlayHintsProvider","Whether the editor has an inline hints provider")),n.hasDocumentFormattingProvider=new Ft("editorHasDocumentFormattingProvider",!1,E("editorHasDocumentFormattingProvider","Whether the editor has a document formatting provider")),n.hasDocumentSelectionFormattingProvider=new Ft("editorHasDocumentSelectionFormattingProvider",!1,E("editorHasDocumentSelectionFormattingProvider","Whether the editor has a document selection formatting provider")),n.hasMultipleDocumentFormattingProvider=new Ft("editorHasMultipleDocumentFormattingProvider",!1,E("editorHasMultipleDocumentFormattingProvider","Whether the editor has multiple document formatting providers")),n.hasMultipleDocumentSelectionFormattingProvider=new Ft("editorHasMultipleDocumentSelectionFormattingProvider",!1,E("editorHasMultipleDocumentSelectionFormattingProvider","Whether the editor has multiple document selection formatting providers"))})(ee||(ee={}));const wr=0;class Ts extends kl{runEditorCommand(e,t,i){const r=t._getViewModel();r&&this.runCoreEditorCommand(r,i||{})}}var ic;(function(n){const e=function(i){if(!Vu(i))return!1;const r=i;return!(!Ku(r.to)||!Xd(r.by)&&!Ku(r.by)||!Xd(r.value)&&!ow(r.value)||!Xd(r.revealCursor)&&!Cje(r.revealCursor))};n.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 * 'to': A mandatory direction value.\n ```\n 'up', 'down'\n ```\n * 'by': Unit to move. Default is computed based on 'to' value.\n ```\n 'line', 'wrappedLine', 'page', 'halfPage', 'editor'\n ```\n * 'value': Number of units to move. Default is '1'.\n * 'revealCursor': If 'true' reveals the cursor if it is outside view port.\n ",constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["up","down"]},by:{type:"string",enum:["line","wrappedLine","page","halfPage","editor"]},value:{type:"number",default:1},revealCursor:{type:"boolean"}}}}]},n.RawDirection={Up:"up",Right:"right",Down:"down",Left:"left"},n.RawUnit={Line:"line",WrappedLine:"wrappedLine",Page:"page",HalfPage:"halfPage",Editor:"editor",Column:"column"};function t(i){let r;switch(i.to){case n.RawDirection.Up:r=1;break;case n.RawDirection.Right:r=2;break;case n.RawDirection.Down:r=3;break;case n.RawDirection.Left:r=4;break;default:return null}let o;switch(i.by){case n.RawUnit.Line:o=1;break;case n.RawUnit.WrappedLine:o=2;break;case n.RawUnit.Page:o=3;break;case n.RawUnit.HalfPage:o=4;break;case n.RawUnit.Editor:o=5;break;case n.RawUnit.Column:o=6;break;default:o=2}const s=Math.floor(i.value||1),a=!!i.revealCursor;return{direction:r,unit:o,value:s,revealCursor:a,select:!!i.select}}n.parse=t})(ic||(ic={}));var qI;(function(n){const e=function(t){if(!Vu(t))return!1;const i=t;return!(!ow(i.lineNumber)&&!Ku(i.lineNumber)||!Xd(i.at)&&!Ku(i.at))};n.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 * 'lineNumber': A mandatory line number value.\n * 'at': Logical position at which line has to be revealed.\n ```\n 'top', 'center', 'bottom'\n ```\n ",constraint:e,schema:{type:"object",required:["lineNumber"],properties:{lineNumber:{type:["number","string"]},at:{type:"string",enum:["top","center","bottom"]}}}}]},n.RawAtArgument={Top:"top",Center:"center",Bottom:"bottom"}})(qI||(qI={}));class Ese{constructor(e){e.addImplementation(1e4,"code-editor",(t,i)=>{const r=t.get(Lr).getFocusedCodeEditor();return r&&r.hasTextFocus()?this._runEditorCommand(t,r,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const r=Lp();return r&&["input","textarea"].indexOf(r.tagName.toLowerCase())>=0?(this.runDOMCommand(r),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const r=t.get(Lr).getActiveCodeEditor();return r?(r.focus(),this._runEditorCommand(t,r,i)):!1})}_runEditorCommand(e,t,i){const r=this.runEditorCommand(e,t,i);return r||!0}}var fl;(function(n){class e extends Ts{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){if(!y.position)return;b.model.pushStackElement(),b.setCursorStates(y.source,3,[Nl.moveTo(b,b.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)])&&y.revealType!==2&&b.revealPrimaryCursor(y.source,!0,!0)}}n.MoveTo=Et(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),n.MoveToSelect=Et(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends Ts{runCoreEditorCommand(b,y){b.model.pushStackElement();const C=this._getColumnSelectResult(b,b.getPrimaryCursorState(),b.getCursorColumnSelectData(),y);C!==null&&(b.setCursorStates(y.source,3,C.viewStates.map(x=>lr.fromViewState(x))),b.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:C.fromLineNumber,fromViewVisualColumn:C.fromVisualColumn,toViewLineNumber:C.toLineNumber,toViewVisualColumn:C.toVisualColumn}),C.reversed?b.revealTopMostCursor(y.source):b.revealBottomMostCursor(y.source))}}n.ColumnSelect=Et(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(v,b,y,C){if(typeof C.position>"u"||typeof C.viewPosition>"u"||typeof C.mouseColumn>"u")return null;const x=v.model.validatePosition(C.position),k=v.coordinatesConverter.validateViewPosition(new Ce(C.viewPosition.lineNumber,C.viewPosition.column),x),I=C.doColumnSelect?y.fromViewLineNumber:k.lineNumber,L=C.doColumnSelect?y.fromViewVisualColumn:C.mouseColumn-1;return cE.columnSelect(v.cursorConfig,v,I,L,k.lineNumber,C.mouseColumn-1)}}),n.CursorColumnSelectLeft=Et(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(v,b,y,C){return cE.columnSelectLeft(v.cursorConfig,v,y)}}),n.CursorColumnSelectRight=Et(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(v,b,y,C){return cE.columnSelectRight(v.cursorConfig,v,y)}});class i extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,y,C,x){return cE.columnSelectUp(b.cursorConfig,b,C,this._isPaged)}}n.CursorColumnSelectUp=Et(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:3600,linux:{primary:0}}})),n.CursorColumnSelectPageUp=Et(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:3595,linux:{primary:0}}}));class r extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,y,C,x){return cE.columnSelectDown(b.cursorConfig,b,C,this._isPaged)}}n.CursorColumnSelectDown=Et(new r({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:3602,linux:{primary:0}}})),n.CursorColumnSelectPageDown=Et(new r({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends Ts{constructor(){super({id:"cursorMove",precondition:void 0,description:ZV.description})}runCoreEditorCommand(b,y){const C=ZV.parse(y);C&&this._runCursorMove(b,y.source,C)}_runCursorMove(b,y,C){b.model.pushStackElement(),b.setCursorStates(y,3,o._move(b,b.getCursorStates(),C)),b.revealPrimaryCursor(y,!0)}static _move(b,y,C){const x=C.select,k=C.value;switch(C.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return Nl.simpleMove(b,y,C.direction,x,k,C.unit);case 11:case 13:case 12:case 14:return Nl.viewportMove(b,y,C.direction,x,k);default:return null}}}n.CursorMoveImpl=o,n.CursorMove=Et(new o);class s extends Ts{constructor(b){super(b),this._staticArgs=b.args}runCoreEditorCommand(b,y){let C=this._staticArgs;this._staticArgs.value===-1&&(C={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:y.pageSize||b.cursorConfig.pageSize}),b.model.pushStackElement(),b.setCursorStates(y.source,3,Nl.simpleMove(b,b.getCursorStates(),C.direction,C.select,C.value,C.unit)),b.revealPrimaryCursor(y.source,!0)}}n.CursorLeft=Et(new s({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),n.CursorLeftSelect=Et(new s({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:1039}})),n.CursorRight=Et(new s({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),n.CursorRightSelect=Et(new s({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:1041}})),n.CursorUp=Et(new s({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),n.CursorUpSelect=Et(new s({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),n.CursorPageUp=Et(new s({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:11}})),n.CursorPageUpSelect=Et(new s({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:1035}})),n.CursorDown=Et(new s({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),n.CursorDownSelect=Et(new s({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),n.CursorPageDown=Et(new s({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:12}})),n.CursorPageDownSelect=Et(new s({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:1036}})),n.CreateCursor=Et(new class extends Ts{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(v,b){if(!b.position)return;let y;b.wholeLine?y=Nl.line(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition):y=Nl.moveTo(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition);const C=v.getCursorStates();if(C.length>1){const x=y.modelState?y.modelState.position:null,k=y.viewState?y.viewState.position:null;for(let I=0,L=C.length;I<L;I++){const D=C[I];if(!(x&&!D.modelState.selection.containsPosition(x))&&!(k&&!D.viewState.selection.containsPosition(k))){C.splice(I,1),v.model.pushStackElement(),v.setCursorStates(b.source,3,C);return}}}C.push(y),v.model.pushStackElement(),v.setCursorStates(b.source,3,C)}}),n.LastCursorMoveToSelect=Et(new class extends Ts{constructor(){super({id:"_lastCursorMoveToSelect",precondition:void 0})}runCoreEditorCommand(v,b){if(!b.position)return;const y=v.getLastAddedCursorIndex(),C=v.getCursorStates(),x=C.slice(0);x[y]=Nl.moveTo(v,C[y],!0,b.position,b.viewPosition),v.model.pushStackElement(),v.setCursorStates(b.source,3,x)}});class a extends Ts{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,Nl.moveToBeginningOfLine(b,b.getCursorStates(),this._inSelectionMode)),b.revealPrimaryCursor(y.source,!0)}}n.CursorHome=Et(new a({inSelectionMode:!1,id:"cursorHome",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:14,mac:{primary:14,secondary:[2063]}}})),n.CursorHomeSelect=Et(new a({inSelectionMode:!0,id:"cursorHomeSelect",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:1038,mac:{primary:1038,secondary:[3087]}}}));class l extends Ts{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,this._exec(b.getCursorStates())),b.revealPrimaryCursor(y.source,!0)}_exec(b){const y=[];for(let C=0,x=b.length;C<x;C++){const k=b[C],I=k.modelState.position.lineNumber;y[C]=lr.fromModelState(k.modelState.move(this._inSelectionMode,I,1,0))}return y}}n.CursorLineStart=Et(new l({inSelectionMode:!1,id:"cursorLineStart",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:0,mac:{primary:287}}})),n.CursorLineStartSelect=Et(new l({inSelectionMode:!0,id:"cursorLineStartSelect",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:0,mac:{primary:1311}}}));class c extends Ts{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,Nl.moveToEndOfLine(b,b.getCursorStates(),this._inSelectionMode,y.sticky||!1)),b.revealPrimaryCursor(y.source,!0)}}n.CursorEnd=Et(new c({inSelectionMode:!1,id:"cursorEnd",precondition:void 0,kbOpts:{args:{sticky:!1},weight:wr,kbExpr:ee.textInputFocus,primary:13,mac:{primary:13,secondary:[2065]}},description:{description:"Go to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:E("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}})),n.CursorEndSelect=Et(new c({inSelectionMode:!0,id:"cursorEndSelect",precondition:void 0,kbOpts:{args:{sticky:!1},weight:wr,kbExpr:ee.textInputFocus,primary:1037,mac:{primary:1037,secondary:[3089]}},description:{description:"Select to End",args:[{name:"args",schema:{type:"object",properties:{sticky:{description:E("stickydesc","Stick to the end even when going to longer lines"),type:"boolean",default:!1}}}}]}}));class u extends Ts{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,this._exec(b,b.getCursorStates())),b.revealPrimaryCursor(y.source,!0)}_exec(b,y){const C=[];for(let x=0,k=y.length;x<k;x++){const I=y[x],L=I.modelState.position.lineNumber,D=b.model.getLineMaxColumn(L);C[x]=lr.fromModelState(I.modelState.move(this._inSelectionMode,L,D,0))}return C}}n.CursorLineEnd=Et(new u({inSelectionMode:!1,id:"cursorLineEnd",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:0,mac:{primary:291}}})),n.CursorLineEndSelect=Et(new u({inSelectionMode:!0,id:"cursorLineEndSelect",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:0,mac:{primary:1315}}}));class d extends Ts{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,Nl.moveToBeginningOfBuffer(b,b.getCursorStates(),this._inSelectionMode)),b.revealPrimaryCursor(y.source,!0)}}n.CursorTop=Et(new d({inSelectionMode:!1,id:"cursorTop",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:2062,mac:{primary:2064}}})),n.CursorTopSelect=Et(new d({inSelectionMode:!0,id:"cursorTopSelect",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:3086,mac:{primary:3088}}}));class h extends Ts{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){b.model.pushStackElement(),b.setCursorStates(y.source,3,Nl.moveToEndOfBuffer(b,b.getCursorStates(),this._inSelectionMode)),b.revealPrimaryCursor(y.source,!0)}}n.CursorBottom=Et(new h({inSelectionMode:!1,id:"cursorBottom",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:2061,mac:{primary:2066}}})),n.CursorBottomSelect=Et(new h({inSelectionMode:!0,id:"cursorBottomSelect",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:3085,mac:{primary:3090}}}));class g extends Ts{constructor(){super({id:"editorScroll",precondition:void 0,description:ic.description})}determineScrollMethod(b){const y=[6],C=[1,2,3,4,5,6],x=[4,2],k=[1,3];return y.includes(b.unit)&&x.includes(b.direction)?this._runHorizontalEditorScroll.bind(this):C.includes(b.unit)&&k.includes(b.direction)?this._runVerticalEditorScroll.bind(this):null}runCoreEditorCommand(b,y){const C=ic.parse(y);if(!C)return;const x=this.determineScrollMethod(C);x&&x(b,y.source,C)}_runVerticalEditorScroll(b,y,C){const x=this._computeDesiredScrollTop(b,C);if(C.revealCursor){const k=b.getCompletelyVisibleViewRangeAtScrollTop(x);b.setCursorStates(y,3,[Nl.findPositionInViewportIfOutside(b,b.getPrimaryCursorState(),k,C.select)])}b.viewLayout.setScrollPosition({scrollTop:x},0)}_computeDesiredScrollTop(b,y){if(y.unit===1){const k=b.viewLayout.getFutureViewport(),I=b.getCompletelyVisibleViewRangeAtScrollTop(k.top),L=b.coordinatesConverter.convertViewRangeToModelRange(I);let D;y.direction===1?D=Math.max(1,L.startLineNumber-y.value):D=Math.min(b.model.getLineCount(),L.startLineNumber+y.value);const R=b.coordinatesConverter.convertModelPositionToViewPosition(new Ce(D,1));return b.viewLayout.getVerticalOffsetForLineNumber(R.lineNumber)}if(y.unit===5){let k=0;return y.direction===3&&(k=b.model.getLineCount()-b.cursorConfig.pageSize),b.viewLayout.getVerticalOffsetForLineNumber(k)}let C;y.unit===3?C=b.cursorConfig.pageSize*y.value:y.unit===4?C=Math.round(b.cursorConfig.pageSize/2)*y.value:C=y.value;const x=(y.direction===1?-1:1)*C;return b.viewLayout.getCurrentScrollTop()+x*b.cursorConfig.lineHeight}_runHorizontalEditorScroll(b,y,C){const x=this._computeDesiredScrollLeft(b,C);b.viewLayout.setScrollPosition({scrollLeft:x},0)}_computeDesiredScrollLeft(b,y){const C=(y.direction===4?-1:1)*y.value;return b.viewLayout.getCurrentScrollLeft()+C*b.cursorConfig.typicalHalfwidthCharacterWidth}}n.EditorScrollImpl=g,n.EditorScroll=Et(new g),n.ScrollLineUp=Et(new class extends Ts{constructor(){super({id:"scrollLineUp",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:2064,mac:{primary:267}}})}runCoreEditorCommand(v,b){n.EditorScroll.runCoreEditorCommand(v,{to:ic.RawDirection.Up,by:ic.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollPageUp=Et(new class extends Ts{constructor(){super({id:"scrollPageUp",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:2059,win:{primary:523},linux:{primary:523}}})}runCoreEditorCommand(v,b){n.EditorScroll.runCoreEditorCommand(v,{to:ic.RawDirection.Up,by:ic.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollEditorTop=Et(new class extends Ts{constructor(){super({id:"scrollEditorTop",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus}})}runCoreEditorCommand(v,b){n.EditorScroll.runCoreEditorCommand(v,{to:ic.RawDirection.Up,by:ic.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollLineDown=Et(new class extends Ts{constructor(){super({id:"scrollLineDown",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:2066,mac:{primary:268}}})}runCoreEditorCommand(v,b){n.EditorScroll.runCoreEditorCommand(v,{to:ic.RawDirection.Down,by:ic.RawUnit.WrappedLine,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollPageDown=Et(new class extends Ts{constructor(){super({id:"scrollPageDown",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:2060,win:{primary:524},linux:{primary:524}}})}runCoreEditorCommand(v,b){n.EditorScroll.runCoreEditorCommand(v,{to:ic.RawDirection.Down,by:ic.RawUnit.Page,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollEditorBottom=Et(new class extends Ts{constructor(){super({id:"scrollEditorBottom",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus}})}runCoreEditorCommand(v,b){n.EditorScroll.runCoreEditorCommand(v,{to:ic.RawDirection.Down,by:ic.RawUnit.Editor,value:1,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollLeft=Et(new class extends Ts{constructor(){super({id:"scrollLeft",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus}})}runCoreEditorCommand(v,b){n.EditorScroll.runCoreEditorCommand(v,{to:ic.RawDirection.Left,by:ic.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:b.source})}}),n.ScrollRight=Et(new class extends Ts{constructor(){super({id:"scrollRight",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus}})}runCoreEditorCommand(v,b){n.EditorScroll.runCoreEditorCommand(v,{to:ic.RawDirection.Right,by:ic.RawUnit.Column,value:2,revealCursor:!1,select:!1,source:b.source})}});class p extends Ts{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){y.position&&(b.model.pushStackElement(),b.setCursorStates(y.source,3,[Nl.word(b,b.getPrimaryCursorState(),this._inSelectionMode,y.position)]),y.revealType!==2&&b.revealPrimaryCursor(y.source,!0,!0))}}n.WordSelect=Et(new p({inSelectionMode:!1,id:"_wordSelect",precondition:void 0})),n.WordSelectDrag=Et(new p({inSelectionMode:!0,id:"_wordSelectDrag",precondition:void 0})),n.LastCursorWordSelect=Et(new class extends Ts{constructor(){super({id:"lastCursorWordSelect",precondition:void 0})}runCoreEditorCommand(v,b){if(!b.position)return;const y=v.getLastAddedCursorIndex(),C=v.getCursorStates(),x=C.slice(0),k=C[y];x[y]=Nl.word(v,k,k.modelState.hasSelection(),b.position),v.model.pushStackElement(),v.setCursorStates(b.source,3,x)}});class m extends Ts{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){y.position&&(b.model.pushStackElement(),b.setCursorStates(y.source,3,[Nl.line(b,b.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)]),y.revealType!==2&&b.revealPrimaryCursor(y.source,!1,!0))}}n.LineSelect=Et(new m({inSelectionMode:!1,id:"_lineSelect",precondition:void 0})),n.LineSelectDrag=Et(new m({inSelectionMode:!0,id:"_lineSelectDrag",precondition:void 0}));class _ extends Ts{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){if(!y.position)return;const C=b.getLastAddedCursorIndex(),x=b.getCursorStates(),k=x.slice(0);k[C]=Nl.line(b,x[C],this._inSelectionMode,y.position,y.viewPosition),b.model.pushStackElement(),b.setCursorStates(y.source,3,k)}}n.LastCursorLineSelect=Et(new _({inSelectionMode:!1,id:"lastCursorLineSelect",precondition:void 0})),n.LastCursorLineSelectDrag=Et(new _({inSelectionMode:!0,id:"lastCursorLineSelectDrag",precondition:void 0})),n.CancelSelection=Et(new class extends Ts{constructor(){super({id:"cancelSelection",precondition:ee.hasNonEmptySelection,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(v,b){v.model.pushStackElement(),v.setCursorStates(b.source,3,[Nl.cancelSelection(v,v.getPrimaryCursorState())]),v.revealPrimaryCursor(b.source,!0)}}),n.RemoveSecondaryCursors=Et(new class extends Ts{constructor(){super({id:"removeSecondaryCursors",precondition:ee.hasMultipleSelections,kbOpts:{weight:wr+1,kbExpr:ee.textInputFocus,primary:9,secondary:[1033]}})}runCoreEditorCommand(v,b){v.model.pushStackElement(),v.setCursorStates(b.source,3,[v.getPrimaryCursorState()]),v.revealPrimaryCursor(b.source,!0),fw(E("removedCursor","Removed secondary cursors"))}}),n.RevealLine=Et(new class extends Ts{constructor(){super({id:"revealLine",precondition:void 0,description:qI.description})}runCoreEditorCommand(v,b){const y=b,C=y.lineNumber||0;let x=typeof C=="number"?C+1:parseInt(C)+1;x<1&&(x=1);const k=v.model.getLineCount();x>k&&(x=k);const I=new q(x,1,x,v.model.getLineMaxColumn(x));let L=0;if(y.at)switch(y.at){case qI.RawAtArgument.Top:L=3;break;case qI.RawAtArgument.Center:L=1;break;case qI.RawAtArgument.Bottom:L=4;break}const D=v.coordinatesConverter.convertModelRangeToViewRange(I);v.revealRange(b.source,!1,D,L,0)}}),n.SelectAll=new class extends Ese{constructor(){super(_$i)}runDOMCommand(v){wg&&(v.focus(),v.select()),v.ownerDocument.execCommand("selectAll")}runEditorCommand(v,b,y){const C=b._getViewModel();C&&this.runCoreEditorCommand(C,y)}runCoreEditorCommand(v,b){v.model.pushStackElement(),v.setCursorStates("keyboard",3,[Nl.selectAll(v,v.getPrimaryCursorState())])}},n.SetSelection=Et(new class extends Ts{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(v,b){b.selection&&(v.model.pushStackElement(),v.setCursorStates(b.source,3,[lr.fromModelSelection(b.selection)]))}})})(fl||(fl={}));const AWi=Ke.and(ee.textInputFocus,ee.columnSelection);function kA(n,e){Ld.registerKeybindingRule({id:n,primary:e,when:AWi,weight:wr+1})}kA(fl.CursorColumnSelectLeft.id,1039);kA(fl.CursorColumnSelectRight.id,1041);kA(fl.CursorColumnSelectUp.id,1040);kA(fl.CursorColumnSelectPageUp.id,1035);kA(fl.CursorColumnSelectDown.id,1042);kA(fl.CursorColumnSelectPageDown.id,1036);function zDe(n){return n.register(),n}var PL;(function(n){class e extends kl{runEditorCommand(i,r,o){const s=r._getViewModel();s&&this.runCoreEditingCommand(r,s,o||{})}}n.CoreEditingCommand=e,n.LineBreakInsert=Et(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:ee.writable,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,r){t.pushUndoStop(),t.executeCommands(this.id,ls.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),n.Outdent=Et(new class extends e{constructor(){super({id:"outdent",precondition:ee.writable,kbOpts:{weight:wr,kbExpr:Ke.and(ee.editorTextFocus,ee.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,r){t.pushUndoStop(),t.executeCommands(this.id,ls.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.Tab=Et(new class extends e{constructor(){super({id:"tab",precondition:ee.writable,kbOpts:{weight:wr,kbExpr:Ke.and(ee.editorTextFocus,ee.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,r){t.pushUndoStop(),t.executeCommands(this.id,ls.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.DeleteLeft=Et(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,r){const[o,s]=Fx.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());o&&t.pushUndoStop(),t.executeCommands(this.id,s),i.setPrevEditOperationType(2)}}),n.DeleteRight=Et(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:wr,kbExpr:ee.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,r){const[o,s]=Fx.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,s),i.setPrevEditOperationType(3)}}),n.Undo=new class extends Ese{constructor(){super(RUe)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,r){if(!(!i.hasModel()||i.getOption(90)===!0))return i.getModel().undo()}},n.Redo=new class extends Ese{constructor(){super(NUe)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,r){if(!(!i.hasModel()||i.getOption(90)===!0))return i.getModel().redo()}}})(PL||(PL={}));class jDe extends zU{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(Lr).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function Pk(n,e){zDe(new jDe("default:"+n,n)),zDe(new jDe(n,n,e))}Pk("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});Pk("replacePreviousChar");Pk("compositionType");Pk("compositionStart");Pk("compositionEnd");Pk("paste");Pk("cut");class RWi{constructor(e,t,i,r){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=r}paste(e,t,i,r){this.commandDelegate.paste(e,t,i,r)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,r){this.commandDelegate.compositionType(e,t,i,r)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){fl.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column<t?new Ce(e.lineNumber,t):e}_hasMulticursorModifier(e){switch(this.configuration.options.get(77)){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(77)){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,i=fu&&t.get(106),r=t.get(22);e.middleButton&&!i?this._columnSelect(e.position,e.mouseColumn,e.inSelectionMode):e.startedOnLineNumbers?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelect(e.position,e.revealType):this._createCursor(e.position,!0):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount>=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):r?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){fl.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){fl.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),fl.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),fl.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){fl.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){fl.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){fl.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){fl.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){fl.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){fl.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){fl.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){fl.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){fl.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 cq{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){var t;(t=this.onKeyDown)===null||t===void 0||t.call(this,e)}emitKeyUp(e){var t;(t=this.onKeyUp)===null||t===void 0||t.call(this,e)}emitContextMenu(e){var t;(t=this.onContextMenu)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;(t=this.onMouseMove)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;(t=this.onMouseLeave)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;(t=this.onMouseDown)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;(t=this.onMouseUp)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;(t=this.onMouseDrag)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;(t=this.onMouseDrop)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;(e=this.onMouseDropCanceled)===null||e===void 0||e.call(this)}emitMouseWheel(e){var t;(t=this.onMouseWheel)===null||t===void 0||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return cq.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i=Object.assign({},e);return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),(i.type===5||i.type===8)&&(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new Ce(e.afterLineNumber,1)).lineNumber}}}class zqe{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 ya("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const i=this.getStartLineNumber(),r=this.getEndLineNumber();if(t<i){const l=t-e+1;return this._rendLineNumberStart-=l,null}if(e>r)return null;let o=0,s=0;for(let l=i;l<=r;l++){const c=l-this._rendLineNumberStart;e<=l&&l<=t&&(s===0?(o=c,s=1):s++)}if(e<i){let l=0;t<i?l=t-e+1:l=i-e,this._rendLineNumberStart-=l}return this._lines.splice(o,s)}onLinesChanged(e,t){const i=e+t-1;if(this.getCount()===0)return!1;const r=this.getStartLineNumber(),o=this.getEndLineNumber();let s=!1;for(let a=e;a<=i;a++)a>=r&&a<=o&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),s=!0);return s}onLinesInserted(e,t){if(this.getCount()===0)return null;const i=t-e+1,r=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=r)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const s=[];for(let d=0;d<i;d++)s[d]=this._createLine();const a=e-this._rendLineNumberStart,l=this._lines.slice(0,a),c=this._lines.slice(a,this._lines.length-i),u=this._lines.slice(this._lines.length-i,this._lines.length);return this._lines=l.concat(s).concat(c),u}onTokensChanged(e){if(this.getCount()===0)return!1;const t=this.getStartLineNumber(),i=this.getEndLineNumber();let r=!1;for(let o=0,s=e.length;o<s;o++){const a=e[o];if(a.toLineNumber<t||a.fromLineNumber>i)continue;const l=Math.max(t,a.fromLineNumber),c=Math.min(i,a.toLineNumber);for(let u=l;u<=c;u++){const d=u-this._rendLineNumberStart;this._lines[d].onTokensChanged(),r=!0}}return r}}class jqe{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new zqe(()=>this._host.createVisibleLine())}_createDomNode(){const e=Or(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(143)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,r=t.length;i<r;i++){const o=t[i].getDomNode();o&&this.domNode.domNode.removeChild(o)}return!0}onLinesInserted(e){const t=this._linesCollection.onLinesInserted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,r=t.length;i<r;i++){const o=t[i].getDomNode();o&&this.domNode.domNode.removeChild(o)}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(),i=new Ey(this.domNode.domNode,this._host,e),r={rendLineNumberStart:t.rendLineNumberStart,lines:t.lines,linesLength:t.lines.length},o=i.render(r,e.startLineNumber,e.endLineNumber,e.relativeVerticalOffset);this._linesCollection._set(o.rendLineNumberStart,o.lines)}}class Ey{constructor(e,t,i){this.domNode=e,this.host=t,this.viewportData=i}render(e,t,i,r){const o={rendLineNumberStart:e.rendLineNumberStart,lines:e.lines.slice(0),linesLength:e.linesLength};if(o.rendLineNumberStart+o.linesLength-1<t||i<o.rendLineNumberStart){o.rendLineNumberStart=t,o.linesLength=i-t+1,o.lines=[];for(let s=t;s<=i;s++)o.lines[s-t]=this.host.createVisibleLine();return this._finishRendering(o,!0,r),o}if(this._renderUntouchedLines(o,Math.max(t-o.rendLineNumberStart,0),Math.min(i-o.rendLineNumberStart,o.linesLength-1),r,t),o.rendLineNumberStart>t){const s=t,a=Math.min(i,o.rendLineNumberStart-1);s<=a&&(this._insertLinesBefore(o,s,a,r,t),o.linesLength+=a-s+1)}else if(o.rendLineNumberStart<t){const s=Math.min(o.linesLength,t-o.rendLineNumberStart);s>0&&(this._removeLinesBefore(o,s),o.linesLength-=s)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1<i){const s=o.rendLineNumberStart+o.linesLength,a=i;s<=a&&(this._insertLinesAfter(o,s,a,r,t),o.linesLength+=a-s+1)}else if(o.rendLineNumberStart+o.linesLength-1>i){const s=Math.max(0,i-o.rendLineNumberStart+1),l=o.linesLength-1-s+1;l>0&&(this._removeLinesAfter(o,l),o.linesLength-=l)}return this._finishRendering(o,!1,r),o}_renderUntouchedLines(e,t,i,r,o){const s=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=i;l++){const c=s+l;a[l].layoutLine(c,r[c-o])}}_insertLinesBefore(e,t,i,r,o){const s=[];let a=0;for(let l=t;l<=i;l++)s[a++]=this.host.createVisibleLine();e.lines=s.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i<t;i++){const r=e.lines[i].getDomNode();r&&this.domNode.removeChild(r)}e.lines.splice(0,t)}_insertLinesAfter(e,t,i,r,o){const s=[];let a=0;for(let l=t;l<=i;l++)s[a++]=this.host.createVisibleLine();e.lines=e.lines.concat(s)}_removeLinesAfter(e,t){const i=e.linesLength-t;for(let r=0;r<t;r++){const o=e.lines[i+r].getDomNode();o&&this.domNode.removeChild(o)}e.lines.splice(i,t)}_finishRenderingNewLines(e,t,i,r){Ey._ttPolicy&&(i=Ey._ttPolicy.createHTML(i));const o=this.domNode.lastChild;t||!o?this.domNode.innerHTML=i:o.insertAdjacentHTML("afterend",i);let s=this.domNode.lastChild;for(let a=e.linesLength-1;a>=0;a--){const l=e.lines[a];r[a]&&(l.setDomNode(s),s=s.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const r=document.createElement("div");Ey._ttPolicy&&(t=Ey._ttPolicy.createHTML(t)),r.innerHTML=t;for(let o=0;o<e.linesLength;o++){const s=e.lines[o];if(i[o]){const a=r.firstChild,l=s.getDomNode();l.parentNode.replaceChild(a,l),s.setDomNode(a)}}}_finishRendering(e,t,i){const r=Ey._sb,o=e.linesLength,s=e.lines,a=e.rendLineNumberStart,l=[];{r.reset();let c=!1;for(let u=0;u<o;u++){const d=s[u];l[u]=!1,!(d.getDomNode()||!d.renderLine(u+a,i[u],this.viewportData,r))&&(l[u]=!0,c=!0)}c&&this._finishRenderingNewLines(e,t,r.build(),l)}{r.reset();let c=!1;const u=[];for(let d=0;d<o;d++){const h=s[d];u[d]=!1,!(l[d]||!h.renderLine(d+a,i[d],this.viewportData,r))&&(u[d]=!0,c=!0)}c&&this._finishRenderingInvalidLines(e,r.build(),u)}}}Ey._ttPolicy=R0("editorViewLayer",{createHTML:n=>n});Ey._sb=new SA(1e5);class Uqe extends ph{constructor(e){super(e),this._visibleLines=new jqe(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(50);mc(this.domNode,i),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 NWi(this._context.configuration,this._dynamicOverlays)}addDynamicOverlay(e){this._dynamicOverlays.push(e)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e);const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let s=t;s<=i;s++)this._visibleLines.getVisibleLine(s).onConfigurationChanged(e);const o=this._context.configuration.options.get(50);return mc(this.domNode,o),!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(i=>i.shouldRender());for(let i=0,r=t.length;i<r;i++){const o=t[i];o.prepareRender(e),o.onDidRender()}}render(e){this._viewOverlaysRender(e),this.domNode.toggleClassName("focused",this._isFocused)}_viewOverlaysRender(e){this._visibleLines.renderLines(e.viewportData)}}class NWi{constructor(e,t){this._configuration=e,this._lineHeight=this._configuration.options.get(66),this._dynamicOverlays=t,this._domNode=null,this._renderedContent=null}getDomNode(){return this._domNode?this._domNode.domNode:null}setDomNode(e){this._domNode=Or(e)}onContentChanged(){}onTokensChanged(){}onConfigurationChanged(e){this._lineHeight=this._configuration.options.get(66)}renderLine(e,t,i,r){let o="";for(let s=0,a=this._dynamicOverlays.length;s<a;s++){const l=this._dynamicOverlays[s];o+=l.render(i.startLineNumber,e)}return this._renderedContent===o?!1:(this._renderedContent=o,r.appendString('<div style="position:absolute;top:'),r.appendString(String(t)),r.appendString("px;width:100%;height:"),r.appendString(String(this._lineHeight)),r.appendString('px;">'),r.appendString(o),r.appendString("</div>"),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class OWi extends Uqe{constructor(e){super(e);const i=this._context.configuration.options.get(143);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const i=this._context.configuration.options.get(143);return this._contentWidth=i.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 PWi extends Uqe{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),mc(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;mc(this.domNode,t.get(50));const i=t.get(143);return this._contentLeft=i.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 MWi extends ph{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=Or(document.createElement("div")),ub.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=Or(document.createElement("div")),ub.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){const e=Object.keys(this._widgets);for(const t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){const t=new FWi(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,i,r,o){this._widgets[e.getId()].setPosition(t,i,r,o),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const i=this._widgets[t];delete this._widgets[t];const r=i.domNode.domNode;r.parentNode.removeChild(r),r.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return this._widgets.hasOwnProperty(e)?this._widgets[e].suppressMouseDown:!1}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}}class FWi{constructor(e,t,i){this._primaryAnchor=new WR(null,null),this._secondaryAnchor=new WR(null,null),this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=Or(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const r=this._context.configuration.options,o=r.get(143);this._fixedOverflowWidgets=r.get(42),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=r.get(66),this._affinity=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(66),e.hasChanged(143)){const i=t.get(143);this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,i){this._affinity=e,this._primaryAnchor=r(t,this._context.viewModel,this._affinity),this._secondaryAnchor=r(i,this._context.viewModel,this._affinity);function r(o,s,a){if(!o)return new WR(null,null);const l=s.model.validatePosition(o);if(s.coordinatesConverter.modelPositionIsVisible(l)){const c=s.coordinatesConverter.convertModelPositionToViewPosition(l,a??void 0);return new WR(o,c)}return new WR(o,null)}}_getMaxWidth(){const e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?(t==null?void 0:t.innerWidth)||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,i,r){this._setPosition(r,e,t),this._preference=i,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,r){const o=e.top,s=o,a=e.top+e.height,l=r.viewportHeight-a,c=o-i,u=s>=i,d=a,h=l>=i;let g=e.left;return g+t>r.scrollLeft+r.viewportWidth&&(g=r.scrollLeft+r.viewportWidth-t),g<r.scrollLeft&&(g=r.scrollLeft),{fitsAbove:u,aboveTop:c,fitsBelow:h,belowTop:d,left:g}}_layoutHorizontalSegmentInPage(e,t,i,r){var o;const l=Math.max(15,t.left-r),c=Math.min(t.left+t.width+r,e.width-15),d=this._viewDomNode.domNode.ownerDocument.defaultView;let h=t.left+i-((o=d==null?void 0:d.scrollX)!==null&&o!==void 0?o:0);if(h+r>c){const g=h-(c-r);h-=g,i-=g}if(h<l){const g=h-l;h-=g,i-=g}return[i,h]}_layoutBoxInPage(e,t,i,r){var o,s;const a=e.top-i,l=e.top+e.height,c=Oa(this._viewDomNode.domNode),u=this._viewDomNode.domNode.ownerDocument,d=u.defaultView,h=c.top+a-((o=d==null?void 0:d.scrollY)!==null&&o!==void 0?o:0),g=c.top+l-((s=d==null?void 0:d.scrollY)!==null&&s!==void 0?s:0),p=CA(u.body),[m,_]=this._layoutHorizontalSegmentInPage(p,c,e.left-r.scrollLeft+this._contentLeft,t),v=22,b=22,y=h>=v,C=g+i<=p.height-b;return this._fixedOverflowWidgets?{fitsAbove:y,aboveTop:Math.max(h,v),fitsBelow:C,belowTop:g,left:_}:{fitsAbove:y,aboveTop:a,fitsBelow:C,belowTop:l,left:m}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new zR(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,i;const r=a(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),o=((t=this._secondaryAnchor.viewPosition)===null||t===void 0?void 0:t.lineNumber)===((i=this._primaryAnchor.viewPosition)===null||i===void 0?void 0:i.lineNumber)?this._secondaryAnchor.viewPosition:null,s=a(o,this._affinity,this._lineHeight);return{primary:r,secondary:s};function a(l,c,u){if(!l)return null;const d=e.visibleRangeForPosition(l);if(!d)return null;const h=l.column===1&&c===3?0:d.left,g=e.getVerticalOffsetForLineNumber(l.lineNumber)-e.scrollTop;return new UDe(g,h,u)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const r=this._context.configuration.options.get(50);let o=t.left;return o<e.left?o=Math.max(o,e.left-i+r.typicalFullwidthCharacterWidth):o=Math.min(o,e.left+i-r.typicalFullwidthCharacterWidth),new UDe(e.top,o,e.height)}_prepareRenderWidget(e){if(!this._preference||this._preference.length===0)return null;const{primary:t,secondary:i}=this._getAnchorsCoordinates(e);if(!t)return null;if(this._cachedDomNodeOffsetWidth===-1||this._cachedDomNodeOffsetHeight===-1){let s=null;if(typeof this._actual.beforeRender=="function"&&(s=kZ(this._actual.beforeRender,this._actual)),s)this._cachedDomNodeOffsetWidth=s.width,this._cachedDomNodeOffsetHeight=s.height;else{const l=this.domNode.domNode.getBoundingClientRect();this._cachedDomNodeOffsetWidth=Math.round(l.width),this._cachedDomNodeOffsetHeight=Math.round(l.height)}}const r=this._reduceAnchorCoordinates(t,i,this._cachedDomNodeOffsetWidth);let o;this.allowEditorOverflow?o=this._layoutBoxInPage(r,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e):o=this._layoutBoxInViewport(r,this._cachedDomNodeOffsetWidth,this._cachedDomNodeOffsetHeight,e);for(let s=1;s<=2;s++)for(const a of this._preference)if(a===1){if(!o)return null;if(s===2||o.fitsAbove)return{coordinate:new zR(o.aboveTop,o.left),position:1}}else if(a===2){if(!o)return null;if(s===2||o.fitsBelow)return{coordinate:new zR(o.belowTop,o.left),position:2}}else return this.allowEditorOverflow?{coordinate:this._prepareRenderWidgetAtExactPositionOverflowing(new zR(r.top,r.left)),position:0}:{coordinate:new zR(r.top,r.left),position:0};return null}onBeforeRender(e){!this._primaryAnchor.viewPosition||!this._preference||this._primaryAnchor.viewPosition.lineNumber<e.startLineNumber||this._primaryAnchor.viewPosition.lineNumber>e.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&kZ(this._actual.afterRender,this._actual,null);return}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),typeof this._actual.afterRender=="function"&&kZ(this._actual.afterRender,this._actual,this._renderData.position)}}class WR{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class zR{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class UDe{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function kZ(n,e,...t){try{return n.call(e,...t)}catch{return null}}class qqe extends Ok{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(143);this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new ln(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(r=>r.positionLineNumber);t.sort((r,o)=>r-o),Qs(this._cursorLineNumbers,t)||(this._cursorLineNumbers=t,e=!0);const i=this._selections.every(r=>r.isEmpty());return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=i.contentLeft,this._contentWidth=i.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):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=this._renderOne(e),i=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,o=this._cursorLineNumbers.length;let s=0;const a=[];for(let l=i;l<=r;l++){const c=l-i;for(;s<o&&this._cursorLineNumbers[s]<l;)s++;s<o&&this._cursorLineNumbers[s]===l?a[c]=t:a[c]=""}this._renderData=a}render(e,t){if(!this._renderData)return"";const i=t-e;return i>=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class BWi extends qqe{_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 $Wi extends qqe{_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()}}rm((n,e)=>{const t=n.getColor(Aqe);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||n.defines(VDe)){const i=n.getColor(VDe);i&&(e.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${i}; }`),m_(n.type)&&(e.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}});class VWi extends Ok{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).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(66),this._typicalHalfwidthCharacterWidth=t.get(50).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 i=[],r=0;for(let l=0,c=t.length;l<c;l++){const u=t[l];u.options.className&&(i[r++]=u)}i=i.sort((l,c)=>{if(l.options.zIndex<c.options.zIndex)return-1;if(l.options.zIndex>c.options.zIndex)return 1;const u=l.options.className,d=c.options.className;return u<d?-1:u>d?1:q.compareRangesUsingStarts(l.range,c.range)});const o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,a=[];for(let l=o;l<=s;l++){const c=l-o;a[c]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const r=String(this._lineHeight),o=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber;for(let a=0,l=t.length;a<l;a++){const c=t[a];if(!c.options.isWholeLine)continue;const u='<div class="cdr '+c.options.className+'" style="left:0;width:100%;height:'+r+'px;"></div>',d=Math.max(c.range.startLineNumber,o),h=Math.min(c.range.endLineNumber,s);for(let g=d;g<=h;g++){const p=g-o;i[p]+=u}}}_renderNormalDecorations(e,t,i){var r;const o=String(this._lineHeight),s=e.visibleRange.startLineNumber;let a=null,l=!1,c=null,u=!1;for(let d=0,h=t.length;d<h;d++){const g=t[d];if(g.options.isWholeLine)continue;const p=g.options.className,m=!!g.options.showIfCollapsed;let _=g.range;if(m&&_.endColumn===1&&_.endLineNumber!==_.startLineNumber&&(_=new q(_.startLineNumber,_.startColumn,_.endLineNumber-1,this._context.viewModel.getLineMaxColumn(_.endLineNumber-1))),a===p&&l===m&&q.areIntersectingOrTouching(c,_)){c=q.plusRange(c,_);continue}a!==null&&this._renderNormalDecoration(e,c,a,u,l,o,s,i),a=p,l=m,c=_,u=(r=g.options.shouldFillLineOnLineBreak)!==null&&r!==void 0?r:!1}a!==null&&this._renderNormalDecoration(e,c,a,u,l,o,s,i)}_renderNormalDecoration(e,t,i,r,o,s,a,l){const c=e.linesVisibleRangesForRange(t,i==="findMatch");if(c)for(let u=0,d=c.length;u<d;u++){const h=c[u];if(h.outsideRenderedLine)continue;const g=h.lineNumber-a;if(o&&h.ranges.length===1){const p=h.ranges[0];if(p.width<this._typicalHalfwidthCharacterWidth){const m=Math.round(p.left+p.width/2),_=Math.max(0,Math.round(m-this._typicalHalfwidthCharacterWidth/2));h.ranges[0]=new oq(_,this._typicalHalfwidthCharacterWidth)}}for(let p=0,m=h.ranges.length;p<m;p++){const _=r&&h.continuesOnNextLine&&m===1,v=h.ranges[p],b='<div class="cdr '+i+'" style="left:'+String(v.left)+(_?"px;width:100%;height:":"px;width:"+String(v.width)+"px;height:")+s+'px;"></div>';l[g]+=b}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class HWi extends ph{constructor(e,t,i,r){super(e);const o=this._context.configuration.options,s=o.get(102),a=o.get(74),l=o.get(40),c=o.get(105),u={listenOnDomNode:i.domNode,className:"editor-scrollable "+wse(e.theme.type),useShadows:!1,lazyRender:!0,vertical:s.vertical,horizontal:s.horizontal,verticalHasArrows:s.verticalHasArrows,horizontalHasArrows:s.horizontalHasArrows,verticalScrollbarSize:s.verticalScrollbarSize,verticalSliderSize:s.verticalSliderSize,horizontalScrollbarSize:s.horizontalScrollbarSize,horizontalSliderSize:s.horizontalSliderSize,handleMouseWheel:s.handleMouseWheel,alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel,arrowSize:s.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:s.scrollByPage};this.scrollbar=this._register(new f_e(t.domNode,u,this._context.viewLayout.getScrollable())),ub.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=Or(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const d=(h,g,p)=>{const m={};if(g){const _=h.scrollTop;_&&(m.scrollTop=this._context.viewLayout.getCurrentScrollTop()+_,h.scrollTop=0)}if(p){const _=h.scrollLeft;_&&(m.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+_,h.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(m,1)};this._register(We(i.domNode,"scroll",h=>d(i.domNode,!0,!0))),this._register(We(t.domNode,"scroll",h=>d(t.domNode,!0,!1))),this._register(We(r.domNode,"scroll",h=>d(r.domNode,!0,!1))),this._register(We(this.scrollbarDomNode.domNode,"scroll",h=>d(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(143);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(72).side==="right"?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}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(102)||e.hasChanged(74)||e.hasChanged(40)){const t=this._context.configuration.options,i=t.get(102),r=t.get(74),o=t.get(40),s=t.get(105),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:r,fastScrollSensitivity:o,scrollPredominantAxis:s};this.scrollbar.updateOptions(a)}return e.hasChanged(143)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+wse(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class Kqe extends Ae{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function uq(n,e){let t=0,i=0;const r=n.length;for(;i<r;){const o=n.charCodeAt(i);if(o===32)t++;else if(o===9)t=t-t%e+e;else break;i++}return i===r?-1:t}var JE;(function(n){n[n.Disabled=0]="Disabled",n[n.EnabledForActive=1]="EnabledForActive",n[n.Enabled=2]="Enabled"})(JE||(JE={}));class RE{constructor(e,t,i,r,o,s){if(this.visibleColumn=e,this.column=t,this.className=i,this.horizontalLine=r,this.forWrappedLinesAfterColumn=o,this.forWrappedLinesBeforeOrAtColumn=s,e!==-1==(t!==-1))throw new Error}}class BO{constructor(e,t){this.top=e,this.endColumn=t}}class WWi extends Kqe{constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t}getLanguageConfiguration(e){return this.languageConfigurationService.getLanguageConfiguration(e)}_computeIndentLevel(e){return uq(this.textModel.getLineContent(e+1),this.textModel.getOptions().tabSize)}getActiveIndentGuide(e,t,i){this.assertNotDisposed();const r=this.textModel.getLineCount();if(e<1||e>r)throw new ya("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=!!(o&&o.offSide);let a=-2,l=-1,c=-2,u=-1;const d=I=>{if(a!==-1&&(a===-2||a>I-1)){a=-1,l=-1;for(let L=I-2;L>=0;L--){const D=this._computeIndentLevel(L);if(D>=0){a=L,l=D;break}}}if(c===-2){c=-1,u=-1;for(let L=I;L<r;L++){const D=this._computeIndentLevel(L);if(D>=0){c=L,u=D;break}}}};let h=-2,g=-1,p=-2,m=-1;const _=I=>{if(h===-2){h=-1,g=-1;for(let L=I-2;L>=0;L--){const D=this._computeIndentLevel(L);if(D>=0){h=L,g=D;break}}}if(p!==-1&&(p===-2||p<I-1)){p=-1,m=-1;for(let L=I;L<r;L++){const D=this._computeIndentLevel(L);if(D>=0){p=L,m=D;break}}}};let v=0,b=!0,y=0,C=!0,x=0,k=0;for(let I=0;b||C;I++){const L=e-I,D=e+I;I>1&&(L<1||L<t)&&(b=!1),I>1&&(D>r||D>i)&&(C=!1),I>5e4&&(b=!1,C=!1);let R=-1;if(b&&L>=1){const M=this._computeIndentLevel(L-1);M>=0?(c=L-1,u=M,R=Math.ceil(M/this.textModel.getOptions().indentSize)):(d(L),R=this._getIndentLevelForWhitespaceLine(s,l,u))}let P=-1;if(C&&D<=r){const M=this._computeIndentLevel(D-1);M>=0?(h=D-1,g=M,P=Math.ceil(M/this.textModel.getOptions().indentSize)):(_(D),P=this._getIndentLevelForWhitespaceLine(s,g,m))}if(I===0){k=R;continue}if(I===1){if(D<=r&&P>=0&&k+1===P){b=!1,v=D,y=D,x=P;continue}if(L>=1&&R>=0&&R-1===k){C=!1,v=L,y=L,x=R;continue}if(v=e,y=e,x=k,x===0)return{startLineNumber:v,endLineNumber:y,indent:x}}b&&(R>=x?v=L:b=!1),C&&(P>=x?y=D:C=!1)}return{startLineNumber:v,endLineNumber:y,indent:x}}getLinesBracketGuides(e,t,i,r){var o;const s=[];for(let h=e;h<=t;h++)s.push([]);const a=!0,l=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new q(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let c;if(i&&l.length>0){const h=(e<=i.lineNumber&&i.lineNumber<=t?l:this.textModel.bracketPairs.getBracketPairsInRange(q.fromPositions(i)).toArray()).filter(g=>q.strictContainsPosition(g.range,i));c=(o=HV(h,g=>a))===null||o===void 0?void 0:o.range}const u=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new Gqe;for(const h of l){if(!h.closingBracketRange)continue;const g=c&&h.range.equalsRange(c);if(!g&&!r.includeInactive)continue;const p=d.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,u)+(r.highlightActive&&g?" "+d.activeClassName:""),m=h.openingBracketRange.getStartPosition(),_=h.closingBracketRange.getStartPosition(),v=r.horizontalGuides===JE.Enabled||r.horizontalGuides===JE.EnabledForActive&&g;if(h.range.startLineNumber===h.range.endLineNumber){v&&s[h.range.startLineNumber-e].push(new RE(-1,h.openingBracketRange.getEndPosition().column,p,new BO(!1,_.column),-1,-1));continue}const b=this.getVisibleColumnFromPosition(_),y=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),C=Math.min(y,b,h.minVisibleColumnIndentation+1);let x=!1;cu(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))<h.closingBracketRange.startColumn-1&&(x=!0);const L=Math.max(m.lineNumber,e),D=Math.min(_.lineNumber,t),R=x?1:0;for(let P=L;P<D+R;P++)s[P-e].push(new RE(C,-1,p,null,P===m.lineNumber?m.column:-1,P===_.lineNumber?_.column:-1));v&&(m.lineNumber>=e&&y>C&&s[m.lineNumber-e].push(new RE(C,-1,p,new BO(!1,m.column),-1,-1)),_.lineNumber<=t&&b>C&&s[_.lineNumber-e].push(new RE(C,-1,p,new BO(!x,_.column),-1,-1)))}for(const h of s)h.sort((g,p)=>g.visibleColumn-p.visibleColumn);return s}getVisibleColumnFromPosition(e){return Va.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const r=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,s=!!(o&&o.offSide),a=new Array(t-e+1);let l=-2,c=-1,u=-2,d=-1;for(let h=e;h<=t;h++){const g=h-e,p=this._computeIndentLevel(h-1);if(p>=0){l=h-1,c=p,a[g]=Math.ceil(p/r.indentSize);continue}if(l===-2){l=-1,c=-1;for(let m=h-2;m>=0;m--){const _=this._computeIndentLevel(m);if(_>=0){l=m,c=_;break}}}if(u!==-1&&(u===-2||u<h-1)){u=-1,d=-1;for(let m=h;m<i;m++){const _=this._computeIndentLevel(m);if(_>=0){u=m,d=_;break}}}a[g]=this._getIndentLevelForWhitespaceLine(s,c,d)}return a}_getIndentLevelForWhitespaceLine(e,t,i){const r=this.textModel.getOptions();return t===-1||i===-1?0:t<i?1+Math.floor(t/r.indentSize):t===i||e?Math.ceil(i/r.indentSize):1+Math.floor(i/r.indentSize)}}class Gqe{constructor(){this.activeClassName="indent-active"}getInlineClassName(e,t,i){return this.getInlineClassNameOfLevel(i?t:e)}getInlineClassNameOfLevel(e){return`bracket-indent-guide lvl-${e%30}`}}class zWi extends Ok{constructor(e){super(),this._context=e,this._primaryPosition=null;const t=this._context.configuration.options,i=t.get(144),r=t.get(50);this._lineHeight=t.get(66),this._spaceWidth=r.spaceWidth,this._maxIndentLeft=i.wrappingColumn===-1?-1:i.wrappingColumn*r.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(16),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,i=t.get(144),r=t.get(50);return this._lineHeight=t.get(66),this._spaceWidth=r.spaceWidth,this._maxIndentLeft=i.wrappingColumn===-1?-1:i.wrappingColumn*r.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(16),!0}onCursorStateChanged(e){var t;const r=e.selections[0].getPosition();return!((t=this._primaryPosition)===null||t===void 0)&&t.equals(r)?!1:(this._primaryPosition=r,!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,i,r,o;if(!this._bracketPairGuideOptions.indentation&&this._bracketPairGuideOptions.bracketPairs===!1){this._renderResult=null;return}const s=e.visibleRange.startLineNumber,a=e.visibleRange.endLineNumber,l=e.scrollWidth,c=this._lineHeight,u=this._primaryPosition,d=this.getGuidesByLine(s,Math.min(a+1,this._context.viewModel.getLineCount()),u),h=[];for(let g=s;g<=a;g++){const p=g-s,m=d[p];let _="";const v=(i=(t=e.visibleRangeForPosition(new Ce(g,1)))===null||t===void 0?void 0:t.left)!==null&&i!==void 0?i:0;for(const b of m){const y=b.column===-1?v+(b.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new Ce(g,b.column)).left;if(y>l||this._maxIndentLeft>0&&y>this._maxIndentLeft)break;const C=b.horizontalLine?b.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",x=b.horizontalLine?((o=(r=e.visibleRangeForPosition(new Ce(g,b.horizontalLine.endColumn)))===null||r===void 0?void 0:r.left)!==null&&o!==void 0?o:y+this._spaceWidth)-y:this._spaceWidth;_+=`<div class="core-guide ${b.className} ${C}" style="left:${y}px;height:${c}px;width:${x}px"></div>`}h[p]=_}this._renderResult=h}getGuidesByLine(e,t,i){const r=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?JE.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?JE.EnabledForActive:JE.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let s=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&i){const d=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);s=d.startLineNumber,a=d.endLineNumber,l=d.indent}const{indentSize:c}=this._context.viewModel.model.getOptions(),u=[];for(let d=e;d<=t;d++){const h=new Array;u.push(h);const g=r?r[d-e]:[],p=new v0(g),m=o?o[d-e]:0;for(let _=1;_<=m;_++){const v=(_-1)*c+1,b=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||g.length===0)&&s<=d&&d<=a&&_===l;h.push(...p.takeWhile(C=>C.visibleColumn<v)||[]);const y=p.peek();(!y||y.visibleColumn!==v||y.horizontalLine)&&h.push(new RE(v,-1,`core-guide-indent lvl-${(_-1)%30}`+(b?" indent-active":""),null,-1,-1))}h.push(...p.takeWhile(_=>!0)||[])}return u}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function OT(n){if(!(n&&n.isTransparent()))return n}rm((n,e)=>{const t=[{bracketColor:Oqe,guideColor:JHi,guideColorActive:oWi},{bracketColor:Pqe,guideColor:eWi,guideColorActive:sWi},{bracketColor:Mqe,guideColor:tWi,guideColorActive:aWi},{bracketColor:Fqe,guideColor:nWi,guideColorActive:lWi},{bracketColor:Bqe,guideColor:iWi,guideColorActive:cWi},{bracketColor:$qe,guideColor:rWi,guideColorActive:uWi}],i=new Gqe,r=[{indentColor:E5,indentColorActive:x5},{indentColor:PHi,indentColorActive:VHi},{indentColor:MHi,indentColorActive:HHi},{indentColor:FHi,indentColorActive:WHi},{indentColor:BHi,indentColorActive:zHi},{indentColor:$Hi,indentColorActive:jHi}],o=t.map(a=>{var l,c;const u=n.getColor(a.bracketColor),d=n.getColor(a.guideColor),h=n.getColor(a.guideColorActive),g=OT((l=OT(d))!==null&&l!==void 0?l:u==null?void 0:u.transparent(.3)),p=OT((c=OT(h))!==null&&c!==void 0?c:u);if(!(!g||!p))return{guideColor:g,guideColorActive:p}}).filter(mM),s=r.map(a=>{const l=n.getColor(a.indentColor),c=n.getColor(a.indentColorActive),u=OT(l),d=OT(c);if(!(!u||!d))return{indentColor:u,indentColorActive:d}}).filter(mM);if(o.length>0){for(let a=0;a<30;a++){const l=o[a%o.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${l.guideColor}; --guide-color-active: ${l.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${i.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${i.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${i.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(s.length>0){for(let a=0;a<30;a++){const l=s[a%s.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});class TZ{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),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}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class jWi{constructor(){this._currentVisibleRange=new q(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class UWi{constructor(e,t,i,r,o,s,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=r,this.startScrollTop=o,this.stopScrollTop=s,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class qWi{constructor(e,t,i,r,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=r,this.scrollType=o,this.type="selections";let s=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;l<c;l++){const u=t[l];s=Math.min(s,u.startLineNumber),a=Math.max(a,u.endLineNumber)}this.minLineNumber=s,this.maxLineNumber=a}}class dq extends ph{constructor(e,t){super(e),this._linesContent=t,this._textRangeRestingSpot=document.createElement("div"),this._visibleLines=new jqe(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration,r=this._context.configuration.options,o=r.get(50),s=r.get(144);this._lineHeight=r.get(66),this._typicalHalfwidthCharacterWidth=o.typicalHalfwidthCharacterWidth,this._isViewportWrapping=s.isViewportWrapping,this._revealHorizontalRightPadding=r.get(99),this._cursorSurroundingLines=r.get(29),this._cursorSurroundingLinesStyle=r.get(30),this._canUseLayerHinting=!r.get(32),this._viewLineOptions=new MDe(i,this._context.theme.type),ub.write(this.domNode,7),this.domNode.setClassName(`view-lines ${NL}`),mc(this.domNode,o),this._maxLineWidth=0,this._asyncUpdateLineWidths=new so(()=>{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new so(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new jWi,this._horizontalRevealRequest=null,this._stickyScrollEnabled=r.get(114).enabled,this._maxNumberStickyLines=r.get(114).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new wv(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(144)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(50),r=t.get(144);return this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=r.isViewportWrapping,this._revealHorizontalRightPadding=t.get(99),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(114).enabled,this._maxNumberStickyLines=t.get(114).maxLineCount,mc(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(143)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new MDe(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let o=i;o<=r;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let r=!1;for(let o=t;o<=i;o++)r=this._visibleLines.getVisibleLine(o).onSelectionChanged()||r;return r}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let r=t;r<=i;r++)this._visibleLines.getVisibleLine(r).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(t===-1)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new UWi(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new qWi(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const o=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,o),!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),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTop<t||e.scrollTop>i)&&(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 i=this._getViewLineDomNode(e);if(i===null)return null;const r=this._getLineNumberFor(i);if(r===-1||r<1||r>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(r)===1)return new Ce(r,1);const o=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();if(r<o||r>s)return null;let a=this._visibleLines.getVisibleLine(r).getColumnOfNodeOffset(e,t);const l=this._context.viewModel.getLineMinColumn(r);return a<l&&(a=l),new Ce(r,a)}_getViewLineDomNode(e){for(;e&&e.nodeType===1;){if(e.className===wv.CLASS_NAME)return e;e=e.parentElement}return null}_getLineNumberFor(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let r=t;r<=i;r++){const o=this._visibleLines.getVisibleLine(r);if(e===o.getDomNode())return r}return-1}getLineWidth(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();if(e<t||e>i)return-1;const r=new TZ(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(r);return this._updateLineWidthsSlowIfDomDidLayout(r),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,r=q.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!r)return null;const o=[];let s=0;const a=new TZ(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Ce(r.startLineNumber,1)).lineNumber);const c=this._visibleLines.getStartLineNumber(),u=this._visibleLines.getEndLineNumber();for(let d=r.startLineNumber;d<=r.endLineNumber;d++){if(d<c||d>u)continue;const h=d===r.startLineNumber?r.startColumn:1,g=d!==r.endLineNumber,p=g?this._context.viewModel.getLineMaxColumn(d):r.endColumn,m=this._visibleLines.getVisibleLine(d).getVisibleRangesForRange(d,h,p,a);if(m){if(t&&d<i){const _=l;l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Ce(d+1,1)).lineNumber,_!==l&&(m.ranges[m.ranges.length-1].width+=this._typicalHalfwidthCharacterWidth)}o[s++]=new tHi(m.outsideRenderedLine,d,oq.from(m.ranges),g)}}return this._updateLineWidthsSlowIfDomDidLayout(a),s===0?null:o}_visibleRangesForLineRange(e,t,i){if(this.shouldRender()||e<this._visibleLines.getStartLineNumber()||e>this._visibleLines.getEndLineNumber())return null;const r=new TZ(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,r);return this._updateLineWidthsSlowIfDomDidLayout(r),o}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new nHi(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let r=1,o=!0;for(let s=t;s<=i;s++){const a=this._visibleLines.getVisibleLine(s);if(e&&!a.getWidthIsFast()){o=!1;continue}r=Math.max(r,a.getWidth(null))}return o&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(r),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let o=i;o<=r;o++){const s=this._visibleLines.getVisibleLine(o);if(s.needsMonospaceFontCheck()){const a=s.getWidth(null);a>t&&(t=a,e=o)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=i;o<=r;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 i=this._horizontalRevealRequest;if(e.startLineNumber<=i.minLineNumber&&i.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const r=this._computeScrollLeftToReveal(i);r&&(this._isViewportWrapping||this._ensureMaxLineWidth(r.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:r.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),fu&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();for(let o=i;o<=r;o++)if(this._visibleLines.getVisibleLine(o).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,i,r,o,s){const a=e.top,l=e.height,c=a+l;let u,d,h;if(o&&o.length>0){let v=o[0].startLineNumber,b=o[0].endLineNumber;for(let y=1,C=o.length;y<C;y++){const x=o[y];v=Math.min(v,x.startLineNumber),b=Math.max(b,x.endLineNumber)}u=!1,d=this._context.viewLayout.getVerticalOffsetForLineNumber(v),h=this._context.viewLayout.getVerticalOffsetForLineNumber(b)+this._lineHeight}else if(r)u=!0,d=this._context.viewLayout.getVerticalOffsetForLineNumber(r.startLineNumber),h=this._context.viewLayout.getVerticalOffsetForLineNumber(r.endLineNumber)+this._lineHeight;else return-1;const g=(t==="mouse"||i)&&this._cursorSurroundingLinesStyle==="default";let p=0,m=0;if(g)i||(p=this._lineHeight);else{const v=Math.min(l/this._lineHeight/2,this._cursorSurroundingLines);this._stickyScrollEnabled?p=Math.max(v,this._maxNumberStickyLines)*this._lineHeight:p=v*this._lineHeight,m=Math.max(0,v-1)*this._lineHeight}i||(s===0||s===4)&&(m+=this._lineHeight),d-=p,h+=m;let _;if(h-d>l){if(!u)return-1;_=d}else if(s===5||s===6)if(s===6&&a<=d&&h<=c)_=a;else{const v=Math.max(5*this._lineHeight,l*.2),b=d-v,y=h-l;_=Math.max(y,b)}else if(s===1||s===2)if(s===2&&a<=d&&h<=c)_=a;else{const v=(d+h)/2;_=Math.max(0,v-l/2)}else _=this._computeMinimumScrolling(a,c,d,h,s===3,s===4);return _}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(143),r=t.left,o=r+t.width-i.verticalScrollbarWidth;let s=1073741824,a=0;if(e.type==="range"){const c=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!c)return null;for(const u of c.ranges)s=Math.min(s,Math.round(u.left)),a=Math.max(a,Math.round(u.left+u.width))}else for(const c of e.selections){if(c.startLineNumber!==c.endLineNumber)return null;const u=this._visibleRangesForLineRange(c.startLineNumber,c.startColumn,c.endColumn);if(!u)return null;for(const d of u.ranges)s=Math.min(s,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}return e.minimalReveal||(s=Math.max(0,s-dq.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-s>t.width?null:{scrollLeft:this._computeMinimumScrolling(r,o,s,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,i,r,o,s){e=e|0,t=t|0,i=i|0,r=r|0,o=!!o,s=!!s;const a=t-e;if(r-i<a){if(o)return i;if(s)return Math.max(0,r-a);if(i<e)return i;if(r>t)return Math.max(0,r-a)}else return i;return e}}dq.HORIZONTAL_EXTRA_PX=30;class xse{constructor(e,t,i,r){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i),this.zIndex=r??0}}class KWi{constructor(e,t){this.className=e,this.zIndex=t}}class GWi{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class Yqe extends Ok{_render(e,t,i){const r=[];for(let a=e;a<=t;a++){const l=a-e;r[l]=new GWi}if(i.length===0)return r;i.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.className<l.className?-1:1);let o=null,s=0;for(let a=0,l=i.length;a<l;a++){const c=i[a],u=c.className,d=c.zIndex;let h=Math.max(c.startLineNumber,e)-e;const g=Math.min(c.endLineNumber,t)-e;o===u?(h=Math.max(s+1,h),s=Math.max(s,g)):(o=u,s=g);for(let p=h;p<=s;p++)r[p].add(new KWi(u,d))}return r}}class YWi extends ph{constructor(e){super(e),this._widgets={},this._context=e;const t=this._context.configuration.options,i=t.get(143);this.domNode=Or(document.createElement("div")),this.domNode.setClassName("glyph-margin-widgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this._lineHeight=t.get(66),this._glyphMargin=t.get(57),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._glyphMarginDecorationLaneCount=i.glyphMarginDecorationLaneCount,this._managedDomNodes=[],this._decorationGlyphsToRender=[]}dispose(){this._managedDomNodes=[],this._decorationGlyphsToRender=[],this._widgets={},super.dispose()}getWidgets(){return Object.values(this._widgets)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._lineHeight=t.get(66),this._glyphMargin=t.get(57),this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._glyphMarginDecorationLaneCount=i.glyphMarginDecorationLaneCount,!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}addWidget(e){const t=Or(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:e.getPosition(),domNode:t,renderInfo:null},t.setPosition("absolute"),t.setDisplay("none"),t.setAttribute("widgetId",e.getId()),this.domNode.appendChild(t),this.setShouldRender()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference.lane===t.lane&&i.preference.zIndex===t.zIndex&&q.equalsRange(i.preference.range,t.range)?!1:(i.preference=t,this.setShouldRender(),!0)}removeWidget(e){var t;const i=e.getId();if(this._widgets[i]){const o=this._widgets[i].domNode.domNode;delete this._widgets[i],(t=o.parentNode)===null||t===void 0||t.removeChild(o),this.setShouldRender()}}_collectDecorationBasedGlyphRenderRequest(e,t){var i,r,o;const s=e.visibleRange.startLineNumber,a=e.visibleRange.endLineNumber,l=e.getDecorationsInViewport();for(const c of l){const u=c.options.glyphMarginClassName;if(!u)continue;const d=Math.max(c.range.startLineNumber,s),h=Math.min(c.range.endLineNumber,a),g=Math.min((r=(i=c.options.glyphMargin)===null||i===void 0?void 0:i.position)!==null&&r!==void 0?r:1,this._glyphMarginDecorationLaneCount),p=(o=c.options.zIndex)!==null&&o!==void 0?o:0;for(let m=d;m<=h;m++)t.push(new QWi(m,g,p,u))}}_collectWidgetBasedGlyphRenderRequest(e,t){const i=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(const o of Object.values(this._widgets)){const s=o.preference.range;if(s.endLineNumber<i||s.startLineNumber>r)continue;const a=Math.max(s.startLineNumber,i),l=Math.min(o.preference.lane,this._glyphMarginDecorationLaneCount);t.push(new XWi(a,l,o.preference.zIndex,o))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((i,r)=>i.lineNumber===r.lineNumber?i.lane===r.lane?i.zIndex===r.zIndex?r.type===i.type?i.type===0&&r.type===0?i.className<r.className?-1:1:0:r.type-i.type:r.zIndex-i.zIndex:i.lane-r.lane:i.lineNumber-r.lineNumber),t}prepareRender(e){if(!this._glyphMargin){this._decorationGlyphsToRender=[];return}for(const r of Object.values(this._widgets))r.renderInfo=null;const t=new v0(this._collectSortedGlyphRenderRequests(e)),i=[];for(;t.length>0;){const r=t.peek();if(!r)break;const o=t.takeWhile(a=>a.lineNumber===r.lineNumber&&a.lane===r.lane);if(!o||o.length===0)break;const s=o[0];if(s.type===0){const a=[];for(const l of o){if(l.zIndex!==s.zIndex||l.type!==s.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}i.push(s.accept(a.join(" ")))}else s.widget.renderInfo={lineNumber:s.lineNumber,lane:s.lane}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const i of Object.values(this._widgets))i.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const i=this._managedDomNodes.pop();i==null||i.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(!i.renderInfo)i.domNode.setDisplay("none");else{const r=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+(i.renderInfo.lane-1)*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(r),i.domNode.setLeft(o),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}for(let i=0;i<this._decorationGlyphsToRender.length;i++){const r=this._decorationGlyphsToRender[i],o=e.viewportData.relativeVerticalOffset[r.lineNumber-e.viewportData.startLineNumber],s=this._glyphMarginLeft+(r.lane-1)*this._lineHeight;let a;i<this._managedDomNodes.length?a=this._managedDomNodes[i]:(a=Or(document.createElement("div")),this._managedDomNodes.push(a),this.domNode.appendChild(a)),a.setClassName("cgmr codicon "+r.combinedClassName),a.setPosition("absolute"),a.setTop(o),a.setLeft(s),a.setWidth(t),a.setHeight(this._lineHeight)}for(;this._managedDomNodes.length>this._decorationGlyphsToRender.length;){const i=this._managedDomNodes.pop();i==null||i.domNode.remove()}}}class QWi{constructor(e,t,i,r){this.lineNumber=e,this.lane=t,this.zIndex=i,this.className=r,this.type=0}accept(e){return new ZWi(this.lineNumber,this.lane,e)}}class XWi{constructor(e,t,i,r){this.lineNumber=e,this.lane=t,this.zIndex=i,this.widget=r,this.type=1}}class ZWi{constructor(e,t,i){this.lineNumber=e,this.lane=t,this.combinedClassName=i}}class JWi extends Yqe{constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(143);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const i=this._context.configuration.options.get(143);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.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(),i=[];let r=0;for(let o=0,s=t.length;o<s;o++){const a=t[o],l=a.options.linesDecorationsClassName,c=a.options.zIndex;l&&(i[r++]=new xse(a.range.startLineNumber,a.range.endLineNumber,l,c));const u=a.options.firstLineDecorationClassName;u&&(i[r++]=new xse(a.range.startLineNumber,a.range.startLineNumber,u,c))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,r=this._render(t,i,this._getDecorations(e)),o=this._decorationsLeft.toString(),s=this._decorationsWidth.toString(),a='" style="left:'+o+"px;width:"+s+'px;"></div>',l=[];for(let c=t;c<=i;c++){const u=c-t,d=r[u].getDecorations();let h="";for(const g of d)h+='<div class="cldr '+g.className+a;l[u]=h}this._renderResult=l}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class ezi extends Yqe{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(),i=[];let r=0;for(let o=0,s=t.length;o<s;o++){const a=t[o],l=a.options.marginClassName,c=a.options.zIndex;l&&(i[r++]=new xse(a.range.startLineNumber,a.range.endLineNumber,l,c))}return i}prepareRender(e){const t=e.visibleRange.startLineNumber,i=e.visibleRange.endLineNumber,r=this._render(t,i,this._getDecorations(e)),o=[];for(let s=t;s<=i;s++){const a=s-t,l=r[a].getDecorations();let c="";for(const u of l)c+='<div class="cmdr '+u.className+'" style=""></div>';o[a]=c}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class ag{constructor(e,t,i,r){this._rgba8Brand=void 0,this.r=ag._clamp(e),this.g=ag._clamp(t),this.b=ag._clamp(i),this.a=ag._clamp(r)}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:e|0}}ag.Empty=new ag(0,0,0,0);class T5 extends Ae{static getInstance(){return this._INSTANCE||(this._INSTANCE=new T5),this._INSTANCE}constructor(){super(),this._onDidChange=new be,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(ps.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=ps.getColorMap();if(!e){this._colors=[ag.Empty],this._backgroundIsLight=!0;return}this._colors=[ag.Empty];for(let i=1;i<e.length;i++){const r=e[i].rgba;this._colors[i]=new ag(r.r,r.g,r.b,Math.round(r.a*255))}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}}T5._INSTANCE=null;const tzi=(()=>{const n=[];for(let e=32;e<=126;e++)n.push(e);return n.push(65533),n})(),nzi=(n,e)=>(n-=32,n<0||n>96?e<=2?(n+96)%96:96-1:n);class jM{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=jM.soften(e,12/15),this.charDataLight=jM.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let r=0,o=e.length;r<o;r++)i[r]=BV(e[r]*t);return i}renderChar(e,t,i,r,o,s,a,l,c,u,d){const h=1*this.scale,g=2*this.scale,p=d?1:g;if(t+h>e.width||i+p>e.height){console.warn("bad render request outside image data");return}const m=u?this.charDataLight:this.charDataNormal,_=nzi(r,c),v=e.width*4,b=a.r,y=a.g,C=a.b,x=o.r-b,k=o.g-y,I=o.b-C,L=Math.max(s,l),D=e.data;let R=_*h*g,P=i*v+t*4;for(let M=0;M<p;M++){let O=P;for(let B=0;B<h;B++){const F=m[R++]/255*(s/255);D[O++]=b+x*F,D[O++]=y+k*F,D[O++]=C+I*F,D[O++]=L}P+=v}}blockRenderChar(e,t,i,r,o,s,a,l){const c=1*this.scale,u=2*this.scale,d=l?1:u;if(t+c>e.width||i+d>e.height){console.warn("bad render request outside image data");return}const h=e.width*4,g=.5*(o/255),p=s.r,m=s.g,_=s.b,v=r.r-p,b=r.g-m,y=r.b-_,C=p+v*g,x=m+b*g,k=_+y*g,I=Math.max(o,a),L=e.data;let D=i*h+t*4;for(let R=0;R<d;R++){let P=D;for(let M=0;M<c;M++)L[P++]=C,L[P++]=x,L[P++]=k,L[P++]=I;D+=h}}}const qDe={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},KDe=n=>{const e=new Uint8ClampedArray(n.length/2);for(let t=0;t<n.length;t+=2)e[t>>1]=qDe[n[t]]<<4|qDe[n[t+1]]&15;return e},GDe={1:sw(()=>KDe("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:sw(()=>KDe("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class $O{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return GDe[e]?i=new jM(GDe[e](),e):i=$O.createFromSampleData($O.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=96*10,t.style.width=96*10+"px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let r=0;for(const o of tzi)i.fillText(String.fromCharCode(o),r,16/2),r+=10;return i.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const r=$O._downsample(e,t);return new jM(r,t)}static _downsampleChar(e,t,i,r,o){const s=1*o,a=2*o;let l=r,c=0;for(let u=0;u<a;u++){const d=u/a*16,h=(u+1)/a*16;for(let g=0;g<s;g++){const p=g/s*10,m=(g+1)/s*10;let _=0,v=0;for(let y=d;y<h;y++){const C=t+Math.floor(y)*3840,x=1-(y-Math.floor(y));for(let k=p;k<m;k++){const I=1-(k-Math.floor(k)),L=C+Math.floor(k)*4,D=I*x;v+=D,_+=e[L]*e[L+3]/255*D}}const b=_/v;c=Math.max(c,b),i[l++]=BV(b)}}return c}static _downsample(e,t){const i=2*t*1*t,r=i*96,o=new Uint8ClampedArray(r);let s=0,a=0,l=0;for(let c=0;c<96;c++)l=Math.max(l,this._downsampleChar(e,a,o,s,t)),s+=i,a+=10*4;if(l>0){const c=255/l;for(let u=0;u<r;u++)o[u]*=c}return o}}const izi=140,rzi=2;class UM{constructor(e,t,i){const r=e.options,o=r.get(141),s=r.get(143),a=s.minimap,l=r.get(50),c=r.get(72);this.renderMinimap=a.renderMinimap,this.size=c.size,this.minimapHeightIsEditorHeight=a.minimapHeightIsEditorHeight,this.scrollBeyondLastLine=r.get(104),this.paddingTop=r.get(83).top,this.paddingBottom=r.get(83).bottom,this.showSlider=c.showSlider,this.autohide=c.autohide,this.pixelRatio=o,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.lineHeight=r.get(66),this.minimapLeft=a.minimapLeft,this.minimapWidth=a.minimapWidth,this.minimapHeight=s.height,this.canvasInnerWidth=a.minimapCanvasInnerWidth,this.canvasInnerHeight=a.minimapCanvasInnerHeight,this.canvasOuterWidth=a.minimapCanvasOuterWidth,this.canvasOuterHeight=a.minimapCanvasOuterHeight,this.isSampling=a.minimapIsSampling,this.editorHeight=s.height,this.fontScale=a.minimapScale,this.minimapLineHeight=a.minimapLineHeight,this.minimapCharWidth=1*this.fontScale,this.charRenderer=sw(()=>$O.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=UM._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=UM._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor($Vi);return i?new ag(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(VVi);return t?ag._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.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&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 VO{constructor(e,t,i,r,o,s,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=r,this.sliderTop=o,this.sliderHeight=s,this.topPaddingLineCount=a,this.startLineNumber=l,this.endLineNumber=c}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,r,o,s,a,l,c,u,d){const h=e.pixelRatio,g=e.minimapLineHeight,p=Math.floor(e.canvasInnerHeight/g),m=e.lineHeight;if(e.minimapHeightIsEditorHeight){let k=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(k+=Math.max(0,o-e.lineHeight-e.paddingBottom));const I=Math.max(1,Math.floor(o*o/k)),L=Math.max(0,e.minimapHeight-I),D=L/(u-o),R=c*D,P=L>0,M=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),O=Math.floor(e.paddingTop/e.lineHeight);return new VO(c,u,P,D,R,I,O,1,Math.min(a,M))}let _;if(s&&i!==a){const k=i-t+1;_=Math.floor(k*g/h)}else{const k=o/m;_=Math.floor(k*g/h)}const v=Math.floor(e.paddingTop/m);let b=Math.floor(e.paddingBottom/m);if(e.scrollBeyondLastLine){const k=o/m;b=Math.max(b,k-1)}let y;if(b>0){const k=o/m;y=(v+a+b-k-1)*g/h}else y=Math.max(0,(v+a)*g/h-_);y=Math.min(e.minimapHeight-_,y);const C=y/(u-o),x=c*C;if(p>=v+a+b){const k=y>0;return new VO(c,u,k,C,x,_,v,1,a)}else{let k;t>1?k=t+v:k=Math.max(1,c/m);let I,L=Math.max(1,Math.floor(k-x*h/g));L<v?(I=v-L+1,L=1):(I=0,L=Math.max(1,L-v)),d&&d.scrollHeight===u&&(d.scrollTop>c&&(L=Math.min(L,d.startLineNumber),I=Math.max(I,d.topPaddingLineCount)),d.scrollTop<c&&(L=Math.max(L,d.startLineNumber),I=Math.min(I,d.topPaddingLineCount)));const D=Math.min(a,L-I+p-1),R=(c-r)/m;let P;return c>=e.paddingTop?P=(t-L+I+R)*g/h:P=c/e.paddingTop*(I+R)*g/h,new VO(c,u,!0,C,P,_,I,L,D)}}}class JV{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}JV.INVALID=new JV(-1);class YDe{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new zqe(()=>JV.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const i=this._renderedLines._get().lines;for(let r=0,o=i.length;r<o;r++)if(i[r].dy===-1)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 m_e{constructor(e,t,i,r){this._backgroundFillData=m_e._createBackgroundFillData(t,i,r),this._buffers=[e.createImageData(t,i),e.createImageData(t,i)],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,i){const r=i.r,o=i.g,s=i.b,a=i.a,l=new Uint8ClampedArray(e*t*4);let c=0;for(let u=0;u<t;u++)for(let d=0;d<e;d++)l[c]=r,l[c+1]=o,l[c+2]=s,l[c+3]=a,c+=4;return l}}class qM{static compute(e,t,i){if(e.renderMinimap===0||!e.isSampling)return[null,[]];const{minimapLineCount:r}=wL.computeContainedMinimapLineCount({viewLineCount:t,scrollBeyondLastLine:e.scrollBeyondLastLine,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:e.editorHeight,lineHeight:e.lineHeight,pixelRatio:e.pixelRatio}),o=t/r,s=o/2;if(!i||i.minimapLines.length===0){const _=[];if(_[0]=1,r>1){for(let v=0,b=r-1;v<b;v++)_[v]=Math.round(v*o+s);_[r-1]=t}return[new qM(o,_),[]]}const a=i.minimapLines,l=a.length,c=[];let u=0,d=0,h=1;const g=10;let p=[],m=null;for(let _=0;_<r;_++){const v=Math.max(h,Math.round(_*o)),b=Math.max(v,Math.round((_+1)*o));for(;u<l&&a[u]<v;){if(p.length<g){const C=u+1+d;m&&m.type==="deleted"&&m._oldIndex===u-1?m.deleteToLineNumber++:(m={type:"deleted",_oldIndex:u,deleteFromLineNumber:C,deleteToLineNumber:C},p.push(m)),d--}u++}let y;if(u<l&&a[u]<=b)y=a[u],u++;else if(_===0?y=1:_+1===r?y=t:y=Math.round(_*o+s),p.length<g){const C=u+1+d;m&&m.type==="inserted"&&m._i===_-1?m.insertToLineNumber++:(m={type:"inserted",_i:_,insertFromLineNumber:C,insertToLineNumber:C},p.push(m)),d++}c[_]=y,h=y}if(p.length<g)for(;u<l;){const _=u+1+d;m&&m.type==="deleted"&&m._oldIndex===u-1?m.deleteToLineNumber++:(m={type:"deleted",_oldIndex:u,deleteFromLineNumber:_,deleteToLineNumber:_},p.push(m)),d--,u++}else p=[{type:"flush"}];return[new qM(o,c),p]}constructor(e,t){this.samplingRatio=e,this.minimapLines=t}modelLineToMinimapLine(e){return Math.min(this.minimapLines.length,Math.max(1,Math.round(e/this.samplingRatio)))}modelLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e)-1;for(;i>0&&this.minimapLines[i-1]>=e;)i--;let r=this.modelLineToMinimapLine(t)-1;for(;r+1<this.minimapLines.length&&this.minimapLines[r+1]<=t;)r++;if(i===r){const o=this.minimapLines[i];if(o<e||o>t)return null}return[i+1,r+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),r=this.modelLineToMinimapLine(t);return e!==t&&r===i&&(r===this.minimapLines.length?i>1&&i--:r++),[i,r]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,r=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),i=Math.min(i,o),r=Math.max(r,o)):this.minimapLines[o]-=t;return[i,r]}onLinesInserted(e){const t=e.toLineNumber-e.fromLineNumber+1;for(let i=this.minimapLines.length-1;i>=0&&!(this.minimapLines[i]<e.fromLineNumber);i--)this.minimapLines[i]+=t}}class ozi extends ph{constructor(e){super(e),this.tokensColorTracker=T5.getInstance(),this._selections=[],this._minimapSelections=null,this.options=new UM(this._context.configuration,this._context.theme,this.tokensColorTracker);const[t]=qM.compute(this.options,this._context.viewModel.getLineCount(),null);this._samplingState=t,this._shouldCheckSampling=!1,this._actual=new eH(e.theme,this)}dispose(){this._actual.dispose(),super.dispose()}getDomNode(){return this._actual.getDomNode()}_onOptionsMaybeChanged(){const e=new UM(this._context.configuration,this._context.theme,this.tokensColorTracker);return this.options.equals(e)?!1:(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():!1}onFlushed(e){return this._samplingState&&(this._shouldCheckSampling=!0),this._actual.onFlushed()}onLinesChanged(e){if(this._samplingState){const t=this._samplingState.modelLineRangeToMinimapLineRange(e.fromLineNumber,e.fromLineNumber+e.count-1);return t?this._actual.onLinesChanged(t[0],t[1]-t[0]+1):!1}else return this._actual.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){if(this._samplingState){const[t,i]=this._samplingState.onLinesDeleted(e);return t<=i&&this._actual.onLinesChanged(t+1,i-t+1),this._shouldCheckSampling=!0,!0}else 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 i of e.ranges){const r=this._samplingState.modelLineRangeToMinimapLineRange(i.fromLineNumber,i.toLineNumber);r&&t.push({fromLineNumber:r[0],toLineNumber:r[1]})}return t.length?this._actual.onTokensChanged(t):!1}else 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,i=e.visibleRange.endLineNumber;this._samplingState&&(t=this._samplingState.modelLineToMinimapLine(t),i=this._samplingState.modelLineToMinimapLine(i));const r={viewportContainsWhitespaceGaps:e.viewportData.whitespaceViewportData.length>0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(r)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,i]=qM.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const r of i)switch(r.type){case"deleted":this._actual.onLinesDeleted(r.deleteFromLineNumber,r.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(r.insertFromLineNumber,r.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}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,i){if(this._samplingState){const r=[];for(let o=0,s=t-e+1;o<s;o++)i[o]?r[o]=this._context.viewModel.getViewLineData(this._samplingState.minimapLines[e+o-1]):r[o]=null;return r}return this._context.viewModel.getMinimapLinesRenderingData(e,t,i).data}getSelections(){if(this._minimapSelections===null)if(this._samplingState){this._minimapSelections=[];for(const e of this._selections){const[t,i]=this._samplingState.decorationLineRangeToMinimapLineRange(e.startLineNumber,e.endLineNumber);this._minimapSelections.push(new ln(t,e.startColumn,i,e.endColumn))}}else this._minimapSelections=this._selections;return this._minimapSelections}getMinimapDecorationsInViewport(e,t){let i;if(this._samplingState){const o=this._samplingState.minimapLines[e-1],s=this._samplingState.minimapLines[t-1];i=new q(o,1,s,this._context.viewModel.getLineMaxColumn(s))}else i=new q(e,1,t,this._context.viewModel.getLineMaxColumn(t));const r=this._context.viewModel.getMinimapDecorationsInRange(i);if(this._samplingState){const o=[];for(const s of r){if(!s.options.minimap)continue;const a=s.range,l=this._samplingState.modelLineToMinimapLine(a.startLineNumber),c=this._samplingState.modelLineToMinimapLine(a.endLineNumber);o.push(new lqe(new q(l,a.startColumn,c,a.endColumn),s.options))}return o}return r}getOptions(){return this._context.viewModel.model.getOptions()}revealLineNumber(e){this._samplingState&&(e=this._samplingState.minimapLines[e-1]),this._context.viewModel.revealRange("mouse",!1,new q(e,1,e,1),1,0)}setScrollTop(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e},1)}}class eH extends Ae{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(RDe),this._domNode=Or(document.createElement("div")),ub.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=Or(document.createElement("div")),this._shadow.setClassName("minimap-shadow-hidden"),this._domNode.appendChild(this._shadow),this._canvas=Or(document.createElement("canvas")),this._canvas.setPosition("absolute"),this._canvas.setLeft(0),this._domNode.appendChild(this._canvas),this._decorationsCanvas=Or(document.createElement("canvas")),this._decorationsCanvas.setPosition("absolute"),this._decorationsCanvas.setClassName("minimap-decorations-layer"),this._decorationsCanvas.setLeft(0),this._domNode.appendChild(this._decorationsCanvas),this._slider=Or(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=Or(document.createElement("div")),this._sliderHorizontal.setPosition("absolute"),this._sliderHorizontal.setClassName("minimap-slider-horizontal"),this._slider.appendChild(this._sliderHorizontal),this._applyLayout(),this._pointerDownListener=ua(this._domNode.domNode,Lt.POINTER_DOWN,i=>{if(i.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.button===0&&this._lastRenderData){const c=Oa(this._slider.domNode),u=c.top+c.height/2;this._startSliderDragging(i,u,this._lastRenderData.renderedLayout)}return}const o=this._model.options.minimapLineHeight,s=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.offsetY;let l=Math.floor(s/o)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderPointerMoveMonitor=new xA,this._sliderPointerDownListener=ua(this._slider.domNode,Lt.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=bo.addTarget(this._domNode.domNode),this._sliderTouchStartListener=We(this._domNode.domNode,yo.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=We(this._domNode.domNode,yo.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=ua(this._domNode.domNode,yo.End,i=>{i.preventDefault(),i.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i){if(!e.target||!(e.target instanceof Element))return;const r=e.pageX;this._slider.toggleClassName("active",!0);const o=(s,a)=>{const l=Oa(this._domNode.domNode),c=Math.min(Math.abs(a-r),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(vc&&c>izi){this._model.setScrollTop(i.scrollTop);return}const u=s-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(u))};e.pageY!==t&&o(e.pageY,r),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>o(s.pageY,s.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return this._model.options.showSlider==="always"?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}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 m_e(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):!1}onLinesDeleted(e,t){var i;return(i=this._lastRenderData)===null||i===void 0||i.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var i;return(i=this._lastRenderData)===null||i===void 0||i.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(RDe),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===0){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const i=VO.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(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(q.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((h,g)=>(h.options.zIndex||0)-(g.options.zIndex||0));const{canvasInnerWidth:r,canvasInnerHeight:o}=this._model.options,s=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,r,o);const u=new QDe(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,u,e,s),this._renderDecorationsLineHighlights(c,i,u,e,s);const d=new QDe(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,d,e,s,l,a,r),this._renderDecorationsHighlights(c,i,d,e,s,l,a,r)}}_renderSelectionLineHighlights(e,t,i,r,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let s=0,a=0;for(const l of t){const c=r.intersectWithViewport(l);if(!c)continue;const[u,d]=c;for(let p=u;p<=d;p++)i.set(p,!0);const h=r.getYForLineNumber(u,o),g=r.getYForLineNumber(d,o);a>=h||(a>s&&e.fillRect(l1,s,e.canvas.width,a-s),s=h),a=g}a>s&&e.fillRect(l1,s,e.canvas.width,a-s)}_renderDecorationsLineHighlights(e,t,i,r,o){const s=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],c=l.options.minimap;if(!c||c.position!==rh.Inline)continue;const u=r.intersectWithViewport(l.range);if(!u)continue;const[d,h]=u,g=c.getColor(this._theme.value);if(!g||g.isTransparent())continue;let p=s.get(g.toString());p||(p=g.transparent(.5).toString(),s.set(g.toString(),p)),e.fillStyle=p;for(let m=d;m<=h;m++){if(i.has(m))continue;i.set(m,!0);const _=r.getYForLineNumber(d,o);e.fillRect(l1,_,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,r,o,s,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const c of t){const u=r.intersectWithViewport(c);if(!u)continue;const[d,h]=u;for(let g=d;g<=h;g++)this.renderDecorationOnLine(e,i,c,this._selectionColor,r,g,o,o,s,a,l)}}_renderDecorationsHighlights(e,t,i,r,o,s,a,l){for(const c of t){const u=c.options.minimap;if(!u)continue;const d=r.intersectWithViewport(c.range);if(!d)continue;const[h,g]=d,p=u.getColor(this._theme.value);if(!(!p||p.isTransparent()))for(let m=h;m<=g;m++)switch(u.position){case rh.Inline:this.renderDecorationOnLine(e,i,c.range,p,r,m,o,o,s,a,l);continue;case rh.Gutter:{const _=r.getYForLineNumber(m,o),v=2;this.renderDecoration(e,p,v,_,rzi,o);continue}}}}renderDecorationOnLine(e,t,i,r,o,s,a,l,c,u,d){const h=o.getYForLineNumber(s,l);if(h+a<0||h>this._model.options.canvasInnerHeight)return;const{startLineNumber:g,endLineNumber:p}=i,m=g===s?i.startColumn:1,_=p===s?i.endColumn:this._model.getLineMaxColumn(s),v=this.getXOffsetForPosition(t,s,m,c,u,d),b=this.getXOffsetForPosition(t,s,_,c,u,d);this.renderDecoration(e,r,v,h,b-v,a)}getXOffsetForPosition(e,t,i,r,o,s){if(i===1)return l1;if((i-1)*o>=s)return s;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[l1];let u=l1;for(let d=1;d<c.length+1;d++){const h=c.charCodeAt(d-1),g=h===9?r*o:aw(h)?2*o:o,p=u+g;if(p>=s){l[d]=s;break}l[d]=p,u=p}e.set(t,l)}return i-1<l.length?l[i-1]:s}renderDecoration(e,t,i,r,o,s){e.fillStyle=t&&t.toString()||"",e.fillRect(i,r,o,s)}renderLines(e){const t=e.startLineNumber,i=e.endLineNumber,r=this._model.options.minimapLineHeight;if(this._lastRenderData&&this._lastRenderData.linesEquals(e)){const F=this._lastRenderData._get();return new YDe(e,F.imageData,F.lines)}const o=this._getBuffer();if(!o)return null;const[s,a,l]=eH._renderUntouchedLines(o,e.topPaddingLineCount,t,i,r,this._lastRenderData),c=this._model.getMinimapLinesRenderingData(t,i,l),u=this._model.getOptions().tabSize,d=this._model.options.defaultBackgroundColor,h=this._model.options.backgroundColor,g=this._model.options.foregroundAlpha,p=this._model.tokensColorTracker,m=p.backgroundIsLight(),_=this._model.options.renderMinimap,v=this._model.options.charRenderer(),b=this._model.options.fontScale,y=this._model.options.minimapCharWidth,x=(_===1?2:2+1)*b,k=r>x?Math.floor((r-x)/2):0,I=h.a/255,L=new ag(Math.round((h.r-d.r)*I+d.r),Math.round((h.g-d.g)*I+d.g),Math.round((h.b-d.b)*I+d.b),255);let D=e.topPaddingLineCount*r;const R=[];for(let F=0,H=i-t+1;F<H;F++)l[F]&&eH._renderLine(o,L,h.a,m,_,y,p,g,v,D,k,u,c[F],b,r),R[F]=new JV(D),D+=r;const P=s===-1?0:s,O=(a===-1?o.height:a)-P;return this._canvas.domNode.getContext("2d").putImageData(o,0,0,0,P,o.width,O),new YDe(e,o,R)}static _renderUntouchedLines(e,t,i,r,o,s){const a=[];if(!s){for(let D=0,R=r-i+1;D<R;D++)a[D]=!0;return[-1,-1,a]}const l=s._get(),c=l.imageData.data,u=l.rendLineNumberStart,d=l.lines,h=d.length,g=e.width,p=e.data,m=(r-i+1)*o*g*4;let _=-1,v=-1,b=-1,y=-1,C=-1,x=-1,k=t*o;for(let D=i;D<=r;D++){const R=D-i,P=D-u,M=P>=0&&P<h?d[P].dy:-1;if(M===-1){a[R]=!0,k+=o;continue}const O=M*g*4,B=(M+o)*g*4,F=k*g*4,H=(k+o)*g*4;y===O&&x===F?(y=B,x=H):(b!==-1&&(p.set(c.subarray(b,y),C),_===-1&&b===0&&b===C&&(_=y),v===-1&&y===m&&b===C&&(v=b)),b=O,y=B,C=F,x=H),a[R]=!1,k+=o}b!==-1&&(p.set(c.subarray(b,y),C),_===-1&&b===0&&b===C&&(_=y),v===-1&&y===m&&b===C&&(v=b));const I=_===-1?-1:_/(g*4),L=v===-1?-1:v/(g*4);return[I,L,a]}static _renderLine(e,t,i,r,o,s,a,l,c,u,d,h,g,p,m){const _=g.content,v=g.tokens,b=e.width-s,y=m===1;let C=l1,x=0,k=0;for(let I=0,L=v.getCount();I<L;I++){const D=v.getEndOffset(I),R=v.getForeground(I),P=a.getColor(R);for(;x<D;x++){if(C>b)return;const M=_.charCodeAt(x);if(M===9){const O=h-(x+k)%h;k+=O-1,C+=O*s}else if(M===32)C+=s;else{const O=aw(M)?2:1;for(let B=0;B<O;B++)if(o===2?c.blockRenderChar(e,C,u+d,P,l,t,i,y):c.renderChar(e,C,u+d,M,P,l,t,i,p,r,y),C+=s,C>b)return}}}}}class QDe{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let r=0,o=this._endLineNumber-this._startLineNumber+1;r<o;r++)this._values[r]=i}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]}}class szi extends ph{constructor(e){super(e);const i=this._context.configuration.options.get(143);this._widgets={},this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,this._domNode=Or(document.createElement("div")),ub.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const i=this._context.configuration.options.get(143);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}addWidget(e){const t=Or(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(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference===t?(this._updateMaxMinWidth(),!1):(i.preference=t,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const r=this._widgets[t].domNode.domNode;delete this._widgets[t],r.parentNode.removeChild(r),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let i=0;const r=Object.keys(this._widgets);for(let o=0,s=r.length;o<s;o++){const a=r[o],c=(t=(e=this._widgets[a].widget).getMinContentWidthInPx)===null||t===void 0?void 0:t.call(e);typeof c<"u"&&(i=Math.max(i,c))}this._context.viewLayout.setOverlayWidgetsMinWidth(i)}_renderWidget(e){const t=e.domNode;if(e.preference===null){t.setTop("");return}if(e.preference===0)t.setTop(0),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth);else if(e.preference===1){const i=t.domNode.clientHeight;t.setTop(this._editorHeight-i-2*this._horizontalScrollbarHeight),t.setRight(2*this._verticalScrollbarWidth+this._minimapWidth)}else e.preference===2&&(t.setTop(0),t.domNode.style.right="50%")}prepareRender(e){}render(e){this._domNode.setWidth(this._editorWidth);const t=Object.keys(this._widgets);for(let i=0,r=t.length;i<r;i++){const o=t[i];this._renderWidget(this._widgets[o])}}}class azi{constructor(e,t){const i=e.options;this.lineHeight=i.get(66),this.pixelRatio=i.get(141),this.overviewRulerLanes=i.get(82),this.renderBorder=i.get(81);const r=t.getColor(qHi);this.borderColor=r?r.toString():null,this.hideCursor=i.get(59);const o=t.getColor(Rqe);this.cursorColor=o?o.transparent(.7).toString():null,this.themeType=t.type;const s=i.get(72),a=s.enabled,l=s.side,c=t.getColor(KHi),u=ps.getDefaultBackground();c?this.backgroundColor=c:a&&l==="right"?this.backgroundColor=u:this.backgroundColor=null;const h=i.get(143).overviewRuler;this.top=h.top,this.right=h.right,this.domWidth=h.width,this.domHeight=h.height,this.overviewRulerLanes===0?(this.canvasWidth=0,this.canvasHeight=0):(this.canvasWidth=this.domWidth*this.pixelRatio|0,this.canvasHeight=this.domHeight*this.pixelRatio|0);const[g,p]=this._initLanes(1,this.canvasWidth,this.overviewRulerLanes);this.x=g,this.w=p}_initLanes(e,t,i){const r=t-e;if(i>=3){const o=Math.floor(r/3),s=Math.floor(r/3),a=r-o-s,l=e,c=l+o,u=l+o+a;return[[0,l,c,l,u,l,c,l],[0,o,a,o+a,s,o+a+s,a+s,o+a+s]]}else if(i===2){const o=Math.floor(r/2),s=r-o,a=e,l=a+o;return[[0,a,a,a,l,a,a,a],[0,o,o,o,s,o+s,o+s,o+s]]}else{const o=e,s=r;return[[0,o,o,o,o,o,o,o],[0,s,s,s,s,s,s,s]]}}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&&De.equals(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 lzi extends ph{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=Or(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=ps.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new azi(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(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)}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;t<i;t++)this._cursorPositions[t]=e.selections[t].getPosition();return this._cursorPositions.sort(Ce.compare),this._markRenderingIsMaybeNeeded()}onDecorationsChanged(e){return e.affectsOverviewRuler?this._markRenderingIsMaybeNeeded():!1}onFlushed(e){return this._markRenderingIsNeeded()}onScrollChanged(e){return e.scrollHeightChanged?this._markRenderingIsNeeded():!1}onZonesChanged(e){return this._markRenderingIsNeeded()}onThemeChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}getDomNode(){return this._domNode.domNode}prepareRender(e){}render(e){this._render(),this._actualShouldRender=0}_render(){const e=this._settings.backgroundColor;if(this._settings.overviewRulerLanes===0){this._domNode.setBackgroundColor(e?De.Format.CSS.formatHexA(e):""),this._domNode.setDisplay("none");return}const t=this._context.viewModel.getAllOverviewRulerDecorations(this._context.theme);if(t.sort(OM.compareByRenderingProps),this._actualShouldRender===1&&!OM.equalsArr(this._renderedDecorations,t)&&(this._actualShouldRender=2),this._actualShouldRender===1&&!Qs(this._renderedCursorPositions,this._cursorPositions,(p,m)=>p.lineNumber===m.lineNumber)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,r=this._settings.canvasHeight,o=this._settings.lineHeight,s=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=r/a,c=6*this._settings.pixelRatio|0,u=c/2|0,d=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(d.fillStyle=De.Format.CSS.formatHexA(e),d.fillRect(0,0,i,r)):(d.clearRect(0,0,i,r),d.fillStyle=De.Format.CSS.formatHexA(e),d.fillRect(0,0,i,r)):d.clearRect(0,0,i,r);const h=this._settings.x,g=this._settings.w;for(const p of t){const m=p.color,_=p.data;d.fillStyle=m;let v=0,b=0,y=0;for(let C=0,x=_.length/3;C<x;C++){const k=_[3*C],I=_[3*C+1],L=_[3*C+2];let D=s.getVerticalOffsetForLineNumber(I)*l|0,R=(s.getVerticalOffsetForLineNumber(L)+o)*l|0;if(R-D<c){let M=(D+R)/2|0;M<u?M=u:M+u>r&&(M=r-u),D=M-u,R=M+u}D>y+1||k!==v?(C!==0&&d.fillRect(h[v],b,g[v],y-b),v=k,b=D,y=R):R>y&&(y=R)}d.fillRect(h[v],b,g[v],y-b)}if(!this._settings.hideCursor&&this._settings.cursorColor){const p=2*this._settings.pixelRatio|0,m=p/2|0,_=this._settings.x[7],v=this._settings.w[7];d.fillStyle=this._settings.cursorColor;let b=-100,y=-100;for(let C=0,x=this._cursorPositions.length;C<x;C++){const k=this._cursorPositions[C];let I=s.getVerticalOffsetForLineNumber(k.lineNumber)*l|0;I<m?I=m:I+m>r&&(I=r-m);const L=I-m,D=L+p;L>y+1?(C!==0&&d.fillRect(_,b,v,y-b),b=L,y=D):D>y&&(y=D)}d.fillRect(_,b,v,y-b)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(d.beginPath(),d.lineWidth=1,d.strokeStyle=this._settings.borderColor,d.moveTo(0,0),d.lineTo(0,r),d.stroke(),d.moveTo(0,0),d.lineTo(i,0),d.stroke())}}class XDe{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=i|0}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 Qqe{constructor(e,t,i,r){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=r,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 czi{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(Qqe.compare)}setLineHeight(e){return this._lineHeight===e?!1:(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?!1:(this._domWidth=e,this._colorZonesInvalid=!0,!0)}getDOMHeight(){return this._domHeight}getCanvasHeight(){return this._domHeight*this._pixelRatio}setDOMHeight(e){return this._domHeight===e?!1:(this._domHeight=e,this._colorZonesInvalid=!0,!0)}getOuterHeight(){return this._outerHeight}setOuterHeight(e){return this._outerHeight===e?!1:(this._outerHeight=e,this._colorZonesInvalid=!0,!0)}resolveColorZones(){const e=this._colorZonesInvalid,t=Math.floor(this._lineHeight),i=Math.floor(this.getCanvasHeight()),r=Math.floor(this._outerHeight),o=i/r,s=Math.floor(4*this._pixelRatio/2),a=[];for(let l=0,c=this._zones.length;l<c;l++){const u=this._zones[l];if(!e){const C=u.getColorZones();if(C){a.push(C);continue}}const d=this._getVerticalOffsetForLine(u.startLineNumber),h=u.heightInLines===0?this._getVerticalOffsetForLine(u.endLineNumber)+t:d+u.heightInLines*t,g=Math.floor(o*d),p=Math.floor(o*h);let m=Math.floor((g+p)/2),_=p-m;_<s&&(_=s),m-_<0&&(m=_),m+_>i&&(m=i-_);const v=u.color;let b=this._color2Id[v];b||(b=++this._lastAssignedId,this._color2Id[v]=b,this._id2Color[b]=v);const y=new XDe(m-_,m+_,b);u.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(XDe.compare),a}}class uzi extends C5{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=Or(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new czi(r=>this._context.viewLayout.getVerticalOffsetForLineNumber(r)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(66)),this._zoneManager.setPixelRatio(i.get(141)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(66)&&(this._zoneManager.setLineHeight(t.get(66)),this._render()),e.hasChanged(141)&&(this._zoneManager.setPixelRatio(t.get(141)),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(this._zoneManager.getOuterHeight()===0)return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),r=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,r,e),!0}_renderOneLane(e,t,i,r){let o=0,s=0,a=0;for(const l of t){const c=l.colorId,u=l.from,d=l.to;c!==o?(e.fillRect(0,s,r,a-s),o=c,e.fillStyle=i[o],s=u,a=d):a>=u?a=Math.max(a,d):(e.fillRect(0,s,r,a-s),s=u,a=d)}e.fillRect(0,s,r,a-s)}}class dzi extends ph{constructor(e){super(e),this.domNode=Or(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(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).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:r}=this._context.viewModel.model.getOptions(),o=r;let s=t-e;for(;s>0;){const a=Or(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(o),this.domNode.appendChild(a),this._renderedRulers.push(a),s--}return}let i=e-t;for(;i>0;){const r=this._renderedRulers.pop();this.domNode.removeChild(r),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t<i;t++){const r=this._renderedRulers[t],o=this._rulers[t];r.setBoxShadow(o.color?`1px 0 0 0 ${o.color} inset`:""),r.setHeight(Math.min(e.scrollHeight,1e6)),r.setLeft(o.column*this._typicalHalfwidthCharacterWidth)}}}class hzi extends ph{constructor(e){super(e),this._scrollTop=0,this._width=0,this._updateWidth(),this._shouldShow=!1;const i=this._context.configuration.options.get(102);this._useShadows=i.useShadows,this._domNode=Or(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):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(143);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.verticalScrollbarWidth}onConfigurationChanged(e){const i=this._context.configuration.options.get(102);return this._useShadows=i.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":"")}}class fzi{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class gzi{constructor(e,t){this.lineNumber=e,this.ranges=t}}function pzi(n){return new fzi(n)}function mzi(n){return new gzi(n.lineNumber,n.ranges.map(pzi))}class Ws extends Ok{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).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(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).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,i=e.length;t<i;t++)if(e[t].ranges.length>1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const r=this._typicalHalfwidthCharacterWidth/4;let o=null,s=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!o&&c<i.length;c++)i[c].lineNumber===a&&(o=i[c].ranges[0]);const l=t[t.length-1].lineNumber;if(l===e.endLineNumber)for(let c=i.length-1;!s&&c>=0;c--)i[c].lineNumber===l&&(s=i[c].ranges[0]);o&&!o.startStyle&&(o=null),s&&!s.startStyle&&(s=null)}for(let a=0,l=t.length;a<l;a++){const c=t[a].ranges[0],u=c.left,d=c.left+c.width,h={top:0,bottom:0},g={top:0,bottom:0};if(a>0){const p=t[a-1].ranges[0].left,m=t[a-1].ranges[0].left+t[a-1].ranges[0].width;NB(u-p)<r?h.top=2:u>p&&(h.top=1),NB(d-m)<r?g.top=2:p<d&&d<m&&(g.top=1)}else o&&(h.top=o.startStyle.top,g.top=o.endStyle.top);if(a+1<l){const p=t[a+1].ranges[0].left,m=t[a+1].ranges[0].left+t[a+1].ranges[0].width;NB(u-p)<r?h.bottom=2:p<u&&u<m&&(h.bottom=1),NB(d-m)<r?g.bottom=2:d<m&&(g.bottom=1)}else s&&(h.bottom=s.startStyle.bottom,g.bottom=s.endStyle.bottom);c.startStyle=h,c.endStyle=g}}_getVisibleRangesWithStyle(e,t,i){const o=(t.linesVisibleRangesForRange(e,!0)||[]).map(mzi);return!this._visibleRangesHaveGaps(o)&&this._roundedSelection&&this._enrichVisibleRangesWithStyle(t.visibleRange,o,i),o}_createSelectionPiece(e,t,i,r,o){return'<div class="cslr '+i+'" style="top:'+e.toString()+"px;left:"+r.toString()+"px;width:"+o.toString()+"px;height:"+t+'px;"></div>'}_actualRenderOneSelection(e,t,i,r){if(r.length===0)return;const o=!!r[0].ranges[0].startStyle,s=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),l=r[0].lineNumber,c=r[r.length-1].lineNumber;for(let u=0,d=r.length;u<d;u++){const h=r[u],g=h.lineNumber,p=g-t,m=i&&(g===c||g===l)?a:s,_=i&&g===l?1:0;let v="",b="";for(let y=0,C=h.ranges.length;y<C;y++){const x=h.ranges[y];if(o){const I=x.startStyle,L=x.endStyle;if(I.top===1||I.bottom===1){v+=this._createSelectionPiece(_,m,Ws.SELECTION_CLASS_NAME,x.left-Ws.ROUNDED_PIECE_WIDTH,Ws.ROUNDED_PIECE_WIDTH);let D=Ws.EDITOR_BACKGROUND_CLASS_NAME;I.top===1&&(D+=" "+Ws.SELECTION_TOP_RIGHT),I.bottom===1&&(D+=" "+Ws.SELECTION_BOTTOM_RIGHT),v+=this._createSelectionPiece(_,m,D,x.left-Ws.ROUNDED_PIECE_WIDTH,Ws.ROUNDED_PIECE_WIDTH)}if(L.top===1||L.bottom===1){v+=this._createSelectionPiece(_,m,Ws.SELECTION_CLASS_NAME,x.left+x.width,Ws.ROUNDED_PIECE_WIDTH);let D=Ws.EDITOR_BACKGROUND_CLASS_NAME;L.top===1&&(D+=" "+Ws.SELECTION_TOP_LEFT),L.bottom===1&&(D+=" "+Ws.SELECTION_BOTTOM_LEFT),v+=this._createSelectionPiece(_,m,D,x.left+x.width,Ws.ROUNDED_PIECE_WIDTH)}}let k=Ws.SELECTION_CLASS_NAME;if(o){const I=x.startStyle,L=x.endStyle;I.top===0&&(k+=" "+Ws.SELECTION_TOP_LEFT),I.bottom===0&&(k+=" "+Ws.SELECTION_BOTTOM_LEFT),L.top===0&&(k+=" "+Ws.SELECTION_TOP_RIGHT),L.bottom===0&&(k+=" "+Ws.SELECTION_BOTTOM_RIGHT)}b+=this._createSelectionPiece(_,m,k,x.left,x.width)}e[p][0]+=v,e[p][1]+=b}}prepareRender(e){const t=[],i=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(let s=i;s<=r;s++){const a=s-i;t[a]=["",""]}const o=[];for(let s=0,a=this._selections.length;s<a;s++){const l=this._selections[s];if(l.isEmpty()){o[s]=null;continue}const c=this._getVisibleRangesWithStyle(l,e,this._previousFrameVisibleRangesWithStyle[s]);o[s]=c,this._actualRenderOneSelection(t,i,this._selections.length>1,c)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([s,a])=>s+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}Ws.SELECTION_CLASS_NAME="selected-text";Ws.SELECTION_TOP_LEFT="top-left-radius";Ws.SELECTION_BOTTOM_LEFT="bottom-left-radius";Ws.SELECTION_TOP_RIGHT="top-right-radius";Ws.SELECTION_BOTTOM_RIGHT="bottom-right-radius";Ws.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";Ws.ROUNDED_PIECE_WIDTH=10;rm((n,e)=>{const t=n.getColor(U7i);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function NB(n){return n<0?-n:n}class ZDe{constructor(e,t,i,r,o,s,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=r,this.height=o,this.textContent=s,this.textContentClassName=a}}class JDe{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(50);this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=Or(document.createElement("div")),this._domNode.setClassName(`cursor ${NL}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),mc(this._domNode,i),this._domNode.setDisplay("none"),this._position=new Ce(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,i=t.get(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),mc(this._domNode,i),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[r,o]=A6i(i,t-1);return[new Ce(e,r+1),i.substring(r,o)]}_prepareRender(e){let t="",i="";const[r,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===Hl.Line||this._cursorStyle===Hl.LineThin){const h=e.visibleRangeForPosition(r);if(!h||h.outsideRenderedLine)return null;let g;this._cursorStyle===Hl.Line?(g=ALe(this._lineCursorWidth>0?this._lineCursorWidth:2),g>2&&(t=o,i=this._getTokenClassName(r))):g=ALe(1);let p=h.left,m=0;g>=2&&p>=1&&(m=1,p-=m);const _=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta;return new ZDe(_,p,m,g,this._lineHeight,t,i)}const s=e.linesVisibleRangesForRange(new q(r.lineNumber,r.column,r.lineNumber,r.column+o.length),!1);if(!s||s.length===0)return null;const a=s[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const l=a.ranges[0],c=o===" "?this._typicalHalfwidthCharacterWidth:l.width<1?this._typicalHalfwidthCharacterWidth:l.width;this._cursorStyle===Hl.Block&&(t=o,i=this._getTokenClassName(r));let u=e.getVerticalOffsetForLineNumber(r.lineNumber)-e.bigNumbersDelta,d=this._lineHeight;return(this._cursorStyle===Hl.Underline||this._cursorStyle===Hl.UnderlineThin)&&(u+=this._lineHeight-2,d=2),new ZDe(u,l.left,0,c,d,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}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 ${NL} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),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 KM extends ph{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new JDe(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=Or(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 nm,this._cursorFlatBlinkInterval=new p5,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(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,r=this._secondaryCursors.length;i<r;i++)this._secondaryCursors[i].onConfigurationChanged(e);return!0}_onCursorPositionChanged(e,t,i){const r=this._secondaryCursors.length!==t.length||this._cursorSmoothCaretAnimation==="explicit"&&i!==3;if(this._primaryCursor.onCursorPositionChanged(e,r),this._updateBlinking(),this._secondaryCursors.length<t.length){const o=t.length-this._secondaryCursors.length;for(let s=0;s<o;s++){const a=new JDe(this._context);this._domNode.domNode.insertBefore(a.getDomNode().domNode,this._primaryCursor.getDomNode().domNode.nextSibling),this._secondaryCursors.push(a)}}else if(this._secondaryCursors.length>t.length){const o=this._secondaryCursors.length-t.length;for(let s=0;s<o;s++)this._domNode.removeChild(this._secondaryCursors[0].getDomNode()),this._secondaryCursors.splice(0,1)}for(let o=0;o<t.length;o++)this._secondaryCursors[o].onCursorPositionChanged(t[o],r)}onCursorStateChanged(e){const t=[];for(let r=0,o=e.selections.length;r<o;r++)t[r]=e.selections[r].getPosition();this._onCursorPositionChanged(t[0],t.slice(1),e.reason);const i=e.selections[0].isEmpty();return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,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=i=>{for(let r=0,o=e.ranges.length;r<o;r++)if(e.ranges[r].fromLineNumber<=i.lineNumber&&i.lineNumber<=e.ranges[r].toLineNumber)return!0;return!1};if(t(this._primaryCursor.getPosition()))return!0;for(const i of this._secondaryCursors)if(t(i.getPosition()))return!0;return!1}onZonesChanged(e){return!0}_getCursorBlinking(){return this._isComposingInput||!this._editorHasFocus?0:this._readOnly?5:this._cursorBlinking}_updateBlinking(){this._startCursorBlinkAnimation.cancel(),this._cursorFlatBlinkInterval.cancel();const e=this._getCursorBlinking(),t=e===0,i=e===5;t?this._hide():this._show(),this._blinkingEnabled=!1,this._updateDomClassName(),!t&&!i&&(e===1?this._cursorFlatBlinkInterval.cancelAndSet(()=>{this._isVisible?this._hide():this._show()},KM.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},KM.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case Hl.Line:e+=" cursor-line-style";break;case Hl.Block:e+=" cursor-block-style";break;case Hl.Underline:e+=" cursor-underline-style";break;case Hl.LineThin:e+=" cursor-line-thin-style";break;case Hl.BlockOutline:e+=" cursor-block-outline-style";break;case Hl.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;case 5:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return(this._cursorSmoothCaretAnimation==="on"||this._cursorSmoothCaretAnimation==="explicit")&&(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,i=this._secondaryCursors.length;t<i;t++)this._secondaryCursors[t].prepareRender(e)}render(e){const t=[];let i=0;const r=this._primaryCursor.render(e);r&&(t[i++]=r);for(let o=0,s=this._secondaryCursors.length;o<s;o++){const a=this._secondaryCursors[o].render(e);a&&(t[i++]=a)}this._renderData=t}getLastRenderData(){return this._renderData}}KM.BLINK_INTERVAL=500;rm((n,e)=>{const t=n.getColor(Rqe);if(t){let i=n.getColor(NHi);i||(i=t.opposite()),e.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${t}; border-color: ${t}; color: ${i}; }`),m_(n.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${i}; border-right: 1px solid ${i}; }`)}});const IZ=()=>{throw new Error("Invalid change accessor")};class _zi extends ph{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._lineHeight=t.get(66),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=Or(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=Or(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 r of e)t.set(r.id,r);let i=!1;return this._context.viewModel.changeWhitespace(r=>{const o=Object.keys(this._zones);for(let s=0,a=o.length;s<a;s++){const l=o[s],c=this._zones[l],u=this._computeWhitespaceProps(c.delegate);c.isInHiddenArea=u.isInHiddenArea;const d=t.get(l);d&&(d.afterLineNumber!==u.afterViewLineNumber||d.height!==u.heightInPx)&&(r.changeOneWhitespace(l,u.afterViewLineNumber,u.heightInPx),this._safeCallOnComputedHeight(c.delegate,u.heightInPx),i=!0)}}),i}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._lineHeight=t.get(66),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,e.hasChanged(66)&&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){var t,i;return(i=(t=e.ordinal)!==null&&t!==void 0?t:e.afterColumn)!==null&&i!==void 0?i:1e4}_computeWhitespaceProps(e){if(e.afterLineNumber===0)return{isInHiddenArea:!1,afterViewLineNumber:0,heightInPx:this._heightInPixels(e),minWidthInPx:this._minWidthInPixels(e)};let t;if(typeof e.afterColumn<"u")t=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:e.afterColumn});else{const s=this._context.viewModel.model.validatePosition({lineNumber:e.afterLineNumber,column:1}).lineNumber;t=new Ce(s,this._context.viewModel.model.getLineMaxColumn(s))}let i;t.column===this._context.viewModel.model.getLineMaxColumn(t.lineNumber)?i=this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber+1,column:1}):i=this._context.viewModel.model.validatePosition({lineNumber:t.lineNumber,column:t.column+1});const r=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t,e.afterColumnAffinity,!0),o=e.showInHiddenAreas||this._context.viewModel.coordinatesConverter.modelPositionIsVisible(i);return{isInHiddenArea:!o,afterViewLineNumber:r.lineNumber,heightInPx:o?this._heightInPixels(e):0,minWidthInPx:this._minWidthInPixels(e)}}changeViewZones(e){let t=!1;return this._context.viewModel.changeWhitespace(i=>{const r={addZone:o=>(t=!0,this._addZone(i,o)),removeZone:o=>{o&&(t=this._removeZone(i,o)||t)},layoutZone:o=>{o&&(t=this._layoutZone(i,o)||t)}};vzi(e,r),r.addZone=IZ,r.removeZone=IZ,r.layoutZone=IZ}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:Or(t.domNode),marginDomNode:t.marginDomNode?Or(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,i.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],r=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=r.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,r.afterViewLineNumber,r.heightInPx),this._safeCallOnComputedHeight(i.delegate,r.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(t)}catch(i){fi(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){fi(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let r=!1;for(const s of t)this._zones[s.id].isInHiddenArea||(i[s.id]=s,r=!0);const o=Object.keys(this._zones);for(let s=0,a=o.length;s<a;s++){const l=o[s],c=this._zones[l];let u=0,d=0,h="none";i.hasOwnProperty(l)?(u=i[l].verticalOffset-e.bigNumbersDelta,d=i[l].height,h="block",c.isVisible||(c.domNode.setAttribute("monaco-visible-view-zone","true"),c.isVisible=!0),this._safeCallOnDomNodeTop(c.delegate,e.getScrolledTopFromAbsoluteTop(i[l].verticalOffset))):(c.isVisible&&(c.domNode.removeAttribute("monaco-visible-view-zone"),c.isVisible=!1),this._safeCallOnDomNodeTop(c.delegate,e.getScrolledTopFromAbsoluteTop(-1e6))),c.domNode.setTop(u),c.domNode.setHeight(d),c.domNode.setDisplay(h),c.marginDomNode&&(c.marginDomNode.setTop(u),c.marginDomNode.setHeight(d),c.marginDomNode.setDisplay(h))}r&&(this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth)),this.marginDomNode.setWidth(this._contentLeft))}}function vzi(n,e){try{return n(e)}catch(t){fi(t)}}class bzi{get type(){return this._theme.type}get value(){return this._theme}constructor(e){this._theme=e}update(e){this._theme=e}getColor(e){return this._theme.getColor(e)}}class yzi{constructor(e,t,i){this.configuration=e,this.theme=new bzi(t),this.viewModel=i,this.viewLayout=i.viewLayout}addEventHandler(e){this.viewModel.addViewEventHandler(e)}removeEventHandler(e){this.viewModel.removeViewEventHandler(e)}}class Czi{constructor(e,t,i,r){this.selections=e,this.startLineNumber=t.startLineNumber|0,this.endLineNumber=t.endLineNumber|0,this.relativeVerticalOffset=t.relativeVerticalOffset,this.bigNumbersDelta=t.bigNumbersDelta|0,this.whitespaceViewportData=i,this._model=r,this.visibleRange=new q(t.startLineNumber,this._model.getLineMinColumn(t.startLineNumber),t.endLineNumber,this._model.getLineMaxColumn(t.endLineNumber))}getViewLineRenderingData(e){return this._model.getViewportViewLineRenderingData(this.visibleRange,e)}getDecorationsInViewport(){return this._model.getDecorationsInViewport(this.visibleRange)}}class wzi extends ph{constructor(e){super(e),this.blocks=[],this.contentWidth=-1,this.contentLeft=0,this.domNode=Or(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("blockDecorations-container"),this.update()}update(){let e=!1;const i=this._context.configuration.options.get(143),r=i.contentWidth-i.verticalScrollbarWidth;this.contentWidth!==r&&(this.contentWidth=r,e=!0);const o=i.contentLeft;return this.contentLeft!==o&&(this.contentLeft=o,e=!0),e}dispose(){super.dispose()}onConfigurationChanged(e){return this.update()}onScrollChanged(e){return e.scrollTopChanged||e.scrollLeftChanged}onDecorationsChanged(e){return!0}onZonesChanged(e){return!0}prepareRender(e){}render(e){var t;let i=0;const r=e.getDecorationsInViewport();for(const o of r){if(!o.options.blockClassName)continue;let s=this.blocks[i];s||(s=this.blocks[i]=Or(document.createElement("div")),this.domNode.appendChild(s));let a,l;o.options.blockIsAfterEnd?(a=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!1),l=e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0)):(a=e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!0),l=o.range.isEmpty()&&!o.options.blockDoesNotCollapse?e.getVerticalOffsetForLineNumber(o.range.startLineNumber,!1):e.getVerticalOffsetAfterLineNumber(o.range.endLineNumber,!0));const[c,u,d,h]=(t=o.options.blockPadding)!==null&&t!==void 0?t:[0,0,0,0];s.setClassName("blockDecorations-block "+o.options.blockClassName),s.setLeft(this.contentLeft-h),s.setWidth(this.contentWidth+h+u),s.setTop(a-e.scrollTop-c),s.setHeight(l-a+c+d),i++}for(let o=i;o<this.blocks.length;o++)this.blocks[o].domNode.remove();this.blocks.length=i}}class Szi extends Ok{constructor(e){super(),this._context=e,this._options=new e2e(this._context.configuration),this._selection=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=new e2e(this._context.configuration);return this._options.equals(t)?e.hasChanged(143):(this._options=t,!0)}onCursorStateChanged(e){return this._selection=e.selections,this._options.renderWhitespace==="selection"}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}prepareRender(e){if(this._options.renderWhitespace==="none"){this._renderResult=null;return}const t=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber-t+1,o=new Array(r);for(let a=0;a<r;a++)o[a]=!0;const s=this._context.viewModel.getMinimapLinesRenderingData(e.viewportData.startLineNumber,e.viewportData.endLineNumber,o);this._renderResult=[];for(let a=e.viewportData.startLineNumber;a<=e.viewportData.endLineNumber;a++){const l=a-e.viewportData.startLineNumber,c=s.data[l];let u=null;if(this._options.renderWhitespace==="selection"){const d=this._selection;for(const h of d){if(h.endLineNumber<a||h.startLineNumber>a)continue;const g=h.startLineNumber===a?h.startColumn:c.minColumn,p=h.endLineNumber===a?h.endColumn:c.maxColumn;g<p&&(u||(u=[]),u.push(new oqe(g-1,p-1)))}}this._renderResult[l]=this._applyRenderWhitespace(e,a,u,c)}}_applyRenderWhitespace(e,t,i,r){if(this._options.renderWhitespace==="selection"&&!i||this._options.renderWhitespace==="trailing"&&r.continuesWithWrappedLine)return"";const o=this._context.theme.getColor(Hy),s=this._options.renderWithSVG,a=r.content,l=this._options.stopRenderingLineAfter===-1?a.length:Math.min(this._options.stopRenderingLineAfter,a.length),c=r.continuesWithWrappedLine,u=r.minColumn-1,d=this._options.renderWhitespace==="boundary",h=this._options.renderWhitespace==="trailing",g=this._options.lineHeight,p=this._options.middotWidth,m=this._options.wsmiddotWidth,_=this._options.spaceWidth,v=Math.abs(m-_),b=Math.abs(p-_),y=v<b?11825:183,C=this._options.canUseHalfwidthRightwardsArrow;let x="",k=!1,I=cu(a),L;I===-1?(k=!0,I=l,L=l):L=g_(a);let D=0,R=i&&i[D],P=0;for(let M=u;M<l;M++){const O=a.charCodeAt(M);if(R&&M>=R.endOffset&&(D++,R=i&&i[D]),O!==9&&O!==32||h&&!k&&M<=L)continue;if(d&&M>=I&&M<=L&&O===32){const F=M-1>=0?a.charCodeAt(M-1):0,H=M+1<l?a.charCodeAt(M+1):0;if(F!==32&&H!==32)continue}if(d&&c&&M===l-1){const F=M-1>=0?a.charCodeAt(M-1):0;if(O===32&&F!==32&&F!==9)continue}if(i&&(!R||R.startOffset>M||R.endOffset<=M))continue;const B=e.visibleRangeForPosition(new Ce(t,M+1));B&&(s?(P=Math.max(P,B.left),O===9?x+=this._renderArrow(g,_,B.left):x+=`<circle cx="${(B.left+_/2).toFixed(2)}" cy="${(g/2).toFixed(2)}" r="${(_/7).toFixed(2)}" />`):O===9?x+=`<div class="mwh" style="left:${B.left}px;height:${g}px;">${C?String.fromCharCode(65515):String.fromCharCode(8594)}</div>`:x+=`<div class="mwh" style="left:${B.left}px;height:${g}px;">${String.fromCharCode(y)}</div>`)}return s?(P=Math.round(P+_),`<svg style="position:absolute;width:${P}px;height:${g}px" viewBox="0 0 ${P} ${g}" xmlns="http://www.w3.org/2000/svg" fill="${o}">`+x+"</svg>"):x}_renderArrow(e,t,i){const r=t/7,o=t,s=e/2,a=i,l={x:0,y:r/2},c={x:100/125*o,y:l.y},u={x:c.x-.2*c.x,y:c.y+.2*c.x},d={x:u.x+.1*c.x,y:u.y+.1*c.x},h={x:d.x+.35*c.x,y:d.y-.35*c.x},g={x:h.x,y:-h.y},p={x:d.x,y:-d.y},m={x:u.x,y:-u.y},_={x:c.x,y:-c.y},v={x:l.x,y:-l.y};return`<path d="M ${[l,c,u,d,h,g,p,m,_,v].map(C=>`${(a+C.x).toFixed(2)} ${(s+C.y).toFixed(2)}`).join(" L ")}" />`}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class e2e{constructor(e){const t=e.options,i=t.get(50),r=t.get(38);r==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):r==="svg"?(this.renderWhitespace=t.get(98),this.renderWithSVG=!0):(this.renderWhitespace=t.get(98),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(66),this.stopRenderingLineAfter=t.get(116)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}var Ezi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},xzi=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let kse=class extends C5{constructor(e,t,i,r,o,s,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new ln(1,1,1,1)],this._renderAnimationFrame=null;const l=new RWi(t,r,o,e);this._context=new yzi(t,i,r),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(Sse,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=Or(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=Or(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=Or(document.createElement("div")),ub.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new HWi(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new dq(this._context,this._linesContent),this._viewZones=new _zi(this._context),this._viewParts.push(this._viewZones);const c=new lzi(this._context);this._viewParts.push(c);const u=new hzi(this._context);this._viewParts.push(u);const d=new OWi(this._context);this._viewParts.push(d),d.addDynamicOverlay(new BWi(this._context)),d.addDynamicOverlay(new Ws(this._context)),d.addDynamicOverlay(new zWi(this._context)),d.addDynamicOverlay(new VWi(this._context)),d.addDynamicOverlay(new Szi(this._context));const h=new PWi(this._context);this._viewParts.push(h),h.addDynamicOverlay(new $Wi(this._context)),h.addDynamicOverlay(new ezi(this._context)),h.addDynamicOverlay(new JWi(this._context)),h.addDynamicOverlay(new k5(this._context)),this._glyphMarginWidgets=new YWi(this._context),this._viewParts.push(this._glyphMarginWidgets);const g=new Mx(this._context);g.getDomNode().appendChild(this._viewZones.marginDomNode),g.getDomNode().appendChild(h.getDomNode()),g.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(g),this._contentWidgets=new MWi(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new KM(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new szi(this._context),this._viewParts.push(this._overlayWidgets);const p=new dzi(this._context);this._viewParts.push(p);const m=new wzi(this._context);this._viewParts.push(m);const _=new ozi(this._context);if(this._viewParts.push(_),c){const v=this._scrollbar.getOverviewRulerLayoutInfo();v.parent.insertBefore(c.getDomNode(),v.insertBefore)}this._linesContent.appendChild(d.getDomNode()),this._linesContent.appendChild(p.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(g.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(u.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(_.getDomNode()),this._overflowGuardContainer.appendChild(m.domNode),this.domNode.appendChild(this._overflowGuardContainer),s?s.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new DHi(this._context,l,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._shouldRecomputeGlyphMarginLanes&&(this._shouldRecomputeGlyphMarginLanes=!1,this._context.configuration.setGlyphMarginDecorationLaneCount(this._computeGlyphMarginLaneCount())),J1.onRenderStart(),this._renderNow()}_computeGlyphMarginLaneCount(){const e=this._context.viewModel.model;let t=[];t=t.concat(e.getAllMarginDecorations().map(o=>{var s,a;const l=(a=(s=o.options.glyphMargin)===null||s===void 0?void 0:s.position)!==null&&a!==void 0?a:LL.Left;return{range:o.range,lane:l}})),t=t.concat(this._glyphMarginWidgets.getWidgets().map(o=>({range:e.validateRange(o.preference.range),lane:o.preference.lane}))),t.sort((o,s)=>q.compareRangesUsingStarts(o.range,s.range));let i=null,r=null;for(const o of t)if(o.lane===LL.Left&&(!i||q.compareRangesUsingEnds(i,o.range)<0)&&(i=o.range),o.lane===LL.Right&&(!r||q.compareRangesUsingEnds(r,o.range)<0)&&(r=o.range),i&&r){if(i.endLineNumber<r.startLineNumber){i=null;continue}if(r.endLineNumber<i.startLineNumber){r=null;continue}return 2}return 1}_createPointerHandlerHelper(){return{viewDomNode:this.domNode.domNode,linesContentDomNode:this._linesContent.domNode,viewLinesDomNode:this._viewLines.getDomNode().domNode,focusTextArea:()=>{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new aHi(e,t)},renderNow:()=>{this.render(!0,!1)},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 Ce(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const t=this._context.configuration.options.get(143);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(140)+" "+wse(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}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!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(){this._renderAnimationFrame!==null&&(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(){this._renderAnimationFrame===null&&(this._renderAnimationFrame=NV(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){kzi(()=>this._actualRender())}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!Vme(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new Czi(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const r=new eHi(this._context.viewLayout,i,this._viewLines);for(const o of e)o.prepareRender(r);for(const o of e)o.render(r),o.onDidRender()}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),r=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new Ce(r.lineNumber,r.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?cq.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new uzi(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const i of this._viewParts)i.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}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){var t,i,r,o,s,a,l,c;this._contentWidgets.setWidgetPosition(e.widget,(i=(t=e.position)===null||t===void 0?void 0:t.position)!==null&&i!==void 0?i:null,(o=(r=e.position)===null||r===void 0?void 0:r.secondaryPosition)!==null&&o!==void 0?o:null,(a=(s=e.position)===null||s===void 0?void 0:s.preference)!==null&&a!==void 0?a:null,(c=(l=e.position)===null||l===void 0?void 0:l.positionAffinity)!==null&&c!==void 0?c:null),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()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};kse=Ezi([xzi(6,Un)],kse);function kzi(n){try{return n()}catch(e){fi(e)}}class Xqe{constructor(e,t,i,r,o,s){this.id=e,this.label=t,this.alias=i,this._precondition=r,this._run=o,this._contextKeyService=s}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function pw(n){let e=0,t=0,i=0,r=0;for(let o=0,s=n.length;o<s;o++){const a=n.charCodeAt(o);a===13?(e===0&&(t=o),e++,o+1<s&&n.charCodeAt(o+1)===10?(r|=2,o++):r|=3,i=o+1):a===10&&(r|=1,e===0&&(t=o),e++,i=o+1)}return e===0&&(t=n.length),[e,t,n.length-i,r]}class t2e{constructor(e,t,i,r){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=i,this.isInvalid=r}}class Tzi{constructor(e,t,i,r,o,s){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=r,this.nestingLevelOfEqualBracketType=o,this.bracketPairNode=s}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}class Izi extends Tzi{constructor(e,t,i,r,o,s,a){super(e,t,i,r,o,s),this.minVisibleColumnIndentation=a}}class GM{constructor(e,t){this.lineCount=e,this.columnCount=t}toString(){return`${this.lineCount},${this.columnCount}`}}GM.zero=new GM(0,0);function Lzi(n,e,t,i){return n!==t?ia(t-n,i):ia(0,i-e)}const zu=0;function tH(n){return n===0}const Yh=Math.pow(2,26);function ia(n,e){return n*Yh+e}function pg(n){const e=n,t=Math.floor(e/Yh),i=e-t*Yh;return new GM(t,i)}function Dzi(n){return Math.floor(n/Yh)}function _s(n,e){let t=n+e;return e>=Yh&&(t=t-n%Yh),t}function Azi(n,e){return n.reduce((t,i)=>_s(t,e(i)),zu)}function Zqe(n,e){return n===e}function YM(n,e){const t=n,i=e;if(i-t<=0)return zu;const o=Math.floor(t/Yh),s=Math.floor(i/Yh),a=i-s*Yh;if(o===s){const l=t-o*Yh;return ia(0,a-l)}else return ia(s-o,a)}function ML(n,e){return n<e}function FL(n,e){return n<=e}function ON(n,e){return n>=e}function KI(n){return ia(n.lineNumber-1,n.column-1)}function ex(n,e){const t=n,i=Math.floor(t/Yh),r=t-i*Yh,o=e,s=Math.floor(o/Yh),a=o-s*Yh;return new q(i+1,r+1,s+1,a+1)}function Rzi(n){const e=ab(n);return ia(e.length-1,e[e.length-1].length)}class Wy{static fromModelContentChanges(e){return e.map(i=>{const r=q.lift(i.range);return new Wy(KI(r.getStartPosition()),KI(r.getEndPosition()),Rzi(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${pg(this.startOffset)}...${pg(this.endOffset)}) -> ${pg(this.newLength)}`}}class Nzi{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>__e.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return i===null?null:YM(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?ia(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):ia(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=pg(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?ia(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):ia(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx<this.edits.length;){const t=this.edits[this.nextEditIdx],i=this.translateOldToCur(t.endOffsetAfterObj);if(FL(i,e)){this.nextEditIdx++;const r=pg(i),o=pg(this.translateOldToCur(t.endOffsetBeforeObj)),s=r.lineCount-o.lineCount;this.deltaOldToNewLineCount+=s;const a=this.deltaLineIdxInOld===t.endOffsetBeforeObj.lineCount?this.deltaOldToNewColumnCount:0,l=r.columnCount-o.columnCount;this.deltaOldToNewColumnCount=a+l,this.deltaLineIdxInOld=t.endOffsetBeforeObj.lineCount}else break}}}class __e{static from(e){return new __e(e.startOffset,e.endOffset,e.newLength)}constructor(e,t,i){this.endOffsetBeforeObj=pg(t),this.endOffsetAfterObj=pg(_s(e,i)),this.offsetObj=pg(e)}}const V8=[];class Aa{static create(e,t){if(e<=128&&t.length===0){let i=Aa.cache[e];return i||(i=new Aa(e,t),Aa.cache[e]=i),i}return new Aa(e,t)}static getEmpty(){return this.empty}constructor(e,t){this.items=e,this.additionalItems=t}add(e,t){const i=t.getKey(e);let r=i>>5;if(r===0){const s=1<<i|this.items;return s===this.items?this:Aa.create(s,this.additionalItems)}r--;const o=this.additionalItems.slice(0);for(;o.length<r;)o.push(0);return o[r]|=1<<(i&31),Aa.create(this.items,o)}merge(e){const t=this.items|e.items;if(this.additionalItems===V8&&e.additionalItems===V8)return t===this.items?this:t===e.items?e:Aa.create(t,V8);const i=[];for(let r=0;r<Math.max(this.additionalItems.length,e.additionalItems.length);r++){const o=this.additionalItems[r]||0,s=e.additionalItems[r]||0;i.push(o|s)}return Aa.create(t,i)}intersects(e){if(this.items&e.items)return!0;for(let t=0;t<Math.min(this.additionalItems.length,e.additionalItems.length);t++)if(this.additionalItems[t]&e.additionalItems[t])return!0;return!1}}Aa.cache=new Array(129);Aa.empty=Aa.create(0,V8);const n2e={getKey(n){return n}};class Jqe{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return t===void 0&&(t=this.items.size,this.items.set(e,t)),t}}class v_e{get length(){return this._length}constructor(e){this._length=e}}class QM extends v_e{static create(e,t,i){let r=e.length;return t&&(r=_s(r,t.length)),i&&(r=_s(r,i.length)),new QM(r,e,t,i,t?t.missingOpeningBracketIds:Aa.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=[];return e.push(this.openingBracket),this.child&&e.push(this.child),this.closingBracket&&e.push(this.closingBracket),e}constructor(e,t,i,r,o){super(e),this.openingBracket=t,this.child=i,this.closingBracket=r,this.missingOpeningBracketIds=o}canBeReused(e){return!(this.closingBracket===null||e.intersects(this.missingOpeningBracketIds))}deepClone(){return new QM(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(_s(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class db extends v_e{static create23(e,t,i,r=!1){let o=e.length,s=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(o=_s(o,t.length),s=s.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");o=_s(o,i.length),s=s.merge(i.missingOpeningBracketIds)}return r?new Ozi(o,e.listHeight+1,e,t,i,s):new XM(o,e.listHeight+1,e,t,i,s)}static getEmpty(){return new Pzi(zu,0,[],Aa.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}constructor(e,t,i){super(e),this.listHeight=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();const e=this.childrenLength;if(e===0)return;const t=this.getChild(e-1),i=t.kind===4?t.toMutable():t;return t!==i&&this.setChild(e-1,i),i}makeFirstElementMutable(){if(this.throwIfImmutable(),this.childrenLength===0)return;const t=this.getChild(0),i=t.kind===4?t.toMutable():t;return t!==i&&this.setChild(0,i),i}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds)||this.childrenLength===0)return!1;let t=this;for(;t.kind===4;){const i=t.childrenLength;if(i===0)throw new ya;t=t.getChild(i-1)}return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let t=this.getChild(0).length,i=this.getChild(0).missingOpeningBracketIds;for(let r=1;r<e;r++){const o=this.getChild(r);t=_s(t,o.length),i=i.merge(o.missingOpeningBracketIds)}this._length=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}computeMinIndentation(e,t){if(this.cachedMinIndentation!==-1)return this.cachedMinIndentation;let i=Number.MAX_SAFE_INTEGER,r=e;for(let o=0;o<this.childrenLength;o++){const s=this.getChild(o);s&&(i=Math.min(i,s.computeMinIndentation(r,t)),r=_s(r,s.length))}return this.cachedMinIndentation=i,i}}class XM extends db{get childrenLength(){return this._item3!==null?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:this._item1=t;return;case 1:this._item2=t;return;case 2:this._item3=t;return}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}constructor(e,t,i,r,o,s){super(e,t,s),this._item1=i,this._item2=r,this._item3=o}deepClone(){return new XM(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 Ozi extends XM{toMutable(){return new XM(this.length,this.listHeight,this.item1,this.item2,this.item3,this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}class nH extends db{get childrenLength(){return this._children.length}getChild(e){return this._children[e]}setChild(e,t){this._children[e]=t}get children(){return this._children}constructor(e,t,i,r){super(e,t,r),this._children=i}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 nH(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 Pzi extends nH{toMutable(){return new nH(this.length,this.listHeight,[...this.children],this.missingOpeningBracketIds)}throwIfImmutable(){throw new Error("this instance is immutable")}}const Mzi=[];class b_e extends v_e{get listHeight(){return 0}get childrenLength(){return 0}getChild(e){return null}get children(){return Mzi}deepClone(){return this}}class uE extends b_e{get kind(){return 0}get missingOpeningBracketIds(){return Aa.getEmpty()}canBeReused(e){return!0}computeMinIndentation(e,t){const i=pg(e),r=(i.columnCount===0?i.lineCount:i.lineCount+1)+1,o=Dzi(_s(e,this.length))+1;let s=Number.MAX_SAFE_INTEGER;for(let a=r;a<=o;a++){const l=t.getLineFirstNonWhitespaceColumn(a),c=t.getLineContent(a);if(l===0)continue;const u=Va.visibleColumnFromColumn(c,l,t.getOptions().tabSize);s=Math.min(s,u)}return s}}class iH extends b_e{static create(e,t,i){return new iH(e,t,i)}get kind(){return 1}get missingOpeningBracketIds(){return Aa.getEmpty()}constructor(e,t,i){super(e),this.bracketInfo=t,this.bracketIds=i}get text(){return this.bracketInfo.bracketText}get languageId(){return this.bracketInfo.languageId}canBeReused(e){return!1}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}class Fzi extends b_e{get kind(){return 3}constructor(e,t){super(t),this.missingOpeningBracketIds=e}canBeReused(e){return!e.intersects(this.missingOpeningBracketIds)}computeMinIndentation(e,t){return Number.MAX_SAFE_INTEGER}}let P1=class{constructor(e,t,i,r,o){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=r,this.astNode=o}};class eKe{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new Bzi(this.textModel,this.bracketTokens),this._offset=zu,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return ia(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=_s(this._offset,e);const t=pg(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=_s(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class Bzi{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.line!==null&&(this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const o=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=o.length,o}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const o=this.lineTokens,s=o.getCount();let a=null;if(this.lineTokenOffset<s){const l=o.getMetadata(this.lineTokenOffset);for(;this.lineTokenOffset+1<s&&l===o.getMetadata(this.lineTokenOffset+1);)this.lineTokenOffset++;const c=dc.getTokenType(l)===0,u=dc.containsBalancedBrackets(l),d=o.getEndOffset(this.lineTokenOffset);if(u&&c&&this.lineCharOffset<d){const h=o.getLanguageId(this.lineTokenOffset),g=this.line.substring(this.lineCharOffset,d),p=this.bracketTokens.getSingleLanguageBracketTokens(h),m=p.regExpGlobal;if(m){m.lastIndex=0;const _=m.exec(g);_&&(a=p.getToken(_[0]),a&&(this.lineCharOffset+=_.index))}}if(i+=d-this.lineCharOffset,a)if(e!==this.lineIdx||t!==this.lineCharOffset){this.peekedToken=a;break}else return this.lineCharOffset+=a.length,a;else this.lineTokenOffset++,this.lineCharOffset=d}else if(this.lineIdx===this.textBufferLineCount-1||(this.lineIdx++,this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.lineTokenOffset=0,this.line=this.lineTokens.getLineContent(),this.lineCharOffset=0,i+=33,i>1e3))break;if(i>1500)break}const r=Lzi(e,t,this.lineIdx,this.lineCharOffset);return new P1(r,0,-1,Aa.getEmpty(),new uE(r))}}class $zi{constructor(e,t){this.text=e,this._offset=zu,this.idx=0;const i=t.getRegExpStr(),r=i?new RegExp(i+`|
`,"gi"):null,o=[];let s,a=0,l=0,c=0,u=0;const d=[];for(let p=0;p<60;p++)d.push(new P1(ia(0,p),0,-1,Aa.getEmpty(),new uE(ia(0,p))));const h=[];for(let p=0;p<60;p++)h.push(new P1(ia(1,p),0,-1,Aa.getEmpty(),new uE(ia(1,p))));if(r)for(r.lastIndex=0;(s=r.exec(e))!==null;){const p=s.index,m=s[0];if(m===`
`)a++,l=p+1;else{if(c!==p){let _;if(u===a){const v=p-c;if(v<d.length)_=d[v];else{const b=ia(0,v);_=new P1(b,0,-1,Aa.getEmpty(),new uE(b))}}else{const v=a-u,b=p-l;if(v===1&&b<h.length)_=h[b];else{const y=ia(v,b);_=new P1(y,0,-1,Aa.getEmpty(),new uE(y))}}o.push(_)}o.push(t.getToken(m)),c=p+m.length,u=a}}const g=e.length;if(c!==g){const p=u===a?ia(0,g-c):ia(a-u,g-l);o.push(new P1(p,0,-1,Aa.getEmpty(),new uE(p)))}this.length=ia(a,g-l),this.tokens=o}get offset(){return this._offset}read(){return this.tokens[this.idx++]||null}peek(){return this.tokens[this.idx]||null}skip(e){throw new HFi}}class y_e{static createFromLanguage(e,t){function i(o){return t.getKey(`${o.languageId}:::${o.bracketText}`)}const r=new Map;for(const o of e.bracketsNew.openingBrackets){const s=ia(0,o.bracketText.length),a=i(o),l=Aa.getEmpty().add(a,n2e);r.set(o.bracketText,new P1(s,1,a,l,iH.create(s,o,l)))}for(const o of e.bracketsNew.closingBrackets){const s=ia(0,o.bracketText.length);let a=Aa.getEmpty();const l=o.getOpeningBrackets();for(const c of l)a=a.add(i(c),n2e);r.set(o.bracketText,new P1(s,2,i(l[0]),a,iH.create(s,o,a)))}return new y_e(r)}constructor(e){this.map=e,this.hasRegExp=!1,this._regExpGlobal=null}getRegExpStr(){if(this.isEmpty)return null;{const e=[...this.map.keys()];return e.sort(),e.reverse(),e.map(t=>Vzi(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(i.kind===2&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function Vzi(n){let e=hf(n);return/^[\w ]+/.test(n)&&(e=`\\b${e}`),/[\w ]+$/.test(n)&&(e=`${e}\\b`),e}class tKe{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=y_e.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function Hzi(n){if(n.length===0)return null;if(n.length===1)return n[0];let e=0;function t(){if(e>=n.length)return null;const s=e,a=n[s].listHeight;for(e++;e<n.length&&n[e].listHeight===a;)e++;return e-s>=2?nKe(s===0&&e===n.length?n:n.slice(s,e),!1):n[s]}let i=t(),r=t();if(!r)return i;for(let s=t();s;s=t())i2e(i,r)<=i2e(r,s)?(i=LZ(i,r),r=s):r=LZ(r,s);return LZ(i,r)}function nKe(n,e=!1){if(n.length===0)return null;if(n.length===1)return n[0];let t=n.length;for(;t>3;){const i=t>>1;for(let r=0;r<i;r++){const o=r<<1;n[r]=db.create23(n[o],n[o+1],o+3===t?n[o+2]:null,e)}t=i}return db.create23(n[0],n[1],t>=3?n[2]:null,e)}function i2e(n,e){return Math.abs(n.listHeight-e.listHeight)}function LZ(n,e){return n.listHeight===e.listHeight?db.create23(n,e,null,!1):n.listHeight>e.listHeight?Wzi(n,e):zzi(e,n)}function Wzi(n,e){n=n.toMutable();let t=n;const i=[];let r;for(;;){if(e.listHeight===t.listHeight){r=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let o=i.length-1;o>=0;o--){const s=i[o];r?s.childrenLength>=3?r=db.create23(s.unappendChild(),r,null,!1):(s.appendChildOfSameHeight(r),r=void 0):s.handleChildrenChanged()}return r?db.create23(n,r,null,!1):n}function zzi(n,e){n=n.toMutable();let t=n;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let r=e;for(let o=i.length-1;o>=0;o--){const s=i[o];r?s.childrenLength>=3?r=db.create23(r,s.unprependChild(),null,!1):(s.prependChildOfSameHeight(r),r=void 0):s.handleChildrenChanged()}return r?db.create23(r,n,null,!1):n}class jzi{constructor(e){this.lastOffset=zu,this.nextNodes=[e],this.offsets=[zu],this.idxs=[]}readLongestNodeAt(e,t){if(ML(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=jR(this.nextNodes);if(!i)return;const r=jR(this.offsets);if(ML(e,r))return;if(ML(r,e))if(_s(r,i.length)<=e)this.nextNodeAfterCurrent();else{const o=DZ(i);o!==-1?(this.nextNodes.push(i.getChild(o)),this.offsets.push(r),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const o=DZ(i);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(o)),this.offsets.push(r),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=jR(this.offsets),t=jR(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=jR(this.nextNodes),r=DZ(i,this.idxs[this.idxs.length-1]);if(r!==-1){this.nextNodes.push(i.getChild(r)),this.offsets.push(_s(e,t.length)),this.idxs[this.idxs.length-1]=r;break}else this.idxs.pop()}}}function DZ(n,e=-1){for(;;){if(e++,e>=n.childrenLength)return-1;if(n.getChild(e))return e}}function jR(n){return n.length>0?n[n.length-1]:void 0}function Tse(n,e,t,i){return new Uzi(n,e,t,i).parseDocument()}class Uzi{constructor(e,t,i,r){if(this.tokenizer=e,this.createImmutableLists=r,this._itemsConstructed=0,this._itemsFromCache=0,i&&r)throw new Error("Not supported");this.oldNodeReader=i?new jzi(i):void 0,this.positionMapper=new Nzi(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Aa.getEmpty(),0);return e||(e=db.getEmpty()),e}parseList(e,t){const i=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const s=this.tokenizer.peek();if(!s||s.kind===2&&s.bracketIds.intersects(e))break;o=this.parseChild(e,t+1)}o.kind===4&&o.childrenLength===0||i.push(o)}return this.oldNodeReader?Hzi(i):nKe(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!tH(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),r=>t!==null&&!ML(r.length,t)?!1:r.canBeReused(e));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;const i=this.tokenizer.read();switch(i.kind){case 2:return new Fzi(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new uE(i.length);const r=e.merge(i.bracketIds),o=this.parseList(r,t+1),s=this.tokenizer.peek();return s&&s.kind===2&&(s.bracketId===i.bracketId||s.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),QM.create(i.astNode,o,s.astNode)):QM.create(i.astNode,o,null)}default:throw new Error("unexpected")}}}function rH(n,e){if(n.length===0)return e;if(e.length===0)return n;const t=new v0(r2e(n)),i=r2e(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let r=t.dequeue();function o(c){if(c===void 0){const d=t.takeWhile(h=>!0)||[];return r&&d.unshift(r),d}const u=[];for(;r&&!tH(c);){const[d,h]=r.splitAt(c);u.push(d),c=YM(d.lengthAfter,c),r=h??t.dequeue()}return tH(c)||u.push(new eC(!1,c,c)),u}const s=[];function a(c,u,d){if(s.length>0&&Zqe(s[s.length-1].endOffset,c)){const h=s[s.length-1];s[s.length-1]=new Wy(h.startOffset,u,_s(h.newLength,d))}else s.push({startOffset:c,endOffset:u,newLength:d})}let l=zu;for(const c of i){const u=o(c.lengthBefore);if(c.modified){const d=Azi(u,g=>g.lengthBefore),h=_s(l,d);a(l,h,c.lengthAfter),l=h}else for(const d of u){const h=l;l=_s(l,d.lengthBefore),d.modified&&a(h,l,d.lengthAfter)}}return s}class eC{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=YM(e,this.lengthAfter);return Zqe(t,zu)?[this,void 0]:this.modified?[new eC(this.modified,this.lengthBefore,e),new eC(this.modified,zu,t)]:[new eC(this.modified,e,e),new eC(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${pg(this.lengthBefore)} -> ${pg(this.lengthAfter)}`}}function r2e(n){const e=[];let t=zu;for(const i of n){const r=YM(t,i.startOffset);tH(r)||e.push(new eC(!1,r,r));const o=YM(i.startOffset,i.endOffset);e.push(new eC(!0,o,i.newLength)),t=i.endOffset}return e}class qzi extends Ae{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new be,this.denseKeyProvider=new Jqe,this.brackets=new tKe(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const i=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),r=new $zi(this.textModel.getValue(),i);this.initialAstWithoutTokens=Tse(r,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(i=>new Wy(ia(i.fromLineNumber-1,0),ia(i.toLineNumber,0),ia(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=Wy.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=rH(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=rH(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const r=t,o=new eKe(this.textModel,this.brackets);return Tse(o,e,r,i)}getBracketsInRange(e,t){this.flushQueue();const i=ia(e.startLineNumber-1,e.startColumn-1),r=ia(e.endLineNumber-1,e.endColumn-1);return new Yv(o=>{const s=this.initialAstWithoutTokens||this.astWithTokens;Ise(s,zu,s.length,i,r,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=KI(e.getStartPosition()),r=KI(e.getEndPosition());return new Yv(o=>{const s=this.initialAstWithoutTokens||this.astWithTokens,a=new Kzi(o,t,this.textModel);Lse(s,zu,s.length,i,r,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return rKe(t,zu,t.length,KI(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return iKe(t,zu,t.length,KI(e))}}function iKe(n,e,t,i){if(n.kind===4||n.kind===2){const r=[];for(const o of n.children)t=_s(e,o.length),r.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let o=r.length-1;o>=0;o--){const{nodeOffsetStart:s,nodeOffsetEnd:a}=r[o];if(ML(s,i)){const l=iKe(n.children[o],s,a,i);if(l)return l}}return null}else{if(n.kind===3)return null;if(n.kind===1){const r=ex(e,t);return{bracketInfo:n.bracketInfo,range:r}}}return null}function rKe(n,e,t,i){if(n.kind===4||n.kind===2){for(const r of n.children){if(t=_s(e,r.length),ML(i,t)){const o=rKe(r,e,t,i);if(o)return o}e=t}return null}else{if(n.kind===3)return null;if(n.kind===1){const r=ex(e,t);return{bracketInfo:n.bracketInfo,range:r}}}return null}function Ise(n,e,t,i,r,o,s,a,l,c,u=!1){if(s>200)return!0;e:for(;;)switch(n.kind){case 4:{const d=n.childrenLength;for(let h=0;h<d;h++){const g=n.getChild(h);if(g){if(t=_s(e,g.length),FL(e,r)&&ON(t,i)){if(ON(t,r)){n=g;continue e}if(!Ise(g,e,t,i,r,o,s,0,l,c))return!1}e=t}}return!0}case 2:{const d=!c||!n.closingBracket||n.closingBracket.bracketInfo.closesColorized(n.openingBracket.bracketInfo);let h=0;if(l){let p=l.get(n.openingBracket.text);p===void 0&&(p=0),h=p,d&&(p++,l.set(n.openingBracket.text,p))}const g=n.childrenLength;for(let p=0;p<g;p++){const m=n.getChild(p);if(m){if(t=_s(e,m.length),FL(e,r)&&ON(t,i)){if(ON(t,r)&&m.kind!==1){n=m,d?(s++,a=h+1):a=h;continue e}if((d||m.kind!==1||!n.closingBracket)&&!Ise(m,e,t,i,r,o,d?s+1:s,d?h+1:h,l,c,!n.closingBracket))return!1}e=t}}return l==null||l.set(n.openingBracket.text,h),!0}case 3:{const d=ex(e,t);return o(new t2e(d,s-1,0,!0))}case 1:{const d=ex(e,t);return o(new t2e(d,s-1,a-1,u))}case 0:return!0}}class Kzi{constructor(e,t,i){this.push=e,this.includeMinIndentation=t,this.textModel=i}}function Lse(n,e,t,i,r,o,s,a){var l;if(s>200)return!0;let c=!0;if(n.kind===2){let u=0;if(a){let g=a.get(n.openingBracket.text);g===void 0&&(g=0),u=g,g++,a.set(n.openingBracket.text,g)}const d=_s(e,n.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=n.computeMinIndentation(e,o.textModel)),c=o.push(new Izi(ex(e,t),ex(e,d),n.closingBracket?ex(_s(d,((l=n.child)===null||l===void 0?void 0:l.length)||zu),t):void 0,s,u,n,h)),e=d,c&&n.child){const g=n.child;if(t=_s(e,g.length),FL(e,r)&&ON(t,i)&&(c=Lse(g,e,t,i,r,o,s+1,a),!c))return!1}a==null||a.set(n.openingBracket.text,u)}else{let u=e;for(const d of n.children){const h=u;if(u=_s(u,d.length),FL(h,r)&&FL(i,u)&&(c=Lse(d,h,u,i,r,o,s,a),!c))return!1}}return c}class Gzi extends Ae{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new Zl),this.onDidChangeEmitter=new be,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(i=>{var r;(!i.languageId||!((r=this.bracketPairsTree.value)===null||r===void 0)&&r.object.didLanguageChange(i.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)===null||e===void 0||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new nt;this.bracketPairsTree.value=Yzi(e.add(new qzi(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!1))||Yv.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!0))||Yv.empty}getBracketsInRange(e,t=!1){var i;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((i=this.bracketPairsTree.value)===null||i===void 0?void 0:i.object.getBracketsInRange(e,t))||Yv.empty}findMatchingBracketUp(e,t,i){const r=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(r.lineNumber,r.column);if(this.canBuildAST){const s=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!s)return null;const a=this.getBracketPairsInRange(q.fromPositions(t,t)).findLast(l=>s.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const s=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!a)return null;const l=a.textIsBracket[s];return l?OB(this._findMatchingBracketUp(l,r,AZ(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(q.fromPositions(e,e)).filter(r=>r.closingBracketRange!==void 0&&(r.openingBracketRange.containsPosition(e)||r.closingBracketRange.containsPosition(e))).findLastMaxBy(fg(r=>r.openingBracketRange.containsPosition(e)?r.openingBracketRange:r.closingBracketRange,q.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=AZ(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,r){const o=t.getCount(),s=t.getLanguageId(r);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let c=r-1;c>=0;c--){const u=t.getEndOffset(c);if(u<=a)break;if(X_(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){a=u;break}}let l=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let c=r+1;c<o;c++){const u=t.getStartOffset(c);if(u>=l)break;if(X_(t.getStandardTokenType(c))||t.getLanguageId(c)!==s){l=u;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const i=e.lineNumber,r=this.textModel.tokenization.getLineTokens(i),o=this.textModel.getLineContent(i),s=r.findTokenIndexAtOffset(e.column-1);if(s<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId(s)).brackets;if(a&&!X_(r.getStandardTokenType(s))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,r,a,s),u=null;for(;;){const d=ap.findNextBracketInRange(a.forwardRegex,i,o,l,c);if(!d)break;if(d.startColumn<=e.column&&e.column<=d.endColumn){const h=o.substring(d.startColumn-1,d.endColumn-1).toLowerCase(),g=this._matchFoundBracket(d,a.textIsBracket[h],a.textIsOpenBracket[h],t);if(g){if(g instanceof my)return null;u=g}}l=d.endColumn-1}if(u)return u}if(s>0&&r.getStartOffset(s)===e.column-1){const l=s-1,c=this.languageConfigurationService.getLanguageConfiguration(r.getLanguageId(l)).brackets;if(c&&!X_(r.getStandardTokenType(l))){const{searchStartOffset:u,searchEndOffset:d}=this._establishBracketSearchOffsets(e,r,c,l),h=ap.findPrevBracketInRange(c.reversedRegex,i,o,u,d);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const g=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),p=this._matchFoundBracket(h,c.textIsBracket[g],c.textIsOpenBracket[g],t);if(p)return p instanceof my?null:p}}}return null}_matchFoundBracket(e,t,i,r){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),r):this._findMatchingBracketUp(t,e.getStartPosition(),r);return o?o instanceof my?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const r=e.languageId,o=e.reversedRegex;let s=-1,a=0;const l=(c,u,d,h)=>{for(;;){if(i&&++a%100===0&&!i())return my.INSTANCE;const g=ap.findPrevBracketInRange(o,c,u,d,h);if(!g)break;const p=u.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(p)?s++:e.isClose(p)&&s--,s===0)return g;h=g.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const u=this.textModel.tokenization.getLineTokens(c),d=u.getCount(),h=this.textModel.getLineContent(c);let g=d-1,p=h.length,m=h.length;c===t.lineNumber&&(g=u.findTokenIndexAtOffset(t.column-1),p=t.column-1,m=t.column-1);let _=!0;for(;g>=0;g--){const v=u.getLanguageId(g)===r&&!X_(u.getStandardTokenType(g));if(v)_?p=u.getStartOffset(g):(p=u.getStartOffset(g),m=u.getEndOffset(g));else if(_&&p!==m){const b=l(c,h,p,m);if(b)return b}_=v}if(_&&p!==m){const v=l(c,h,p,m);if(v)return v}}return null}_findMatchingBracketDown(e,t,i){const r=e.languageId,o=e.forwardRegex;let s=1,a=0;const l=(u,d,h,g)=>{for(;;){if(i&&++a%100===0&&!i())return my.INSTANCE;const p=ap.findNextBracketInRange(o,u,d,h,g);if(!p)break;const m=d.substring(p.startColumn-1,p.endColumn-1).toLowerCase();if(e.isOpen(m)?s++:e.isClose(m)&&s--,s===0)return p;h=p.endColumn-1}return null},c=this.textModel.getLineCount();for(let u=t.lineNumber;u<=c;u++){const d=this.textModel.tokenization.getLineTokens(u),h=d.getCount(),g=this.textModel.getLineContent(u);let p=0,m=0,_=0;u===t.lineNumber&&(p=d.findTokenIndexAtOffset(t.column-1),m=t.column-1,_=t.column-1);let v=!0;for(;p<h;p++){const b=d.getLanguageId(p)===r&&!X_(d.getStandardTokenType(p));if(b)v||(m=d.getStartOffset(p)),_=d.getEndOffset(p);else if(v&&m!==_){const y=l(u,g,m,_);if(y)return y}v=b}if(v&&m!==_){const b=l(u,g,m,_);if(b)return b}}return null}findPrevBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getFirstBracketBefore(i))||null;let r=null,o=null,s=null;for(let a=i.lineNumber;a>=1;a--){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),u=this.textModel.getLineContent(a);let d=c-1,h=u.length,g=u.length;if(a===i.lineNumber){d=l.findTokenIndexAtOffset(i.column-1),h=i.column-1,g=i.column-1;const m=l.getLanguageId(d);r!==m&&(r=m,o=this.languageConfigurationService.getLanguageConfiguration(r).brackets,s=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew)}let p=!0;for(;d>=0;d--){const m=l.getLanguageId(d);if(r!==m){if(o&&s&&p&&h!==g){const v=ap.findPrevBracketInRange(o.reversedRegex,a,u,h,g);if(v)return this._toFoundBracket(s,v);p=!1}r=m,o=this.languageConfigurationService.getLanguageConfiguration(r).brackets,s=this.languageConfigurationService.getLanguageConfiguration(r).bracketsNew}const _=!!o&&!X_(l.getStandardTokenType(d));if(_)p?h=l.getStartOffset(d):(h=l.getStartOffset(d),g=l.getEndOffset(d));else if(s&&o&&p&&h!==g){const v=ap.findPrevBracketInRange(o.reversedRegex,a,u,h,g);if(v)return this._toFoundBracket(s,v)}p=_}if(s&&o&&p&&h!==g){const m=ap.findPrevBracketInRange(o.reversedRegex,a,u,h,g);if(m)return this._toFoundBracket(s,m)}}return null}findNextBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getFirstBracketAfter(i))||null;const r=this.textModel.getLineCount();let o=null,s=null,a=null;for(let l=i.lineNumber;l<=r;l++){const c=this.textModel.tokenization.getLineTokens(l),u=c.getCount(),d=this.textModel.getLineContent(l);let h=0,g=0,p=0;if(l===i.lineNumber){h=c.findTokenIndexAtOffset(i.column-1),g=i.column-1,p=i.column-1;const _=c.getLanguageId(h);o!==_&&(o=_,s=this.languageConfigurationService.getLanguageConfiguration(o).brackets,a=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let m=!0;for(;h<u;h++){const _=c.getLanguageId(h);if(o!==_){if(a&&s&&m&&g!==p){const b=ap.findNextBracketInRange(s.forwardRegex,l,d,g,p);if(b)return this._toFoundBracket(a,b);m=!1}o=_,s=this.languageConfigurationService.getLanguageConfiguration(o).brackets,a=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew}const v=!!s&&!X_(c.getStandardTokenType(h));if(v)m||(g=c.getStartOffset(h)),p=c.getEndOffset(h);else if(a&&s&&m&&g!==p){const b=ap.findNextBracketInRange(s.forwardRegex,l,d,g,p);if(b)return this._toFoundBracket(a,b)}m=v}if(a&&s&&m&&g!==p){const _=ap.findNextBracketInRange(s.forwardRegex,l,d,g,p);if(_)return this._toFoundBracket(a,_)}}return null}findEnclosingBrackets(e,t){const i=this.textModel.validatePosition(e);if(this.canBuildAST){const g=q.fromPositions(i),p=this.getBracketPairsInRange(q.fromPositions(i,i)).findLast(m=>m.closingBracketRange!==void 0&&m.range.strictContainsRange(g));return p?[p.openingBracketRange,p.closingBracketRange]:null}const r=AZ(t),o=this.textModel.getLineCount(),s=new Map;let a=[];const l=(g,p)=>{if(!s.has(g)){const m=[];for(let _=0,v=p?p.brackets.length:0;_<v;_++)m[_]=0;s.set(g,m)}a=s.get(g)};let c=0;const u=(g,p,m,_,v)=>{for(;;){if(r&&++c%100===0&&!r())return my.INSTANCE;const b=ap.findNextBracketInRange(g.forwardRegex,p,m,_,v);if(!b)break;const y=m.substring(b.startColumn-1,b.endColumn-1).toLowerCase(),C=g.textIsBracket[y];if(C&&(C.isOpen(y)?a[C.index]++:C.isClose(y)&&a[C.index]--,a[C.index]===-1))return this._matchFoundBracket(b,C,!1,r);_=b.endColumn-1}return null};let d=null,h=null;for(let g=i.lineNumber;g<=o;g++){const p=this.textModel.tokenization.getLineTokens(g),m=p.getCount(),_=this.textModel.getLineContent(g);let v=0,b=0,y=0;if(g===i.lineNumber){v=p.findTokenIndexAtOffset(i.column-1),b=i.column-1,y=i.column-1;const x=p.getLanguageId(v);d!==x&&(d=x,h=this.languageConfigurationService.getLanguageConfiguration(d).brackets,l(d,h))}let C=!0;for(;v<m;v++){const x=p.getLanguageId(v);if(d!==x){if(h&&C&&b!==y){const I=u(h,g,_,b,y);if(I)return OB(I);C=!1}d=x,h=this.languageConfigurationService.getLanguageConfiguration(d).brackets,l(d,h)}const k=!!h&&!X_(p.getStandardTokenType(v));if(k)C||(b=p.getStartOffset(v)),y=p.getEndOffset(v);else if(h&&C&&b!==y){const I=u(h,g,_,b,y);if(I)return OB(I)}C=k}if(h&&C&&b!==y){const x=u(h,g,_,b,y);if(x)return OB(x)}}return null}_toFoundBracket(e,t){if(!t)return null;let i=this.textModel.getValueInRange(t);i=i.toLowerCase();const r=e.getBracketInfo(i);return r?{range:t,bracketInfo:r}:null}}function Yzi(n,e){return{object:n,dispose:()=>e==null?void 0:e.dispose()}}function AZ(n){if(typeof n>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=n}}class my{constructor(){this._searchCanceledBrand=void 0}}my.INSTANCE=new my;function OB(n){return n instanceof my?null:n}class Qzi extends Ae{constructor(e){super(),this.textModel=e,this.colorProvider=new oKe,this.onDidChangeEmitter=new be,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,r){return r?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(s=>({id:`bracket${s.range.toString()}-${s.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(s,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:s.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new q(1,1,this.textModel.getLineCount(),1),e,t):[]}}class oKe{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}rm((n,e)=>{const t=[Oqe,Pqe,Mqe,Fqe,Bqe,$qe],i=new oKe;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${n.getColor(ZHi)}; }`);const r=t.map(o=>n.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const s=r[o%r.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(o)} { color: ${s}; }`)}});function PB(n){return n.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class sc{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}constructor(e,t,i,r){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=r}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${PB(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${PB(this.oldText)}")`:`(replace@${this.oldPosition} "${PB(this.oldText)}" with "${PB(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const r=t.length;Am(e,r,i),i+=4;for(let o=0;o<r;o++)F$i(e,t.charCodeAt(o),i),i+=2;return i}static _readString(e,t){const i=Dm(e,t);return t+=4,$$i(e,t,i)}writeSize(){return 4+4+sc._writeStringSize(this.oldText)+sc._writeStringSize(this.newText)}write(e,t){return Am(e,this.oldPosition,t),t+=4,Am(e,this.newPosition,t),t+=4,t=sc._writeString(e,this.oldText,t),t=sc._writeString(e,this.newText,t),t}static read(e,t,i){const r=Dm(e,t);t+=4;const o=Dm(e,t);t+=4;const s=sc._readString(e,t);t+=sc._writeStringSize(s);const a=sc._readString(e,t);return t+=sc._writeStringSize(a),i.push(new sc(r,s,o,a)),t}}function Xzi(n,e){return n===null||n.length===0?e:new nv(n,e).compress()}class nv{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,i=this._getPrev(e),r=this._getCurr(t);for(;e<this._prevLen||t<this._currLen;){if(i===null){this._acceptCurr(r),r=this._getCurr(++t);continue}if(r===null){this._acceptPrev(i),i=this._getPrev(++e);continue}if(r.oldEnd<=i.newPosition){this._acceptCurr(r),r=this._getCurr(++t);continue}if(i.newEnd<=r.oldPosition){this._acceptPrev(i),i=this._getPrev(++e);continue}if(r.oldPosition<i.newPosition){const[c,u]=nv._splitCurr(r,i.newPosition-r.oldPosition);this._acceptCurr(c),r=u;continue}if(i.newPosition<r.oldPosition){const[c,u]=nv._splitPrev(i,r.oldPosition-i.newPosition);this._acceptPrev(c),i=u;continue}let a,l;if(r.oldEnd===i.newEnd)a=i,l=r,i=this._getPrev(++e),r=this._getCurr(++t);else if(r.oldEnd<i.newEnd){const[c,u]=nv._splitPrev(i,r.oldLength);a=c,l=r,i=u,r=this._getCurr(++t)}else{const[c,u]=nv._splitCurr(r,i.newLength);a=i,l=c,i=this._getPrev(++e),r=u}this._result[this._resultLen++]=new sc(a.oldPosition,a.oldText,l.newPosition,l.newText),this._prevDeltaOffset+=a.newLength-a.oldLength,this._currDeltaOffset+=l.newLength-l.oldLength}const o=nv._merge(this._result);return nv._removeNoOps(o)}_acceptCurr(e){this._result[this._resultLen++]=nv._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++]=nv._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 sc(t.oldPosition-e,t.oldText,t.newPosition,t.newText)}static _rebasePrev(e,t){return new sc(t.oldPosition,t.oldText,t.newPosition+e,t.newText)}static _splitPrev(e,t){const i=e.newText.substr(0,t),r=e.newText.substr(t);return[new sc(e.oldPosition,e.oldText,e.newPosition,i),new sc(e.oldEnd,"",e.newPosition+t,r)]}static _splitCurr(e,t){const i=e.oldText.substr(0,t),r=e.oldText.substr(t);return[new sc(e.oldPosition,i,e.newPosition,e.newText),new sc(e.oldPosition+t,r,e.newEnd,"")]}static _merge(e){if(e.length===0)return e;const t=[];let i=0,r=e[0];for(let o=1;o<e.length;o++){const s=e[o];r.oldEnd===s.oldPosition?r=new sc(r.oldPosition,r.oldText+s.oldText,r.newPosition,r.newText+s.newText):(t[i++]=r,r=s)}return t[i++]=r,t}static _removeNoOps(e){if(e.length===0)return e;const t=[];let i=0;for(let r=0;r<e.length;r++){const o=e[r];o.oldText!==o.newText&&(t[i++]=o)}return t}}function n1(n){return n===47||n===92}function sKe(n){return n.replace(/[\\/]/g,Ra.sep)}function Zzi(n){return n.indexOf("/")===-1&&(n=sKe(n)),/^[a-zA-Z]:(\/|$)/.test(n)&&(n="/"+n),n}function o2e(n,e=Ra.sep){if(!n)return"";const t=n.length,i=n.charCodeAt(0);if(n1(i)){if(n1(n.charCodeAt(1))&&!n1(n.charCodeAt(2))){let o=3;const s=o;for(;o<t&&!n1(n.charCodeAt(o));o++);if(s!==o&&!n1(n.charCodeAt(o+1))){for(o+=1;o<t;o++)if(n1(n.charCodeAt(o)))return n.slice(0,o+1).replace(/[\\/]/g,e)}}return e}else if(aKe(i)&&n.charCodeAt(1)===58)return n1(n.charCodeAt(2))?n.slice(0,2)+e:n.slice(0,2);let r=n.indexOf("://");if(r!==-1){for(r+=3;r<t;r++)if(n1(n.charCodeAt(r)))return n.slice(0,r+1)}return""}function Dse(n,e,t,i=f_){if(n===e)return!0;if(!n||!e||e.length>n.length)return!1;if(t){if(!Lme(n,e))return!1;if(e.length===n.length)return!0;let o=e.length;return e.charAt(e.length-1)===i&&o--,n.charAt(o)===i}return e.charAt(e.length-1)!==i&&(e+=i),n.indexOf(e)===0}function aKe(n){return n>=65&&n<=90||n>=97&&n<=122}function Jzi(n,e=vc){return e?aKe(n.charCodeAt(0))&&n.charCodeAt(1)===58:!1}function Z_(n){return kV(n,!0)}class eji{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:wM(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}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,i=!1){if(e.scheme===t.scheme){if(e.scheme===Si.file)return Dse(Z_(e),Z_(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(a2e(e.authority,t.authority))return Dse(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return Tn.joinPath(e,...t)}basenameOrAuthority(e){return Tg(e)||e.authority}basename(e){return Ra.basename(e.path)}extname(e){return Ra.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===Si.file?t=Tn.file(zje(Z_(e))).path:(t=Ra.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return e.scheme===Si.file?t=Tn.file(Wje(Z_(e))).path:t=Ra.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!a2e(e.authority,t.authority))return;if(e.scheme===Si.file){const o=l6i(Z_(e),Z_(t));return vc?sKe(o):o}let i=e.path||"/";const r=t.path||"/";if(this._ignorePathCasing(e)){let o=0;for(const s=Math.min(i.length,r.length);o<s&&!(i.charCodeAt(o)!==r.charCodeAt(o)&&i.charAt(o).toLowerCase()!==r.charAt(o).toLowerCase());o++);i=r.substr(0,o)+i.substr(o)}return Ra.relative(i,r)}resolvePath(e,t){if(e.scheme===Si.file){const i=Tn.file(a6i(Z_(e),t));return e.with({authority:i.authority,path:i.path})}return t=Zzi(t),e.with({path:Ra.resolve(e.path,t)})}isAbsolutePath(e){return!!e.path&&e.path[0]==="/"}isEqualAuthority(e,t){return e===t||e!==void 0&&t!==void 0&&OI(e,t)}hasTrailingPathSeparator(e,t=f_){if(e.scheme===Si.file){const i=Z_(e);return i.length>o2e(i).length&&i[i.length-1]===t}else{const i=e.path;return i.length>1&&i.charCodeAt(i.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=f_){return l2e(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=f_){let i=!1;if(e.scheme===Si.file){const r=Z_(e);i=r!==void 0&&r.length===o2e(r).length&&r[r.length-1]===t}else{t="/";const r=e.path;i=r.length===1&&r.charCodeAt(r.length-1)===47}return!i&&!l2e(e,t)?e.with({path:e.path+"/"}):e}}const Wo=new eji(()=>!1),C_e=Wo.isEqual.bind(Wo);Wo.isEqualOrParent.bind(Wo);Wo.getComparisonKey.bind(Wo);const tji=Wo.basenameOrAuthority.bind(Wo),Tg=Wo.basename.bind(Wo),nji=Wo.extname.bind(Wo),hq=Wo.dirname.bind(Wo),iji=Wo.joinPath.bind(Wo),rji=Wo.normalizePath.bind(Wo),oji=Wo.relativePath.bind(Wo),s2e=Wo.resolvePath.bind(Wo);Wo.isAbsolutePath.bind(Wo);const a2e=Wo.isEqualAuthority.bind(Wo),l2e=Wo.hasTrailingPathSeparator.bind(Wo);Wo.removeTrailingPathSeparator.bind(Wo);Wo.addTrailingPathSeparator.bind(Wo);var mw;(function(n){n.META_DATA_LABEL="label",n.META_DATA_DESCRIPTION="description",n.META_DATA_SIZE="size",n.META_DATA_MIME="mime";function e(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(s=>{const[a,l]=s.split(":");a&&l&&i.set(a,l)});const o=t.path.substring(0,t.path.indexOf(";"));return o&&i.set(n.META_DATA_MIME,o),i}n.parseMetaData=e})(mw||(mw={}));function PT(n){return n.toString()}class gl{static create(e,t){const i=e.getAlternativeVersionId(),r=Ase(e);return new gl(i,i,r,r,t,t,[])}constructor(e,t,i,r,o,s,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=r,this.beforeCursorState=o,this.afterCursorState=s,this.changes=a}append(e,t,i,r,o){t.length>0&&(this.changes=Xzi(this.changes,t)),this.afterEOL=i,this.afterVersionId=r,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(Am(e,t?t.length:0,i),i+=4,t)for(const r of t)Am(e,r.selectionStartLineNumber,i),i+=4,Am(e,r.selectionStartColumn,i),i+=4,Am(e,r.positionLineNumber,i),i+=4,Am(e,r.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const r=Dm(e,t);t+=4;for(let o=0;o<r;o++){const s=Dm(e,t);t+=4;const a=Dm(e,t);t+=4;const l=Dm(e,t);t+=4;const c=Dm(e,t);t+=4,i.push(new ln(s,a,l,c))}return t}serialize(){let e=10+gl._writeSelectionsSize(this.beforeCursorState)+gl._writeSelectionsSize(this.afterCursorState)+4;for(const r of this.changes)e+=r.writeSize();const t=new Uint8Array(e);let i=0;Am(t,this.beforeVersionId,i),i+=4,Am(t,this.afterVersionId,i),i+=4,$Le(t,this.beforeEOL,i),i+=1,$Le(t,this.afterEOL,i),i+=1,i=gl._writeSelections(t,this.beforeCursorState,i),i=gl._writeSelections(t,this.afterCursorState,i),Am(t,this.changes.length,i),i+=4;for(const r of this.changes)i=r.write(t,i);return t.buffer}static deserialize(e){const t=new Uint8Array(e);let i=0;const r=Dm(t,i);i+=4;const o=Dm(t,i);i+=4;const s=BLe(t,i);i+=1;const a=BLe(t,i);i+=1;const l=[];i=gl._readSelections(t,i,l);const c=[];i=gl._readSelections(t,i,c);const u=Dm(t,i);i+=4;const d=[];for(let h=0;h<u;h++)i=sc.read(t,i,d);return new gl(r,o,s,a,l,c,d)}}class lKe{get type(){return 0}get resource(){return Tn.isUri(this.model)?this.model:this.model.uri}constructor(e,t,i,r){this.label=e,this.code=t,this.model=i,this._data=gl.create(i,r)}toString(){return(this._data instanceof gl?this._data:gl.deserialize(this._data)).changes.map(t=>t.toString()).join(", ")}matchesResource(e){return(Tn.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 gl}append(e,t,i,r,o){this._data instanceof gl&&this._data.append(e,t,i,r,o)}close(){this._data instanceof gl&&(this._data=this._data.serialize())}open(){this._data instanceof gl||(this._data=gl.deserialize(this._data))}undo(){if(Tn.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof gl&&(this._data=this._data.serialize());const e=gl.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(Tn.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof gl&&(this._data=this._data.serialize());const e=gl.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof gl&&(this._data=this._data.serialize()),this._data.byteLength+168}}class sji{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const r of this._editStackElementsArr){const o=PT(r.resource);this._editStackElementsMap.set(o,r)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=PT(e);return this._editStackElementsMap.has(t)}setModel(e){const t=PT(Tn.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=PT(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,r,o){const s=PT(e.uri);this._editStackElementsMap.get(s).append(e,t,i,r,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=PT(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${Tg(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function Ase(n){return n.getEOL()===`
`?0:1}function _y(n){return n?n instanceof lKe||n instanceof sji:!1}class w_e{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);_y(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);_y(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(_y(i)&&i.canAppend(this._model))return i;const r=new lKe(E("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(r,t),r}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],Ase(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,r){const o=this._getOrCreateEditStackElement(e,r),s=this._model.applyEdits(t,!0),a=w_e._computeCursorState(i,s),l=s.map((c,u)=>({index:u,textChange:c.textChange}));return l.sort((c,u)=>c.textChange.oldPosition===u.textChange.oldPosition?c.index-u.index:c.textChange.oldPosition-u.textChange.oldPosition),o.append(this._model,l.map(c=>c.textChange),Ase(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return fi(i),null}}}class aji{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function lji(n,e,t,i,r){r.spacesDiff=0,r.looksLikeAlignment=!1;let o;for(o=0;o<e&&o<i;o++){const h=n.charCodeAt(o),g=t.charCodeAt(o);if(h!==g)break}let s=0,a=0;for(let h=o;h<e;h++)n.charCodeAt(h)===32?s++:a++;let l=0,c=0;for(let h=o;h<i;h++)t.charCodeAt(h)===32?l++:c++;if(s>0&&a>0||l>0&&c>0)return;const u=Math.abs(a-c),d=Math.abs(s-l);if(u===0){r.spacesDiff=d,d>0&&0<=l-1&&l-1<n.length&&l<t.length&&t.charCodeAt(l)!==32&&n.charCodeAt(l-1)===32&&n.charCodeAt(n.length-1)===44&&(r.looksLikeAlignment=!0);return}if(d%u===0){r.spacesDiff=d/u;return}}function c2e(n,e,t){const i=Math.min(n.getLineCount(),1e4);let r=0,o=0,s="",a=0;const l=[2,4,6,8,3,5,7],c=8,u=[0,0,0,0,0,0,0,0,0],d=new aji;for(let p=1;p<=i;p++){const m=n.getLineLength(p),_=n.getLineContent(p),v=m<=65536;let b=!1,y=0,C=0,x=0;for(let I=0,L=m;I<L;I++){const D=v?_.charCodeAt(I):n.getLineCharCode(p,I);if(D===9)x++;else if(D===32)C++;else{b=!0,y=I;break}}if(!b||(x>0?r++:C>1&&o++,lji(s,a,_,y,d),d.looksLikeAlignment&&!(t&&e===d.spacesDiff)))continue;const k=d.spacesDiff;k<=c&&u[k]++,s=_,a=y}let h=t;r!==o&&(h=r<o);let g=e;if(h){let p=h?0:.1*i;l.forEach(m=>{const _=u[m];_>p&&(p=_,g=m)}),g===4&&u[4]>0&&u[2]>0&&u[2]>=u[4]/2&&(g=2)}return{insertSpaces:h,tabSize:g}}function fd(n){return(n.metadata&1)>>>0}function Bo(n,e){n.metadata=n.metadata&254|e<<0}function _c(n){return(n.metadata&2)>>>1===1}function Ro(n,e){n.metadata=n.metadata&253|(e?1:0)<<1}function cKe(n){return(n.metadata&4)>>>2===1}function u2e(n,e){n.metadata=n.metadata&251|(e?1:0)<<2}function uKe(n){return(n.metadata&64)>>>6===1}function d2e(n,e){n.metadata=n.metadata&191|(e?1:0)<<6}function cji(n){return(n.metadata&24)>>>3}function h2e(n,e){n.metadata=n.metadata&231|e<<3}function uji(n){return(n.metadata&32)>>>5===1}function f2e(n,e){n.metadata=n.metadata&223|(e?1:0)<<5}class dKe{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,Bo(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,u2e(this,!1),d2e(this,!1),h2e(this,1),f2e(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Ro(this,!1)}reset(e,t,i,r){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=r}setOptions(e){this.options=e;const t=this.options.className;u2e(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),d2e(this,this.options.glyphMarginClassName!==null),h2e(this,this.options.stickiness),f2e(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const Ai=new dKe(null,0,0);Ai.parent=Ai;Ai.left=Ai;Ai.right=Ai;Bo(Ai,0);class RZ{constructor(){this.root=Ai,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,r,o,s){return this.root===Ai?[]:vji(this,e,t,i,r,o,s)}search(e,t,i,r){return this.root===Ai?[]:_ji(this,e,t,i,r)}collectNodesFromOwner(e){return pji(this,e)}collectNodesPostOrder(){return mji(this)}insert(e){g2e(this,e),this._normalizeDeltaIfNecessary()}delete(e){p2e(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let r=0;for(;e!==this.root;)e===e.parent.right&&(r+=e.parent.delta),e=e.parent;const o=i.start+r,s=i.end+r;i.setCachedOffsets(o,s,t)}acceptReplace(e,t,i,r){const o=fji(this,e,e+t);for(let s=0,a=o.length;s<a;s++){const l=o[s];p2e(this,l)}this._normalizeDeltaIfNecessary(),gji(this,e,e+t,i),this._normalizeDeltaIfNecessary();for(let s=0,a=o.length;s<a;s++){const l=o[s];l.start=l.cachedAbsoluteStart,l.end=l.cachedAbsoluteEnd,hji(l,e,e+t,i,r),l.maxEnd=l.end,g2e(this,l)}this._normalizeDeltaIfNecessary()}_normalizeDeltaIfNecessary(){this.requestNormalizeDelta&&(this.requestNormalizeDelta=!1,dji(this))}}function dji(n){let e=n.root,t=0;for(;e!==Ai;){if(e.left!==Ai&&!_c(e.left)){e=e.left;continue}if(e.right!==Ai&&!_c(e.right)){t+=e.delta,e=e.right;continue}e.start=t+e.start,e.end=t+e.end,e.delta=0,_w(e),Ro(e,!0),Ro(e.left,!1),Ro(e.right,!1),e===e.parent.right&&(t-=e.parent.delta),e=e.parent}Ro(n.root,!1)}function MT(n,e,t,i){return n<t?!0:n>t||i===1?!1:i===2?!0:e}function hji(n,e,t,i,r){const o=cji(n),s=o===0||o===2,a=o===1||o===2,l=t-e,c=i,u=Math.min(l,c),d=n.start;let h=!1;const g=n.end;let p=!1;e<=d&&g<=t&&uji(n)&&(n.start=e,h=!0,n.end=e,p=!0);{const _=r?1:l>0?2:0;!h&&MT(d,s,e,_)&&(h=!0),!p&&MT(g,a,e,_)&&(p=!0)}if(u>0&&!r){const _=l>c?2:0;!h&&MT(d,s,e+u,_)&&(h=!0),!p&&MT(g,a,e+u,_)&&(p=!0)}{const _=r?1:0;!h&&MT(d,s,t,_)&&(n.start=e+c,h=!0),!p&&MT(g,a,t,_)&&(n.end=e+c,p=!0)}const m=c-l;h||(n.start=Math.max(0,d+m)),p||(n.end=Math.max(0,g+m)),n.start>n.end&&(n.end=n.start)}function fji(n,e,t){let i=n.root,r=0,o=0,s=0,a=0;const l=[];let c=0;for(;i!==Ai;){if(_c(i)){Ro(i.left,!1),Ro(i.right,!1),i===i.parent.right&&(r-=i.parent.delta),i=i.parent;continue}if(!_c(i.left)){if(o=r+i.maxEnd,o<e){Ro(i,!0);continue}if(i.left!==Ai){i=i.left;continue}}if(s=r+i.start,s>t){Ro(i,!0);continue}if(a=r+i.end,a>=e&&(i.setCachedOffsets(s,a,0),l[c++]=i),Ro(i,!0),i.right!==Ai&&!_c(i.right)){r+=i.delta,i=i.right;continue}}return Ro(n.root,!1),l}function gji(n,e,t,i){let r=n.root,o=0,s=0,a=0;const l=i-(t-e);for(;r!==Ai;){if(_c(r)){Ro(r.left,!1),Ro(r.right,!1),r===r.parent.right&&(o-=r.parent.delta),_w(r),r=r.parent;continue}if(!_c(r.left)){if(s=o+r.maxEnd,s<e){Ro(r,!0);continue}if(r.left!==Ai){r=r.left;continue}}if(a=o+r.start,a>t){r.start+=l,r.end+=l,r.delta+=l,(r.delta<-1073741824||r.delta>1073741824)&&(n.requestNormalizeDelta=!0),Ro(r,!0);continue}if(Ro(r,!0),r.right!==Ai&&!_c(r.right)){o+=r.delta,r=r.right;continue}}Ro(n.root,!1)}function pji(n,e){let t=n.root;const i=[];let r=0;for(;t!==Ai;){if(_c(t)){Ro(t.left,!1),Ro(t.right,!1),t=t.parent;continue}if(t.left!==Ai&&!_c(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[r++]=t),Ro(t,!0),t.right!==Ai&&!_c(t.right)){t=t.right;continue}}return Ro(n.root,!1),i}function mji(n){let e=n.root;const t=[];let i=0;for(;e!==Ai;){if(_c(e)){Ro(e.left,!1),Ro(e.right,!1),e=e.parent;continue}if(e.left!==Ai&&!_c(e.left)){e=e.left;continue}if(e.right!==Ai&&!_c(e.right)){e=e.right;continue}t[i++]=e,Ro(e,!0)}return Ro(n.root,!1),t}function _ji(n,e,t,i,r){let o=n.root,s=0,a=0,l=0;const c=[];let u=0;for(;o!==Ai;){if(_c(o)){Ro(o.left,!1),Ro(o.right,!1),o===o.parent.right&&(s-=o.parent.delta),o=o.parent;continue}if(o.left!==Ai&&!_c(o.left)){o=o.left;continue}a=s+o.start,l=s+o.end,o.setCachedOffsets(a,l,i);let d=!0;if(e&&o.ownerId&&o.ownerId!==e&&(d=!1),t&&cKe(o)&&(d=!1),r&&!uKe(o)&&(d=!1),d&&(c[u++]=o),Ro(o,!0),o.right!==Ai&&!_c(o.right)){s+=o.delta,o=o.right;continue}}return Ro(n.root,!1),c}function vji(n,e,t,i,r,o,s){let a=n.root,l=0,c=0,u=0,d=0;const h=[];let g=0;for(;a!==Ai;){if(_c(a)){Ro(a.left,!1),Ro(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!_c(a.left)){if(c=l+a.maxEnd,c<e){Ro(a,!0);continue}if(a.left!==Ai){a=a.left;continue}}if(u=l+a.start,u>t){Ro(a,!0);continue}if(d=l+a.end,d>=e){a.setCachedOffsets(u,d,o);let p=!0;i&&a.ownerId&&a.ownerId!==i&&(p=!1),r&&cKe(a)&&(p=!1),s&&!uKe(a)&&(p=!1),p&&(h[g++]=a)}if(Ro(a,!0),a.right!==Ai&&!_c(a.right)){l+=a.delta,a=a.right;continue}}return Ro(n.root,!1),h}function g2e(n,e){if(n.root===Ai)return e.parent=Ai,e.left=Ai,e.right=Ai,Bo(e,0),n.root=e,n.root;bji(n,e),f1(e.parent);let t=e;for(;t!==n.root&&fd(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;fd(i)===1?(Bo(t.parent,0),Bo(i,0),Bo(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,HO(n,t)),Bo(t.parent,0),Bo(t.parent.parent,1),WO(n,t.parent.parent))}else{const i=t.parent.parent.left;fd(i)===1?(Bo(t.parent,0),Bo(i,0),Bo(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,WO(n,t)),Bo(t.parent,0),Bo(t.parent.parent,1),HO(n,t.parent.parent))}return Bo(n.root,0),e}function bji(n,e){let t=0,i=n.root;const r=e.start,o=e.end;for(;;)if(Cji(r,o,i.start+t,i.end+t)<0)if(i.left===Ai){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===Ai){e.start-=t+i.delta,e.end-=t+i.delta,e.maxEnd-=t+i.delta,i.right=e;break}else t+=i.delta,i=i.right;e.parent=i,e.left=Ai,e.right=Ai,Bo(e,1)}function p2e(n,e){let t,i;if(e.left===Ai?(t=e.right,i=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===Ai?(t=e.left,i=e):(i=yji(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.delta<-1073741824||i.delta>1073741824)&&(n.requestNormalizeDelta=!0)),i===n.root){n.root=t,Bo(t,0),e.detach(),NZ(),_w(t),n.root.parent=Ai;return}const r=fd(i)===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?t.parent=i.parent:(i.parent===e?t.parent=i:t.parent=i.parent,i.left=e.left,i.right=e.right,i.parent=e.parent,Bo(i,fd(e)),e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Ai&&(i.left.parent=i),i.right!==Ai&&(i.right.parent=i)),e.detach(),r){f1(t.parent),i!==e&&(f1(i),f1(i.parent)),NZ();return}f1(t),f1(t.parent),i!==e&&(f1(i),f1(i.parent));let o;for(;t!==n.root&&fd(t)===0;)t===t.parent.left?(o=t.parent.right,fd(o)===1&&(Bo(o,0),Bo(t.parent,1),HO(n,t.parent),o=t.parent.right),fd(o.left)===0&&fd(o.right)===0?(Bo(o,1),t=t.parent):(fd(o.right)===0&&(Bo(o.left,0),Bo(o,1),WO(n,o),o=t.parent.right),Bo(o,fd(t.parent)),Bo(t.parent,0),Bo(o.right,0),HO(n,t.parent),t=n.root)):(o=t.parent.left,fd(o)===1&&(Bo(o,0),Bo(t.parent,1),WO(n,t.parent),o=t.parent.left),fd(o.left)===0&&fd(o.right)===0?(Bo(o,1),t=t.parent):(fd(o.left)===0&&(Bo(o.right,0),Bo(o,1),HO(n,o),o=t.parent.left),Bo(o,fd(t.parent)),Bo(t.parent,0),Bo(o.left,0),WO(n,t.parent),t=n.root));Bo(t,0),NZ()}function yji(n){for(;n.left!==Ai;)n=n.left;return n}function NZ(){Ai.parent=Ai,Ai.delta=0,Ai.start=0,Ai.end=0}function HO(n,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==Ai&&(t.left.parent=e),t.parent=e.parent,e.parent===Ai?n.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,_w(e),_w(t)}function WO(n,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(n.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==Ai&&(t.right.parent=e),t.parent=e.parent,e.parent===Ai?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,_w(e),_w(t)}function hKe(n){let e=n.end;if(n.left!==Ai){const t=n.left.maxEnd;t>e&&(e=t)}if(n.right!==Ai){const t=n.right.maxEnd+n.delta;t>e&&(e=t)}return e}function _w(n){n.maxEnd=hKe(n)}function f1(n){for(;n!==Ai;){const e=hKe(n);if(n.maxEnd===e)return;n.maxEnd=e,n=n.parent}}function Cji(n,e,t,i){return n===t?e-i:n-t}class Rse{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!==ui)return S_e(this.right);let e=this;for(;e.parent!==ui&&e.parent.left!==e;)e=e.parent;return e.parent===ui?ui:e.parent}prev(){if(this.left!==ui)return fKe(this.left);let e=this;for(;e.parent!==ui&&e.parent.right!==e;)e=e.parent;return e.parent===ui?ui:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const ui=new Rse(null,0);ui.parent=ui;ui.left=ui;ui.right=ui;ui.color=0;function S_e(n){for(;n.left!==ui;)n=n.left;return n}function fKe(n){for(;n.right!==ui;)n=n.right;return n}function E_e(n){return n===ui?0:n.size_left+n.piece.length+E_e(n.right)}function x_e(n){return n===ui?0:n.lf_left+n.piece.lineFeedCnt+x_e(n.right)}function OZ(){ui.parent=ui}function zO(n,e){const t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==ui&&(t.left.parent=e),t.parent=e.parent,e.parent===ui?n.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function jO(n,e){const t=e.left;e.left=t.right,t.right!==ui&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===ui?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function MB(n,e){let t,i;if(e.left===ui?(i=e,t=i.right):e.right===ui?(i=e,t=i.left):(i=S_e(e.right),t=i.right),i===n.root){n.root=t,t.color=0,e.detach(),OZ(),n.root.parent=ui;return}const r=i.color===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,PN(n,t)):(i.parent===e?t.parent=i:t.parent=i.parent,PN(n,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==ui&&(i.left.parent=i),i.right!==ui&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,PN(n,i)),e.detach(),t.parent.left===t){const s=E_e(t),a=x_e(t);if(s!==t.parent.size_left||a!==t.parent.lf_left){const l=s-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=s,t.parent.lf_left=a,oy(n,t.parent,l,c)}}if(PN(n,t.parent),r){OZ();return}let o;for(;t!==n.root&&t.color===0;)t===t.parent.left?(o=t.parent.right,o.color===1&&(o.color=0,t.parent.color=1,zO(n,t.parent),o=t.parent.right),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.right.color===0&&(o.left.color=0,o.color=1,jO(n,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=0,o.right.color=0,zO(n,t.parent),t=n.root)):(o=t.parent.left,o.color===1&&(o.color=0,t.parent.color=1,jO(n,t.parent),o=t.parent.left),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.left.color===0&&(o.right.color=0,o.color=1,zO(n,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=0,o.left.color=0,jO(n,t.parent),t=n.root));t.color=0,OZ()}function m2e(n,e){for(PN(n,e);e!==n.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,zO(n,e)),e.parent.color=0,e.parent.parent.color=1,jO(n,e.parent.parent))}else{const t=e.parent.parent.left;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,jO(n,e)),e.parent.color=0,e.parent.parent.color=1,zO(n,e.parent.parent))}n.root.color=0}function oy(n,e,t,i){for(;e!==n.root&&e!==ui;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function PN(n,e){let t=0,i=0;if(e!==n.root){for(;e!==n.root&&e===e.parent.right;)e=e.parent;if(e!==n.root)for(e=e.parent,t=E_e(e.left)-e.size_left,i=x_e(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==n.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}const Yb=65535;function gKe(n){let e;return n[n.length-1]<65536?e=new Uint16Array(n.length):e=new Uint32Array(n.length),e.set(n,0),e}class wji{constructor(e,t,i,r,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=r,this.isBasicASCII=o}}function uy(n,e=!0){const t=[0];let i=1;for(let r=0,o=n.length;r<o;r++){const s=n.charCodeAt(r);s===13?r+1<o&&n.charCodeAt(r+1)===10?(t[i++]=r+2,r++):t[i++]=r+1:s===10&&(t[i++]=r+1)}return e?gKe(t):t}function Sji(n,e){n.length=0,n[0]=0;let t=1,i=0,r=0,o=0,s=!0;for(let l=0,c=e.length;l<c;l++){const u=e.charCodeAt(l);u===13?l+1<c&&e.charCodeAt(l+1)===10?(o++,n[t++]=l+2,l++):(i++,n[t++]=l+1):u===10?(r++,n[t++]=l+1):s&&u!==9&&(u<32||u>126)&&(s=!1)}const a=new wji(gKe(n),i,r,o,s);return n.length=0,a}class Wd{constructor(e,t,i,r,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=r,this.length=o}}class dE{constructor(e,t){this.buffer=e,this.lineStarts=t}}class Eji{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==ui&&e.iterate(e.root,i=>(i!==ui&&this._pieces.push(i.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class xji{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber<e&&i.nodeStartLineNumber+i.node.piece.lineFeedCnt>=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let r=0;r<i.length;r++){const o=i[r];if(o.node.parent===null||o.nodeStartOffset>=e){i[r]=null,t=!0;continue}}if(t){const r=[];for(const o of i)o!==null&&r.push(o);this._cache=r}}}class kji{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new dE("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=ui,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let r=null;for(let o=0,s=e.length;o<s;o++)if(e[o].buffer.length>0){e[o].lineStarts||(e[o].lineStarts=uy(e[o].buffer));const a=new Wd(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]),r=this.rbInsertRight(r,a)}this._searchCache=new xji(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=Yb,i=t-Math.floor(t/3),r=i*2;let o="",s=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),u=c.length;if(s<=i||s+u<r)return o+=c,s+=u,!0;const d=o.replace(/\r\n|\r|\n/g,e);return a.push(new dE(d,uy(d))),o=c,s=u,!0}),s>0){const l=o.replace(/\r\n|\r|\n/g,e);a.push(new dE(l,uy(l)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new Eji(this,e)}getOffsetAt(e,t){let i=0,r=this.root;for(;r!==ui;)if(r.left!==ui&&r.lf_left+1>=e)r=r.left;else if(r.lf_left+r.piece.lineFeedCnt+1>=e){i+=r.size_left;const o=this.getAccumulatedValue(r,e-r.lf_left-2);return i+=o+t-1}else e-=r.lf_left+r.piece.lineFeedCnt,i+=r.size_left+r.piece.length,r=r.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const r=e;for(;t!==ui;)if(t.size_left!==0&&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(i+=t.lf_left+o.index,o.index===0){const s=this.getOffsetAt(i+1,1),a=r-s;return new Ce(i+1,a+1)}return new Ce(i+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===ui){const o=this.getOffsetAt(i+1,1),s=r-e-o;return new Ce(i+1,s+1)}else t=t.right;return new Ce(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),r=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,r);return t?t!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,c=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(c+e.remainder,c+t.remainder)}let i=e.node;const r=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let s=r.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==ui;){const a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){s+=a.substring(l,l+t.remainder);break}else s+=a.substr(l,i.piece.length);i=i.next()}return s}getLinesContent(){const e=[];let t=0,i="",r=!1;return this.iterate(this.root,o=>{if(o===ui)return!0;const s=o.piece;let a=s.length;if(a===0)return!0;const l=this._buffers[s.bufferIndex].buffer,c=this._buffers[s.bufferIndex].lineStarts,u=s.start.line,d=s.end.line;let h=c[u]+s.start.column;if(r&&(l.charCodeAt(h)===10&&(h++,a--),e[t++]=i,i="",r=!1,a===0))return!0;if(u===d)return!this._EOLNormalized&&l.charCodeAt(h+a-1)===13?(r=!0,i+=l.substr(h,a-1)):i+=l.substr(h,a),!0;i+=this._EOLNormalized?l.substring(h,Math.max(h,c[u+1]-this._EOLLength)):l.substring(h,c[u+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let g=u+1;g<d;g++)i=this._EOLNormalized?l.substring(c[g],c[g+1]-this._EOLLength):l.substring(c[g],c[g+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;return!this._EOLNormalized&&l.charCodeAt(c[d]+s.end.column-1)===13?(r=!0,s.end.column===0?t--:i=l.substr(c[d],s.end.column-1)):i=l.substr(c[d],s.end.column),!0}),r&&(e[t++]=i,i=""),e[t++]=i,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e?this._lastVisitedLine.value:(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 i=this._buffers[t.piece.bufferIndex],r=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return i.buffer.charCodeAt(r)}else{const t=this._buffers[e.node.piece.bufferIndex],r=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return t.buffer.charCodeAt(r)}}getLineCharCode(e,t){const i=this.nodeAt2(e,t+1);return this._getCharCode(i)}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,i,r,o,s,a,l,c,u,d){const h=this._buffers[e.piece.bufferIndex],g=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),p=this.offsetInBuffer(e.piece.bufferIndex,o),m=this.offsetInBuffer(e.piece.bufferIndex,s);let _;const v={line:0,column:0};let b,y;t._wordSeparators?(b=h.buffer.substring(p,m),y=C=>C+p,t.reset(0)):(b=h.buffer,y=C=>C,t.reset(p));do if(_=t.next(b),_){if(y(_.index)>=m)return u;this.positionInBuffer(e,y(_.index)-g,v);const C=this.getLineFeedCnt(e.piece.bufferIndex,o,v),x=v.line===o.line?v.column-o.column+r:v.column+1,k=x+_[0].length;if(d[u++]=oE(new q(i+C,x,i+C,k),_,l),y(_.index)+_[0].length>=m||u>=c)return u}while(_);return u}findMatchesLineByLine(e,t,i,r){const o=[];let s=0;const a=new FI(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];const c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let u=this.positionInBuffer(l.node,l.remainder);const d=this.positionInBuffer(c.node,c.remainder);if(l.node===c.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,u,d,t,i,r,s,o),o;let h=e.startLineNumber,g=l.node;for(;g!==c.node;){const m=this.getLineFeedCnt(g.piece.bufferIndex,u,g.piece.end);if(m>=1){const v=this._buffers[g.piece.bufferIndex].lineStarts,b=this.offsetInBuffer(g.piece.bufferIndex,g.piece.start),y=v[u.line+m],C=h===e.startLineNumber?e.startColumn:1;if(s=this.findMatchesInNode(g,a,h,C,u,this.positionInBuffer(g,y-b),t,i,r,s,o),s>=r)return o;h+=m}const _=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const v=this.getLineContent(h).substring(_,e.endColumn-1);return s=this._findMatchesInLine(t,a,v,e.endLineNumber,_,s,o,i,r),o}if(s=this._findMatchesInLine(t,a,this.getLineContent(h).substr(_),h,_,s,o,i,r),s>=r)return o;h++,l=this.nodeAt2(h,1),g=l.node,u=this.positionInBuffer(l.node,l.remainder)}if(h===e.endLineNumber){const m=h===e.startLineNumber?e.startColumn-1:0,_=this.getLineContent(h).substring(m,e.endColumn-1);return s=this._findMatchesInLine(t,a,_,e.endLineNumber,m,s,o,i,r),o}const p=h===e.startLineNumber?e.startColumn:1;return s=this.findMatchesInNode(c.node,a,h,p,u,d,t,i,r,s,o),o}_findMatchesInLine(e,t,i,r,o,s,a,l,c){const u=e.wordSeparators;if(!l&&e.simpleSearch){const h=e.simpleSearch,g=h.length,p=i.length;let m=-g;for(;(m=i.indexOf(h,m+g))!==-1;)if((!u||jme(u,i,p,m,g))&&(a[s++]=new LM(new q(r,m+1+o,r,m+1+g+o),null),s>=c))return s;return s}let d;t.reset(0);do if(d=t.next(i),d&&(a[s++]=oE(new q(r,d.index+1+o,r,d.index+1+d[0].length+o),d,l),s>=c))return s;while(d);return s}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==ui){const{node:r,remainder:o,nodeStartOffset:s}=this.nodeAt(e),a=r.piece,l=a.bufferIndex,c=this.positionInBuffer(r,o);if(r.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&s+a.length===e&&t.length<Yb){this.appendToNode(r,t),this.computeBufferMetadata();return}if(s===e)this.insertContentToNodeLeft(t,r),this._searchCache.validate(e);else if(s+r.piece.length>e){const u=[];let d=new Wd(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,c));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(r,o)===10){const m={line:d.start.line+1,column:0};d=new Wd(d.bufferIndex,m,d.end,this.getLineFeedCnt(d.bufferIndex,m,d.end),d.length-1),t+=`
`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(r,o-1)===13){const m=this.positionInBuffer(r,o-1);this.deleteNodeTail(r,m),t="\r"+t,r.piece.length===0&&u.push(r)}else this.deleteNodeTail(r,c);else this.deleteNodeTail(r,c);const h=this.createNewPieces(t);d.length>0&&this.rbInsertRight(r,d);let g=r;for(let p=0;p<h.length;p++)g=this.rbInsertRight(g,h[p]);this.deleteNodes(u)}else this.insertContentToNodeRight(t,r)}else{const r=this.createNewPieces(t);let o=this.rbInsertLeft(null,r[0]);for(let s=1;s<r.length;s++)o=this.rbInsertRight(o,r[s])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",t<=0||this.root===ui)return;const i=this.nodeAt(e),r=this.nodeAt(e+t),o=i.node,s=r.node;if(o===s){const h=this.positionInBuffer(o,i.remainder),g=this.positionInBuffer(o,r.remainder);if(i.nodeStartOffset===e){if(t===o.piece.length){const p=o.next();MB(this,o),this.validateCRLFWithPrevNode(p),this.computeBufferMetadata();return}this.deleteNodeHead(o,g),this._searchCache.validate(e),this.validateCRLFWithPrevNode(o),this.computeBufferMetadata();return}if(i.nodeStartOffset+o.piece.length===e+t){this.deleteNodeTail(o,h),this.validateCRLFWithNextNode(o),this.computeBufferMetadata();return}this.shrinkNode(o,h,g),this.computeBufferMetadata();return}const a=[],l=this.positionInBuffer(o,i.remainder);this.deleteNodeTail(o,l),this._searchCache.validate(e),o.piece.length===0&&a.push(o);const c=this.positionInBuffer(s,r.remainder);this.deleteNodeHead(s,c),s.piece.length===0&&a.push(s);const u=o.next();for(let h=u;h!==ui&&h!==s;h=h.next())a.push(h);const d=o.piece.length===0?o.prev():o;this.deleteNodes(a),this.validateCRLFWithNextNode(d),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){const i=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){const s=t.piece,a={line:s.start.line+1,column:0},l=new Wd(s.bufferIndex,a,s.end,this.getLineFeedCnt(s.bufferIndex,a,s.end),s.length-1);t.piece=l,e+=`
`,oy(this,t,-1,-1),t.piece.length===0&&i.push(t)}const r=this.createNewPieces(e);let o=this.rbInsertLeft(t,r[r.length-1]);for(let s=r.length-2;s>=0;s--)o=this.rbInsertLeft(o,r[s]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=`
`);const i=this.createNewPieces(e),r=this.rbInsertRight(t,i[0]);let o=r;for(let s=1;s<i.length;s++)o=this.rbInsertRight(o,i[s]);this.validateCRLFWithPrevNode(r)}positionInBuffer(e,t,i){const r=e.piece,o=e.piece.bufferIndex,s=this._buffers[o].lineStarts,l=s[r.start.line]+r.start.column+t;let c=r.start.line,u=r.end.line,d=0,h=0,g=0;for(;c<=u&&(d=c+(u-c)/2|0,g=s[d],d!==u);)if(h=s[d+1],l<g)u=d-1;else if(l>=h)c=d+1;else break;return i?(i.line=d,i.column=l-g,null):{line:d,column:l-g}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const r=this._buffers[e].lineStarts;if(i.line===r.length-1)return i.line-t.line;const o=r[i.line+1],s=r[i.line]+i.column;if(o>s+1)return i.line-t.line;const a=s-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.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++)MB(this,e[t])}createNewPieces(e){if(e.length>Yb){const u=[];for(;e.length>Yb;){const h=e.charCodeAt(Yb-1);let g;h===13||h>=55296&&h<=56319?(g=e.substring(0,Yb-1),e=e.substring(Yb-1)):(g=e.substring(0,Yb),e=e.substring(Yb));const p=uy(g);u.push(new Wd(this._buffers.length,{line:0,column:0},{line:p.length-1,column:g.length-p[p.length-1]},p.length-1,g.length)),this._buffers.push(new dE(g,p))}const d=uy(e);return u.push(new Wd(this._buffers.length,{line:0,column:0},{line:d.length-1,column:e.length-d[d.length-1]},d.length-1,e.length)),this._buffers.push(new dE(e,d)),u}let t=this._buffers[0].buffer.length;const i=uy(e,!1);let r=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},r=this._lastChangeBufferPos;for(let u=0;u<i.length;u++)i[u]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+="_"+e,t+=1}else{if(t!==0)for(let u=0;u<i.length;u++)i[u]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1)),this._buffers[0].buffer+=e}const o=this._buffers[0].buffer.length,s=this._buffers[0].lineStarts.length-1,a=o-this._buffers[0].lineStarts[s],l={line:s,column:a},c=new Wd(0,r,l,this.getLineFeedCnt(0,r,l),o-t);return this._lastChangeBufferPos=l,[c]}getLineRawContent(e,t=0){let i=this.root,r="";const o=this._searchCache.get2(e);if(o){i=o.node;const s=this.getAccumulatedValue(i,e-o.nodeStartLineNumber-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(o.nodeStartLineNumber+i.piece.lineFeedCnt===e)r=a.substring(l+s,l+i.piece.length);else{const c=this.getAccumulatedValue(i,e-o.nodeStartLineNumber);return a.substring(l+s,l+c-t)}}else{let s=0;const a=e;for(;i!==ui;)if(i.left!==ui&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this.getAccumulatedValue(i,e-i.lf_left-1),u=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return s+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:s,nodeStartLineNumber:a-(e-1-i.lf_left)}),u.substring(d+l,d+c-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this._buffers[i.piece.bufferIndex].buffer,u=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);r=c.substring(u+l,u+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,s+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==ui;){const s=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(i,0),l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return r+=s.substring(l,l+a-t),r}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);r+=s.substr(a,i.piece.length)}i=i.next()}return r}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==ui;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){const i=e.piece,r=this.positionInBuffer(e,t),o=r.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const s=this.getLineFeedCnt(e.piece.bufferIndex,i.start,r);if(s!==o)return{index:s,remainder:0}}return{index:o,remainder:r.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,r=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?r[i.end.line]+i.end.column-r[i.start.line]-i.start.column:r[o]-r[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,r=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),s=t,a=this.offsetInBuffer(i.bufferIndex,s),l=this.getLineFeedCnt(i.bufferIndex,i.start,s),c=l-r,u=a-o,d=i.length+u;e.piece=new Wd(i.bufferIndex,i.start,s,l,d),oy(this,e,u,c)}deleteNodeHead(e,t){const i=e.piece,r=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),s=t,a=this.getLineFeedCnt(i.bufferIndex,s,i.end),l=this.offsetInBuffer(i.bufferIndex,s),c=a-r,u=o-l,d=i.length+u;e.piece=new Wd(i.bufferIndex,s,i.end,a,d),oy(this,e,u,c)}shrinkNode(e,t,i){const r=e.piece,o=r.start,s=r.end,a=r.length,l=r.lineFeedCnt,c=t,u=this.getLineFeedCnt(r.bufferIndex,r.start,c),d=this.offsetInBuffer(r.bufferIndex,t)-this.offsetInBuffer(r.bufferIndex,o);e.piece=new Wd(r.bufferIndex,r.start,c,u,d),oy(this,e,d-a,u-l);const h=new Wd(r.bufferIndex,i,s,this.getLineFeedCnt(r.bufferIndex,i,s),this.offsetInBuffer(r.bufferIndex,s)-this.offsetInBuffer(r.bufferIndex,i)),g=this.rbInsertRight(e,h);this.validateCRLFWithPrevNode(g)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=`
`);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),r=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=uy(t,!1);for(let g=0;g<o.length;g++)o[g]+=r;if(i){const g=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:r-g}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(o.slice(1));const s=this._buffers[0].lineStarts.length-1,a=this._buffers[0].buffer.length-this._buffers[0].lineStarts[s],l={line:s,column:a},c=e.piece.length+t.length,u=e.piece.lineFeedCnt,d=this.getLineFeedCnt(0,e.piece.start,l),h=d-u;e.piece=new Wd(e.piece.bufferIndex,e.piece.start,l,d,c),this._lastChangeBufferPos=l,oy(this,e,t.length,h)}nodeAt(e){let t=this.root;const i=this._searchCache.get(e);if(i)return{node:i.node,nodeStartOffset:i.nodeStartOffset,remainder:e-i.nodeStartOffset};let r=0;for(;t!==ui;)if(t.size_left>e)t=t.left;else if(t.size_left+t.piece.length>=e){r+=t.size_left;const o={node:t,remainder:e-t.size_left,nodeStartOffset:r};return this._searchCache.set(o),o}else e-=t.size_left+t.piece.length,r+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,r=0;for(;i!==ui;)if(i.left!==ui&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2),s=this.getAccumulatedValue(i,e-i.lf_left-1);return r+=i.size_left,{node:i,remainder:Math.min(o+t-1,s),nodeStartOffset:r}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:r};t-=i.piece.length-o;break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==ui;){if(i.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(i,0),s=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,o),nodeStartOffset:s}}else if(i.piece.length>=t-1){const o=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:o}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],r=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(r)}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&&this._EOL===`
`)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===ui||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,r=t.start.line,o=i[r]+t.start.column;return r===i.length-1||i[r+1]>o+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(o)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===ui||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}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 i=[],r=this._buffers[e.piece.bufferIndex].lineStarts;let o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:r[e.piece.end.line]-r[e.piece.end.line-1]-1}:o={line:e.piece.end.line,column:e.piece.end.column-1};const s=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new Wd(e.piece.bufferIndex,e.piece.start,o,a,s),oy(this,e,-1,-1),e.piece.length===0&&i.push(e);const l={line:t.piece.start.line+1,column:0},c=t.piece.length-1,u=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new Wd(t.piece.bufferIndex,l,t.piece.end,u,c),oy(this,t,-1,-1),t.piece.length===0&&i.push(t);const d=this.createNewPieces(`\r
`);this.rbInsertRight(e,d[0]);for(let h=0;h<i.length;h++)MB(this,i[h])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const i=t.next();if(this.startWithLF(i)){if(e+=`
`,i.piece.length===1)MB(this,i);else{const r=i.piece,o={line:r.start.line+1,column:0},s=r.length-1,a=this.getLineFeedCnt(r.bufferIndex,o,r.end);i.piece=new Wd(r.bufferIndex,o,r.end,a,s),oy(this,i,-1,-1)}return!0}}return!1}iterate(e,t){if(e===ui)return t(ui);const i=this.iterate(e.left,t);return i&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===ui)return"";const t=this._buffers[e.piece.bufferIndex],i=e.piece,r=this.offsetInBuffer(i.bufferIndex,i.start),o=this.offsetInBuffer(i.bufferIndex,i.end);return t.buffer.substring(r,o)}getPieceContent(e){const t=this._buffers[e.bufferIndex],i=this.offsetInBuffer(e.bufferIndex,e.start),r=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(i,r)}rbInsertRight(e,t){const i=new Rse(t,1);if(i.left=ui,i.right=ui,i.parent=ui,i.size_left=0,i.lf_left=0,this.root===ui)this.root=i,i.color=0;else if(e.right===ui)e.right=i,i.parent=e;else{const o=S_e(e.right);o.left=i,i.parent=o}return m2e(this,i),i}rbInsertLeft(e,t){const i=new Rse(t,1);if(i.left=ui,i.right=ui,i.parent=ui,i.size_left=0,i.lf_left=0,this.root===ui)this.root=i,i.color=0;else if(e.left===ui)e.left=i,i.parent=e;else{const r=fKe(e.left);r.right=i,i.parent=r}return m2e(this,i),i}}class BL extends Ae{constructor(e,t,i,r,o,s,a){super(),this._onDidChangeContent=this._register(new be),this._BOM=t,this._mightContainNonBasicASCII=!s,this._mightContainRTL=r,this._mightContainUnusualLineTerminators=o,this._pieceTree=new kji(e,i,a)}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 i=e+t,r=this.getPositionAt(e),o=this.getPositionAt(i);return new q(r.lineNumber,r.column,o.lineNumber,o.column)}getValueInRange(e,t=0){if(e.isEmpty())return"";const i=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,i)}getValueLengthInRange(e,t=0){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;const i=this.getOffsetAt(e.startLineNumber,e.startColumn),r=this.getOffsetAt(e.endLineNumber,e.endColumn);let o=0;const s=this._getEndOfLine(t),a=this.getEOL();if(s.length!==a.length){const l=s.length-a.length,c=e.endLineNumber-e.startLineNumber;o=l*c}return r-i+o}getCharacterCountInRange(e,t=0){if(this._mightContainNonBasicASCII){let i=0;const r=e.startLineNumber,o=e.endLineNumber;for(let s=r;s<=o;s++){const a=this.getLineContent(s),l=s===r?e.startColumn-1:0,c=s===o?e.endColumn-1:a.length;for(let u=l;u<c;u++)Za(a.charCodeAt(u))?(i=i+1,u=u+1):i=i+1}return i+=this._getEndOfLine(t).length*(o-r),i}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=cu(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=g_(this.getLineContent(e));return t===-1?0:t+2}_getEndOfLine(e){switch(e){case 1:return`
`;case 2:return`\r
`;case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,i){let r=this._mightContainRTL,o=this._mightContainUnusualLineTerminators,s=this._mightContainNonBasicASCII,a=!0,l=[];for(let m=0;m<e.length;m++){const _=e[m];a&&_._isTracked&&(a=!1);const v=_.range;if(_.text){let k=!0;s||(k=!f5(_.text),s=k),!r&&k&&(r=qD(_.text)),!o&&k&&(o=tUe(_.text))}let b="",y=0,C=0,x=0;if(_.text){let k;[y,C,x,k]=pw(_.text);const I=this.getEOL();k===0||k===(I===`\r
`?2:1)?b=_.text:b=_.text.replace(/\r\n|\r|\n/g,I)}l[m]={sortIndex:m,identifier:_.identifier||null,range:v,rangeOffset:this.getOffsetAt(v.startLineNumber,v.startColumn),rangeLength:this.getValueLengthInRange(v),text:b,eolCount:y,firstLineLength:C,lastLineLength:x,forceMoveMarkers:!!_.forceMoveMarkers,isAutoWhitespaceEdit:_.isAutoWhitespaceEdit||!1}}l.sort(BL._sortOpsAscending);let c=!1;for(let m=0,_=l.length-1;m<_;m++){const v=l[m].range.getEndPosition(),b=l[m+1].range.getStartPosition();if(b.isBeforeOrEqual(v)){if(b.isBefore(v))throw new Error("Overlapping ranges are not allowed!");c=!0}}a&&(l=this._reduceOperations(l));const u=i||t?BL._getInverseEditRanges(l):[],d=[];if(t)for(let m=0;m<l.length;m++){const _=l[m],v=u[m];if(_.isAutoWhitespaceEdit&&_.range.isEmpty())for(let b=v.startLineNumber;b<=v.endLineNumber;b++){let y="";b===v.startLineNumber&&(y=this.getLineContent(_.range.startLineNumber),cu(y)!==-1)||d.push({lineNumber:b,oldContent:y})}}let h=null;if(i){let m=0;h=[];for(let _=0;_<l.length;_++){const v=l[_],b=u[_],y=this.getValueInRange(v.range),C=v.rangeOffset+m;m+=v.text.length-y.length,h[_]={sortIndex:v.sortIndex,identifier:v.identifier,range:b,text:y,textChange:new sc(v.rangeOffset,y,C,v.text)}}c||h.sort((_,v)=>_.sortIndex-v.sortIndex)}this._mightContainRTL=r,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=s;const g=this._doApplyEdits(l);let p=null;if(t&&d.length>0){d.sort((m,_)=>_.lineNumber-m.lineNumber),p=[];for(let m=0,_=d.length;m<_;m++){const v=d[m].lineNumber;if(m>0&&d[m-1].lineNumber===v)continue;const b=d[m].oldContent,y=this.getLineContent(v);y.length===0||y===b||cu(y)!==-1||p.push(v)}}return this._onDidChangeContent.fire(),new N8i(h,g,p)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,r=e[e.length-1].range,o=new q(i.startLineNumber,i.startColumn,r.endLineNumber,r.endColumn);let s=i.startLineNumber,a=i.startColumn;const l=[];for(let g=0,p=e.length;g<p;g++){const m=e[g],_=m.range;t=t||m.forceMoveMarkers,l.push(this.getValueInRange(new q(s,a,_.startLineNumber,_.startColumn))),m.text.length>0&&l.push(m.text),s=_.endLineNumber,a=_.endColumn}const c=l.join(""),[u,d,h]=pw(c);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:c,eolCount:u,firstLineLength:d,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(BL._sortOpsDescending);const t=[];for(let i=0;i<e.length;i++){const r=e[i],o=r.range.startLineNumber,s=r.range.startColumn,a=r.range.endLineNumber,l=r.range.endColumn;if(o===a&&s===l&&r.text.length===0)continue;r.text?(this._pieceTree.delete(r.rangeOffset,r.rangeLength),this._pieceTree.insert(r.rangeOffset,r.text,!0)):this._pieceTree.delete(r.rangeOffset,r.rangeLength);const c=new q(o,s,a,l);t.push({range:c,rangeLength:r.rangeLength,text:r.text,rangeOffset:r.rangeOffset,forceMoveMarkers:r.forceMoveMarkers})}return t}findMatchesLineByLine(e,t,i,r){return this._pieceTree.findMatchesLineByLine(e,t,i,r)}static _getInverseEditRanges(e){const t=[];let i=0,r=0,o=null;for(let s=0,a=e.length;s<a;s++){const l=e[s];let c,u;o?o.range.endLineNumber===l.range.startLineNumber?(c=i,u=r+(l.range.startColumn-o.range.endColumn)):(c=i+(l.range.startLineNumber-o.range.endLineNumber),u=l.range.startColumn):(c=l.range.startLineNumber,u=l.range.startColumn);let d;if(l.text.length>0){const h=l.eolCount+1;h===1?d=new q(c,u,c,u+l.firstLineLength):d=new q(c,u,c+h-1,l.lastLineLength+1)}else d=new q(c,u,c,u);i=d.endLineNumber,r=d.endColumn,t.push(d),o=l}return t}static _sortOpsAscending(e,t){const i=q.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=q.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class Tji{constructor(e,t,i,r,o,s,a,l,c){this._chunks=e,this._bom=t,this._cr=i,this._lf=r,this._crlf=o,this._containsRTL=s,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=c}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return t===0?e===1?`
`:`\r
`:i>t/2?`\r
`:`
`}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&(t===`\r
`&&(this._cr>0||this._lf>0)||t===`
`&&(this._cr>0||this._crlf>0)))for(let o=0,s=i.length;o<s;o++){const a=i[o].buffer.replace(/\r\n|\r|\n/g,t),l=uy(a);i[o]=new dE(a,l)}const r=new BL(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:r,disposable:r}}}class pKe{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(e.length===0)return;this.chunks.length===0&&Ome(e)&&(this.BOM=O6i,e=e.substr(1));const t=e.charCodeAt(e.length-1);t===13||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&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=Sji(this._tmpLineStarts,e);this.chunks.push(new dE(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=qD(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=tUe(e)))}finish(e=!0){return this._finish(),new Tji(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=uy(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class Iji{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}replace(e,t,i){if(e>=this._store.length)return;if(t===0){this.insert(e,i);return}else if(i===0){this.delete(e,t);return}const r=this._store.slice(0,e),o=this._store.slice(e+t),s=Lji(i,this._default);this._store=r.concat(s,o)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const i=[];for(let r=0;r<t;r++)i[r]=this._default;this._store=TU(this._store,e,i)}}function Lji(n,e){const t=[];for(let i=0;i<n;i++)t[i]=e;return t}class Dji{get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._startLineNumber+this._tokens.length-1}constructor(e,t){this._startLineNumber=e,this._tokens=t}getLineTokens(e){return this._tokens[e-this._startLineNumber]}appendLineTokens(e){this._tokens.push(e)}}class Nse{constructor(){this._tokens=[]}add(e,t){if(this._tokens.length>0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new Dji(e,[t]))}finalize(){return this._tokens}}class Aji{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new Ose(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class Rji extends Aji{constructor(e,t,i,r){super(e,t),this._textModel=i,this._languageIdCodec=r}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const r=this.getFirstInvalidLine();if(!r||r.lineNumber>t)break;const o=this._textModel.getLineContent(r.lineNumber),s=UR(this._languageIdCodec,i,this.tokenizationSupport,o,!0,r.startState);e.add(r.lineNumber,s.tokens),this.store.setEndState(r.lineNumber,s.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const r=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),s=o.substring(0,e.column-1)+t+o.substring(e.column-1),a=UR(this._languageIdCodec,r,this.tokenizationSupport,s,!0,i),l=new el(a.tokens,s,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(c)}tokenizeLineWithEdit(e,t,i){const r=e.lineNumber,o=e.column,s=this.getStartState(r);if(!s)return null;const a=this._textModel.getLineContent(r),l=a.substring(0,o-1)+i+a.substring(o-1+t),c=this._textModel.getLanguageIdAtPosition(r,0),u=UR(this._languageIdCodec,c,this.tokenizationSupport,l,!0,s);return new el(u.tokens,l,this._languageIdCodec)}isCheapToTokenize(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e<t||e===t&&this._textModel.getLineLength(e)<2048}tokenizeHeuristically(e,t,i){if(i<=this.store.getFirstInvalidEndStateLineNumberOrMax())return{heuristicTokens:!1};if(t<=this.store.getFirstInvalidEndStateLineNumberOrMax())return this.updateTokensUntilLine(e,i),{heuristicTokens:!1};let r=this.guessStartState(t);const o=this._textModel.getLanguageId();for(let s=t;s<=i;s++){const a=this._textModel.getLineContent(s),l=UR(this._languageIdCodec,o,this.tokenizationSupport,a,!0,r);e.add(s,l.tokens),r=l.endState}return{heuristicTokens:!0}}guessStartState(e){let t=this._textModel.getLineFirstNonWhitespaceColumn(e);const i=[];let r=null;for(let a=e-1;t>1&&a>=1;a--){const l=this._textModel.getLineFirstNonWhitespaceColumn(a);if(l!==0&&l<t&&(i.push(this._textModel.getLineContent(a)),t=l,r=this.getStartState(a),r))break}r||(r=this.tokenizationSupport.getInitialState()),i.reverse();const o=this._textModel.getLanguageId();let s=r;for(const a of i)s=UR(this._languageIdCodec,o,this.tokenizationSupport,a,!1,s).endState;return s}}class Ose{constructor(e){this.lineCount=e,this._tokenizationStateStore=new Nji,this._invalidEndStatesLineNumbers=new Oji,this._invalidEndStatesLineNumbers.addRange(new Bi(1,e+1))}getEndState(e){return this._tokenizationStateStore.getEndState(e)}setEndState(e,t){if(!t)throw new ya("Cannot set null/undefined state");this._invalidEndStatesLineNumbers.delete(e);const i=this._tokenizationStateStore.setEndState(e,t);return i&&e<this.lineCount&&this._invalidEndStatesLineNumbers.addRange(new Bi(e+1,e+2)),i}acceptChange(e,t){this.lineCount+=t-e.length,this._tokenizationStateStore.acceptChange(e,t),this._invalidEndStatesLineNumbers.addRangeAndResize(new Bi(e.startLineNumber,e.endLineNumberExclusive),t)}acceptChanges(e){for(const t of e){const[i]=pw(t.text);this.acceptChange(new zi(t.range.startLineNumber,t.range.endLineNumber+1),i+1)}}invalidateEndStateRange(e){this._invalidEndStatesLineNumbers.addRange(new Bi(e.startLineNumber,e.endLineNumberExclusive))}getFirstInvalidEndStateLineNumber(){return this._invalidEndStatesLineNumbers.min}getFirstInvalidEndStateLineNumberOrMax(){return this.getFirstInvalidEndStateLineNumber()||Number.MAX_SAFE_INTEGER}allStatesValid(){return this._invalidEndStatesLineNumbers.min===null}getStartState(e,t){return e===1?t:this.getEndState(e-1)}getFirstInvalidLine(e){const t=this.getFirstInvalidEndStateLineNumber();if(t===null)return null;const i=this.getStartState(t,e);if(!i)throw new ya("Start state must be defined");return{lineNumber:t,startState:i}}}class Nji{constructor(){this._lineEndStates=new Iji(null)}getEndState(e){return this._lineEndStates.get(e)}setEndState(e,t){const i=this._lineEndStates.get(e);return i&&i.equals(t)?!1:(this._lineEndStates.set(e,t),!0)}acceptChange(e,t){let i=e.length;t>0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}}class Oji{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(i=>i.contains(e));if(t!==-1){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new Bi(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new Bi(i.start,e):this._ranges.splice(t,1,new Bi(i.start,e),new Bi(e+1,i.endExclusive))}}addRange(e){Bi.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let r=i;for(;!(r>=this._ranges.length||e.endExclusive<this._ranges[r].start);)r++;const o=t-e.length;for(let s=r;s<this._ranges.length;s++)this._ranges[s]=this._ranges[s].delta(o);if(i===r){const s=new Bi(e.start,e.start+t);s.isEmpty||this._ranges.splice(i,0,s)}else{const s=Math.min(e.start,this._ranges[i].start),a=Math.max(e.endExclusive,this._ranges[r-1].endExclusive),l=new Bi(s,a+o);l.isEmpty?this._ranges.splice(i,r-i):this._ranges.splice(i,r-i,l)}}toString(){return this._ranges.map(e=>e.toString()).join(" + ")}}function UR(n,e,t,i,r,o){let s=null;if(t)try{s=t.tokenizeEncoded(i,r,o.clone())}catch(a){fi(a)}return s||(s=eq(n.encodeLanguageId(e),o)),el.convertToEndOffset(s.tokens,i.length),s}class Pji{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._isScheduled||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._isScheduled=!0,Py(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()<t?kje(i):this._beginBackgroundTokenization())};i()}_backgroundTokenizeForAtLeast1ms(){const e=this._tokenizerWithStateStore._textModel.getLineCount(),t=new Nse,i=$c.create(!1);do if(i.elapsed()>1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){var t;const i=(t=this._tokenizerWithStateStore)===null||t===void 0?void 0:t.getFirstInvalidLine();return i?(this._tokenizerWithStateStore.updateTokensUntilLine(e,i.lineNumber),i.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new zi(e,t))}}const dy=new Uint32Array(0).buffer;class rv{static deleteBeginning(e,t){return e===null||e===dy?e:rv.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===dy)return e;const i=xy(e),r=i[i.length-2];return rv.delete(e,t,r)}static delete(e,t,i){if(e===null||e===dy||t===i)return e;const r=xy(e),o=r.length>>>1;if(t===0&&r[r.length-2]===i)return dy;const s=el.findIndexInTokensArray(r,t),a=s>0?r[s-1<<1]:0,l=r[s<<1];if(i<l){const g=i-t;for(let p=s;p<o;p++)r[p<<1]-=g;return e}let c,u;a!==t?(r[s<<1]=t,c=s+1<<1,u=t):(c=s<<1,u=a);const d=i-t;for(let g=s+1;g<o;g++){const p=r[g<<1]-d;p>u&&(r[c++]=p,r[c++]=r[(g<<1)+1],u=p)}if(c===r.length)return e;const h=new Uint32Array(c);return h.set(r.subarray(0,c),0),h.buffer}static append(e,t){if(t===dy)return e;if(e===dy)return t;if(e===null)return e;if(t===null)return null;const i=xy(e),r=xy(t),o=r.length>>>1,s=new Uint32Array(i.length+r.length);s.set(i,0);let a=i.length;const l=i[i.length-2];for(let c=0;c<o;c++)s[a++]=r[c<<1]+l,s[a++]=r[(c<<1)+1];return s.buffer}static insert(e,t,i){if(e===null||e===dy)return e;const r=xy(e),o=r.length>>>1;let s=el.findIndexInTokensArray(r,t);s>0&&r[s-1<<1]===t&&s--;for(let a=s;a<o;a++)r[a<<1]+=i;return e}}function xy(n){return n instanceof Uint32Array?n:new Uint32Array(n)}class ZM{constructor(e){this._lineTokens=[],this._len=0,this._languageIdCodec=e}flush(){this._lineTokens=[],this._len=0}get hasTokens(){return this._lineTokens.length>0}getTokens(e,t,i){let r=null;if(t<this._len&&(r=this._lineTokens[t]),r!==null&&r!==dy)return new el(xy(r),i,this._languageIdCodec);const o=new Uint32Array(2);return o[0]=i.length,o[1]=_2e(this._languageIdCodec.encodeLanguageId(e)),new el(o,i,this._languageIdCodec)}static _massageTokens(e,t,i){const r=i?xy(i):null;if(t===0){let o=!1;if(r&&r.length>1&&(o=dc.getLanguageId(r[1])!==e),!o)return dy}if(!r||r.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=_2e(e),o.buffer}return r[r.length-2]=t,r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:r}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;const i=[];for(let r=0;r<t;r++)i[r]=null;this._lineTokens=TU(this._lineTokens,e,i),this._len+=t}setTokens(e,t,i,r,o){const s=ZM._massageTokens(this._languageIdCodec.encodeLanguageId(e),i,r);this._ensureLine(t);const a=this._lineTokens[t];return this._lineTokens[t]=s,o?!ZM._equals(a,s):!1}static _equals(e,t){if(!e||!t)return!e&&!t;const i=xy(e),r=xy(t);if(i.length!==r.length)return!1;for(let o=0,s=i.length;o<s;o++)if(i[o]!==r[o])return!1;return!0}acceptEdit(e,t,i){this._acceptDeleteRange(e),this._acceptInsertText(new Ce(e.startLineNumber,e.startColumn),t,i)}_acceptDeleteRange(e){const t=e.startLineNumber-1;if(t>=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=rv.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=rv.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let r=null;i<this._len&&(r=rv.deleteBeginning(this._lineTokens[i],e.endColumn-1)),this._lineTokens[t]=rv.append(this._lineTokens[t],r),this._deleteLines(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t,i){if(t===0&&i===0)return;const r=e.lineNumber-1;if(!(r>=this._len)){if(t===0){this._lineTokens[r]=rv.insert(this._lineTokens[r],e.column-1,i);return}this._lineTokens[r]=rv.deleteEnding(this._lineTokens[r],e.column-1),this._lineTokens[r]=rv.insert(this._lineTokens[r],e.column-1,i),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const i=[];for(let r=0,o=e.length;r<o;r++){const s=e[r];let a=0,l=0,c=!1;for(let u=s.startLineNumber;u<=s.endLineNumber;u++)c?(this.setTokens(t.getLanguageId(),u-1,t.getLineLength(u),s.getLineTokens(u),!1),l=u):this.setTokens(t.getLanguageId(),u-1,t.getLineLength(u),s.getLineTokens(u),!0)&&(c=!0,a=u,l=u);c&&i.push({fromLineNumber:a,toLineNumber:l})}return{changes:i}}}function _2e(n){return(n<<0|0|0|32768|2<<24|1024)>>>0}class k_e{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const o=t[0].getRange(),s=t[t.length-1].getRange();if(!o||!s)return e;i=e.plusRange(o).plusRange(s)}let r=null;for(let o=0,s=this._pieces.length;o<s;o++){const a=this._pieces[o];if(a.endLineNumber<i.startLineNumber)continue;if(a.startLineNumber>i.endLineNumber){r=r||{index:o};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(o,1),o--,s--;continue}if(a.endLineNumber<i.startLineNumber)continue;if(a.startLineNumber>i.endLineNumber){r=r||{index:o};continue}const[l,c]=a.split(i);if(l.isEmpty()){r=r||{index:o};continue}c.isEmpty()||(this._pieces.splice(o,1,l,c),o++,s++,r=r||{index:o})}return r=r||{index:this._pieces.length},t.length>0&&(this._pieces=TU(this._pieces,r.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const i=this._pieces;if(i.length===0)return t;const r=k_e._findFirstPieceWithLine(i,e),o=i[r].getLineTokens(e);if(!o)return t;const s=t.getCount(),a=o.getCount();let l=0;const c=[];let u=0,d=0;const h=(g,p)=>{g!==d&&(d=g,c[u++]=g,c[u++]=p)};for(let g=0;g<a;g++){const p=o.getStartCharacter(g),m=o.getEndCharacter(g),_=o.getMetadata(g),v=((_&1?2048:0)|(_&2?4096:0)|(_&4?8192:0)|(_&8?16384:0)|(_&16?16744448:0)|(_&32?4278190080:0))>>>0,b=~v>>>0;for(;l<s&&t.getEndOffset(l)<=p;)h(t.getEndOffset(l),t.getMetadata(l)),l++;for(l<s&&t.getStartOffset(l)<p&&h(p,t.getMetadata(l));l<s&&t.getEndOffset(l)<m;)h(t.getEndOffset(l),t.getMetadata(l)&b|_&v),l++;if(l<s)h(m,t.getMetadata(l)&b|_&v),t.getEndOffset(l)===m&&l++;else{const y=Math.min(Math.max(0,l-1),s-1);h(m,t.getMetadata(y)&b|_&v)}}for(;l<s;)h(t.getEndOffset(l),t.getMetadata(l)),l++;return new el(new Uint32Array(c),t.getLineContent(),this._languageIdCodec)}static _findFirstPieceWithLine(e,t){let i=0,r=e.length-1;for(;i<r;){let o=i+Math.floor((r-i)/2);if(e[o].endLineNumber<t)i=o+1;else if(e[o].startLineNumber>t)r=o-1;else{for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}}return i}acceptEdit(e,t,i,r,o){for(const s of this._pieces)s.acceptEdit(e,t,i,r,o)}}class oH extends Kqe{constructor(e,t,i,r,o,s){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=r,this._languageId=o,this._attachedViews=s,this._semanticTokens=new k_e(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new be),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new be),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new be),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new Mji(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(a=>{a.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(a=>{this._emitModelTokensChangedEvent(a)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(a=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[i,r,o]=pw(t.text);this._semanticTokens.acceptEdit(t.range,i,r,o,t.text.length>0?t.text.charCodeAt(0):0)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new ya("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLineWithEdit(e,t,i){return this.grammarTokens.tokenizeLineWithEdit(e,t,i)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),r=this.getLineTokens(t.lineNumber),o=r.findTokenIndexAtOffset(t.column-1),[s,a]=oH._findLanguageBoundaries(r,o),l=vM(t.column,this.getLanguageConfiguration(r.getLanguageId(o)).getWordDefinition(),i.substring(s,a),s);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(o>0&&s===t.column-1){const[c,u]=oH._findLanguageBoundaries(r,o-1),d=vM(t.column,this.getLanguageConfiguration(r.getLanguageId(o-1)).getWordDefinition(),i.substring(c,u),c);if(d&&d.startColumn<=e.column&&e.column<=d.endColumn)return d}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let r=0;for(let s=t;s>=0&&e.getLanguageId(s)===i;s--)r=e.getStartOffset(s);let o=e.getLineContent().length;for(let s=t,a=e.getCount();s<a&&e.getLanguageId(s)===i;s++)o=e.getEndOffset(s);return[r,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}}getLanguageId(){return this._languageId}getLanguageIdAtPosition(e,t){const i=this._textModel.validatePosition(new Ce(e,t)),r=this.getLineTokens(i.lineNumber);return r.getLanguageId(r.findTokenIndexAtOffset(i.column-1))}setLanguageId(e,t="api"){if(this._languageId===e)return;const i={oldLanguage:this._languageId,newLanguage:e,source:t};this._languageId=e,this._bracketPairsTextModelPart.handleDidChangeLanguage(i),this.grammarTokens.resetTokenization(),this._onDidChangeLanguage.fire(i),this._onDidChangeLanguageConfiguration.fire({})}}class Mji extends Ae{get backgroundTokenizationState(){return this._backgroundTokenizationState}constructor(e,t,i,r){super(),this._languageIdCodec=e,this._textModel=t,this.getLanguageId=i,this._tokenizer=null,this._defaultBackgroundTokenizer=null,this._backgroundTokenizer=this._register(new Zl),this._tokens=new ZM(this._languageIdCodec),this._debugBackgroundTokenizer=this._register(new Zl),this._backgroundTokenizationState=1,this._onDidChangeBackgroundTokenizationState=this._register(new be),this.onDidChangeBackgroundTokenizationState=this._onDidChangeBackgroundTokenizationState.event,this._onDidChangeTokens=this._register(new be),this.onDidChangeTokens=this._onDidChangeTokens.event,this._attachedViewStates=this._register(new wme),this._register(ps.onDidChange(o=>{const s=this.getLanguageId();o.changedLanguages.indexOf(s)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(r.onDidChangeVisibleRanges(({view:o,state:s})=>{if(s){let a=this._attachedViewStates.get(o);a||(a=new Fji(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(o,a)),a.handleStateChange(s)}else this._attachedViewStates.deleteAndDispose(o)}))}resetTokenization(e=!0){var t;this._tokens.flush(),(t=this._debugBackgroundTokens)===null||t===void 0||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new Ose(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const i=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const s=ps.get(this.getLanguageId());if(!s)return[null,null];let a;try{a=s.getInitialState()}catch(l){return fi(l),[null,null]}return[s,a]},[r,o]=i();if(r&&o?this._tokenizer=new Rji(this._textModel.getLineCount(),r,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const s={setTokens:a=>{this.setTokens(a)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;const a=2;this._backgroundTokenizationState=a,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(a,l)=>{var c;if(!this._tokenizer)return;const u=this._tokenizer.store.getFirstInvalidEndStateLineNumber();u!==null&&a>=u&&((c=this._tokenizer)===null||c===void 0||c.store.setEndState(a,l))}};r&&r.createBackgroundTokenizer&&!r.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=r.createBackgroundTokenizer(this._textModel,s)),this._backgroundTokenizer.value||(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new Pji(this._tokenizer,s),this._defaultBackgroundTokenizer.handleChanges()),r!=null&&r.backgroundTokenizerShouldOnlyVerifyTokens&&r.createBackgroundTokenizer?(this._debugBackgroundTokens=new ZM(this._languageIdCodec),this._debugBackgroundStates=new Ose(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=r.createBackgroundTokenizer(this._textModel,{setTokens:a=>{var l;(l=this._debugBackgroundTokens)===null||l===void 0||l.setMultilineTokens(a,this._textModel)},backgroundTokenizationFinished(){},setEndState:(a,l)=>{var c;(c=this._debugBackgroundStates)===null||c===void 0||c.setEndState(a,l)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;(e=this._defaultBackgroundTokenizer)===null||e===void 0||e.handleChanges()}handleDidChangeContent(e){var t,i,r;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const o of e.changes){const[s,a]=pw(o.text);this._tokens.acceptEdit(o.range,s,a),(t=this._debugBackgroundTokens)===null||t===void 0||t.acceptEdit(o.range,s,a)}(i=this._debugBackgroundStates)===null||i===void 0||i.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(r=this._defaultBackgroundTokenizer)===null||r===void 0||r.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=zi.joinMany([...this._attachedViewStates].map(([t,i])=>i.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var i,r;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const o=new Nse,{heuristicTokens:s}=this._tokenizer.tokenizeHeuristically(o,e,t),a=this.setTokens(o.finalize());if(s)for(const l of a.changes)(i=this._backgroundTokenizer.value)===null||i===void 0||i.requestTokens(l.fromLineNumber,l.toLineNumber+1);(r=this._defaultBackgroundTokenizer)===null||r===void 0||r.checkFinished()}forceTokenization(e){var t,i;const r=new Nse;(t=this._tokenizer)===null||t===void 0||t.updateTokensUntilLine(r,e),this.setTokens(r.finalize()),(i=this._defaultBackgroundTokenizer)===null||i===void 0||i.checkFinished()}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const i=this._textModel.getLineContent(e),r=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,i);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const o=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,i);!r.equals(o)&&(!((t=this._debugBackgroundTokenizer.value)===null||t===void 0)&&t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return r}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;const r=this._textModel.validatePosition(new Ce(e,t));return this.forceTokenization(r.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(r,i)}tokenizeLineWithEdit(e,t,i){if(!this._tokenizer)return null;const r=this._textModel.validatePosition(e);return this.forceTokenization(r.lineNumber),this._tokenizer.tokenizeLineWithEdit(r,t,i)}get hasTokens(){return this._tokens.hasTokens}}class Fji extends Ae{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new so(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Qs(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}class Bji{constructor(){this.changeType=1}}class S_{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",r=0;for(const o of t)i+=e.substring(r,o.column-1),r=o.column-1,i+=o.options.content;return i+=e.substring(r),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new S_(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new S_(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,r)=>i.lineNumber===r.lineNumber?i.column===r.column?i.order-r.order:i.column-r.column:i.lineNumber-r.lineNumber),t}constructor(e,t,i,r,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=r,this.order=o}}class v2e{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class $ji{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class Vji{constructor(e,t,i,r){this.changeType=4,this.injectedTexts=r,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class Hji{constructor(){this.changeType=5}}class $L{constructor(e,t,i,r){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=r,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;t<i;t++)if(this.changes[t].changeType===e)return!0;return!1}static merge(e,t){const i=[].concat(e.changes).concat(t.changes),r=t.versionId,o=e.isUndoing||t.isUndoing,s=e.isRedoing||t.isRedoing;return new $L(i,r,o,s)}}class mKe{constructor(e){this.changes=e}}class tx{constructor(e,t){this.rawContentChangedEvent=e,this.contentChangedEvent=t}merge(e){const t=$L.merge(this.rawContentChangedEvent,e.rawContentChangedEvent),i=tx._mergeChangeEvents(this.contentChangedEvent,e.contentChangedEvent);return new tx(t,i)}static _mergeChangeEvents(e,t){const i=[].concat(e.changes).concat(t.changes),r=t.eol,o=t.versionId,s=e.isUndoing||t.isUndoing,a=e.isRedoing||t.isRedoing,l=e.isFlush||t.isFlush,c=e.isEolChange&&t.isEolChange;return{changes:i,eol:r,isEolChange:c,versionId:o,isUndoing:s,isRedoing:a,isFlush:l}}}const fq=Vi("undoRedoService");class _Ke{constructor(e,t){this.resource=e,this.elements=t}}class a2{constructor(){this.id=a2._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}a2._ID=0;a2.None=new a2;class Sv{constructor(){this.id=Sv._ID++,this.order=1}nextOrder(){return this.id===0?0:this.order++}}Sv._ID=0;Sv.None=new Sv;var Wji=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},PZ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},GS;function zji(n){const e=new pKe;return e.acceptChunk(n),e.finish()}function jji(n){const e=new pKe;let t;for(;typeof(t=n.read())=="string";)e.acceptChunk(t);return e.finish()}function b2e(n,e){let t;return typeof n=="string"?t=zji(n):A8i(n)?t=jji(n):t=n,t.create(e)}let FB=0;const Uji=999,qji=1e4;class Kji{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;do{const r=this._source.read();if(r===null)return this._eos=!0,t===0?null:e.join("");if(r.length>0&&(e[t++]=r,i+=r.length),i>=64*1024)return e.join("")}while(!0)}}const qR=()=>{throw new Error("Invalid change accessor")};let hb=GS=class extends Ae{static resolveOptions(e,t){if(t.detectIndentation){const i=c2e(e,t.tabSize,t.insertSpaces);return new R8({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new R8(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return Ip(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,i,r=null,o,s,a){super(),this._undoRedoService=o,this._languageService=s,this._languageConfigurationService=a,this._onWillDispose=this._register(new be),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Zji(g=>this.handleBeforeFireDecorationsChangedEvent(g))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new be),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new be),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new be),this._eventEmitter=this._register(new Jji),this._languageSelectionListener=this._register(new Zl),this._deltaDecorationCallCnt=0,this._attachedViews=new eUi,FB++,this.id="$model"+FB,this.isForSimpleWidget=i.isForSimpleWidget,typeof r>"u"||r===null?this._associatedResource=Tn.parse("inmemory://model/"+FB):this._associatedResource=r,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=b2e(e,i.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=GS.resolveOptions(this._buffer,i);const u=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new Gzi(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new WWi(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Qzi(this)),this._tokenizationTextModelPart=new oH(this._languageService,this._languageConfigurationService,this,this._bracketPairs,u,this._attachedViews);const d=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new q(1,1,d,this._buffer.getLineLength(d)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=h>GS.LARGE_FILE_SIZE_THRESHOLD||d>GS.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>GS.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=h>GS._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=nUe(FB),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new y2e,this._commandManager=new w_e(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(u)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new BL([],"",`
`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=Ae.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new tx(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw gg();const{textBuffer:t,disposable:i}=b2e(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,r,o,s,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:r}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:o,isRedoing:s,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),r=this.getValueLengthInRange(i),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new y2e,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new $L([new Bji],this._versionId,!1,!1),this._createContentChanged2(new q(1,1,o,s),0,r,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r
`:`
`;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),r=this.getValueLengthInRange(i),o=this.getLineCount(),s=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new $L([new Hji],this._versionId,!1,!1),this._createContentChanged2(new q(1,1,o,s),0,r,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,r=t.length;i<r;i++){const o=t[i],s=o.range,a=o.cachedAbsoluteStart-o.start,l=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),c=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);o.cachedAbsoluteStart=l,o.cachedAbsoluteEnd=c,o.cachedVersionId=e,o.start=l-a,o.end=c-a,_w(o)}}onBeforeAttached(){return this._attachedEditorCount++,this._attachedEditorCount===1&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.attachView()}onBeforeDetached(e){this._attachedEditorCount--,this._attachedEditorCount===0&&(this._tokenizationTextModelPart.handleDidChangeAttached(),this._onDidChangeAttached.fire(void 0)),this._attachedViews.detachView(e)}isAttachedToEditor(){return this._attachedEditorCount>0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let r=1;r<=i;r++){const o=this._buffer.getLineLength(r);o>=qji?t+=o:e+=o}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=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,r=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,s=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new R8({tabSize:t,indentSize:i,insertSpaces:r,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:s});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const i=c2e(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),XV(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(eUe.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.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){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new ya("Operation would exceed heap memory limits");const i=this.getFullModelRange(),r=this.getValueInRange(i,e);return t?this._buffer.getBOM()+r:r}createSnapshot(e=!1){return new Kji(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),r=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+r:r}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 ya("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new ya("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new ya("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===`
`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new ya("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new ya("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new ya("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,r=e.startColumn;let o=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),s=Math.floor(typeof r=="number"&&!isNaN(r)?r:1);if(o<1)o=1,s=1;else if(o>t)o=t,s=this.getLineMaxColumn(o);else if(s<=1)s=1;else{const d=this.getLineMaxColumn(o);s>=d&&(s=d)}const a=e.endLineNumber,l=e.endColumn;let c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),u=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,u=1;else if(c>t)c=t,u=this.getLineMaxColumn(c);else if(u<=1)u=1;else{const d=this.getLineMaxColumn(c);u>=d&&(u=d)}return i===o&&r===s&&a===c&&l===u&&e instanceof q&&!(e instanceof ln)?e:new q(o,s,c,u)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const r=this._buffer.getLineCount();if(e>r)return!1;if(t===1)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(i===1){const s=this._buffer.getLineCharCode(e,t-2);if(Za(s))return!1}return!0}_validatePosition(e,t,i){const r=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),s=this._buffer.getLineCount();if(r<1)return new Ce(1,1);if(r>s)return new Ce(s,this.getLineMaxColumn(s));if(o<=1)return new Ce(r,1);const a=this.getLineMaxColumn(r);if(o>=a)return new Ce(r,a);if(i===1){const l=this._buffer.getLineCharCode(r,o-2);if(Za(l))return new Ce(r,o-1)}return new Ce(r,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof Ce&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,r=e.startColumn,o=e.endLineNumber,s=e.endColumn;if(!this._isValidPosition(i,r,0)||!this._isValidPosition(o,s,0))return!1;if(t===1){const a=r>1?this._buffer.getLineCharCode(i,r-2):0,l=s>1&&s<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,s-2):0,c=Za(a),u=Za(l);return!c&&!u}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof q&&!(e instanceof ln)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),r=this._validatePosition(e.endLineNumber,e.endColumn,0),o=i.lineNumber,s=i.column,a=r.lineNumber,l=r.column;{const c=s>1?this._buffer.getLineCharCode(o,s-2):0,u=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,d=Za(c),h=Za(u);return!d&&!h?new q(o,s,a,l):o===a&&s===l?new q(o,s-1,a,l-1):d&&h?new q(o,s-1,a,l+1):d?new q(o,s-1,a,l):new q(o,s,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new q(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,r){return this._buffer.findMatchesLineByLine(e,t,i,r)}findMatches(e,t,i,r,o,s,a=Uji){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(d=>q.isIRange(d))&&(l=t.map(d=>this.validateRange(d)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((d,h)=>d.startLineNumber-h.startLineNumber||d.startColumn-h.startColumn);const c=[];c.push(l.reduce((d,h)=>q.areIntersecting(d,h)?d.plusRange(h):(c.push(d),h)));let u;if(!i&&e.indexOf(`
`)<0){const h=new KS(e,i,r,o).parseSearchRequest();if(!h)return[];u=g=>this.findMatchesLineByLine(g,h,s,a)}else u=d=>wB.findMatches(this,new KS(e,i,r,o),d,s,a);return c.map(u).reduce((d,h)=>d.concat(h),[])}findNextMatch(e,t,i,r,o,s){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(`
`)<0){const c=new KS(e,i,r,o).parseSearchRequest();if(!c)return null;const u=this.getLineCount();let d=new q(a.lineNumber,a.column,u,this.getLineMaxColumn(u)),h=this.findMatchesLineByLine(d,c,s,1);return wB.findNextMatch(this,new KS(e,i,r,o),a,s),h.length>0||(d=new q(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),h=this.findMatchesLineByLine(d,c,s,1),h.length>0)?h[0]:null}return wB.findNextMatch(this,new KS(e,i,r,o),a,s)}findPreviousMatch(e,t,i,r,o,s){this._assertNotDisposed();const a=this.validatePosition(t);return wB.findPreviousMatch(this,new KS(e,i,r,o),a,s)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===`
`?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof pZ?e:new pZ(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,r=e.length;i<r;i++)t[i]=this._validateEditOperation(e[i]);return t}pushEditOperations(e,t,i,r){try{return this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._pushEditOperations(e,this._validateEditOperations(t),i,r)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_pushEditOperations(e,t,i,r){if(this._options.trimAutoWhitespace&&this._trimAutoWhitespaceLines){const o=t.map(a=>({range:this.validateRange(a.range),text:a.text}));let s=!0;if(e)for(let a=0,l=e.length;a<l;a++){const c=e[a];let u=!1;for(let d=0,h=o.length;d<h;d++){const g=o[d].range,p=g.startLineNumber>c.endLineNumber,m=c.startLineNumber>g.endLineNumber;if(!p&&!m){u=!0;break}}if(!u){s=!1;break}}if(s)for(let a=0,l=this._trimAutoWhitespaceLines.length;a<l;a++){const c=this._trimAutoWhitespaceLines[a],u=this.getLineMaxColumn(c);let d=!0;for(let h=0,g=o.length;h<g;h++){const p=o[h].range,m=o[h].text;if(!(c<p.startLineNumber||c>p.endLineNumber)&&!(c===p.startLineNumber&&p.startColumn===u&&p.isEmpty()&&m&&m.length>0&&m.charAt(0)===`
`)&&!(c===p.startLineNumber&&p.startColumn===1&&p.isEmpty()&&m&&m.length>0&&m.charAt(m.length-1)===`
`)){d=!1;break}}if(d){const h=new q(c,1,c,u);t.push(new pZ(null,h,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,r)}_applyUndo(e,t,i,r){const o=e.map(s=>{const a=this.getPositionAt(s.newPosition),l=this.getPositionAt(s.newEnd);return{range:new q(a.lineNumber,a.column,l.lineNumber,l.column),text:s.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,r)}_applyRedo(e,t,i,r){const o=e.map(s=>{const a=this.getPositionAt(s.oldPosition),l=this.getPositionAt(s.oldEnd);return{range:new q(a.lineNumber,a.column,l.lineNumber,l.column),text:s.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,r)}_applyUndoRedoEdits(e,t,i,r,o,s){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=r,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(s),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),r=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),s=r.changes;if(this._trimAutoWhitespaceLines=r.trimAutoWhitespaceLineNumbers,s.length!==0){for(let c=0,u=s.length;c<u;c++){const d=s[c];this._decorationsTree.acceptReplace(d.rangeOffset,d.rangeLength,d.text.length,d.forceMoveMarkers)}const a=[];this._increaseVersionId();let l=i;for(let c=0,u=s.length;c<u;c++){const d=s[c],[h]=pw(d.text);this._onDidChangeDecorations.fire();const g=d.range.startLineNumber,p=d.range.endLineNumber,m=p-g,_=h,v=Math.min(m,_),b=_-m,y=o-l-b+g,C=y,x=y+_,k=this._decorationsTree.getInjectedTextInInterval(this,this.getOffsetAt(new Ce(C,1)),this.getOffsetAt(new Ce(x,this.getLineMaxColumn(x))),0),I=S_.fromDecorations(k),L=new v0(I);for(let D=v;D>=0;D--){const R=g+D,P=y+D;L.takeFromEndWhile(O=>O.lineNumber>P);const M=L.takeFromEndWhile(O=>O.lineNumber===P);a.push(new v2e(R,this.getLineContent(P),M))}if(v<m){const D=g+v;a.push(new $ji(D+1,p))}if(v<_){const D=new v0(I),R=g+v,P=_-v,M=o-l-P+R+1,O=[],B=[];for(let F=0;F<P;F++){const H=M+F;B[F]=this.getLineContent(H),D.takeWhile(V=>V.lineNumber<H),O[F]=D.takeWhile(V=>V.lineNumber===H)}a.push(new Vji(R+1,g+_,B,O))}l+=b}this._emitContentChangedEvent(new $L(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:s,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return r.reverseEdits===null?void 0:r.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(e===null||e.size===0)return;const i=Array.from(e).map(r=>new v2e(r,this.getLineContent(r),this._getInjectedTextInLine(r)));this._onDidChangeInjectedText.fire(new mKe(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(o,s)=>this._deltaDecorationsImpl(e,[],[{range:o,options:s}])[0],changeDecoration:(o,s)=>{this._changeDecorationImpl(o,s)},changeDecorationOptions:(o,s)=>{this._changeDecorationOptionsImpl(o,w2e(s))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,s)=>o.length===0&&s.length===0?[]:this._deltaDecorationsImpl(e,o,s)};let r=null;try{r=t(i)}catch(o){fi(o)}return i.addDecoration=qR,i.changeDecoration=qR,i.changeDecorationOptions=qR,i.removeDecoration=qR,i.deltaDecorations=qR,r}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),fi(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const r=e?this._decorations[e]:null;if(!r)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:C2e[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(r),delete this._decorations[r.id],null;const o=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(r),r.reset(this.getVersionId(),s,a,o),r.setOptions(C2e[i]),this._decorationsTree.insert(r),r.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,r=t.length;i<r;i++){const o=t[i];this._decorationsTree.delete(o),delete this._decorations[o.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,i=!1){return e<1||e>this.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,r=!1,o=!1){const s=this.getLineCount(),a=Math.min(s,Math.max(1,e)),l=Math.min(s,Math.max(1,t)),c=this.getLineMaxColumn(l),u=new q(a,1,l,c),d=this._getDecorationsInRange(u,i,r,o);return Kre(d,this._decorationProvider.getDecorationsInRange(u,i,r)),d}getDecorationsInRange(e,t=0,i=!1,r=!1,o=!1){const s=this.validateRange(e),a=this._getDecorationsInRange(s,t,i,o);return Kre(a,this._decorationProvider.getDecorationsInRange(s,t,i,r)),a}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),r=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return S_.fromDecorations(r).filter(o=>o.lineNumber===e)}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,i,r){const o=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),s=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,o,s,t,i,r)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(i.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const r=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(r.startLineNumber,r.startColumn),s=this._buffer.getOffsetAt(r.endLineNumber,r.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,s,r),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const r=!!(i.options.overviewRuler&&i.options.overviewRuler.color),o=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const s=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber)}if(i.options.before||t.before){const s=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber)}r!==o?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,r=!1){const o=this.getVersionId(),s=t.length;let a=0;const l=i.length;let c=0;this._onDidChangeDecorations.beginDeferredEmit();try{const u=new Array(l);for(;a<s||c<l;){let d=null;if(a<s){do d=this._decorations[t[a++]];while(!d&&a<s);if(d){if(d.options.after){const h=this._decorationsTree.getNodeRange(this,d);this._onDidChangeDecorations.recordLineAffectedByInjectedText(h.endLineNumber)}if(d.options.before){const h=this._decorationsTree.getNodeRange(this,d);this._onDidChangeDecorations.recordLineAffectedByInjectedText(h.startLineNumber)}this._decorationsTree.delete(d),r||this._onDidChangeDecorations.checkAffectedAndFire(d.options)}}if(c<l){if(!d){const v=++this._lastDecorationId,b=`${this._instanceId};${v}`;d=new dKe(b,0,0),this._decorations[b]=d}const h=i[c],g=this._validateRangeRelaxedNoAllocations(h.range),p=w2e(h.options),m=this._buffer.getOffsetAt(g.startLineNumber,g.startColumn),_=this._buffer.getOffsetAt(g.endLineNumber,g.endColumn);d.ownerId=e,d.reset(o,m,_,g),d.setOptions(p),d.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(g.endLineNumber),d.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(g.startLineNumber),r||this._onDidChangeDecorations.checkAffectedAndFire(p),this._decorationsTree.insert(d),u[c]=d.id,c++}else d&&delete this._decorations[d.id]}return u}finally{this._onDidChangeDecorations.endDeferredEmit()}}getLanguageId(){return this.tokenization.getLanguageId()}setLanguage(e,t){typeof e=="string"?(this._languageSelectionListener.clear(),this._setLanguage(e,t)):(this._languageSelectionListener.value=e.onDidChange(()=>this._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return Gji(this.getLineContent(e))+1}};hb._MODEL_SYNC_LIMIT=50*1024*1024;hb.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;hb.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;hb.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;hb.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Ac.tabSize,indentSize:Ac.indentSize,insertSpaces:Ac.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:Ac.trimAutoWhitespace,largeFileOptimizations:Ac.largeFileOptimizations,bracketPairColorizationOptions:Ac.bracketPairColorizationOptions};hb=GS=Wji([PZ(4,fq),PZ(5,Qo),PZ(6,xo)],hb);function Gji(n){let e=0;for(const t of n)if(t===" "||t===" ")e++;else break;return e}function MZ(n){return!!(n.options.overviewRuler&&n.options.overviewRuler.color)}function FZ(n){return!!n.options.after||!!n.options.before}class y2e{constructor(){this._decorationsTree0=new RZ,this._decorationsTree1=new RZ,this._injectedTextDecorationsTree=new RZ}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)i.range===null&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,r,o,s){const a=e.getVersionId(),l=this._intervalSearch(t,i,r,o,a,s);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,i,r,o,s){const a=this._decorationsTree0.intervalSearch(e,t,i,r,o,s),l=this._decorationsTree1.intervalSearch(e,t,i,r,o,s),c=this._injectedTextDecorationsTree.intervalSearch(e,t,i,r,o,s);return a.concat(l).concat(c)}getInjectedTextInInterval(e,t,i,r){const o=e.getVersionId(),s=this._injectedTextDecorationsTree.intervalSearch(t,i,r,!1,o,!1);return this._ensureNodesHaveRanges(e,s).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),r=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,r).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,i,r,o){const s=e.getVersionId(),a=this._search(t,i,r,s,o);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,r,o){if(i)return this._decorationsTree1.search(e,t,r,o);{const s=this._decorationsTree0.search(e,t,r,o),a=this._decorationsTree1.search(e,t,r,o),l=this._injectedTextDecorationsTree.search(e,t,r,o);return s.concat(a).concat(l)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),r=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(r)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){FZ(e)?this._injectedTextDecorationsTree.insert(e):MZ(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){FZ(e)?this._injectedTextDecorationsTree.delete(e):MZ(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){FZ(e)?this._injectedTextDecorationsTree.resolveNode(e,t):MZ(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,r){this._decorationsTree0.acceptReplace(e,t,i,r),this._decorationsTree1.acceptReplace(e,t,i,r),this._injectedTextDecorationsTree.acceptReplace(e,t,i,r)}}function Qb(n){return n.replace(/[^a-z0-9\-_]/gi," ")}class vKe{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Yji extends vKe{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:ff.Center}getColor(e){return this._resolvedColor||(e.type!=="light"&&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(typeof e=="string")return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class Qji{constructor(e){var t;this.position=(t=e==null?void 0:e.position)!==null&&t!==void 0?t:LL.Left}}class Xji extends vKe{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||(e.type!=="light"&&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 typeof e=="string"?De.fromHex(e):t.getColor(e.id)}}class vw{static from(e){return e instanceof vw?e:new vw(e)}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}}class hi{static register(e){return new hi(e)}static createDynamic(e){return new hi(e)}constructor(e){var t,i,r,o,s,a;this.description=e.description,this.blockClassName=e.blockClassName?Qb(e.blockClassName):null,this.blockDoesNotCollapse=(t=e.blockDoesNotCollapse)!==null&&t!==void 0?t:null,this.blockIsAfterEnd=(i=e.blockIsAfterEnd)!==null&&i!==void 0?i:null,this.blockPadding=(r=e.blockPadding)!==null&&r!==void 0?r:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?Qb(e.className):null,this.shouldFillLineOnLineBreak=(o=e.shouldFillLineOnLineBreak)!==null&&o!==void 0?o: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 Yji(e.overviewRuler):null,this.minimap=e.minimap?new Xji(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new Qji(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Qb(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Qb(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Qb(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Qb(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Qb(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Qb(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Qb(e.afterContentClassName):null,this.after=e.after?vw.from(e.after):null,this.before=e.before?vw.from(e.before):null,this.hideInCommentTokens=(s=e.hideInCommentTokens)!==null&&s!==void 0?s:!1,this.hideInStringTokens=(a=e.hideInStringTokens)!==null&&a!==void 0?a:!1}}hi.EMPTY=hi.register({description:"empty"});const C2e=[hi.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),hi.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),hi.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),hi.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function w2e(n){return n instanceof hi?n:hi.createDynamic(n)}class Zji extends Ae{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new be),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),(e=this._affectedInjectedTextLines)===null||e===void 0||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._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){this._deferredCnt===0?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class Jji extends Ae{constructor(){super(),this._fastEmitter=this._register(new be),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new be),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}class eUi{constructor(){this._onDidChangeVisibleRanges=new be,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new tUi(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}}class tUi{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(r=>new zi(r.startLineNumber,r.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class sH{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new $l(new q(1,1,1,1),0,0,new Ce(1,1),0),new $l(new q(1,1,1,1),0,0,new Ce(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 lr(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?ln.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):ln.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,r){return t.equals(i)?r:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,r=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),s=e.normalizePosition(i,2),a=this._validatePositionWithCache(e,r,i,s),l=this._validatePositionWithCache(e,o,r,a);return i.equals(s)&&r.equals(a)&&o.equals(l)?t:new $l(q.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+r.column-a.column,s,t.leftoverVisibleColumns+i.column-s.column)}_setState(e,t,i){if(i&&(i=sH._validateViewState(e.viewModel,i)),t){const r=e.model.validateRange(t.selectionStart),o=t.selectionStart.equalsRange(r)?t.selectionStartLeftoverVisibleColumns:0,s=e.model.validatePosition(t.position),a=t.position.equals(s)?t.leftoverVisibleColumns:0;t=new $l(r,t.selectionStartKind,o,s,a)}else{if(!i)return;const r=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new $l(r,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const r=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new $l(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const r=e.coordinatesConverter.convertModelPositionToViewPosition(new Ce(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new Ce(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),s=new q(r.lineNumber,r.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new $l(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class S2e{constructor(e){this.context=e,this.cursors=[new sH(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 z8i(this.cursors,fg(e=>e.viewState.position,Ce.compare)).viewState.position}getBottomMostViewPosition(){return W8i(this.cursors,fg(e=>e.viewState.position,Ce.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(lr.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){e!==null&&(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,i=e.length;if(t<i){const r=i-t;for(let o=0;o<r;o++)this._addSecondaryCursor()}else if(t>i){const r=t-i;for(let o=0;o<r;o++)this._removeSecondaryCursor(this.cursors.length-2)}for(let r=0;r<i;r++)this.cursors[r+1].setState(this.context,e[r].modelState,e[r].viewState)}killSecondaryCursors(){this._setSecondaryStates([])}_addSecondaryCursor(){this.cursors.push(new sH(this.context)),this.lastAddedCursorIndex=this.cursors.length-1}getLastAddedCursorIndex(){return this.cursors.length===1||this.lastAddedCursorIndex===0?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(this.cursors.length===1)return;const e=this.cursors.slice(0),t=[];for(let i=0,r=e.length;i<r;i++)t.push({index:i,selection:e[i].modelState.selection});t.sort(fg(i=>i.selection,q.compareRangesUsingStarts));for(let i=0;i<t.length-1;i++){const r=t[i],o=t[i+1],s=r.selection,a=o.selection;if(!this.context.cursorConfig.multiCursorMergeOverlapping)continue;let l;if(a.isEmpty()||s.isEmpty()?l=a.getStartPosition().isBeforeOrEqual(s.getEndPosition()):l=a.getStartPosition().isBefore(s.getEndPosition()),l){const c=r.index<o.index?i:i+1,u=r.index<o.index?i+1:i,d=t[u].index,h=t[c].index,g=t[u].selection,p=t[c].selection;if(!g.equalsSelection(p)){const m=g.plusRange(p),_=g.selectionStartLineNumber===g.startLineNumber&&g.selectionStartColumn===g.startColumn,v=p.selectionStartLineNumber===p.startLineNumber&&p.selectionStartColumn===p.startColumn;let b;d===this.lastAddedCursorIndex?(b=_,this.lastAddedCursorIndex=h):b=v;let y;b?y=new ln(m.startLineNumber,m.startColumn,m.endLineNumber,m.endColumn):y=new ln(m.endLineNumber,m.endColumn,m.startLineNumber,m.startColumn),t[c].selection=y;const C=lr.fromModelSelection(y);e[h].setState(this.context,C.modelState,C.viewState)}for(const m of t)m.index>d&&m.index--;e.splice(d,1),t.splice(u,1),this._removeSecondaryCursor(d-1),i--}}}}class E2e{constructor(e,t,i,r){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=r}}class nUi{constructor(){this.type=0}}class iUi{constructor(){this.type=1}}class rUi{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class oUi{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class FT{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0)}}class BB{constructor(){this.type=5}}class sUi{constructor(e){this.type=6,this.isFocused=e}}class aUi{constructor(){this.type=7}}class $B{constructor(){this.type=8}}class bKe{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class Pse{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class Mse{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class H8{constructor(e,t,i,r,o,s,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=r,this.verticalType=o,this.revealHorizontal=s,this.scrollType=a,this.type=12}}class lUi{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 cUi{constructor(e){this.theme=e,this.type=14}}class uUi{constructor(e){this.type=15,this.ranges=e}}class dUi{constructor(){this.type=16}}let hUi=class{constructor(){this.type=17}};class fUi extends Ae{constructor(){super(),this._onEvent=this._register(new be),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,i=this._outgoingEvents.length;t<i;t++){const r=this._outgoingEvents[t].kind===e.kind?this._outgoingEvents[t].attemptToMerge(e):null;if(r){this._outgoingEvents[t]=r;return}}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,i=this._eventHandlers.length;t<i;t++)this._eventHandlers[t]===e&&console.warn("Detected duplicate listener in ViewEventDispatcher",e);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++,this._collectorCnt===1&&(this._collector=new gUi),this._collector}endEmitViewEvents(){if(this._collectorCnt--,this._collectorCnt===0){const e=this._collector.outgoingEvents,t=this._collector.viewEvents;this._collector=null;for(const i of e)this._addOutgoingEvent(i);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 i of t)i.handleEvents(e)}}}class gUi{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class T_e{constructor(e,t,i,r){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=r,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new T_e(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class I_e{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new I_e(this.oldHasFocus,e.hasFocus)}}class L_e{constructor(e,t,i,r,o,s,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=r,this.scrollWidth=o,this.scrollLeft=s,this.scrollHeight=a,this.scrollTop=l,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}attemptToMerge(e){return e.kind!==this.kind?null:new L_e(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class pUi{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class mUi{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class aH{constructor(e,t,i,r,o,s,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=r,this.source=o,this.reason=s,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length,r=t.length;if(i!==r)return!1;for(let o=0;o<i;o++)if(!e[o].equalsSelection(t[o]))return!1;return!0}isNoOp(){return aH._selectionsAreEqual(this.oldSelections,this.selections)&&this.oldModelVersionId===this.modelVersionId}attemptToMerge(e){return e.kind!==this.kind?null:new aH(this.oldSelections,e.selections,this.oldModelVersionId,e.modelVersionId,e.source,e.reason,this.reachedMaxCursorCount||e.reachedMaxCursorCount)}}class _Ui{constructor(){this.kind=5}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class vUi{constructor(e){this.event=e,this.kind=7}isNoOp(){return!1}attemptToMerge(e){return null}}class bUi{constructor(e){this.event=e,this.kind=8}isNoOp(){return!1}attemptToMerge(e){return null}}class yUi{constructor(e){this.event=e,this.kind=9}isNoOp(){return!1}attemptToMerge(e){return null}}class CUi{constructor(e){this.event=e,this.kind=10}isNoOp(){return!1}attemptToMerge(e){return null}}class wUi{constructor(e){this.event=e,this.kind=11}isNoOp(){return!1}attemptToMerge(e){return null}}class SUi{constructor(e){this.event=e,this.kind=12}isNoOp(){return!1}attemptToMerge(e){return null}}class EUi extends Ae{constructor(e,t,i,r){super(),this._model=e,this._knownModelVersionId=this._model.getVersionId(),this._viewModel=t,this._coordinatesConverter=i,this.context=new E2e(this._model,this._viewModel,this._coordinatesConverter,r),this._cursors=new S2e(this.context),this._hasFocus=!1,this._isHandling=!1,this._compositionState=null,this._columnSelectData=null,this._autoClosedActions=[],this._prevEditOperationType=0}dispose(){this._cursors.dispose(),this._autoClosedActions=Hr(this._autoClosedActions),super.dispose()}updateConfiguration(e){this.context=new E2e(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 i=this._autoClosedActions[t];i.isValid(e)||(i.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,i,r){let o=!1;const s=this.context.cursorConfig.multiCursorLimit;r!==null&&r.length>s&&(r=r.slice(0,s),o=!0);const a=UO.from(this._model,this);return this._cursors.setStates(r),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,r,o,s){const a=this._cursors.getViewPositions();let l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=q.fromPositions(a[0],a[0]),e.emitViewEvent(new H8(t,i,l,c,r,o,s))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,r=t.length;i<r;i++){const o=t[i];e.push({inSelectionMode:!o.isEmpty(),selectionStart:{lineNumber:o.selectionStartLineNumber,column:o.selectionStartColumn},position:{lineNumber:o.positionLineNumber,column:o.positionColumn}})}return e}restoreState(e,t){const i=[];for(let r=0,o=t.length;r<o;r++){const s=t[r];let a=1,l=1;s.position&&s.position.lineNumber&&(a=s.position.lineNumber),s.position&&s.position.column&&(l=s.position.column);let c=a,u=l;s.selectionStart&&s.selectionStart.lineNumber&&(c=s.selectionStart.lineNumber),s.selectionStart&&s.selectionStart.column&&(u=s.selectionStart.column),i.push({selectionStartLineNumber:c,selectionStartColumn:u,positionLineNumber:a,positionColumn:l})}this.setStates(e,"restoreState",0,lr.fromModelSelections(i)),this.revealPrimary(e,"restoreState",!1,0,!0,1)}onModelContentChanged(e,t){if(t instanceof mKe){if(this._isHandling)return;this._isHandling=!0;try{this.setStates(e,"modelChange",0,this.getCursorStates())}finally{this._isHandling=!1}}else{const i=t.rawContentChangedEvent;if(this._knownModelVersionId=i.versionId,this._isHandling)return;const r=i.containsEvent(1);if(this._prevEditOperationType=0,r)this._cursors.dispose(),this._cursors=new S2e(this.context),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,"model",1,null,!1);else if(this._hasFocus&&i.resultingSelection&&i.resultingSelection.length>0){const o=lr.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,o)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const o=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,lr.fromModelSelections(o))}}}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(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,r){this.setStates(e,t,r,lr.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],r=[];for(let a=0,l=e.length;a<l;a++)i.push({range:e[a],options:{description:"auto-closed-character",inlineClassName:"auto-closed-character",stickiness:1}}),r.push({range:t[a],options:{description:"auto-closed-enclosing",stickiness:1}});const o=this._model.deltaDecorations([],i),s=this._model.deltaDecorations([],r);this._autoClosedActions.push(new x2e(this._model,o,s))}_executeEditOperation(e){if(!e)return;e.shouldPushStackElementBefore&&this._model.pushStackElement();const t=xUi.executeCommands(this._model,this._cursors.getSelections(),e.commands);if(t){this._interpretCommandResult(t);const i=[],r=[];for(let o=0;o<e.commands.length;o++){const s=e.commands[o];s instanceof Wqe&&s.enclosingRange&&s.closeCharacterRange&&(i.push(s.closeCharacterRange),r.push(s.enclosingRange))}i.length>0&&this._pushAutoClosedAction(i,r),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,r,o){const s=UO.from(this._model,this);if(s.equals(r))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new oUi(l,a,i)),!r||r.cursorState.length!==s.cursorState.length||s.cursorState.some((c,u)=>!c.modelState.equals(r.cursorState[u].modelState))){const c=r?r.cursorState.map(d=>d.modelState.selection):null,u=r?r.modelVersionId:0;e.emitOutgoingEvent(new aH(c,a,u,s.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,r=e.length;i<r;i++){const o=e[i];if(!o.text||o.text.indexOf(`
`)>=0)return null;const s=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!s)return null;const a=s[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,u=o.text.length-s[2].length-1,d=o.text.lastIndexOf(c,u-1);if(d===-1)return null;t.push([d,u])}return t}executeEdits(e,t,i,r){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);const s=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,c=>{if(o)for(let d=0,h=o.length;d<h;d++){const[g,p]=o[d],m=c[d],_=m.range.startLineNumber,v=m.range.startColumn-1+g,b=m.range.startColumn-1+p;s.push(new q(_,b+1,_,b+2)),a.push(new q(_,v+1,_,b+2))}const u=r(c);return u&&(this._isHandling=!0),u});l&&(this._isHandling=!1,this.setSelections(e,t,l,0)),s.length>0&&this._pushAutoClosedAction(s,a)}_executeEdit(e,t,i,r=0){if(this.context.cursorConfig.readOnly)return;const o=UO.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(s){fi(s)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,r,o,!1)&&this.revealPrimary(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return x2e.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new qO(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(ls.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const r=t.length;let o=0;for(;o<r;){const s=Rme(t,o),a=t.substr(o,s);this._executeEditOperation(ls.typeWithInterceptors(!!this._compositionState,this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),this.getAutoClosedCharacters(),a)),o+=s}}else this._executeEditOperation(ls.typeWithoutInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t))},e,i)}compositionType(e,t,i,r,o,s){if(t.length===0&&i===0&&r===0){if(o!==0){const a=this.getSelections().map(l=>{const c=l.getPosition();return new ln(c.lineNumber,c.column+o,c.lineNumber,c.column+o)});this.setSelections(e,s,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(ls.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,r,o))},e,s)}paste(e,t,i,r,o){this._executeEdit(()=>{this._executeEditOperation(ls.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,r||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(Fx.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new hd(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new hd(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class UO{static from(e,t){return new UO(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t<i;t++)if(!this.cursorState[t].equals(e.cursorState[t]))return!1;return!0}}class x2e{static getAllAutoClosedCharacters(e){let t=[];for(const i of e)t=t.concat(i.getAutoClosedCharactersRanges());return t}constructor(e,t,i){this._model=e,this._autoClosedCharactersDecorations=t,this._autoClosedEnclosingDecorations=i}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 i=this._model.getDecorationRange(this._autoClosedCharactersDecorations[t]);i&&e.push(i)}return e}isValid(e){const t=[];for(let i=0;i<this._autoClosedEnclosingDecorations.length;i++){const r=this._model.getDecorationRange(this._autoClosedEnclosingDecorations[i]);if(r&&(t.push(r),r.startLineNumber!==r.endLineNumber))return!1}t.sort(q.compareRangesUsingStarts),e.sort(q.compareRangesUsingStarts);for(let i=0;i<e.length;i++)if(i>=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class xUi{static executeCommands(e,t,i){const r={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(r,i);for(let s=0,a=r.trackedRanges.length;s<a;s++)r.model._setTrackedRange(r.trackedRanges[s],null,0);return o}static _innerExecuteCommands(e,t){if(this._arrayIsEmpty(t))return null;const i=this._getEditOperations(e,t);if(i.operations.length===0)return null;const r=i.operations,o=this._getLoserCursorMap(r);if(o.hasOwnProperty("0"))return console.warn("Ignoring commands"),null;const s=[];for(let c=0,u=r.length;c<u;c++)o.hasOwnProperty(r[c].identifier.major.toString())||s.push(r[c]);i.hadTrackedEditOperation&&s.length>0&&(s[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,s,c=>{const u=[];for(let g=0;g<e.selectionsBefore.length;g++)u[g]=[];for(const g of c)g.identifier&&u[g.identifier.major].push(g);const d=(g,p)=>g.identifier.minor-p.identifier.minor,h=[];for(let g=0;g<e.selectionsBefore.length;g++)u[g].length>0?(u[g].sort(d),h[g]=t[g].computeCursorState(e.model,{getInverseEditOperations:()=>u[g],getTrackedSelection:p=>{const m=parseInt(p,10),_=e.model._getTrackedRange(e.trackedRanges[m]);return e.trackedRangesDirection[m]===0?new ln(_.startLineNumber,_.startColumn,_.endLineNumber,_.endColumn):new ln(_.endLineNumber,_.endColumn,_.startLineNumber,_.startColumn)}})):h[g]=e.selectionsBefore[g];return h});a||(a=e.selectionsBefore);const l=[];for(const c in o)o.hasOwnProperty(c)&&l.push(parseInt(c,10));l.sort((c,u)=>u-c);for(const c of l)a.splice(c,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t<i;t++)if(e[t])return!1;return!0}static _getEditOperations(e,t){let i=[],r=!1;for(let o=0,s=t.length;o<s;o++){const a=t[o];if(a){const l=this._getEditOperationsFromCommand(e,o,a);i=i.concat(l.operations),r=r||l.hadTrackedEditOperation}}return{operations:i,hadTrackedEditOperation:r}}static _getEditOperationsFromCommand(e,t,i){const r=[];let o=0;const s=(d,h,g=!1)=>{q.isEmpty(d)&&h===""||r.push({identifier:{major:t,minor:o++},range:d,text:h,forceMoveMarkers:g,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const u={addEditOperation:s,addTrackedEditOperation:(d,h,g)=>{a=!0,s(d,h,g)},trackSelection:(d,h)=>{const g=ln.liftSelection(d);let p;if(g.isEmpty())if(typeof h=="boolean")h?p=2:p=3;else{const v=e.model.getLineMaxColumn(g.startLineNumber);g.startColumn===v?p=2:p=3}else p=1;const m=e.trackedRanges.length,_=e.model._setTrackedRange(null,g,p);return e.trackedRanges[m]=_,e.trackedRangesDirection[m]=g.getDirection(),m.toString()}};try{i.getEditOperations(e.model,u)}catch(d){return fi(d),{operations:[],hadTrackedEditOperation:!1}}return{operations:r,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,r)=>-q.compareRangesUsingEnds(i.range,r.range));const t={};for(let i=1;i<e.length;i++){const r=e[i-1],o=e[i];if(q.getStartPosition(r.range).isBefore(q.getEndPosition(o.range))){let s;r.identifier.major>o.identifier.major?s=r.identifier.major:s=o.identifier.major,t[s.toString()]=!0;for(let a=0;a<e.length;a++)e[a].identifier.major===s&&(e.splice(a,1),a<i&&i--,a--);i>0&&i--}}return t}}class kUi{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class qO{static _capture(e,t){const i=[];for(const r of t){if(r.startLineNumber!==r.endLineNumber)return null;i.push(new kUi(e.getLineContent(r.startLineNumber),r.startColumn-1,r.endColumn-1))}return i}constructor(e,t){this._original=qO._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=qO._capture(e,t);if(!i||this._original.length!==i.length)return null;const r=[];for(let o=0,s=this._original.length;o<s;o++)r.push(qO._deduceOutcome(this._original[o],i[o]));return r}static _deduceOutcome(e,t){const i=Math.min(e.startSelection,t.startSelection,Ax(e.text,t.text)),r=Math.min(e.text.length-e.endSelection,t.text.length-t.endSelection,DV(e.text,t.text)),o=e.text.substring(i,e.text.length-r),s=t.text.substring(i,t.text.length-r);return new DWi(o,e.startSelection-i,e.endSelection-i,s,t.startSelection-i,t.endSelection-i)}}var TUi=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const k2e={getInitialState:()=>JD,tokenizeEncoded:(n,e,t)=>eq(0,t)};function IUi(n,e,t){return TUi(this,void 0,void 0,function*(){if(!t)return T2e(e,n.languageIdCodec,k2e);const i=yield ps.getOrCreate(t);return T2e(e,n.languageIdCodec,i||k2e)})}function LUi(n,e,t,i,r,o,s){let a="<div>",l=i,c=0,u=!0;for(let d=0,h=e.getCount();d<h;d++){const g=e.getEndOffset(d);if(g<=i)continue;let p="";for(;l<g&&l<r;l++){const m=n.charCodeAt(l);switch(m){case 9:{let _=o-(l+c)%o;for(c+=_-1;_>0;)s&&u?(p+="&#160;",u=!1):(p+=" ",u=!0),_--;break}case 60:p+="&lt;",u=!1;break;case 62:p+="&gt;",u=!1;break;case 38:p+="&amp;",u=!1;break;case 0:p+="&#00;",u=!1;break;case 65279:case 8232:case 8233:case 133:p+="<22>",u=!1;break;case 13:p+="&#8203",u=!1;break;case 32:s&&u?(p+="&#160;",u=!1):(p+=" ",u=!0);break;default:p+=String.fromCharCode(m),u=!1}}if(a+=`<span style="${e.getInlineStyle(d,t)}">${p}</span>`,g>r||l>=r)break}return a+="</div>",a}function T2e(n,e,t){let i='<div class="monaco-tokenized-source">';const r=ab(n);let o=t.getInitialState();for(let s=0,a=r.length;s<a;s++){const l=r[s];s>0&&(i+="<br/>");const c=t.tokenizeEncoded(l,!0,o);el.convertToEndOffset(c.tokens,l.length);const d=new el(c.tokens,l,e).inflate();let h=0;for(let g=0,p=d.getCount();g<p;g++){const m=d.getClassName(g),_=d.getEndOffset(g);i+=`<span class="${m}">${LV(l.substring(h,_))}</span>`,h=_}o=c.endState}return i+="</div>",i}class DUi{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,i=this._changes,r=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,r)}}class AUi{constructor(e,t,i,r,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=r,this.minWidth=o,this.prefixSum=0}}let yKe=class Fse{constructor(e,t,i,r){this._instanceId=nUe(++Fse.INSTANCE_COUNT),this._pendingChanges=new DUi,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=r}static findInsertionIndex(e,t,i){let r=0,o=e.length;for(;r<o;){const s=r+o>>>1;t===e[s].afterLineNumber?i<e[s].ordinal?o=s:r=s+1:t<e[s].afterLineNumber?o=s:r=s+1}return r}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:(r,o,s,a)=>{t=!0,r=r|0,o=o|0,s=s|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new AUi(l,r,o,s,a)),l},changeOneWhitespace:(r,o,s)=>{t=!0,o=o|0,s=s|0,this._pendingChanges.change({id:r,newAfterLineNumber:o,newHeight:s})},removeWhitespace:r=>{t=!0,this._pendingChanges.remove({id:r})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const l of e)this._insertWhitespace(l);for(const l of t)this._changeOneWhitespace(l.id,l.newAfterLineNumber,l.newHeight);for(const l of i){const c=this._findWhitespaceIndex(l.id);c!==-1&&this._removeWhitespace(c)}return}const r=new Set;for(const l of i)r.add(l.id);const o=new Map;for(const l of t)o.set(l.id,l);const s=l=>{const c=[];for(const u of l)if(!r.has(u.id)){if(o.has(u.id)){const d=o.get(u.id);u.afterLineNumber=d.newAfterLineNumber,u.height=d.newHeight}c.push(u)}return c},a=s(this._arr).concat(s(e));a.sort((l,c)=>l.afterLineNumber===c.afterLineNumber?l.ordinal-c.ordinal:l.afterLineNumber-c.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=Fse.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 i=0,r=t.length;i<r;i++)if(t[i].id===e)return i;return-1}_changeOneWhitespace(e,t,i){const r=this._findWhitespaceIndex(e);if(r!==-1&&(this._arr[r].height!==i&&(this._arr[r].height=i,this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,r-1)),this._arr[r].afterLineNumber!==t)){const o=this._arr[r];this._removeWhitespace(r),o.afterLineNumber=t,this._insertWhitespace(o)}}_removeWhitespace(e){this._arr.splice(e,1),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,e-1)}onLinesDeleted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount-=t-e+1;for(let i=0,r=this._arr.length;i<r;i++){const o=this._arr[i].afterLineNumber;e<=o&&o<=t?this._arr[i].afterLineNumber=e-1:o>t&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let i=0,r=this._arr.length;i<r;i++){const o=this._arr[i].afterLineNumber;e<=o&&(this._arr[i].afterLineNumber+=t-e+1)}}getWhitespacesTotalHeight(){return this._checkPendingChanges(),this._arr.length===0?0:this.getWhitespacesAccumulatedHeight(this._arr.length-1)}getWhitespacesAccumulatedHeight(e){this._checkPendingChanges(),e=e|0;let t=Math.max(0,this._prefixSumValidIndex+1);t===0&&(this._arr[0].prefixSum=this._arr[0].height,t++);for(let i=t;i<=e;i++)this._arr[i].prefixSum=this._arr[i-1].prefixSum+this._arr[i].height;return this._prefixSumValidIndex=Math.max(this._prefixSumValidIndex,e),this._arr[e].prefixSum}getLinesTotalHeight(){this._checkPendingChanges();const e=this._lineHeight*this._lineCount,t=this.getWhitespacesTotalHeight();return e+t+this._paddingTop+this._paddingBottom}getWhitespaceAccumulatedHeightBeforeLineNumber(e){this._checkPendingChanges(),e=e|0;const t=this._findLastWhitespaceBeforeLineNumber(e);return t===-1?0:this.getWhitespacesAccumulatedHeight(t)}_findLastWhitespaceBeforeLineNumber(e){e=e|0;const t=this._arr;let i=0,r=t.length-1;for(;i<=r;){const s=(r-i|0)/2|0,a=i+s|0;if(t[a].afterLineNumber<e){if(a+1>=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else r=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const i=this._findLastWhitespaceBeforeLineNumber(e)+1;return i<this._arr.length?i:-1}getFirstWhitespaceIndexAfterLineNumber(e){return this._checkPendingChanges(),e=e|0,this._findFirstWhitespaceAfterLineNumber(e)}getVerticalOffsetForLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;let i;e>1?i=this._lineHeight*(e-1):i=0;const r=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return i+r+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const i=this._lineHeight*e,r=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return i+r+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,i=this._arr.length;t<i;t++)e=Math.max(e,this._arr[t].minWidth);this._minWidth=e}return this._minWidth}isAfterLines(e){this._checkPendingChanges();const t=this.getLinesTotalHeight();return e>t}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e<this._paddingTop)}isInBottomPadding(e){if(this._paddingBottom===0)return!1;this._checkPendingChanges();const t=this.getLinesTotalHeight();return e>=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const t=this._lineCount|0,i=this._lineHeight;let r=1,o=t;for(;r<o;){const s=(r+o)/2|0,a=this.getVerticalOffsetForLineNumber(s)|0;if(e>=a+i)r=s+1;else{if(e>=a)return s;o=s}}return r>t?t:r}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this._lineHeight,r=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(r)|0;let s=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(r)|0;const l=this.getWhitespacesCount()|0;let c,u;a===-1?(a=l,u=s+1,c=0):(u=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);let d=o,h=d;const g=5e5;let p=0;o>=g&&(p=Math.floor(o/g)*g,p=Math.floor(p/i)*i,h-=p);const m=[],_=e+(t-e)/2;let v=-1;for(let x=r;x<=s;x++){if(v===-1){const k=d,I=d+i;(k<=_&&_<I||k>_)&&(v=x)}for(d+=i,m[x-r]=h,h+=i;u===x;)h+=c,d+=c,a++,a>=l?u=s+1:(u=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(d>=t){s=x;break}}v===-1&&(v=s);const b=this.getVerticalOffsetForLineNumber(s)|0;let y=r,C=s;return y<C&&o<e&&y++,y<C&&b+i>t&&C--,{bigNumbersDelta:p,startLineNumber:r,endLineNumber:s,relativeVerticalOffset:m,centeredLineNumber:v,completelyVisibleStartLineNumber:y,completelyVisibleEndLineNumber:C}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeight*t:i=0;let r;return e>0?r=this.getWhitespacesAccumulatedHeight(e-1):r=0,i+r+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const r=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=r+o)return-1;for(;t<i;){const s=Math.floor((t+i)/2),a=this.getVerticalOffsetForWhitespaceIndex(s),l=this.getHeightForWhitespaceIndex(s);if(e>=a+l)t=s+1;else{if(e>=a)return s;i=s}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const r=this.getHeightForWhitespaceIndex(t),o=this.getIdForWhitespaceIndex(t),s=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:s,verticalOffset:i,height:r}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),r=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let s=i;s<=r;s++){const a=this.getVerticalOffsetForWhitespaceIndex(s),l=this.getHeightForWhitespaceIndex(s);if(a>=t)break;o.push({id:this.getIdForWhitespaceIndex(s),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(s),verticalOffset:a,height:l})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}};yKe.INSTANCE_COUNT=0;const RUi=125;class MN{constructor(e,t,i,r){e=e|0,t=t|0,i=i|0,r=r|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),r<0&&(r=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=r,this.scrollHeight=Math.max(i,r)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class NUi extends Ae{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new be),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new MN(0,0,0,0),this._scrollable=this._register(new w5({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 i=t.contentWidth!==e.contentWidth,r=t.contentHeight!==e.contentHeight;(i||r)&&this._onDidContentSizeChange.fire(new T_e(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)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class OUi extends Ae{constructor(e,t,i){super(),this._configuration=e;const r=this._configuration.options,o=r.get(143),s=r.get(83);this._linesLayout=new yKe(t,r.get(66),s.top,s.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new NUi(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new MN(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(113)?RUi:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(66)&&this._linesLayout.setLineHeight(t.get(66)),e.hasChanged(83)){const i=t.get(83);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(143)){const i=t.get(143),r=i.contentWidth,o=i.height,s=this._scrollable.getScrollDimensions(),a=s.contentWidth;this._scrollable.setScrollDimensions(new MN(r,s.contentWidth,o,this._getContentHeight(r,o,a)))}else this._updateHeight();e.hasChanged(113)&&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 r=this._configuration.options.get(102);return r.horizontal===2||e>=t?0:r.horizontalScrollbarSize}_getContentHeight(e,t,i){const r=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return r.get(104)?o+=Math.max(0,t-r.get(66)-r.get(83).bottom):o+=this._getHorizontalScrollbarHeight(e,i),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,r=e.contentWidth;this._scrollable.setScrollDimensions(new MN(t,e.contentWidth,i,this._getContentHeight(t,i,r)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new yDe(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new yDe(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(144),r=e.get(50),o=e.get(143);if(i.isViewportWrapping){const s=e.get(72);return t>o.contentWidth+r.typicalHalfwidthCharacterWidth&&s.enabled&&s.side==="right"?t+o.verticalScrollbarWidth:t}else{const s=e.get(103)*r.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+s+o.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new MN(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),r=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-r,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}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){t===1?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class PUi{constructor(e,t,i,r,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=r,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 i=this._decorationsCache[t];if(!i){const r=e.range,o=e.options;let s;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new Ce(r.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new Ce(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber)),1);s=new q(a.lineNumber,a.column,l.lineNumber,l.column)}else s=this._coordinatesConverter.convertModelRangeToViewRange(r,1);i=new lqe(s,o),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1,i=!1){const r=new q(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(r,t,i).inlineDecorations[0]}_getDecorationsInRange(e,t,i){const r=this._linesCollection.getDecorationsInRange(e,this.editorId,wV(this.configuration.options),t,i),o=e.startLineNumber,s=e.endLineNumber,a=[];let l=0;const c=[];for(let u=o;u<=s;u++)c[u-o]=[];for(let u=0,d=r.length;u<d;u++){const h=r[u],g=h.options;if(!D_e(this.model,h))continue;const p=this._getOrCreateViewModelDecoration(h),m=p.range;if(a[l++]=p,g.inlineClassName){const _=new OO(m,g.inlineClassName,g.inlineClassNameAffectsLetterSpacing?3:0),v=Math.max(o,m.startLineNumber),b=Math.min(s,m.endLineNumber);for(let y=v;y<=b;y++)c[y-o].push(_)}if(g.beforeContentClassName&&o<=m.startLineNumber&&m.startLineNumber<=s){const _=new OO(new q(m.startLineNumber,m.startColumn,m.startLineNumber,m.startColumn),g.beforeContentClassName,1);c[m.startLineNumber-o].push(_)}if(g.afterContentClassName&&o<=m.endLineNumber&&m.endLineNumber<=s){const _=new OO(new q(m.endLineNumber,m.endColumn,m.endLineNumber,m.endColumn),g.afterContentClassName,2);c[m.endLineNumber-o].push(_)}}return{decorations:a,inlineDecorations:c}}}function D_e(n,e){return!(e.options.hideInCommentTokens&&A_e(n,e)||e.options.hideInStringTokens&&R_e(n,e))}function A_e(n,e){return CKe(n,e.range,t=>t===1)}function R_e(n,e){return CKe(n,e.range,t=>t===2)}function CKe(n,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const r=n.tokenization.getLineTokens(i),o=i===e.startLineNumber,s=i===e.endLineNumber;let a=o?r.findTokenIndexAtOffset(e.startColumn-1):0;for(;a<r.getCount()&&!(s&&r.getStartOffset(a)>e.endColumn-1);){if(!t(r.getStandardTokenType(a)))return!1;a++}}return!0}function BZ(n,e){return n===null?e?lH.INSTANCE:cH.INSTANCE:new MUi(n,e)}class MUi{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,i){this._assertVisible();const r=i>0?this._projectionData.breakOffsets[i-1]:0,o=this._projectionData.breakOffsets[i];let s;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((c,u)=>new S_(0,0,c+1,this._projectionData.injectionOptions[u],0));s=S_.applyInjectedText(e.getLineContent(t),a).substring(r,o)}else s=e.getValueInRange({startLineNumber:t,startColumn:r+1,endLineNumber:t,endColumn:o+1});return i>0&&(s=I2e(this._projectionData.wrappedTextIndentLength)+s),s}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const r=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],r),r[0]}getViewLinesData(e,t,i,r,o,s,a){this._assertVisible();const l=this._projectionData,c=l.injectionOffsets,u=l.injectionOptions;let d=null;if(c){d=[];let g=0,p=0;for(let m=0;m<l.getOutputLineCount();m++){const _=new Array;d[m]=_;const v=m>0?l.breakOffsets[m-1]:0,b=l.breakOffsets[m];for(;p<c.length;){const y=u[p].content.length,C=c[p]+g,x=C+y;if(C>b)break;if(v<x){const k=u[p];if(k.inlineClassName){const I=m>0?l.wrappedTextIndentLength:0,L=I+Math.max(C-v,0),D=I+Math.min(x-v,b-v);L!==D&&_.push(new W9i(L,D,k.inlineClassName,k.inlineClassNameAffectsLetterSpacing))}}if(x<=b)g+=y,p++;else break}}}let h;c?h=e.tokenization.getLineTokens(t).withInserted(c.map((g,p)=>({offset:g,text:u[p].content,tokenMetadata:el.defaultTokenMetadata}))):h=e.tokenization.getLineTokens(t);for(let g=i;g<i+r;g++){const p=o+g-i;if(!s[p]){a[p]=null;continue}a[p]=this._getViewLineData(h,d?d[g]:null,g)}}_getViewLineData(e,t,i){this._assertVisible();const r=this._projectionData,o=i>0?r.wrappedTextIndentLength:0,s=i>0?r.breakOffsets[i-1]:0,a=r.breakOffsets[i],l=e.sliceAndInflate(s,a,o);let c=l.getLineContent();i>0&&(c=I2e(r.wrappedTextIndentLength)+c);const u=this._projectionData.getMinOutputOffset(i)+1,d=c.length+1,h=i+1<this.getViewLineCount(),g=i===0?0:r.breakOffsetsVisibleColumn[i-1];return new Jme(c,h,u,d,g,l,t)}getModelColumnOfViewPosition(e,t){return this._assertVisible(),this._projectionData.translateToInputOffset(e,t-1)+1}getViewPositionOfModelPosition(e,t,i=2){return this._assertVisible(),this._projectionData.translateToOutputPosition(t-1,i).toPosition(e)}getViewLineNumberOfModelPosition(e,t){this._assertVisible();const i=this._projectionData.translateToOutputPosition(t-1);return e+i.outputLineIndex}normalizePosition(e,t,i){const r=t.lineNumber-e;return this._projectionData.normalizeOutputPosition(e,t.column-1,i).toPosition(r)}getInjectedTextAt(e,t){return this._projectionData.getInjectedText(e,t-1)}_assertVisible(){if(!this._isVisible)throw new Error("Not supported")}}class lH{constructor(){}isVisible(){return!0}setVisible(e){return e?this:cH.INSTANCE}getProjectionData(){return null}getViewLineCount(){return 1}getViewLineContent(e,t,i){return e.getLineContent(t)}getViewLineLength(e,t,i){return e.getLineLength(t)}getViewLineMinColumn(e,t,i){return e.getLineMinColumn(t)}getViewLineMaxColumn(e,t,i){return e.getLineMaxColumn(t)}getViewLineData(e,t,i){const r=e.tokenization.getLineTokens(t),o=r.getLineContent();return new Jme(o,!1,1,o.length+1,0,r.inflate(),null)}getViewLinesData(e,t,i,r,o,s,a){if(!s[o]){a[o]=null;return}a[o]=this.getViewLineData(e,t,0)}getModelColumnOfViewPosition(e,t){return t}getViewPositionOfModelPosition(e,t){return new Ce(e,t)}getViewLineNumberOfModelPosition(e,t){return e}normalizePosition(e,t,i){return t}getInjectedTextAt(e,t){return null}}lH.INSTANCE=new lH;class cH{constructor(){}isVisible(){return!1}setVisible(e){return e?lH.INSTANCE:this}getProjectionData(){return null}getViewLineCount(){return 0}getViewLineContent(e,t,i){throw new Error("Not supported")}getViewLineLength(e,t,i){throw new Error("Not supported")}getViewLineMinColumn(e,t,i){throw new Error("Not supported")}getViewLineMaxColumn(e,t,i){throw new Error("Not supported")}getViewLineData(e,t,i){throw new Error("Not supported")}getViewLinesData(e,t,i,r,o,s,a){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,i){throw new Error("Not supported")}getInjectedTextAt(e,t){throw new Error("Not supported")}}cH.INSTANCE=new cH;const $Z=[""];function I2e(n){if(n>=$Z.length)for(let e=1;e<=n;e++)$Z[e]=FUi(e);return $Z[n]}function FUi(n){return new Array(n+1).join(" ")}class BUi{constructor(e,t,i,r,o,s,a,l,c,u){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=r,this.fontInfo=o,this.tabSize=s,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=c,this.wordBreak=u,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new VUi(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),r=this.model.getInjectedTextDecorations(this._editorId),o=i.length,s=this.createLineBreaksComputer(),a=new v0(S_.fromDecorations(r));for(let m=0;m<o;m++){const _=a.takeWhile(v=>v.lineNumber===m+1);s.addRequest(i[m],_,t?t[m]:null)}const l=s.finalize(),c=[],u=this.hiddenAreasDecorationIds.map(m=>this.model.getDecorationRange(m)).sort(q.compareRangesUsingStarts);let d=1,h=0,g=-1,p=g+1<u.length?h+1:o+2;for(let m=0;m<o;m++){const _=m+1;_===p&&(g++,d=u[g].startLineNumber,h=u[g].endLineNumber,p=g+1<u.length?h+1:o+2);const v=_>=d&&_<=h,b=BZ(l[m],!v);c[m]=b.getViewLineCount(),this.modelLineProjections[m]=b}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new w8i(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(h=>this.model.validateRange(h)),i=$Ui(t),r=this.hiddenAreasDecorationIds.map(h=>this.model.getDecorationRange(h)).sort(q.compareRangesUsingStarts);if(i.length===r.length){let h=!1;for(let g=0;g<i.length;g++)if(!i[g].equalsRange(r[g])){h=!0;break}if(!h)return!1}const o=i.map(h=>({range:h,options:hi.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,o);const s=i;let a=1,l=0,c=-1,u=c+1<s.length?l+1:this.modelLineProjections.length+2,d=!1;for(let h=0;h<this.modelLineProjections.length;h++){const g=h+1;g===u&&(c++,a=s[c].startLineNumber,l=s[c].endLineNumber,u=c+1<s.length?l+1:this.modelLineProjections.length+2);let p=!1;if(g>=a&&g<=l?this.modelLineProjections[h].isVisible()&&(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!1),p=!0):(d=!0,this.modelLineProjections[h].isVisible()||(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!0),p=!0)),p){const m=this.modelLineProjections[h].getViewLineCount();this.projectedModelLineLineCounts.setValue(h,m)}}return d||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.modelLineProjections.length?!1: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?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,r,o){const s=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===i,c=this.wrappingIndent===r,u=this.wordBreak===o;if(s&&a&&l&&c&&u)return!1;const d=s&&a&&!l&&c&&u;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=r,this.wordBreak=o;let h=null;if(d){h=[];for(let g=0,p=this.modelLineProjections.length;g<p;g++)h[g]=this.modelLineProjections[g].getProjectionData()}return this._constructLines(!1,h),!0}createLineBreaksComputer(){return(this.wrappingStrategy==="advanced"?this._domLineBreaksComputerFactory:this._monospaceLineBreaksComputerFactory).createLineBreaksComputer(this.fontInfo,this.tabSize,this.wrappingColumn,this.wrappingIndent,this.wordBreak)}onModelFlushed(){this._constructLines(!0,null)}onModelLinesDeleted(e,t,i){if(!e||e<=this._validModelVersionId)return null;const r=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,o=this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections.splice(t-1,i-t+1),this.projectedModelLineLineCounts.removeValues(t-1,i-t+1),new Pse(r,o)}onModelLinesInserted(e,t,i,r){if(!e||e<=this._validModelVersionId)return null;const o=t>2&&!this.modelLineProjections[t-2].isVisible(),s=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const l=[],c=[];for(let u=0,d=r.length;u<d;u++){const h=BZ(r[u],!o);l.push(h);const g=h.getViewLineCount();a+=g,c[u]=g}return this.modelLineProjections=this.modelLineProjections.slice(0,t-1).concat(l).concat(this.modelLineProjections.slice(t-1)),this.projectedModelLineLineCounts.insertValues(t-1,c),new Mse(s,s+a-1)}onModelLineChanged(e,t,i){if(e!==null&&e<=this._validModelVersionId)return[!1,null,null,null];const r=t-1,o=this.modelLineProjections[r].getViewLineCount(),s=this.modelLineProjections[r].isVisible(),a=BZ(i,s);this.modelLineProjections[r]=a;const l=this.modelLineProjections[r].getViewLineCount();let c=!1,u=0,d=-1,h=0,g=-1,p=0,m=-1;o>l?(u=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=u+l-1,p=d+1,m=p+(o-l)-1,c=!0):o<l?(u=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=u+o-1,h=d+1,g=h+(l-o)-1,c=!0):(u=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,d=u+l-1),this.projectedModelLineLineCounts.setValue(r,l);const _=u<=d?new bKe(u,d-u+1):null,v=h<=g?new Mse(h,g):null,b=p<=m?new Pse(p,m):null;return[c,_,v,b]}acceptVersionId(e){this._validModelVersionId=e,this.modelLineProjections.length===1&&!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:e|0}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const r=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),s=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.guides.getActiveIndentGuide(r.lineNumber,o.lineNumber,s.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),c=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:c.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,r=t.remainder;return new L2e(i+1,r)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),r=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new Ce(e.modelLineNumber,r)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),r=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new Ce(e.modelLineNumber,r)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),r=this.getViewLineInfo(t),o=new Array;let s=this.getModelStartPositionOfViewLine(i),a=new Array;for(let l=i.modelLineNumber;l<=r.modelLineNumber;l++){const c=this.modelLineProjections[l-1];if(c.isVisible()){const u=l===i.modelLineNumber?i.modelLineWrappedLineIdx:0,d=l===r.modelLineNumber?r.modelLineWrappedLineIdx+1:c.getViewLineCount();for(let h=u;h<d;h++)a.push(new L2e(l,h))}if(!c.isVisible()&&s){const u=new Ce(l-1,this.model.getLineMaxColumn(l-1)+1),d=q.fromPositions(s,u);o.push(new D2e(d,a)),a=[],s=null}else c.isVisible()&&!s&&(s=new Ce(l,1))}if(s){const l=q.fromPositions(s,this.getModelEndPositionOfViewLine(r));o.push(new D2e(l,a))}return o}getViewLinesBracketGuides(e,t,i,r){const o=i?this.convertViewPositionToModelPosition(i.lineNumber,i.column):null,s=[];for(const a of this.getViewLineInfosGroupedByModelRanges(e,t)){const l=a.modelRange.startLineNumber,c=this.model.guides.getLinesBracketGuides(l,a.modelRange.endLineNumber,o,r);for(const u of a.viewLines){const h=c[u.modelLineNumber-l].map(g=>{if(g.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,g.forWrappedLinesAfterColumn).lineNumber>=u.modelLineWrappedLineIdx||g.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,g.forWrappedLinesBeforeOrAtColumn).lineNumber<u.modelLineWrappedLineIdx)return;if(!g.horizontalLine)return g;let p=-1;if(g.column!==-1){const v=this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,g.column);if(v.lineNumber===u.modelLineWrappedLineIdx)p=v.column;else if(v.lineNumber<u.modelLineWrappedLineIdx)p=this.getMinColumnOfViewLine(u);else if(v.lineNumber>u.modelLineWrappedLineIdx)return}const m=this.convertModelPositionToViewPosition(u.modelLineNumber,g.horizontalLine.endColumn),_=this.modelLineProjections[u.modelLineNumber-1].getViewPositionOfModelPosition(0,g.horizontalLine.endColumn);return _.lineNumber===u.modelLineWrappedLineIdx?new RE(g.visibleColumn,p,g.className,new BO(g.horizontalLine.top,m.column),-1,-1):_.lineNumber<u.modelLineWrappedLineIdx||g.visibleColumn!==-1?void 0:new RE(g.visibleColumn,p,g.className,new BO(g.horizontalLine.top,this.getMaxColumnOfViewLine(u)),-1,-1)});s.push(h.filter(g=>!!g))}}return s}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),r=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const s=[],a=[],l=i.lineNumber-1,c=r.lineNumber-1;let u=null;for(let p=l;p<=c;p++){const m=this.modelLineProjections[p];if(m.isVisible()){const _=m.getViewLineNumberOfModelPosition(0,p===l?i.column:1),v=m.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(p+1)),b=v-_+1;let y=0;b>1&&m.getViewLineMinColumn(this.model,p+1,v)===1&&(y=_===0?1:2),s.push(b),a.push(y),u===null&&(u=new Ce(p+1,0))}else u!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(u.lineNumber,p)),u=null)}u!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(u.lineNumber,r.lineNumber)),u=null);const d=t-e+1,h=new Array(d);let g=0;for(let p=0,m=o.length;p<m;p++){let _=o[p];const v=Math.min(d-g,s[p]),b=a[p];let y;b===2?y=0:b===1?y=1:y=v;for(let C=0;C<v;C++)C===y&&(_=0),h[g++]=_}return h}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,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const r=this.projectedModelLineLineCounts.getIndexOf(e-1);let o=e;const s=r.index,a=r.remainder,l=[];for(let c=s,u=this.model.getLineCount();c<u;c++){const d=this.modelLineProjections[c];if(!d.isVisible())continue;const h=c===s?a:0;let g=d.getViewLineCount()-h,p=!1;if(o+g>t&&(p=!0,g=t-o+1),d.getViewLinesData(this.model,c+1,h,g,o-e,i,l),o+=g,p)break}return l}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const r=this.projectedModelLineLineCounts.getIndexOf(e-1),o=r.index,s=r.remainder,a=this.modelLineProjections[o],l=a.getViewLineMinColumn(this.model,o+1,s),c=a.getViewLineMaxColumn(this.model,o+1,s);t<l&&(t=l),t>c&&(t=c);const u=a.getModelColumnOfViewPosition(s,t);return this.model.validatePosition(new Ce(o+1,u)).equals(i)?new Ce(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),r=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new q(i.lineNumber,i.column,r.lineNumber,r.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),r=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new Ce(i.modelLineNumber,r))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new q(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,r=!1,o=!1){const s=this.model.validatePosition(new Ce(e,t)),a=s.lineNumber,l=s.column;let c=a-1,u=!1;if(o)for(;c<this.modelLineProjections.length&&!this.modelLineProjections[c].isVisible();)c++,u=!0;else for(;c>0&&!this.modelLineProjections[c].isVisible();)c--,u=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new Ce(r?0:1,1);const d=1+this.projectedModelLineLineCounts.getPrefixSum(c);let h;return u?o?h=this.modelLineProjections[c].getViewPositionOfModelPosition(d,1,i):h=this.modelLineProjections[c].getViewPositionOfModelPosition(d,this.model.getLineMaxColumn(c+1),i):h=this.modelLineProjections[a-1].getViewPositionOfModelPosition(d,l,i),h}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return q.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),r=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new q(i.lineNumber,i.column,r.lineNumber,r.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const o=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(o,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(i===0&&!this.modelLineProjections[i].isVisible())return 1;const r=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(r,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,r,o){const s=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-s.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new q(s.lineNumber,1,a.lineNumber,a.column),t,i,r,o);let l=[];const c=s.lineNumber-1,u=a.lineNumber-1;let d=null;for(let m=c;m<=u;m++)if(this.modelLineProjections[m].isVisible())d===null&&(d=new Ce(m+1,m===c?s.column:1));else if(d!==null){const v=this.model.getLineMaxColumn(m);l=l.concat(this.model.getDecorationsInRange(new q(d.lineNumber,d.column,m,v),t,i,r)),d=null}d!==null&&(l=l.concat(this.model.getDecorationsInRange(new q(d.lineNumber,d.column,a.lineNumber,a.column),t,i,r)),d=null),l.sort((m,_)=>{const v=q.compareRangesUsingStarts(m.range,_.range);return v===0?m.id<_.id?-1:m.id>_.id?1:0:v});const h=[];let g=0,p=null;for(const m of l){const _=m.id;p!==_&&(p=_,h[g++]=m)}return h}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function $Ui(n){if(n.length===0)return[];const e=n.slice();e.sort(q.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,r=e[0].endLineNumber;for(let o=1,s=e.length;o<s;o++){const a=e[o];a.startLineNumber>r+1?(t.push(new q(i,1,r,1)),i=a.startLineNumber,r=a.endLineNumber):a.endLineNumber>r&&(r=a.endLineNumber)}return t.push(new q(i,1,r,1)),t}class L2e{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class D2e{constructor(e,t){this.modelRange=e,this.viewLines=t}}class VUi{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,i,r){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,r)}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 HUi{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new WUi(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,r){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,r)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new Pse(t,i)}onModelLinesInserted(e,t,i,r){return new Mse(t,i)}onModelLineChanged(e,t,i){return[!1,new bKe(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,r=new Array(i);for(let o=0;o<i;o++)r[o]=0;return r}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.tokenization.getLineTokens(e),i=t.getLineContent();return new Jme(i,!1,1,i.length+1,0,t.inflate(),null)}getViewLinesData(e,t,i){const r=this.model.getLineCount();e=Math.min(Math.max(1,e),r),t=Math.min(Math.max(1,t),r);const o=[];for(let s=e;s<=t;s++){const a=s-e;o[a]=i[a]?this.getViewLineData(s):null}return o}getDecorationsInRange(e,t,i,r,o){return this.model.getDecorationsInRange(e,t,i,r,o)}normalizePosition(e,t){return this.model.normalizePosition(e,t)}getLineIndentColumn(e){return this.model.getLineIndentColumn(e)}getInjectedTextAt(e){return null}}class WUi{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}}let zUi=class extends Ae{constructor(e,t,i,r,o,s,a,l,c){if(super(),this.languageConfigurationService=a,this._themeService=l,this._attachedView=c,this.hiddenAreasModel=new UUi,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new fUi,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new NT(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new so(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=N_e.create(this.model),this.model.isTooLargeForTokenization())this._lines=new HUi(this.model);else{const u=this._configuration.options,d=u.get(50),h=u.get(137),g=u.get(144),p=u.get(136),m=u.get(128);this._lines=new BUi(this._editorId,this.model,r,o,d,this.model.getOptions().tabSize,h,g.wrappingColumn,p,m)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new EUi(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new OUi(this._configuration,this.getLineCount(),s)),this._register(this.viewLayout.onDidScroll(u=>{u.scrollTopChanged&&this._handleVisibleLinesChanged(),u.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new lUi(u)),this._eventDispatcher.emitOutgoingEvent(new L_e(u.oldScrollWidth,u.oldScrollLeft,u.oldScrollHeight,u.oldScrollTop,u.scrollWidth,u.scrollLeft,u.scrollHeight,u.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(u=>{this._eventDispatcher.emitOutgoingEvent(u)})),this._decorations=new PUi(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(u=>{try{const d=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(d,u)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(T5.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new dUi)})),this._register(this._themeService.onDidColorThemeChange(u=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new cUi(u))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),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())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new q(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new sUi(e)),this._eventDispatcher.emitOutgoingEvent(new I_e(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new nUi)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new iUi)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new Ce(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new R2e(t,this._viewportStart.startLineDelta)}return new R2e(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),r=this._configuration.options,o=r.get(50),s=r.get(137),a=r.get(144),l=r.get(136),c=r.get(128);this._lines.setWrappingSettings(o,s,a.wrappingColumn,l,c)&&(e.emitViewEvent(new BB),e.emitViewEvent(new $B),e.emitViewEvent(new FT(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(90)&&(this._decorations.reset(),e.emitViewEvent(new FT(null))),e.emitViewEvent(new rUi(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),NT.shouldRecreate(t)&&(this.cursorConfig=new NT(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const i=this._eventDispatcher.beginEmitViewEvents();let r=!1,o=!1;const s=e instanceof tx?e.rawContentChangedEvent.changes:e.changes,a=e instanceof tx?e.rawContentChangedEvent.versionId:null,l=this._lines.createLineBreaksComputer();for(const d of s)switch(d.changeType){case 4:{for(let h=0;h<d.detail.length;h++){const g=d.detail[h];let p=d.injectedTexts[h];p&&(p=p.filter(m=>!m.ownerId||m.ownerId===this._editorId)),l.addRequest(g,p,null)}break}case 2:{let h=null;d.injectedText&&(h=d.injectedText.filter(g=>!g.ownerId||g.ownerId===this._editorId)),l.addRequest(d.detail,h,null);break}}const c=l.finalize(),u=new v0(c);for(const d of s)switch(d.changeType){case 1:{this._lines.onModelFlushed(),i.emitViewEvent(new BB),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),r=!0;break}case 3:{const h=this._lines.onModelLinesDeleted(a,d.fromLineNumber,d.toLineNumber);h!==null&&(i.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber)),r=!0;break}case 4:{const h=u.takeCount(d.detail.length),g=this._lines.onModelLinesInserted(a,d.fromLineNumber,d.toLineNumber,h);g!==null&&(i.emitViewEvent(g),this.viewLayout.onLinesInserted(g.fromLineNumber,g.toLineNumber)),r=!0;break}case 2:{const h=u.dequeue(),[g,p,m,_]=this._lines.onModelLineChanged(a,d.lineNumber,h);o=g,p&&i.emitViewEvent(p),m&&(i.emitViewEvent(m),this.viewLayout.onLinesInserted(m.fromLineNumber,m.toLineNumber)),_&&(i.emitViewEvent(_),this.viewLayout.onLinesDeleted(_.fromLineNumber,_.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!r&&o&&(i.emitViewEvent(new $B),i.emitViewEvent(new FT(null)),this._cursor.onLineMappingChanged(i),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const i=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(i){const r=this.coordinatesConverter.convertModelPositionToViewPosition(i.getStartPosition()),o=this.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber);this.viewLayout.setScrollPosition({scrollTop:o+this._viewportStart.startLineDelta},1)}}try{const i=this._eventDispatcher.beginEmitViewEvents();e instanceof tx&&i.emitOutgoingEvent(new CUi(e.contentChangedEvent)),this._cursor.onModelContentChanged(i,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let i=0,r=e.ranges.length;i<r;i++){const o=e.ranges[i],s=this.coordinatesConverter.convertModelPositionToViewPosition(new Ce(o.fromLineNumber,1)).lineNumber,a=this.coordinatesConverter.convertModelPositionToViewPosition(new Ce(o.toLineNumber,this.model.getLineMaxColumn(o.toLineNumber))).lineNumber;t[i]={fromLineNumber:s,toLineNumber:a}}this._eventDispatcher.emitSingleViewEvent(new uUi(t)),this._eventDispatcher.emitOutgoingEvent(new SUi(e))})),this._register(this.model.onDidChangeLanguageConfiguration(e=>{this._eventDispatcher.emitSingleViewEvent(new aUi),this.cursorConfig=new NT(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new yUi(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new NT(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new bUi(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new BB),t.emitViewEvent(new $B),t.emitViewEvent(new FT(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new NT(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new wUi(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new FT(e)),this._eventDispatcher.emitOutgoingEvent(new vUi(e))}))}setHiddenAreas(e,t){this.hiddenAreasModel.setHiddenAreas(t,e);const i=this.hiddenAreasModel.getMergedRanges();if(i===this.previousHiddenAreas)return;this.previousHiddenAreas=i;const r=this._captureStableViewport();let o=!1;try{const s=this._eventDispatcher.beginEmitViewEvents();o=this._lines.setHiddenAreas(i),o&&(s.emitViewEvent(new BB),s.emitViewEvent(new $B),s.emitViewEvent(new FT(null)),this._cursor.onLineMappingChanged(s),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged()),r.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),o&&this._eventDispatcher.emitOutgoingEvent(new mUi)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(143),t=this._configuration.options.get(66),i=Math.max(20,Math.round(e.height/t)),r=this.viewLayout.getLinesViewportData(),o=Math.max(1,r.completelyVisibleStartLineNumber-i),s=Math.min(this.getLineCount(),r.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new q(o,this.getLineMinColumn(o),s,this.getLineMaxColumn(s)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(i.length===0)return[t];const r=[];let o=0,s=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,c=t.endColumn;for(let u=0,d=i.length;u<d;u++){const h=i[u].startLineNumber,g=i[u].endLineNumber;g<s||h>l||(s<h&&(r[o++]=new q(s,a,h-1,this.model.getLineMaxColumn(h-1))),s=g+1,a=1)}return(s<l||s===l&&a<c)&&(r[o++]=new q(s,a,l,c)),r}getCompletelyVisibleViewRange(){const e=this.viewLayout.getLinesViewportData(),t=e.completelyVisibleStartLineNumber,i=e.completelyVisibleEndLineNumber;return new q(t,this.getLineMinColumn(t),i,this.getLineMaxColumn(i))}getCompletelyVisibleViewRangeAtScrollTop(e){const t=this.viewLayout.getLinesViewportDataAtScrollTop(e),i=t.completelyVisibleStartLineNumber,r=t.completelyVisibleEndLineNumber;return new q(i,this.getLineMinColumn(i),r,this.getLineMaxColumn(r))}saveState(){const e=this.viewLayout.saveState(),t=e.scrollTop,i=this.viewLayout.getLineNumberAtVerticalOffset(t),r=this.coordinatesConverter.convertViewPositionToModelPosition(new Ce(i,this.getLineMinColumn(i))),o=this.viewLayout.getVerticalOffsetForLineNumber(i)-t;return{scrollLeft:e.scrollLeft,firstPosition:r,firstPositionDeltaTop:o}}reduceRestoreState(e){if(typeof e.firstPosition>"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),r=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:r}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,r){return this._lines.getViewLinesBracketGuides(e,t,i,r)}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=cu(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=g_(this.getLineContent(e));return t===-1?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){const r=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,r)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const i=this.model.mightContainRTL(),r=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),s=this._lines.getViewLineData(e);return s.inlineDecorations&&(t=[...t,...s.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new gf(s.minColumn,s.maxColumn,s.content,s.continuesWithWrappedLine,i,r,s.tokens,t,o,s.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const r=this._lines.getViewLinesData(e,t,i);return new H9i(this.getTabSize(),r)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,wV(this._configuration.options)),i=new jUi;for(const r of t){const o=r.options,s=o.overviewRuler;if(!s)continue;const a=s.position;if(a===0)continue;const l=s.getColor(e.value),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(r.range.startLineNumber,r.range.startColumn),u=this.coordinatesConverter.getViewLineNumberOfModelPosition(r.range.endLineNumber,r.range.endColumn);i.accept(l,o.zIndex,c,u,a)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const i=t.options.overviewRuler;i==null||i.invalidateCachedColor();const r=t.options.minimap;r==null||r.invalidateCachedColor()}}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e);return this.model.modifyPosition(i,t)}deduceModelPositionRelativeToViewPosition(e,t,i){const r=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const s=this.model.getOffsetAt(r)+t;return this.model.getPositionAt(s)}getPlainTextToCopy(e,t,i){const r=i?`\r
`:this.model.getEOL();e=e.slice(0),e.sort(q.compareRangesUsingStarts);let o=!1,s=!1;for(const l of e)l.isEmpty()?o=!0:s=!0;if(!s){if(!t)return"";const l=e.map(u=>u.startLineNumber);let c="";for(let u=0;u<l.length;u++)u>0&&l[u-1]===l[u]||(c+=this.model.getLineContent(l[u])+r);return c}if(o&&t){const l=[];let c=0;for(const u of e){const d=u.startLineNumber;u.isEmpty()?d!==c&&l.push(this.model.getLineContent(d)):l.push(this.model.getValueInRange(u,i?2:0)),c=d}return l.length===1?l[0]:l}const a=[];for(const l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,i?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===nf||e.length!==1)return null;let r=e[0];if(r.isEmpty()){if(!t)return null;const u=r.startLineNumber;r=new q(u,this.model.getLineMinColumn(u),u,this.model.getLineMaxColumn(u))}const o=this._configuration.options.get(50),s=this._getColorMap(),l=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===ih.fontFamily;let c;return l?c=ih.fontFamily:(c=o.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${ih.fontFamily}`),{mode:i,html:`<div style="color: ${s[1]};background-color: ${s[2]};font-family: ${c};font-weight: ${o.fontWeight};font-size: ${o.fontSize}px;line-height: ${o.lineHeight}px;white-space: pre;">`+this._getHTMLToCopy(r,s)+"</div>"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,r=e.startColumn,o=e.endLineNumber,s=e.endColumn,a=this.getTabSize();let l="";for(let c=i;c<=o;c++){const u=this.model.tokenization.getLineTokens(c),d=u.getLineContent(),h=c===i?r-1:0,g=c===o?s-1:d.length;d===""?l+="<br>":l+=LUi(d,u.inflate(),t,h,g,a,vc)}return l}_getColorMap(){const e=ps.getColorMap(),t=["#000000"];if(e)for(let i=1,r=e.length;i<r;i++)t[i]=De.Format.CSS.formatHex(e[i]);return t}getPrimaryCursorState(){return this._cursor.getPrimaryCursorState()}getLastAddedCursorIndex(){return this._cursor.getLastAddedCursorIndex()}getCursorStates(){return this._cursor.getCursorStates()}setCursorStates(e,t,i){return this._withViewEventsCollector(r=>this._cursor.setStates(r,e,t,i))}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,i=0){this._withViewEventsCollector(r=>this._cursor.setSelections(r,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new _Ui);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(r=>this._cursor.executeEdits(r,e,t,i))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,r,o){this._executeCursorEdit(s=>this._cursor.compositionType(s,e,t,i,r,o))}paste(e,t,i,r){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,i,r))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(r=>this._cursor.revealPrimary(r,e,i,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new q(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(r=>r.emitViewEvent(new H8(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new q(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(r=>r.emitViewEvent(new H8(e,!1,i,null,0,!0,0)))}revealRange(e,t,i,r,o){this._withViewEventsCollector(s=>s.emitViewEvent(new H8(e,!1,i,null,r,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new hUi),this._eventDispatcher.emitOutgoingEvent(new pUi))}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class N_e{static create(e){const t=e._setTrackedRange(null,new q(1,1,1,1),1);return new N_e(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,r,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=r,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new Ce(t,e.getLineMinColumn(t))),r=e.model._setTrackedRange(this._modelTrackedRange,new q(i.lineNumber,i.column,i.lineNumber,i.column),1),o=e.viewLayout.getVerticalOffsetForLineNumber(t),s=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=r,this._startLineDelta=s-o}invalidate(){this._isValid=!1}}class jUi{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,r,o){const s=this._asMap[e];if(s){const a=s.data,l=a[a.length-3],c=a[a.length-1];if(l===o&&c+1>=i){r>c&&(a[a.length-1]=r);return}a.push(o,i,r)}else{const a=new OM(e,t,[o,i,r]);this._asMap[e]=a,this.asArray.push(a)}}}class UUi{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&A2e(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce((t,i)=>qUi(t,i),[]);return A2e(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function qUi(n,e){const t=[];let i=0,r=0;for(;i<n.length&&r<e.length;){const o=n[i],s=e[r];if(o.endLineNumber<s.startLineNumber-1)t.push(n[i++]);else if(s.endLineNumber<o.startLineNumber-1)t.push(e[r++]);else{const a=Math.min(o.startLineNumber,s.startLineNumber),l=Math.max(o.endLineNumber,s.endLineNumber);t.push(new q(a,1,l,1)),i++,r++}}for(;i<n.length;)t.push(n[i++]);for(;r<e.length;)t.push(e[r++]);return t}function A2e(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].equalsRange(e[t]))return!1;return!0}class R2e{constructor(e,t){this.viewportStartModelPosition=e,this.startLineDelta=t}recoverViewportStart(e,t){if(!this.viewportStartModelPosition)return;const i=e.convertModelPositionToViewPosition(this.viewportStartModelPosition),r=t.getVerticalOffsetForLineNumber(i.lineNumber);t.setScrollPosition({scrollTop:r+this.startLineDelta},1)}}class gq{constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}get(e){return this._entries.get(e)}}var JM;(function(n){n[n.Ignore=0]="Ignore",n[n.Info=1]="Info",n[n.Warning=2]="Warning",n[n.Error=3]="Error"})(JM||(JM={}));(function(n){const e="error",t="warning",i="warn",r="info",o="ignore";function s(l){return l?OI(e,l)?n.Error:OI(t,l)||OI(i,l)?n.Warning:OI(r,l)?n.Info:n.Ignore:n.Ignore}n.fromValue=s;function a(l){switch(l){case n.Error:return e;case n.Warning:return t;case n.Info:return r;default:return o}}n.toString=a})(JM||(JM={}));const js=JM;var pq=js;const ga=Vi("notificationService");class KUi{}class KO{constructor(e,t,i,r,o){this.injectionOffsets=e,this.injectionOptions=t,this.breakOffsets=i,this.breakOffsetsVisibleColumn=r,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 r=this.breakOffsets[e]-t;return e>0&&(r+=this.wrappedTextIndentLength),r}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let r=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let o=0;o<this.injectionOffsets.length&&r>this.injectionOffsets[o];o++)r<this.injectionOffsets[o]+this.injectionOptions[o].content.length?r=this.injectionOffsets[o]:r-=this.injectionOptions[o].content.length;return r}translateToOutputPosition(e,t=2){let i=e;if(this.injectionOffsets!==null)for(let r=0;r<this.injectionOffsets.length&&!(e<this.injectionOffsets[r]||t!==1&&e===this.injectionOffsets[r]);r++)i+=this.injectionOptions[r].content.length;return this.offsetInInputWithInjectionsToOutputPosition(i,t)}offsetInInputWithInjectionsToOutputPosition(e,t=2){let i=0,r=this.breakOffsets.length-1,o=0,s=0;for(;i<=r;){o=i+(r-i)/2|0;const l=this.breakOffsets[o];if(s=o>0?this.breakOffsets[o-1]:0,t===0)if(e<=s)r=o-1;else if(e>l)i=o+1;else break;else if(e<s)r=o-1;else if(e>=l)i=o+1;else break}let a=e-s;return o>0&&(a+=this.wrappedTextIndentLength),new VB(o,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const r=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(r,i);if(o!==r)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(i===0){if(e>0&&t===this.getMinOutputOffset(e))return new VB(e-1,this.getMaxOutputOffset(e-1))}else if(i===1){const r=this.getOutputLineCount()-1;if(e<r&&t===this.getMaxOutputOffset(e))return new VB(e+1,this.getMinOutputOffset(e+1))}return new VB(e,t)}outputPositionToOffsetInInputWithInjections(e,t){return e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(t===2){if(e===i.offsetInInputWithInjections+i.length&&N2e(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let r=i.offsetInInputWithInjections;if(O2e(this.injectionOptions[i.injectedTextIndex].cursorStops))return r;let o=i.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[i.injectedTextIndex]&&!(N2e(this.injectionOptions[o].cursorStops)||(r-=this.injectionOptions[o].content.length,O2e(this.injectionOptions[o].cursorStops)));)o--;return r}}else if(t===1||t===4){let r=i.offsetInInputWithInjections+i.length,o=i.injectedTextIndex;for(;o+1<this.injectionOffsets.length&&this.injectionOffsets[o+1]===this.injectionOffsets[o];)r+=this.injectionOptions[o+1].content.length,o++;return r}else if(t===0||t===3){let r=i.offsetInInputWithInjections,o=i.injectedTextIndex;for(;o-1>=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)r-=this.injectionOptions[o-1].content.length,o--;return r}VU()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),r=this.getInjectedTextAtOffset(i);return r?{options:this.injectionOptions[r.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let r=0;for(let o=0;o<t.length;o++){const s=i[o].content.length,a=t[o]+r,l=t[o]+r+s;if(a>e)break;if(e<=l)return{injectedTextIndex:o,offsetInInputWithInjections:a,length:s};r+=s}}}}function N2e(n){return n==null?!0:n===r_.Right||n===r_.Both}function O2e(n){return n==null?!0:n===r_.Left||n===r_.Both}class VB{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new Ce(e+this.outputLineIndex,this.outputOffset+1)}}class O_e{static create(e){return new O_e(e.get(132),e.get(131))}constructor(e,t){this.classifier=new GUi(e,t)}createLineBreaksComputer(e,t,i,r,o){const s=[],a=[],l=[];return{addRequest:(c,u,d)=>{s.push(c),a.push(u),l.push(d)},finalize:()=>{const c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,u=[];for(let d=0,h=s.length;d<h;d++){const g=a[d],p=l[d];p&&!p.injectionOptions&&!g?u[d]=YUi(this.classifier,p,s[d],t,i,c,r,o):u[d]=QUi(this.classifier,s[d],g,t,i,c,r,o)}return Bse.length=0,$se.length=0,u}}}}class GUi extends EA{constructor(e,t){super(0);for(let i=0;i<e.length;i++)this.set(e.charCodeAt(i),1);for(let i=0;i<t.length;i++)this.set(t.charCodeAt(i),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 Bse=[],$se=[];function YUi(n,e,t,i,r,o,s,a){if(r===-1)return null;const l=t.length;if(l<=1)return null;const c=a==="keepAll",u=e.breakOffsets,d=e.breakOffsetsVisibleColumn,h=wKe(t,i,r,o,s),g=r-h,p=Bse,m=$se;let _=0,v=0,b=0,y=r;const C=u.length;let x=0;if(x>=0){let k=Math.abs(d[x]-y);for(;x+1<C;){const I=Math.abs(d[x+1]-y);if(I>=k)break;k=I,x++}}for(;x<C;){let k=x<0?0:u[x],I=x<0?0:d[x];v>k&&(k=v,I=b);let L=0,D=0,R=0,P=0;if(I<=y){let O=I,B=k===0?0:t.charCodeAt(k-1),F=k===0?0:n.get(B),H=!0;for(let V=k;V<l;V++){const $=V,j=t.charCodeAt(V);let Y,ne;if(Za(j)?(V++,Y=0,ne=2):(Y=n.get(j),ne=GO(j,O,i,o)),$>v&&Vse(B,F,j,Y,c)&&(L=$,D=O),O+=ne,O>y){$>v?(R=$,P=O-ne):(R=V+1,P=O),O-D>g&&(L=0),H=!1;break}B=j,F=Y}if(H){_>0&&(p[_]=u[u.length-1],m[_]=d[u.length-1],_++);break}}if(L===0){let O=I,B=t.charCodeAt(k),F=n.get(B),H=!1;for(let V=k-1;V>=v;V--){const $=V+1,j=t.charCodeAt(V);if(j===9){H=!0;break}let Y,ne;if(Rx(j)?(V--,Y=0,ne=2):(Y=n.get(j),ne=aw(j)?o:1),O<=y){if(R===0&&(R=$,P=O),O<=y-g)break;if(Vse(j,Y,B,F,c)){L=$,D=O;break}}O-=ne,B=j,F=Y}if(L!==0){const V=g-(P-D);if(V<=i){const $=t.charCodeAt(R);let j;Za($)?j=2:j=GO($,P,i,o),V-j<0&&(L=0)}}if(H){x--;continue}}if(L===0&&(L=R,D=P),L<=v){const O=t.charCodeAt(v);Za(O)?(L=v+2,D=b+2):(L=v+1,D=b+GO(O,b,i,o))}for(v=L,p[_]=L,b=D,m[_]=D,_++,y=D+g;x<0||x<C&&d[x]<D;)x++;let M=Math.abs(d[x]-y);for(;x+1<C;){const O=Math.abs(d[x+1]-y);if(O>=M)break;M=O,x++}}return _===0?null:(p.length=_,m.length=_,Bse=e.breakOffsets,$se=e.breakOffsetsVisibleColumn,e.breakOffsets=p,e.breakOffsetsVisibleColumn=m,e.wrappedTextIndentLength=h,e)}function QUi(n,e,t,i,r,o,s,a){const l=S_.applyInjectedText(e,t);let c,u;if(t&&t.length>0?(c=t.map(D=>D.options),u=t.map(D=>D.column-1)):(c=null,u=null),r===-1)return c?new KO(u,c,[l.length],[],0):null;const d=l.length;if(d<=1)return c?new KO(u,c,[l.length],[],0):null;const h=a==="keepAll",g=wKe(l,i,r,o,s),p=r-g,m=[],_=[];let v=0,b=0,y=0,C=r,x=l.charCodeAt(0),k=n.get(x),I=GO(x,0,i,o),L=1;Za(x)&&(I+=1,x=l.charCodeAt(1),k=n.get(x),L++);for(let D=L;D<d;D++){const R=D,P=l.charCodeAt(D);let M,O;Za(P)?(D++,M=0,O=2):(M=n.get(P),O=GO(P,I,i,o)),Vse(x,k,P,M,h)&&(b=R,y=I),I+=O,I>C&&((b===0||I-y>p)&&(b=R,y=I-O),m[v]=b,_[v]=y,v++,C=y+p,b=0),x=P,k=M}return v===0&&(!t||t.length===0)?null:(m[v]=d,_[v]=I,new KO(u,c,m,_,g))}function GO(n,e,t,i){return n===9?t-e%t:aw(n)||n<32?i:1}function P2e(n,e){return e-n%e}function Vse(n,e,t,i,r){return t!==32&&(e===2&&i!==2||e!==1&&i===1||!r&&e===3&&i!==2||!r&&i===3&&e!==1)}function wKe(n,e,t,i,r){let o=0;if(r!==0){const s=cu(n);if(s!==-1){for(let l=0;l<s;l++){const c=n.charCodeAt(l)===9?P2e(o,e):1;o+=c}const a=r===3?2:r===2?1:0;for(let l=0;l<a;l++){const c=P2e(o,e);o+=c}o+i>t&&(o=0)}}return o}const VZ=R0("domLineBreaksComputer",{createHTML:n=>n});class P_e{static create(){return new P_e}constructor(){}createLineBreaksComputer(e,t,i,r,o){const s=[],a=[];return{addRequest:(l,c,u)=>{s.push(l),a.push(c)},finalize:()=>XUi(s,e,t,i,r,o,a)}}}function XUi(n,e,t,i,r,o,s){var a;function l(D){const R=s[D];if(R){const P=S_.applyInjectedText(n[D],R),M=R.map(B=>B.options),O=R.map(B=>B.column-1);return new KO(O,M,[P.length],[],0)}else return null}if(i===-1){const D=[];for(let R=0,P=n.length;R<P;R++)D[R]=l(R);return D}const c=Math.round(i*e.typicalHalfwidthCharacterWidth),d=Math.round(t*(r===3?2:r===2?1:0)),h=Math.ceil(e.spaceWidth*d),g=document.createElement("div");mc(g,e);const p=new SA(1e4),m=[],_=[],v=[],b=[],y=[];for(let D=0;D<n.length;D++){const R=S_.applyInjectedText(n[D],s[D]);let P=0,M=0,O=c;if(r!==0)if(P=cu(R),P===-1)P=0;else{for(let V=0;V<P;V++){const $=R.charCodeAt(V)===9?t-M%t:1;M+=$}const H=Math.ceil(e.spaceWidth*M);H+e.typicalFullwidthCharacterWidth>c?(P=0,M=0):O=c-H}const B=R.substr(P),F=ZUi(B,M,t,O,p,h);m[D]=P,_[D]=M,v[D]=B,b[D]=F[0],y[D]=F[1]}const C=p.build(),x=(a=VZ==null?void 0:VZ.createHTML(C))!==null&&a!==void 0?a:C;g.innerHTML=x,g.style.position="absolute",g.style.top="10000",o==="keepAll"?(g.style.wordBreak="keep-all",g.style.overflowWrap="anywhere"):(g.style.wordBreak="inherit",g.style.overflowWrap="break-word"),document.body.appendChild(g);const k=document.createRange(),I=Array.prototype.slice.call(g.children,0),L=[];for(let D=0;D<n.length;D++){const R=I[D],P=JUi(k,R,v[D],b[D]);if(P===null){L[D]=l(D);continue}const M=m[D],O=_[D]+d,B=y[D],F=[];for(let j=0,Y=P.length;j<Y;j++)F[j]=B[P[j]];if(M!==0)for(let j=0,Y=P.length;j<Y;j++)P[j]+=M;let H,V;const $=s[D];$?(H=$.map(j=>j.options),V=$.map(j=>j.column-1)):(H=null,V=null),L[D]=new KO(V,H,P,F,O)}return document.body.removeChild(g),L}function ZUi(n,e,t,i,r,o){if(o!==0){const h=String(o);r.appendString('<div style="text-indent: -'),r.appendString(h),r.appendString("px; padding-left: "),r.appendString(h),r.appendString("px; box-sizing: border-box; width:")}else r.appendString('<div style="width:');r.appendString(String(i)),r.appendString('px;">');const s=n.length;let a=e,l=0;const c=[],u=[];let d=0<s?n.charCodeAt(0):0;r.appendString("<span>");for(let h=0;h<s;h++){h!==0&&h%16384===0&&r.appendString("</span><span>"),c[h]=l,u[h]=a;const g=d;d=h+1<s?n.charCodeAt(h+1):0;let p=1,m=1;switch(g){case 9:p=t-a%t,m=p;for(let _=1;_<=p;_++)_<p?r.appendCharCode(160):r.appendASCIICharCode(32);break;case 32:d===32?r.appendCharCode(160):r.appendASCIICharCode(32);break;case 60:r.appendString("&lt;");break;case 62:r.appendString("&gt;");break;case 38:r.appendString("&amp;");break;case 0:r.appendString("&#00;");break;case 65279:case 8232:case 8233:case 133:r.appendCharCode(65533);break;default:aw(g)&&m++,g<32?r.appendCharCode(9216+g):r.appendCharCode(g)}l+=p,a+=m}return r.appendString("</span>"),c[n.length]=l,u[n.length]=a,r.appendString("</div>"),[c,u]}function JUi(n,e,t,i){if(t.length<=1)return null;const r=Array.prototype.slice.call(e.children,0),o=[];try{Hse(n,r,i,0,null,t.length-1,null,o)}catch(s){return console.log(s),null}return o.length===0?null:(o.push(t.length),o)}function Hse(n,e,t,i,r,o,s,a){if(i===o||(r=r||HZ(n,e,t[i],t[i+1]),s=s||HZ(n,e,t[o],t[o+1]),Math.abs(r[0].top-s[0].top)<=.1))return;if(i+1===o){a.push(o);return}const l=i+(o-i)/2|0,c=HZ(n,e,t[l],t[l+1]);Hse(n,e,t,i,r,l,c,a),Hse(n,e,t,l,c,o,s,a)}function HZ(n,e,t,i){return n.setStart(e[t/16384|0].firstChild,t%16384),n.setEnd(e[i/16384|0].firstChild,i%16384),n.getClientRects()}class eqi extends Ae{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new wme),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const r of t){if(this._pending.has(r.id)){fi(new Error(`Cannot have two contributions with the same id ${r.id}`));continue}this._pending.set(r.id,r)}this._instantiateSome(0),this._register(Py(()=>{this._instantiateSome(1)})),this._register(Py(()=>{this._instantiateSome(2)})),this._register(Py(()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)typeof i.saveViewState=="function"&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)typeof i.restoreViewState=="function"&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){this._register(Py(()=>{this._instantiateSome(1)},50))}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const i of t)this._instantiateById(i.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const i=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,i),typeof i.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){fi(i)}}}}var tqi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Xb=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},nqi=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},YS;let iqi=0,rqi=class{constructor(e,t,i,r,o,s){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=r,this.listenersToRemove=o,this.attachedView=s}dispose(){Hr(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},l2=YS=class extends Ae{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,i,r,o,s,a,l,c,u,d,h){var g;super(),this.languageConfigurationService=d,this._deliveryQueue=GFi(),this._contributions=this._register(new eqi),this._onDidDispose=this._register(new be),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new be({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new be({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new be({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new be({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new be({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new be({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new be({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new be({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new be({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new be({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new Kc(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new be({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new M2e({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new M2e({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new Kc(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new Kc(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new Kc(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new Kc(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new Kc(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new Kc(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new Kc(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new Kc(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new Kc(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new Kc(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new Kc(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new Kc(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new Kc(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new Kc(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new Kc(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new Kc(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new Kc(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new be({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new be({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new be({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new be({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),o.willCreateCodeEditor();const p=Object.assign({},t);this._domElement=e,this._overflowWidgetsDomNode=p.overflowWidgetsDomNode,delete p.overflowWidgetsDomNode,this._id=++iqi,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,p,u)),this._register(this._configuration.onDidChange(v=>{this._onDidChangeConfiguration.fire(v);const b=this._configuration.options;if(v.hasChanged(143)){const y=b.get(143);this._onDidLayoutChange.fire(y)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=o,this._commandService=s,this._themeService=l,this._register(new oqi(this,this._contextKeyService)),this._register(new sqi(this,this._contextKeyService,h)),this._instantiationService=r.createChild(new gq([Yn,this._contextKeyService])),this._modelData=null,this._focusTracker=new aqi(e),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let m;Array.isArray(i.contributions)?m=i.contributions:m=kL.getEditorContributions(),this._contributions.initialize(this,m,this._instantiationService);for(const v of kL.getEditorActions()){if(this._actions.has(v.id)){fi(new Error(`Cannot have two actions with the same id ${v.id}`));continue}const b=new Xqe(v.id,v.label,v.alias,(g=v.precondition)!==null&&g!==void 0?g:void 0,()=>this._instantiationService.invokeFunction(y=>Promise.resolve(v.runEditorCommand(y,this,null))),this._contextKeyService);this._actions.set(b.id,b)}const _=()=>!this._configuration.options.get(90)&&this._configuration.options.get(36).enabled;this._register(new f$i(this._domElement,{onDragEnter:()=>{},onDragOver:v=>{if(!_())return;const b=this.getTargetAtClientPoint(v.clientX,v.clientY);b!=null&&b.position&&this.showDropIndicatorAt(b.position)},onDrop:v=>nqi(this,void 0,void 0,function*(){if(!_()||(this.removeDropIndicator(),!v.dataTransfer))return;const b=this.getTargetAtClientPoint(v.clientX,v.clientY);b!=null&&b.position&&this._onDropIntoEditor.fire({position:b.position,event:v})}),onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;(t=this._modelData)===null||t===void 0||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i){return new pse(e,t,this._domElement,i)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return _5.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),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?Tr.getWordAtPosition(this._modelData.model,this._configuration.options.get(129),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let i=0;return e&&e.lineEnding&&e.lineEnding===`
`?i=1:e&&e.lineEnding&&e.lineEnding===`\r
`&&(i=2),this._modelData.model.getValue(i,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(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const i=this.hasTextFocus(),r=this._detachModel();this._attachModel(t),i&&this.hasModel()&&this.focus();const o={oldModelUrl:r?r.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(o),this._postDetachModelCleanup(r),this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}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 _getVerticalOffsetAfterPosition(e,t,i,r){const o=e.model.validatePosition({lineNumber:t,column:i}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(s.lineNumber,r)}getTopForLineNumber(e,t=!1){return this._modelData?YS._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?YS._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,r=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),s=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber,r)}getBottomForLineNumber(e,t=!1){return this._modelData?YS._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var i;(i=this._modelData)===null||i===void 0||i.viewModel.setHiddenAreas(e.map(r=>q.lift(r)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return Va.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!Ce.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,i,r){if(!this._modelData)return;if(!q.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),s=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,s,t,r)}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,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new q(e,1,e,1),t,!1,i)}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,i,r){if(!Ce.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new q(e.lineNumber,e.column,e.lineNumber,e.column),t,i,r)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=ln.isISelection(e),r=q.isIRange(e);if(!i&&!r)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(r){const o={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(o,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new ln(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,r){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new q(e,1,t,1),i,!1,r)}revealRange(e,t=0,i=!1,r=!0){this._revealRange(e,i?1:0,r,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,i,r){if(!q.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(q.lift(e),t,i,r)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let r=0,o=e.length;r<o;r++)if(!ln.isISelection(e[r]))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,e,i)}}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(typeof e!="number")throw new Error("Invalid arguments");this._modelData.viewModel.viewLayout.setScrollPosition({scrollLeft:e},t)}}setScrollTop(e,t=1){if(this._modelData){if(typeof e!="number")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)}hasPendingScrollAnimation(){return this._modelData?this._modelData.viewModel.viewLayout.hasPendingScrollAnimation():!1}saveViewState(){if(!this._modelData)return null;const e=this._contributions.saveViewState(),t=this._modelData.viewModel.saveCursorState(),i=this._modelData.viewModel.saveState();return{cursorState:t,viewState:i,contributionsState:e}}restoreViewState(e){if(!this._modelData||!this._modelData.hasRealView)return;const t=e;if(t&&t.cursorState&&t.viewState){const i=t.cursorState;Array.isArray(i)?i.length>0&&this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]),this._contributions.restoreViewState(t.contributionsState||{});const r=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(r)}}handleInitialized(){var e;(e=this._getViewModel())===null||e===void 0||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const o=i;this._type(e,o.text||"");return}case"replacePreviousChar":{const o=i;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case"compositionType":{const o=i;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case"paste":{const o=i;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null);return}case"cut":this._cut(e);return}const r=this.getAction(t);if(r){Promise.resolve(r.run(i)).then(void 0,fi);return}this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_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||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,i,r,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,r,o,e)}_paste(e,t,i,r,o){if(!this._modelData||t.length===0)return;const s=this._modelData.viewModel,a=s.getSelection().getStartPosition();s.paste(t,i,r,e);const l=s.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({range:new q(a.lineNumber,a.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const r=kL.getEditorCommand(t);return r?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(r.runEditorCommand(o,this,i)).then(void 0,fi)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(90))return!1;let r;return i?Array.isArray(i)?r=()=>i:r=i:r=()=>null,this._modelData.viewModel.executeEdits(e,t,r),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new lqi(this,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,wV(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,wV(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){!this._modelData||e.length===0||this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}removeDecorationsByType(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(143)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(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?!1: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())&&console.warn("Overwriting a content widget with the same id."),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 i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(i)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),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 i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(i)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(i)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options,r=i.get(143),o=YS._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),s=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+r.glyphMarginWidth+r.lineNumbersWidth+r.decorationsWidth-this.getScrollLeft();return{top:o,left:s,height:i.get(66)}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}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){mc(e,this._configuration.options.get(50))}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){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const i=e.onBeforeAttached(),r=new zUi(this._id,this._configuration,e,P_e.create(),O_e.create(this._configuration.options),a=>Sg(a),this.languageConfigurationService,this._themeService,i);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(r.onEvent(a=>{switch(a.kind){case 0:this._onDidContentSizeChange.fire(a);break;case 1:this._editorTextFocus.setValue(a.hasFocus);break;case 2:this._onDidScrollChange.fire(a);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(a.reachedMaxCursorCount){const d=this.getOption(79),h=E("cursors.maximum","The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",d);this._notificationService.prompt(pq.Warning,h,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:E("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const l=[];for(let d=0,h=a.selections.length;d<h;d++)l[d]=a.selections[d].getPosition();const c={position:l[0],secondaryPositions:l.slice(1),reason:a.reason,source:a.source};this._onDidChangeCursorPosition.fire(c);const u={selection:a.selections[0],secondarySelections:a.selections.slice(1),modelVersionId:a.modelVersionId,oldSelections:a.oldSelections,oldModelVersionId:a.oldModelVersionId,source:a.source,reason:a.reason};this._onDidChangeCursorSelection.fire(u);break}case 7:this._onDidChangeModelDecorations.fire(a.event);break;case 8:this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._onDidChangeModelLanguage.fire(a.event);break;case 9:this._onDidChangeModelLanguageConfiguration.fire(a.event);break;case 10:this._onDidChangeModelContent.fire(a.event);break;case 11:this._onDidChangeModelOptions.fire(a.event);break;case 12:this._onDidChangeModelTokens.fire(a.event);break}}));const[o,s]=this._createView(r);if(s){this._domElement.appendChild(o.domNode.domNode);let a=Object.keys(this._contentWidgets);for(let l=0,c=a.length;l<c;l++){const u=a[l];o.addContentWidget(this._contentWidgets[u])}a=Object.keys(this._overlayWidgets);for(let l=0,c=a.length;l<c;l++){const u=a[l];o.addOverlayWidget(this._overlayWidgets[u])}a=Object.keys(this._glyphMarginWidgets);for(let l=0,c=a.length;l<c;l++){const u=a[l];o.addGlyphMarginWidget(this._glyphMarginWidgets[u])}o.render(!1,!0),o.domNode.domNode.setAttribute("data-uri",e.uri.toString())}this._modelData=new rqi(e,r,o,s,t,i)}_createView(e){let t;this.isSimpleWidget?t={paste:(o,s,a,l)=>{this._paste("keyboard",o,s,a,l)},type:o=>{this._type("keyboard",o)},compositionType:(o,s,a,l)=>{this._compositionType("keyboard",o,s,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(o,s,a,l)=>{const c={text:o,pasteOnNewLine:s,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:o=>{const s={text:o};this._commandService.executeCommand("type",s)},compositionType:(o,s,a,l)=>{if(a||l){const c={text:o,replacePrevCharCnt:s,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:o,replaceCharCnt:s};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new cq(e.coordinatesConverter);return i.onKeyDown=o=>this._onKeyDown.fire(o),i.onKeyUp=o=>this._onKeyUp.fire(o),i.onContextMenu=o=>this._onContextMenu.fire(o),i.onMouseMove=o=>this._onMouseMove.fire(o),i.onMouseLeave=o=>this._onMouseLeave.fire(o),i.onMouseDown=o=>this._onMouseDown.fire(o),i.onMouseUp=o=>this._onMouseUp.fire(o),i.onMouseDrag=o=>this._onMouseDrag.fire(o),i.onMouseDrop=o=>this._onMouseDrop.fire(o),i.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),i.onMouseWheel=o=>this._onMouseWheel.fire(o),[new kse(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e==null||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 this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new q(e.lineNumber,e.column,e.lineNumber,e.column),options:YS.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};l2.dropIntoEditorDecorationOptions=hi.register({description:"workbench-dnd-target",className:"dnd-target"});l2=YS=tqi([Xb(3,Un),Xb(4,Lr),Xb(5,Fs),Xb(6,Yn),Xb(7,ll),Xb(8,ga),Xb(9,N0),Xb(10,xo),Xb(11,en)],l2);class M2e extends Ae{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new be(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new be(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}}class Kc extends be{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class oqi extends Ae{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=ee.editorSimpleInput.bindTo(t),this._editorFocus=ee.focus.bindTo(t),this._textInputFocus=ee.textInputFocus.bindTo(t),this._editorTextFocus=ee.editorTextFocus.bindTo(t),this._tabMovesFocus=ee.tabMovesFocus.bindTo(t),this._editorReadonly=ee.readOnly.bindTo(t),this._inDiffEditor=ee.inDiffEditor.bindTo(t),this._editorColumnSelection=ee.columnSelection.bindTo(t),this._hasMultipleSelections=ee.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=ee.hasNonEmptySelection.bindTo(t),this._canUndo=ee.canUndo.bindTo(t),this._canRedo=ee.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._register(e2.onDidChangeTabFocus(i=>this._tabMovesFocus.set(i))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(e2.getTabFocusMode()),this._editorReadonly.set(e.get(90)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.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(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class sqi extends Ae{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=ee.languageId.bindTo(t),this._hasCompletionItemProvider=ee.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=ee.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=ee.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=ee.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=ee.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=ee.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=ee.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=ee.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=ee.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=ee.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=ee.hasReferenceProvider.bindTo(t),this._hasRenameProvider=ee.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=ee.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=ee.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=ee.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=ee.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=ee.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=ee.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=ee.isInWalkThroughSnippet.bindTo(t);const r=()=>this._update();this._register(e.onDidChangeModel(r)),this._register(e.onDidChangeModelLanguage(r)),this._register(i.completionProvider.onDidChange(r)),this._register(i.codeActionProvider.onDidChange(r)),this._register(i.codeLensProvider.onDidChange(r)),this._register(i.definitionProvider.onDidChange(r)),this._register(i.declarationProvider.onDidChange(r)),this._register(i.implementationProvider.onDidChange(r)),this._register(i.typeDefinitionProvider.onDidChange(r)),this._register(i.hoverProvider.onDidChange(r)),this._register(i.documentHighlightProvider.onDidChange(r)),this._register(i.documentSymbolProvider.onDidChange(r)),this._register(i.referenceProvider.onDidChange(r)),this._register(i.renameProvider.onDidChange(r)),this._register(i.documentFormattingEditProvider.onDidChange(r)),this._register(i.documentRangeFormattingEditProvider.onDidChange(r)),this._register(i.signatureHelpProvider.onDidChange(r)),this._register(i.inlayHintsProvider.onDidChange(r)),r()}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();if(!e){this.reset();return}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===Si.walkThroughSnippet)})}}class aqi extends Ae{constructor(e){super(),this._onChange=this._register(new be),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(lb(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}}class lqi{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(r=>{this._isChangingDecorations||e.call(t,r)},i)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const r=e.getDecorationRange(i);r&&t.push(r)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}}const cqi=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='"),uqi=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 WZ(n){return cqi+encodeURIComponent(n.toString())+uqi}const dqi=encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" height="3" width="12"><g fill="'),hqi=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 fqi(n){return dqi+encodeURIComponent(n.toString())+hqi}rm((n,e)=>{const t=n.getColor(Mv);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${WZ(t)}") repeat-x bottom left; }`);const i=n.getColor(Gh);i&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${WZ(i)}") repeat-x bottom left; }`);const r=n.getColor(xd);r&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${WZ(r)}") repeat-x bottom left; }`);const o=n.getColor(M7i);o&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${fqi(o)}") no-repeat bottom left; }`);const s=n.getColor(GHi);s&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${s.rgba.a}; }`)});var gqi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},pqi=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},mqi=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let Wse=class extends Ae{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new be),this._onCodeEditorAdd=this._register(new be),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new be),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new be),this._onDiffEditorAdd=this._register(new be),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new be),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new Hu,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}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])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}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(i=>i.removeDecorationsByType(e))))}setModelProperty(e,t,i){const r=e.toString();let o;this._modelProperties.has(r)?o=this._modelProperties.get(r):(o=new Map,this._modelProperties.set(r,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}openCodeEditor(e,t,i){return mqi(this,void 0,void 0,function*(){for(const r of this._codeEditorOpenHandlers){const o=yield r(e,t,i);if(o!==null)return o}return null})}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Gn(t)}};Wse=gqi([pqi(0,ll)],Wse);var _qi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},F2e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},vqi=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let uH=class extends Wse{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler((i,r,o)=>vqi(this,void 0,void 0,function*(){return r?this.doOpenEditor(r,i):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}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const o=t.resource.scheme;if(o===Si.http||o===Si.https)return IUe(t.resource.toString()),e}return null}const r=t.options?t.options.selection:null;if(r)if(typeof r.endLineNumber=="number"&&typeof r.endColumn=="number")e.setSelection(r),e.revealRangeInCenter(r,1);else{const o={lineNumber:r.startLineNumber,column:r.startColumn};e.setPosition(o),e.revealPositionInCenter(o,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};uH=_qi([F2e(0,Yn),F2e(1,ll)],uH);Zi(Lr,uH,0);const TA=Vi("layoutService");var SKe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},EKe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let dH=class{get dimension(){return this._dimension||(this._dimension=CA(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;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayout=Pt.None,this.offset={top:0,quickPickTop:0}}};dH=SKe([EKe(0,Lr)],dH);let zse=class extends dH{get hasContainer(){return!1}get container(){return this._container}constructor(e,t){super(t),this._container=e}};zse=SKe([EKe(1,Lr)],zse);Zi(TA,dH,1);const I5=Vi("dialogService");var bqi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},B2e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},HB=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function WB(n){return n.scheme===Si.file?n.fsPath:n.path}let xKe=0;class zB{constructor(e,t,i,r,o,s,a){this.id=++xKe,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=r,this.groupOrder=o,this.sourceId=s,this.sourceOrder=a,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 $2e{constructor(e,t){this.resourceLabel=e,this.reason=t}}class V2e{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,r]of this.elements)(r.reason===0?e:t).push(r.resourceLabel);const i=[];return e.length>0&&i.push(E({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&&i.push(E({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join(`
`)}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 yqi{constructor(e,t,i,r,o,s,a){this.id=++xKe,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=r,this.groupOrder=o,this.sourceId=s,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new V2e),this.removedResources.has(t)||this.removedResources.set(t,new $2e(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new V2e),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new $2e(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class kKe{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)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const 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(`
`)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,r=this._past.length;i<r;i++)t.push(this._past[i].id);for(let i=this._future.length-1;i>=0;i--)t.push(this._future[i].id);return new _Ke(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,r=0,o=-1;for(let a=0,l=this._past.length;a<l;a++,r++){const c=this._past[a];i&&(r>=t||c.id!==e.elements[r])&&(i=!1,o=0),!i&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let s=-1;for(let a=this._future.length-1;a>=0;a--,r++){const l=this._future[a];i&&(r>=t||l.id!==e.elements[r])&&(i=!1,s=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}o!==-1&&(this._past=this._past.slice(0,o)),s!==-1&&(this._future=this._future.slice(s+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,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 zZ{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;t<i;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 TKe=new kKe("","");TKe.locked=!0;let jse=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){console.log("------------------------------------"),console.log(`AFTER ${e}: `);const t=[];for(const i of this._editStacks)t.push(i[1].toString());console.log(t.join(`
`))}pushElement(e,t=a2.None,i=Sv.None){if(e.type===0){const r=WB(e.resource),o=this.getUriComparisonKey(e.resource);this._pushElement(new zB(e,r,o,t.id,t.nextOrder(),i.id,i.nextOrder()))}else{const r=new Set,o=[],s=[];for(const a of e.resources){const l=WB(a),c=this.getUriComparisonKey(a);r.has(c)||(r.add(c),o.push(l),s.push(c))}o.length===1?this._pushElement(new zB(e,o[0],s[0],t.id,t.nextOrder(),i.id,i.nextOrder())):this._pushElement(new yqi(e,o,s,t.id,t.nextOrder(),i.id,i.nextOrder()))}}_pushElement(e){for(let t=0,i=e.strResources.length;t<i;t++){const r=e.resourceLabels[t],o=e.strResources[t];let s;this._editStacks.has(o)?s=this._editStacks.get(o):(s=new kKe(r,o),this._editStacks.set(o,s)),s.pushElement(e)}}getLastElement(e){const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){const i=this._editStacks.get(t);if(i.hasFutureElements())return null;const r=i.getClosestPastElement();return r?r.actual:null}return null}_splitPastWorkspaceElement(e,t){const i=e.actual.split(),r=new Map;for(const o of i){const s=WB(o.resource),a=this.getUriComparisonKey(o.resource),l=new zB(o,s,a,0,0,0,0);r.set(l.strResource,l)}for(const o of e.strResources){if(t&&t.has(o))continue;this._editStacks.get(o).splitPastWorkspaceElement(e,r)}}_splitFutureWorkspaceElement(e,t){const i=e.actual.split(),r=new Map;for(const o of i){const s=WB(o.resource),a=this.getUriComparisonKey(o.resource),l=new zB(o,s,a,0,0,0,0);r.set(l.strResource,l)}for(const o of e.strResources){if(t&&t.has(o))continue;this._editStacks.get(o).splitFutureWorkspaceElement(e,r)}}removeElements(e){const t=typeof e=="string"?e:this.getUriComparisonKey(e);this._editStacks.has(t)&&(this._editStacks.get(t).dispose(),this._editStacks.delete(t))}setElementsValidFlag(e,t,i){const r=this.getUriComparisonKey(e);this._editStacks.has(r)&&this._editStacks.get(r).setElementsValidFlag(t,i)}createSnapshot(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).createSnapshot(e):new _Ke(e,[])}restoreSnapshot(e){const t=this.getUriComparisonKey(e.resource);if(this._editStacks.has(t)){const i=this._editStacks.get(t);i.restoreSnapshot(e),!i.hasPastElements()&&!i.hasFutureElements()&&(i.dispose(),this._editStacks.delete(t))}}getElements(e){const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).getElements():{past:[],future:[]}}_findClosestUndoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[r,o]of this._editStacks){const s=o.getClosestPastElement();s&&s.sourceId===e&&(!t||s.sourceOrder>t.sourceOrder)&&(t=s,i=r)}return[t,i]}canUndo(e){if(e instanceof Sv){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){fi(e);for(const i of t.strResources)this.removeElements(i);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,i,r,o){const s=this._acquireLocks(i);let a;try{a=t()}catch(l){return s(),r.dispose(),this._onError(l,e)}return a?a.then(()=>(s(),r.dispose(),o()),l=>(s(),r.dispose(),this._onError(l,e))):(s(),r.dispose(),o())}_invokeWorkspacePrepare(e){return HB(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo>"u")return Ae.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?Ae.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(Ae.None);const i=e.actual.prepareUndoRedo();return i?Cme(i)?t(i):i.then(r=>t(r)):t(Ae.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||TKe);return new zZ(t)}_tryToSplitAndUndo(e,t,i,r){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(r),new jB(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(r),new jB}_checkWorkspaceUndo(e,t,i,r){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,E({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(r&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,E({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 a of i.editStacks)a.getClosestPastElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,E({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 s=[];for(const a of i.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndUndo(e,t,null,E({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,s.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,E({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,i){const r=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,r,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,r,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const r=t.getSecondClosestPastElement();if(r&&r.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,i,r){return HB(this,void 0,void 0,function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(u){u[u.All=0]="All",u[u.This=1]="This",u[u.Cancel=2]="Cancel"})(a||(a={}));const{result:l}=yield this._dialogService.prompt({type:js.Info,message:E("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:E({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:E({key:"nok",comment:["&& denotes a mnemonic"]},"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(l===a.Cancel)return;if(l===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const c=this._checkWorkspaceUndo(e,t,i,!1);if(c)return c.returnValue;r=!0}let o;try{o=yield this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const s=this._checkWorkspaceUndo(e,t,i,!0);if(s)return o.dispose(),s.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,o,()=>this._continueUndoInGroup(t.groupId,r))})}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const r=E({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(r);return}return this._invokeResourcePrepare(t,r=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new zZ([e]),r,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[r,o]of this._editStacks){const s=o.getClosestPastElement();s&&s.groupId===e&&(!t||s.groupOrder>t.groupOrder)&&(t=s,i=r)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof Sv){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const r=this._editStacks.get(e),o=r.getClosestPastElement();if(!o)return;if(o.groupId){const[a,l]=this._findClosestUndoElementInGroup(o.groupId);if(o!==a&&l)return this._undo(l,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return o.type===1?this._workspaceUndo(e,o,i):this._resourceUndo(r,o,i)}finally{}}_confirmAndContinueUndo(e,t,i){return HB(this,void 0,void 0,function*(){if((yield this._dialogService.confirm({message:E("confirmDifferentSource","Would you like to undo '{0}'?",i.label),primaryButton:E({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:E("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)})}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[r,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.sourceId===e&&(!t||s.sourceOrder<t.sourceOrder)&&(t=s,i=r)}return[t,i]}canRedo(e){if(e instanceof Sv){const[,i]=this._findClosestRedoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasFutureElements():!1}_tryToSplitAndRedo(e,t,i,r){if(t.canSplit())return this._splitFutureWorkspaceElement(t,i),this._notificationService.warn(r),new jB(this._redo(e));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(r),new jB}_checkWorkspaceRedo(e,t,i,r){if(t.removedResources)return this._tryToSplitAndRedo(e,t,t.removedResources,E({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(r&&t.invalidatedResources)return this._tryToSplitAndRedo(e,t,t.invalidatedResources,E({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 a of i.editStacks)a.getClosestFutureElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndRedo(e,t,null,E({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 s=[];for(const a of i.editStacks)a.locked&&s.push(a.resourceLabel);return s.length>0?this._tryToSplitAndRedo(e,t,null,E({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,s.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,E({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 i=this._getAffectedEditStacks(t),r=this._checkWorkspaceRedo(e,t,i,!1);return r?r.returnValue:this._executeWorkspaceRedo(e,t,i)}_executeWorkspaceRedo(e,t,i){return HB(this,void 0,void 0,function*(){let r;try{r=yield this._invokeWorkspacePrepare(t)}catch(s){return this._onError(s,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return r.dispose(),o.returnValue;for(const s of i.editStacks)s.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,r,()=>this._continueRedoInGroup(t.groupId))})}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=E({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(i);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new zZ([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[r,o]of this._editStacks){const s=o.getClosestFutureElement();s&&s.groupId===e&&(!t||s.groupOrder<t.groupOrder)&&(t=s,i=r)}return[t,i]}_continueRedoInGroup(e){if(!e)return;const[,t]=this._findClosestRedoElementInGroup(e);if(t)return this._redo(t)}redo(e){if(e instanceof Sv){const[,t]=this._findClosestRedoElementWithSource(e.id);return t?this._redo(t):void 0}return typeof e=="string"?this._redo(e):this._redo(this.getUriComparisonKey(e))}_redo(e){if(!this._editStacks.has(e))return;const t=this._editStacks.get(e),i=t.getClosestFutureElement();if(i){if(i.groupId){const[r,o]=this._findClosestRedoElementInGroup(i.groupId);if(i!==r&&o)return this._redo(o)}try{return i.type===1?this._workspaceRedo(e,i):this._resourceRedo(t,i)}finally{}}}};jse=bqi([B2e(0,I5),B2e(1,ga)],jse);class jB{constructor(e){this.returnValue=e}}Zi(fq,jse,1);function qd(n,e,t){return Math.min(Math.max(n,e),t)}class IKe{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 Cqi{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}}const M_e=Vi("environmentService"),mh=Vi("openerService");function F_e(n,e){return Tn.isUri(n)?OI(n.scheme,e):Lme(n,e+":")}function H2e(n,...e){return e.some(t=>F_e(n,t))}function wqi(n){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(n.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},n=n.with({fragment:""})),{selection:e,uri:n}}var Sqi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},W2e=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Fg=Vi("ILanguageFeatureDebounceService");var hH;(function(n){const e=new WeakMap;let t=0;function i(r){let o=e.get(r);return o===void 0&&(o=++t,e.set(r,o)),o}n.of=i})(hH||(hH={}));class Eqi{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class xqi{constructor(e,t,i,r,o,s){this._logService=e,this._name=t,this._registry=i,this._default=r,this._min=o,this._max=s,this._cache=new eS(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>ZU(hH.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?qd(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let r=this._cache.get(i);r||(r=new Cqi(6),this._cache.set(i,r));const o=qd(r.update(t),this._min,this._max);return F_e(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new IKe;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return qd(e,this._min,this._max)}}let Use=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){var r,o,s;const a=(r=i==null?void 0:i.min)!==null&&r!==void 0?r:50,l=(o=i==null?void 0:i.max)!==null&&o!==void 0?o:Math.pow(a,2),c=(s=i==null?void 0:i.key)!==null&&s!==void 0?s:void 0,u=`${hH.of(e)},${a}${c?","+c:""}`;let d=this._data.get(u);return d||(this._isDev?d=new xqi(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),d=new Eqi(a*1.5)),this._data.set(u,d)),d}_overallAverage(){const e=new IKe;for(const t of this._data.values())e.update(t.default());return e.value}};Use=Sqi([W2e(0,Sf),W2e(1,M_e)],Use);Zi(Fg,Use,1);class YO{static create(e,t){return new YO(e,new fH(t))}get startLineNumber(){return this._startLineNumber}get endLineNumber(){return this._endLineNumber}constructor(e,t){this._startLineNumber=e,this._tokens=t,this._endLineNumber=this._startLineNumber+this._tokens.getMaxDeltaLine()}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 q(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn)}removeTokens(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;this._startLineNumber+=this._tokens.removeTokens(t,e.startColumn-1,i,e.endColumn-1),this._updateEndLineNumber()}split(e){const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber,[r,o,s]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new YO(this._startLineNumber,r),new YO(this._startLineNumber+s,o)]}applyEdit(e,t){const[i,r,o]=pw(t);this.acceptEdit(e,i,r,o,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,r,o){this._acceptDeleteRange(e),this._acceptInsertText(new Ce(e.startLineNumber,e.startColumn),t,i,r,o),this._updateEndLineNumber()}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return;const t=e.startLineNumber-this._startLineNumber,i=e.endLineNumber-this._startLineNumber;if(i<0){const o=i-t;this._startLineNumber-=o;return}const r=this._tokens.getMaxDeltaLine();if(!(t>=r+1)){if(t<0&&i>=r+1){this._startLineNumber=0,this._tokens.clear();return}if(t<0){const o=-t;this._startLineNumber-=o,this._tokens.acceptDeleteRange(e.startColumn-1,0,0,i,e.endColumn-1)}else this._tokens.acceptDeleteRange(0,t,e.startColumn-1,i,e.endColumn-1)}}_acceptInsertText(e,t,i,r,o){if(t===0&&i===0)return;const s=e.lineNumber-this._startLineNumber;if(s<0){this._startLineNumber+=t;return}const a=this._tokens.getMaxDeltaLine();s>=a+1||this._tokens.acceptInsertText(s,e.column-1,t,i,r,o)}}class fH{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;i<this._tokenCount;i++)t.push(`(${this._getDeltaLine(i)+e},${this._getStartCharacter(i)}-${this._getEndCharacter(i)})`);return`[${t.join(",")}]`}getMaxDeltaLine(){const e=this._getTokenCount();return e===0?-1:this._getDeltaLine(e-1)}getRange(){const e=this._getTokenCount();if(e===0)return null;const t=this._getStartCharacter(0),i=this._getDeltaLine(e-1),r=this._getEndCharacter(e-1);return new q(0,t+1,i,r+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 this._getTokenCount()===0}getLineTokens(e){let t=0,i=this._getTokenCount()-1;for(;t<i;){const r=t+Math.floor((i-t)/2),o=this._getDeltaLine(r);if(o<e)t=r+1;else if(o>e)i=r-1;else{let s=r;for(;s>t&&this._getDeltaLine(s-1)===e;)s--;let a=r;for(;a<i&&this._getDeltaLine(a+1)===e;)a++;return new z2e(this._tokens.subarray(4*s,4*a+4))}}return this._getDeltaLine(t)===e?new z2e(this._tokens.subarray(4*t,4*t+4)):null}clear(){this._tokenCount=0}removeTokens(e,t,i,r){const o=this._tokens,s=this._tokenCount;let a=0,l=!1,c=0;for(let u=0;u<s;u++){const d=4*u,h=o[d],g=o[d+1],p=o[d+2],m=o[d+3];if((h>e||h===e&&p>=t)&&(h<i||h===i&&g<=r))l=!0;else{if(a===0&&(c=h),l){const _=4*a;o[_]=h-c,o[_+1]=g,o[_+2]=p,o[_+3]=m}a++}}return this._tokenCount=a,c}split(e,t,i,r){const o=this._tokens,s=this._tokenCount,a=[],l=[];let c=a,u=0,d=0;for(let h=0;h<s;h++){const g=4*h,p=o[g],m=o[g+1],_=o[g+2],v=o[g+3];if(p>e||p===e&&_>=t){if(p<i||p===i&&m<=r)continue;c!==l&&(c=l,u=0,d=p)}c[u++]=p-d,c[u++]=m,c[u++]=_,c[u++]=v}return[new fH(new Uint32Array(a)),new fH(new Uint32Array(l)),d]}acceptDeleteRange(e,t,i,r,o){const s=this._tokens,a=this._tokenCount,l=r-t;let c=0,u=!1;for(let d=0;d<a;d++){const h=4*d;let g=s[h],p=s[h+1],m=s[h+2];const _=s[h+3];if(g<t||g===t&&m<=i){c++;continue}else if(g===t&&p<i)g===r&&m>o?m-=o-i:m=i;else if(g===t&&p===i)if(g===r&&m>o)m-=o-i;else{u=!0;continue}else if(g<r||g===r&&p<o)if(g===r&&m>o)g=t,p=i,m=p+(m-o);else{u=!0;continue}else if(g>r){if(l===0&&!u){c=a;break}g-=l}else if(g===r&&p>=o)e&&g===0&&(p+=e,m+=e),g-=l,p-=o-i,m-=o-i;else throw new Error("Not possible!");const v=4*c;s[v]=g,s[v+1]=p,s[v+2]=m,s[v+3]=_,c++}this._tokenCount=c}acceptInsertText(e,t,i,r,o,s){const a=i===0&&r===1&&(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122),l=this._tokens,c=this._tokenCount;for(let u=0;u<c;u++){const d=4*u;let h=l[d],g=l[d+1],p=l[d+2];if(!(h<e||h===e&&p<t)){if(h===e&&p===t)if(a)p+=1;else continue;else if(h===e&&g<t&&t<p)i===0?p+=r:p=t;else{if(h===e&&g===t&&a)continue;if(h===e)if(h+=i,i===0)g+=r,p+=r;else{const m=p-g;g=o+(g-t),p=g+m}else h+=i}l[d]=h,l[d+1]=g,l[d+2]=p}}}}class z2e{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 kqi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},jZ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let qse=class{constructor(e,t,i,r){this._legend=e,this._themeService=t,this._languageService=i,this._logService=r,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new vy}getMetadata(e,t,i){const r=this._languageService.languageIdCodec.encodeLanguageId(i),o=this._hashTable.get(e,t,r);let s;if(o)s=o.metadata,this._logService.getLevel()===uc.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${dc.getForeground(s)}, fontStyle ${dc.getFontStyle(s).toString(2)}`);else{let a=this._legend.tokenTypes[e];const l=[];if(a){let c=t;for(let d=0;c>0&&d<this._legend.tokenModifiers.length;d++)c&1&&l.push(this._legend.tokenModifiers[d]),c=c>>1;c>0&&this._logService.getLevel()===uc.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),l.push("not-in-legend"));const u=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,i);if(typeof u>"u")s=2147483647;else{if(s=0,typeof u.italic<"u"){const d=(u.italic?1:0)<<11;s|=d|1}if(typeof u.bold<"u"){const d=(u.bold?2:0)<<11;s|=d|2}if(typeof u.underline<"u"){const d=(u.underline?4:0)<<11;s|=d|4}if(typeof u.strikethrough<"u"){const d=(u.strikethrough?8:0)<<11;s|=d|8}if(u.foreground){const d=u.foreground<<15;s|=d|16}s===0&&(s=2147483647)}}else this._logService.getLevel()===uc.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),s=2147483647,a="not-in-legend";this._hashTable.add(e,t,r,s),this._logService.getLevel()===uc.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${dc.getForeground(s)}, fontStyle ${dc.getFontStyle(s).toString(2)}`)}return s}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,console.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,r,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,console.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${r} is outside the previous data (length ${o}).`))}};qse=kqi([jZ(1,ll),jZ(2,Qo),jZ(3,Sf)],qse);function LKe(n,e,t){const i=n.data,r=n.data.length/5|0,o=Math.max(Math.ceil(r/1024),400),s=[];let a=0,l=1,c=0;for(;a<r;){const u=a;let d=Math.min(u+o,r);if(d<r){let b=d;for(;b-1>u&&i[5*b]===0;)b--;if(b-1===u){let y=d;for(;y+1<r&&i[5*y]===0;)y++;d=y}else d=b}let h=new Uint32Array((d-u)*4),g=0,p=0,m=0,_=0;for(;a<d;){const b=5*a,y=i[b],C=i[b+1],x=l+y|0,k=y===0?c+C|0:C,I=i[b+2],L=k+I|0,D=i[b+3],R=i[b+4];if(L<=k)e.warnInvalidLengthSemanticTokens(x,k+1);else if(m===x&&_>k)e.warnOverlappingSemanticTokens(x,k+1);else{const P=e.getMetadata(D,R,t);P!==2147483647&&(p===0&&(p=x),h[g]=x-p,h[g+1]=k,h[g+2]=L,h[g+3]=P,g+=4,m=x,_=L)}l=x,c=k,a++}g!==h.length&&(h=h.subarray(0,g));const v=YO.create(p,h);s.push(v)}return s}class Tqi{constructor(e,t,i,r){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=r,this.next=null}}class vy{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=vy._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<vy._SIZES.length?2/3*this._currentLength:0),this._elements=[],vy._nullOutEntries(this._elements,this._currentLength)}static _nullOutEntries(e,t){for(let i=0;i<t;i++)e[i]=null}_hash2(e,t){return(e<<5)-e+t|0}_hashFunc(e,t,i){return this._hash2(this._hash2(e,t),i)%this._currentLength}get(e,t,i){const r=this._hashFunc(e,t,i);let o=this._elements[r];for(;o;){if(o.tokenTypeIndex===e&&o.tokenModifierSet===t&&o.languageId===i)return o;o=o.next}return null}add(e,t,i,r){if(this._elementsCount++,this._growCount!==0&&this._elementsCount>=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=vy._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1<vy._SIZES.length?2/3*this._currentLength:0),this._elements=[],vy._nullOutEntries(this._elements,this._currentLength);for(const s of o){let a=s;for(;a;){const l=a.next;a.next=null,this._add(a),a=l}}}this._add(new Tqi(e,t,i,r))}_add(e){const t=this._hashFunc(e.tokenTypeIndex,e.tokenModifierSet,e.languageId);e.next=this._elements[t],this._elements[t]=e}}vy._SIZES=[3,7,13,31,61,127,251,509,1021,2039,4093,8191,16381,32749,65521,131071,262139,524287,1048573,2097143];const mq=Vi("semanticTokensStylingService");var Iqi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},UZ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Kse=class extends Ae{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new qse(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};Kse=Iqi([UZ(0,ll),UZ(1,Sf),UZ(2,Qo)],Kse);Zi(mq,Kse,1);var j2e=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const UB="**",U2e="/",W8="[/\\\\]",z8="[^/\\\\]",Lqi=/\//g;function q2e(n,e){switch(n){case 0:return"";case 1:return`${z8}*?`;default:return`(?:${W8}|${z8}+${W8}${e?`|${W8}${z8}+`:""})*?`}}function K2e(n,e){if(!n)return[];const t=[];let i=!1,r=!1,o="";for(const s of n){switch(s){case e:if(!i&&!r){t.push(o),o="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":r=!0;break;case"]":r=!1;break}o+=s}return o&&t.push(o),t}function DKe(n){if(!n)return"";let e="";const t=K2e(n,U2e);if(t.every(i=>i===UB))e=".*";else{let i=!1;t.forEach((r,o)=>{if(r===UB){if(i)return;e+=q2e(2,o===t.length-1)}else{let s=!1,a="",l=!1,c="";for(const u of r){if(u!=="}"&&s){a+=u;continue}if(l&&(u!=="]"||!c)){let d;u==="-"?d=u:(u==="^"||u==="!")&&!c?d="^":u===U2e?d="":d=hf(u),c+=d;continue}switch(u){case"{":s=!0;continue;case"[":l=!0;continue;case"}":{const h=`(?:${K2e(a,",").map(g=>DKe(g)).join("|")})`;e+=h,s=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=z8;continue;case"*":e+=q2e(1);continue;default:e+=hf(u)}}o<t.length-1&&(t[o+1]!==UB||o+2<t.length)&&(e+=W8)}i=r===UB})}return e}const Dqi=/^\*\*\/\*\.[\w\.-]+$/,Aqi=/^\*\*\/([\w\.-]+)\/?$/,Rqi=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,Nqi=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,Oqi=/^\*\*((\/[\w\.-]+)+)\/?$/,Pqi=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,G2e=new eS(1e4),Y2e=function(){return!1},Zv=function(){return null};function B_e(n,e){if(!n)return Zv;let t;typeof n!="string"?t=n.pattern:t=n,t=t.trim();const i=`${t}_${!!e.trimForExclusions}`;let r=G2e.get(i);if(r)return Q2e(r,n);let o;return Dqi.test(t)?r=Mqi(t.substr(4),t):(o=Aqi.exec(qZ(t,e)))?r=Fqi(o[1],t):(e.trimForExclusions?Nqi:Rqi).test(t)?r=Bqi(t,e):(o=Oqi.exec(qZ(t,e)))?r=X2e(o[1].substr(1),t,!0):(o=Pqi.exec(qZ(t,e)))?r=X2e(o[1],t,!1):r=$qi(t),G2e.set(i,r),Q2e(r,n)}function Q2e(n,e){if(typeof e=="string")return n;const t=function(i,r){return Dse(i,e.base,!fu)?n(d5(i.substr(e.base.length),f_),r):null};return t.allBasenames=n.allBasenames,t.allPaths=n.allPaths,t.basenames=n.basenames,t.patterns=n.patterns,t}function qZ(n,e){return e.trimForExclusions&&n.endsWith("/**")?n.substr(0,n.length-2):n}function Mqi(n,e){return function(t,i){return typeof t=="string"&&t.endsWith(n)?e:null}}function Fqi(n,e){const t=`/${n}`,i=`\\${n}`,r=function(s,a){return typeof s!="string"?null:a?a===n?e:null:s===n||s.endsWith(t)||s.endsWith(i)?e:null},o=[n];return r.basenames=o,r.patterns=[e],r.allBasenames=o,r}function Bqi(n,e){const t=RKe(n.slice(1,-1).split(",").map(a=>B_e(a,e)).filter(a=>a!==Zv),n),i=t.length;if(!i)return Zv;if(i===1)return t[0];const r=function(a,l){for(let c=0,u=t.length;c<u;c++)if(t[c](a,l))return n;return null},o=t.find(a=>!!a.allBasenames);o&&(r.allBasenames=o.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(r.allPaths=s),r}function X2e(n,e,t){const i=f_===Ra.sep,r=i?n:n.replace(Lqi,f_),o=f_+r,s=Ra.sep+n;let a;return t?a=function(l,c){return typeof l=="string"&&(l===r||l.endsWith(o)||!i&&(l===n||l.endsWith(s)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===r||!i&&l===n)?e:null},a.allPaths=[(t?"*/":"./")+n],a}function $qi(n){try{const e=new RegExp(`^${DKe(n)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return Zv}}function Vqi(n,e,t){return!n||typeof e!="string"?!1:AKe(n)(e,void 0,t)}function AKe(n,e={}){if(!n)return Y2e;if(typeof n=="string"||Hqi(n)){const t=B_e(n,e);if(t===Zv)return Y2e;const i=function(r,o){return!!t(r,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return Wqi(n,e)}function Hqi(n){const e=n;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function Wqi(n,e){const t=RKe(Object.getOwnPropertyNames(n).map(a=>zqi(a,n[a],e)).filter(a=>a!==Zv)),i=t.length;if(!i)return Zv;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(u,d){let h;for(let g=0,p=t.length;g<p;g++){const m=t[g](u,d);if(typeof m=="string")return m;Joe(m)&&(h||(h=[]),h.push(m))}return h?(()=>j2e(this,void 0,void 0,function*(){for(const g of h){const p=yield g;if(typeof p=="string")return p}return null}))():null},l=t.find(u=>!!u.allBasenames);l&&(a.allBasenames=l.allBasenames);const c=t.reduce((u,d)=>d.allPaths?u.concat(d.allPaths):u,[]);return c.length&&(a.allPaths=c),a}const r=function(a,l,c){let u,d;for(let h=0,g=t.length;h<g;h++){const p=t[h];p.requiresSiblings&&c&&(l||(l=LC(a)),u||(u=l.substr(0,l.length-c6i(a).length)));const m=p(a,l,u,c);if(typeof m=="string")return m;Joe(m)&&(d||(d=[]),d.push(m))}return d?(()=>j2e(this,void 0,void 0,function*(){for(const h of d){const g=yield h;if(typeof g=="string")return g}return null}))():null},o=t.find(a=>!!a.allBasenames);o&&(r.allBasenames=o.allBasenames);const s=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return s.length&&(r.allPaths=s),r}function zqi(n,e,t){if(e===!1)return Zv;const i=B_e(n,t);if(i===Zv)return Zv;if(typeof e=="boolean")return i;if(e){const r=e.when;if(typeof r=="string"){const o=(s,a,l,c)=>{if(!c||!i(s,a))return null;const u=r.replace("$(basename)",()=>l),d=c(u);return Joe(d)?d.then(h=>h?n:null):d?n:null};return o.requiresSiblings=!0,o}}return i}function RKe(n,e){const t=n.filter(a=>!!a.basenames);if(t.length<2)return n;const i=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let r;if(e){r=[];for(let a=0,l=i.length;a<l;a++)r.push(e)}else r=t.reduce((a,l)=>{const c=l.patterns;return c?a.concat(c):a},[]);const o=function(a,l){if(typeof a!="string")return null;if(!l){let u;for(u=a.length;u>0;u--){const d=a.charCodeAt(u-1);if(d===47||d===92)break}l=a.substr(u)}const c=i.indexOf(l);return c!==-1?r[c]:null};o.basenames=i,o.patterns=r,o.allBasenames=i;const s=n.filter(a=>!a.basenames);return s.push(o),s}function NKe(n,e,t,i,r,o){if(Array.isArray(n)){let s=0;for(const a of n){const l=NKe(a,e,t,i,r,o);if(l===10)return l;l>s&&(s=l)}return s}else{if(typeof n=="string")return i?n==="*"?5:n===t?10:0:0;if(n){const{language:s,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:u}=n;if(!i&&!c)return 0;u&&r&&(e=r);let d=0;if(l)if(l===e.scheme)d=10;else if(l==="*")d=5;else return 0;if(s)if(s===t)d=10;else if(s==="*")d=Math.max(d,5);else return 0;if(u)if(u===o)d=10;else if(u==="*"&&o!==void 0)d=Math.max(d,5);else return 0;if(a){let h;if(typeof a=="string"?h=a:h=Object.assign(Object.assign({},a),{base:Wje(a.base)}),h===e.fsPath||Vqi(h,e.fsPath))d=10;else return 0}return d}else return 0}}function OKe(n){return typeof n=="string"?!1:Array.isArray(n)?n.every(OKe):!!n.exclusive}class Z2e{constructor(e,t,i,r){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=r}equals(e){var t,i;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((t=this.notebookUri)===null||t===void 0?void 0:t.toString())===((i=e.notebookUri)===null||i===void 0?void 0:i.toString())}}class Is{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new be,this.onDidChange=this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Gn(()=>{if(i){const r=this._entries.indexOf(i);r>=0&&(this._entries.splice(r,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,i=>t.push(i.provider)),t}orderedGroups(e){const t=[];let i,r;return this._orderedForEach(e,o=>{i&&r===o._score?i.push(o.provider):(r=o._score,i=[o.provider],t.push(i))}),t}_orderedForEach(e,t){this._updateScores(e);for(const i of this._entries)i._score>0&&t(i)}_updateScores(e){var t,i;const r=(t=this._notebookInfoResolver)===null||t===void 0?void 0:t.call(this,e.uri),o=r?new Z2e(e.uri,e.getLanguageId(),r.uri,r.type):new Z2e(e.uri,e.getLanguageId(),void 0,void 0);if(!(!((i=this._lastCandidate)===null||i===void 0)&&i.equals(o))){this._lastCandidate=o;for(const s of this._entries)if(s._score=NKe(s.selector,o.uri,o.languageId,O8i(e),o.notebookUri,o.notebookType),OKe(s.selector)&&s._score>0){for(const a of this._entries)a._score=0;s._score=1e3;break}this._entries.sort(Is._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._score<t._score?1:e._score>t._score?-1:FN(e.selector)&&!FN(t.selector)?1:!FN(e.selector)&&FN(t.selector)?-1:e._time<t._time?1:e._time>t._time?-1:0}}function FN(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(FN):!!n.isBuiltin}class jqi{constructor(){this.referenceProvider=new Is(this._score.bind(this)),this.renameProvider=new Is(this._score.bind(this)),this.codeActionProvider=new Is(this._score.bind(this)),this.definitionProvider=new Is(this._score.bind(this)),this.typeDefinitionProvider=new Is(this._score.bind(this)),this.declarationProvider=new Is(this._score.bind(this)),this.implementationProvider=new Is(this._score.bind(this)),this.documentSymbolProvider=new Is(this._score.bind(this)),this.inlayHintsProvider=new Is(this._score.bind(this)),this.colorProvider=new Is(this._score.bind(this)),this.codeLensProvider=new Is(this._score.bind(this)),this.documentFormattingEditProvider=new Is(this._score.bind(this)),this.documentRangeFormattingEditProvider=new Is(this._score.bind(this)),this.onTypeFormattingEditProvider=new Is(this._score.bind(this)),this.signatureHelpProvider=new Is(this._score.bind(this)),this.hoverProvider=new Is(this._score.bind(this)),this.documentHighlightProvider=new Is(this._score.bind(this)),this.selectionRangeProvider=new Is(this._score.bind(this)),this.foldingRangeProvider=new Is(this._score.bind(this)),this.linkProvider=new Is(this._score.bind(this)),this.inlineCompletionsProvider=new Is(this._score.bind(this)),this.completionProvider=new Is(this._score.bind(this)),this.linkedEditingRangeProvider=new Is(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new Is(this._score.bind(this)),this.documentSemanticTokensProvider=new Is(this._score.bind(this)),this.documentOnDropEditProvider=new Is(this._score.bind(this)),this.documentPasteEditProvider=new Is(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}Zi(en,jqi,1);const L5=Vi("IWorkspaceEditService");class $_e{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(Xy.is(t))return Xy.lift(t);if(VL.is(t))return VL.lift(t);throw new Error("Unsupported edit")})}}class Xy extends $_e{static is(e){return e instanceof Xy?!0:Vu(e)&&Tn.isUri(e.resource)&&Vu(e.textEdit)}static lift(e){return e instanceof Xy?e:new Xy(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,r){super(r),this.resource=e,this.textEdit=t,this.versionId=i}}class VL extends $_e{static is(e){return e instanceof VL?!0:Vu(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof VL?e:new VL(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},r){super(r),this.oldResource=e,this.newResource=t,this.options=i}}const Gc={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},_q=Object.freeze({id:"editor",order:5,type:"object",title:E("editorConfigurationTitle","Editor"),scope:5}),gH=Object.assign(Object.assign({},_q),{properties:{"editor.tabSize":{type:"number",default:Ac.tabSize,minimum:1,markdownDescription:E("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:E("indentSize",'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:Ac.insertSpaces,markdownDescription:E("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:Ac.detectIndentation,markdownDescription:E("detectIndentation","Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:Ac.trimAutoWhitespace,description:E("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Ac.largeFileOptimizations,description:E("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:E("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[E("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),E("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),E("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:E("wordBasedSuggestionsMode","Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[E("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),E("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),E("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:E("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:E("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:E("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:E("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:E("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:E("editor.experimental.asyncTokenizationVerification","Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:E("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:E("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:E("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:E("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:E("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:E("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:Gc.maxComputationTime,description:E("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:Gc.maxFileSize,description:E("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:Gc.renderSideBySide,description:E("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:Gc.renderSideBySideInlineBreakpoint,description:E("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:Gc.useInlineViewWhenSpaceIsLimited,description:E("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:Gc.renderMarginRevertIcon,description:E("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:Gc.ignoreTrimWhitespace,description:E("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:Gc.renderIndicators,description:E("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:Gc.diffCodeLens,description:E("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:Gc.diffWordWrap,markdownEnumDescriptions:[E("wordWrap.off","Lines will never wrap."),E("wordWrap.on","Lines will wrap at the viewport width."),E("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:Gc.diffAlgorithm,markdownEnumDescriptions:[E("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),E("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:Gc.hideUnchangedRegions.enabled,markdownDescription:E("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:Gc.hideUnchangedRegions.revealLineCount,markdownDescription:E("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:Gc.hideUnchangedRegions.minimumLineCount,markdownDescription:E("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:Gc.hideUnchangedRegions.contextLineCount,markdownDescription:E("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:Gc.experimental.showMoves,markdownDescription:E("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:Gc.experimental.showEmptyDecorations,description:E("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}});function Uqi(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(const n of NI){const e=n.schema;if(typeof e<"u")if(Uqi(e))gH.properties[`editor.${n.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(gH.properties[t]=e[t])}let qB=null;function PKe(){return qB===null&&(qB=Object.create(null),Object.keys(gH.properties).forEach(n=>{qB[n]=!0})),qB}function qqi(n){return PKe()[`editor.${n}`]||!1}function Kqi(n){return PKe()[`diffEditor.${n}`]||!1}const Gqi=ds.as(O_.Configuration);Gqi.registerConfiguration(gH);class es{static insert(e,t){return{range:new q(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}}}function KZ(n){return Object.isFrozen(n)?n:O5i(n)}class Lc{constructor(e={},t=[],i=[],r){this._contents=e,this._keys=t,this._overrides=i,this.raw=r,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(!((e=this.raw)===null||e===void 0)&&e.length){const t=this.raw.map(i=>{if(i instanceof Lc)return i;const r=new Yqi("");return r.parseRaw(i),r.configurationModel});this._rawConfiguration=t.reduce((i,r)=>r===i?r:i.merge(r),t[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?VLe(this.contents,e):this.contents}inspect(e,t){const i=this.rawConfiguration.getValue(e),r=t?this.rawConfiguration.getOverrideValue(e,t):void 0,o=t?this.rawConfiguration.override(t).getValue(e):i;return{value:i,override:r,merged:o}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?VLe(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,i;const r=py(this.contents),o=py(this.overrides),s=[...this.keys],a=!((t=this.raw)===null||t===void 0)&&t.length?[...this.raw]:[this];for(const l of e)if(a.push(...!((i=l.raw)===null||i===void 0)&&i.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(r,l.contents);for(const c of l.overrides){const[u]=o.filter(d=>Qs(d.identifiers,c.identifiers));u?(this.mergeContents(u.contents,c.contents),u.keys.push(...c.keys),u.keys=rw(u.keys)):o.push(py(c))}for(const c of l.keys)s.indexOf(c)===-1&&s.push(c)}return new Lc(r,s,o,a.every(l=>l instanceof Lc)?void 0:a)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const i={};for(const r of rw([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[r];const s=t[r];s&&(typeof o=="object"&&typeof s=="object"?(o=py(o),this.mergeContents(o,s)):o=s),i[r]=o}return new Lc(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&Vu(e[i])&&Vu(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=py(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const r=o=>{o&&(i?this.mergeContents(i,o):i=py(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&r(o.contents);return r(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),Q$i(this.contents,e),dw.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>Qs(i.identifiers,FV(e))),1))}updateValue(e,t,i){zUe(this.contents,e,t,r=>console.error(r)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),dw.test(e)&&this.overrides.push({identifiers:FV(e),keys:Object.keys(this.contents[e]),contents:nse(this.contents[e],r=>console.error(r))})}}class Yqi{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new Lc}parseRaw(e,t){this._raw=e;const{contents:i,keys:r,overrides:o,restricted:s,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new Lc(i,r,o,a?[e]:void 0),this._restrictedConfigurations=s||[]}doParseRaw(e,t){const i=ds.as(O_.Configuration).getConfigurationProperties(),r=this.filter(e,i,!0,t);e=r.raw;const o=nse(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`)),s=Object.keys(e),a=this.toOverrides(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:o,keys:s,overrides:a,restricted:r.restricted,hasExcludedProperties:r.hasExcludedProperties}}filter(e,t,i,r){var o,s,a;let l=!1;if(!(r!=null&&r.scopes)&&!(r!=null&&r.skipRestricted)&&!(!((o=r==null?void 0:r.exclude)===null||o===void 0)&&o.length))return{raw:e,restricted:[],hasExcludedProperties:l};const c={},u=[];for(const d in e)if(dw.test(d)&&i){const h=this.filter(e[d],t,!1,r);c[d]=h.raw,l=l||h.hasExcludedProperties,u.push(...h.restricted)}else{const h=t[d],g=h?typeof h.scope<"u"?h.scope:3:void 0;h!=null&&h.restricted&&u.push(d),!(!((s=r.exclude)===null||s===void 0)&&s.includes(d))&&(!((a=r.include)===null||a===void 0)&&a.includes(d)||(g===void 0||r.scopes===void 0||r.scopes.includes(g))&&!(r.skipRestricted&&(h!=null&&h.restricted)))?c[d]=e[d]:l=!0}return{raw:c,restricted:u,hasExcludedProperties:l}}toOverrides(e,t){const i=[];for(const r of Object.keys(e))if(dw.test(r)){const o={};for(const s in e[r])o[s]=e[r][s];i.push({identifiers:FV(r),keys:Object.keys(o),contents:nse(o,t)})}return i}}class Qqi{constructor(e,t,i,r,o,s,a,l,c,u,d,h,g){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=r,this.defaultConfiguration=o,this.policyConfiguration=s,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=u,this.workspaceConfiguration=d,this.folderConfigurationModel=h,this.memoryConfigurationModel=g}inspect(e,t,i){const r=e.inspect(t,i);return{get value(){return KZ(r.value)},get override(){return KZ(r.override)},get merged(){return KZ(r.merged)}}}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.inspect(this.userConfiguration,this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.userInspectValue.value!==void 0||this.userInspectValue.override!==void 0?{value:this.userInspectValue.value,override:this.userInspectValue.override}:void 0}}class vq{constructor(e,t,i,r,o=new Lc,s=new Lc,a=new Rc,l=new Lc,c=new Rc){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=r,this._remoteUserConfiguration=o,this._workspaceConfiguration=s,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Rc,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let r;i.resource?(r=this._memoryConfigurationByResource.get(i.resource),r||(r=new Lc,this._memoryConfigurationByResource.set(i.resource,r))):r=this._memoryConfiguration,t===void 0?r.removeValue(e):r.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const r=this.getConsolidatedConfigurationModel(e,t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),s=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of r.overrides)for(const c of l.identifiers)r.getOverrideValue(e,c)!==void 0&&a.add(c);return new Qqi(e,t,r.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,o||void 0,s)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let r=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(r=r.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(r=r.merge(this._policyConfiguration)),r}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const r=t.getFolder(e);r&&(i=this.getFolderConsolidatedConfiguration(r.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),r=this._folderConfigurations.get(e);r?(t=i.merge(r),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.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:i,overrides:r,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:r,keys:o}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),i=this.parseConfigurationModel(e.policy),r=this.parseConfigurationModel(e.application),o=this.parseConfigurationModel(e.user),s=this.parseConfigurationModel(e.workspace),a=e.folders.reduce((l,c)=>(l.set(Tn.revive(c[0]),this.parseConfigurationModel(c[1])),l),new Rc);return new vq(t,i,r,o,new Lc,s,a,new Lc,new Rc)}static parseConfigurationModel(e){return new Lc(e.contents,e.keys,e.overrides)}}class Xqi{constructor(e,t,i,r){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=r,this._marker=`
`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const o of e.keys)this.affectedKeys.add(o);for(const[,o]of e.overrides)for(const s of o)this.affectedKeys.add(s);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=vq.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var i;const r=this._marker+e,o=this._affectsConfigStr.indexOf(r);if(o<0)return!1;const s=o+r.length;if(s>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(s);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(i=this.previous)===null||i===void 0?void 0:i.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!tf(l,c)}return!0}}const pH={kind:0},Zqi={kind:1};function Jqi(n,e,t){return{kind:2,commandId:n,commandArgs:e,isBubble:t}}class QO{constructor(e,t,i){var r;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const o of e){const s=o.command;s&&s.charAt(0)!=="-"&&this._defaultBoundCommands.set(s,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=QO.handleRemovals([].concat(e).concat(t));for(let o=0,s=this._keybindings.length;o<s;o++){const a=this._keybindings[o];if(a.chords.length===0)continue;const l=(r=a.when)===null||r===void 0?void 0:r.substituteConstants();l&&l.type===0||this._addKeyPress(a.chords[0],a)}}static _isTargetedForRemoval(e,t,i){if(t){for(let r=0;r<t.length;r++)if(t[r]!==e.chords[r])return!1}return!(i&&i.type!==1&&(!e.when||!lBi(i,e.when)))}static handleRemovals(e){const t=new Map;for(let r=0,o=e.length;r<o;r++){const s=e[r];if(s.command&&s.command.charAt(0)==="-"){const a=s.command.substring(1);t.has(a)?t.get(a).push(s):t.set(a,[s])}}if(t.size===0)return e;const i=[];for(let r=0,o=e.length;r<o;r++){const s=e[r];if(!s.command||s.command.length===0){i.push(s);continue}if(s.command.charAt(0)==="-")continue;const a=t.get(s.command);if(!a||!s.isDefault){i.push(s);continue}let l=!1;for(const c of a){const u=c.when;if(this._isTargetedForRemoval(s,c.chords,u)){l=!0;break}}if(!l){i.push(s);continue}}return i}_addKeyPress(e,t){const i=this._map.get(e);if(typeof i>"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let r=i.length-1;r>=0;r--){const o=i[r];if(o.command===t.command)continue;let s=!0;for(let a=1;a<o.chords.length&&a<t.chords.length;a++)if(o.chords[a]!==t.chords[a]){s=!1;break}s&&QO.whenIsEntirelyIncluded(o.when,t.when)&&this._removeFromLookupMap(o)}i.push(t),this._addToLookupMap(t)}_addToLookupMap(e){if(!e.command)return;let t=this._lookupMap.get(e.command);typeof t>"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,r=t.length;i<r;i++)if(t[i]===e){t.splice(i,1);return}}}static whenIsEntirelyIncluded(e,t){return!t||t.type===1?!0:!e||e.type===1?!1:Goe(e,t)}getKeybindings(){return this._keybindings}lookupPrimaryKeybinding(e,t){const i=this._lookupMap.get(e);if(typeof i>"u"||i.length===0)return null;if(i.length===1)return i[0];for(let r=i.length-1;r>=0;r--){const o=i[r];if(t.contextMatchesRules(o.when))return o}return i[i.length-1]}resolve(e,t,i){const r=[...t,i];this._log(`| Resolving ${r}`);const o=this._map.get(r[0]);if(o===void 0)return this._log("\\ No keybinding entries."),pH;let s=null;if(r.length<2)s=o;else{s=[];for(let l=0,c=o.length;l<c;l++){const u=o[l];if(r.length>u.chords.length)continue;let d=!0;for(let h=1;h<r.length;h++)if(u.chords[h]!==r[h]){d=!1;break}d&&s.push(u)}}const a=this._findCommand(e,s);return a?r.length<a.chords.length?(this._log(`\\ From ${s.length} keybinding entries, awaiting ${a.chords.length-r.length} more chord(s), when: ${J2e(a.when)}, source: ${eAe(a)}.`),Zqi):(this._log(`\\ From ${s.length} keybinding entries, matched ${a.command}, when: ${J2e(a.when)}, source: ${eAe(a)}.`),Jqi(a.command,a.commandArgs,a.bubble)):(this._log(`\\ From ${s.length} keybinding entries, no when clauses matched the context.`),pH)}_findCommand(e,t){for(let i=t.length-1;i>=0;i--){const r=t[i];if(QO._contextMatchesRules(e,r.when))return r}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function J2e(n){return n?`${n.serialize()}`:"no when condition"}function eAe(n){return n.extensionId?n.isBuiltinExtension?`built-in extension ${n.extensionId}`:`user extension ${n.extensionId}`:n.isDefault?"built-in":"user"}const eKi=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class tKi extends Ae{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:Pt.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,r,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=r,this._logService=o,this._onDidUpdateKeybindings=this._register(new be),this._currentChords=[],this._currentChordChecker=new p5,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=GI.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new nm,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),pH;const[r]=i.getDispatchChords();if(r===null)return this._log("\\ Keyboard event cannot be dispatched"),pH;const o=this._contextKeyService.getContext(t),s=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,s,r)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw yme("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(E("first.chord","({0}) was pressed. Waiting for second key of chord...",t));break;default:{const i=this._currentChords.map(({label:r})=>r).join(", ");this._currentChordStatusMessage=this._notificationService.status(E("next.chord","({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),MO.enabled&&MO.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],MO.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[r]=i.getSingleModifierDispatchChords();if(r)return this._ignoreSingleModifiers.has(r)?(this._log(`+ Ignoring single modifier ${r} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=GI.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=GI.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${r}.`),this._currentSingleModifier=r,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):r===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${r} ${r}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${r}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new GI(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){var r;let o=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let s=null,a=null;if(i){const[d]=e.getSingleModifierDispatchChords();s=d,a=d?[d]:[]}else[s]=e.getDispatchChords(),a=this._currentChords.map(({keypress:d})=>d);if(s===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),o;const l=this._contextKeyService.getContext(t),c=e.getLabel(),u=this._getResolver().resolve(l,a,s);switch(u.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",c,"[ No matching keybinding ]"),this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(E("missing.chord","The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}return o}case 1:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),o=!0,this._expectAnotherChord(s,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),o;case 2:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${u.commandId} ]`),u.commandId===null||u.commandId===""){if(this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${d}, ${c}".`),this._notificationService.status(E("missing.chord","The key combination ({0}, {1}) is not a command.",d,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}}else this.inChordMode&&this._leaveChordMode(),u.isBubble||(o=!0),this._log(`+ Invoking command ${u.commandId}.`),typeof u.commandArgs>"u"?this._commandService.executeCommand(u.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(u.commandId,u.commandArgs).then(void 0,d=>this._notificationService.warn(d)),eKi.test(u.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:u.commandId,from:"keybinding",detail:(r=e.getUserSettingsLabel())!==null&&r!==void 0?r:void 0});return o}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class GI{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}GI.EMPTY=new GI(null);class tAe{constructor(e,t,i,r,o,s,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?Gse(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=Gse(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=r,this.isDefault=o,this.extensionId=s,this.isBuiltinExtension=a}}function Gse(n){const e=[];for(let t=0,i=n.length;t<i;t++){const r=n[t];if(!r)return[];e.push(r)}return e}class bq{constructor(e,t,i=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=i}toLabel(e,t,i){if(t.length===0)return null;const r=[];for(let o=0,s=t.length;o<s;o++){const a=t[o],l=i(a);if(l===null)return null;r[o]=oKi(a,l,this.modifierLabels[e])}return r.join(" ")}}const V_e=new bq({ctrlKey:"⌃",shiftKey:"⇧",altKey:"⌥",metaKey:"⌘",separator:""},{ctrlKey:E({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:E({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:E({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:E({key:"windowsKey",comment:["This is the short form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:E({key:"ctrlKey",comment:["This is the short form for the Control key on the keyboard"]},"Ctrl"),shiftKey:E({key:"shiftKey",comment:["This is the short form for the Shift key on the keyboard"]},"Shift"),altKey:E({key:"altKey",comment:["This is the short form for the Alt key on the keyboard"]},"Alt"),metaKey:E({key:"superKey",comment:["This is the short form for the Super key on the keyboard"]},"Super"),separator:"+"}),nKi=new bq({ctrlKey:E({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:E({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:E({key:"optKey.long",comment:["This is the long form for the Alt/Option key on the keyboard"]},"Option"),metaKey:E({key:"cmdKey.long",comment:["This is the long form for the Command key on the keyboard"]},"Command"),separator:"+"},{ctrlKey:E({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:E({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:E({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:E({key:"windowsKey.long",comment:["This is the long form for the Windows key on the keyboard"]},"Windows"),separator:"+"},{ctrlKey:E({key:"ctrlKey.long",comment:["This is the long form for the Control key on the keyboard"]},"Control"),shiftKey:E({key:"shiftKey.long",comment:["This is the long form for the Shift key on the keyboard"]},"Shift"),altKey:E({key:"altKey.long",comment:["This is the long form for the Alt key on the keyboard"]},"Alt"),metaKey:E({key:"superKey.long",comment:["This is the long form for the Super key on the keyboard"]},"Super"),separator:"+"}),iKi=new bq({ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Cmd",separator:"+"},{ctrlKey:"Ctrl",shiftKey:"Shift",altKey:"Alt",metaKey:"Super",separator:"+"}),rKi=new bq({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:"+"});function oKi(n,e,t){if(e===null)return"";const i=[];return n.ctrlKey&&i.push(t.ctrlKey),n.shiftKey&&i.push(t.shiftKey),n.altKey&&i.push(t.altKey),n.metaKey&&i.push(t.metaKey),e!==""&&i.push(e),i.join(t.separator)}class sKi extends uBi{constructor(e,t){if(super(),t.length===0)throw gg("chords");this._os=e,this._chords=t}getLabel(){return V_e.toLabel(this._os,this._chords,e=>this._getLabel(e))}getAriaLabel(){return nKi.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:iKi.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return rKi.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new cBi(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class e4 extends sKi{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return Cy.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Cy.toString(e.keyCode)}_getElectronAccelerator(e){return Cy.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Cy.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return e4.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+=Cy.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=kme[e];if(t!==-1)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 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof y0)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new y0(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=Gse(e.chords.map(r=>this._toKeyCodeChord(r)));return i.length>0?[new e4(i,t)]:[]}}const c2=Vi("labelService"),MKe=Vi("progressService");class Zy{constructor(e,t){this.callback=e,this.report=t!=null&&t.async?this._reportAsync.bind(this):this._reportSync.bind(this)}_reportSync(e){this._value=e,this.callback(this._value)}_reportAsync(e){Promise.resolve(this._lastTask).finally(()=>{this._value=e;const t=this.callback(this._value);this._lastTask=Promise.resolve(t).finally(()=>this._lastTask=void 0)})}}Zy.None=Object.freeze({report(){}});const iS=Vi("editorProgressService");class aKi{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){const t=e.charCodeAt(0),i=this._value.charCodeAt(this._pos);return t-i}value(){return this._value[this._pos]}}class lKi{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(this._value.charCodeAt(this._to)===46)if(e)this._from++;else break;else e=!1;return this}cmp(e){return this._caseSensitive?Ime(e,this._value,0,e.length,this._from,this._to):h5(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class cKi{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 i=this._value.charCodeAt(t);if(!(i===47||this._splitOnBackslash&&i===92))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(t===47||this._splitOnBackslash&&t===92)if(e)this._from++;else break;else e=!1}return this}cmp(e){return this._caseSensitive?Ime(e,this._value,0,e.length,this._from,this._to):h5(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class uKi{constructor(e,t){this._ignorePathCasing=e,this._ignoreQueryAndFragment=t,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 cKi(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(3)),this._ignoreQueryAndFragment(e)||(this._value.query&&this._states.push(4),this._value.fragment&&this._states.push(5)),this._stateIdx=0,this}next(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return this._states[this._stateIdx]===3&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(this._states[this._stateIdx]===1)return Woe(e,this._value.scheme);if(this._states[this._stateIdx]===2)return Woe(e,this._value.authority);if(this._states[this._stateIdx]===3)return this._pathIterator.cmp(e);if(this._states[this._stateIdx]===4)return wM(e,this._value.query);if(this._states[this._stateIdx]===5)return wM(e,this._value.fragment);throw new Error}value(){if(this._states[this._stateIdx]===1)return this._value.scheme;if(this._states[this._stateIdx]===2)return this._value.authority;if(this._states[this._stateIdx]===3)return this._pathIterator.value();if(this._states[this._stateIdx]===4)return this._value.query;if(this._states[this._stateIdx]===5)return this._value.fragment;throw new Error}}class KB{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(t=(e=this.left)===null||e===void 0?void 0:e.height)!==null&&t!==void 0?t:0}get heightRight(){var e,t;return(t=(e=this.right)===null||e===void 0?void 0:e.height)!==null&&t!==void 0?t:0}}class HL{static forUris(e=()=>!1,t=()=>!1){return new HL(new uKi(e,t))}static forStrings(){return new HL(new aKi)}static forConfigKeys(){return new HL(new lKi)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let r;this._root||(this._root=new KB,this._root.segment=i.value());const o=[];for(r=this._root;;){const a=i.cmp(r.segment);if(a>0)r.left||(r.left=new KB,r.left.segment=i.value()),o.push([-1,r]),r=r.left;else if(a<0)r.right||(r.right=new KB,r.right.segment=i.value()),o.push([1,r]),r=r.right;else if(i.hasNext())i.next(),r.mid||(r.mid=new KB,r.mid.segment=i.value()),o.push([0,r]),r=r.mid;else break}const s=r.value;r.value=t,r.key=e;for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const u=o[a][0],d=o[a+1][0];if(u===1&&d===1)o[a][1]=l.rotateLeft();else if(u===-1&&d===-1)o[a][1]=l.rotateRight();else if(u===1&&d===-1)l.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=l.rotateLeft();else if(u===-1&&d===1)l.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return s}get(e){var t;return(t=this._getNode(e))===null||t===void 0?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const r=t.cmp(i.segment);if(r>0)i=i.left;else if(r<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!((t==null?void 0:t.value)===void 0&&(t==null?void 0:t.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var i;const r=this._iter.reset(e),o=[];let s=this._root;for(;s;){const a=r.cmp(s.segment);if(a>0)o.push([-1,s]),s=s.left;else if(a<0)o.push([1,s]),s=s.right;else if(r.hasNext())r.next(),o.push([0,s]),s=s.mid;else break}if(s){if(t?(s.left=void 0,s.mid=void 0,s.right=void 0,s.height=1):(s.key=void 0,s.value=void 0),!s.mid&&!s.value)if(s.left&&s.right){const a=this._min(s.right);if(a.key){const{key:l,value:c,segment:u}=a;this._delete(a.key,!1),s.key=l,s.value=c,s.segment=u}}else{const a=(i=s.left)!==null&&i!==void 0?i:s.right;if(o.length>0){const[l,c]=o[o.length-1];switch(l){case-1:c.left=a;break;case 0:c.mid=a;break;case 1:c.right=a;break}}else this._root=a}for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c>1?(l.right.balanceFactor()>=0||(l.right=l.right.rotateRight()),o[a][1]=l.rotateLeft()):c<-1&&(l.left.balanceFactor()<=0||(l.left=l.left.rotateLeft()),o[a][1]=l.rotateRight()),a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}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 i=this._root,r;for(;i;){const o=t.cmp(i.segment);if(o>0)i=i.left;else if(o<0)i=i.right;else if(t.hasNext())t.next(),r=i.value||r,i=i.mid;else break}return i&&i.value||r}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let r=this._root;for(;r;){const o=i.cmp(r.segment);if(o>0)r=r.left;else if(o<0)r=r.right;else if(i.hasNext())i.next(),r=r.mid;else return r.mid?this._entries(r.mid):t?r.value:void 0}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const Bx=Vi("contextService");function Yse(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&Tn.isUri(e.uri)}function dKi(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&!Yse(n)&&!pKi(n)}const hKi={id:"ext-dev"},fKi={id:"empty-window"};function gKi(n,e){if(typeof n=="string"||typeof n>"u")return typeof n=="string"?{id:LC(n)}:e?hKi:fKi;const t=n;return t.configuration?{id:t.id,configPath:t.configuration}:t.folders.length===1?{id:t.id,uri:t.folders[0].uri}:{id:t.id}}function pKi(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&Tn.isUri(e.configPath)}class mKi{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 Qse="code-workspace";E("codeWorkspace","Code Workspace");const FKe="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function _Ki(n){return n.id===FKe}var Xse;(function(n){n.inspectTokensAction=E("inspectTokens","Developer: Inspect Tokens")})(Xse||(Xse={}));var mH;(function(n){n.gotoLineActionLabel=E("gotoLineActionLabel","Go to Line/Column...")})(mH||(mH={}));var Zse;(function(n){n.helpQuickAccessActionLabel=E("helpQuickAccess","Show all Quick Access Providers")})(Zse||(Zse={}));var _H;(function(n){n.quickCommandActionLabel=E("quickCommandActionLabel","Command Palette"),n.quickCommandHelp=E("quickCommandActionHelp","Show And Run Commands")})(_H||(_H={}));var t4;(function(n){n.quickOutlineActionLabel=E("quickOutlineActionLabel","Go to Symbol..."),n.quickOutlineByCategoryActionLabel=E("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(t4||(t4={}));var vH;(function(n){n.editorViewAccessibleLabel=E("editorViewAccessibleLabel","Editor content"),n.accessibilityHelpMessage=E("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(vH||(vH={}));var Jse;(function(n){n.toggleHighContrast=E("toggleHighContrast","Toggle High Contrast Theme")})(Jse||(Jse={}));var eae;(function(n){n.bulkEditServiceSummary=E("bulkEditServiceSummary","Made {0} edits in {1} files")})(eae||(eae={}));const BKe=Vi("workspaceTrustManagementService"),O0=Vi("contextViewService"),om=Vi("contextMenuService");var xc;(function(n){function e(o,s){if(o.start>=s.end||s.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,s.start),l=Math.min(o.end,s.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}n.intersect=e;function t(o){return o.end-o.start<=0}n.isEmpty=t;function i(o,s){return!t(e(o,s))}n.intersects=i;function r(o,s){const a=[],l={start:o.start,end:Math.min(s.start,o.end)},c={start:Math.max(s.end,o.start),end:o.end};return t(l)||a.push(l),t(c)||a.push(c),a}n.relativeComplement=r})(xc||(xc={}));function vKi(n){const e=n;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var tC;(function(n){n[n.AVOID=0]="AVOID",n[n.ALIGN=1]="ALIGN"})(tC||(tC={}));function YI(n,e,t){const i=t.mode===tC.ALIGN?t.offset:t.offset+t.size,r=t.mode===tC.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=n-i?i:e<=r?r-e:Math.max(n-e,0):e<=r?r-e:e<=n-i?i:0}class u2 extends Ae{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=Ae.None,this.toDisposeOnSetContainer=Ae.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=at(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,Au(this.view),this.setContainer(e,t),this._register(Gn(()=>this.setContainer(null,1)))}setContainer(e,t){var i;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(i=this.shadowRootHostElement)===null||i===void 0||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){if(this.container=e,this.useFixedPosition=t!==1,this.useShadowDOM=t===3,this.useShadowDOM){this.shadowRootHostElement=at(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=bKi,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(at("slot"))}else this.container.appendChild(this.view);const r=new nt;u2.BUBBLE_UP_EVENTS.forEach(o=>{r.add(ua(this.container,o,s=>{this.onDOMEvent(s,!1)}))}),u2.BUBBLE_DOWN_EVENTS.forEach(o=>{r.add(ua(this.container,o,s=>{this.onDOMEvent(s,!0)},!0))}),this.toDisposeOnSetContainer=r}}show(e){var t,i;this.isVisible()&&this.hide(),Gl(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",Yd(this.view),this.toDisposeOnClean=e.render(this.view)||Ae.None,this.delegate=e,this.doLayout(),(i=(t=this.delegate).focus)===null||i===void 0||i.call(t)}getViewElement(){return this.view}layout(){if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(C_&&$me.pointerEvents)){this.hide();return}this.delegate.layout&&this.delegate.layout(),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(Hme(e)){const d=Oa(e),h=t$i(e);t={top:d.top*h,left:d.left*h,width:d.width*h,height:d.height*h}}else vKi(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};const i=_d(this.view),r=TE(this.view),o=this.delegate.anchorPosition||0,s=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,c;if(a===0){const d={offset:t.top-window.pageYOffset,size:t.height,position:o===0?0:1},h={offset:t.left,size:t.width,position:s===0?0:1,mode:tC.ALIGN};l=YI(window.innerHeight,r,d)+window.pageYOffset,xc.intersects({start:l,end:l+r},{start:d.offset,end:d.offset+d.size})&&(h.mode=tC.AVOID),c=YI(window.innerWidth,i,h)}else{const d={offset:t.left,size:t.width,position:s===0?0:1},h={offset:t.top,size:t.height,position:o===0?0:1,mode:tC.ALIGN};c=YI(window.innerWidth,i,d),xc.intersects({start:c,end:c+i},{start:d.offset,end:d.offset+d.size})&&(h.mode=tC.AVOID),l=YI(window.innerHeight,r,h)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===0?"bottom":"top"),this.view.classList.add(s===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const u=Oa(this.container);this.view.style.top=`${l-(this.useFixedPosition?Oa(this.view).top:u.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?Oa(this.view).left:u.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t!=null&&t.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),Au(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!gc(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}u2.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];u2.BUBBLE_DOWN_EVENTS=["click"];const bKi=`
:host {
all: initial; /* 1st rule so subsequent properties are reset. */
}
.codicon[class*='codicon-'] {
font: normal normal normal 16px/1 codicon;
display: inline-block;
text-decoration: none;
text-rendering: auto;
text-align: center;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
:host {
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;
}
:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }
:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }
:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }
:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }
:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }
:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }
:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }
:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }
:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }
:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }
:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }
: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; }
: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; }
: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; }
: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; }
`;var yKi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},CKi=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let tae=class extends Ae{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=Ae.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new u2(this.container,1)),this.layout(),this._register(e.onDidLayout(()=>this.layout()))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,i){t?(t!==this.container||this.shadowRoot!==i)&&(this.container=t,this.setContainer(t,i?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.shadowRoot=i,this.contextView.show(e);const r=Gn(()=>{this.currentViewDisposable===r&&this.hideContextView()});return this.currentViewDisposable=r,r}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};tae=yKi([CKi(0,TA)],tae);let d2=[],H_e=[],$Ke=[];function GB(n,e=!1){wKi(n,!1,e)}function wKi(n,e,t){const i=SKi(n,e);d2.push(i),i.userConfigured?$Ke.push(i):H_e.push(i),t&&!i.userConfigured&&d2.forEach(r=>{r.mime===i.mime||r.userConfigured||(i.extension&&r.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&r.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&r.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&r.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function SKi(n,e){return{id:n.id,mime:n.mime,filename:n.filename,extension:n.extension,filepattern:n.filepattern,firstline:n.firstline,userConfigured:e,filenameLowercase:n.filename?n.filename.toLowerCase():void 0,extensionLowercase:n.extension?n.extension.toLowerCase():void 0,filepatternLowercase:n.filepattern?AKe(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(Ra.sep)>=0:!1}}function EKi(){d2=d2.filter(n=>n.userConfigured),H_e=[]}function xKi(n,e){return kKi(n,e).map(t=>t.id)}function kKi(n,e){let t;if(n)switch(n.scheme){case Si.file:t=n.fsPath;break;case Si.data:{t=mw.parseMetaData(n).get(mw.META_DATA_LABEL);break}case Si.vscodeNotebookCell:t=void 0;break;default:t=n.path}if(!t)return[{id:"unknown",mime:Ks.unknown}];t=t.toLowerCase();const i=LC(t),r=nAe(t,i,$Ke);if(r)return[r,{id:nf,mime:Ks.text}];const o=nAe(t,i,H_e);if(o)return[o,{id:nf,mime:Ks.text}];if(e){const s=TKi(e);if(s)return[s,{id:nf,mime:Ks.text}]}return[{id:"unknown",mime:Ks.unknown}]}function nAe(n,e,t){var i;let r,o,s;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){r=l;break}if(l.filepattern&&(!o||l.filepattern.length>o.filepattern.length)){const c=l.filepatternOnPath?n:e;!((i=l.filepatternLowercase)===null||i===void 0)&&i.call(l,c)&&(o=l)}l.extension&&(!s||l.extension.length>s.extension.length)&&e.endsWith(l.extensionLowercase)&&(s=l)}if(r)return r;if(o)return o;if(s)return s}function TKi(n){if(Ome(n)&&(n=n.substr(1)),n.length>0)for(let e=d2.length-1;e>=0;e--){const t=d2[e];if(!t.firstline)continue;const i=n.match(t.firstline);if(i&&i.length>0)return t}}const YB=Object.prototype.hasOwnProperty,iAe="vs.editor.nullLanguage";class IKi{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(iAe,0),this._register(nf,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]||iAe}}class n4 extends Ae{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new be),this.onDidChange=this._onDidChange.event,n4.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new IKi,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(XD.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){n4.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},EKi();const e=[].concat(XD.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(t=>{const i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(r=>{this._lowercaseNameMap[r.toLowerCase()]=i.identifier}),i.mimetypes.forEach(r=>{this._mimeTypesMap[r]=i.identifier})}),ds.as(O_.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;YB.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let r=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),r=t.mimetypes[0]),r||(r=`text/x-${i}`,e.mimetypes.push(r)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)GB({id:i,mime:r,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)GB({id:i,mime:r,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)GB({id:i,mime:r,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const l=new RegExp(a);L6i(l)||GB({id:i,mime:r,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(i);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);const s=o!==null&&o.length>0;if(!(s&&o[0]===null)){const a=(s?o[0]:null)||i;(s||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?YB.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return YB.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&YB.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:xKi(e,t)}}n4.instanceCount=0;class i4 extends Ae{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new be),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new be),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new be({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,i4.instanceCount++,this._registry=this._register(new n4(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){i4.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){const i=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return vje(i,null)}createById(e){return new rAe(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new rAe(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=nf),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),ps.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}i4.instanceCount=0;class rAe{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 be({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,(e=this._emitter)===null||e===void 0||e.fire(this.languageId))}}const r4={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Ks.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};function W_e(...n){return function(e,t){for(let i=0,r=n.length;i<r;i++){const o=n[i](e,t);if(o)return o}return null}}VKe.bind(void 0,!1);const o4=VKe.bind(void 0,!0);function VKe(n,e,t){if(!t||t.length<e.length)return null;let i;return n?i=Lme(t,e):i=t.indexOf(e)===0,i?e.length>0?[{start:0,end:e.length}]:[]:null}function HKe(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t===-1?null:[{start:t,end:t+n.length}]}function WKe(n,e){return nae(n.toLowerCase(),e.toLowerCase(),0,0)}function nae(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]===e[i]){let r=null;return(r=nae(n,e,t+1,i+1))?U_e({start:i,end:i+1},r):null}return nae(n,e,t,i+1)}function z_e(n){return 97<=n&&n<=122}function yq(n){return 65<=n&&n<=90}function j_e(n){return 48<=n&&n<=57}function zKe(n){return n===32||n===9||n===10||n===13}const jKe=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(n=>jKe.add(n.charCodeAt(0)));function bH(n){return zKe(n)||jKe.has(n)}function LKi(n,e){return n===e||bH(n)&&bH(e)}function UKe(n){return z_e(n)||yq(n)||j_e(n)}function U_e(n,e){return e.length===0?e=[n]:n.end===e[0].start?e[0].start=n.start:e.unshift(n),e}function qKe(n,e){for(let t=e;t<n.length;t++){const i=n.charCodeAt(t);if(yq(i)||j_e(i)||t>0&&!UKe(n.charCodeAt(t-1)))return t}return n.length}function iae(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]!==e[i].toLowerCase())return null;{let r=null,o=i+1;for(r=iae(n,e,t+1,i+1);!r&&(o=qKe(e,o))<e.length;)r=iae(n,e,t+1,o),o++;return r===null?null:U_e({start:i,end:i+1},r)}}function DKi(n){let e=0,t=0,i=0,r=0,o=0;for(let u=0;u<n.length;u++)o=n.charCodeAt(u),yq(o)&&e++,z_e(o)&&t++,UKe(o)&&i++,j_e(o)&&r++;const s=e/n.length,a=t/n.length,l=i/n.length,c=r/n.length;return{upperPercent:s,lowerPercent:a,alphaPercent:l,numericPercent:c}}function AKi(n){const{upperPercent:e,lowerPercent:t}=n;return t===0&&e>.6}function RKi(n){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:r}=n;return t>.2&&e<.8&&i>.6&&r<.2}function NKi(n){let e=0,t=0,i=0,r=0;for(let o=0;o<n.length;o++)i=n.charCodeAt(o),yq(i)&&e++,z_e(i)&&t++,zKe(i)&&r++;return(e===0||t===0)&&r===0?n.length<=30:e<=5}function KKe(n,e){if(!e||(e=e.trim(),e.length===0)||!NKi(n)||e.length>60)return null;const t=DKi(e);if(!RKi(t)){if(!AKi(t))return null;e=e.toLowerCase()}let i=null,r=0;for(n=n.toLowerCase();r<e.length&&(i=iae(n,e,0,r))===null;)r=qKe(e,r+1);return i}function OKi(n,e,t=!1){if(!e||e.length===0)return null;let i=null,r=0;for(n=n.toLowerCase(),e=e.toLowerCase();r<e.length&&(i=rae(n,e,0,r,t))===null;)r=GKe(e,r+1);return i}function rae(n,e,t,i,r){if(t===n.length)return[];if(i===e.length)return null;if(LKi(n.charCodeAt(t),e.charCodeAt(i))){let o=null,s=i+1;if(o=rae(n,e,t+1,i+1,r),!r)for(;!o&&(s=GKe(e,s))<e.length;)o=rae(n,e,t+1,s,r),s++;return o?n.charCodeAt(t)!==e.charCodeAt(i)?o:U_e({start:i,end:i+1},o):null}else return null}function GKe(n,e){for(let t=e;t<n.length;t++)if(bH(n.charCodeAt(t))||t>0&&bH(n.charCodeAt(t-1)))return t;return n.length}const PKi=W_e(o4,KKe,HKe),MKi=W_e(o4,KKe,WKe),oAe=new eS(1e4);function sAe(n,e,t=!1){if(typeof n!="string"||typeof e!="string")return null;let i=oAe.get(n);i||(i=new RegExp(T6i(n),"i"),oAe.set(n,i));const r=i.exec(e);return r?[{start:r.index,end:r.index+r[0].length}]:t?MKi(n,e):PKi(n,e)}function FKi(n,e){const t=$x(n,n.toLowerCase(),0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return t?D5(t):null}function BKi(n,e,t,i,r,o){const s=Math.min(13,n.length);for(;t<s;t++){const a=$x(n,e,t,i,r,o,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(a)return a}return[0,o]}function D5(n){if(typeof n>"u")return[];const e=[],t=n[1];for(let i=n.length-1;i>1;i--){const r=n[i]+t,o=e[e.length-1];o&&o.end===r?o.end=r+1:e.push({start:r,end:r+1})}return e}const nC=128;function q_e(){const n=[],e=[];for(let t=0;t<=nC;t++)e[t]=0;for(let t=0;t<=nC;t++)n.push(e.slice(0));return n}function YKe(n){const e=[];for(let t=0;t<=n;t++)e[t]=0;return e}const QKe=YKe(2*nC),oae=YKe(2*nC),Zb=q_e(),kS=q_e(),QB=q_e();function XB(n,e){if(e<0||e>=n.length)return!1;const t=n.codePointAt(e);switch(t){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!Nme(t)}}function aAe(n,e){if(e<0||e>=n.length)return!1;switch(n.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function j8(n,e,t){return e[n]!==t[n]}function $Ki(n,e,t,i,r,o,s=!1){for(;e<t&&r<o;)n[e]===i[r]&&(s&&(QKe[e]=r),e+=1),r+=1;return e===t}var __;(function(n){n.Default=[-100,0];function e(t){return!t||t.length===2&&t[0]===-100&&t[1]===0}n.isDefault=e})(__||(__={}));class Cq{constructor(e,t){this.firstMatchCanBeWeak=e,this.boostFullMatch=t}}Cq.default={boostFullMatch:!0,firstMatchCanBeWeak:!1};function $x(n,e,t,i,r,o,s=Cq.default){const a=n.length>nC?nC:n.length,l=i.length>nC?nC:i.length;if(t>=a||o>=l||a-t>l-o||!$Ki(e,t,a,r,o,l,!0))return;VKi(a,l,t,o,e,r);let c=1,u=1,d=t,h=o;const g=[!1];for(c=1,d=t;d<a;c++,d++){const b=QKe[d],y=oae[d],C=d+1<a?oae[d+1]:l;for(u=b-o+1,h=b;h<C;u++,h++){let x=Number.MIN_SAFE_INTEGER,k=!1;h<=y&&(x=HKi(n,e,d,t,i,r,h,l,o,Zb[c-1][u-1]===0,g));let I=0;x!==Number.MAX_SAFE_INTEGER&&(k=!0,I=x+kS[c-1][u-1]);const L=h>b,D=L?kS[c][u-1]+(Zb[c][u-1]>0?-5:0):0,R=h>b+1&&Zb[c][u-1]>0,P=R?kS[c][u-2]+(Zb[c][u-2]>0?-5:0):0;if(R&&(!L||P>=D)&&(!k||P>=I))kS[c][u]=P,QB[c][u]=3,Zb[c][u]=0;else if(L&&(!k||D>=I))kS[c][u]=D,QB[c][u]=2,Zb[c][u]=0;else if(k)kS[c][u]=I,QB[c][u]=1,Zb[c][u]=Zb[c-1][u-1]+1;else throw new Error("not possible")}}if(!g[0]&&!s.firstMatchCanBeWeak)return;c--,u--;const p=[kS[c][u],o];let m=0,_=0;for(;c>=1;){let b=u;do{const y=QB[c][b];if(y===3)b=b-2;else if(y===2)b=b-1;else break}while(b>=1);m>1&&e[t+c-1]===r[o+u-1]&&!j8(b+o-1,i,r)&&m+1>Zb[c][b]&&(b=u),b===u?m++:m=1,_||(_=b),c--,u=b-1,p.push(u)}l===a&&s.boostFullMatch&&(p[0]+=2);const v=_-a;return p[0]-=v,p}function VKi(n,e,t,i,r,o){let s=n-1,a=e-1;for(;s>=t&&a>=i;)r[s]===o[a]&&(oae[s]=a,s--),a--}function HKi(n,e,t,i,r,o,s,a,l,c,u){if(e[t]!==o[s])return Number.MIN_SAFE_INTEGER;let d=1,h=!1;return s===t-i?d=n[t]===r[s]?7:5:j8(s,r,o)&&(s===0||!j8(s-1,r,o))?(d=n[t]===r[s]?7:5,h=!0):XB(o,s)&&(s===0||!XB(o,s-1))?d=5:(XB(o,s-1)||aAe(o,s-1))&&(d=5,h=!0),d>1&&t===i&&(u[0]=!0),h||(h=j8(s,r,o)||XB(o,s-1)||aAe(o,s-1)),t===i?s>l&&(d-=h?3:5):c?d+=h?2:0:d+=h?0:1,s+1===a&&(d-=h?3:5),d}function WKi(n,e,t,i,r,o,s){return zKi(n,e,t,i,r,o,!0,s)}function zKi(n,e,t,i,r,o,s,a){let l=$x(n,e,t,i,r,o,a);if(l&&!s)return l;if(n.length>=3){const c=Math.min(7,n.length-1);for(let u=t+1;u<c;u++){const d=jKi(n,u);if(d){const h=$x(d,d.toLowerCase(),t,i,r,o,a);h&&(h[0]-=3,(!l||h[0]>l[0])&&(l=h))}}}return l}function jKi(n,e){if(e+1>=n.length)return;const t=n[e],i=n[e+1];if(t!==i)return n.slice(0,e)+i+t+n.slice(e+2)}const UKi="$(",K_e=new RegExp(`\\$\\(${In.iconNameExpression}(?:${In.iconModifierExpression})?\\)`,"g"),qKi=new RegExp(`(\\\\)?${K_e.source}`,"g");function KKi(n){return n.replace(qKi,(e,t)=>t?e:`\\${e}`)}const GKi=new RegExp(`\\\\${K_e.source}`,"g");function YKi(n){return n.replace(GKi,e=>`\\${e}`)}const QKi=new RegExp(`(\\s)?(\\\\)?${K_e.source}(\\s)?`,"g");function G_e(n){return n.indexOf(UKi)===-1?n:n.replace(QKi,(e,t,i,r)=>i?e:t||r||"")}function XKi(n){return n?n.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const GZ=new RegExp(`\\$\\(${In.iconNameCharacter}+\\)`,"g");function BN(n){GZ.lastIndex=0;let e="";const t=[];let i=0;for(;;){const r=GZ.lastIndex,o=GZ.exec(n),s=n.substring(r,o==null?void 0:o.index);if(s.length>0){e+=s;for(let a=0;a<s.length;a++)t.push(i)}if(!o)break;i+=o[0].length}return{text:e,iconOffsets:t}}function YZ(n,e,t=!1){const{text:i,iconOffsets:r}=e;if(!r||r.length===0)return sAe(n,i,t);const o=d5(i," "),s=i.length-o.length,a=sAe(n,o,t);if(a)for(const l of a){const c=r[l.start+s]+s;l.start+=c,l.end+=c}return a}class hc{constructor(e="",t=!1){var i,r,o;if(this.value=e,typeof this.value!="string")throw gg("value");typeof t=="boolean"?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=(i=t.isTrusted)!==null&&i!==void 0?i:void 0,this.supportThemeIcons=(r=t.supportThemeIcons)!==null&&r!==void 0?r:!1,this.supportHtml=(o=t.supportHtml)!==null&&o!==void 0?o:!1)}appendText(e,t=0){return this.value+=JKi(this.supportThemeIcons?KKi(e):e).replace(/([ \t]+)/g,(i,r)=>"&nbsp;".repeat(r.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\
`:`
`),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+=`
`,this.value+=t,this.value+="\n```\n",this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(hf(t),"g");return e.replace(i,(r,o)=>e.charAt(o-1)!=="\\"?`\\${r}`:r)}}function h2(n){return OC(n)?!n.value:Array.isArray(n)?n.every(h2):!0}function OC(n){return n instanceof hc?!0:n&&typeof n=="object"?typeof n.value=="string"&&(typeof n.isTrusted=="boolean"||typeof n.isTrusted=="object"||n.isTrusted===void 0)&&(typeof n.supportThemeIcons=="boolean"||n.supportThemeIcons===void 0):!1}function ZKi(n,e){return n===e?!0:!n||!e?!1:n.value===e.value&&n.isTrusted===e.isTrusted&&n.supportThemeIcons===e.supportThemeIcons&&n.supportHtml===e.supportHtml&&(n.baseUri===e.baseUri||!!n.baseUri&&!!e.baseUri&&C_e(Tn.from(n.baseUri),Tn.from(e.baseUri)))}function JKi(n){return n.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function ZB(n){return n.replace(/"/g,"&quot;")}function QZ(n){return n&&n.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function eGi(n){const e=[],t=n.split("|").map(r=>r.trim());n=t[0];const i=t[1];if(i){const r=/height=(\d+)/.exec(i),o=/width=(\d+)/.exec(i),s=r?r[1]:"",a=o?o[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(s));l&&e.push(`width="${a}"`),c&&e.push(`height="${s}"`)}return{href:n,dimensions:e}}var sae=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function tGi(n,e){Ku(e)?n.title=G_e(e):e!=null&&e.markdownNotSupportedFallback?n.title=e.markdownNotSupportedFallback:n.removeAttribute("title")}class nGi{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t,i){var r;return sae(this,void 0,void 0,function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(e===void 0||Ku(e)||e instanceof HTMLElement)o=e;else if(!_M(e.markdown))o=(r=e.markdown)!==null&&r!==void 0?r:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(E("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new da;const s=this._cancellationTokenSource.token;if(o=yield e.markdown(s),o===void 0&&(o=e.markdownNotSupportedFallback),this.isDisposed||s.isCancellationRequested)return}this.show(o,t,i)})}show(e,t,i){const r=this._hoverWidget;if(this.hasContent(e)){const o=Object.assign({content:e,target:this.target,showPointer:this.hoverDelegate.placement==="element",hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!r},i);this._hoverWidget=this.hoverDelegate.showHover(o,t)}r==null||r.dispose()}hasContent(e){return e?OC(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}function XKe(n,e,t,i){let r,o;const s=(d,h)=>{var g;const p=o!==void 0;d&&(o==null||o.dispose(),o=void 0),h&&(r==null||r.dispose(),r=void 0),p&&((g=n.onDidHideHover)===null||g===void 0||g.call(n))},a=(d,h,g)=>new nm(()=>sae(this,void 0,void 0,function*(){(!o||o.isDisposed)&&(o=new nGi(n,g||e,d>0),yield o.update(t,h,i))}),d),l=()=>{if(r)return;const d=new nt,h=m=>s(!1,m.fromElement===e);d.add(We(e,Lt.MOUSE_LEAVE,h,!0));const g=()=>s(!0,!0);d.add(We(e,Lt.MOUSE_DOWN,g,!0));const p={targetElements:[e],dispose:()=>{}};if(n.placement===void 0||n.placement==="mouse"){const m=_=>{p.x=_.x+10,_.target instanceof HTMLElement&&_.target.classList.contains("action-label")&&s(!0,!0)};d.add(We(e,Lt.MOUSE_MOVE,m,!0))}d.add(a(n.delay,!1,p)),r=d},c=We(e,Lt.MOUSE_OVER,l,!0);return{show:d=>{s(!1,!0),a(0,d)},hide:()=>{s(!0,!0)},update:(d,h)=>sae(this,void 0,void 0,function*(){t=d,yield o==null?void 0:o.update(t,void 0,h)}),dispose:()=>{c.dispose(),s(!0,!0)}}}function iGi(n,e={}){const t=Y_e(e);return t.textContent=n,t}function rGi(n,e={}){const t=Y_e(e);return ZKe(t,sGi(n,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function Y_e(n){const e=n.inline?"span":"div",t=document.createElement(e);return n.className&&(t.className=n.className),t}class oGi{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 ZKe(n,e,t,i){let r;if(e.type===2)r=document.createTextNode(e.content||"");else if(e.type===3)r=document.createElement("b");else if(e.type===4)r=document.createElement("i");else if(e.type===7&&i)r=document.createElement("code");else if(e.type===5&&t){const o=document.createElement("a");t.disposables.add(ua(o,"click",s=>{t.callback(String(e.index),s)})),r=o}else e.type===8?r=document.createElement("br"):e.type===1&&(r=n);r&&n!==r&&n.appendChild(r),r&&Array.isArray(e.children)&&e.children.forEach(o=>{ZKe(r,o,t,i)})}function sGi(n,e){const t={type:1,children:[]};let i=0,r=t;const o=[],s=new oGi(n);for(;!s.eos();){let a=s.next();const l=a==="\\"&&aae(s.peek(),e)!==0;if(l&&(a=s.next()),!l&&aGi(a,e)&&a===s.peek()){s.advance(),r.type===2&&(r=o.pop());const c=aae(a,e);if(r.type===c||r.type===5&&c===6)r=o.pop();else{const u={type:c,children:[]};c===5&&(u.index=i,i++),r.children.push(u),o.push(r),r=u}}else if(a===`
`)r.type===2&&(r=o.pop()),r.children.push({type:8});else if(r.type!==2){const c={type:2,content:a};r.children.push(c),o.push(r),r=c}else r.content+=a}return r.type===2&&(r=o.pop()),t}function aGi(n,e){return aae(n,e)!==0}function aae(n,e){switch(n){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const lGi=new RegExp(`(\\\\)?\\$\\((${In.iconNameExpression}(?:${In.iconModifierExpression})?)\\)`,"g");function PC(n){const e=new Array;let t,i=0,r=0;for(;(t=lGi.exec(n))!==null;){r=t.index||0,i<r&&e.push(n.substring(i,r)),i=(t.index||0)+t[0].length;const[,o,s]=t;e.push(o?`$(${s})`:lae({id:s}))}return i<n.length&&e.push(n.substring(i)),e}function lae(n){const e=at("span");return e.classList.add(...In.asClassNameArray(n)),e}class Q_e{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}}const cae=new Q_e("id#");let Ju={};(function(){function n(e,t){t(Ju)}n.amd=!0,function(e,t){typeof n=="function"&&n.amd?n(["exports"],t):typeof exports=="object"&&typeof module<"u"?t(exports):(e=typeof globalThis<"u"?globalThis:e||self,t(e.marked={}))}(this,function(e){function t(pe,me){for(var Z=0;Z<me.length;Z++){var G=me[Z];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(pe,G.key,G)}}function i(pe,me,Z){return me&&t(pe.prototype,me),Z&&t(pe,Z),Object.defineProperty(pe,"prototype",{writable:!1}),pe}function r(pe,me){if(pe){if(typeof pe=="string")return o(pe,me);var Z=Object.prototype.toString.call(pe).slice(8,-1);if(Z==="Object"&&pe.constructor&&(Z=pe.constructor.name),Z==="Map"||Z==="Set")return Array.from(pe);if(Z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Z))return o(pe,me)}}function o(pe,me){(me==null||me>pe.length)&&(me=pe.length);for(var Z=0,G=new Array(me);Z<me;Z++)G[Z]=pe[Z];return G}function s(pe,me){var Z=typeof Symbol<"u"&&pe[Symbol.iterator]||pe["@@iterator"];if(Z)return(Z=Z.call(pe)).next.bind(Z);if(Array.isArray(pe)||(Z=r(pe))||me&&pe&&typeof pe.length=="number"){Z&&(pe=Z);var G=0;return function(){return G>=pe.length?{done:!0}:{done:!1,value:pe[G++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a(){return{async:!1,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=a();function l(pe){e.defaults=pe}var c=/[&<>"']/,u=/[&<>"']/g,d=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,g={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},p=function(me){return g[me]};function m(pe,me){if(me){if(c.test(pe))return pe.replace(u,p)}else if(d.test(pe))return pe.replace(h,p);return pe}var _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function v(pe){return pe.replace(_,function(me,Z){return Z=Z.toLowerCase(),Z==="colon"?":":Z.charAt(0)==="#"?Z.charAt(1)==="x"?String.fromCharCode(parseInt(Z.substring(2),16)):String.fromCharCode(+Z.substring(1)):""})}var b=/(^|[^\[])\^/g;function y(pe,me){pe=typeof pe=="string"?pe:pe.source,me=me||"";var Z={replace:function(K,oe){return oe=oe.source||oe,oe=oe.replace(b,"$1"),pe=pe.replace(K,oe),Z},getRegex:function(){return new RegExp(pe,me)}};return Z}var C=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function k(pe,me,Z){if(pe){var G;try{G=decodeURIComponent(v(Z)).replace(C,"").toLowerCase()}catch{return null}if(G.indexOf("javascript:")===0||G.indexOf("vbscript:")===0||G.indexOf("data:")===0)return null}me&&!x.test(Z)&&(Z=P(me,Z));try{Z=encodeURI(Z).replace(/%25/g,"%")}catch{return null}return Z}var I={},L=/^[^:]+:\/*[^/]*$/,D=/^([^:]+:)[\s\S]*$/,R=/^([^:]+:\/*[^/]*)[\s\S]*$/;function P(pe,me){I[" "+pe]||(L.test(pe)?I[" "+pe]=pe+"/":I[" "+pe]=F(pe,"/",!0)),pe=I[" "+pe];var Z=pe.indexOf(":")===-1;return me.substring(0,2)==="//"?Z?me:pe.replace(D,"$1")+me:me.charAt(0)==="/"?Z?me:pe.replace(R,"$1")+me:pe+me}var M={exec:function(){}};function O(pe){for(var me=1,Z,G;me<arguments.length;me++){Z=arguments[me];for(G in Z)Object.prototype.hasOwnProperty.call(Z,G)&&(pe[G]=Z[G])}return pe}function B(pe,me){var Z=pe.replace(/\|/g,function(oe,le,we){for(var Me=!1,ft=le;--ft>=0&&we[ft]==="\\";)Me=!Me;return Me?"|":" |"}),G=Z.split(/ \|/),K=0;if(G[0].trim()||G.shift(),G.length>0&&!G[G.length-1].trim()&&G.pop(),G.length>me)G.splice(me);else for(;G.length<me;)G.push("");for(;K<G.length;K++)G[K]=G[K].trim().replace(/\\\|/g,"|");return G}function F(pe,me,Z){var G=pe.length;if(G===0)return"";for(var K=0;K<G;){var oe=pe.charAt(G-K-1);if(oe===me&&!Z)K++;else if(oe!==me&&Z)K++;else break}return pe.slice(0,G-K)}function H(pe,me){if(pe.indexOf(me[1])===-1)return-1;for(var Z=pe.length,G=0,K=0;K<Z;K++)if(pe[K]==="\\")K++;else if(pe[K]===me[0])G++;else if(pe[K]===me[1]&&(G--,G<0))return K;return-1}function V(pe){pe&&pe.sanitize&&!pe.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function $(pe,me){if(me<1)return"";for(var Z="";me>1;)me&1&&(Z+=pe),me>>=1,pe+=pe;return Z+pe}function j(pe,me,Z,G){var K=me.href,oe=me.title?m(me.title):null,le=pe[1].replace(/\\([\[\]])/g,"$1");if(pe[0].charAt(0)!=="!"){G.state.inLink=!0;var we={type:"link",raw:Z,href:K,title:oe,text:le,tokens:G.inlineTokens(le)};return G.state.inLink=!1,we}return{type:"image",raw:Z,href:K,title:oe,text:m(le)}}function Y(pe,me){var Z=pe.match(/^(\s+)(?:```)/);if(Z===null)return me;var G=Z[1];return me.split(`
`).map(function(K){var oe=K.match(/^\s+/);if(oe===null)return K;var le=oe[0];return le.length>=G.length?K.slice(G.length):K}).join(`
`)}var ne=function(){function pe(Z){this.options=Z||e.defaults}var me=pe.prototype;return me.space=function(G){var K=this.rules.block.newline.exec(G);if(K&&K[0].length>0)return{type:"space",raw:K[0]}},me.code=function(G){var K=this.rules.block.code.exec(G);if(K){var oe=K[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:K[0],codeBlockStyle:"indented",text:this.options.pedantic?oe:F(oe,`
`)}}},me.fences=function(G){var K=this.rules.block.fences.exec(G);if(K){var oe=K[0],le=Y(oe,K[3]||"");return{type:"code",raw:oe,lang:K[2]?K[2].trim():K[2],text:le}}},me.heading=function(G){var K=this.rules.block.heading.exec(G);if(K){var oe=K[2].trim();if(/#$/.test(oe)){var le=F(oe,"#");(this.options.pedantic||!le||/ $/.test(le))&&(oe=le.trim())}return{type:"heading",raw:K[0],depth:K[1].length,text:oe,tokens:this.lexer.inline(oe)}}},me.hr=function(G){var K=this.rules.block.hr.exec(G);if(K)return{type:"hr",raw:K[0]}},me.blockquote=function(G){var K=this.rules.block.blockquote.exec(G);if(K){var oe=K[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:K[0],tokens:this.lexer.blockTokens(oe,[]),text:oe}}},me.list=function(G){var K=this.rules.block.list.exec(G);if(K){var oe,le,we,Me,ft,Nt,Yt,He,Dt,ae,Se,Xe,wt=K[1].trim(),Tt=wt.length>1,zt={type:"list",raw:"",ordered:Tt,start:Tt?+wt.slice(0,-1):"",loose:!1,items:[]};wt=Tt?"\\d{1,9}\\"+wt.slice(-1):"\\"+wt,this.options.pedantic&&(wt=Tt?wt:"[*+-]");for(var Mt=new RegExp("^( {0,3}"+wt+")((?:[ ][^\\n]*)?(?:\\n|$))");G&&(Xe=!1,!(!(K=Mt.exec(G))||this.rules.block.hr.test(G)));){if(oe=K[0],G=G.substring(oe.length),He=K[2].split(`
`,1)[0],Dt=G.split(`
`,1)[0],this.options.pedantic?(Me=2,Se=He.trimLeft()):(Me=K[2].search(/[^ ]/),Me=Me>4?1:Me,Se=He.slice(Me),Me+=K[1].length),Nt=!1,!He&&/^ *$/.test(Dt)&&(oe+=Dt+`
`,G=G.substring(Dt.length+1),Xe=!0),!Xe)for(var On=new RegExp("^ {0,"+Math.min(3,Me-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),Ni=new RegExp("^ {0,"+Math.min(3,Me-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),xn=new RegExp("^ {0,"+Math.min(3,Me-1)+"}(?:```|~~~)"),un=new RegExp("^ {0,"+Math.min(3,Me-1)+"}#");G&&(ae=G.split(`
`,1)[0],He=ae,this.options.pedantic&&(He=He.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(xn.test(He)||un.test(He)||On.test(He)||Ni.test(G)));){if(He.search(/[^ ]/)>=Me||!He.trim())Se+=`
`+He.slice(Me);else if(!Nt)Se+=`
`+He;else break;!Nt&&!He.trim()&&(Nt=!0),oe+=ae+`
`,G=G.substring(ae.length+1)}zt.loose||(Yt?zt.loose=!0:/\n *\n *$/.test(oe)&&(Yt=!0)),this.options.gfm&&(le=/^\[[ xX]\] /.exec(Se),le&&(we=le[0]!=="[ ] ",Se=Se.replace(/^\[[ xX]\] +/,""))),zt.items.push({type:"list_item",raw:oe,task:!!le,checked:we,loose:!1,text:Se}),zt.raw+=oe}zt.items[zt.items.length-1].raw=oe.trimRight(),zt.items[zt.items.length-1].text=Se.trimRight(),zt.raw=zt.raw.trimRight();var ei=zt.items.length;for(ft=0;ft<ei;ft++){this.lexer.state.top=!1,zt.items[ft].tokens=this.lexer.blockTokens(zt.items[ft].text,[]);var li=zt.items[ft].tokens.filter(function(br){return br.type==="space"}),xi=li.every(function(br){for(var Wr=br.raw.split(""),ko=0,oo=s(Wr),ea;!(ea=oo()).done;){var xr=ea.value;if(xr===`
`&&(ko+=1),ko>1)return!0}return!1});!zt.loose&&li.length&&xi&&(zt.loose=!0,zt.items[ft].loose=!0)}return zt}},me.html=function(G){var K=this.rules.block.html.exec(G);if(K){var oe={type:"html",raw:K[0],pre:!this.options.sanitizer&&(K[1]==="pre"||K[1]==="script"||K[1]==="style"),text:K[0]};if(this.options.sanitize){var le=this.options.sanitizer?this.options.sanitizer(K[0]):m(K[0]);oe.type="paragraph",oe.text=le,oe.tokens=this.lexer.inline(le)}return oe}},me.def=function(G){var K=this.rules.block.def.exec(G);if(K){K[3]&&(K[3]=K[3].substring(1,K[3].length-1));var oe=K[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:oe,raw:K[0],href:K[2],title:K[3]}}},me.table=function(G){var K=this.rules.block.table.exec(G);if(K){var oe={type:"table",header:B(K[1]).map(function(Yt){return{text:Yt}}),align:K[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:K[3]&&K[3].trim()?K[3].replace(/\n[ \t]*$/,"").split(`
`):[]};if(oe.header.length===oe.align.length){oe.raw=K[0];var le=oe.align.length,we,Me,ft,Nt;for(we=0;we<le;we++)/^ *-+: *$/.test(oe.align[we])?oe.align[we]="right":/^ *:-+: *$/.test(oe.align[we])?oe.align[we]="center":/^ *:-+ *$/.test(oe.align[we])?oe.align[we]="left":oe.align[we]=null;for(le=oe.rows.length,we=0;we<le;we++)oe.rows[we]=B(oe.rows[we],oe.header.length).map(function(Yt){return{text:Yt}});for(le=oe.header.length,Me=0;Me<le;Me++)oe.header[Me].tokens=this.lexer.inline(oe.header[Me].text);for(le=oe.rows.length,Me=0;Me<le;Me++)for(Nt=oe.rows[Me],ft=0;ft<Nt.length;ft++)Nt[ft].tokens=this.lexer.inline(Nt[ft].text);return oe}}},me.lheading=function(G){var K=this.rules.block.lheading.exec(G);if(K)return{type:"heading",raw:K[0],depth:K[2].charAt(0)==="="?1:2,text:K[1],tokens:this.lexer.inline(K[1])}},me.paragraph=function(G){var K=this.rules.block.paragraph.exec(G);if(K){var oe=K[1].charAt(K[1].length-1)===`
`?K[1].slice(0,-1):K[1];return{type:"paragraph",raw:K[0],text:oe,tokens:this.lexer.inline(oe)}}},me.text=function(G){var K=this.rules.block.text.exec(G);if(K)return{type:"text",raw:K[0],text:K[0],tokens:this.lexer.inline(K[0])}},me.escape=function(G){var K=this.rules.inline.escape.exec(G);if(K)return{type:"escape",raw:K[0],text:m(K[1])}},me.tag=function(G){var K=this.rules.inline.tag.exec(G);if(K)return!this.lexer.state.inLink&&/^<a /i.test(K[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(K[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(K[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(K[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:K[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(K[0]):m(K[0]):K[0]}},me.link=function(G){var K=this.rules.inline.link.exec(G);if(K){var oe=K[2].trim();if(!this.options.pedantic&&/^</.test(oe)){if(!/>$/.test(oe))return;var le=F(oe.slice(0,-1),"\\");if((oe.length-le.length)%2===0)return}else{var we=H(K[2],"()");if(we>-1){var Me=K[0].indexOf("!")===0?5:4,ft=Me+K[1].length+we;K[2]=K[2].substring(0,we),K[0]=K[0].substring(0,ft).trim(),K[3]=""}}var Nt=K[2],Yt="";if(this.options.pedantic){var He=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Nt);He&&(Nt=He[1],Yt=He[3])}else Yt=K[3]?K[3].slice(1,-1):"";return Nt=Nt.trim(),/^</.test(Nt)&&(this.options.pedantic&&!/>$/.test(oe)?Nt=Nt.slice(1):Nt=Nt.slice(1,-1)),j(K,{href:Nt&&Nt.replace(this.rules.inline._escapes,"$1"),title:Yt&&Yt.replace(this.rules.inline._escapes,"$1")},K[0],this.lexer)}},me.reflink=function(G,K){var oe;if((oe=this.rules.inline.reflink.exec(G))||(oe=this.rules.inline.nolink.exec(G))){var le=(oe[2]||oe[1]).replace(/\s+/g," ");if(le=K[le.toLowerCase()],!le||!le.href){var we=oe[0].charAt(0);return{type:"text",raw:we,text:we}}return j(oe,le,oe[0],this.lexer)}},me.emStrong=function(G,K,oe){oe===void 0&&(oe="");var le=this.rules.inline.emStrong.lDelim.exec(G);if(le&&!(le[3]&&oe.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 we=le[1]||le[2]||"";if(!we||we&&(oe===""||this.rules.inline.punctuation.exec(oe))){var Me=le[0].length-1,ft,Nt,Yt=Me,He=0,Dt=le[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Dt.lastIndex=0,K=K.slice(-1*G.length+Me);(le=Dt.exec(K))!=null;)if(ft=le[1]||le[2]||le[3]||le[4]||le[5]||le[6],!!ft){if(Nt=ft.length,le[3]||le[4]){Yt+=Nt;continue}else if((le[5]||le[6])&&Me%3&&!((Me+Nt)%3)){He+=Nt;continue}if(Yt-=Nt,!(Yt>0)){if(Nt=Math.min(Nt,Nt+Yt+He),Math.min(Me,Nt)%2){var ae=G.slice(1,Me+le.index+Nt);return{type:"em",raw:G.slice(0,Me+le.index+Nt+1),text:ae,tokens:this.lexer.inlineTokens(ae)}}var Se=G.slice(2,Me+le.index+Nt-1);return{type:"strong",raw:G.slice(0,Me+le.index+Nt+1),text:Se,tokens:this.lexer.inlineTokens(Se)}}}}}},me.codespan=function(G){var K=this.rules.inline.code.exec(G);if(K){var oe=K[2].replace(/\n/g," "),le=/[^ ]/.test(oe),we=/^ /.test(oe)&&/ $/.test(oe);return le&&we&&(oe=oe.substring(1,oe.length-1)),oe=m(oe,!0),{type:"codespan",raw:K[0],text:oe}}},me.br=function(G){var K=this.rules.inline.br.exec(G);if(K)return{type:"br",raw:K[0]}},me.del=function(G){var K=this.rules.inline.del.exec(G);if(K)return{type:"del",raw:K[0],text:K[2],tokens:this.lexer.inlineTokens(K[2])}},me.autolink=function(G,K){var oe=this.rules.inline.autolink.exec(G);if(oe){var le,we;return oe[2]==="@"?(le=m(this.options.mangle?K(oe[1]):oe[1]),we="mailto:"+le):(le=m(oe[1]),we=le),{type:"link",raw:oe[0],text:le,href:we,tokens:[{type:"text",raw:le,text:le}]}}},me.url=function(G,K){var oe;if(oe=this.rules.inline.url.exec(G)){var le,we;if(oe[2]==="@")le=m(this.options.mangle?K(oe[0]):oe[0]),we="mailto:"+le;else{var Me;do Me=oe[0],oe[0]=this.rules.inline._backpedal.exec(oe[0])[0];while(Me!==oe[0]);le=m(oe[0]),oe[1]==="www."?we="http://"+le:we=le}return{type:"link",raw:oe[0],text:le,href:we,tokens:[{type:"text",raw:le,text:le}]}}},me.inlineText=function(G,K){var oe=this.rules.inline.text.exec(G);if(oe){var le;return this.lexer.state.inRawBlock?le=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):m(oe[0]):oe[0]:le=m(this.options.smartypants?K(oe[0]):oe[0]),{type:"text",raw:oe[0],text:le}}},pe}(),se={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}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\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:M,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};se._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,se._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,se.def=y(se.def).replace("label",se._label).replace("title",se._title).getRegex(),se.bullet=/(?:[*+-]|\d{1,9}[.)])/,se.listItemStart=y(/^( *)(bull) */).replace("bull",se.bullet).getRegex(),se.list=y(se.list).replace(/bull/g,se.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+se.def.source+")").getRegex(),se._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",se._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,se.html=y(se.html,"i").replace("comment",se._comment).replace("tag",se._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),se.paragraph=y(se._paragraph).replace("hr",se.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",se._tag).getRegex(),se.blockquote=y(se.blockquote).replace("paragraph",se.paragraph).getRegex(),se.normal=O({},se),se.gfm=O({},se.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),se.gfm.table=y(se.gfm.table).replace("hr",se.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",se._tag).getRegex(),se.gfm.paragraph=y(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",se.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",se._tag).getRegex(),se.pedantic=O({},se.normal,{html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",se._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:M,paragraph:y(se.normal._paragraph).replace("hr",se.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",se.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var he={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:M,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:M,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};he._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",he.punctuation=y(he.punctuation).replace(/punctuation/g,he._punctuation).getRegex(),he.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,he.escapedEmSt=/\\\*|\\_/g,he._comment=y(se._comment).replace("(?:-->|$)","-->").getRegex(),he.emStrong.lDelim=y(he.emStrong.lDelim).replace(/punct/g,he._punctuation).getRegex(),he.emStrong.rDelimAst=y(he.emStrong.rDelimAst,"g").replace(/punct/g,he._punctuation).getRegex(),he.emStrong.rDelimUnd=y(he.emStrong.rDelimUnd,"g").replace(/punct/g,he._punctuation).getRegex(),he._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,he._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,he._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])?)+(?![-_])/,he.autolink=y(he.autolink).replace("scheme",he._scheme).replace("email",he._email).getRegex(),he._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,he.tag=y(he.tag).replace("comment",he._comment).replace("attribute",he._attribute).getRegex(),he._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,he._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,he._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,he.link=y(he.link).replace("label",he._label).replace("href",he._href).replace("title",he._title).getRegex(),he.reflink=y(he.reflink).replace("label",he._label).replace("ref",se._label).getRegex(),he.nolink=y(he.nolink).replace("ref",se._label).getRegex(),he.reflinkSearch=y(he.reflinkSearch,"g").replace("reflink",he.reflink).replace("nolink",he.nolink).getRegex(),he.normal=O({},he),he.pedantic=O({},he.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:y(/^!?\[(label)\]\((.*?)\)/).replace("label",he._label).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",he._label).getRegex()}),he.gfm=O({},he.normal,{escape:y(he.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.!#$%&'*+\/=?_`{\|}~-]+@)))/}),he.gfm.url=y(he.gfm.url,"i").replace("email",he.gfm._extended_email).getRegex(),he.breaks=O({},he.gfm,{br:y(he.br).replace("{2,}","*").getRegex(),text:y(he.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});function xe(pe){return pe.replace(/---/g,"—").replace(/--/g,"").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1").replace(/'/g,"").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function _e(pe){var me="",Z,G,K=pe.length;for(Z=0;Z<K;Z++)G=pe.charCodeAt(Z),Math.random()>.5&&(G="x"+G.toString(16)),me+="&#"+G+";";return me}var Ie=function(){function pe(Z){this.tokens=[],this.tokens.links=Object.create(null),this.options=Z||e.defaults,this.options.tokenizer=this.options.tokenizer||new ne,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 G={block:se.normal,inline:he.normal};this.options.pedantic?(G.block=se.pedantic,G.inline=he.pedantic):this.options.gfm&&(G.block=se.gfm,this.options.breaks?G.inline=he.breaks:G.inline=he.gfm),this.tokenizer.rules=G}pe.lex=function(G,K){var oe=new pe(K);return oe.lex(G)},pe.lexInline=function(G,K){var oe=new pe(K);return oe.inlineTokens(G)};var me=pe.prototype;return me.lex=function(G){G=G.replace(/\r\n|\r/g,`
`),this.blockTokens(G,this.tokens);for(var K;K=this.inlineQueue.shift();)this.inlineTokens(K.src,K.tokens);return this.tokens},me.blockTokens=function(G,K){var oe=this;K===void 0&&(K=[]),this.options.pedantic?G=G.replace(/\t/g," ").replace(/^ +$/gm,""):G=G.replace(/^( *)(\t+)/gm,function(Yt,He,Dt){return He+" ".repeat(Dt.length)});for(var le,we,Me,ft;G;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(Yt){return(le=Yt.call({lexer:oe},G,K))?(G=G.substring(le.raw.length),K.push(le),!0):!1}))){if(le=this.tokenizer.space(G)){G=G.substring(le.raw.length),le.raw.length===1&&K.length>0?K[K.length-1].raw+=`
`:K.push(le);continue}if(le=this.tokenizer.code(G)){G=G.substring(le.raw.length),we=K[K.length-1],we&&(we.type==="paragraph"||we.type==="text")?(we.raw+=`
`+le.raw,we.text+=`
`+le.text,this.inlineQueue[this.inlineQueue.length-1].src=we.text):K.push(le);continue}if(le=this.tokenizer.fences(G)){G=G.substring(le.raw.length),K.push(le);continue}if(le=this.tokenizer.heading(G)){G=G.substring(le.raw.length),K.push(le);continue}if(le=this.tokenizer.hr(G)){G=G.substring(le.raw.length),K.push(le);continue}if(le=this.tokenizer.blockquote(G)){G=G.substring(le.raw.length),K.push(le);continue}if(le=this.tokenizer.list(G)){G=G.substring(le.raw.length),K.push(le);continue}if(le=this.tokenizer.html(G)){G=G.substring(le.raw.length),K.push(le);continue}if(le=this.tokenizer.def(G)){G=G.substring(le.raw.length),we=K[K.length-1],we&&(we.type==="paragraph"||we.type==="text")?(we.raw+=`
`+le.raw,we.text+=`
`+le.raw,this.inlineQueue[this.inlineQueue.length-1].src=we.text):this.tokens.links[le.tag]||(this.tokens.links[le.tag]={href:le.href,title:le.title});continue}if(le=this.tokenizer.table(G)){G=G.substring(le.raw.length),K.push(le);continue}if(le=this.tokenizer.lheading(G)){G=G.substring(le.raw.length),K.push(le);continue}if(Me=G,this.options.extensions&&this.options.extensions.startBlock&&function(){var Yt=1/0,He=G.slice(1),Dt=void 0;oe.options.extensions.startBlock.forEach(function(ae){Dt=ae.call({lexer:this},He),typeof Dt=="number"&&Dt>=0&&(Yt=Math.min(Yt,Dt))}),Yt<1/0&&Yt>=0&&(Me=G.substring(0,Yt+1))}(),this.state.top&&(le=this.tokenizer.paragraph(Me))){we=K[K.length-1],ft&&we.type==="paragraph"?(we.raw+=`
`+le.raw,we.text+=`
`+le.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=we.text):K.push(le),ft=Me.length!==G.length,G=G.substring(le.raw.length);continue}if(le=this.tokenizer.text(G)){G=G.substring(le.raw.length),we=K[K.length-1],we&&we.type==="text"?(we.raw+=`
`+le.raw,we.text+=`
`+le.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=we.text):K.push(le);continue}if(G){var Nt="Infinite loop on byte: "+G.charCodeAt(0);if(this.options.silent){console.error(Nt);break}else throw new Error(Nt)}}return this.state.top=!0,K},me.inline=function(G,K){return K===void 0&&(K=[]),this.inlineQueue.push({src:G,tokens:K}),K},me.inlineTokens=function(G,K){var oe=this;K===void 0&&(K=[]);var le,we,Me,ft=G,Nt,Yt,He;if(this.tokens.links){var Dt=Object.keys(this.tokens.links);if(Dt.length>0)for(;(Nt=this.tokenizer.rules.inline.reflinkSearch.exec(ft))!=null;)Dt.includes(Nt[0].slice(Nt[0].lastIndexOf("[")+1,-1))&&(ft=ft.slice(0,Nt.index)+"["+$("a",Nt[0].length-2)+"]"+ft.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Nt=this.tokenizer.rules.inline.blockSkip.exec(ft))!=null;)ft=ft.slice(0,Nt.index)+"["+$("a",Nt[0].length-2)+"]"+ft.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(Nt=this.tokenizer.rules.inline.escapedEmSt.exec(ft))!=null;)ft=ft.slice(0,Nt.index)+"++"+ft.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;G;)if(Yt||(He=""),Yt=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Se){return(le=Se.call({lexer:oe},G,K))?(G=G.substring(le.raw.length),K.push(le),!0):!1}))){if(le=this.tokenizer.escape(G)){G=G.substring(le.raw.length),K.push(le);continue}if(le=this.tokenizer.tag(G)){G=G.substring(le.raw.length),we=K[K.length-1],we&&le.type==="text"&&we.type==="text"?(we.raw+=le.raw,we.text+=le.text):K.push(le);continue}if(le=this.tokenizer.link(G)){G=G.substring(le.raw.length),K.push(le);continue}if(le=this.tokenizer.reflink(G,this.tokens.links)){G=G.substring(le.raw.length),we=K[K.length-1],we&&le.type==="text"&&we.type==="text"?(we.raw+=le.raw,we.text+=le.text):K.push(le);continue}if(le=this.tokenizer.emStrong(G,ft,He)){G=G.substring(le.raw.length),K.push(le);continue}if(le=this.tokenizer.codespan(G)){G=G.substring(le.raw.length),K.push(le);continue}if(le=this.tokenizer.br(G)){G=G.substring(le.raw.length),K.push(le);continue}if(le=this.tokenizer.del(G)){G=G.substring(le.raw.length),K.push(le);continue}if(le=this.tokenizer.autolink(G,_e)){G=G.substring(le.raw.length),K.push(le);continue}if(!this.state.inLink&&(le=this.tokenizer.url(G,_e))){G=G.substring(le.raw.length),K.push(le);continue}if(Me=G,this.options.extensions&&this.options.extensions.startInline&&function(){var Se=1/0,Xe=G.slice(1),wt=void 0;oe.options.extensions.startInline.forEach(function(Tt){wt=Tt.call({lexer:this},Xe),typeof wt=="number"&&wt>=0&&(Se=Math.min(Se,wt))}),Se<1/0&&Se>=0&&(Me=G.substring(0,Se+1))}(),le=this.tokenizer.inlineText(Me,xe)){G=G.substring(le.raw.length),le.raw.slice(-1)!=="_"&&(He=le.raw.slice(-1)),Yt=!0,we=K[K.length-1],we&&we.type==="text"?(we.raw+=le.raw,we.text+=le.text):K.push(le);continue}if(G){var ae="Infinite loop on byte: "+G.charCodeAt(0);if(this.options.silent){console.error(ae);break}else throw new Error(ae)}}return K},i(pe,null,[{key:"rules",get:function(){return{block:se,inline:he}}}]),pe}(),Re=function(){function pe(Z){this.options=Z||e.defaults}var me=pe.prototype;return me.code=function(G,K,oe){var le=(K||"").match(/\S*/)[0];if(this.options.highlight){var we=this.options.highlight(G,le);we!=null&&we!==G&&(oe=!0,G=we)}return G=G.replace(/\n$/,"")+`
`,le?'<pre><code class="'+this.options.langPrefix+m(le,!0)+'">'+(oe?G:m(G,!0))+`</code></pre>
`:"<pre><code>"+(oe?G:m(G,!0))+`</code></pre>
`},me.blockquote=function(G){return`<blockquote>
`+G+`</blockquote>
`},me.html=function(G){return G},me.heading=function(G,K,oe,le){if(this.options.headerIds){var we=this.options.headerPrefix+le.slug(oe);return"<h"+K+' id="'+we+'">'+G+"</h"+K+`>
`}return"<h"+K+">"+G+"</h"+K+`>
`},me.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},me.list=function(G,K,oe){var le=K?"ol":"ul",we=K&&oe!==1?' start="'+oe+'"':"";return"<"+le+we+`>
`+G+"</"+le+`>
`},me.listitem=function(G){return"<li>"+G+`</li>
`},me.checkbox=function(G){return"<input "+(G?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},me.paragraph=function(G){return"<p>"+G+`</p>
`},me.table=function(G,K){return K&&(K="<tbody>"+K+"</tbody>"),`<table>
<thead>
`+G+`</thead>
`+K+`</table>
`},me.tablerow=function(G){return`<tr>
`+G+`</tr>
`},me.tablecell=function(G,K){var oe=K.header?"th":"td",le=K.align?"<"+oe+' align="'+K.align+'">':"<"+oe+">";return le+G+("</"+oe+`>
`)},me.strong=function(G){return"<strong>"+G+"</strong>"},me.em=function(G){return"<em>"+G+"</em>"},me.codespan=function(G){return"<code>"+G+"</code>"},me.br=function(){return this.options.xhtml?"<br/>":"<br>"},me.del=function(G){return"<del>"+G+"</del>"},me.link=function(G,K,oe){if(G=k(this.options.sanitize,this.options.baseUrl,G),G===null)return oe;var le='<a href="'+m(G)+'"';return K&&(le+=' title="'+K+'"'),le+=">"+oe+"</a>",le},me.image=function(G,K,oe){if(G=k(this.options.sanitize,this.options.baseUrl,G),G===null)return oe;var le='<img src="'+G+'" alt="'+oe+'"';return K&&(le+=' title="'+K+'"'),le+=this.options.xhtml?"/>":">",le},me.text=function(G){return G},pe}(),Ye=function(){function pe(){}var me=pe.prototype;return me.strong=function(G){return G},me.em=function(G){return G},me.codespan=function(G){return G},me.del=function(G){return G},me.html=function(G){return G},me.text=function(G){return G},me.link=function(G,K,oe){return""+oe},me.image=function(G,K,oe){return""+oe},me.br=function(){return""},pe}(),Ze=function(){function pe(){this.seen={}}var me=pe.prototype;return me.serialize=function(G){return G.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},me.getNextSafeSlug=function(G,K){var oe=G,le=0;if(this.seen.hasOwnProperty(oe)){le=this.seen[G];do le++,oe=G+"-"+le;while(this.seen.hasOwnProperty(oe))}return K||(this.seen[G]=le,this.seen[oe]=0),oe},me.slug=function(G,K){K===void 0&&(K={});var oe=this.serialize(G);return this.getNextSafeSlug(oe,K.dryrun)},pe}(),tt=function(){function pe(Z){this.options=Z||e.defaults,this.options.renderer=this.options.renderer||new Re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ye,this.slugger=new Ze}pe.parse=function(G,K){var oe=new pe(K);return oe.parse(G)},pe.parseInline=function(G,K){var oe=new pe(K);return oe.parseInline(G)};var me=pe.prototype;return me.parse=function(G,K){K===void 0&&(K=!0);var oe="",le,we,Me,ft,Nt,Yt,He,Dt,ae,Se,Xe,wt,Tt,zt,Mt,On,Ni,xn,un,ei=G.length;for(le=0;le<ei;le++){if(Se=G[le],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[Se.type]&&(un=this.options.extensions.renderers[Se.type].call({parser:this},Se),un!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(Se.type))){oe+=un||"";continue}switch(Se.type){case"space":continue;case"hr":{oe+=this.renderer.hr();continue}case"heading":{oe+=this.renderer.heading(this.parseInline(Se.tokens),Se.depth,v(this.parseInline(Se.tokens,this.textRenderer)),this.slugger);continue}case"code":{oe+=this.renderer.code(Se.text,Se.lang,Se.escaped);continue}case"table":{for(Dt="",He="",ft=Se.header.length,we=0;we<ft;we++)He+=this.renderer.tablecell(this.parseInline(Se.header[we].tokens),{header:!0,align:Se.align[we]});for(Dt+=this.renderer.tablerow(He),ae="",ft=Se.rows.length,we=0;we<ft;we++){for(Yt=Se.rows[we],He="",Nt=Yt.length,Me=0;Me<Nt;Me++)He+=this.renderer.tablecell(this.parseInline(Yt[Me].tokens),{header:!1,align:Se.align[Me]});ae+=this.renderer.tablerow(He)}oe+=this.renderer.table(Dt,ae);continue}case"blockquote":{ae=this.parse(Se.tokens),oe+=this.renderer.blockquote(ae);continue}case"list":{for(Xe=Se.ordered,wt=Se.start,Tt=Se.loose,ft=Se.items.length,ae="",we=0;we<ft;we++)Mt=Se.items[we],On=Mt.checked,Ni=Mt.task,zt="",Mt.task&&(xn=this.renderer.checkbox(On),Tt?Mt.tokens.length>0&&Mt.tokens[0].type==="paragraph"?(Mt.tokens[0].text=xn+" "+Mt.tokens[0].text,Mt.tokens[0].tokens&&Mt.tokens[0].tokens.length>0&&Mt.tokens[0].tokens[0].type==="text"&&(Mt.tokens[0].tokens[0].text=xn+" "+Mt.tokens[0].tokens[0].text)):Mt.tokens.unshift({type:"text",text:xn}):zt+=xn),zt+=this.parse(Mt.tokens,Tt),ae+=this.renderer.listitem(zt,Ni,On);oe+=this.renderer.list(ae,Xe,wt);continue}case"html":{oe+=this.renderer.html(Se.text);continue}case"paragraph":{oe+=this.renderer.paragraph(this.parseInline(Se.tokens));continue}case"text":{for(ae=Se.tokens?this.parseInline(Se.tokens):Se.text;le+1<ei&&G[le+1].type==="text";)Se=G[++le],ae+=`
`+(Se.tokens?this.parseInline(Se.tokens):Se.text);oe+=K?this.renderer.paragraph(ae):ae;continue}default:{var li='Token with "'+Se.type+'" type was not found.';if(this.options.silent){console.error(li);return}else throw new Error(li)}}}return oe},me.parseInline=function(G,K){K=K||this.renderer;var oe="",le,we,Me,ft=G.length;for(le=0;le<ft;le++){if(we=G[le],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[we.type]&&(Me=this.options.extensions.renderers[we.type].call({parser:this},we),Me!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(we.type))){oe+=Me||"";continue}switch(we.type){case"escape":{oe+=K.text(we.text);break}case"html":{oe+=K.html(we.text);break}case"link":{oe+=K.link(we.href,we.title,this.parseInline(we.tokens,K));break}case"image":{oe+=K.image(we.href,we.title,we.text);break}case"strong":{oe+=K.strong(this.parseInline(we.tokens,K));break}case"em":{oe+=K.em(this.parseInline(we.tokens,K));break}case"codespan":{oe+=K.codespan(we.text);break}case"br":{oe+=K.br();break}case"del":{oe+=K.del(this.parseInline(we.tokens,K));break}case"text":{oe+=K.text(we.text);break}default:{var Nt='Token with "'+we.type+'" type was not found.';if(this.options.silent){console.error(Nt);return}else throw new Error(Nt)}}}return oe},pe}();function Be(pe,me,Z){if(typeof pe>"u"||pe===null)throw new Error("marked(): input parameter is undefined or null");if(typeof pe!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(pe)+", string expected");if(typeof me=="function"&&(Z=me,me=null),me=O({},Be.defaults,me||{}),V(me),Z){var G=me.highlight,K;try{K=Ie.lex(pe,me)}catch(ft){return Z(ft)}var oe=function(Nt){var Yt;if(!Nt)try{me.walkTokens&&Be.walkTokens(K,me.walkTokens),Yt=tt.parse(K,me)}catch(He){Nt=He}return me.highlight=G,Nt?Z(Nt):Z(null,Yt)};if(!G||G.length<3||(delete me.highlight,!K.length))return oe();var le=0;Be.walkTokens(K,function(ft){ft.type==="code"&&(le++,setTimeout(function(){G(ft.text,ft.lang,function(Nt,Yt){if(Nt)return oe(Nt);Yt!=null&&Yt!==ft.text&&(ft.text=Yt,ft.escaped=!0),le--,le===0&&oe()})},0))}),le===0&&oe();return}function we(ft){if(ft.message+=`
Please report this to https://github.com/markedjs/marked.`,me.silent)return"<p>An error occurred:</p><pre>"+m(ft.message+"",!0)+"</pre>";throw ft}try{var Me=Ie.lex(pe,me);if(me.walkTokens){if(me.async)return Promise.all(Be.walkTokens(Me,me.walkTokens)).then(function(){return tt.parse(Me,me)}).catch(we);Be.walkTokens(Me,me.walkTokens)}return tt.parse(Me,me)}catch(ft){we(ft)}}Be.options=Be.setOptions=function(pe){return O(Be.defaults,pe),l(Be.defaults),Be},Be.getDefaults=a,Be.defaults=e.defaults,Be.use=function(){for(var pe=arguments.length,me=new Array(pe),Z=0;Z<pe;Z++)me[Z]=arguments[Z];var G=O.apply(void 0,[{}].concat(me)),K=Be.defaults.extensions||{renderers:{},childTokens:{}},oe;me.forEach(function(le){if(le.extensions&&(oe=!0,le.extensions.forEach(function(Me){if(!Me.name)throw new Error("extension name required");if(Me.renderer){var ft=K.renderers?K.renderers[Me.name]:null;ft?K.renderers[Me.name]=function(){for(var Nt=arguments.length,Yt=new Array(Nt),He=0;He<Nt;He++)Yt[He]=arguments[He];var Dt=Me.renderer.apply(this,Yt);return Dt===!1&&(Dt=ft.apply(this,Yt)),Dt}:K.renderers[Me.name]=Me.renderer}if(Me.tokenizer){if(!Me.level||Me.level!=="block"&&Me.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");K[Me.level]?K[Me.level].unshift(Me.tokenizer):K[Me.level]=[Me.tokenizer],Me.start&&(Me.level==="block"?K.startBlock?K.startBlock.push(Me.start):K.startBlock=[Me.start]:Me.level==="inline"&&(K.startInline?K.startInline.push(Me.start):K.startInline=[Me.start]))}Me.childTokens&&(K.childTokens[Me.name]=Me.childTokens)})),le.renderer&&function(){var Me=Be.defaults.renderer||new Re,ft=function(He){var Dt=Me[He];Me[He]=function(){for(var ae=arguments.length,Se=new Array(ae),Xe=0;Xe<ae;Xe++)Se[Xe]=arguments[Xe];var wt=le.renderer[He].apply(Me,Se);return wt===!1&&(wt=Dt.apply(Me,Se)),wt}};for(var Nt in le.renderer)ft(Nt);G.renderer=Me}(),le.tokenizer&&function(){var Me=Be.defaults.tokenizer||new ne,ft=function(He){var Dt=Me[He];Me[He]=function(){for(var ae=arguments.length,Se=new Array(ae),Xe=0;Xe<ae;Xe++)Se[Xe]=arguments[Xe];var wt=le.tokenizer[He].apply(Me,Se);return wt===!1&&(wt=Dt.apply(Me,Se)),wt}};for(var Nt in le.tokenizer)ft(Nt);G.tokenizer=Me}(),le.walkTokens){var we=Be.defaults.walkTokens;G.walkTokens=function(Me){var ft=[];return ft.push(le.walkTokens.call(this,Me)),we&&(ft=ft.concat(we.call(this,Me))),ft}}oe&&(G.extensions=K),Be.setOptions(G)})},Be.walkTokens=function(pe,me){for(var Z=[],G=function(){var we=oe.value;switch(Z=Z.concat(me.call(Be,we)),we.type){case"table":{for(var Me=s(we.header),ft;!(ft=Me()).done;){var Nt=ft.value;Z=Z.concat(Be.walkTokens(Nt.tokens,me))}for(var Yt=s(we.rows),He;!(He=Yt()).done;)for(var Dt=He.value,ae=s(Dt),Se;!(Se=ae()).done;){var Xe=Se.value;Z=Z.concat(Be.walkTokens(Xe.tokens,me))}break}case"list":{Z=Z.concat(Be.walkTokens(we.items,me));break}default:Be.defaults.extensions&&Be.defaults.extensions.childTokens&&Be.defaults.extensions.childTokens[we.type]?Be.defaults.extensions.childTokens[we.type].forEach(function(wt){Z=Z.concat(Be.walkTokens(we[wt],me))}):we.tokens&&(Z=Z.concat(Be.walkTokens(we.tokens,me)))}},K=s(pe),oe;!(oe=K()).done;)G();return Z},Be.parseInline=function(pe,me){if(typeof pe>"u"||pe===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof pe!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(pe)+", string expected");me=O({},Be.defaults,me||{}),V(me);try{var Z=Ie.lexInline(pe,me);return me.walkTokens&&Be.walkTokens(Z,me.walkTokens),tt.parseInline(Z,me)}catch(G){if(G.message+=`
Please report this to https://github.com/markedjs/marked.`,me.silent)return"<p>An error occurred:</p><pre>"+m(G.message+"",!0)+"</pre>";throw G}},Be.Parser=tt,Be.parser=tt.parse,Be.Renderer=Re,Be.TextRenderer=Ye,Be.Lexer=Ie,Be.lexer=Ie.lex,Be.Tokenizer=ne,Be.Slugger=Ze,Be.parse=Be;var kt=Be.options,Vt=Be.setOptions,xt=Be.use,Kt=Be.walkTokens,cn=Be.parseInline,wn=Be,on=tt.parse,Zt=Ie.lex;e.Lexer=Ie,e.Parser=tt,e.Renderer=Re,e.Slugger=Ze,e.TextRenderer=Ye,e.Tokenizer=ne,e.getDefaults=a,e.lexer=Zt,e.marked=Be,e.options=kt,e.parse=wn,e.parseInline=cn,e.parser=on,e.setOptions=Vt,e.use=xt,e.walkTokens=Kt,Object.defineProperty(e,"__esModule",{value:!0})})})();Ju.Lexer||exports.Lexer;Ju.Parser||exports.Parser;Ju.Renderer||exports.Renderer;Ju.Slugger||exports.Slugger;Ju.TextRenderer||exports.TextRenderer;Ju.Tokenizer||exports.Tokenizer;Ju.getDefaults||exports.getDefaults;Ju.lexer||exports.lexer;var Ev=Ju.marked||exports.marked;Ju.options||exports.options;Ju.parse||exports.parse;Ju.parseInline||exports.parseInline;Ju.parser||exports.parser;Ju.setOptions||exports.setOptions;Ju.use||exports.use;Ju.walkTokens||exports.walkTokens;function cGi(n){return JSON.stringify(n,uGi)}function uae(n){let e=JSON.parse(n);return e=dae(e),e}function uGi(n,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function dae(n,e=0){if(!n||e>200)return n;if(typeof n=="object"){switch(n.$mid){case 1:return Tn.revive(n);case 2:return new RegExp(n.source,n.flags);case 17:return new Date(n.source)}if(n instanceof GU||n instanceof Uint8Array)return n;if(Array.isArray(n))for(let t=0;t<n.length;++t)n[t]=dae(n[t],e+1);else for(const t in n)Object.hasOwnProperty.call(n,t)&&(n[t]=dae(n[t],e+1))}return n}const XZ=Object.freeze({image:(n,e,t)=>{let i=[],r=[];return n&&({href:n,dimensions:i}=eGi(n),r.push(`src="${ZB(n)}"`)),t&&r.push(`alt="${ZB(t)}"`),e&&r.push(`title="${ZB(e)}"`),i.length&&(r=r.concat(i)),"<img "+r.join(" ")+">"},paragraph:n=>`<p>${n}</p>`,link:(n,e,t)=>typeof n!="string"?"":(n===t&&(t=QZ(t)),e=typeof e=="string"?ZB(QZ(e)):"",n=QZ(n),n=n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),`<a href="${n}" title="${e||n}">${t}</a>`)});function wq(n,e={},t={}){var i,r;const o=new nt;let s=!1;const a=Y_e(e),l=function(v){let b;try{b=uae(decodeURIComponent(v))}catch{}return b?(b=Sje(b,y=>{if(n.uris&&n.uris[y])return Tn.revive(n.uris[y])}),encodeURIComponent(JSON.stringify(b))):v},c=function(v,b){const y=n.uris&&n.uris[v];let C=Tn.revive(y);return b?v.startsWith(Si.data+":")?v:(C||(C=Tn.parse(v)),CUe.uriToBrowserUri(C).toString(!0)):!C||Tn.parse(v).toString()===C.toString()?v:(C.query&&(C=C.with({query:l(C.query)})),C.toString())},u=new Ev.Renderer;u.image=XZ.image,u.link=XZ.link,u.paragraph=XZ.paragraph;const d=[],h=[];if(e.codeBlockRendererSync?u.code=(v,b)=>{const y=cae.nextId(),C=e.codeBlockRendererSync(lAe(b),v);return h.push([y,C]),`<div class="code" data-code="${y}">${LV(v)}</div>`}:e.codeBlockRenderer&&(u.code=(v,b)=>{const y=cae.nextId(),C=e.codeBlockRenderer(lAe(b),v);return d.push(C.then(x=>[y,x])),`<div class="code" data-code="${y}">${LV(v)}</div>`}),e.actionHandler){const v=function(C){let x=C.target;if(!(x.tagName!=="A"&&(x=x.parentElement,!x||x.tagName!=="A")))try{let k=x.dataset.href;k&&(n.baseUri&&(k=ZZ(Tn.from(n.baseUri),k)),e.actionHandler.callback(k,C))}catch(k){fi(k)}finally{C.preventDefault()}},b=e.actionHandler.disposables.add(new Wi(a,"click")),y=e.actionHandler.disposables.add(new Wi(a,"auxclick"));e.actionHandler.disposables.add(Pt.any(b.event,y.event)(C=>{const x=new og(C);!x.leftButton&&!x.middleButton||v(x)})),e.actionHandler.disposables.add(We(a,"keydown",C=>{const x=new Oo(C);!x.equals(10)&&!x.equals(3)||v(x)}))}n.supportHtml||(t.sanitizer=v=>(n.isTrusted?v.match(/^(<span[^>]+>)|(<\/\s*span>)$/):void 0)?v:"",t.sanitize=!0,t.silent=!0),t.renderer=u;let g=(i=n.value)!==null&&i!==void 0?i:"";g.length>1e5&&(g=`${g.substr(0,1e5)}…`),n.supportThemeIcons&&(g=YKi(g));let p;if(e.fillInIncompleteTokens){const v=Object.assign(Object.assign({},Ev.defaults),t),b=Ev.lexer(g,v),y=vGi(b);p=Ev.parser(y,v)}else p=Ev.parse(g,t);n.supportThemeIcons&&(p=PC(p).map(b=>typeof b=="string"?b:b.outerHTML).join(""));const _=new DOMParser().parseFromString(hae(n,p),"text/html");if(_.body.querySelectorAll("img").forEach(v=>{const b=v.getAttribute("src");if(b){let y=b;try{n.baseUri&&(y=ZZ(Tn.from(n.baseUri),y))}catch{}v.src=c(y,!0)}}),_.body.querySelectorAll("a").forEach(v=>{const b=v.getAttribute("href");if(v.setAttribute("href",""),!b||/^data:|javascript:/i.test(b)||/^command:/i.test(b)&&!n.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(b))v.replaceWith(...v.childNodes);else{let y=c(b,!1);n.baseUri&&(y=ZZ(Tn.from(n.baseUri),b)),v.dataset.href=y}}),a.innerHTML=hae(n,_.body.innerHTML),d.length>0)Promise.all(d).then(v=>{var b,y;if(s)return;const C=new Map(v),x=a.querySelectorAll("div[data-code]");for(const k of x){const I=C.get((b=k.dataset.code)!==null&&b!==void 0?b:"");I&&Yl(k,I)}(y=e.asyncRenderCallback)===null||y===void 0||y.call(e)});else if(h.length>0){const v=new Map(h),b=a.querySelectorAll("div[data-code]");for(const y of b){const C=v.get((r=y.dataset.code)!==null&&r!==void 0?r:"");C&&Yl(y,C)}}if(e.asyncRenderCallback)for(const v of a.getElementsByTagName("img")){const b=o.add(We(v,"load",()=>{b.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{s=!0,o.dispose()}}}function lAe(n){if(!n)return"";const e=n.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:n}function ZZ(n,e){return/^\w[\w\d+.-]*:/.test(e)?e:n.path.endsWith("/")?s2e(n,e).toString():s2e(hq(n),e).toString()}function hae(n,e){const{config:t,allowedSchemes:i}=hGi(n);vUe("uponSanitizeAttribute",(o,s)=>{if(s.attrName==="style"||s.attrName==="class"){if(o.tagName==="SPAN"){if(s.attrName==="style"){s.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(s.attrValue);return}else if(s.attrName==="class"){s.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(s.attrValue);return}}s.keepAttr=!1;return}});const r=d$i(i);try{return _Ue(e,Object.assign(Object.assign({},t),{RETURN_TRUSTED_TYPE:!0}))}finally{bUe("uponSanitizeAttribute"),r.dispose()}}const dGi=["align","autoplay","alt","class","controls","data-code","data-href","height","href","loop","muted","playsinline","poster","src","style","target","title","width","start"];function hGi(n){const e=[Si.http,Si.https,Si.mailto,Si.data,Si.file,Si.vscodeFileResource,Si.vscodeRemote,Si.vscodeRemoteResource];return n.isTrusted&&e.push(Si.command),{config:{ALLOWED_TAGS:[...h$i],ALLOWED_ATTR:dGi,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function fGi(n){return typeof n=="string"?n:gGi(n)}function gGi(n){var e;let t=(e=n.value)!==null&&e!==void 0?e:"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const i=Ev.parse(t,{renderer:mGi.value}).replace(/&(#\d+|[a-zA-Z]+);/g,r=>{var o;return(o=pGi.get(r))!==null&&o!==void 0?o:r});return hae({isTrusted:!1},i).toString()}const pGi=new Map([["&quot;",'"'],["&nbsp;"," "],["&amp;","&"],["&#39;","'"],["&lt;","<"],["&gt;",">"]]),mGi=new Jw(()=>{const n=new Ev.Renderer;return n.code=e=>e,n.blockquote=e=>e,n.html=e=>"",n.heading=(e,t,i)=>e+`
`,n.hr=()=>"",n.list=(e,t)=>e,n.listitem=e=>e+`
`,n.paragraph=e=>e+`
`,n.table=(e,t)=>e+t+`
`,n.tablerow=e=>e,n.tablecell=(e,t)=>e+" ",n.strong=e=>e,n.em=e=>e,n.codespan=e=>e,n.br=()=>`
`,n.del=e=>e,n.image=(e,t,i)=>"",n.text=e=>e,n.link=(e,t,i)=>i,n});function X_e(n){let e="";return n.forEach(t=>{e+=t.raw}),e}function _Gi(n){for(const e of n.tokens)if(e.type==="text"){const t=e.raw.split(`
`),i=t[t.length-1];if(i.includes("`"))return yGi(n);if(i.includes("**"))return xGi(n);if(i.match(/\*\w/))return CGi(n);if(i.match(/(^|\s)__\w/))return kGi(n);if(i.match(/(^|\s)_\w/))return wGi(n);if(i.match(/(^|\s)\[.*\]\(\w*/))return SGi(n);if(i.match(/(^|\s)\[\w/))return EGi(n)}}function vGi(n){let e,t;for(e=0;e<n.length;e++){const i=n[e];if(i.type==="paragraph"&&i.raw.match(/(\n|^)```/)){t=bGi(n.slice(e));break}if(i.type==="paragraph"&&i.raw.match(/(\n|^)\|/)){t=TGi(n.slice(e));break}if(e===n.length-1&&i.type==="paragraph"){const r=_Gi(i);if(r){t=[r];break}}}if(t){const i=[...n.slice(0,e),...t];return i.links=n.links,i}return n}function bGi(n){const e=X_e(n);return Ev.lexer(e+"\n```")}function yGi(n){return Mk(n,"`")}function CGi(n){return Mk(n,"*")}function wGi(n){return Mk(n,"_")}function SGi(n){return Mk(n,")")}function EGi(n){return Mk(n,"](about:blank)")}function xGi(n){return Mk(n,"**")}function kGi(n){return Mk(n,"__")}function Mk(n,e){const t=X_e(Array.isArray(n)?n:[n]);return Ev.lexer(t+e)[0]}function TGi(n){const e=X_e(n),t=e.split(`
`);let i,r=!1;for(let o=0;o<t.length;o++){const s=t[o].trim();if(typeof i>"u"&&s.match(/^\s*\|/)){const a=s.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(s.match(/^\s*\|/)){if(o!==t.length-1)return;r=!0}else return}if(typeof i=="number"&&i>0){const o=r?t.slice(0,-1).join(`
`):e,s=!!o.match(/\|\s*$/),a=o+(s?"":"|")+`
|${" --- |".repeat(i)}`;return Ev.lexer(a)}}class IGi{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(r=>r.splice(e,t,i))}}class BT extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function cAe(n,e){const t=[];for(const i of e){if(n.start>=i.range.end)continue;if(n.end<i.range.start)break;const r=xc.intersect(n,i.range);xc.isEmpty(r)||t.push({range:r,size:i.size})}return t}function fae({start:n,end:e},t){return{start:n+t,end:e+t}}function LGi(n){const e=[];let t=null;for(const i of n){const r=i.range.start,o=i.range.end,s=i.size;if(t&&s===t.size){t.range.end=o;continue}t={range:{start:r,end:o},size:s},e.push(t)}return e}function DGi(...n){return LGi(n.reduce((e,t)=>e.concat(t),[]))}class uAe{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const r=i.length-t,o=cAe({start:0,end:e},this.groups),s=cAe({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:fae(l.range,r),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=DGi(o,a,s),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.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;if(e<this._paddingTop)return 0;let t=0,i=this._paddingTop;for(const r of this.groups){const o=r.range.end-r.range.start,s=i+o*r.size;if(e<s)return t+Math.floor((e-i)/r.size);t+=o,i=s}return t}indexAfter(e){return Math.min(this.indexAt(e)+1,this.count)}positionAt(e){if(e<0)return-1;let t=0,i=0;for(const r of this.groups){const o=r.range.end-r.range.start,s=i+o;if(e<s)return this._paddingTop+t+(e-i)*r.size;t+=o*r.size,i=s}return-1}}function AGi(n){var e;try{(e=n.parentElement)===null||e===void 0||e.removeChild(n)}catch{}}class RGi{constructor(e){this.renderers=e,this.cache=new Map,this.transactionNodesPendingRemoval=new Set,this.inTransaction=!1}alloc(e){let t=this.getTemplateCache(e).pop(),i=!1;if(t)i=this.transactionNodesPendingRemoval.has(t.domNode),i&&this.transactionNodesPendingRemoval.delete(t.domNode);else{const r=at(".monaco-list-row"),s=this.getRenderer(e).renderTemplate(r);t={domNode:r,templateId:e,templateData:s}}return{row:t,isReusingConnectedDomNode:i}}release(e){e&&this.releaseRow(e)}transact(e){if(this.inTransaction)throw new Error("Already in transaction");this.inTransaction=!0;try{e()}finally{for(const t of this.transactionNodesPendingRemoval)this.doRemoveNode(t);this.transactionNodesPendingRemoval.clear(),this.inTransaction=!1}}releaseRow(e){const{domNode:t,templateId:i}=e;t&&(this.inTransaction?this.transactionNodesPendingRemoval.add(t):this.doRemoveNode(t)),this.getTemplateCache(i).push(e)}doRemoveNode(e){e.classList.remove("scrolling"),AGi(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 i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var P0=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};const TS={CurrentDragAndDropData:void 0},G_={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(n){return[n]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class A5{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class NGi{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class OGi{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 i=e.files.item(t);i&&(i.size||i.type)&&this.files.push(i)}}}getData(){return{types:this.types,files:this.files}}}function PGi(n,e){return Array.isArray(n)&&Array.isArray(e)?Qs(n,e):n===e}class MGi{constructor(e){e!=null&&e.getSetSize?this.getSetSize=e.getSetSize.bind(e):this.getSetSize=(t,i,r)=>r,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class Bg{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}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 t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:rZ(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=""}}constructor(e,t,i,r=G_){var o,s,a,l,c,u,d,h,g,p,m,_,v;if(this.virtualDelegate=t,this.domId=`list_id_${++Bg.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Gp(50),this.splicing=!1,this.dragOverAnimationStopDisposable=Ae.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=Ae.None,this.onDragLeaveTimeout=Ae.None,this.disposables=new nt,this._onDidChangeContentHeight=new be,this._onDidChangeContentWidth=new be,this._horizontalScrolling=!1,r.horizontalScrolling&&r.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new uAe((o=r.paddingTop)!==null&&o!==void 0?o:0);for(const y of i)this.renderers.set(y.templateId,y);this.cache=this.disposables.add(new RGi(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",typeof r.mouseSupport=="boolean"?r.mouseSupport:!0),this._horizontalScrolling=(s=r.horizontalScrolling)!==null&&s!==void 0?s:G_.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof r.paddingBottom>"u"?0:r.paddingBottom,this.accessibilityProvider=new MGi(r.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=r.transformOptimization)!==null&&a!==void 0?a:G_.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(bo.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new w5({forceIntegerValues:!0,smoothScrollDuration:(l=r.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:y=>Sg(y)})),this.scrollableElement=this.disposables.add(new f_e(this.rowsContainer,{alwaysConsumeMouseWheel:(c=r.alwaysConsumeMouseWheel)!==null&&c!==void 0?c:G_.alwaysConsumeMouseWheel,horizontal:1,vertical:(u=r.verticalScrollMode)!==null&&u!==void 0?u:G_.verticalScrollMode,useShadows:(d=r.useShadows)!==null&&d!==void 0?d:G_.useShadows,mouseWheelScrollSensitivity:r.mouseWheelScrollSensitivity,fastScrollSensitivity:r.fastScrollSensitivity,scrollByPage:r.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(We(this.rowsContainer,yo.Change,y=>this.onTouchChange(y))),this.disposables.add(We(this.scrollableElement.getDomNode(),"scroll",y=>y.target.scrollTop=0)),this.disposables.add(We(this.domNode,"dragover",y=>this.onDragOver(this.toDragEvent(y)))),this.disposables.add(We(this.domNode,"drop",y=>this.onDrop(this.toDragEvent(y)))),this.disposables.add(We(this.domNode,"dragleave",y=>this.onDragLeave(this.toDragEvent(y)))),this.disposables.add(We(this.domNode,"dragend",y=>this.onDragEnd(y))),this.setRowLineHeight=(h=r.setRowLineHeight)!==null&&h!==void 0?h:G_.setRowLineHeight,this.setRowHeight=(g=r.setRowHeight)!==null&&g!==void 0?g:G_.setRowHeight,this.supportDynamicHeights=(p=r.supportDynamicHeights)!==null&&p!==void 0?p:G_.supportDynamicHeights,this.dnd=(m=r.dnd)!==null&&m!==void 0?m:this.disposables.add(G_.dnd),this.layout((_=r.initialSize)===null||_===void 0?void 0:_.height,(v=r.initialSize)===null||v===void 0?void 0:v.width)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t=Object.assign(Object.assign({},t??{}),{scrollByPage:e.scrollByPage})),e.mouseWheelScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t??{}),{mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity})),e.fastScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t??{}),{fastScrollSensitivity:e.fastScrollSensitivity})),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const i=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),r=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(i,Math.max(0,this.lastRenderTop+r),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const r=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},s=xc.intersect(r,o),a=new Map;for(let k=s.end-1;k>=s.start;k--){const I=this.items[k];if(I.dragStartDisposable.dispose(),I.checkedDisposable.dispose(),I.row){let L=a.get(I.templateId);L||(L=[],a.set(I.templateId,L));const D=this.renderers.get(I.templateId);D&&D.disposeElement&&D.disposeElement(I.element,k,I.row.templateData,I.size),L.push(I.row)}I.row=null}const l={start:e+t,end:this.items.length},c=xc.intersect(l,r),u=xc.relativeComplement(l,r),d=i.map(k=>({id:String(this.itemId++),element:k,templateId:this.virtualDelegate.getTemplateId(k),size:this.virtualDelegate.getHeight(k),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(k),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:Ae.None,checkedDisposable:Ae.None}));let h;e===0&&t>=this.items.length?(this.rangeMap=new uAe(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,d),h=this.items,this.items=d):(this.rangeMap.splice(e,t,d),h=this.items.splice(e,t,...d));const g=i.length-t,p=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),m=fae(c,g),_=xc.intersect(p,m);for(let k=_.start;k<_.end;k++)this.updateItemInDOM(this.items[k],k);const v=xc.relativeComplement(m,p);for(const k of v)for(let I=k.start;I<k.end;I++)this.removeItemFromDOM(I);const b=u.map(k=>fae(k,g)),C=[{start:e,end:e+i.length},...b].map(k=>xc.intersect(p,k)),x=this.getNextToLastElement(C);for(const k of C)for(let I=k.start;I<k.end;I++){const L=this.items[I],D=a.get(L.templateId),R=D==null?void 0:D.pop();this.insertItemInDOM(I,x,R)}for(const k of a.values())for(const I of k)this.cache.release(I);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),h.map(k=>k.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Sg(()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}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}get firstVisibleIndex(){const e=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),t=this.rangeMap.positionAt(e.start),i=this.rangeMap.positionAt(e.start+1);return i!==-1&&(i-t)/2+t<this.scrollTop?e.start+1:e.start}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){const i={height:typeof e=="number"?e:n$i(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:rZ(this.domNode)})}render(e,t,i,r,o,s=!1){const a=this.getRenderRange(t,i),l=xc.relativeComplement(a,e),c=xc.relativeComplement(e,a),u=this.getNextToLastElement(l);if(s){const d=xc.intersect(e,a);for(let h=d.start;h<d.end;h++)this.updateItemInDOM(this.items[h],h)}this.cache.transact(()=>{for(const d of c)for(let h=d.start;h<d.end;h++)this.removeItemFromDOM(h);for(const d of l)for(let h=d.start;h<d.end;h++)this.insertItemInDOM(h,u)}),r!==void 0&&(this.rowsContainer.style.left=`-${r}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&o!==void 0&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t,i){const r=this.items[e];let o=!1;if(!r.row)if(i)r.row=i;else{const u=this.cache.alloc(r.templateId);r.row=u.row,o=u.isReusingConnectedDomNode}const s=this.accessibilityProvider.getRole(r.element)||"listitem";r.row.domNode.setAttribute("role",s);const a=this.accessibilityProvider.isChecked(r.element);if(typeof a=="boolean")r.row.domNode.setAttribute("aria-checked",String(!!a));else if(a){const u=d=>r.row.domNode.setAttribute("aria-checked",String(!!d));u(a.value),r.checkedDisposable=a.onDidChange(u)}(o||!r.row.domNode.parentElement)&&(t?this.rowsContainer.insertBefore(r.row.domNode,t):this.rowsContainer.appendChild(r.row.domNode)),this.updateItemInDOM(r,e);const l=this.renderers.get(r.templateId);if(!l)throw new Error(`No renderer found for template id ${r.templateId}`);l==null||l.renderElement(r.element,e,r.row.templateData,r.size);const c=this.dnd.getDragURI(r.element);r.dragStartDisposable.dispose(),r.row.domNode.draggable=!!c,c&&(r.dragStartDisposable=We(r.row.domNode,"dragstart",u=>this.onDragStart(r.element,c,u))),this.horizontalScrolling&&(this.measureItemWidth(r),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=rZ(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 i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.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.paddingBottom}get onMouseClick(){return Pt.map(this.disposables.add(new Wi(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return Pt.map(this.disposables.add(new Wi(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return Pt.filter(Pt.map(this.disposables.add(new Wi(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return Pt.map(this.disposables.add(new Wi(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return Pt.map(this.disposables.add(new Wi(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return Pt.map(this.disposables.add(new Wi(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return Pt.any(Pt.map(this.disposables.add(new Wi(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),Pt.map(this.disposables.add(new Wi(this.domNode,yo.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return Pt.map(this.disposables.add(new Wi(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return Pt.map(this.disposables.add(new Wi(this.rowsContainer,yo.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],r=i&&i.element;return{browserEvent:e,index:t,element:r}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],r=i&&i.element;return{browserEvent:e,index:t,element:r}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],r=i&&i.element;return{browserEvent:e,index:t,element:r}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],r=i&&i.element;return{browserEvent:e,index:t,element:r}}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 console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){var r,o;if(!i.dataTransfer)return;const s=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(r4.TEXT,t),i.dataTransfer.setDragImage){let a;this.dnd.getDragLabel&&(a=this.dnd.getDragLabel(s,i)),typeof a>"u"&&(a=String(s.length));const l=at(".monaco-drag-image");l.textContent=a;const u=(d=>{for(;d&&!d.classList.contains("monaco-workbench");)d=d.parentElement;return d||document.body})(this.domNode);u.appendChild(l),i.dataTransfer.setDragImage(l,-10,-10),setTimeout(()=>u.removeChild(l),0)}this.domNode.classList.add("dragging"),this.currentDragData=new A5(s),TS.CurrentDragAndDropData=new NGi(s),(o=(r=this.dnd).onDragStart)===null||o===void 0||o.call(r,this.currentDragData,i)}onDragOver(e){var t;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),TS.CurrentDragAndDropData&&TS.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(TS.CurrentDragAndDropData)this.currentDragData=TS.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new OGi}const i=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop=typeof i=="boolean"?i:i.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof i!="boolean"&&i.effect===0?"copy":"move";let r;if(typeof i!="boolean"&&i.feedback?r=i.feedback:typeof e.index>"u"?r=[-1]:r=[e.index],r=rw(r).filter(o=>o>=-1&&o<this.length).sort((o,s)=>o-s),r=r[0]===-1?[-1]:r,PGi(this.currentDragFeedback,r))return!0;if(this.currentDragFeedback=r,this.currentDragFeedbackDisposable.dispose(),r[0]===-1)this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=Gn(()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")});else{for(const o of r){const s=this.items[o];s.dropTarget=!0,(t=s.row)===null||t===void 0||t.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=Gn(()=>{var o;for(const s of r){const a=this.items[s];a.dropTarget=!1,(o=a.row)===null||o===void 0||o.domNode.classList.remove("drop-target")}})}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=uw(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((i=(t=this.dnd).onDragLeave)===null||i===void 0||i.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.domNode.classList.remove("dragging"),this.currentDragData=void 0,TS.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){var t,i;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,TS.CurrentDragAndDropData=void 0,(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=Ae.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=SUe(this.domNode).top;this.dragOverAnimationDisposable=u$i(this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=uw(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){const r=i.getAttribute("data-index");if(r){const o=Number(r);if(!isNaN(o))return o}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const r=this.getRenderRange(e,t);let o,s;e===this.elementTop(r.start)?(o=r.start,s=0):r.end-r.start>1&&(o=r.start+1,s=this.elementTop(o)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let u=l.start;u<l.end;u++){const d=this.probeDynamicHeight(u);d!==0&&this.rangeMap.splice(u,1,[this.items[u]]),a+=d,c=c||d!==0}if(!c){a!==0&&this.eventuallyUpdateScrollDimensions();const u=xc.relativeComplement(r,l);for(const h of u)for(let g=h.start;g<h.end;g++)this.items[g].row&&this.removeItemFromDOM(g);const d=xc.relativeComplement(l,r);for(const h of d)for(let g=h.start;g<h.end;g++){const p=g+1,m=p<this.items.length?this.items[p].row:null,_=m?m.domNode:null;this.insertItemInDOM(g,_)}for(let h=l.start;h<l.end;h++)this.items[h].row&&this.updateItemInDOM(this.items[h],h);if(typeof o=="number"){const h=this.scrollable.getFutureScrollPosition().scrollTop-e,g=this.elementTop(o)-s+h;this.setScrollTop(g,i)}this._onDidChangeContentHeight.fire(this.contentHeight);return}}}probeDynamicHeight(e){var t,i,r;const o=this.items[e];if(this.virtualDelegate.getDynamicHeight){const c=this.virtualDelegate.getDynamicHeight(o.element);if(c!==null){const u=o.size;return o.size=c,o.lastDynamicHeightWidth=this.renderWidth,c-u}}if(!o.hasDynamicHeight||o.lastDynamicHeightWidth===this.renderWidth||this.virtualDelegate.hasDynamicHeight&&!this.virtualDelegate.hasDynamicHeight(o.element))return 0;const s=o.size;if(o.row)return o.row.domNode.style.height="",o.size=o.row.domNode.offsetHeight,o.lastDynamicHeightWidth=this.renderWidth,o.size-s;const{row:a}=this.cache.alloc(o.templateId);a.domNode.style.height="",this.rowsContainer.appendChild(a.domNode);const l=this.renderers.get(o.templateId);if(!l)throw new ya("Missing renderer for templateId: "+o.templateId);return l.renderElement(o.element,e,a.templateData,void 0),o.size=a.domNode.offsetHeight,(t=l.disposeElement)===null||t===void 0||t.call(l,o.element,e,a.templateData,void 0),(r=(i=this.virtualDelegate).setDynamicHeight)===null||r===void 0||r.call(i,o.element,o.size),o.lastDynamicHeightWidth=this.renderWidth,this.rowsContainer.removeChild(a.domNode),this.cache.release(a),o.size-s}getNextToLastElement(e){const t=e[e.length-1];if(!t)return null;const i=this.items[t.end];return!i||!i.row?null:i.row.domNode}getElementDomId(e){return`${this.domId}_${e}`}dispose(){var e,t;for(const i of this.items)if(i.dragStartDisposable.dispose(),i.checkedDisposable.dispose(),i.row){const r=this.renderers.get(i.row.templateId);r&&((e=r.disposeElement)===null||e===void 0||e.call(r,i.element,-1,i.row.templateData,void 0),r.disposeTemplate(i.row.templateData))}this.items=[],this.domNode&&this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),(t=this.dragOverAnimationDisposable)===null||t===void 0||t.dispose(),this.disposables.dispose()}}Bg.InstanceCount=0;P0([fa],Bg.prototype,"onMouseClick",null);P0([fa],Bg.prototype,"onMouseDblClick",null);P0([fa],Bg.prototype,"onMouseMiddleClick",null);P0([fa],Bg.prototype,"onMouseDown",null);P0([fa],Bg.prototype,"onMouseOver",null);P0([fa],Bg.prototype,"onMouseOut",null);P0([fa],Bg.prototype,"onContextMenu",null);P0([fa],Bg.prototype,"onTouchStart",null);P0([fa],Bg.prototype,"onTap",null);var Fk=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},dAe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class FGi{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const r=this.renderedElements.findIndex(o=>o.templateData===i);if(r>=0){const o=this.renderedElements[r];this.trait.unrender(i),o.index=t}else{const o={index:t,templateData:i};this.renderedElements.push(o)}this.trait.renderIndex(t,i)}splice(e,t,i){const r=[];for(const o of this.renderedElements)o.index<e?r.push(o):o.index>=e+t&&r.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=r}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(i=>i.templateData===e);t<0||this.renderedElements.splice(t,1)}}let yH=class{get name(){return this._trait}get renderer(){return new FGi(this)}constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new be,this.onChange=this._onChange.event}splice(e,t,i){var r;t=Math.max(0,Math.min(t,this.length-e));const o=i.length-t,s=e+t,a=[];let l=0;for(;l<this.sortedIndexes.length&&this.sortedIndexes[l]<e;)a.push(this.sortedIndexes[l++]);for(let u=0;u<i.length;u++)i[u]&&a.push(u+e);for(;l<this.sortedIndexes.length&&this.sortedIndexes[l]>=s;)a.push(this.sortedIndexes[l++]+o);const c=this.length+o;if(this.sortedIndexes.length>0&&a.length===0&&c>0){const u=(r=this.sortedIndexes.find(d=>d>=e))!==null&&r!==void 0?r:c-1;a.push(Math.min(u,c-1))}this.renderer.splice(e,t,i.length),this._set(a,a),this.length=c}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(fAe),t)}_set(e,t,i){const r=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const s=gae(o,e);return this.renderer.renderIndexes(s),this._onChange.fire({indexes:e,browserEvent:i}),r}get(){return this.indexes}contains(e){return gM(this.sortedIndexes,e,fAe)>=0}dispose(){Hr(this._onChange)}};Fk([fa],yH.prototype,"renderer",null);class BGi extends yH{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 JZ{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));const r=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(r.length===0)return this.trait.splice(e,t,new Array(i.length).fill(!1));const o=new Set(r),s=i.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,s)}}function MC(n){return n.tagName==="INPUT"||n.tagName==="TEXTAREA"}function QI(n){return n.classList.contains("monaco-editor")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:QI(n.parentElement)}function JKe(n){return n.tagName==="A"&&n.classList.contains("monaco-button")||n.tagName==="DIV"&&n.classList.contains("monaco-button-dropdown")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:JKe(n.parentElement)}class eGe{get onKeyDown(){return Pt.chain(this.disposables.add(new Wi(this.view.domNode,"keydown")).event,e=>e.filter(t=>!MC(t.target)).map(t=>new Oo(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new nt,this.multipleSelectionDisposables=new nt,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(r=>{switch(r.keyCode){case 3:return this.onEnter(r);case 16:return this.onUpArrow(r);case 18:return this.onDownArrow(r);case 11:return this.onPageUpArrow(r);case 12:return this.onPageDownArrow(r);case 9:return this.onEscape(r);case 31:this.multipleSelectionSupport&&(Qi?r.metaKey:r.ctrlKey)&&this.onCtrlA(r)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}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(xu(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()}}Fk([fa],eGe.prototype,"onKeyDown",null);var xv;(function(n){n[n.Automatic=0]="Automatic",n[n.Trigger=1]="Trigger"})(xv||(xv={}));var XI;(function(n){n[n.Idle=0]="Idle",n[n.Typing=1]="Typing"})(XI||(XI={}));const $Gi=new class{mightProducePrintableCharacter(n){return n.ctrlKey||n.metaKey||n.altKey?!1:n.keyCode>=31&&n.keyCode<=56||n.keyCode>=21&&n.keyCode<=30||n.keyCode>=98&&n.keyCode<=107||n.keyCode>=85&&n.keyCode<=95}};class VGi{constructor(e,t,i,r,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=r,this.delegate=o,this.enabled=!1,this.state=XI.Idle,this.mode=xv.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new nt,this.disposables=new nt,this.updateOptions(e.options)}updateOptions(e){var t,i;!((t=e.typeNavigationEnabled)!==null&&t!==void 0)||t?this.enable():this.disable(),this.mode=(i=e.typeNavigationMode)!==null&&i!==void 0?i:xv.Automatic}enable(){if(this.enabled)return;let e=!1;const t=Pt.chain(this.enabledDisposables.add(new Wi(this.view.domNode,"keydown")).event,o=>o.filter(s=>!MC(s.target)).filter(()=>this.mode===xv.Automatic||this.triggered).map(s=>new Oo(s)).filter(s=>e||this.keyboardNavigationEventFilter(s)).filter(s=>this.delegate.mightProducePrintableCharacter(s)).forEach(s=>yi.stop(s,!0)).map(s=>s.browserEvent.key)),i=Pt.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);Pt.reduce(Pt.any(t,i),(o,s)=>s===null?null:(o||"")+s,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,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 i=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(t[0]));i&&Pc(i)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=XI.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,r=this.state===XI.Idle?1:0;this.state=XI.Typing;for(let o=0;o<this.list.length;o++){const s=(i+o+r)%this.list.length,a=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(s)),l=a&&a.toString();if(this.list.options.typeNavigationEnabled){if(typeof l<"u"){if(o4(e,l)){this.previouslyFocused=i,this.list.setFocus([s]),this.list.reveal(s);return}const c=FKi(e,l);if(c&&c[0].end-c[0].start>1&&c.length===1){this.previouslyFocused=i,this.list.setFocus([s]),this.list.reveal(s);return}}}else if(typeof l>"u"||o4(e,l)){this.previouslyFocused=i,this.list.setFocus([s]),this.list.reveal(s);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class HGi{constructor(e,t){this.list=e,this.view=t,this.disposables=new nt;const i=Pt.chain(this.disposables.add(new Wi(t.domNode,"keydown")).event,o=>o.filter(s=>!MC(s.target)).map(s=>new Oo(s)));Pt.chain(i,o=>o.filter(s=>s.keyCode===2&&!s.ctrlKey&&!s.metaKey&&!s.shiftKey&&!s.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const i=this.view.domElement(t[0]);if(!i)return;const r=i.querySelector("[tabIndex]");if(!r||!(r instanceof HTMLElement)||r.tabIndex===-1)return;const o=window.getComputedStyle(r);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),r.focus())}dispose(){this.disposables.dispose()}}function tGe(n){return Qi?n.browserEvent.metaKey:n.browserEvent.ctrlKey}function nGe(n){return n.browserEvent.shiftKey}function WGi(n){return n instanceof MouseEvent&&n.button===2}const hAe={isSelectionSingleChangeEvent:tGe,isSelectionRangeChangeEvent:nGe};class iGe{constructor(e){this.list=e,this.disposables=new nt,this._onPointer=new be,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||hAe),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!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(bo.addTarget(e.getHTMLElement()))),Pt.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||hAe))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){QI(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(MC(e.browserEvent.target)||QI(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||MC(e.browserEvent.target)||QI(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),WGi(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(MC(e.browserEvent.target)||QI(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(typeof i>"u"){const u=this.list.getFocus()[0];i=u??t,this.list.setAnchor(i)}const r=Math.min(i,t),o=Math.max(i,t),s=xu(r,o+1),a=this.list.getSelection(),l=UGi(gae(a,[i]),i);if(l.length===0)return;const c=gae(s,qGi(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const r=this.list.getSelection(),o=r.filter(s=>s!==t);this.list.setFocus([t]),this.list.setAnchor(t),r.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class rGe{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,i;const r=this.selectorSuffix&&`.${this.selectorSuffix}`,o=[];e.listBackground&&o.push(`.monaco-list${r} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(o.push(`.monaco-list${r}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),o.push(`.monaco-list${r}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&o.push(`.monaco-list${r}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(o.push(`.monaco-list${r}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),o.push(`.monaco-list${r}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&o.push(`.monaco-list${r}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&o.push(`.monaco-list${r}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&o.push(`
.monaco-drag-image,
.monaco-list${r}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }
`),e.listFocusAndSelectionForeground&&o.push(`
.monaco-drag-image,
.monaco-list${r}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }
`),e.listInactiveFocusForeground&&(o.push(`.monaco-list${r} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),o.push(`.monaco-list${r} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&o.push(`.monaco-list${r} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(o.push(`.monaco-list${r} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),o.push(`.monaco-list${r} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(o.push(`.monaco-list${r} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),o.push(`.monaco-list${r} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&o.push(`.monaco-list${r} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&o.push(`.monaco-list${r}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&o.push(`.monaco-list${r}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const s=XE(e.listFocusAndSelectionOutline,XE(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));s&&o.push(`.monaco-list${r}:focus .monaco-list-row.focused.selected { outline: 1px solid ${s}; outline-offset: -1px;}`),e.listFocusOutline&&o.push(`
.monaco-drag-image,
.monaco-list${r}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
.monaco-workbench.context-menu-visible .monaco-list${r}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }
`);const a=XE(e.listSelectionOutline,(i=e.listInactiveFocusOutline)!==null&&i!==void 0?i:"");a&&o.push(`.monaco-list${r} .monaco-list-row.focused.selected { outline: 1px dotted ${a}; outline-offset: -1px; }`),e.listSelectionOutline&&o.push(`.monaco-list${r} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&o.push(`.monaco-list${r} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&o.push(`.monaco-list${r} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&o.push(`
.monaco-list${r}.drop-target,
.monaco-list${r} .monaco-list-rows.drop-target,
.monaco-list${r} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; }
`),e.tableColumnsBorder&&o.push(`
.monaco-table > .monaco-split-view2,
.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,
.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2,
.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {
border-color: ${e.tableColumnsBorder};
}
.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,
.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {
border-color: transparent;
}
`),e.tableOddRowsBackgroundColor&&o.push(`
.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,
.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,
.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {
background-color: ${e.tableOddRowsBackgroundColor};
}
`),this.styleElement.textContent=o.join(`
`)}}const zGi={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropBackground:"#383B3D",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:De.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:De.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:De.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0},jGi={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function UGi(n,e){const t=n.indexOf(e);if(t===-1)return[];const i=[];let r=t-1;for(;r>=0&&n[r]===e-(t-r);)i.push(n[r--]);for(i.reverse(),r=t;r<n.length&&n[r]===e+(r-t);)i.push(n[r++]);return i}function gae(n,e){const t=[];let i=0,r=0;for(;i<n.length||r<e.length;)if(i>=n.length)t.push(e[r++]);else if(r>=e.length)t.push(n[i++]);else if(n[i]===e[r]){t.push(n[i]),i++,r++;continue}else n[i]<e[r]?t.push(n[i++]):t.push(e[r++]);return t}function qGi(n,e){const t=[];let i=0,r=0;for(;i<n.length||r<e.length;)if(i>=n.length)t.push(e[r++]);else if(r>=e.length)t.push(n[i++]);else if(n[i]===e[r]){i++,r++;continue}else n[i]<e[r]?t.push(n[i++]):r++;return t}const fAe=(n,e)=>n-e;class KGi{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,i,r){let o=0;for(const s of this.renderers)s.renderElement(e,t,i[o++],r)}disposeElement(e,t,i,r){var o;let s=0;for(const a of this.renderers)(o=a.disposeElement)===null||o===void 0||o.call(a,e,t,i[s],r),s+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class GGi{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,i){const r=this.accessibilityProvider.getAriaLabel(e);r?i.setAttribute("aria-label",r):i.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof o=="number"?i.setAttribute("aria-level",`${o}`):i.removeAttribute("aria-level")}disposeTemplate(e){}}class YGi{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){var i,r;(r=(i=this.dnd).onDragStart)===null||r===void 0||r.call(i,e,t)}onDragOver(e,t,i,r){return this.dnd.onDragOver(e,t,i,r)}onDragLeave(e,t,i,r){var o,s;(s=(o=this.dnd).onDragLeave)===null||s===void 0||s.call(o,e,t,i,r)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}drop(e,t,i,r){this.dnd.drop(e,t,i,r)}dispose(){this.dnd.dispose()}}class sm{get onDidChangeFocus(){return Pt.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return Pt.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}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 onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=Pt.chain(this.disposables.add(new Wi(this.view.domNode,"keydown")).event,o=>o.map(s=>new Oo(s)).filter(s=>e=s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>yi.stop(s,!0)).filter(()=>!1)),i=Pt.chain(this.disposables.add(new Wi(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(s=>new Oo(s)).filter(s=>s.keyCode===58||s.shiftKey&&s.keyCode===68).map(s=>yi.stop(s,!0)).map(({browserEvent:s})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l<"u"?this.view.element(l):void 0,u=typeof l<"u"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:u,browserEvent:s}})),r=Pt.chain(this.view.onContextMenu,o=>o.filter(s=>!e).map(({element:s,index:a,browserEvent:l})=>({element:s,index:a,anchor:new og(l),browserEvent:l})));return Pt.any(t,i,r)}get onKeyDown(){return this.disposables.add(new Wi(this.view.domNode,"keydown")).event}get onDidFocus(){return Pt.signal(this.disposables.add(new Wi(this.view.domNode,"focus",!0)).event)}constructor(e,t,i,r,o=jGi){var s,a,l,c;this.user=e,this._options=o,this.focus=new yH("focused"),this.anchor=new yH("anchor"),this.eventBufferer=new Eme,this._ariaLabel="",this.disposables=new nt,this._onDidDispose=new be,this.onDidDispose=this._onDidDispose.event;const u=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(s=this._options.accessibilityProvider)===null||s===void 0?void 0:s.getWidgetRole():"list";this.selection=new BGi(u!=="listbox");const d=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(d.push(new GGi(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),r=r.map(g=>new KGi(g.templateId,[...d,g]));const h=Object.assign(Object.assign({},o),{dnd:o.dnd&&new YGi(this,o.dnd)});if(this.view=this.createListView(t,i,r,h),this.view.domNode.setAttribute("role",u),o.styleController)this.styleController=o.styleController(this.view.domId);else{const g=Eg(this.view.domNode);this.styleController=new rGe(g,this.view.domId)}if(this.spliceable=new IGi([new JZ(this.focus,this.view,o.identityProvider),new JZ(this.selection,this.view,o.identityProvider),new JZ(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 HGi(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new eGe(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const g=o.keyboardNavigationDelegate||$Gi;this.typeNavigationController=new VGi(this,this.view,o.keyboardNavigationLabelProvider,(c=o.keyboardNavigationEventFilter)!==null&&c!==void 0?c:()=>!0,g),this.disposables.add(this.typeNavigationController)}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()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,r){return new Bg(e,t,i,r)}createMouseController(e){return new iGe(this)}updateOptions(e={}){var t,i;this._options=Object.assign(Object.assign({},this._options),e),(t=this.typeNavigationController)===null||t===void 0||t.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),(i=this.keyboardController)===null||i===void 0||i.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new BT(this.user,`Invalid start index: ${e}`);if(t<0)throw new BT(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}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 scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}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 i of e)if(i<0||i>=this.length)throw new BT(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new BT(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return vje(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new BT(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,r){if(this.length===0)return;const o=this.focus.get(),s=this.findNextIndex(o.length>0?o[0]+e:0,t,r);s>-1&&this.setFocus([s],i)}focusPrevious(e=1,t=!1,i,r){if(this.length===0)return;const o=this.focus.get(),s=this.findPreviousIndex(o.length>0?o[0]-e:0,t,r);s>-1&&this.setFocus([s],i)}focusNextPage(e,t){return dAe(this,void 0,void 0,function*(){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;const r=this.getFocus()[0];if(r!==i&&(r===void 0||i>r)){const o=this.findPreviousIndex(i,!1,t);o>-1&&r!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let s=o+this.view.renderHeight;i>r&&(s-=this.view.elementHeight(i)),this.view.setScrollTop(s),this.view.getScrollTop()!==o&&(this.setFocus([]),yield cw(0),yield this.focusNextPage(e,t))}})}focusPreviousPage(e,t){return dAe(this,void 0,void 0,function*(){let i;const r=this.view.getScrollTop();r===0?i=this.view.indexAt(r):i=this.view.indexAfter(r-1);const o=this.getFocus()[0];if(o!==i&&(o===void 0||o>=i)){const s=this.findNextIndex(i,!1,t);s>-1&&o!==s?this.setFocus([s],e):this.setFocus([i],e)}else{const s=r;this.view.setScrollTop(r-this.view.renderHeight),this.view.getScrollTop()!==s&&(this.setFocus([]),yield cw(0),yield this.focusPreviousPage(e,t))}})}focusLast(e,t){if(this.length===0)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(this.length===0)return;const r=this.findNextIndex(e,!1,i);r>-1&&this.setFocus([r],t)}findNextIndex(e,t=!1,i){for(let r=0;r<this.length;r++){if(e>=this.length&&!t)return-1;if(e=e%this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let r=0;r<this.length;r++){if(e<0&&!t)return-1;if(e=(this.length+e%this.length)%this.length,!i||i(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 BT(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),r=this.view.elementTop(e),o=this.view.elementHeight(e);if(ow(t)){const s=o-this.view.renderHeight;this.view.setScrollTop(s*qd(t,0,1)+r)}else{const s=r+o,a=i+this.view.renderHeight;r<i&&s>=a||(r<i||s>=a&&o>=this.view.renderHeight?this.view.setScrollTop(r):s>=a&&this.view.setScrollTop(s-this.view.renderHeight))}}getHTMLElement(){return this.view.domNode}getElementID(e){return this.view.getElementDomId(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(i=>this.view.element(i)),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 i;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||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",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}Fk([fa],sm.prototype,"onDidChangeFocus",null);Fk([fa],sm.prototype,"onDidChangeSelection",null);Fk([fa],sm.prototype,"onContextMenu",null);Fk([fa],sm.prototype,"onKeyDown",null);Fk([fa],sm.prototype,"onDidFocus",null);const NE=at,oGe="selectOption.entry.template";class QGi{get templateId(){return oGe}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=Ge(e,NE(".option-text")),t.detail=Ge(e,NE(".option-detail")),t.decoratorRight=Ge(e,NE(".option-decorator-right")),t}renderElement(e,t,i){const r=i,o=e.text,s=e.detail,a=e.decoratorRight,l=e.isDisabled;r.text.textContent=o,r.detail.textContent=s||"",r.decoratorRight.innerText=a||"",l?r.root.classList.add("option-disabled"):r.root.classList.remove("option-disabled")}disposeTemplate(e){}}class kv extends Ae{constructor(e,t,i,r,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=r,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=kv.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new be,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return oGe}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=at(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=Ge(this.selectDropDownContainer,NE(".select-box-details-pane"));const t=Ge(this.selectDropDownContainer,NE(".select-box-dropdown-container-width-control")),i=Ge(t,NE(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",Ge(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=Eg(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(We(this.selectDropDownContainer,Lt.DRAG_START,r=>{yi.stop(r,!0)}))}registerListeners(){this._register(ua(this.selectElement,"change",t=>{this.selected=t.target.selectedIndex,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)})),this._register(We(this.selectElement,Lt.CLICK,t=>{yi.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(We(this.selectElement,Lt.MOUSE_DOWN,t=>{yi.stop(t)}));let e;this._register(We(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(We(this.selectElement,"touchend",t=>{yi.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(We(this.selectElement,Lt.KEY_DOWN,t=>{const i=new Oo(t);let r=!1;Qi?(i.keyCode===18||i.keyCode===16||i.keyCode===10||i.keyCode===3)&&(r=!0):(i.keyCode===18&&i.altKey||i.keyCode===16&&i.altKey||i.keyCode===10||i.keyCode===3)&&(r=!0),r&&(this.showSelectDropDown(),yi.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Qs(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((i,r)=>{this.selectElement.add(this.createOption(i.text,r,i.isDisabled)),typeof i.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)===null||e===void 0||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(`
`)}styleSelectElement(){var e,t,i;const r=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",o=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",s=(i=this.styles.selectBorder)!==null&&i!==void 0?i:"";this.selectElement.style.backgroundColor=r,this.selectElement.style.color=o,this.selectElement.style.borderColor=s}styleList(){var e,t;const i=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",r=XE(this.styles.selectListBackground,i);this.selectDropDownListContainer.style.backgroundColor=r,this.selectionDetailsPane.style.backgroundColor=r;const o=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=o,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const r=document.createElement("option");return r.value=e,r.text=e,r.disabled=!!i,r}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=Oa(this.selectElement),i=getComputedStyle(this.selectElement),r=parseFloat(i.getPropertyValue("--dropdown-padding-top"))+parseFloat(i.getPropertyValue("--dropdown-padding-bottom")),o=window.innerHeight-t.top-t.height-(this.selectBoxOptions.minBottomMargin||0),s=t.top-kv.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,a=this.selectElement.offsetWidth,l=this.setWidthControlElement(this.widthControlElement),c=Math.max(l,Math.round(a)).toString()+"px";this.selectDropDownContainer.style.width=c,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let u=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const d=this._hasDetails?this._cachedMaxDetailsHeight:0,h=u+r+d,g=Math.floor((o-r-d)/this.getHeight()),p=Math.floor((s-r-d)/this.getHeight());if(e)return t.top+t.height>window.innerHeight-22||t.top<kv.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||g<1&&p<1?!1:(g<kv.DEFAULT_MINIMUM_VISIBLE_OPTIONS&&p>g&&this.options.length>g?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(t.top+t.height>window.innerHeight-22||t.top<kv.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN||this._dropDownPosition===0&&g<1||this._dropDownPosition===1&&p<1)return this.hideSelectDropDown(!0),!1;if(this._dropDownPosition===0){if(this._isVisible&&g+p<1)return this.hideSelectDropDown(!0),!1;h>o&&(u=g*this.getHeight())}else h>s&&(u=p*this.getHeight());return this.selectList.layout(u),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=u+r+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=u+r+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=c,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let i=0,r=0;this.options.forEach((o,s)=>{const a=o.detail?o.detail.length:0,l=o.decoratorRight?o.decoratorRight.length:0,c=o.text.length+a+l;c>r&&(i=s,r=c)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=_d(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=Ge(e,NE(".select-box-dropdown-list-container")),this.listRenderer=new QGi,this.selectList=new sm("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:r=>{let o=r.text;return r.detail&&(o+=`. ${r.detail}`),r.decoratorRight&&(o+=`. ${r.decoratorRight}`),r.description&&(o+=`. ${r.description}`),o},getWidgetAriaLabel:()=>E({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>Qi?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new Wi(this.selectDropDownListContainer,"keydown")),i=Pt.chain(t.event,r=>r.filter(()=>this.selectList.length>0).map(o=>new Oo(o)));this._register(Pt.chain(i,r=>r.filter(o=>o.keyCode===3))(this.onEnter,this)),this._register(Pt.chain(i,r=>r.filter(o=>o.keyCode===2))(this.onEnter,this)),this._register(Pt.chain(i,r=>r.filter(o=>o.keyCode===9))(this.onEscape,this)),this._register(Pt.chain(i,r=>r.filter(o=>o.keyCode===16))(this.onUpArrow,this)),this._register(Pt.chain(i,r=>r.filter(o=>o.keyCode===18))(this.onDownArrow,this)),this._register(Pt.chain(i,r=>r.filter(o=>o.keyCode===12))(this.onPageDown,this)),this._register(Pt.chain(i,r=>r.filter(o=>o.keyCode===11))(this.onPageUp,this)),this._register(Pt.chain(i,r=>r.filter(o=>o.keyCode===14))(this.onHome,this)),this._register(Pt.chain(i,r=>r.filter(o=>o.keyCode===13))(this.onEnd,this)),this._register(Pt.chain(i,r=>r.filter(o=>o.keyCode>=21&&o.keyCode<=56||o.keyCode>=85&&o.keyCode<=113))(this.onCharacter,this)),this._register(We(this.selectList.getHTMLElement(),Lt.POINTER_UP,r=>this.onPointerUp(r))),this._register(this.selectList.onMouseOver(r=>typeof r.index<"u"&&this.selectList.setFocus([r.index]))),this._register(this.selectList.onDidChangeFocus(r=>this.onListFocus(r))),this._register(We(this.selectDropDownContainer,Lt.FOCUS_OUT,r=>{!this._isVisible||gc(r.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;yi.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const r=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");r>=0&&r<this.options.length&&!o&&(this.selected=r,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)),this.hideSelectDropDown(!0))}onListBlur(){this._sticky||(this.selected!==this._currentSelection&&this.select(this._currentSelection),this.hideSelectDropDown(!1))}renderDescriptionMarkdown(e,t){const i=o=>{for(let s=0;s<o.childNodes.length;s++){const a=o.childNodes.item(s);(a.tagName&&a.tagName.toLowerCase())==="img"?o.removeChild(a):i(a)}},r=wq({value:e,supportThemeIcons:!0},{actionHandler:t});return r.element.classList.add("select-box-description-markdown"),i(r.element),r.element}onListFocus(e){!this._isVisible||!this._hasDetails||this.updateDetail(e.indexes[0])}updateDetail(e){var t,i;this.selectionDetailsPane.innerText="";const r=this.options[e],o=(t=r==null?void 0:r.description)!==null&&t!==void 0?t:"",s=(i=r==null?void 0:r.descriptionIsMarkdown)!==null&&i!==void 0?i:!1;if(o){if(s){const a=r.descriptionMarkdownActionHandler;this.selectionDetailsPane.appendChild(this.renderDescriptionMarkdown(o,a))}else this.selectionDetailsPane.innerText=o;this.selectionDetailsPane.style.display="block"}else this.selectionDetailsPane.style.display="none";this._skipLayout=!0,this.contextViewProvider.layout(),this._skipLayout=!1}onEscape(e){yi.stop(e),this.select(this._currentSelection),this.hideSelectDropDown(!0)}onEnter(e){yi.stop(e),this.selected!==this._currentSelection&&(this._currentSelection=this.selected,this._onDidSelect.fire({index:this.selectElement.selectedIndex,selected:this.options[this.selected].text}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)),this.hideSelectDropDown(!0)}onDownArrow(e){if(this.selected<this.options.length-1){yi.stop(e,!0);const t=this.options[this.selected+1].isDisabled;if(t&&this.options.length>this.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(yi.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){yi.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected<this.options.length-1&&(this.selected++,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onPageDown(e){yi.stop(e),this.selectList.focusNextPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){yi.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){yi.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=Cy.toString(e.keyCode);let i=-1;for(let r=0;r<this.options.length-1;r++)if(i=(r+this.selected+1)%this.options.length,this.options[i].text.charAt(0).toUpperCase()===t&&!this.options[i].isDisabled){this.select(i),this.selectList.setFocus([i]),this.selectList.reveal(this.selectList.getFocus()[0]),yi.stop(e);break}}dispose(){this.hideSelectDropDown(!1),super.dispose()}}kv.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN=32;kv.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN=2;kv.DEFAULT_MINIMUM_VISIBLE_OPTIONS=3;class XGi extends Ae{constructor(e,t,i,r){super(),this.selected=0,this.selectBoxOptions=r||Object.create(null),this.options=[],this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=this._register(new be),this.styles=i,this.registerListeners(),this.setOptions(e,t)}registerListeners(){this._register(bo.addTarget(this.selectElement)),[yo.Tap].forEach(e=>{this._register(We(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(ua(this.selectElement,"click",e=>{yi.stop(e,!0)})),this._register(ua(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(ua(this.selectElement,"keydown",e=>{let t=!1;Qi?(e.keyCode===18||e.keyCode===16||e.keyCode===10)&&(t=!0):(e.keyCode===18&&e.altKey||e.keyCode===10||e.keyCode===3)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!Qs(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((i,r)=>{this.selectElement.add(this.createOption(i.text,r,i.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&e<this.options.length?this.selected=e:e>this.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected<this.options.length&&typeof this.options[this.selected].text=="string"?this.selectElement.title=this.options[this.selected].text:this.selectElement.title=""}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){e.classList.add("select-container"),e.appendChild(this.selectElement),this.setOptions(this.options,this.selected),this.applyStyles()}applyStyles(){var e,t,i;this.selectElement&&(this.selectElement.style.backgroundColor=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",this.selectElement.style.color=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",this.selectElement.style.borderColor=(i=this.styles.selectBorder)!==null&&i!==void 0?i:"")}createOption(e,t,i){const r=document.createElement("option");return r.value=e,r.text=e,r.disabled=!!i,r}}class ZGi extends im{constructor(e,t,i,r,o){super(),Qi&&!(o!=null&&o.useCustomDrawn)?this.selectBoxDelegate=new XGi(e,t,r,o):this.selectBoxDelegate=new kv(e,t,i,r,o),this._register(this.selectBoxDelegate)}get onDidSelect(){return this.selectBoxDelegate.onDidSelect}setOptions(e,t){this.selectBoxDelegate.setOptions(e,t)}select(e){this.selectBoxDelegate.select(e)}focus(){this.selectBoxDelegate.focus()}blur(){this.selectBoxDelegate.blur()}setFocusable(e){this.selectBoxDelegate.setFocusable(e)}render(e){this.selectBoxDelegate.render(e)}}class Um extends Ae{get action(){return this._action}constructor(e,t,i={}){super(),this.options=i,this._context=e||this,this._action=t,t instanceof Gu&&this._register(t.onDidChange(r=>{this.element&&this.handleActionChangeEvent(r)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new GD)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(bo.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,wg&&this._register(We(e,Lt.DRAG_START,r=>{var o;return(o=r.dataTransfer)===null||o===void 0?void 0:o.setData(r4.TEXT,this._action.label)}))),this._register(We(t,yo.Tap,r=>this.onClick(r,!0))),this._register(We(t,Lt.MOUSE_DOWN,r=>{i||yi.stop(r,!0),this._action.enabled&&r.button===0&&t.classList.add("active")})),Qi&&this._register(We(t,Lt.CONTEXT_MENU,r=>{r.button===0&&r.ctrlKey===!0&&this.onClick(r)})),this._register(We(t,Lt.CLICK,r=>{yi.stop(r,!0),this.options&&this.options.isMenu||this.onClick(r)})),this._register(We(t,Lt.DBLCLICK,r=>{yi.stop(r,!0)})),[Lt.MOUSE_UP,Lt.MOUSE_OUT].forEach(r=>{this._register(We(t,r,o=>{yi.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var i;yi.stop(e,!0);const r=Mh(this._context)?!((i=this.options)===null||i===void 0)&&i.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,r)}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(){}getTooltip(){return this.action.tooltip}updateTooltip(){var e;if(!this.element)return;const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.updateAriaLabel(),this.options.hoverDelegate?(this.element.title="",this.customHover?this.customHover.update(t):(this.customHover=XKe(this.options.hoverDelegate,this.element,t),this._store.add(this.customHover))):this.element.title=t}updateAriaLabel(){var e;if(this.element){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class f2 extends Um{constructor(e,t,i){super(e,t,i),this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=Ge(this.element,at("a.action-label"))),this.label&&this.label.setAttribute("role",this.getDefaultAriaRole()),this.options.label&&this.options.keybinding&&this.element&&(Ge(this.element,at("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===El.ID?"presentation":this.options.isMenu?"menuitem":"button"}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.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=E({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.action.class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):(e=this.label)===null||e===void 0||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(e=this.element)===null||e===void 0||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(t=this.element)===null||t===void 0||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.setAttribute("aria-checked",""),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class JGi extends Um{constructor(e,t,i,r,o,s,a){super(e,t),this.selectBox=new ZGi(i,r,o,s,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;(e=this.selectBox)===null||e===void 0||e.focus()}blur(){var e;(e=this.selectBox)===null||e===void 0||e.blur()}render(e){this.selectBox.render(e)}}class eYi extends GD{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new be),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=Ge(e,at(".monaco-dropdown")),this._label=Ge(this._element,at(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[Lt.CLICK,Lt.MOUSE_DOWN,yo.Tap])this._register(We(this.element,o,s=>yi.stop(s,!0)));for(const o of[Lt.MOUSE_DOWN,yo.Tap])this._register(We(this._label,o,s=>{s instanceof MouseEvent&&(s.detail>1||s.button!==0)||(this.visible?this.hide():this.show())}));this._register(We(this._label,Lt.KEY_UP,o=>{const s=new Oo(o);(s.equals(3)||s.equals(10))&&(yi.stop(o,!0),this.visible?this.hide():this.show())}));const r=i(this._label);r&&this._register(r),this._register(bo.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 tYi extends eYi{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class CH extends Um{constructor(e,t,i,r=Object.create(null)){super(null,e,r),this.actionItem=null,this._onDidChangeVisibility=this._register(new be),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=r,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{this.element=Ge(o,at("a.action-label"));let s=[];return typeof this.options.classNames=="string"?s=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(s=this.options.classNames),s.find(a=>a==="icon")||s.push("codicon"),this.element.classList.add(...s),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",this.element.ariaLabel=this._action.label||"",null},i=Array.isArray(this.menuActionsOrProvider),r={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new tYi(e,r)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var s;(s=this.element)===null||s===void 0||s.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return o.options.anchorAlignmentProvider()}})}this.updateTooltip(),this.updateEnabled()}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;(e=this.dropdownMenu)===null||e===void 0||e.show()}updateEnabled(){var e,t;const i=!this.action.enabled;(e=this.actionItem)===null||e===void 0||e.classList.toggle("disabled",i),(t=this.element)===null||t===void 0||t.classList.toggle("disabled",i)}}function nYi(n){return n?n.condition!==void 0:!1}var $N=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},WL;(function(n){n[n.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",n[n.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(WL||(WL={}));var ZI;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(ZI||(ZI={}));class zL extends Ae{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new Lx),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=ZI.None,this.cache=new Map,this.flushDelayer=this._register(new PUe(zL.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,i;this._onDidChangeStorage.pause();try{(t=e.changed)===null||t===void 0||t.forEach((r,o)=>this.acceptExternal(o,r)),(i=e.deleted)===null||i===void 0||i.forEach(r=>this.acceptExternal(r,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===ZI.Closed)return;let i=!1;Mh(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const i=this.cache.get(e);return Mh(i)?t:i}getBoolean(e,t){const i=this.get(e);return Mh(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return Mh(i)?t:parseInt(i,10)}set(e,t,i=!1){return $N(this,void 0,void 0,function*(){if(this.state===ZI.Closed)return;if(Mh(t))return this.delete(e,i);const r=Vu(t)||Array.isArray(t)?cGi(t):String(t);if(this.cache.get(e)!==r)return this.cache.set(e,r),this.pendingInserts.set(e,r),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()})}delete(e,t=!1){return $N(this,void 0,void 0,function*(){if(!(this.state===ZI.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()})}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return $N(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 t;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(t=this.whenFlushedCallbacks.pop())===null||t===void 0||t()})})}doFlush(e){return $N(this,void 0,void 0,function*(){return this.options.hint===WL.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)})}}zL.DEFAULT_FLUSH_DELAY=100;class eJ{constructor(){this.onDidChangeItemsExternal=Pt.None,this.items=new Map}updateItems(e){var t,i;return $N(this,void 0,void 0,function*(){(t=e.insert)===null||t===void 0||t.forEach((r,o)=>this.items.set(o,r)),(i=e.delete)===null||i===void 0||i.forEach(r=>this.items.delete(r))})}}const U8="__$__targetStorageMarker",am=Vi("storageService");var wH;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(wH||(wH={}));function iYi(n){const e=n.get(U8);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class Sq extends Ae{constructor(e={flushInterval:Sq.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new Lx),this._onDidChangeTarget=this._register(new Lx),this._onWillSaveState=this._register(new be),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return Pt.filter(this._onDidChangeValue.event,r=>r.scope===e&&(t===void 0||r.key===t),i)}emitDidChangeValue(e,t){const{key:i,external:r}=t;if(i===U8){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:r})}get(e,t,i){var r;return(r=this.getStorage(t))===null||r===void 0?void 0:r.get(e,i)}getBoolean(e,t,i){var r;return(r=this.getStorage(t))===null||r===void 0?void 0:r.getBoolean(e,i)}getNumber(e,t,i){var r;return(r=this.getStorage(t))===null||r===void 0?void 0:r.getNumber(e,i)}store(e,t,i,r,o=!1){if(Mh(t)){this.remove(e,i,o);return}this.withPausedEmitters(()=>{var s;this.updateKeyTarget(e,i,r),(s=this.getStorage(i))===null||s===void 0||s.set(e,t,o)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{var r;this.updateKeyTarget(e,t,void 0),(r=this.getStorage(t))===null||r===void 0||r.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,r=!1){var o,s;const a=this.getKeyTargets(t);typeof i=="number"?a[e]!==i&&(a[e]=i,(o=this.getStorage(t))===null||o===void 0||o.set(U8,JSON.stringify(a),r)):typeof a[e]=="number"&&(delete a[e],(s=this.getStorage(t))===null||s===void 0||s.set(U8,JSON.stringify(a),r))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?iYi(t):Object.create(null)}}Sq.DEFAULT_FLUSH_INTERVAL=60*1e3;class rYi extends Sq{constructor(){super(),this.applicationStorage=this._register(new zL(new eJ,{hint:WL.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new zL(new eJ,{hint:WL.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new zL(new eJ,{hint:WL.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}}function oYi(n,e){const t=Object.assign({},e);for(const i in n){const r=n[i];t[i]=r!==void 0?Bt(r):void 0}return t}const sYi={keybindingLabelBackground:Bt(H7i),keybindingLabelForeground:Bt(W7i),keybindingLabelBorder:Bt(z7i),keybindingLabelBottomBorder:Bt(j7i),keybindingLabelShadow:Bt(Ov)},aYi={buttonForeground:Bt(kN),buttonSeparator:Bt(T7i),buttonBackground:Bt(TN),buttonHoverBackground:Bt(I7i),buttonSecondaryForeground:Bt(D7i),buttonSecondaryBackground:Bt(mse),buttonSecondaryHoverBackground:Bt(A7i),buttonBorder:Bt(L7i)},lYi={progressBarBackground:Bt(O7i)},SH={inputActiveOptionBorder:Bt(r_e),inputActiveOptionForeground:Bt(o_e),inputActiveOptionBackground:Bt(IE)};Bt(SVi),Bt(xVi),Bt(EVi);Bt(As),Bt(Fv),Bt(Ov),Bt(ji),Bt(HVi),Bt(WVi),Bt(zVi),Bt(m7i);const EH={inputBackground:Bt(fqe),inputForeground:Bt(gqe),inputBorder:Bt(pqe),inputValidationInfoBorder:Bt(b7i),inputValidationInfoBackground:Bt(_7i),inputValidationInfoForeground:Bt(v7i),inputValidationWarningBorder:Bt(w7i),inputValidationWarningBackground:Bt(y7i),inputValidationWarningForeground:Bt(C7i),inputValidationErrorBorder:Bt(x7i),inputValidationErrorBackground:Bt(S7i),inputValidationErrorForeground:Bt(E7i)},cYi={listFilterWidgetBackground:Bt(mVi),listFilterWidgetOutline:Bt(_Vi),listFilterWidgetNoMatchesOutline:Bt(vVi),listFilterWidgetShadow:Bt(bVi),inputBoxStyles:EH,toggleStyles:SH},sGe={badgeBackground:Bt(M8),badgeForeground:Bt(R7i),badgeBorder:Bt(ji)};Bt(OVi),Bt(NVi),Bt(IDe),Bt(IDe),Bt(PVi);const Bk={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:Bt(sVi),listFocusForeground:Bt(aVi),listFocusOutline:Bt(lVi),listActiveSelectionBackground:Bt(Vy),listActiveSelectionForeground:Bt(Vv),listActiveSelectionIconForeground:Bt(AN),listFocusAndSelectionOutline:Bt(cVi),listFocusAndSelectionBackground:Bt(Vy),listFocusAndSelectionForeground:Bt(Vv),listInactiveSelectionBackground:Bt(uVi),listInactiveSelectionIconForeground:Bt(hVi),listInactiveSelectionForeground:Bt(dVi),listInactiveFocusBackground:Bt(fVi),listInactiveFocusOutline:Bt(gVi),listHoverBackground:Bt(vqe),listHoverForeground:Bt(bqe),listDropBackground:Bt(pVi),listSelectionOutline:Bt(Ho),listHoverOutline:Bt(Ho),treeIndentGuidesStroke:Bt(RN),treeInactiveIndentGuidesStroke:Bt(yVi),tableColumnsBorder:Bt(CVi),tableOddRowsBackgroundColor:Bt(wVi)};function IA(n){return oYi(n,Bk)}const uYi={selectBackground:Bt(Pv),selectListBackground:Bt(k7i),selectForeground:Bt(Fy),decoratorRightForeground:Bt(mqe),selectBorder:Bt($I),focusBorder:Bt(Kh),listFocusBackground:Bt(DE),listInactiveSelectionIconForeground:Bt(VI),listFocusForeground:Bt(LE),listFocusOutline:f7i(Ho,De.transparent.toString()),listHoverBackground:Bt(vqe),listHoverForeground:Bt(bqe),listHoverOutline:Bt(Ho),selectListBorder:Bt(Bv),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0},dYi={shadowColor:Bt(Ov),borderColor:Bt(kVi),foregroundColor:Bt(TVi),backgroundColor:Bt(IVi),selectionForegroundColor:Bt(LVi),selectionBackgroundColor:Bt(DVi),selectionBorderColor:Bt(AVi),separatorColor:Bt(RVi),scrollbarShadow:Bt(N7i),scrollbarSliderBackground:Bt(IN),scrollbarSliderHoverBackground:Bt(LN),scrollbarSliderActiveBackground:Bt(DN)};var Eq=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Sd=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},aGe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function hYi(n,e,t,i){const r=n.getActions(e),o=Oy.getInstance(),s=o.keyStatus.altKey||(vc||fu)&&o.keyStatus.shiftKey;cGe(r,t,s,i?a=>a===i:a=>a==="navigation")}function lGe(n,e,t,i,r,o){const s=n.getActions(e);cGe(s,t,!1,typeof i=="string"?l=>l===i:i,r,o)}function cGe(n,e,t,i=s=>s==="navigation",r=()=>!1,o=!1){let s,a;Array.isArray(e)?(s=e,a=e):(s=e.primary,a=e.secondary);const l=new Set;for(const[c,u]of n){let d;i(c)?(d=s,d.length>0&&o&&d.push(new El)):(d=a,d.length>0&&d.push(new El));for(let h of u){t&&(h=h instanceof qp&&h.alt?h.alt:h);const g=d.push(h);h instanceof YD&&l.add({group:c,action:h,index:g-1})}}for(const{group:c,action:u,index:d}of l){const h=i(c)?s:a,g=u.actions;r(u,c,h.length)&&h.splice(d,1,...g)}}let Vx=class extends f2{constructor(e,t,i,r,o,s,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t==null?void 0:t.draggable,keybinding:t==null?void 0:t.keybinding,hoverDelegate:t==null?void 0:t.hoverDelegate}),this._keybindingService=i,this._notificationService=r,this._contextKeyService=o,this._themeService=s,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Zl),this._altKey=Oy.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return aGe(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){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{var r;const o=!!(!((r=this._menuItemAction.alt)===null||r===void 0)&&r.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);o!==this._wantsAltCommand&&(this._wantsAltCommand=o,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(We(e,"mouseleave",r=>{t=!1,i()})),this._register(We(e,"mouseenter",r=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),i=t&&t.getLabel(),r=this._commandAction.tooltip||this._commandAction.label;let o=i?E("titleAndKb","{0} ({1})",r,i):r;if(!this._wantsAltCommand&&(!((e=this._menuItemAction.alt)===null||e===void 0)&&e.enabled)){const s=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?E("titleAndKb","{0} ({1})",s,l):s;o=E("titleAndKbAndAlt",`{0}
[{1}] {2}`,o,V_e.modifierLabels[qh].altKey,c)}return o}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const r=this._commandAction.checked&&nYi(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(r)if(In.isThemeIcon(r)){const o=In.asClassNameArray(r);i.classList.add(...o),this._itemClassDispose.value=Gn(()=>{i.classList.remove(...o)})}else{const o=i2(this._themeService.getColorTheme().type)?lw(r.dark):lw(r.light),s=at("span");s.style.webkitMask=s.style.mask=`${o} no-repeat 50% 50%`,s.style.background="var(--vscode-icon-foreground)",s.style.display="inline-block",s.style.width="100%",s.style.height="100%",i.appendChild(s),i.classList.add("icon"),this._itemClassDispose.value=Ip(Gn(()=>{i.classList.remove("icon"),Yl(i)}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}}};Vx=Eq([Sd(2,mo),Sd(3,ga),Sd(4,Yn),Sd(5,ll),Sd(6,om),Sd(7,N0)],Vx);let pae=class extends CH{constructor(e,t,i,r,o){var s,a,l;const c=Object.assign(Object.assign({},t),{menuAsChild:(s=t==null?void 0:t.menuAsChild)!==null&&s!==void 0?s:!1,classNames:(a=t==null?void 0:t.classNames)!==null&&a!==void 0?a:In.isThemeIcon(e.item.icon)?In.asClassName(e.item.icon):void 0,keybindingProvider:(l=t==null?void 0:t.keybindingProvider)!==null&&l!==void 0?l:u=>i.lookupKeybinding(u.id)});super(e,{getActions:()=>e.actions},r,c),this._keybindingService=i,this._contextMenuService=r,this._themeService=o}render(e){super.render(e),to(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!In.isThemeIcon(i)){this.element.classList.add("icon");const r=()=>{this.element&&(this.element.style.backgroundImage=i2(this._themeService.getColorTheme().type)?lw(i.dark):lw(i.light))};r(),this._register(this._themeService.onDidColorThemeChange(()=>{r()}))}}};pae=Eq([Sd(2,mo),Sd(3,om),Sd(4,ll)],pae);let mae=class extends Um{constructor(e,t,i,r,o,s,a,l){var c,u,d;super(null,e),this._keybindingService=i,this._notificationService=r,this._contextMenuService=o,this._menuService=s,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let h;const g=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;g&&(h=e.actions.find(m=>g===m.id)),h||(h=e.actions[0]),this._defaultAction=this._instaService.createInstance(Vx,h,{keybinding:this._getDefaultActionKeybindingLabel(h)});const p=Object.assign(Object.assign({keybindingProvider:m=>this._keybindingService.lookupKeybinding(m.id)},t),{menuAsChild:(c=t==null?void 0:t.menuAsChild)!==null&&c!==void 0?c:!0,classNames:(u=t==null?void 0:t.classNames)!==null&&u!==void 0?u:["codicon","codicon-chevron-down"],actionRunner:(d=t==null?void 0:t.actionRunner)!==null&&d!==void 0?d:new GD});this._dropdown=new CH(e,e.actions,this._contextMenuService,p),this._dropdown.actionRunner.onDidRun(m=>{m.action instanceof qp&&this.update(m.action)})}update(e){var t;!((t=this._options)===null||t===void 0)&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(Vx,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends GD{runAction(i,r){return aGe(this,void 0,void 0,function*(){yield i.run(void 0)})}},this._container&&this._defaultAction.render(kUe(this._container,at(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let i;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const r=this._keybindingService.lookupKeybinding(e.id);r&&(i=`(${r.getLabel()})`)}return i}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=at(".action-container");this._defaultAction.render(Ge(this._container,t)),this._register(We(t,Lt.KEY_DOWN,r=>{const o=new Oo(r);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=at(".dropdown-action-container");this._dropdown.render(Ge(this._container,i)),this._register(We(i,Lt.KEY_DOWN,r=>{var o;const s=new Oo(r);s.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(o=this._defaultAction.element)===null||o===void 0||o.focus(),s.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()}};mae=Eq([Sd(2,mo),Sd(3,ga),Sd(4,om),Sd(5,kb),Sd(6,Un),Sd(7,am)],mae);let _ae=class extends JGi{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===El.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,uYi,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=Bt($I)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};_ae=Eq([Sd(1,O0)],_ae);function fYi(n,e,t){return e instanceof qp?n.createInstance(Vx,e,t):e instanceof kM?e.item.isSelection?n.createInstance(_ae,e):e.item.rememberDefaultAction?n.createInstance(mae,e,Object.assign(Object.assign({},t),{persistLastActionId:!0})):n.createInstance(pae,e,t):void 0}var gYi=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Ig extends Ae{constructor(e,t={}){var i,r,o,s,a,l;super(),this._actionRunnerDisposables=this._register(new nt),this.viewItemDisposables=this._register(new wme),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new be),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new be({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new be),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new be),this.onWillRun=this._onWillRun.event,this.options=t,this._context=(i=t.context)!==null&&i!==void 0?i:null,this._orientation=(r=this.options.orientation)!==null&&r!==void 0?r:0,this._triggerKeys={keyDown:(s=(o=this.options.triggerKeys)===null||o===void 0?void 0:o.keyDown)!==null&&s!==void 0?s:!1,keys:(l=(a=this.options.triggerKeys)===null||a===void 0?void 0:a.keys)!==null&&l!==void 0?l:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new GD,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(d=>this._onDidRun.fire(d))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(d=>this._onWillRun.fire(d))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",t.animated!==!1&&this.domNode.classList.add("animated");let c,u;switch(this._orientation){case 0:c=[15],u=[17];break;case 1:c=[16],u=[18],this.domNode.className+=" vertical";break}this._register(We(this.domNode,Lt.KEY_DOWN,d=>{const h=new Oo(d);let g=!0;const p=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;c&&(h.equals(c[0])||h.equals(c[1]))?g=this.focusPrevious():u&&(h.equals(u[0])||h.equals(u[1]))?g=this.focusNext():h.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():h.equals(14)?g=this.focusFirst():h.equals(13)?g=this.focusLast():h.equals(2)&&p instanceof Um&&p.trapsArrowNavigation?g=this.focusNext():this.isTriggerKeyEvent(h)?this._triggerKeys.keyDown?this.doTrigger(h):this.triggerKeyDown=!0:g=!1,g&&(h.preventDefault(),h.stopPropagation())})),this._register(We(this.domNode,Lt.KEY_UP,d=>{const h=new Oo(d);this.isTriggerKeyEvent(h)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(h)),h.preventDefault(),h.stopPropagation()):(h.equals(2)||h.equals(1026))&&this.updateFocusedItem()})),this.focusTracker=this._register(lb(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(Lp()===this.domNode||!gc(Lp(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"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",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(i=>i instanceof Um&&i.isEnabled());t instanceof Um&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof Um&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;e<this.actionsList.children.length;e++){const t=this.actionsList.children[e];if(gc(Lp(),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){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){var t;if(typeof e=="number")return(t=this.viewItems[e])===null||t===void 0?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let i=0;i<this.actionsList.childNodes.length;i++)if(this.actionsList.childNodes[i]===e)return this.viewItems[i].action}}push(e,t={}){const i=Array.isArray(e)?e:[e];let r=ow(t.index)?t.index:null;i.forEach(o=>{const s=document.createElement("li");s.className="action-item",s.setAttribute("role","presentation");let a;const l=Object.assign({hoverDelegate:this.options.hoverDelegate},t);this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,l)),a||(a=new f2(this.context,o,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,We(s,Lt.CONTEXT_MENU,c=>{yi.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(s),this.focusable&&a instanceof Um&&this.viewItems.length===0&&a.setFocusable(!0),r===null||r<0||r>=this.actionsList.children.length?(this.actionsList.appendChild(s),this.viewItems.push(a)):(this.actionsList.insertBefore(s,this.actionsList.children[r]),this.viewItems.splice(r,0,a),r++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=Hr(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),Gl(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}focus(e){let t=!1,i;if(e===void 0?t=!0:typeof e=="number"?i=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem>"u"){const r=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=r===-1?void 0:r,this.updateFocus(void 0,void 0,!0)}else i!==void 0&&(this.focusedItem=i),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(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;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,i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===El.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;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}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===El.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var r;typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((r=this.viewItems[this.previouslyFocusedItem])===null||r===void 0||r.blur());const o=this.focusedItem!==void 0&&this.viewItems[this.focusedItem];if(o){let s=!0;_M(o.focus)||(s=!1),this.options.focusOnlyEnabledItems&&_M(o.isEnabled)&&!o.isEnabled()&&(s=!1),o.action.id===El.ID&&(s=!1),s?(i||this.previouslyFocusedItem!==this.focusedItem)&&(o.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0)}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof Um){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}run(e,t){return gYi(this,void 0,void 0,function*(){yield this._actionRunner.run(e,t)})}dispose(){this._context=void 0,this.viewItems=Hr(this.viewItems),this.getContainer().remove(),super.dispose()}}const vae=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,tJ=/(&amp;)?(&amp;)([^\s&])/g;var xH;(function(n){n[n.Right=0]="Right",n[n.Left=1]="Left"})(xH||(xH={}));class jL extends Ig{constructor(e,t,i,r){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:l=>this.doGetActionViewItem(l,i,s),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...Qi||fu?[10]:[]],keyDown:!0}}),this.menuStyles=r,this.menuElement=o,this.actionsList.tabIndex=0,this.menuDisposables=this._register(new nt),this.initializeOrUpdateStyleSheet(e,r),this._register(bo.addTarget(o)),We(o,Lt.KEY_DOWN,l=>{new Oo(l).equals(2)&&l.preventDefault()}),i.enableMnemonics&&this.menuDisposables.add(We(o,Lt.KEY_DOWN,l=>{const c=l.key.toLocaleLowerCase();if(this.mnemonics.has(c)){yi.stop(l,!0);const u=this.mnemonics.get(c);if(u.length===1&&(u[0]instanceof gAe&&u[0].container&&this.focusItemByElement(u[0].container),u[0].onClick(l)),u.length>1){const d=u.shift();d&&d.container&&(this.focusItemByElement(d.container),u.push(d)),this.mnemonics.set(c,u)}}})),fu&&this._register(We(o,Lt.KEY_DOWN,l=>{const c=new Oo(l);c.equals(14)||c.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),yi.stop(l,!0)):(c.equals(13)||c.equals(12))&&(this.focusedItem=0,this.focusPrevious(),yi.stop(l,!0))})),this._register(We(this.domNode,Lt.MOUSE_OUT,l=>{const c=l.relatedTarget;gc(c,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),l.stopPropagation())})),this._register(We(this.actionsList,Lt.MOUSE_OVER,l=>{let c=l.target;if(!(!c||!gc(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const u=this.focusedItem;this.setFocusedItem(c),u!==this.focusedItem&&this.updateFocus()}}})),this._register(bo.addTarget(this.actionsList)),this._register(We(this.actionsList,yo.Tap,l=>{let c=l.initialTarget;if(!(!c||!gc(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const u=this.focusedItem;this.setFocusedItem(c),u!==this.focusedItem&&this.updateFocus()}}}));const s={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new S5(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,r),this._register(We(o,yo.Change,l=>{yi.stop(l,!0);const c=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:c-l.translationY})})),this._register(We(a,Lt.MOUSE_UP,l=>{l.preventDefault()})),o.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter(l=>{var c;return!((c=i.submenuIds)===null||c===void 0)&&c.has(l.id)?(console.warn(`Found submenu cycle: ${l.id}`),!1):!0}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(l=>!(l instanceof pAe)).forEach((l,c,u)=>{l.updatePositionInSet(c+1,u.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(OV(e)?this.styleSheet=Eg(e):(jL.globalStyleSheet||(jL.globalStyleSheet=Eg()),this.styleSheet=jL.globalStyleSheet)),this.styleSheet.textContent=mYi(t,OV(e))}styleScrollElement(e,t){var i,r;const o=(i=t.foregroundColor)!==null&&i!==void 0?i:"",s=(r=t.backgroundColor)!==null&&r!==void 0?r:"",a=t.borderColor?`1px solid ${t.borderColor}`:"",l="5px",c=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=a,e.style.borderRadius=l,e.style.color=o,e.style.backgroundColor=s,e.style.boxShadow=c}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++){const i=this.actionsList.children[t];if(e===i){this.focusedItem=t;break}}}updateFocus(e){super.updateFocus(e,!0,!0),typeof this.focusedItem<"u"&&this.scrollableElement.setScrollPosition({scrollTop:Math.round(this.menuElement.scrollTop)})}doGetActionViewItem(e,t,i){if(e instanceof El)return new pAe(t.context,e,{icon:!0},this.menuStyles);if(e instanceof YD){const r=new gAe(e,e.actions,i,Object.assign(Object.assign({},t),{submenuIds:new Set([...t.submenuIds||[],e.id])}),this.menuStyles);if(t.enableMnemonics){const o=r.getMnemonic();if(o&&r.isEnabled()){let s=[];this.mnemonics.has(o)&&(s=this.mnemonics.get(o)),s.push(r),this.mnemonics.set(o,s)}}return r}else{const r={enableMnemonics:t.enableMnemonics,useEventAsContext:t.useEventAsContext};if(t.getKeyBinding){const s=t.getKeyBinding(e);if(s){const a=s.getLabel();a&&(r.keybinding=a)}}const o=new uGe(t.context,e,r,this.menuStyles);if(t.enableMnemonics){const s=o.getMnemonic();if(s&&o.isEnabled()){let a=[];this.mnemonics.has(s)&&(a=this.mnemonics.get(s)),a.push(o),this.mnemonics.set(s,a)}}return o}}}class uGe extends Um{constructor(e,t,i,r){if(i.isMenu=!0,super(t,t,i),this.menuStyle=r,this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass="",this.options.label&&i.enableMnemonics){const o=this.action.label;if(o){const s=vae.exec(o);s&&(this.mnemonic=(s[1]?s[1]:s[3]).toLocaleLowerCase())}}this.runOnceToEnableMouseUp=new so(()=>{this.element&&(this._register(We(this.element,Lt.MOUSE_UP,o=>{if(yi.stop(o,!0),wg){if(new og(o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(We(this.element,Lt.CONTEXT_MENU,o=>{yi.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=Ge(this.element,at("a.action-menu-item")),this._action.id===El.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=Ge(this.item,at("span.menu-item-check"+In.asCSSSelector(Ct.menuSelection))),this.check.setAttribute("role","none"),this.label=Ge(this.item,at("span.action-label")),this.options.label&&this.options.keybinding&&(Ge(this.item,at("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),(e=this.item)===null||e===void 0||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){Gl(this.label);let t=G_e(this.action.label);if(t){const i=pYi(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const r=vae.exec(t);if(r){t=LV(t),tJ.lastIndex=0;let o=tJ.exec(t);for(;o&&o[1];)o=tJ.exec(t);const s=a=>a.replace(/&amp;&amp;/g,"&amp;");o?this.label.append(d5(s(t.substr(0,o.index))," "),at("u",{"aria-hidden":"true"},o[3]),Xje(s(t.substr(o.index+o[0].length))," ")):this.label.innerText=s(t).trim(),(e=this.item)===null||e===void 0||e.setAttribute("aria-keyshortcuts",(r[1]?r[1]:r[3]).toLocaleLowerCase())}else this.label.innerText=t.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.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.action.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.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(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(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,r=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=r,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class gAe extends uGe{constructor(e,t,i,r,o){super(e,e,r,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=r,this.mysubmenu=null,this.submenuDisposables=this._register(new nt),this.mouseOver=!1,this.expandDirection=r&&r.expandDirection!==void 0?r.expandDirection:xH.Right,this.showScheduler=new so(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new so(()=>{this.element&&!gc(Lp(),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=Ge(this.item,at("span.submenu-indicator"+In.asCSSSelector(Ct.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(We(this.element,Lt.KEY_UP,t=>{const i=new Oo(t);(i.equals(17)||i.equals(3))&&(yi.stop(t,!0),this.createSubmenu(!0))})),this._register(We(this.element,Lt.KEY_DOWN,t=>{const i=new Oo(t);Lp()===this.item&&(i.equals(17)||i.equals(3))&&yi.stop(t,!0)})),this._register(We(this.element,Lt.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(We(this.element,Lt.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(We(this.element,Lt.FOCUS_OUT,t=>{this.element&&!gc(Lp(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(e){yi.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{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,r){const o={top:0,left:0};return o.left=YI(e.width,t.width,{position:r===xH.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left<i.left+i.width&&(i.left+10+t.width<=e.width&&(o.left=i.left+10),i.top+=10,i.height=0),o.top=YI(e.height,t.height,{position:0,offset:i.top,size:0}),o.top+t.height===i.top&&o.top+i.height+t.height<=e.height&&(o.top+=i.height),o}createSubmenu(e=!0){if(this.element)if(this.parentData.submenu)this.parentData.submenu.focus(!1);else{this.updateAriaExpanded("true"),this.submenuContainer=Ge(this.element,at("div.monaco-submenu")),this.submenuContainer.classList.add("menubar-menu-items-holder","context-view");const t=getComputedStyle(this.parentData.parent.domNode),i=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 jL(this.submenuContainer,this.submenuActions.length?this.submenuActions:[new AU],this.submenuOptions,this.menuStyle);const r=this.element.getBoundingClientRect(),o={top:r.top-i,left:r.left,height:r.height+2*i,width:r.width},s=this.submenuContainer.getBoundingClientRect(),{top:a,left:l}=this.calculateSubmenuMenuLayout(new vr(window.innerWidth,window.innerHeight),vr.lift(s),o,this.expandDirection);this.submenuContainer.style.left=`${l-s.left}px`,this.submenuContainer.style.top=`${a-s.top}px`,this.submenuDisposables.add(We(this.submenuContainer,Lt.KEY_UP,c=>{new Oo(c).equals(15)&&(yi.stop(c,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(We(this.submenuContainer,Lt.KEY_DOWN,c=>{new Oo(c).equals(15)&&yi.stop(c,!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&&((t=this.item)===null||t===void 0||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class pAe extends f2{constructor(e,t,i,r){super(e,t,i),this.menuStyles=r}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function pYi(n){const e=vae,t=e.exec(n);if(!t)return n;const i=!t[1];return n.replace(e,i?"$2$3":"").trim()}function mAe(n){const e=Kje()[n.id];return`.codicon-${n.id}:before { content: '\\${e.toString(16)}'; }`}function mYi(n,e){let t=`
.monaco-menu {
font-size: 13px;
border-radius: 5px;
min-width: 160px;
}
${mAe(Ct.menuSelection)}
${mAe(Ct.menuSubmenu)}
.monaco-menu .monaco-action-bar {
text-align: right;
overflow: hidden;
white-space: nowrap;
}
.monaco-menu .monaco-action-bar .actions-container {
display: flex;
margin: 0 auto;
padding: 0;
width: 100%;
justify-content: flex-end;
}
.monaco-menu .monaco-action-bar.vertical .actions-container {
display: inline-block;
}
.monaco-menu .monaco-action-bar.reverse .actions-container {
flex-direction: row-reverse;
}
.monaco-menu .monaco-action-bar .action-item {
cursor: pointer;
display: inline-block;
transition: transform 50ms ease;
position: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */
}
.monaco-menu .monaco-action-bar .action-item.disabled {
cursor: default;
}
.monaco-menu .monaco-action-bar.animated .action-item.active {
transform: scale(1.272019649, 1.272019649); /* 1.272019649 = √φ */
}
.monaco-menu .monaco-action-bar .action-item .icon,
.monaco-menu .monaco-action-bar .action-item .codicon {
display: inline-block;
}
.monaco-menu .monaco-action-bar .action-item .codicon {
display: flex;
align-items: center;
}
.monaco-menu .monaco-action-bar .action-label {
font-size: 11px;
margin-right: 4px;
}
.monaco-menu .monaco-action-bar .action-item.disabled .action-label,
.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {
color: var(--vscode-disabledForeground);
}
/* Vertical actions */
.monaco-menu .monaco-action-bar.vertical {
text-align: left;
}
.monaco-menu .monaco-action-bar.vertical .action-item {
display: block;
}
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
display: block;
border-bottom: 1px solid var(--vscode-menu-separatorBackground);
padding-top: 1px;
padding: 30px;
}
.monaco-menu .secondary-actions .monaco-action-bar .action-label {
margin-left: 6px;
}
/* Action Items */
.monaco-menu .monaco-action-bar .action-item.select-container {
overflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */
flex: 1;
max-width: 170px;
min-width: 60px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 10px;
}
.monaco-menu .monaco-action-bar.vertical {
margin-left: 0;
overflow: visible;
}
.monaco-menu .monaco-action-bar.vertical .actions-container {
display: block;
}
.monaco-menu .monaco-action-bar.vertical .action-item {
padding: 0;
transform: none;
display: flex;
}
.monaco-menu .monaco-action-bar.vertical .action-item.active {
transform: none;
}
.monaco-menu .monaco-action-bar.vertical .action-menu-item {
flex: 1 1 auto;
display: flex;
height: 2em;
align-items: center;
position: relative;
margin: 0 4px;
border-radius: 4px;
}
.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,
.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {
opacity: unset;
}
.monaco-menu .monaco-action-bar.vertical .action-label {
flex: 1 1 auto;
text-decoration: none;
padding: 0 1em;
background: none;
font-size: 12px;
line-height: 1;
}
.monaco-menu .monaco-action-bar.vertical .keybinding,
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
display: inline-block;
flex: 2 1 auto;
padding: 0 1em;
text-align: right;
font-size: 12px;
line-height: 1;
}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
height: 100%;
}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {
font-size: 16px !important;
display: flex;
align-items: center;
}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {
margin-left: auto;
margin-right: -20px;
}
.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,
.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {
opacity: 0.4;
}
.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {
display: inline-block;
box-sizing: border-box;
margin: 0;
}
.monaco-menu .monaco-action-bar.vertical .action-item {
position: static;
overflow: visible;
}
.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {
position: absolute;
}
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
width: 100%;
height: 0px !important;
opacity: 1;
}
.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {
padding: 0.7em 1em 0.1em 1em;
font-weight: bold;
opacity: 1;
}
.monaco-menu .monaco-action-bar.vertical .action-label:hover {
color: inherit;
}
.monaco-menu .monaco-action-bar.vertical .menu-item-check {
position: absolute;
visibility: hidden;
width: 1em;
height: 100%;
}
.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {
visibility: visible;
display: flex;
align-items: center;
justify-content: center;
}
/* Context Menu */
.context-view.monaco-menu-container {
outline: 0;
border: none;
animation: fadeIn 0.083s linear;
-webkit-app-region: no-drag;
}
.context-view.monaco-menu-container :focus,
.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,
.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {
outline: 0;
}
.hc-black .context-view.monaco-menu-container,
.hc-light .context-view.monaco-menu-container,
:host-context(.hc-black) .context-view.monaco-menu-container,
:host-context(.hc-light) .context-view.monaco-menu-container {
box-shadow: none;
}
.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,
.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,
:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,
:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {
background: none;
}
/* Vertical Action Bar Styles */
.monaco-menu .monaco-action-bar.vertical {
padding: 4px 0;
}
.monaco-menu .monaco-action-bar.vertical .action-menu-item {
height: 2em;
}
.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),
.monaco-menu .monaco-action-bar.vertical .keybinding {
font-size: inherit;
padding: 0 2em;
}
.monaco-menu .monaco-action-bar.vertical .menu-item-check {
font-size: inherit;
width: 2em;
}
.monaco-menu .monaco-action-bar.vertical .action-label.separator {
font-size: inherit;
margin: 5px 0 !important;
padding: 0;
border-radius: 0;
}
.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,
:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {
margin-left: 0;
margin-right: 0;
}
.monaco-menu .monaco-action-bar.vertical .submenu-indicator {
font-size: 60%;
padding: 0 1.8em;
}
.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator,
:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {
height: 100%;
mask-size: 10px 10px;
-webkit-mask-size: 10px 10px;
}
.monaco-menu .action-item {
cursor: default;
}`;if(e){t+=`
/* Arrows */
.monaco-scrollable-element > .scrollbar > .scra {
cursor: pointer;
font-size: 11px !important;
}
.monaco-scrollable-element > .visible {
opacity: 1;
/* Background rule added for IE9 - to allow clicks on dom node */
background:rgba(0,0,0,0);
transition: opacity 100ms linear;
}
.monaco-scrollable-element > .invisible {
opacity: 0;
pointer-events: none;
}
.monaco-scrollable-element > .invisible.fade {
transition: opacity 800ms linear;
}
/* Scrollable Content Inset Shadow */
.monaco-scrollable-element > .shadow {
position: absolute;
display: none;
}
.monaco-scrollable-element > .shadow.top {
display: block;
top: 0;
left: 3px;
height: 3px;
width: 100%;
}
.monaco-scrollable-element > .shadow.left {
display: block;
top: 3px;
left: 0;
height: 100%;
width: 3px;
}
.monaco-scrollable-element > .shadow.top-left-corner {
display: block;
top: 0;
left: 0;
height: 3px;
width: 3px;
}
`;const i=n.scrollbarShadow;i&&(t+=`
.monaco-scrollable-element > .shadow.top {
box-shadow: ${i} 0 6px 6px -6px inset;
}
.monaco-scrollable-element > .shadow.left {
box-shadow: ${i} 6px 0 6px -6px inset;
}
.monaco-scrollable-element > .shadow.top.left {
box-shadow: ${i} 6px 6px 6px -6px inset;
}
`);const r=n.scrollbarSliderBackground;r&&(t+=`
.monaco-scrollable-element > .scrollbar > .slider {
background: ${r};
}
`);const o=n.scrollbarSliderHoverBackground;o&&(t+=`
.monaco-scrollable-element > .scrollbar > .slider:hover {
background: ${o};
}
`);const s=n.scrollbarSliderActiveBackground;s&&(t+=`
.monaco-scrollable-element > .scrollbar > .slider.active {
background: ${s};
}
`)}return t}class _Yi{constructor(e,t,i,r){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=r,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=document.activeElement;let i;const r=Hme(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{var s;this.lastContainer=o;const a=e.getMenuClassName?e.getMenuClassName():"";a&&(o.className+=" "+a),this.options.blockMouse&&(this.block=o.appendChild(at(".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",(s=this.blockDisposable)===null||s===void 0||s.dispose(),this.blockDisposable=We(this.block,Lt.MOUSE_DOWN,u=>u.stopPropagation()));const l=new nt,c=e.actionRunner||new GD;return c.onWillRun(u=>this.onActionRun(u,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),i=new jL(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:u=>this.keybindingService.lookupKeybinding(u.id)},dYi),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l),l.add(We(window,Lt.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(We(window,Lt.MOUSE_DOWN,u=>{if(u.defaultPrevented)return;const d=new og(u);let h=d.target;if(!d.rightButton){for(;h;){if(h===o)return;h=h.parentElement}this.contextViewService.hideContextView(!0)}})),Ip(l,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:o=>{var s,a,l;(s=e.onHide)===null||s===void 0||s.call(e,!!o),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,this.lastContainer&&(Lp()===this.lastContainer||gc(Lp(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||l.focus()),this.lastContainer=null}},r,!!r)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!R_(e.error)&&this.notificationService.error(e.error)}}var vYi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},$T=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let bae=class extends Ae{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new _Yi(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,r,o,s){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=r,this.menuService=o,this.contextKeyService=s,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new be),this._onDidHideContextMenu=this._store.add(new be)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=yae.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu(Object.assign(Object.assign({},e),{onHide:t=>{var i;(i=e.onHide)===null||i===void 0||i.call(e,t),this._onDidHideContextMenu.fire()}})),Oy.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};bae=vYi([$T(0,wf),$T(1,ga),$T(2,O0),$T(3,mo),$T(4,kb),$T(5,Yn)],bae);var yae;(function(n){function e(i){return i&&i.menuId instanceof J}function t(i,r,o){if(!e(i))return i;const{menuId:s,menuActionOptions:a,contextKeyService:l}=i;return Object.assign(Object.assign({},i),{getActions:()=>{const c=[];if(s){const u=r.createMenu(s,l??o);hYi(u,a,c),u.dispose()}return i.getActions?El.join(i.getActions(),c):c}})}n.transform=t})(yae||(yae={}));var kH;(function(n){n[n.API=0]="API",n[n.USER=1]="USER"})(kH||(kH={}));var Z_e=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},TH=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},hE=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let Cae=class{constructor(e){this._commandService=e}open(e,t){return hE(this,void 0,void 0,function*(){if(!F_e(e,Si.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=Tn.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=uae(decodeURIComponent(e.query))}catch{try{i=uae(e.query)}catch{}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0})}};Cae=Z_e([TH(0,Fs)],Cae);let wae=class{constructor(e){this._editorService=e}open(e,t){return hE(this,void 0,void 0,function*(){typeof e=="string"&&(e=Tn.parse(e));const{selection:i,uri:r}=wqi(e);return e=r,e.scheme===Si.file&&(e=rji(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,source:t!=null&&t.fromUserGesture?kH.USER:kH.API},t==null?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0})}};wae=Z_e([TH(0,Lr)],wae);let Sae=class{constructor(e,t){this._openers=new Hu,this._validators=new Hu,this._resolvers=new Hu,this._resolvedUriTargets=new Rc(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new Hu,this._defaultExternalOpener={openExternal:i=>hE(this,void 0,void 0,function*(){return H2e(i,Si.http,Si.https)?IUe(i):window.location.href=i,!0})},this._openers.push({open:(i,r)=>hE(this,void 0,void 0,function*(){return r!=null&&r.openExternal||H2e(i,Si.mailto,Si.http,Si.https,Si.vsls)?(yield this._doOpenExternal(i,r),!0):!1})}),this._openers.push(new Cae(t)),this._openers.push(new wae(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}open(e,t){var i;return hE(this,void 0,void 0,function*(){const r=typeof e=="string"?Tn.parse(e):e,o=(i=this._resolvedUriTargets.get(r))!==null&&i!==void 0?i:e;for(const s of this._validators)if(!(yield s.shouldOpen(o,t)))return!1;for(const s of this._openers)if(yield s.open(e,t))return!0;return!1})}resolveExternalUri(e,t){return hE(this,void 0,void 0,function*(){for(const i of this._resolvers)try{const r=yield i.resolveExternalUri(e,t);if(r)return this._resolvedUriTargets.has(r.resolved)||this._resolvedUriTargets.set(r.resolved,e),r}catch{}throw new Error("Could not resolve external URI: "+e.toString())})}_doOpenExternal(e,t){return hE(this,void 0,void 0,function*(){const i=typeof e=="string"?Tn.parse(e):e;let r;try{r=(yield this.resolveExternalUri(i,t)).resolved}catch{r=i}let o;if(typeof e=="string"&&i.toString()===r.toString()?o=e:o=encodeURI(r.toString(!0)),t!=null&&t.allowContributedOpeners){const s=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(yield a.openExternal(o,{sourceUri:i,preferredOpenerId:s},Mi.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},Mi.None)})}dispose(){this._validators.clear()}};Sae=Z_e([TH(0,Lr),TH(1,Fs)],Sae);const lm=Vi("editorWorkerService");var vs;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(vs||(vs={}));(function(n){function e(s,a){return a-s}n.compare=e;const t=Object.create(null);t[n.Error]=E("sev.error","Error"),t[n.Warning]=E("sev.warning","Warning"),t[n.Info]=E("sev.info","Info");function i(s){return t[s]||""}n.toString=i;function r(s){switch(s){case js.Error:return n.Error;case js.Warning:return n.Warning;case js.Info:return n.Info;case js.Ignore:return n.Hint}}n.fromSeverity=r;function o(s){switch(s){case n.Error:return js.Error;case n.Warning:return js.Warning;case n.Info:return js.Info;case n.Hint:return js.Ignore}}n.toSeverity=o})(vs||(vs={}));var IH;(function(n){const e="";function t(r){return i(r,!0)}n.makeKey=t;function i(r,o){const s=[e];return r.source?s.push(r.source.replace("¦","\\¦")):s.push(e),r.code?typeof r.code=="string"?s.push(r.code.replace("¦","\\¦")):s.push(r.code.value.replace("¦","\\¦")):s.push(e),r.severity!==void 0&&r.severity!==null?s.push(vs.toString(r.severity)):s.push(e),r.message&&o?s.push(r.message.replace("¦","\\¦")):s.push(e),r.startLineNumber!==void 0&&r.startLineNumber!==null?s.push(r.startLineNumber.toString()):s.push(e),r.startColumn!==void 0&&r.startColumn!==null?s.push(r.startColumn.toString()):s.push(e),r.endLineNumber!==void 0&&r.endLineNumber!==null?s.push(r.endLineNumber.toString()):s.push(e),r.endColumn!==void 0&&r.endColumn!==null?s.push(r.endColumn.toString()):s.push(e),s.push(e),s.join("¦")}n.makeKeyOptionalMessage=i})(IH||(IH={}));const Lb=Vi("markerService");function bYi(n,e){const t=[],i=[];for(const r of n)e.has(r)||t.push(r);for(const r of e)n.has(r)||i.push(r);return{removed:t,added:i}}function yYi(n,e){const t=new Set;for(const i of e)n.has(i)&&t.add(i);return t}var CYi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_Ae=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Eae=class extends Ae{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new be),this._markerDecorations=new Rc,e.getModels().forEach(i=>this._onModelAdded(i)),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 i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new wYi(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const i=this._markerDecorations.get(e.uri);i&&(i.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===Si.inMemory||e.uri.scheme===Si.internal||e.uri.scheme===Si.vscode)&&((t=this._markerService)===null||t===void 0||t.read({resource:e.uri}).map(r=>r.owner).forEach(r=>this._markerService.remove(r,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};Eae=CYi([_Ae(0,ts),_Ae(1,Lb)],Eae);class wYi extends Ae{constructor(e){super(),this.model=e,this._map=new r9i,this._register(Gn(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=bYi(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const r=i.map(a=>this._map.get(a)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),s=this.model.deltaDecorations(r,o);for(const a of i)this._map.delete(a);for(let a=0;a<s.length;a++)this._map.set(t[a],s[a]);return!0}getMarker(e){return this._map.getKey(e.id)}_createDecorationRange(e,t){let i=q.lift(t);if(t.severity===vs.Hint&&!this._hasMarkerTag(t,1)&&!this._hasMarkerTag(t,2)&&(i=i.setEndPosition(i.startLineNumber,i.startColumn+2)),i=e.validateRange(i),i.isEmpty()){const r=e.getLineLastNonWhitespaceColumn(i.startLineNumber)||e.getLineMaxColumn(i.startLineNumber);if(r===1||i.endColumn>=r)return i;const o=e.getWordAtPosition(i.getStartPosition());o&&(i=new q(i.startLineNumber,o.startColumn,i.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const r=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);r<i.endColumn&&(i=new q(i.startLineNumber,r,i.endLineNumber,i.endColumn),t.startColumn=r)}return i}_createDecorationOption(e){let t,i,r,o,s;switch(e.severity){case vs.Hint:this._hasMarkerTag(e,2)?t=void 0:this._hasMarkerTag(e,1)?t="squiggly-unnecessary":t="squiggly-hint",r=0;break;case vs.Info:t="squiggly-info",i=ms(XHi),r=10,s={color:ms(MVi),position:rh.Inline};break;case vs.Warning:t="squiggly-warning",i=ms(QHi),r=20,s={color:ms(FVi),position:rh.Inline};break;case vs.Error:default:t="squiggly-error",i=ms(YHi),r=30,s={color:ms(BVi),position:rh.Inline};break}return e.tags&&(e.tags.indexOf(1)!==-1&&(o="squiggly-inline-unnecessary"),e.tags.indexOf(2)!==-1&&(o="squiggly-inline-deprecated")),{description:"marker-decoration",stickiness:1,className:t,showIfCollapsed:!0,overviewRuler:{color:i,position:ff.Right},minimap:s,zIndex:r,inlineClassName:o}}_hasMarkerTag(e,t){return e.tags?e.tags.indexOf(t)>=0:!1}}var SYi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},KR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},iI;function IS(n){return n.toString()}class EYi{constructor(e,t,i){this.model=e,this._modelEventListeners=new nt,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(r=>i(e,r)))}dispose(){this._modelEventListeners.dispose()}}const xYi=fu||Qi?1:2;class kYi{constructor(e,t,i,r,o,s,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=r,this.heapSize=o,this.sha1=s,this.versionId=a,this.alternativeVersionId=l}}let LH=iI=class extends Ae{constructor(e,t,i,r,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=r,this._languageConfigurationService=o,this._onModelAdded=this._register(new be),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new be),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new be),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(s=>this._updateModelOptions(s))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var i;let r=Ac.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const g=parseInt(e.editor.tabSize,10);isNaN(g)||(r=g),r<1&&(r=1)}let o="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const g=parseInt(e.editor.indentSize,10);isNaN(g)||(o=Math.max(g,1))}let s=Ac.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(s=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let a=xYi;const l=e.eol;l===`\r
`?a=2:l===`
`&&(a=1);let c=Ac.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let u=Ac.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(u=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=Ac.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=Ac.bracketPairColorizationOptions;return!((i=e.editor)===null||i===void 0)&&i.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:r,indentSize:o,insertSpaces:s,detectIndentation:u,defaultEOL:a,trimAutoWhitespace:c,largeFileOptimizations:d,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:qh===3||qh===2?`
`:`\r
`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const r=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[r+t];if(!o){const s=this._configurationService.getValue("editor",{overrideIdentifier:r,resource:t}),a=this._getEOL(t,r);o=iI._readModelOptions({editor:s,eol:a},i),this._modelCreationOptionsByLanguageAndResource[r+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let r=0,o=i.length;r<o;r++){const s=i[r],a=this._models[s],l=a.model.getLanguageId(),c=a.model.uri;if(e&&!e.affectsConfiguration("editor",{overrideIdentifier:l,resource:c})&&!e.affectsConfiguration("files.eol",{overrideIdentifier:l,resource:c}))continue;const u=t[l+c],d=this.getCreationOptions(l,c,a.model.isForSimpleWidget);iI._setModelOptionsForModel(a.model,d,u)}}static _setModelOptionsForModel(e,t,i){i&&i.defaultEOL!==t.defaultEOL&&e.getLineCount()===1&&e.setEOL(t.defaultEOL===1?0:1),!(i&&i.detectIndentation===t.detectIndentation&&i.insertSpaces===t.insertSpaces&&i.tabSize===t.tabSize&&i.indentSize===t.indentSize&&i.trimAutoWhitespace===t.trimAutoWhitespace&&tf(i.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(IS(e.uri),e),this._disposedModelsHeapSize+=e.heapSize}_removeDisposedModel(e){const t=this._disposedModels.get(IS(e));return t&&(this._disposedModelsHeapSize-=t.heapSize),this._disposedModels.delete(IS(e)),t}_ensureDisposedModelsHeapSize(e){if(this._disposedModelsHeapSize>e){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,r)=>i.time-r.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,r){const o=this.getCreationOptions(t,i,r),s=new hb(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(IS(i))){const c=this._removeDisposedModel(i),u=this._undoRedoService.getElements(i),d=this._getSHA1Computer(),h=d.canComputeSHA1(s)?d.computeSHA1(s)===c.sha1:!1;if(h||c.sharesUndoRedoStack){for(const g of u.past)_y(g)&&g.matchesResource(i)&&g.setModel(s);for(const g of u.future)_y(g)&&g.matchesResource(i)&&g.setModel(s);this._undoRedoService.setElementsValidFlag(i,!0,g=>_y(g)&&g.matchesResource(i)),h&&(s._overwriteVersionId(c.versionId),s._overwriteAlternativeVersionId(c.alternativeVersionId),s._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=IS(s.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new EYi(s,c=>this._onWillDispose(c),(c,u)=>this._onDidChangeLanguage(c,u));return this._models[a]=l,l}createModel(e,t,i,r=!1){let o;return t?o=this._createModelData(e,t,i,r):o=this._createModelData(e,nf,i,r),this._onModelAdded.fire(o.model),o.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,r=t.length;i<r;i++){const o=t[i];e.push(this._models[o].model)}return e}getModel(e){const t=IS(e),i=this._models[t];return i?i.model:null}_schemaShouldMaintainUndoRedoElements(e){return e.scheme===Si.file||e.scheme===Si.vscodeRemote||e.scheme===Si.vscodeUserData||e.scheme===Si.vscodeNotebookCell||e.scheme==="fake-fs"}_onWillDispose(e){const t=IS(e.uri),i=this._models[t],r=this._undoRedoService.getUriComparisonKey(e.uri)!==e.uri.toString();let o=!1,s=0;if(r||this._shouldRestoreUndoStack()&&this._schemaShouldMaintainUndoRedoElements(e.uri)){const c=this._undoRedoService.getElements(e.uri);if(c.past.length>0||c.future.length>0){for(const u of c.past)_y(u)&&u.matchesResource(e.uri)&&(o=!0,s+=u.heapSize(e.uri),u.setModel(e.uri));for(const u of c.future)_y(u)&&u.matchesResource(e.uri)&&(o=!0,s+=u.heapSize(e.uri),u.setModel(e.uri))}}const a=iI.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(o)if(!r&&(s>a||!l.canComputeSHA1(e))){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-s),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>_y(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new kYi(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),r,s,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!r){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,r=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),s=this.getCreationOptions(r,e.uri,e.isForSimpleWidget);iI._setModelOptionsForModel(e,s,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new xq}};LH.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;LH=iI=SYi([KR(0,Ui),KR(1,rqe),KR(2,fq),KR(3,Qo),KR(4,xo)],LH);class xq{canComputeSHA1(e){return e.getValueLength()<=xq.MAX_MODEL_SIZE}computeSHA1(e){const t=new JU,i=e.createSnapshot();let r;for(;r=i.read();)t.update(r);return t.digest()}}xq.MAX_MODEL_SIZE=10*1024*1024;class TYi{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:Ae.None}}renderElement(e,t,i,r){var o;if((o=i.disposable)===null||o===void 0||o.dispose(),!i.data)return;const s=this.modelProvider();if(s.isResolved(e))return this.renderer.renderElement(s.get(e),e,i.data,r);const a=new da,l=s.resolve(e,a.token);i.disposable={dispose:()=>a.cancel()},this.renderer.renderPlaceholder(e,i.data),l.then(c=>this.renderer.renderElement(c,e,i.data,r))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class IYi{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 LYi(n,e){return Object.assign(Object.assign({},e),{accessibilityProvider:e.accessibilityProvider&&new IYi(n,e.accessibilityProvider)})}class DYi{constructor(e,t,i,r,o={}){const s=()=>this.model,a=r.map(l=>new TYi(l,s));this.list=new sm(e,t,i,a,LYi(s,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return Pt.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return Pt.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeSelection(){return Pt.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(r=>this._model.get(r)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,xu(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 LA=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};const AYi=!1;var DH;(function(n){n.North="north",n.South="south",n.East="east",n.West="west"})(DH||(DH={}));let RYi=4;const NYi=new be;let OYi=300;const PYi=new be;class J_e{constructor(){this.disposables=new nt}get onPointerMove(){return this.disposables.add(new Wi(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new Wi(window,"mouseup")).event}dispose(){this.disposables.dispose()}}LA([fa],J_e.prototype,"onPointerMove",null);LA([fa],J_e.prototype,"onPointerUp",null);class eve{get onPointerMove(){return this.disposables.add(new Wi(this.el,yo.Change)).event}get onPointerUp(){return this.disposables.add(new Wi(this.el,yo.End)).event}constructor(e){this.el=e,this.disposables=new nt}dispose(){this.disposables.dispose()}}LA([fa],eve.prototype,"onPointerMove",null);LA([fa],eve.prototype,"onPointerUp",null);class AH{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}LA([fa],AH.prototype,"onPointerMove",null);LA([fa],AH.prototype,"onPointerUp",null);const vAe="pointer-events-disabled";class kc extends Ae{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",e===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==0&&(this._orthogonalStartDragHandle=Ge(this.el,at(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Gn(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new Wi(this._orthogonalStartDragHandle,"mouseenter")).event(()=>kc.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new Wi(this._orthogonalStartDragHandle,"mouseleave")).event(()=>kc.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._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==0&&(this._orthogonalEndDragHandle=Ge(this.el,at(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Gn(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new Wi(this._orthogonalEndDragHandle,"mouseenter")).event(()=>kc.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new Wi(this._orthogonalEndDragHandle,"mouseleave")).event(()=>kc.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=OYi,this.hoverDelayer=this._register(new Gp(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new be),this._onDidStart=this._register(new be),this._onDidChange=this._register(new be),this._onDidReset=this._register(new be),this._onDidEnd=this._register(new be),this.orthogonalStartSashDisposables=this._register(new nt),this.orthogonalStartDragHandleDisposables=this._register(new nt),this.orthogonalEndSashDisposables=this._register(new nt),this.orthogonalEndDragHandleDisposables=this._register(new nt),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=Ge(e,at(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),Qi&&this.el.classList.add("mac");const r=this._register(new Wi(this.el,"mousedown")).event;this._register(r(d=>this.onPointerStart(d,new J_e),this));const o=this._register(new Wi(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const s=this._register(new Wi(this.el,"mouseenter")).event;this._register(s(()=>kc.onMouseEnter(this)));const a=this._register(new Wi(this.el,"mouseleave")).event;this._register(a(()=>kc.onMouseLeave(this))),this._register(bo.addTarget(this.el));const l=this._register(new Wi(this.el,yo.Start)).event;this._register(l(d=>this.onPointerStart(d,new eve(this.el)),this));const c=this._register(new Wi(this.el,yo.Tap)).event;let u;this._register(c(d=>{if(u){clearTimeout(u),u=void 0,this.onPointerDoublePress(d);return}clearTimeout(u),u=setTimeout(()=>u=void 0,250)},this)),typeof i.size=="number"?(this.size=i.size,i.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=RYi,this._register(NYi.event(d=>{this.size=d,this.layout()}))),this._register(PYi.event(d=>this.hoverDelay=d)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,this.orientation===1?(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",AYi),this.layout()}onPointerStart(e,t){yi.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const p=this.getOrthogonalSash(e);p&&(i=!0,e.__orthogonalSashEvent=!0,p.onPointerStart(e,new AH(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new AH(t))),!this.state)return;const r=document.getElementsByTagName("iframe");for(const p of r)p.classList.add(vAe);const o=e.pageX,s=e.pageY,a=e.altKey,l={startX:o,currentX:o,startY:s,currentY:s,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=Eg(this.el),u=()=>{let p="";i?p="all-scroll":this.orientation===1?this.state===1?p="s-resize":this.state===2?p="n-resize":p=Qi?"row-resize":"ns-resize":this.state===1?p="e-resize":this.state===2?p="w-resize":p=Qi?"col-resize":"ew-resize",c.textContent=`* { cursor: ${p} !important; }`},d=new nt;u(),i||this.onDidEnablementChange.event(u,null,d);const h=p=>{yi.stop(p,!1);const m={startX:o,currentX:p.pageX,startY:s,currentY:p.pageY,altKey:a};this._onDidChange.fire(m)},g=p=>{yi.stop(p,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),d.dispose();for(const m of r)m.classList.remove(vAe)};t.onPointerMove(h,null,d),t.onPointerUp(g,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&&kc.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&kc.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){kc.onMouseLeave(this)}layout(){if(this.orientation===0){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){var t;const i=(t=e.initialTarget)!==null&&t!==void 0?t:e.target;if(!(!i||!(i instanceof HTMLElement))&&i.classList.contains("orthogonal-drag-handle"))return i.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const MYi={separatorBorder:De.transparent};class dGe{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){var i,r;e!==this.visible&&(e?(this.size=qd(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e),(r=(i=this.view).setVisible)===null||r===void 0||r.call(i,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 proportionalLayout(){var e;return(e=this.view.proportionalLayout)!==null&&e!==void 0?e:!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,r){this.container=e,this.view=t,this.disposable=r,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){this.disposable.dispose()}}class FYi extends dGe{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class BYi extends dGe{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var hy;(function(n){n[n.Idle=0]="Idle",n[n.Busy=1]="Busy"})(hy||(hy={}));var RH;(function(n){n.Distribute={type:"distribute"};function e(r){return{type:"split",index:r}}n.Split=e;function t(r){return{type:"auto",index:r}}n.Auto=t;function i(r){return{type:"invisible",cachedVisibleSize:r}}n.Invisible=i})(RH||(RH={}));class hGe extends Ae{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())}constructor(e,t={}){var i,r,o,s,a;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=hy.Idle,this._onDidSashChange=this._register(new be),this._onDidSashReset=this._register(new be),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=(i=t.orientation)!==null&&i!==void 0?i:0,this.inverseAltBehavior=(r=t.inverseAltBehavior)!==null&&r!==void 0?r:!1,this.proportionalLayout=(o=t.proportionalLayout)!==null&&o!==void 0?o:!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=Ge(this.el,at(".sash-container")),this.viewContainer=at(".split-view-container"),this.scrollable=this._register(new w5({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:Sg})),this.scrollableElement=this._register(new f_e(this.viewContainer,{vertical:this.orientation===0?(s=t.scrollbarVisibility)!==null&&s!==void 0?s:1:2,horizontal:this.orientation===1?(a=t.scrollbarVisibility)!==null&&a!==void 0?a:1:2},this.scrollable));const l=this._register(new Wi(this.viewContainer,"scroll")).event;this._register(l(c=>{const u=this.scrollableElement.getScrollPosition(),d=Math.abs(this.viewContainer.scrollLeft-u.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,h=Math.abs(this.viewContainer.scrollTop-u.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(d!==void 0||h!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:d,scrollTop:h})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(c=>{c.scrollTopChanged&&(this.viewContainer.scrollTop=c.scrollTop),c.scrollLeftChanged&&(this.viewContainer.scrollLeft=c.scrollLeft)})),Ge(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||MYi),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((c,u)=>{const d=Xd(c.visible)||c.visible?c.size:{type:"invisible",cachedVisibleSize:c.size},h=c.view;this.doAddView(h,d,u,!0)}),this.contentSize=this.viewItems.reduce((c,u)=>c+u.size,0),this.saveProportions())}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,i=this.viewItems.length,r){this.doAddView(e,t,i,r)}layout(e,t){const i=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let r=0;for(let o=0;o<this.viewItems.length;o++){const s=this.viewItems[o],a=this.proportions[o];typeof a=="number"?r+=a:e-=s.size}for(let o=0;o<this.viewItems.length;o++){const s=this.viewItems[o],a=this.proportions[o];typeof a=="number"&&(s.size=qd(Math.round(a*e/r),s.minimumSize,s.maximumSize))}}else{const r=xu(this.viewItems.length),o=r.filter(a=>this.viewItems[a].priority===1),s=r.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-i,void 0,o,s)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout?e.size/this.contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(const a of this.viewItems)a.enabled=!1;const r=this.sashItems.findIndex(a=>a.sash===e),o=Ip(We(document.body,"keydown",a=>s(this.sashDragState.current,a.altKey)),We(document.body,"keyup",()=>s(this.sashDragState.current,!1))),s=(a,l)=>{const c=this.viewItems.map(p=>p.size);let u=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(r===this.sashItems.length-1){const m=this.viewItems[r];u=(m.minimumSize-m.size)/2,d=(m.maximumSize-m.size)/2}else{const m=this.viewItems[r+1];u=(m.size-m.maximumSize)/2,d=(m.size-m.minimumSize)/2}let h,g;if(!l){const p=xu(r,-1),m=xu(r+1,this.viewItems.length),_=p.reduce((L,D)=>L+(this.viewItems[D].minimumSize-c[D]),0),v=p.reduce((L,D)=>L+(this.viewItems[D].viewMaximumSize-c[D]),0),b=m.length===0?Number.POSITIVE_INFINITY:m.reduce((L,D)=>L+(c[D]-this.viewItems[D].minimumSize),0),y=m.length===0?Number.NEGATIVE_INFINITY:m.reduce((L,D)=>L+(c[D]-this.viewItems[D].viewMaximumSize),0),C=Math.max(_,y),x=Math.min(b,v),k=this.findFirstSnapIndex(p),I=this.findFirstSnapIndex(m);if(typeof k=="number"){const L=this.viewItems[k],D=Math.floor(L.viewMinimumSize/2);h={index:k,limitDelta:L.visible?C-D:C+D,size:L.size}}if(typeof I=="number"){const L=this.viewItems[I],D=Math.floor(L.viewMinimumSize/2);g={index:I,limitDelta:L.visible?x+D:x-D,size:L.size}}}this.sashDragState={start:a,current:a,index:r,sizes:c,minDelta:u,maxDelta:d,alt:l,snapBefore:h,snapAfter:g,disposable:o}};s(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:r,alt:o,minDelta:s,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const u=e-i,d=this.resize(t,u,r,void 0,void 0,s,a,l,c);if(o){const h=t===this.sashItems.length-1,g=this.viewItems.map(y=>y.size),p=h?t:t+1,m=this.viewItems[p],_=m.size-m.maximumSize,v=m.size-m.minimumSize,b=h?t-1:t+1;this.resize(b,-d,g,void 0,void 0,_,v)}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 i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=qd(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(this.state!==hy.Idle)throw new Error("Cant modify splitview");if(this.state=hy.Busy,e<0||e>=this.viewItems.length)return;const i=xu(this.viewItems.length).filter(a=>a!==e),r=[...i.filter(a=>this.viewItems[a].priority===1),e],o=i.filter(a=>this.viewItems[a].priority===2),s=this.viewItems[e];t=Math.round(t),t=qd(t,s.minimumSize,Math.min(s.maximumSize,this.size)),s.size=t,this.relayout(r,o),this.state=hy.Idle}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const i=Math.floor(t/e.length);for(const a of e)a.size=qd(i,a.minimumSize,a.maximumSize);const r=xu(this.viewItems.length),o=r.filter(a=>this.viewItems[a].priority===1),s=r.filter(a=>this.viewItems[a].priority===2);this.relayout(o,s)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,r){if(this.state!==hy.Idle)throw new Error("Cant modify splitview");this.state=hy.Busy;const o=at(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const s=e.onDidChange(h=>this.onViewChange(u,h)),a=Gn(()=>this.viewContainer.removeChild(o)),l=Ip(s,a);let c;typeof t=="number"?c=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?c=this.getViewSize(t.index)/2:t.type==="invisible"?c={cachedVisibleSize:t.cachedVisibleSize}:c=e.minimumSize);const u=this.orientation===0?new FYi(o,e,c,l):new BYi(o,e,c,l);if(this.viewItems.splice(i,0,u),this.viewItems.length>1){const h={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},g=this.orientation===0?new kc(this.sashContainer,{getHorizontalSashTop:L=>this.getSashPosition(L),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:1})):new kc(this.sashContainer,{getVerticalSashLeft:L=>this.getSashPosition(L),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:0})),p=this.orientation===0?L=>({sash:g,start:L.startY,current:L.currentY,alt:L.altKey}):L=>({sash:g,start:L.startX,current:L.currentX,alt:L.altKey}),_=Pt.map(g.onDidStart,p)(this.onSashStart,this),b=Pt.map(g.onDidChange,p)(this.onSashChange,this),C=Pt.map(g.onDidEnd,()=>this.sashItems.findIndex(L=>L.sash===g))(this.onSashEnd,this),x=g.onDidReset(()=>{const L=this.sashItems.findIndex(O=>O.sash===g),D=xu(L,-1),R=xu(L+1,this.viewItems.length),P=this.findFirstSnapIndex(D),M=this.findFirstSnapIndex(R);typeof P=="number"&&!this.viewItems[P].visible||typeof M=="number"&&!this.viewItems[M].visible||this._onDidSashReset.fire(L)}),k=Ip(_,b,C,x,g),I={sash:g,disposable:k};this.sashItems.splice(i-1,0,I)}o.appendChild(e.element);let d;typeof t!="number"&&t.type==="split"&&(d=[t.index]),r||this.relayout([i],d),this.state=hy.Idle,!r&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}relayout(e,t){const i=this.viewItems.reduce((r,o)=>r+o.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(u=>u.size),r,o,s=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const u=xu(e,-1),d=xu(e+1,this.viewItems.length);if(o)for(const I of o)jX(u,I),jX(d,I);if(r)for(const I of r)fB(u,I),fB(d,I);const h=u.map(I=>this.viewItems[I]),g=u.map(I=>i[I]),p=d.map(I=>this.viewItems[I]),m=d.map(I=>i[I]),_=u.reduce((I,L)=>I+(this.viewItems[L].minimumSize-i[L]),0),v=u.reduce((I,L)=>I+(this.viewItems[L].maximumSize-i[L]),0),b=d.length===0?Number.POSITIVE_INFINITY:d.reduce((I,L)=>I+(i[L]-this.viewItems[L].minimumSize),0),y=d.length===0?Number.NEGATIVE_INFINITY:d.reduce((I,L)=>I+(i[L]-this.viewItems[L].maximumSize),0),C=Math.max(_,y,s),x=Math.min(b,v,a);let k=!1;if(l){const I=this.viewItems[l.index],L=t>=l.limitDelta;k=L!==I.visible,I.setVisible(L,l.size)}if(!k&&c){const I=this.viewItems[c.index],L=t<c.limitDelta;k=L!==I.visible,I.setVisible(L,c.size)}if(k)return this.resize(e,t,i,r,o,s,a);t=qd(t,C,x);for(let I=0,L=t;I<h.length;I++){const D=h[I],R=qd(g[I]+L,D.minimumSize,D.maximumSize),P=R-g[I];L-=P,D.size=R}for(let I=0,L=t;I<p.length;I++){const D=p[I],R=qd(m[I]-L,D.minimumSize,D.maximumSize),P=R-m[I];L+=P,D.size=R}return t}distributeEmptySpace(e){const t=this.viewItems.reduce((a,l)=>a+l.size,0);let i=this.size-t;const r=xu(this.viewItems.length-1,-1),o=r.filter(a=>this.viewItems[a].priority===1),s=r.filter(a=>this.viewItems[a].priority===2);for(const a of s)jX(r,a);for(const a of o)fB(r,a);typeof e=="number"&&fB(r,e);for(let a=0;i!==0&&a<r.length;a++){const l=this.viewItems[r[a]],c=qd(l.size+i,l.minimumSize,l.maximumSize),u=c-l.size;i-=u,l.size=c}}layoutViews(){this.contentSize=this.viewItems.reduce((t,i)=>t+i.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?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(l=>e=l.size-l.minimumSize>0||e);e=!1;const i=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),r=[...this.viewItems].reverse();e=!1;const o=r.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const s=r.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l<this.sashItems.length;l++){const{sash:c}=this.sashItems[l],u=this.viewItems[l];a+=u.size;const d=!(t[l]&&s[l+1]),h=!(i[l]&&o[l+1]);if(d&&h){const g=xu(l,-1),p=xu(l+1,this.viewItems.length),m=this.findFirstSnapIndex(g),_=this.findFirstSnapIndex(p),v=typeof m=="number"&&!this.viewItems[m].visible,b=typeof _=="number"&&!this.viewItems[_].visible;v&&o[l]&&(a>0||this.startSnappingEnabled)?c.state=1:b&&t[l]&&(a<this.contentSize||this.endSnappingEnabled)?c.state=2:c.state=0}else d&&!h?c.state=1:!d&&h?c.state=2:c.state=3}}getSashPosition(e){let t=0;for(let i=0;i<this.sashItems.length;i++)if(t+=this.viewItems[i].size,this.sashItems[i].sash===e)return t;return 0}findFirstSnapIndex(e){for(const t of e){const i=this.viewItems[t];if(i.visible&&i.snap)return t}for(const t of e){const i=this.viewItems[t];if(i.visible&&i.maximumSize-i.minimumSize>0)return;if(!i.visible&&i.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=e===void 0?i.size:Math.min(e,i.size),t=t===void 0?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)===null||e===void 0||e.disposable.dispose(),Hr(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}class R5{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=R5.TemplateId,this.renderedTemplates=new Set;const r=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const s=r.get(o.templateId);if(!s)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(s)}}renderTemplate(e){const t=Ge(e,at(".monaco-table-tr")),i=[],r=[];for(let s=0;s<this.columns.length;s++){const a=this.renderers[s],l=Ge(t,at(".monaco-table-td",{"data-col-index":s}));l.style.width=`${this.getColumnSize(s)}px`,i.push(l),r.push(a.renderTemplate(l))}const o={container:e,cellContainers:i,cellTemplateData:r};return this.renderedTemplates.add(o),o}renderElement(e,t,i,r){for(let o=0;o<this.columns.length;o++){const a=this.columns[o].project(e);this.renderers[o].renderElement(a,t,i.cellTemplateData[o],r)}}disposeElement(e,t,i,r){for(let o=0;o<this.columns.length;o++){const s=this.renderers[o];if(s.disposeElement){const l=this.columns[o].project(e);s.disposeElement(l,t,i.cellTemplateData[o],r)}}}disposeTemplate(e){for(let t=0;t<this.columns.length;t++)this.renderers[t].disposeTemplate(e.cellTemplateData[t]);Gl(e.container),this.renderedTemplates.delete(e)}layoutColumn(e,t){for(const{cellContainers:i}of this.renderedTemplates)i[e].style.width=`${t}px`}}R5.TemplateId="row";function $Yi(n){return{getHeight(e){return n.getHeight(e)},getTemplateId(){return R5.TemplateId}}}class VYi{get minimumSize(){var e;return(e=this.column.minimumWidth)!==null&&e!==void 0?e:120}get maximumSize(){var e;return(e=this.column.maximumWidth)!==null&&e!==void 0?e:Number.POSITIVE_INFINITY}get onDidChange(){var e;return(e=this.column.onDidChangeWidthConstraints)!==null&&e!==void 0?e:Pt.None}constructor(e,t){this.column=e,this.index=t,this._onDidLayout=new be,this.onDidLayout=this._onDidLayout.event,this.element=at(".monaco-table-th",{"data-col-index":t,title:e.tooltip},e.label)}layout(e){this._onDidLayout.fire([this.index,e])}}class kq{get onDidChangeFocus(){return this.list.onDidChangeFocus}get onDidChangeSelection(){return this.list.onDidChangeSelection}get onDidScroll(){return this.list.onDidScroll}get onMouseDblClick(){return this.list.onMouseDblClick}get onPointer(){return this.list.onPointer}get onDidFocus(){return this.list.onDidFocus}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get scrollHeight(){return this.list.scrollHeight}get renderHeight(){return this.list.renderHeight}get onDidDispose(){return this.list.onDidDispose}constructor(e,t,i,r,o,s){this.virtualDelegate=i,this.domId=`table_id_${++kq.InstanceCount}`,this.disposables=new nt,this.cachedWidth=0,this.cachedHeight=0,this.domNode=Ge(t,at(`.monaco-table.${this.domId}`));const a=r.map((u,d)=>new VYi(u,d)),l={size:a.reduce((u,d)=>u+d.column.weight,0),views:a.map(u=>({size:u.column.weight,view:u}))};this.splitview=this.disposables.add(new hGe(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const c=new R5(r,o,u=>this.splitview.getViewSize(u));this.list=this.disposables.add(new sm(e,this.domNode,$Yi(i),[c],s)),Pt.any(...a.map(u=>u.onDidLayout))(([u,d])=>c.layoutColumn(u,d),null,this.disposables),this.splitview.onDidSashReset(u=>{const d=r.reduce((g,p)=>g+p.weight,0),h=r[u].weight/d*this.cachedWidth;this.splitview.resizeView(u,h)},null,this.disposables),this.styleElement=Eg(this.domNode),this.style(zGi)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {
top: ${this.virtualDelegate.headerRowHeight+1}px;
height: calc(100% - ${this.virtualDelegate.headerRowHeight}px);
}`),this.styleElement.textContent=t.join(`
`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}kq.InstanceCount=0;class DA extends im{constructor(e){super(),this._onChange=this._register(new be),this.onChange=this._onChange.event,this._onKeyDown=this._register(new be),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...In.asClassNameArray(this._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,i=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,i=>{if(i.keyCode===10||i.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault(),i.stopPropagation();return}this._onKeyDown.fire(i)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}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 2+2+2+16}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const HYi=E("caseDescription","Match Case"),WYi=E("wordsDescription","Match Whole Word"),zYi=E("regexDescription","Use Regular Expression");class fGe extends DA{constructor(e){super({icon:Ct.caseSensitive,title:HYi+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class gGe extends DA{constructor(e){super({icon:Ct.wholeWord,title:WYi+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class pGe extends DA{constructor(e){super({icon:Ct.regex,title:zYi+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class jYi{constructor(e,t=0,i=e.length,r=t-1){this.items=e,this.start=t,this.end=i,this.index=r}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 UYi{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._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new jYi(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}}const GR=at;let qYi=class extends im{constructor(e,t,i){var r;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new be),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new be),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(r=this.options.tooltip)!==null&&r!==void 0?r:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=Ge(e,GR(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",s=Ge(this.element,GR(".ibwrapper"));if(this.input=Ge(s,GR(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=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=Ge(s,GR("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new Iqe(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),Ge(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const a=this._register(new Wi(document,"selectionchange")),l=Pt.filter(a.event,()=>{const c=document.getSelection();return(c==null?void 0:c.anchorNode)===s});this._register(l(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._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new Ig(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}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 typeof this.cachedHeight=="number"?this.cachedHeight:TE(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()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if(this.state==="open"&&tf(this.message,e))return;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 i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${XE(i.border,"transparent")}`,this.message.content&&(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())),e==null?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.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;const t=()=>e.style.width=_d(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:r=>{var o,s;if(!this.message)return null;e=Ge(r,GR(".monaco-inputbox-container")),t();const a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?rGi(this.message.content,a):iGi(this.message.content,a);l.classList.add(this.classForType(this.message.type));const c=this.stylesForType(this.message.type);return l.style.backgroundColor=(o=c.background)!==null&&o!==void 0?o:"",l.style.color=(s=c.foreground)!==null&&s!==void 0?s:"",l.style.border=c.border?`1px solid ${c.border}`:"",Ge(e,l),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===3?i=E("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?i=E("alertWarningMessage","Warning: {0}",this.message.content):i=E("alertInfoMessage","Info: {0}",this.message.content),Pc(i),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,i=e.charCodeAt(e.length-1)===10?" ":"";(e+i).replace(/\u000c/g,"")?this.mirror.textContent=e+i:this.mirror.innerText=" ",this.layout()}applyStyles(){var e,t,i;const r=this.options.inputBoxStyles,o=(e=r.inputBackground)!==null&&e!==void 0?e:"",s=(t=r.inputForeground)!==null&&t!==void 0?t:"",a=(i=r.inputBorder)!==null&&i!==void 0?i:"";this.element.style.backgroundColor=o,this.element.style.color=s,this.input.style.backgroundColor="inherit",this.input.style.color=s,this.element.style.border=`1px solid ${XE(a,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=TE(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,i=t.selectionStart,r=t.selectionEnd,o=t.value;i!==null&&r!==null&&(this.value=o.substr(0,i)+e+o.substr(r),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)===null||e===void 0||e.dispose(),super.dispose()}};class mGe extends qYi{constructor(e,t,i){const r=E({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 ⇅ ${r}`,s=` (⇅ ${r})`;super(e,t,i),this._onDidFocus=this._register(new be),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new be),this.onDidBlur=this._onDidBlur.event,this.history=new UYi(i.history,100);const a=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(o)&&!this.placeholder.endsWith(s)&&this.history.getHistory().length){const l=this.placeholder.endsWith(")")?o:s,c=this.placeholder+l;i.showPlaceholderOnFocus&&document.activeElement!==this.input?this.placeholder=c:this.setPlaceHolder(c)}};this.observer=new MutationObserver((l,c)=>{l.forEach(u=>{u.target.textContent||a()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>a()),this.onblur(this.input,()=>{const l=c=>{if(this.placeholder.endsWith(c)){const u=this.placeholder.slice(0,this.placeholder.length-c.length);return i.showPlaceholderOnFocus?this.placeholder=u:this.setPlaceHolder(u),!0}else return!1};l(s)||l(o)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",fw(this.value?this.value:E("clearedInput","Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,fw(this.value))}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}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()}}const KYi=E("defaultLabel","input");class _Ge extends im{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Zl),this.additionalToggles=[],this._onDidOptionChange=this._register(new be),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new be),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new be),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new be),this._onKeyUp=this._register(new be),this._onCaseSensitiveKeyDown=this._register(new be),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new be),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||KYi,this.showCommonFindToggles=!!i.showCommonFindToggles;const r=i.appendCaseSensitiveLabel||"",o=i.appendWholeWordsLabel||"",s=i.appendRegexLabel||"",a=i.history||[],l=!!i.flexibleHeight,c=!!i.flexibleWidth,u=i.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new mGe(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:i.showHistoryHint,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:u,inputBoxStyles:i.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new pGe(Object.assign({appendTitle:s,isChecked:!1},i.toggleStyles))),this._register(this.regex.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(h=>{this._onRegexKeyDown.fire(h)})),this.wholeWords=this._register(new gGe(Object.assign({appendTitle:o,isChecked:!1},i.toggleStyles))),this._register(this.wholeWords.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new fGe(Object.assign({appendTitle:r,isChecked:!1},i.toggleStyles))),this._register(this.caseSensitive.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(h=>{this._onCaseSensitiveKeyDown.fire(h)}));const d=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const g=d.indexOf(document.activeElement);if(g>=0){let p=-1;h.equals(17)?p=(g+1)%d.length:h.equals(15)&&(g===0?p=d.length-1:p=g-1),h.equals(9)?(d[g].blur(),this.inputBox.focus()):p>=0&&d[p].focus(),yi.stop(h,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i==null?void 0:i.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(We(this.inputBox.inputElement,"compositionstart",d=>{this.imeSessionInProgress=!0})),this._register(We(this.inputBox.inputElement,"compositionend",d=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,d=>this._onKeyDown.fire(d)),this.onkeyup(this.inputBox.inputElement,d=>this._onKeyUp.fire(d)),this.oninput(this.inputBox.inputElement,d=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,d=>this._onMouseDown.fire(d))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,i;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(e=this.regex)===null||e===void 0||e.enable(),(t=this.wholeWords)===null||t===void 0||t.enable(),(i=this.caseSensitive)===null||i===void 0||i.enable();for(const r of this.additionalToggles)r.enable()}disable(){var e,t,i;this.domNode.classList.add("disabled"),this.inputBox.disable(),(e=this.regex)===null||e===void 0||e.disable(),(t=this.wholeWords)===null||t===void 0||t.disable(),(i=this.caseSensitive)===null||i===void 0||i.disable();for(const r of this.additionalToggles)r.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new nt;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(i=>{this._onDidOptionChange.fire(i),!i&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,i,r,o,s,a;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=((i=(t=this.caseSensitive)===null||t===void 0?void 0:t.width())!==null&&i!==void 0?i:0)+((o=(r=this.wholeWords)===null||r===void 0?void 0:r.width())!==null&&o!==void 0?o:0)+((a=(s=this.regex)===null||s===void 0?void 0:s.width())!==null&&a!==void 0?a:0)+this.additionalToggles.reduce((l,c)=>l+c.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return(t=(e=this.caseSensitive)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return(t=(e=this.wholeWords)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return(t=(e=this.regex)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)===null||e===void 0||e.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()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}var iv;(function(n){n[n.Expanded=0]="Expanded",n[n.Collapsed=1]="Collapsed",n[n.PreserveOrExpanded=2]="PreserveOrExpanded",n[n.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(iv||(iv={}));var OE;(function(n){n[n.Unknown=0]="Unknown",n[n.Twistie=1]="Twistie",n[n.Element=2]="Element",n[n.Filter=3]="Filter"})(OE||(OE={}));class Bh extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class tve{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}}function nve(n){return typeof n=="object"&&"visibility"in n&&"data"in n}function s4(n){switch(n){case!0:return 1;case!1:return 0;default:return n}}function nJ(n){return typeof n.collapsible=="boolean"}class GYi{constructor(e,t,i,r={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new Eme,this._onDidChangeCollapseState=new be,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new be,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new be,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Gp(OUe),this.collapseByDefault=typeof r.collapseByDefault>"u"?!1:r.collapseByDefault,this.filter=r.filter,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=Pi.empty(),r={}){if(e.length===0)throw new Bh(this.user,"Invalid tree location");r.diffIdentityProvider?this.spliceSmart(r.diffIdentityProvider,e,t,i,r):this.spliceSimple(e,t,i,r)}spliceSmart(e,t,i,r,o,s){var a;r===void 0&&(r=Pi.empty()),s===void 0&&(s=(a=o.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,i,r,o);const c=[...r],u=t[t.length-1],d=new yv({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,u),...c,...l.children.slice(u+i)].map(_=>e.getId(_.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,i,c,o);const h=t.slice(0,-1),g=(_,v,b)=>{if(s>0)for(let y=0;y<b;y++)_--,v--,this.spliceSmart(e,[...h,_,0],Number.MAX_SAFE_INTEGER,c[v].children,o,s-1)};let p=Math.min(l.children.length,u+i),m=c.length;for(const _ of d.changes.sort((v,b)=>b.originalStart-v.originalStart))g(p,m,p-(_.originalStart+_.originalLength)),p=_.originalStart,m=_.modifiedStart-u,this.spliceSimple([...h,p],_.originalLength,Pi.slice(c,m,m+_.modifiedLength),o);g(p,m,p)}spliceSimple(e,t,i=Pi.empty(),{onDidCreateNode:r,onDidDeleteNode:o,diffIdentityProvider:s}){const{parentNode:a,listIndex:l,revealed:c,visible:u}=this.getParentNodeWithListIndex(e),d=[],h=Pi.map(i,I=>this.createTreeNode(I,a,a.visible?1:0,c,d,r)),g=e[e.length-1],p=a.children.length>0;let m=0;for(let I=g;I>=0&&I<a.children.length;I--){const L=a.children[I];if(L.visible){m=L.visibleChildIndex;break}}const _=[];let v=0,b=0;for(const I of h)_.push(I),b+=I.renderNodeCount,I.visible&&(I.visibleChildIndex=m+v++);const y=iLe(a.children,g,t,_);s?a.lastDiffIds?iLe(a.lastDiffIds,g,t,_.map(I=>s.getId(I.element).toString())):a.lastDiffIds=a.children.map(I=>s.getId(I.element).toString()):a.lastDiffIds=void 0;let C=0;for(const I of y)I.visible&&C++;if(C!==0)for(let I=g+_.length;I<a.children.length;I++){const L=a.children[I];L.visible&&(L.visibleChildIndex-=C)}if(a.visibleChildrenCount+=v-C,c&&u){const I=y.reduce((L,D)=>L+(D.visible?D.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,b-I),this.list.splice(l,I,d)}if(y.length>0&&o){const I=L=>{o(L),L.children.forEach(I)};y.forEach(I)}this._onDidSplice.fire({insertedNodes:_,deletedNodes:y});const x=a.children.length>0;p!==x&&this.setCollapsible(e.slice(0,-1),x);let k=a;for(;k;){if(k.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}k=k.parent}}rerender(e){if(e.length===0)throw new Bh(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:r}=this.getTreeNodeWithListIndex(e);t.visible&&r&&this.list.splice(i,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:r}=this.getTreeNodeWithListIndex(e);return i&&r?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);typeof t>"u"&&(t=!i.collapsible);const r={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,r))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const r=this.getTreeNode(e);typeof t>"u"&&(t=!r.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:r,revealed:o}=this.getTreeNodeWithListIndex(e),s=this._setListNodeCollapseState(i,r,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&s&&!nJ(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let a=-1;for(let l=0;l<i.children.length;l++)if(i.children[l].visible)if(a>-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return s}_setListNodeCollapseState(e,t,i,r){const o=this._setNodeCollapseState(e,r,!1);if(!i||!e.visible||!o)return o;const s=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=s-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),o}_setNodeCollapseState(e,t,i){let r;if(e===this.root?r=!1:(nJ(t)?(r=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(r=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):r=!1,r&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!nJ(t)&&t.recursive)for(const o of e.children)r=this._setNodeCollapseState(o,t,!0)||r;return r}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,i,r,o,s){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,i);a.visibility=l,r&&o.push(a);const c=e.children||Pi.empty(),u=r&&l!==0&&!a.collapsed;let d=0,h=1;for(const g of c){const p=this.createTreeNode(g,a,l,u,o,s);a.children.push(p),h+=p.renderNodeCount,p.visible&&(p.visibleChildIndex=d++)}return a.collapsible=a.collapsible||a.children.length>0,a.visibleChildrenCount=d,a.visible=l===2?d>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=h):(a.renderNodeCount=0,r&&o.pop()),s==null||s(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,r=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===0)return e.visible=!1,e.renderNodeCount=0,!1;r&&i.push(e)}const s=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,o,i,r&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===2?a:o===1,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-s):(e.renderNodeCount=0,r&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return typeof i=="boolean"?(e.filterData=void 0,i?1:0):nve(i)?(e.filterData=i.data,s4(i.visibility)):(e.filterData=void 0,s4(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...r]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(r,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...r]=e;if(i<0||i>t.children.length)throw new Bh(this.user,"Invalid tree location");return this.getTreeNode(r,t.children[i])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:r,visible:o}=this.getParentNodeWithListIndex(e),s=e[e.length-1];if(s<0||s>t.children.length)throw new Bh(this.user,"Invalid tree location");const a=t.children[s];return{node:a,listIndex:i,revealed:r,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,r=!0,o=!0){const[s,...a]=e;if(s<0||s>t.children.length)throw new Bh(this.user,"Invalid tree location");for(let l=0;l<s;l++)i+=t.children[l].renderNodeCount;return r=r&&!t.collapsed,o=o&&t.visible,a.length===0?{parentNode:t,listIndex:i,revealed:r,visible:o}:this.getParentNodeWithListIndex(a,t.children[s],i+1,r,o)}getNode(e=[]){return this.getTreeNode(e)}getNodeLocation(e){const t=[];let i=e;for(;i.parent;)t.push(i.parent.children.indexOf(i)),i=i.parent;return t.reverse()}getParentNodeLocation(e){if(e.length!==0)return e.length===1?[]:E5i(e)[0]}getFirstElementChild(e){const t=this.getTreeNode(e);if(t.children.length!==0)return t.children[0].element}}globalThis&&globalThis.__awaiter;class YYi extends A5{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function iJ(n){return n instanceof A5?new YYi(n):n}class QYi{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=Ae.None,this.disposables=new nt}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){var i,r;(r=(i=this.dnd).onDragStart)===null||r===void 0||r.call(i,iJ(e),t)}onDragOver(e,t,i,r,o=!0){const s=this.dnd.onDragOver(iJ(e),t&&t.element,i,r),a=this.autoExpandNode!==t;if(a&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return s;if(a&&typeof s!="boolean"&&s.autoExpand&&(this.autoExpandDisposable=uw(()=>{const h=this.modelProvider(),g=h.getNodeLocation(t);h.isCollapsed(g)&&h.setCollapsed(g,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof s=="boolean"||!s.accept||typeof s.bubble>"u"||s.feedback){if(!o){const h=typeof s=="boolean"?s:s.accept,g=typeof s=="boolean"?void 0:s.effect;return{accept:h,effect:g,feedback:[i]}}return s}if(s.bubble===1){const h=this.modelProvider(),g=h.getNodeLocation(t),p=h.getParentNodeLocation(g),m=h.getNode(p),_=p&&h.getListIndex(p);return this.onDragOver(e,m,_,r,!1)}const l=this.modelProvider(),c=l.getNodeLocation(t),u=l.getListIndex(c),d=l.getListRenderCount(c);return Object.assign(Object.assign({},s),{feedback:xu(u,u+d)})}drop(e,t,i,r){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(iJ(e),t&&t.element,i,r)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function XYi(n,e){return e&&Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new QYi(n,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))}},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getSetSize(t){const i=n(),r=i.getNodeLocation(t),o=i.getParentNodeLocation(r);return i.getNode(o).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))}),keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}})})}class ive{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){var i,r;(r=(i=this.delegate).setDynamicHeight)===null||r===void 0||r.call(i,e.element,t)}}var a4;(function(n){n.None="none",n.OnHover="onHover",n.Always="always"})(a4||(a4={}));class ZYi{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new nt,this.onDidChange=Pt.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}class l4{constructor(e,t,i,r,o,s={}){var a;this.renderer=e,this.modelProvider=t,this.activeNodes=r,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=l4.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=Ae.None,this.disposables=new nt,this.templateId=e.templateId,this.updateOptions(s),Pt.map(i,l=>l.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(a=e.onDidChangeTwistieState)===null||a===void 0||a.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=qd(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[i,r]of this.renderedNodes)this.renderTreeElement(i,r)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==a4.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[i,r]of this.renderedNodes)this._renderIndentGuides(i,r);if(this.indentGuidesDisposable.dispose(),t){const i=new nt;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,i),this.indentGuidesDisposable=i,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=Ge(e,at(".monaco-tl-row")),i=Ge(t,at(".monaco-tl-indent")),r=Ge(t,at(".monaco-tl-twistie")),o=Ge(t,at(".monaco-tl-contents")),s=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:r,indentGuidesDisposable:Ae.None,templateData:s}}renderElement(e,t,i,r){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,r)}disposeElement(e,t,i,r){var o,s;i.indentGuidesDisposable.dispose(),(s=(o=this.renderer).disposeElement)===null||s===void 0||s.call(o,e,t,i.templateData,r),typeof r=="number"&&(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._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){const i=l4.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${i}px`,t.indent.style.width=`${i+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...In.asClassNameArray(Ct.treeItemExpanded));let r=!1;this.renderer.renderTwistie&&(r=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(r||t.twistie.classList.add(...In.asClassNameArray(Ct.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(Gl(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new nt,r=this.modelProvider();for(;;){const o=r.getNodeLocation(e),s=r.getParentNodeLocation(o);if(!s)break;const a=r.getNode(s),l=at(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&l.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(l):t.indent.insertBefore(l,t.indent.firstElementChild),this.renderedIndentGuides.add(a,l),i.add(Gn(()=>this.renderedIndentGuides.delete(a,l))),e=a}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach(r=>{const o=i.getNodeLocation(r);try{const s=i.getParentNodeLocation(o);r.collapsible&&r.children.length>0&&!r.collapsed?t.add(r):s&&t.add(i.getNode(s))}catch{}}),this.activeIndentNodes.forEach(r=>{t.has(r)||this.renderedIndentGuides.forEach(r,o=>o.classList.remove("active"))}),t.forEach(r=>{this.activeIndentNodes.has(r)||this.renderedIndentGuides.forEach(r,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),Hr(this.disposables)}}l4.DefaultIndent=8;class JYi{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new nt,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=1;if(this._filter){const s=this._filter.filter(e,t);if(typeof s=="boolean"?i=s?1:0:nve(s)?i=s4(s.visibility):i=s,i===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:__.Default,visibility:i};const r=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(r)?r:[r];for(const s of o){const a=s&&s.toString();if(typeof a>"u")return{data:__.Default,visibility:i};let l;if(this.tree.findMatchType===Hx.Contiguous){const c=a.toLowerCase().indexOf(this._lowercasePattern);if(c>-1){l=[Number.MAX_SAFE_INTEGER,0];for(let u=this._lowercasePattern.length;u>0;u--)l.push(c+u-1)}}else l=$x(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return this._matchCount++,o.length===1?{data:l,visibility:i}:{data:{label:a,score:l},visibility:i}}return this.tree.findMode===Hv.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:__.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){Hr(this.disposables)}}var Hv;(function(n){n[n.Highlight=0]="Highlight",n[n.Filter=1]="Filter"})(Hv||(Hv={}));var Hx;(function(n){n[n.Fuzzy=0]="Fuzzy",n[n.Contiguous=1]="Contiguous"})(Hx||(Hx={}));let eQi=class{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,r,o,s={}){var a,l;this.tree=e,this.view=i,this.filter=r,this.contextViewProvider=o,this.options=s,this._pattern="",this.width=0,this._onDidChangeMode=new be,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new be,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new be,this._onDidChangeOpenState=new be,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new nt,this.disposables=new nt,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:Hv.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l:Hx.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){var e,t,i,r;const o=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&o?!((e=this.tree.options.showNotFoundMessage)!==null&&e!==void 0)||e?(t=this.widget)===null||t===void 0||t.showMessage({type:2,content:E("not found","No elements found.")}):(i=this.widget)===null||i===void 0||i.showMessage({type:2}):(r=this.widget)===null||r===void 0||r.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this._mode===Hv.Filter||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!__.isDefault(e.filterData)}layout(e){var t;this.width=e,(t=this.widget)===null||t===void 0||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function bAe(n){let e=OE.Unknown;return oZ(n.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=OE.Twistie:oZ(n.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=OE.Element:oZ(n.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=OE.Filter),{browserEvent:n.browserEvent,element:n.element?n.element.element:null,target:e}}function q8(n,e){e(n),n.children.forEach(t=>q8(t,e))}class rJ{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new be,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&Qs(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const r=this;this._onDidChange.fire({get elements(){return r.get()},browserEvent:i})}}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 l=this.createNodeSet(),c=u=>l.delete(u);t.forEach(u=>q8(u,c)),this.set([...l.values()]);return}const i=new Set,r=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>q8(l,r));const o=new Map,s=l=>o.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>q8(l,s));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!i.has(c))a.push(l);else{const d=o.get(c);d&&d.visible&&a.push(d)}}if(this.nodes.length>0&&a.length===0){const l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class tQi extends iGe{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(JKe(e.browserEvent.target)||MC(e.browserEvent.target)||QI(e.browserEvent.target)||e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,r=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16;let o=!1;if(typeof this.tree.expandOnlyOnTwistieClick=="function"?o=this.tree.expandOnlyOnTwistieClick(t.element):o=!!this.tree.expandOnlyOnTwistieClick,o&&!r&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e);if(t.collapsible){const s=this.tree.getNodeLocation(t),a=e.browserEvent.altKey;if(this.tree.setFocus([s]),this.tree.toggleCollapsed(s,a),o&&r){e.browserEvent.isHandledByList=!0;return}}super.onViewPointer(e)}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}}class nQi extends sm{constructor(e,t,i,r,o,s,a,l){super(e,t,i,r,l),this.focusTrait=o,this.selectionTrait=s,this.anchorTrait=a}createMouseController(e){return new tQi(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const r=[],o=[];let s;i.forEach((a,l)=>{this.focusTrait.has(a)&&r.push(e+l),this.selectionTrait.has(a)&&o.push(e+l),this.anchorTrait.has(a)&&(s=e+l)}),r.length>0&&super.setFocus(rw([...super.getFocus(),...r])),o.length>0&&super.setSelection(rw([...super.getSelection(),...o])),typeof s=="number"&&super.setAnchor(s)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(r=>this.element(r)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(r=>this.element(r)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class vGe{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return Pt.filter(Pt.map(this.view.onMouseDblClick,bAe),e=>e.target!==OE.Filter)}get onPointer(){return Pt.map(this.view.onPointer,bAe)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return Pt.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.mode)!==null&&t!==void 0?t:Hv.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.matchType)!==null&&t!==void 0?t:Hx.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,r,o={}){var s;this._user=e,this._options=o,this.eventBufferer=new Eme,this.onDidChangeFindOpenState=Pt.None,this.disposables=new nt,this._onWillRefilter=new be,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new be;const a=new ive(i),l=new uLe,c=new uLe,u=this.disposables.add(new ZYi(c.event)),d=new Kme;this.renderers=r.map(_=>new l4(_,()=>this.model,l.event,u,d,o));for(const _ of this.renderers)this.disposables.add(_);let h;o.keyboardNavigationLabelProvider&&(h=new JYi(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:h}),this.disposables.add(h)),this.focus=new rJ(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new rJ(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new rJ(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new nQi(e,t,a,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},XYi(()=>this.model,o)),{tree:this})),this.model=this.createModel(e,this.view,o),l.input=this.model.onDidChangeCollapseState;const g=Pt.forEach(this.model.onDidSplice,_=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(_),this.selection.onDidModelSplice(_)})},this.disposables);g(()=>null,null,this.disposables);const p=this.disposables.add(new be),m=this.disposables.add(new Gp(0));if(this.disposables.add(Pt.any(g,this.focus.onDidChange,this.selection.onDidChange)(()=>{m.trigger(()=>{const _=new Set;for(const v of this.focus.getNodes())_.add(v);for(const v of this.selection.getNodes())_.add(v);p.fire([..._.values()])})})),c.input=p.event,o.keyboardSupport!==!1){const _=Pt.chain(this.view.onKeyDown,v=>v.filter(b=>!MC(b.target)).map(b=>new Oo(b)));Pt.chain(_,v=>v.filter(b=>b.keyCode===15))(this.onLeftArrow,this,this.disposables),Pt.chain(_,v=>v.filter(b=>b.keyCode===17))(this.onRightArrow,this,this.disposables),Pt.chain(_,v=>v.filter(b=>b.keyCode===10))(this.onSpace,this,this.disposables)}if((!((s=o.findWidgetEnabled)!==null&&s!==void 0)||s)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const _=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new eQi(this,this.model,this.view,h,o.contextViewProvider,_),this.focusNavigationFilter=v=>this.findController.shouldAllowFocus(v),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=Pt.None,this.onDidChangeFindMatchType=Pt.None;this.styleElement=Eg(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===a4.Always)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e);for(const i of this.renderers)i.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)===null||t===void 0||t.updateOptions(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===a4.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}domFocus(){this.view.domFocus()}layout(e,t){var i;this.view.layout(e,t),ow(t)&&((i=this.findController)===null||i===void 0||i.layout(t))}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=i.join(`
`),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)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,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 i=e.map(o=>this.model.getNode(o));this.selection.set(i,t);const r=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(r,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map(o=>this.model.getNode(o));this.focus.set(i,t);const r=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(r,t,!0)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);i!==-1&&this.view.reveal(i,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],r=this.model.getNodeLocation(i);if(!this.model.setCollapsed(r,!0)){const s=this.model.getParentNodeLocation(r);if(!s)return;const a=this.model.getListIndex(s);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],r=this.model.getNodeLocation(i);if(!this.model.setCollapsed(r,!1)){if(!i.children.some(l=>l.visible))return;const[s]=this.view.getFocus(),a=s+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],r=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(r,void 0,o)}dispose(){Hr(this.disposables),this.view.dispose()}}class rve{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new GYi(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(r,o){return i.sorter.compare(r.element,o.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=Pi.empty(),i={}){const r=this.getElementLocation(e);this._setChildren(r,this.preserveCollapseState(t),i)}_setChildren(e,t=Pi.empty(),i){const r=new Set,o=new Set,s=l=>{var c;if(l.element===null)return;const u=l;if(r.add(u.element),this.nodes.set(u.element,u),this.identityProvider){const d=this.identityProvider.getId(u.element).toString();o.add(d),this.nodesByIdentity.set(d,u)}(c=i.onDidCreateNode)===null||c===void 0||c.call(i,u)},a=l=>{var c;if(l.element===null)return;const u=l;if(r.has(u.element)||this.nodes.delete(u.element),this.identityProvider){const d=this.identityProvider.getId(u.element).toString();o.has(d)||this.nodesByIdentity.delete(d)}(c=i.onDidDeleteNode)===null||c===void 0||c.call(i,u)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:s,onDidDeleteNode:a}))}preserveCollapseState(e=Pi.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),Pi.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const s=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(s)}if(!i){let s;return typeof t.collapsed>"u"?s=void 0:t.collapsed===iv.Collapsed||t.collapsed===iv.PreserveOrCollapsed?s=!0:t.collapsed===iv.Expanded||t.collapsed===iv.PreserveOrExpanded?s=!1:s=!!t.collapsed,Object.assign(Object.assign({},t),{children:this.preserveCollapseState(t.children),collapsed:s})}const r=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let o;return typeof t.collapsed>"u"||t.collapsed===iv.PreserveOrCollapsed||t.collapsed===iv.PreserveOrExpanded?o=i.collapsed:t.collapsed===iv.Collapsed?o=!0:t.collapsed===iv.Expanded?o=!1:o=!!t.collapsed,Object.assign(Object.assign({},t),{collapsible:r,collapsed:o,children:this.preserveCollapseState(t.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 i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const r=this.getElementLocation(e);return this.model.setCollapsed(r,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new Bh(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Bh(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Bh(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),r=this.model.getParentNodeLocation(i);return this.model.getNode(r).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new Bh(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function K8(n){const e=[n.element],t=n.incompressible||!1;return{element:{elements:e,incompressible:t},children:Pi.map(Pi.from(n.children),K8),collapsible:n.collapsible,collapsed:n.collapsed}}function G8(n){const e=[n.element],t=n.incompressible||!1;let i,r;for(;[r,i]=Pi.consume(Pi.from(n.children),2),!(r.length!==1||r[0].incompressible);)n=r[0],e.push(n.element);return{element:{elements:e,incompressible:t},children:Pi.map(Pi.concat(r,i),G8),collapsible:n.collapsible,collapsed:n.collapsed}}function xae(n,e=0){let t;return e<n.element.elements.length-1?t=[xae(n,e+1)]:t=Pi.map(Pi.from(n.children),i=>xae(i,0)),e===0&&n.element.incompressible?{element:n.element.elements[e],children:t,incompressible:!0,collapsible:n.collapsible,collapsed:n.collapsed}:{element:n.element.elements[e],children:t,collapsible:n.collapsible,collapsed:n.collapsed}}function yAe(n){return xae(n,0)}function bGe(n,e,t){return n.element===e?Object.assign(Object.assign({},n),{children:t}):Object.assign(Object.assign({},n),{children:Pi.map(Pi.from(n.children),i=>bGe(i,e,t))})}const iQi=n=>({getId(e){return e.elements.map(t=>n.getId(t).toString()).join("\0")}});class rQi{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new rve(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=Pi.empty(),i){const r=i.diffIdentityProvider&&iQi(i.diffIdentityProvider);if(e===null){const p=Pi.map(t,this.enabled?G8:K8);this._setChildren(null,p,{diffIdentityProvider:r,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new Bh(this.user,"Unknown compressed tree node");const s=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),c=yAe(s),u=bGe(c,e,t),d=(this.enabled?G8:K8)(u),h=i.diffIdentityProvider?(p,m)=>i.diffIdentityProvider.getId(p)===i.diffIdentityProvider.getId(m):void 0;if(Qs(d.element.elements,s.element.elements,h)){this._setChildren(o,d.children||Pi.empty(),{diffIdentityProvider:r,diffDepth:1});return}const g=l.children.map(p=>p===s?d:p);this._setChildren(l.element,g,{diffIdentityProvider:r,diffDepth:s.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,r=Pi.map(i,yAe),o=Pi.map(r,e?G8:K8);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const r=new Set,o=a=>{for(const l of a.element.elements)r.add(l),this.nodes.set(l,a.element)},s=a=>{for(const l of a.element.elements)r.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,Object.assign(Object.assign({},i),{onDidCreateNode:o,onDidDeleteNode:s}))}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(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return i===null?null:i.elements[i.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 i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const r=this.getCompressedNode(e);return this.model.setCollapsed(r,t,i)}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(e===null)return null;const t=this.nodes.get(e);if(!t)throw new Bh(this.user,`Tree element not found: ${e}`);return t}}const oQi=n=>n[n.length-1];class ove{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new ove(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}constructor(e,t){this.unwrapper=e,this.node=t}}function sQi(n,e){return{splice(t,i,r){e.splice(t,i,r.map(o=>n.map(o)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function aQi(n,e){return Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(n(t))}},sorter:e.sorter&&{compare(t,i){return e.sorter.compare(t.elements[0],i.elements[0])}},filter:e.filter&&{filter(t,i){return e.filter.filter(n(t),i)}}})}class lQi{get onDidSplice(){return Pt.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(i=>this.nodeMapper.map(i)),deletedNodes:t.map(i=>this.nodeMapper.map(i))}))}get onDidChangeCollapseState(){return Pt.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return Pt.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||oQi;const r=o=>this.elementMapper(o.elements);this.nodeMapper=new tve(o=>new ove(r,o)),this.model=new rQi(e,sQi(this.nodeMapper,t),aQi(r,i))}setChildren(e,t=Pi.empty(),i={}){this.model.setChildren(e,t,i)}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 t===null||typeof t>"u"?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,i){return this.model.setCollapsed(e,t,i)}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 cQi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};class sve extends vGe{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,r,o={}){super(e,t,i,r,o),this.user=e}setChildren(e,t=Pi.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new rve(e,t,i)}}class yGe{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,r){const o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);o.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,r)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,r))}disposeElement(e,t,i,r){var o,s,a,l;i.compressedTreeNode?(s=(o=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(o,i.compressedTreeNode,t,i.data,r):(l=(a=this.renderer).disposeElement)===null||l===void 0||l.call(a,e,t,i.data,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}cQi([fa],yGe.prototype,"compressedTreeNodeProvider",null);function uQi(n,e){return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(t){let i;try{i=n().getCompressedTreeNode(t)}catch{return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t)}return i.element.elements.length===1?e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t):e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(i.element.elements)}}})}class CGe extends sve{constructor(e,t,i,r,o={}){const s=()=>this,a=r.map(l=>new yGe(s,l));super(e,t,i,a,uQi(s,o))}setChildren(e,t=Pi.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new lQi(e,t,i)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var i1=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function oJ(n){return Object.assign(Object.assign({},n),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function kae(n,e){return e.parent?e.parent===n?!0:kae(n,e.parent):!1}function dQi(n,e){return n===e||kae(n,e)||kae(e,n)}class ave{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new ave(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}constructor(e){this.node=e}}class hQi{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,r){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,r)}renderTwistie(e,t){return e.slow?(t.classList.add(...In.asClassNameArray(Ct.treeItemLoading)),!0):(t.classList.remove(...In.asClassNameArray(Ct.treeItemLoading)),!1)}disposeElement(e,t,i,r){var o,s;(s=(o=this.renderer).disposeElement)===null||s===void 0||s.call(o,this.nodeMapper.map(e),t,i.templateData,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function CAe(n){return{browserEvent:n.browserEvent,elements:n.elements.map(e=>e.element)}}function wAe(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,target:n.target}}class fQi extends A5{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function sJ(n){return n instanceof A5?new fQi(n):n}class gQi{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(i=>i.element),t)}onDragStart(e,t){var i,r;(r=(i=this.dnd).onDragStart)===null||r===void 0||r.call(i,sJ(e),t)}onDragOver(e,t,i,r,o=!0){return this.dnd.onDragOver(sJ(e),t&&t.element,i,r)}drop(e,t,i,r){this.dnd.drop(sJ(e),t&&t.element,i,r)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}dispose(){this.dnd.dispose()}}function wGe(n){return n&&Object.assign(Object.assign({},n),{collapseByDefault:!0,identityProvider:n.identityProvider&&{getId(e){return n.identityProvider.getId(e.element)}},dnd:n.dnd&&new gQi(n.dnd),multipleSelectionController:n.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return n.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},isSelectionRangeChangeEvent(e){return n.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))}},accessibilityProvider:n.accessibilityProvider&&Object.assign(Object.assign({},n.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:n.accessibilityProvider.getRole?e=>n.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:n.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=n.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return n.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return n.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:n.accessibilityProvider.getWidgetRole?()=>n.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:n.accessibilityProvider.getAriaLevel&&(e=>n.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:n.accessibilityProvider.getActiveDescendantId&&(e=>n.accessibilityProvider.getActiveDescendantId(e.element))}),filter:n.filter&&{filter(e,t){return n.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:n.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},n.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(e){return n.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),sorter:void 0,expandOnlyOnTwistieClick:typeof n.expandOnlyOnTwistieClick>"u"?void 0:typeof n.expandOnlyOnTwistieClick!="function"?n.expandOnlyOnTwistieClick:e=>n.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof n.defaultFindVisibility=="number"?n.defaultFindVisibility:typeof n.defaultFindVisibility>"u"?2:n.defaultFindVisibility(e.element)})}function Tae(n,e){e(n),n.children.forEach(t=>Tae(t,e))}class SGe{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return Pt.map(this.tree.onDidChangeFocus,CAe)}get onDidChangeSelection(){return Pt.map(this.tree.onDidChangeSelection,CAe)}get onMouseDblClick(){return Pt.map(this.tree.onMouseDblClick,wAe)}get onPointer(){return Pt.map(this.tree.onPointer,wAe)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,r,o,s={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new be,this._onDidChangeNodeSlowState=new be,this.nodeMapper=new tve(a=>new ave(a)),this.disposables=new nt,this.identityProvider=s.identityProvider,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren>"u"?!1:s.autoExpandSingleChildren,this.sorter=s.sorter,this.collapseByDefault=s.collapseByDefault,this.tree=this.createTree(e,t,i,r,s),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.root=oJ({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)}createTree(e,t,i,r,o){const s=new ive(i),a=r.map(c=>new hQi(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=wGe(o)||{};return new sve(e,t,s,a,l)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}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 i1(this,void 0,void 0,function*(){this.refreshPromises.forEach(r=>r.cancel()),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)})}_updateChildren(e=this.root.element,t=!0,i=!1,r,o){return i1(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new Bh(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield Pt.toPromise(this._onDidRender.event));const s=this.getDataNode(e);if(yield this.refreshAndRenderNode(s,t,r,o),i)try{this.tree.rerender(s)}catch{}})}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}expand(e,t=!1){return i1(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new Bh(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield Pt.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(yield this.root.refreshPromise,yield Pt.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const r=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(yield this.root.refreshPromise,yield Pt.toPromise(this._onDidRender.event)),r})}setSelection(e,t){const i=e.map(r=>this.getDataNode(r));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(r=>this.getDataNode(r));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(t=>t.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),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new Bh(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,i,r){return i1(this,void 0,void 0,function*(){yield this.refreshNode(e,t,i),this.render(e,i,r)})}refreshNode(e,t,i){return i1(this,void 0,void 0,function*(){let r;if(this.subTreeRefreshPromises.forEach((o,s)=>{!r&&dQi(s,e)&&(r=o.then(()=>this.refreshNode(e,t,i)))}),r)return r;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0;return}return this.doRefreshSubTree(e,t,i)})}doRefreshSubTree(e,t,i){return i1(this,void 0,void 0,function*(){let r;e.refreshPromise=new Promise(o=>r=o),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,i);e.stale=!1,yield ese.settled(o.map(s=>this.doRefreshSubTree(s,t,i)))}finally{r()}})}doRefreshNode(e,t,i){return i1(this,void 0,void 0,function*(){e.hasChildren=!!this.dataSource.hasChildren(e.element);let r;if(!e.hasChildren)r=Promise.resolve(Pi.empty());else{const o=this.doGetChildren(e);if(rLe(o))r=Promise.resolve(o);else{const s=cw(800);s.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),r=o.finally(()=>s.cancel())}}try{const o=yield r;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),R_(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 i=this.dataSource.getChildren(e.element);return rLe(i)?this.processChildren(i):(t=za(()=>i1(this,void 0,void 0,function*(){return this.processChildren(yield i)})),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(fi))}setChildren(e,t,i,r){const o=[...t];if(e.children.length===0&&o.length===0)return[];const s=new Map,a=new Map;for(const u of e.children)if(s.set(u.element,u),this.identityProvider){const d=this.tree.isCollapsed(u);a.set(u.id,{node:u,collapsed:d})}const l=[],c=o.map(u=>{const d=!!this.dataSource.hasChildren(u);if(!this.identityProvider){const m=oJ({element:u,parent:e,hasChildren:d});return d&&this.collapseByDefault&&!this.collapseByDefault(u)&&(m.collapsedByDefault=!1,l.push(m)),m}const h=this.identityProvider.getId(u).toString(),g=a.get(h);if(g){const m=g.node;return s.delete(m.element),this.nodes.delete(m.element),this.nodes.set(u,m),m.element=u,m.hasChildren=d,i?g.collapsed?(m.children.forEach(_=>Tae(_,v=>this.nodes.delete(v.element))),m.children.splice(0,m.children.length),m.stale=!0):l.push(m):d&&this.collapseByDefault&&!this.collapseByDefault(u)&&(m.collapsedByDefault=!1,l.push(m)),m}const p=oJ({element:u,parent:e,id:h,hasChildren:d});return r&&r.viewState.focus&&r.viewState.focus.indexOf(h)>-1&&r.focus.push(p),r&&r.viewState.selection&&r.viewState.selection.indexOf(h)>-1&&r.selection.push(p),r&&r.viewState.expanded&&r.viewState.expanded.indexOf(h)>-1?l.push(p):d&&this.collapseByDefault&&!this.collapseByDefault(u)&&(p.collapsedByDefault=!1,l.push(p)),p});for(const u of s.values())Tae(u,d=>this.nodes.delete(d.element));for(const u of c)this.nodes.set(u.element,u);return e.children.splice(0,e.children.length,...c),e!==this.root&&this.autoExpandSingleChildren&&c.length===1&&l.length===0&&(c[0].collapsedByDefault=!1,l.push(c[0])),l}render(e,t,i){const r=e.children.map(s=>this.asTreeElement(s,t)),o=i&&Object.assign(Object.assign({},i),{diffIdentityProvider:i.diffIdentityProvider&&{getId(s){return i.diffIdentityProvider.getId(s.element)}}});this.tree.setChildren(e===this.root?null:e,r,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 i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:i=e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?Pi.map(e.children,r=>this.asTreeElement(r,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class lve{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 lve(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}constructor(e){this.node=e}}class pQi{constructor(e,t,i,r){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=r,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,r){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,r)}renderCompressedElements(e,t,i,r){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,r)}renderTwistie(e,t){return e.slow?(t.classList.add(...In.asClassNameArray(Ct.treeItemLoading)),!0):(t.classList.remove(...In.asClassNameArray(Ct.treeItemLoading)),!1)}disposeElement(e,t,i,r){var o,s;(s=(o=this.renderer).disposeElement)===null||s===void 0||s.call(o,this.nodeMapper.map(e),t,i.templateData,r)}disposeCompressedElements(e,t,i,r){var o,s;(s=(o=this.renderer).disposeCompressedElements)===null||s===void 0||s.call(o,this.compressibleNodeMapperProvider().map(e),t,i.templateData,r)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=Hr(this.disposables)}}function mQi(n){const e=n&&wGe(n);return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel(t){return n.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}})})}class _Qi extends SGe{constructor(e,t,i,r,o,s,a={}){super(e,t,i,o,s,a),this.compressionDelegate=r,this.compressibleNodeMapper=new tve(l=>new lve(l)),this.filter=a.filter}createTree(e,t,i,r,o){const s=new ive(i),a=r.map(c=>new pQi(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=mQi(o)||{};return new CGe(e,t,s,a,l)}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 i=h=>this.identityProvider.getId(h).toString(),r=h=>{const g=new Set;for(const p of h){const m=this.tree.getCompressedTreeNode(p===this.root?null:p);if(m.element)for(const _ of m.element.elements)g.add(i(_.element))}return g},o=r(this.tree.getSelection()),s=r(this.tree.getFocus());super.render(e,t);const a=this.getSelection();let l=!1;const c=this.getFocus();let u=!1;const d=h=>{const g=h.element;if(g)for(let p=0;p<g.elements.length;p++){const m=i(g.elements[p].element),_=g.elements[g.elements.length-1].element;o.has(m)&&a.indexOf(_)===-1&&(a.push(_),l=!0),s.has(m)&&c.indexOf(_)===-1&&(c.push(_),u=!0)}h.children.forEach(d)};d(this.tree.getCompressedTreeNode(e===this.root?null:e)),l&&this.setSelection(a),u&&this.setFocus(c)}processChildren(e){return this.filter&&(e=Pi.filter(e,t=>{const i=this.filter.filter(t,1),r=vQi(i);if(r===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return r===1})),super.processChildren(e)}}function vQi(n){return typeof n=="boolean"?n?1:0:nve(n)?s4(n.visibility):s4(n)}class bQi extends vGe{constructor(e,t,i,r,o,s={}){super(e,t,i,r,s),this.user=e,this.dataSource=o,this.identityProvider=s.identityProvider}createModel(e,t,i){return new rve(e,t,i)}}new Ft("isMac",Qi,E("isMac","Whether the operating system is macOS"));new Ft("isLinux",fu,E("isLinux","Whether the operating system is Linux"));const Tq=new Ft("isWindows",vc,E("isWindows","Whether the operating system is Windows")),EGe=new Ft("isWeb",Qw,E("isWeb","Whether the platform is a web browser"));new Ft("isMacNative",Qi&&!Qw,E("isMacNative","Whether the operating system is macOS on a non-browser platform"));new Ft("isIOS",C_,E("isIOS","Whether the operating system is iOS"));new Ft("isMobile",z5i,E("isMobile","Whether the platform is a mobile web browser"));new Ft("isDevelopment",!1,!0);new Ft("productQualityType","",E("productQualityType","Quality type of VS Code"));const xGe="inputFocus";new Ft(xGe,!1,E("inputFocus","Whether keyboard focus is inside an input box"));var M0=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Po=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const $g=Vi("listService");class yQi{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new nt,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)===null||t===void 0||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(i=this._lastFocusedWidget)===null||i===void 0||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new rGe(Eg(),"").style(Bk)),this.lists.some(r=>r.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),e.getHTMLElement()===document.activeElement&&this.setLastFocusedList(e),Ip(e.onDidFocus(()=>this.setLastFocusedList(e)),Gn(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(r=>r!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const c4=new Ft("listScrollAtBoundary","none");Ke.or(c4.isEqualTo("top"),c4.isEqualTo("both"));Ke.or(c4.isEqualTo("bottom"),c4.isEqualTo("both"));const kGe=new Ft("listFocus",!0),Iq=new Ft("listSupportsMultiselect",!0),TGe=Ke.and(kGe,Ke.not(xGe)),cve=new Ft("listHasSelectionOrFocus",!1),uve=new Ft("listDoubleSelection",!1),dve=new Ft("listMultiSelection",!1),Lq=new Ft("listSelectionNavigation",!1),CQi=new Ft("listSupportsFind",!0),hve=new Ft("treeElementCanCollapse",!1),wQi=new Ft("treeElementHasParent",!1),fve=new Ft("treeElementCanExpand",!1),SQi=new Ft("treeElementHasChild",!1),EQi=new Ft("treeFindOpen",!1),IGe="listTypeNavigationMode",LGe="listAutomaticKeyboardNavigation";function Dq(n,e){const t=n.createScoped(e.getHTMLElement());return kGe.bindTo(t),t}function Aq(n,e){const t=c4.bindTo(n),i=()=>{const r=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;r&&o?t.set("both"):r?t.set("top"):o?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const $k="workbench.list.multiSelectModifier",Y8="workbench.list.openMode",mg="workbench.list.horizontalScrolling",gve="workbench.list.defaultFindMode",pve="workbench.list.typeNavigationMode",NH="workbench.list.keyboardNavigation",E_="workbench.list.scrollByPage",mve="workbench.list.defaultFindMatchType",u4="workbench.tree.indent",OH="workbench.tree.renderIndentGuides",x_="workbench.list.smoothScrolling",fb="workbench.list.mouseWheelScrollSensitivity",gb="workbench.list.fastScrollSensitivity",PH="workbench.tree.expandMode";function pb(n){return n.getValue($k)==="alt"}class xQi extends Ae{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=pb(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration($k)&&(this.useAltAsMultipleSelectionModifier=pb(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:tGe(e)}isSelectionRangeChangeEvent(e){return nGe(e)}}function Rq(n,e){var t;const i=n.get(Ui),r=n.get(mo),o=new nt;return[Object.assign(Object.assign({},e),{keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return r.mightProducePrintableCharacter(a)}},smoothScrolling:!!i.getValue(x_),mouseWheelScrollSensitivity:i.getValue(fb),fastScrollSensitivity:i.getValue(gb),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:o.add(new xQi(i)),keyboardNavigationEventFilter:IQi(r),scrollByPage:!!i.getValue(E_)}),o]}let Iae=class extends sm{constructor(e,t,i,r,o,s,a,l,c){const u=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(mg),[d,h]=c.invokeFunction(Rq,o);super(e,t,i,r,Object.assign(Object.assign({keyboardSupport:!1},d),{horizontalScrolling:u})),this.disposables.add(h),this.contextKeyService=Dq(s,this),this.disposables.add(Aq(this.contextKeyService,this)),this.listSupportsMultiSelect=Iq.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),Lq.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=cve.bindTo(this.contextKeyService),this.listDoubleSelection=uve.bindTo(this.contextKeyService),this.listMultiSelection=dve.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=pb(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),m=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||m.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),m=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||m.length>0)})),this.disposables.add(l.onDidChangeConfiguration(p=>{p.affectsConfiguration($k)&&(this._useAltAsMultipleSelectionModifier=pb(l));let m={};if(p.affectsConfiguration(mg)&&this.horizontalScrolling===void 0){const _=!!l.getValue(mg);m=Object.assign(Object.assign({},m),{horizontalScrolling:_})}if(p.affectsConfiguration(E_)){const _=!!l.getValue(E_);m=Object.assign(Object.assign({},m),{scrollByPage:_})}if(p.affectsConfiguration(x_)){const _=!!l.getValue(x_);m=Object.assign(Object.assign({},m),{smoothScrolling:_})}if(p.affectsConfiguration(fb)){const _=l.getValue(fb);m=Object.assign(Object.assign({},m),{mouseWheelScrollSensitivity:_})}if(p.affectsConfiguration(gb)){const _=l.getValue(gb);m=Object.assign(Object.assign({},m),{fastScrollSensitivity:_})}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new DGe(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?IA(e):Bk)}};Iae=M0([Po(5,Yn),Po(6,$g),Po(7,Ui),Po(8,Un)],Iae);let SAe=class extends DYi{constructor(e,t,i,r,o,s,a,l,c){const u=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(mg),[d,h]=c.invokeFunction(Rq,o);super(e,t,i,r,Object.assign(Object.assign({keyboardSupport:!1},d),{horizontalScrolling:u})),this.disposables=new nt,this.disposables.add(h),this.contextKeyService=Dq(s,this),this.disposables.add(Aq(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=Iq.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),Lq.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=pb(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(p=>{p.affectsConfiguration($k)&&(this._useAltAsMultipleSelectionModifier=pb(l));let m={};if(p.affectsConfiguration(mg)&&this.horizontalScrolling===void 0){const _=!!l.getValue(mg);m=Object.assign(Object.assign({},m),{horizontalScrolling:_})}if(p.affectsConfiguration(E_)){const _=!!l.getValue(E_);m=Object.assign(Object.assign({},m),{scrollByPage:_})}if(p.affectsConfiguration(x_)){const _=!!l.getValue(x_);m=Object.assign(Object.assign({},m),{smoothScrolling:_})}if(p.affectsConfiguration(fb)){const _=l.getValue(fb);m=Object.assign(Object.assign({},m),{mouseWheelScrollSensitivity:_})}if(p.affectsConfiguration(gb)){const _=l.getValue(gb);m=Object.assign(Object.assign({},m),{fastScrollSensitivity:_})}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new DGe(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?IA(e):Bk)}dispose(){this.disposables.dispose(),super.dispose()}};SAe=M0([Po(5,Yn),Po(6,$g),Po(7,Ui),Po(8,Un)],SAe);let EAe=class extends kq{constructor(e,t,i,r,o,s,a,l,c,u){const d=typeof s.horizontalScrolling<"u"?s.horizontalScrolling:!!c.getValue(mg),[h,g]=u.invokeFunction(Rq,s);super(e,t,i,r,o,Object.assign(Object.assign({keyboardSupport:!1},h),{horizontalScrolling:d})),this.disposables.add(g),this.contextKeyService=Dq(a,this),this.disposables.add(Aq(this.contextKeyService,this)),this.listSupportsMultiSelect=Iq.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(s.multipleSelectionSupport!==!1),Lq.bindTo(this.contextKeyService).set(!!s.selectionNavigation),this.listHasSelectionOrFocus=cve.bindTo(this.contextKeyService),this.listDoubleSelection=uve.bindTo(this.contextKeyService),this.listMultiSelection=dve.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=pb(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const m=this.getSelection(),_=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(m.length>0||_.length>0),this.listMultiSelection.set(m.length>1),this.listDoubleSelection.set(m.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const m=this.getSelection(),_=this.getFocus();this.listHasSelectionOrFocus.set(m.length>0||_.length>0)})),this.disposables.add(c.onDidChangeConfiguration(m=>{m.affectsConfiguration($k)&&(this._useAltAsMultipleSelectionModifier=pb(c));let _={};if(m.affectsConfiguration(mg)&&this.horizontalScrolling===void 0){const v=!!c.getValue(mg);_=Object.assign(Object.assign({},_),{horizontalScrolling:v})}if(m.affectsConfiguration(E_)){const v=!!c.getValue(E_);_=Object.assign(Object.assign({},_),{scrollByPage:v})}if(m.affectsConfiguration(x_)){const v=!!c.getValue(x_);_=Object.assign(Object.assign({},_),{smoothScrolling:v})}if(m.affectsConfiguration(fb)){const v=c.getValue(fb);_=Object.assign(Object.assign({},_),{mouseWheelScrollSensitivity:v})}if(m.affectsConfiguration(gb)){const v=c.getValue(gb);_=Object.assign(Object.assign({},_),{fastScrollSensitivity:v})}Object.keys(_).length>0&&this.updateOptions(_)})),this.navigator=new kQi(this,Object.assign({configurationService:c},s)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?IA(e):Bk)}dispose(){this.disposables.dispose(),super.dispose()}};EAe=M0([Po(6,Yn),Po(7,$g),Po(8,Ui),Po(9,Un)],EAe);class _ve extends Ae{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new be),this.onDidOpen=this._onDidOpen.event,this._register(Pt.filter(this.widget.onDidChangeSelection,r=>r.browserEvent instanceof KeyboardEvent)(r=>this.onSelectionFromKeyboard(r))),this._register(this.widget.onPointer(r=>this.onPointer(r.element,r.browserEvent))),this._register(this.widget.onMouseDblClick(r=>this.onMouseDblClick(r.element,r.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t!=null&&t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(Y8))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration(Y8)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(Y8))!=="doubleClick")}))):this.openOnSingleClick=(i=t==null?void 0:t.openOnSingleClick)!==null&&i!==void 0?i:!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,i=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,r=typeof t.pinned=="boolean"?t.pinned:!i,o=!1;this._open(this.getSelectedElement(),i,r,o,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const r=t.button===1,o=!0,s=r,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,s,a,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const o=!1,s=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,s,a,t)}_open(e,t,i,r,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:r,element:e,browserEvent:o})}}class DGe extends _ve{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class kQi extends _ve{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class TQi extends _ve{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function IQi(n){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const i=n.softDispatch(t,t.target);return i.kind===1?(e=!0,!1):(e=!1,i.kind===0)}}let xAe=class extends sve{constructor(e,t,i,r,o,s,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:h}=s.invokeFunction(N5,o);super(e,t,i,r,u),this.disposables.add(h),this.internals=new Wx(this,o,d,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};xAe=M0([Po(5,Un),Po(6,Yn),Po(7,$g),Po(8,Ui)],xAe);let kAe=class extends CGe{constructor(e,t,i,r,o,s,a,l,c){const{options:u,getTypeNavigationMode:d,disposable:h}=s.invokeFunction(N5,o);super(e,t,i,r,u),this.disposables.add(h),this.internals=new Wx(this,o,d,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};kAe=M0([Po(5,Un),Po(6,Yn),Po(7,$g),Po(8,Ui)],kAe);let TAe=class extends bQi{constructor(e,t,i,r,o,s,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:g}=a.invokeFunction(N5,s);super(e,t,i,r,o,d),this.disposables.add(g),this.internals=new Wx(this,s,h,s.overrideStyles,l,c,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};TAe=M0([Po(6,Un),Po(7,Yn),Po(8,$g),Po(9,Ui)],TAe);let Lae=class extends SGe{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,r,o,s,a,l,c,u){const{options:d,getTypeNavigationMode:h,disposable:g}=a.invokeFunction(N5,s);super(e,t,i,r,o,d),this.disposables.add(g),this.internals=new Wx(this,s,h,s.overrideStyles,l,c,u),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};Lae=M0([Po(6,Un),Po(7,Yn),Po(8,$g),Po(9,Ui)],Lae);let IAe=class extends _Qi{constructor(e,t,i,r,o,s,a,l,c,u,d){const{options:h,getTypeNavigationMode:g,disposable:p}=l.invokeFunction(N5,a);super(e,t,i,r,o,s,h),this.disposables.add(p),this.internals=new Wx(this,a,g,a.overrideStyles,c,u,d),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};IAe=M0([Po(7,Un),Po(8,Yn),Po(9,$g),Po(10,Ui)],IAe);function AGe(n){const e=n.getValue(gve);if(e==="highlight")return Hv.Highlight;if(e==="filter")return Hv.Filter;const t=n.getValue(NH);if(t==="simple"||t==="highlight")return Hv.Highlight;if(t==="filter")return Hv.Filter}function RGe(n){const e=n.getValue(mve);if(e==="fuzzy")return Hx.Fuzzy;if(e==="contiguous")return Hx.Contiguous}function N5(n,e){var t;const i=n.get(Ui),r=n.get(O0),o=n.get(Yn),s=n.get(Un),a=()=>{const g=o.getContextKeyValue(IGe);if(g==="automatic")return xv.Automatic;if(g==="trigger"||o.getContextKeyValue(LGe)===!1)return xv.Trigger;const m=i.getValue(pve);if(m==="automatic")return xv.Automatic;if(m==="trigger")return xv.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!i.getValue(mg),[c,u]=s.invokeFunction(Rq,e),d=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:i.getValue(OH);return{getTypeNavigationMode:a,disposable:u,options:Object.assign(Object.assign({keyboardSupport:!1},c),{indent:typeof i.getValue(u4)=="number"?i.getValue(u4):void 0,renderIndentGuides:h,smoothScrolling:!!i.getValue(x_),defaultFindMode:AGe(i),defaultFindMatchType:RGe(i),horizontalScrolling:l,scrollByPage:!!i.getValue(E_),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:i.getValue(PH)==="doubleClick",contextViewProvider:r,findWidgetStyles:cYi})}}let Wx=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,r,o,s,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=Dq(o,e),this.disposables.push(Aq(this.contextKeyService,e)),this.listSupportsMultiSelect=Iq.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),Lq.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=CQi.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=cve.bindTo(this.contextKeyService),this.hasDoubleSelection=uve.bindTo(this.contextKeyService),this.hasMultiSelection=dve.bindTo(this.contextKeyService),this.treeElementCanCollapse=hve.bindTo(this.contextKeyService),this.treeElementHasParent=wQi.bindTo(this.contextKeyService),this.treeElementCanExpand=fve.bindTo(this.contextKeyService),this.treeElementHasChild=SQi.bindTo(this.contextKeyService),this.treeFindOpen=EQi.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=pb(a),this.updateStyleOverrides(r);const u=()=>{const h=e.getFocus()[0];if(!h)return;const g=e.getNode(h);this.treeElementCanCollapse.set(g.collapsible&&!g.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(g.collapsible&&g.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},d=new Set;d.add(IGe),d.add(LGe),this.disposables.push(this.contextKeyService,s.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),g=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||g.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),g=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||g.length>0),u()}),e.onDidChangeCollapseState(u),e.onDidChangeModel(u),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),a.onDidChangeConfiguration(h=>{let g={};if(h.affectsConfiguration($k)&&(this._useAltAsMultipleSelectionModifier=pb(a)),h.affectsConfiguration(u4)){const p=a.getValue(u4);g=Object.assign(Object.assign({},g),{indent:p})}if(h.affectsConfiguration(OH)&&t.renderIndentGuides===void 0){const p=a.getValue(OH);g=Object.assign(Object.assign({},g),{renderIndentGuides:p})}if(h.affectsConfiguration(x_)){const p=!!a.getValue(x_);g=Object.assign(Object.assign({},g),{smoothScrolling:p})}if(h.affectsConfiguration(gve)||h.affectsConfiguration(NH)){const p=AGe(a);g=Object.assign(Object.assign({},g),{defaultFindMode:p})}if(h.affectsConfiguration(pve)||h.affectsConfiguration(NH)){const p=i();g=Object.assign(Object.assign({},g),{typeNavigationMode:p})}if(h.affectsConfiguration(mve)){const p=RGe(a);g=Object.assign(Object.assign({},g),{defaultFindMatchType:p})}if(h.affectsConfiguration(mg)&&t.horizontalScrolling===void 0){const p=!!a.getValue(mg);g=Object.assign(Object.assign({},g),{horizontalScrolling:p})}if(h.affectsConfiguration(E_)){const p=!!a.getValue(E_);g=Object.assign(Object.assign({},g),{scrollByPage:p})}if(h.affectsConfiguration(PH)&&t.expandOnlyOnTwistieClick===void 0&&(g=Object.assign(Object.assign({},g),{expandOnlyOnTwistieClick:a.getValue(PH)==="doubleClick"})),h.affectsConfiguration(fb)){const p=a.getValue(fb);g=Object.assign(Object.assign({},g),{mouseWheelScrollSensitivity:p})}if(h.affectsConfiguration(gb)){const p=a.getValue(gb);g=Object.assign(Object.assign({},g),{fastScrollSensitivity:p})}Object.keys(g).length>0&&e.updateOptions(g)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(d)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new TQi(e,Object.assign({configurationService:a},t)),this.disposables.push(this.navigator)}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?IA(e):Bk)}dispose(){this.disposables=Hr(this.disposables)}};Wx=M0([Po(4,Yn),Po(5,$g),Po(6,Ui)],Wx);const LQi=ds.as(O_.Configuration);LQi.registerConfiguration({id:"workbench",order:7,title:E("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[$k]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[E("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),E("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:E({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.")},[Y8]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:E({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.")},[mg]:{type:"boolean",default:!1,description:E("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[E_]:{type:"boolean",default:!1,description:E("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[u4]:{type:"number",default:8,minimum:4,maximum:40,description:E("tree indent setting","Controls tree indentation in pixels.")},[OH]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:E("render tree indent guides","Controls whether the tree should render indent guides.")},[x_]:{type:"boolean",default:!1,description:E("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[fb]:{type:"number",default:1,markdownDescription:E("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[gb]:{type:"number",default:5,markdownDescription:E("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[gve]:{type:"string",enum:["highlight","filter"],enumDescriptions:[E("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),E("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:E("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[NH]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[E("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),E("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),E("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:E("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:E("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[mve]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[E("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),E("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:E("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[PH]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:E("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.")},[pve]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:E("typeNavigationMode2","Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});var Dae;(function(n){n[n.PRESERVE=0]="PRESERVE",n[n.LAST=1]="LAST"})(Dae||(Dae={}));const Vk={Quickaccess:"workbench.contributions.quickaccess"};class DQi{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,i)=>i.prefix.length-t.prefix.length),Gn(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return ob([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}ds.add(Vk.Quickaccess,new DQi);const AQi={ctrlCmd:!1,alt:!1};var d4;(function(n){n[n.Blur=1]="Blur",n[n.Gesture=2]="Gesture",n[n.Other=3]="Other"})(d4||(d4={}));var Mm;(function(n){n[n.NONE=0]="NONE",n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.LAST=3]="LAST"})(Mm||(Mm={}));const P_=Vi("quickInputService");var RQi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},LAe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Aae=class extends Ae{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=ds.as(Vk.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var r;const[o,s]=this.getOrInstantiateProvider(e),a=this.visibleQuickAccess,l=a==null?void 0:a.descriptor;if(a&&s&&l===s){e!==s.prefix&&!(i!=null&&i.preserveValue)&&(a.picker.value=e),this.adjustValueSelection(a.picker,s,i);return}if(s&&!(i!=null&&i.preserveValue)){let g;if(a&&l&&l!==s){const p=a.value.substr(l.prefix.length);p&&(g=`${s.prefix}${p}`)}if(!g){const p=o==null?void 0:o.defaultFilterValue;p===Dae.LAST?g=this.lastAcceptedPickerValues.get(s):typeof p=="string"&&(g=`${s.prefix}${p}`)}typeof g=="string"&&(e=g)}const c=new nt,u=c.add(this.quickInputService.createQuickPick());u.value=e,this.adjustValueSelection(u,s,i),u.placeholder=s==null?void 0:s.placeholder,u.quickNavigate=i==null?void 0:i.quickNavigateConfiguration,u.hideInput=!!u.quickNavigate&&!a,(typeof(i==null?void 0:i.itemActivation)=="number"||i!=null&&i.quickNavigateConfiguration)&&(u.itemActivation=(r=i==null?void 0:i.itemActivation)!==null&&r!==void 0?r:Mm.SECOND),u.contextKey=s==null?void 0:s.contextKey,u.filterValue=g=>g.substring(s?s.prefix.length:0);let d;t&&(d=new UU,c.add(Pt.once(u.onWillAccept)(g=>{g.veto(),u.hide()}))),c.add(this.registerPickerListeners(u,o,s,e,i==null?void 0:i.providerOptions));const h=c.add(new da);if(o&&c.add(o.provide(u,h.token,i==null?void 0:i.providerOptions)),Pt.once(u.onDidHide)(()=>{u.selectedItems.length===0&&h.cancel(),c.dispose(),d==null||d.complete(u.selectedItems.slice(0))}),u.show(),t)return d==null?void 0:d.p}adjustValueSelection(e,t,i){var r;let o;i!=null&&i.preserveValue?o=[e.value.length,e.value.length]:o=[(r=t==null?void 0:t.prefix.length)!==null&&r!==void 0?r:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,i,r,o){const s=new nt,a=this.visibleQuickAccess={picker:e,descriptor:i,value:r};return s.add(Gn(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),s.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l);c!==t?this.show(l,{preserveValue:!0,providerOptions:o}):a.value=l})),i&&s.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),s}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};Aae=RQi([LAe(0,P_),LAe(1,Un)],Aae);De.white.toString(),De.white.toString();class Rae extends Ae{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new be),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,r=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=r||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),e.appendChild(this._element),this._register(bo.addTarget(this._element)),[Lt.CLICK,yo.Tap].forEach(o=>{this._register(We(this._element,o,s=>{if(!this.enabled){yi.stop(s);return}this._onDidClick.fire(s)}))}),this._register(We(this._element,Lt.KEY_DOWN,o=>{const s=new Oo(o);let a=!1;this.enabled&&(s.equals(3)||s.equals(10))?(this._onDidClick.fire(o),a=!0):s.equals(9)&&(this._element.blur(),a=!0),a&&yi.stop(s,!0)})),this._register(We(this._element,Lt.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(We(this._element,Lt.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(lb(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of PC(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const r=document.createElement("span");r.textContent=i,t.push(r)}else t.push(i);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var t;if(this._label===e||OC(this._label)&&OC(e)&&ZKi(this._label,e))return;this._element.classList.add("monaco-text-button");const i=this.options.supportShortLabel?this._labelElement:this._element;if(OC(e)){const r=wq(e,{inline:!0});r.dispose();const o=(t=r.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(o){const s=_Ue(o,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});i.innerHTML=s}else Yl(i)}else this.options.supportIcons?Yl(i,...this.getContentElements(e)):i.textContent=e;typeof this.options.title=="string"?this._element.title=this.options.title:this.options.title&&(this._element.title=fGi(e)),this._label=e}get label(){return this._label}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")}}class Nae{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=Ge(e,at(".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(){var e,t;this.element.textContent=Dx(this.countFormat,this.count),this.element.title=Dx(this.titleFormat,this.count),this.element.style.backgroundColor=(e=this.styles.badgeBackground)!==null&&e!==void 0?e:"",this.element.style.color=(t=this.styles.badgeForeground)!==null&&t!==void 0?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const DAe="done",AAe="active",aJ="infinite",lJ="infinite-long-running",RAe="discrete";class Nq extends Ae{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new so(()=>Yd(this.element),0)),this.longRunningScheduler=this._register(new so(()=>this.infiniteLongRunning(),Nq.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){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.bit.style.backgroundColor=(t==null?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(AAe,aJ,lJ,RAe),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(DAe),this.element.classList.contains(aJ)?(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(RAe,DAe,lJ),this.element.classList.add(AAe,aJ),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(lJ)}getContainer(){return this.element}}Nq.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const NQi=at;class OQi extends Ae{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=o=>We(this.findInput.inputBox.inputElement,Lt.KEY_DOWN,s=>{o(new Oo(s))}),this.onMouseDown=o=>We(this.findInput.inputBox.inputElement,Lt.MOUSE_DOWN,s=>{o(new og(s))}),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=Ge(this.parent,NQi(".quick-input-box")),this.findInput=this._register(new _Ge(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const r=this.findInput.inputBox.inputElement;r.role="combobox",r.ariaHasPopup="menu",r.ariaAutoComplete="list",r.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===js.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===js.Info?1:e===js.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===js.Info?1:e===js.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class FC{constructor(e,t){var i;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(i=t==null?void 0:t.supportIcons)!==null&&i!==void 0?i:!1,this.domNode=Ge(e,at("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",r){e||(e=""),r&&(e=FC.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&tf(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const i of this.highlights){if(i.end===i.start)continue;if(t<i.start){const s=this.text.substring(t,i.start);this.supportIcons?e.push(...PC(s)):e.push(s),t=i.start}const r=this.text.substring(t,i.end),o=at("span.highlight",void 0,...this.supportIcons?PC(r):[r]);i.extraClasses&&o.classList.add(...i.extraClasses),e.push(o),t=i.end}if(t<this.text.length){const i=this.text.substring(t);this.supportIcons?e.push(...PC(i)):e.push(i)}Yl(this.domNode,...e),this.title?this.domNode.title=this.title:this.domNode.removeAttribute("title"),this.didEverRender=!0}static escapeNewLines(e,t){let i=0,r=0;return e.replace(/\r\n|\r|\n/g,(o,s)=>{r=o===`\r
`?-1:0,s+=i;for(const a of t)a.end<=s||(a.start>=s&&(a.start+=r),a.end>=s&&(a.end+=r));return i+=r,"⏎"})}}class cJ{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 MH extends Ae{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new cJ(Ge(e,at(".monaco-icon-label")))),this.labelContainer=Ge(this.domNode.element,at(".monaco-icon-label-container"));const i=Ge(this.labelContainer,at("span.monaco-icon-name-container"));t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=new FQi(i,!!t.supportIcons):this.nameNode=new PQi(i),this.hoverDelegate=t==null?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,i){const r=["monaco-icon-label"],o=["monaco-icon-label-container"];let s="";if(i&&(i.extraClasses&&r.push(...i.extraClasses),i.italic&&r.push("italic"),i.strikethrough&&r.push("strikethrough"),i.disabledCommand&&o.push("disabled"),i.title&&(s+=i.title)),this.domNode.className=r.join(" "),this.domNode.element.setAttribute("aria-label",s),this.labelContainer.className=o.join(" "),this.setupHover(i!=null&&i.descriptionTitle?this.labelContainer:this.element,i==null?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const a=this.getOrCreateDescriptionNode();a instanceof FC?(a.set(t||"",i?i.descriptionMatches:void 0,void 0,i==null?void 0:i.labelEscapeNewLines),this.setupHover(a.element,i==null?void 0:i.descriptionTitle)):(a.textContent=t&&(i!=null&&i.labelEscapeNewLines)?FC.escapeNewLines(t,[]):t||"",this.setupHover(a.element,(i==null?void 0:i.descriptionTitle)||""),a.empty=!t)}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(!this.hoverDelegate)tGi(e,t);else{const r=XKe(this.hoverDelegate,e,t);r&&this.customHovers.set(e,r)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new cJ(Ge(this.labelContainer,at("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=new FC(Ge(t.element,at("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new cJ(Ge(t.element,at("span.label-description"))))}return this.descriptionNode}}class PQi{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&tf(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=Ge(this.container,at("a.label-name",{id:t==null?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i<e.length;i++){const r=e[i],o=(t==null?void 0:t.domId)&&`${t==null?void 0:t.domId}_${i}`;Ge(this.container,at("a.label-name",{id:o,"data-icon-label-count":e.length,"data-icon-label-index":i,role:"treeitem"},r)),i<e.length-1&&Ge(this.container,at("span.label-separator",void 0,(t==null?void 0:t.separator)||"/"))}}}}function MQi(n,e,t){if(!t)return;let i=0;return n.map(r=>{const o={start:i,end:i+r.length},s=t.map(a=>xc.intersect(o,a)).filter(a=>!xc.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=o.end+e.length,s})}class FQi{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&tf(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new FC(Ge(this.container,at("a.label-name",{id:t==null?void 0:t.domId})),{supportIcons:this.supportIcons})),this.singleLabel.set(e,t==null?void 0:t.matches,void 0,t==null?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=(t==null?void 0:t.separator)||"/",r=MQi(e,i,t==null?void 0:t.matches);for(let o=0;o<e.length;o++){const s=e[o],a=r?r[o]:void 0,l=(t==null?void 0:t.domId)&&`${t==null?void 0:t.domId}_${o}`,c=at("a.label-name",{id:l,"data-icon-label-count":e.length,"data-icon-label-index":o,role:"treeitem"});new FC(Ge(this.container,c),{supportIcons:this.supportIcons}).set(s,a,void 0,t==null?void 0:t.labelEscapeNewLines),o<e.length-1&&Ge(c,at("span.label-separator",void 0,i))}}}}const JB=at,BQi={keybindingLabelBackground:void 0,keybindingLabelForeground:void 0,keybindingLabelBorder:void 0,keybindingLabelBottomBorder:void 0,keybindingLabelShadow:void 0};class O5{constructor(e,t,i){this.os=t,this.keyElements=new Set,this.options=i||Object.create(null);const r=this.options.keybindingLabelForeground;this.domNode=Ge(e,JB(".monaco-keybinding")),r&&(this.domNode.style.color=r),this.didEverRender=!1,e.appendChild(this.domNode)}get element(){return this.domNode}set(e,t){this.didEverRender&&this.keybinding===e&&O5.areSame(this.matches,t)||(this.keybinding=e,this.matches=t,this.render())}render(){var e;if(this.clear(),this.keybinding){const t=this.keybinding.getChords();t[0]&&this.renderChord(this.domNode,t[0],this.matches?this.matches.firstPart:null);for(let r=1;r<t.length;r++)Ge(this.domNode,JB("span.monaco-keybinding-key-chord-separator",void 0," ")),this.renderChord(this.domNode,t[r],this.matches?this.matches.chordPart:null);const i=(e=this.options.disableTitle)!==null&&e!==void 0&&e?void 0:this.keybinding.getAriaLabel()||void 0;i!==void 0?this.domNode.title=i:this.domNode.removeAttribute("title")}else this.options&&this.options.renderUnboundKeybindings&&this.renderUnbound(this.domNode);this.didEverRender=!0}clear(){Gl(this.domNode),this.keyElements.clear()}renderChord(e,t,i){const r=V_e.modifierLabels[this.os];t.ctrlKey&&this.renderKey(e,r.ctrlKey,!!(i!=null&&i.ctrlKey),r.separator),t.shiftKey&&this.renderKey(e,r.shiftKey,!!(i!=null&&i.shiftKey),r.separator),t.altKey&&this.renderKey(e,r.altKey,!!(i!=null&&i.altKey),r.separator),t.metaKey&&this.renderKey(e,r.metaKey,!!(i!=null&&i.metaKey),r.separator);const o=t.keyLabel;o&&this.renderKey(e,o,!!(i!=null&&i.keyCode),"")}renderKey(e,t,i,r){Ge(e,this.createKeyElement(t,i?".highlight":"")),r&&Ge(e,JB("span.monaco-keybinding-key-separator",void 0,r))}renderUnbound(e){Ge(e,this.createKeyElement(E("unbound","Unbound")))}createKeyElement(e,t=""){const i=JB("span.monaco-keybinding-key"+t,void 0,e);return this.keyElements.add(i),this.options.keybindingLabelBackground&&(i.style.backgroundColor=this.options.keybindingLabelBackground),this.options.keybindingLabelBorder&&(i.style.borderColor=this.options.keybindingLabelBorder),this.options.keybindingLabelBottomBorder&&(i.style.borderBottomColor=this.options.keybindingLabelBottomBorder),this.options.keybindingLabelShadow&&(i.style.boxShadow=`inset 0 -1px 0 ${this.options.keybindingLabelShadow}`),i}static areSame(e,t){return e===t||!e&&!t?!0:!!e&&!!t&&tf(e.firstPart,t.firstPart)&&tf(e.chordPart,t.chordPart)}}const NAe=new Jw(()=>{const n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:n,collatorIsNumeric:n.resolvedOptions().numeric}});function $Qi(n,e,t=!1){const i=n||"",r=e||"",o=NAe.value.collator.compare(i,r);return NAe.value.collatorIsNumeric&&o===0&&i!==r?i<r?-1:1:o}function VQi(n,e,t){const i=n.toLowerCase(),r=e.toLowerCase(),o=HQi(n,e,t);if(o)return o;const s=i.endsWith(t),a=r.endsWith(t);if(s!==a)return s?-1:1;const l=$Qi(i,r);return l!==0?l:i.localeCompare(r)}function HQi(n,e,t){const i=n.toLowerCase(),r=e.toLowerCase(),o=i.startsWith(t),s=r.startsWith(t);if(o!==s)return o?-1:1;if(o&&s){if(i.length<r.length)return-1;if(i.length>r.length)return 1}return 0}var WQi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};class NGe{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}WQi([fa],NGe.prototype,"toString",null);const zQi=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function jQi(n){const e=[];let t=0,i;for(;i=zQi.exec(n);){i.index-t>0&&e.push(n.substring(t,i.index));const[,r,o,,s]=i;s?e.push({label:r,href:o,title:s}):e.push({label:r,href:o}),t=i.index+i[0].length}return t<n.length&&e.push(n.substring(t)),new NGe(e)}const uJ={},UQi=new Q_e("quick-input-button-icon-");function Oae(n){if(!n)return;let e;const t=n.dark.toString();return uJ[t]?e=uJ[t]:(e=UQi.nextId(),Zoe(`.${e}, .hc-light .${e}`,`background-image: ${lw(n.light||n.dark)}`),Zoe(`.vs-dark .${e}, .hc-black .${e}`,`background-image: ${lw(n.dark)}`),uJ[t]=e),e}function qQi(n,e,t){Yl(e);const i=jQi(n);let r=0;for(const o of i.nodes)if(typeof o=="string")e.append(...PC(o));else{let s=o.title;!s&&o.href.startsWith("command:")?s=E("executeCommand","Click to execute command '{0}'",o.href.substring(8)):s||(s=o.href);const a=at("a",{href:o.href,title:s,tabIndex:r++},o.label);a.style.textDecoration="underline";const l=g=>{o$i(g)&&yi.stop(g,!0),t.callback(o.href)},c=t.disposables.add(new Wi(a,Lt.CLICK)).event,u=t.disposables.add(new Wi(a,Lt.KEY_DOWN)).event,d=Pt.chain(u,g=>g.filter(p=>{const m=new Oo(p);return m.equals(10)||m.equals(3)}));t.disposables.add(bo.addTarget(a));const h=t.disposables.add(new Wi(a,yo.Tap)).event;Pt.any(c,h,d)(l,null,t.disposables),e.appendChild(a)}}var OGe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},OAe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const xm=at;class KQi{constructor(e,t,i,r,o,s,a){var l,c,u;this._checked=!1,this._hidden=!1,this.hasCheckbox=r,this.index=i,this.fireButtonTriggered=o,this.fireSeparatorButtonTriggered=s,this._onChecked=a,this.onChecked=r?Pt.map(Pt.filter(this._onChecked.event,d=>d.listElement===this),d=>d.checked):Pt.None,e.type==="separator"?this._separator=e:(this.item=e,t&&t.type==="separator"&&!t.buttons&&(this._separator=t),this.saneDescription=this.item.description,this.saneDetail=this.item.detail,this._labelHighlights=(l=this.item.highlights)===null||l===void 0?void 0:l.label,this._descriptionHighlights=(c=this.item.highlights)===null||c===void 0?void 0:c.description,this._detailHighlights=(u=this.item.highlights)===null||u===void 0?void 0:u.detail,this.saneTooltip=this.item.tooltip),this._init=new Jw(()=>{var d;const h=(d=e.label)!==null&&d!==void 0?d:"",g=BN(h).text.trim(),p=e.ariaLabel||[h,this.saneDescription,this.saneDetail].map(m=>XKi(m)).filter(m=>!!m).join(", ");return{saneLabel:h,saneSortLabel:g,saneAriaLabel:p}})}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({listElement:this,checked:e}))}get separator(){return this._separator}set separator(e){this._separator=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class P5{constructor(e){this.themeService=e}get templateId(){return P5.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=Ge(e,xm(".quick-input-list-entry"));const i=Ge(t.entry,xm("label.quick-input-list-label"));t.toDisposeTemplate.push(ua(i,Lt.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=Ge(i,xm("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(ua(t.checkbox,Lt.CHANGE,c=>{t.element.checked=t.checkbox.checked}));const r=Ge(i,xm(".quick-input-list-rows")),o=Ge(r,xm(".quick-input-list-row")),s=Ge(r,xm(".quick-input-list-row"));t.label=new MH(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.label),t.icon=kUe(t.label.element,xm(".quick-input-list-icon"));const a=Ge(o,xm(".quick-input-list-entry-keybinding"));t.keybinding=new O5(a,qh);const l=Ge(s,xm(".quick-input-list-label-meta"));return t.detail=new MH(l,{supportHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.detail),t.separator=Ge(t.entry,xm(".quick-input-list-separator")),t.actionBar=new Ig(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,i){var r,o,s,a;i.element=e,e.element=(r=i.entry)!==null&&r!==void 0?r:void 0;const l=e.item?e.item:e.separator;i.checkbox.checked=e.checked,i.toDisposeElement.push(e.onChecked(p=>i.checkbox.checked=p));const{labelHighlights:c,descriptionHighlights:u,detailHighlights:d}=e;if(!((o=e.item)===null||o===void 0)&&o.iconPath){const p=i2(this.themeService.getColorTheme().type)?e.item.iconPath.dark:(s=e.item.iconPath.light)!==null&&s!==void 0?s:e.item.iconPath.dark,m=Tn.revive(p);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=lw(m)}else i.icon.style.backgroundImage="",i.icon.className=!((a=e.item)===null||a===void 0)&&a.iconClass?`quick-input-list-icon ${e.item.iconClass}`:"";const h={matches:c||[],descriptionTitle:e.saneDescription,descriptionMatches:u||[],labelEscapeNewLines:!0};l.type!=="separator"?(h.extraClasses=l.iconClasses,h.italic=l.italic,h.strikethrough=l.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item")):i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(e.saneLabel,e.saneDescription,h),i.keybinding.set(l.type==="separator"?void 0:l.keybinding),e.saneDetail?(i.detail.element.style.display="",i.detail.setLabel(e.saneDetail,void 0,{matches:d,title:e.saneDetail,labelEscapeNewLines:!0})):i.detail.element.style.display="none",e.item&&e.separator&&e.separator.label?(i.separator.textContent=e.separator.label,i.separator.style.display=""):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const g=l.buttons;g&&g.length?(i.actionBar.push(g.map((p,m)=>{let _=p.iconClass||(p.iconPath?Oae(p.iconPath):void 0);return p.alwaysVisible&&(_=_?`${_} always-visible`:"always-visible"),{id:`id-${m}`,class:_,enabled:!0,label:"",tooltip:p.tooltip||"",run:()=>{l.type!=="separator"?e.fireButtonTriggered({button:p,item:l}):e.fireSeparatorButtonTriggered({button:p,separator:l})}}}),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){i.toDisposeElement=Hr(i.toDisposeElement),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=Hr(e.toDisposeElement),e.toDisposeTemplate=Hr(e.toDisposeTemplate)}}P5.ID="listelement";class GQi{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return P5.ID}}var ml;(function(n){n[n.First=1]="First",n[n.Second=2]="Second",n[n.Last=3]="Last",n[n.Next=4]="Next",n[n.Previous=5]="Previous",n[n.NextPage=6]="NextPage",n[n.PreviousPage=7]="PreviousPage"})(ml||(ml={}));class vve{constructor(e,t,i,r){this.parent=e,this.options=i,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnLabelMode="fuzzy",this.sortByLabel=!0,this._onChangedAllVisibleChecked=new be,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new be,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new be,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new be,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new be,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new be,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new be,this.onKeyDown=this._onKeyDown.event,this._onLeave=new be,this.onLeave=this._onLeave.event,this._listElementChecked=new be,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=Ge(this.parent,xm(".quick-input-list"));const o=new GQi,s=new XQi;if(this.list=i.createList("QuickInput",this.container,o,[new P5(r)],{identityProvider:{getId:a=>{var l,c,u,d,h,g,p,m;return(m=(g=(d=(c=(l=a.item)===null||l===void 0?void 0:l.id)!==null&&c!==void 0?c:(u=a.item)===null||u===void 0?void 0:u.label)!==null&&d!==void 0?d:(h=a.separator)===null||h===void 0?void 0:h.id)!==null&&g!==void 0?g:(p=a.separator)===null||p===void 0?void 0:p.label)!==null&&m!==void 0?m:""}},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:s}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(a=>{const l=new Oo(a);switch(l.keyCode){case 10:this.toggleCheckbox();break;case 31:(Qi?a.metaKey:a.ctrlKey)&&this.list.setFocus(xu(this.list.length));break;case 16:{const c=this.list.getFocus();c.length===1&&c[0]===0&&this._onLeave.fire();break}case 18:{const c=this.list.getFocus();c.length===1&&c[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(l)})),this.disposables.push(this.list.onMouseDown(a=>{a.browserEvent.button!==2&&a.browserEvent.preventDefault()})),this.disposables.push(We(this.container,Lt.CLICK,a=>{(a.x||a.y)&&this._onLeave.fire()})),this.disposables.push(this.list.onMouseMiddleClick(a=>{this._onLeave.fire()})),this.disposables.push(this.list.onContextMenu(a=>{typeof a.index=="number"&&(a.browserEvent.preventDefault(),this.list.setSelection([a.index]))})),i.hoverDelegate){const a=new PUe(i.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver(l=>OAe(this,void 0,void 0,function*(){var c;if(l.browserEvent.target instanceof HTMLAnchorElement){a.cancel();return}if(!(!(l.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&gc(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)))try{yield a.trigger(()=>OAe(this,void 0,void 0,function*(){l.element&&this.showHover(l.element)}))}catch(u){if(!R_(u))throw u}}))),this.disposables.push(this.list.onMouseOut(l=>{var c;gc(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)||a.cancel()})),this.disposables.push(a)}this.disposables.push(this._listElementChecked.event(a=>this.fireCheckedEvents())),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onSeparatorButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return Pt.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return Pt.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(t=>t.item),event:e.browserEvent}))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get ariaLabel(){return this.list.getHTMLElement().ariaLabel}set ariaLabel(e){this.list.getHTMLElement().ariaLabel=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let i=0,r=e.length;i<r;i++){const o=e[i];if(!o.hidden)if(o.checked)t=!0;else return!1}return t}getCheckedCount(){let e=0;const t=this.elements;for(let i=0,r=t.length;i<r;i++)t[i].checked&&e++;return e}getVisibleCount(){let e=0;const t=this.elements;for(let i=0,r=t.length;i<r;i++)t[i].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=Hr(this.elementDisposables);const t=s=>this.fireButtonTriggered(s),i=s=>this.fireSeparatorButtonTriggered(s);this.inputElements=e;const r=new Map,o=this.parent.classList.contains("show-checkboxes");this.elements=e.reduce((s,a,l)=>{var c;const u=l>0?e[l-1]:void 0;if(a.type==="separator"&&!a.buttons)return s;const d=new KQi(a,u,l,o,t,i,this._listElementChecked),h=s.length;return s.push(d),r.set((c=d.item)!==null&&c!==void 0?c:d.separator,h),s},[]),this.elementsToIndexes=r,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(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t))),e.length>0){const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t)))}getCheckedElements(){return this.elements.filter(e=>e.checked).map(e=>e.item).filter(e=>!!e)}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const i of this.elements)i.checked=t.has(i.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===ml.Second&&this.list.length<2&&(e=ml.First),e){case ml.First:this.list.scrollTop=0,this.list.focusFirst(void 0,i=>!!i.item);break;case ml.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,i=>!!i.item);break;case ml.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,i=>!!i.item);break;case ml.Next:{this.list.focusNext(void 0,!0,void 0,r=>!!r.item);const i=this.list.getFocus()[0];i!==0&&!this.elements[i-1].item&&this.list.firstVisibleIndex>i-1&&this.list.reveal(i-1);break}case ml.Previous:{this.list.focusPrevious(void 0,!0,void 0,r=>!!r.item);const i=this.list.getFocus()[0];i!==0&&!this.elements[i-1].item&&this.list.firstVisibleIndex>i-1&&this.list.reveal(i-1);break}case ml.NextPage:this.list.focusNextPage(void 0,i=>!!i.item);break;case ml.PreviousPage:this.list.focusPreviousPage(void 0,i=>!!i.item);break}const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}showHover(e){var t,i,r;this.options.hoverDelegate!==void 0&&(this._lastHover&&!this._lastHover.isDisposed&&((i=(t=this.options.hoverDelegate).onDidHideHover)===null||i===void 0||i.call(t),(r=this._lastHover)===null||r===void 0||r.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.options.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:o=>{this.options.linkOpenerDelegate(o)},showPointer:!0,container:this.container,hoverPosition:1},!1)))}layout(e){this.list.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this.elements.forEach(r=>{r.labelHighlights=void 0,r.descriptionHighlights=void 0,r.detailHighlights=void 0,r.hidden=!1;const o=r.index&&this.inputElements[r.index-1];r.item&&(r.separator=o&&o.type==="separator"&&!o.buttons?o:void 0)});else{let r;this.elements.forEach(o=>{var s,a,l,c;let u;this.matchOnLabelMode==="fuzzy"?u=this.matchOnLabel&&(s=YZ(e,BN(o.saneLabel)))!==null&&s!==void 0?s:void 0:u=this.matchOnLabel&&(a=YQi(t,BN(o.saneLabel)))!==null&&a!==void 0?a:void 0;const d=this.matchOnDescription&&(l=YZ(e,BN(o.saneDescription||"")))!==null&&l!==void 0?l:void 0,h=this.matchOnDetail&&(c=YZ(e,BN(o.saneDetail||"")))!==null&&c!==void 0?c:void 0;if(u||d||h?(o.labelHighlights=u,o.descriptionHighlights=d,o.detailHighlights=h,o.hidden=!1):(o.labelHighlights=void 0,o.descriptionHighlights=void 0,o.detailHighlights=void 0,o.hidden=o.item?!o.item.alwaysShow:!0),o.item?o.separator=void 0:o.separator&&(o.hidden=!0),!this.sortByLabel){const g=o.index&&this.inputElements[o.index-1];r=g&&g.type==="separator"?g:r,r&&!o.hidden&&(o.separator=r,r=void 0)}})}const i=this.elements.filter(r=>!r.hidden);if(this.sortByLabel&&e){const r=e.toLowerCase();i.sort((o,s)=>QQi(o,s,r))}return this.elementsToIndexes=i.reduce((r,o,s)=>{var a;return r.set((a=o.item)!==null&&a!==void 0?a:o.separator,s),r},new Map),this.list.splice(0,this.list.length,i),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(i.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const i of e)i.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return this.container.style.display!=="none"}dispose(){this.elementDisposables=Hr(this.elementDisposables),this.disposables=Hr(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)}fireSeparatorButtonTriggered(e){this._onSeparatorButtonTriggered.fire(e)}style(e){this.list.style(e)}toggleHover(){const e=this.list.getFocusedElements()[0];if(!(e!=null&&e.saneTooltip))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}const t=this.list.getFocusedElements()[0];if(!t)return;this.showHover(t);const i=new nt;i.add(this.list.onDidChangeFocus(r=>{r.indexes.length&&this.showHover(r.elements[0])})),this._lastHover&&i.add(this._lastHover),this._toggleHover=i,this.elementDisposables.push(this._toggleHover)}}OGe([fa],vve.prototype,"onDidChangeFocus",null);OGe([fa],vve.prototype,"onDidChangeSelection",null);function YQi(n,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return PAe(n,t);const r=d5(t," "),o=t.length-r.length,s=PAe(n,r);if(s)for(const a of s){const l=i[a.start+o]+o;a.start+=l,a.end+=l}return s}function PAe(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t!==-1?[{start:t,end:t+n.length}]:null}function QQi(n,e,t){const i=n.labelHighlights||[],r=e.labelHighlights||[];return i.length&&!r.length?-1:!i.length&&r.length?1:i.length===0&&r.length===0?0:VQi(n.saneSortLabel,e.saneSortLabel,t)}class XQi{getWidgetAriaLabel(){return E("quickInput","Quick Input")}getAriaLabel(e){var t;return!((t=e.separator)===null||t===void 0)&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`: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 MAe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const Pae={iconClass:In.asClassName(Ct.quickInputBack),tooltip:E("quickInput.back","Back"),handle:-1};class M5 extends Ae{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=M5.noPromptMessage,this._severity=js.Ignore,this.onDidTriggerButtonEmitter=this._register(new be),this.onDidHideEmitter=this._register(new be),this.onDisposeEmitter=this._register(new be),this.visibleDisposables=this._register(new nt),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&&!C_;this._ignoreFocusOut=e&&!C_,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!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=>{this.buttons.indexOf(e)!==-1&&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.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=d4.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const i=this.getTitle();i&&this.ui.title.textContent!==i?this.ui.title.textContent=i:!i&&this.ui.title.innerHTML!=="&nbsp;"&&(this.ui.title.innerText=" ");const r=this.getDescription();if(this.ui.description1.textContent!==r&&(this.ui.description1.textContent=r),this.ui.description2.textContent!==r&&(this.ui.description2.textContent=r),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?Yl(this.ui.widget,this._widget):Yl(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new nm,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 s=this.buttons.filter(l=>l===Pae);this.ui.leftActionBar.push(s.map((l,c)=>{const u=new Gu(`id-${c}`,"",l.iconClass||Oae(l.iconPath),!0,()=>MAe(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(l)}));return u.tooltip=l.tooltip||"",u}),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const a=this.buttons.filter(l=>l!==Pae);this.ui.rightActionBar.push(a.map((l,c)=>{const u=new Gu(`id-${c}`,"",l.iconClass||Oae(l.iconPath),!0,()=>MAe(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(l)}));return u.tooltip=l.tooltip||"",u}),{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const s=(t=(e=this.toggles)===null||e===void 0?void 0:e.filter(a=>a instanceof DA))!==null&&t!==void 0?t:[];this.ui.inputBox.toggles=s}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const o=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==o&&(this._lastValidationMessage=o,Yl(this.ui.message),qQi(o,this.ui.message,{callback:s=>{this.ui.linkOpenerDelegate(s)},disposables:this.visibleDisposables})),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?E("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==js.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()}}M5.noPromptMessage=E("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class h4 extends M5{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new be),this.onWillAcceptEmitter=this._register(new be),this.onDidAcceptEmitter=this._register(new be),this.onDidCustomEmitter=this._register(new be),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._autoFocusOnList=!0,this._keepScrollPosition=!1,this._itemActivation=Mm.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new be),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new be),this.onDidTriggerItemButtonEmitter=this._register(new be),this.onDidTriggerSeparatorButtonEmitter=this._register(new be),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,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.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){this._value!==e&&(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 matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=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?AQi: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(ml.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(ml.Next),this.canSelectMany&&this.ui.list.domFocus(),yi.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(ml.Previous):this.ui.list.focus(ml.Last),this.canSelectMany&&this.ui.list.domFocus(),yi.stop(e,!0);break;case 12:this.ui.list.focus(ml.NextPage),this.canSelectMany&&this.ui.list.domFocus(),yi.stop(e,!0);break;case 11:this.ui.list.focus(ml.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),yi.stop(e,!0);break;case 17:if(!this._canAcceptInBackground||!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(ml.First),yi.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(ml.Last),yi.stop(e,!0));break}})),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&&Qs(e,this._activeItems,(t,i)=>t===i)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&Qs(e,this._selectedItems,(i,r)=>i===r)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(t instanceof MouseEvent&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&Qs(e,this._selectedItems,(t,i)=>t===i)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.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 We(this.ui.container,Lt.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Oo(e),i=t.keyCode;this._quickNavigate.keybindings.some(s=>{const a=s.getChords();return a.length>1?!1:a[0].shiftKey&&i===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&i===6||a[0].ctrlKey&&i===5||a[0].metaKey&&i===57)})&&(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.description,i={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),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||"");let r=this.ariaLabel;if(!r&&i.inputBox&&(r=this.placeholder||h4.DEFAULT_ARIA_LABEL,this.title&&(r+=` - ${this.title}`)),this.ui.list.ariaLabel!==r&&(this.ui.list.ariaLabel=r??null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,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 Mm.NONE:this._itemActivation=Mm.FIRST;break;case Mm.SECOND:this.ui.list.focus(ml.Second),this._itemActivation=Mm.FIRST;break;case Mm.LAST:this.ui.list.focus(ml.Last),this._itemActivation=Mm.FIRST;break;default:this.trySelectFirst();break}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||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(ml.First)),this.keepScrollPosition&&(this.scrollTop=e)}}h4.DEFAULT_ARIA_LABEL=E("quickInputBox.ariaLabel","Type to narrow down results.");class ZQi extends M5{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new be),this.onDidAcceptEmitter=this._register(new be),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),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||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}}const zd=at;class Oq extends Ae{constructor(e,t){super(),this.options=e,this.themeService=t,this.enabled=!0,this.onDidAcceptEmitter=this._register(new be),this.onDidCustomEmitter=this._register(new be),this.onDidTriggerButtonEmitter=this._register(new be),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new be),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new be),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=t=>{this.keyMods.ctrlCmd=t.ctrlKey||t.metaKey,this.keyMods.alt=t.altKey};this._register(We(window,Lt.KEY_DOWN,e,!0)),this._register(We(window,Lt.KEY_UP,e,!0)),this._register(We(window,Lt.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=Ge(this.parentElement,zd(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=Eg(e),i=Ge(e,zd(".quick-input-titlebar")),r=this.options.hoverDelegate?{hoverDelegate:this.options.hoverDelegate}:void 0,o=this._register(new Ig(i,r));o.domNode.classList.add("quick-input-left-action-bar");const s=Ge(i,zd(".quick-input-title")),a=this._register(new Ig(i,r));a.domNode.classList.add("quick-input-right-action-bar");const l=Ge(e,zd(".quick-input-header")),c=Ge(l,zd("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",E("quickInput.checkAll","Toggle all checkboxes")),this._register(ua(c,Lt.CHANGE,O=>{const B=c.checked;P.setAllVisibleChecked(B)})),this._register(We(c,Lt.CLICK,O=>{(O.x||O.y)&&g.setFocus()}));const u=Ge(l,zd(".quick-input-description")),d=Ge(l,zd(".quick-input-and-message")),h=Ge(d,zd(".quick-input-filter")),g=this._register(new OQi(h,this.styles.inputBox,this.styles.toggle));g.setAttribute("aria-describedby",`${this.idPrefix}message`);const p=Ge(h,zd(".quick-input-visible-count"));p.setAttribute("aria-live","polite"),p.setAttribute("aria-atomic","true");const m=new Nae(p,{countFormat:E({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")},this.styles.countBadge),_=Ge(h,zd(".quick-input-count"));_.setAttribute("aria-live","polite");const v=new Nae(_,{countFormat:E({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")},this.styles.countBadge),b=Ge(l,zd(".quick-input-action")),y=this._register(new Rae(b,this.styles.button));y.label=E("ok","OK"),this._register(y.onDidClick(O=>{this.onDidAcceptEmitter.fire()}));const C=Ge(l,zd(".quick-input-action")),x=this._register(new Rae(C,this.styles.button));x.label=E("custom","Custom"),this._register(x.onDidClick(O=>{this.onDidCustomEmitter.fire()}));const k=Ge(d,zd(`#${this.idPrefix}message.quick-input-message`)),I=this._register(new Nq(e,this.styles.progressBar));I.getContainer().classList.add("quick-input-progress");const L=Ge(e,zd(".quick-input-html-widget"));L.tabIndex=-1;const D=Ge(e,zd(".quick-input-description")),R=this.idPrefix+"list",P=this._register(new vve(e,R,this.options,this.themeService));g.setAttribute("aria-controls",R),this._register(P.onDidChangeFocus(()=>{var O;g.setAttribute("aria-activedescendant",(O=P.getActiveDescendant())!==null&&O!==void 0?O:"")})),this._register(P.onChangedAllVisibleChecked(O=>{c.checked=O})),this._register(P.onChangedVisibleCount(O=>{m.setCount(O)})),this._register(P.onChangedCheckedCount(O=>{v.setCount(O)})),this._register(P.onLeave(()=>{setTimeout(()=>{g.setFocus(),this.controller instanceof h4&&this.controller.canSelectMany&&P.clearFocus()},0)}));const M=lb(e);return this._register(M),this._register(We(e,Lt.FOCUS,O=>{gc(O.relatedTarget,e)||(this.previousFocusElement=O.relatedTarget instanceof HTMLElement?O.relatedTarget:void 0)},!0)),this._register(M.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(d4.Blur),this.previousFocusElement=void 0})),this._register(We(e,Lt.FOCUS,O=>{g.setFocus()})),this._register(ua(e,Lt.KEY_DOWN,O=>{if(!gc(O.target,L))switch(O.keyCode){case 3:yi.stop(O,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:yi.stop(O,!0),this.hide(d4.Gesture);break;case 2:if(!O.altKey&&!O.ctrlKey&&!O.metaKey){const B=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(e.classList.contains("show-checkboxes")?B.push("input"):B.push("input[type=text]"),this.getUI().list.isDisplayed()&&B.push(".monaco-list"),this.getUI().message&&B.push(".quick-input-message a"),this.getUI().widget){if(gc(O.target,this.getUI().widget))break;B.push(".quick-input-html-widget")}const F=e.querySelectorAll(B.join(", "));O.shiftKey&&O.target===F[0]?(yi.stop(O,!0),P.clearFocus()):!O.shiftKey&&gc(O.target,F[F.length-1])&&(yi.stop(O,!0),F[0].focus())}break;case 10:O.ctrlKey&&(yi.stop(O,!0),this.getUI().list.toggleHover());break}})),this.ui={container:e,styleSheet:t,leftActionBar:o,titleBar:i,title:s,description1:D,description2:u,widget:L,rightActionBar:a,checkAll:c,inputContainer:d,filterContainer:h,inputBox:g,visibleCountContainer:p,visibleCount:m,countContainer:_,count:v,okContainer:b,ok:y,message:k,customButtonContainer:C,customButton:x,list:P,progressBar:I,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:O=>this.show(O),hide:()=>this.hide(),setVisibilities:O=>this.setVisibilities(O),setEnabled:O=>this.setEnabled(O),setContextKey:O=>this.options.setContextKey(O),linkOpenerDelegate:O=>this.options.linkOpenerDelegate(O)},this.updateStyles(),this.ui}pick(e,t={},i=Mi.None){return new Promise((r,o)=>{let s=u=>{var d;s=r,(d=t.onKeyMods)===null||d===void 0||d.call(t,a.keyMods),r(u)};if(i.isCancellationRequested){s(void 0);return}const a=this.createQuickPick();let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)s(a.selectedItems.slice()),a.hide();else{const u=a.activeItems[0];u&&(s(u),a.hide())}}),a.onDidChangeActive(u=>{const d=u[0];d&&t.onDidFocus&&t.onDidFocus(d)}),a.onDidChangeSelection(u=>{if(!a.canSelectMany){const d=u[0];d&&(s(d),a.hide())}}),a.onDidTriggerItemButton(u=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},u),{removeItem:()=>{const d=a.items.indexOf(u.item);if(d!==-1){const h=a.items.slice(),g=h.splice(d,1),p=a.activeItems.filter(_=>_!==g[0]),m=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=h,p&&(a.activeItems=p),a.keepScrollPosition=m}}}))),a.onDidTriggerSeparatorButton(u=>{var d;return(d=t.onDidTriggerSeparatorButton)===null||d===void 0?void 0:d.call(t,u)}),a.onDidChangeValue(u=>{l&&!u&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{Hr(c),s(void 0)})];a.title=t.title,a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.autoFocusOnList=t.autoFocusOnList===void 0||t.autoFocusOnList,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([u,d])=>{l=d,a.busy=!1,a.items=u,a.canSelectMany&&(a.selectedItems=u.filter(h=>h.type!=="separator"&&h.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,u=>{o(u),a.hide()})})}createQuickPick(){const e=this.getUI();return new h4(e)}createInputBox(){const e=this.getUI();return new ZQi(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const i=this.controller;this.controller=e,i==null||i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",Yl(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(js.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),Yl(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,t.inputBox.toggles=void 0;const r=this.options.backKeybindingLabel();Pae.tooltip=r?E("quickInput.backWithKeybinding","Back ({0})",r):E("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.inputContainer.style.display=e.inputBox?"":"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.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t,i,r;const o=this.controller;if(!o)return;const s=!gc(document.activeElement,(i=(t=this.ui)===null||t===void 0?void 0:t.container)!==null&&i!==void 0?i:null);if(this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",!s){let a=this.previousFocusElement;for(;a&&!a.offsetParent;)a=(r=a.parentElement)!==null&&r!==void 0?r:void 0;a!=null&&a.offsetParent?(a.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}o.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isDisplayed()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,Oq.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:r,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=r?`1px solid ${r}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list);const s=[];this.styles.pickerGroup.pickerGroupBorder&&s.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&s.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(s.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&s.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&s.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&s.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&s.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&s.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),s.push("}"));const a=s.join(`
`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}isDisplayed(){return this.ui&&this.ui.container.style.display!=="none"}}Oq.MAX_WIDTH=600;var JQi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},e$=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Mae=class extends RHi{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(Aae))),this._quickAccess}constructor(e,t,i,r){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=r,this._onShow=this._register(new be),this._onHide=this._register(new be),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(s=>{s.get(mh).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(o,s,a,l,c)=>this.instantiationService.createInstance(Iae,o,s,a,l,c),styles:this.computeStyles()},r=this._register(new Oq(Object.assign(Object.assign({},i),t),this.themeService));return r.layout(e.dimension,e.offset.quickPickTop),this._register(e.onDidLayout(o=>r.layout(o,e.offset.quickPickTop))),this._register(r.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(r.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),r}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new Ft(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t==null||t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=Mi.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:Bt(kDe),quickInputForeground:Bt(B7i),quickInputTitleBackground:Bt($7i),widgetBorder:Bt(i_e),widgetShadow:Bt(Ov)},inputBox:EH,toggle:SH,countBadge:sGe,button:aYi,progressBar:lYi,keybindingLabel:sYi,list:IA({listBackground:kDe,listFocusBackground:DE,listFocusForeground:LE,listInactiveFocusForeground:LE,listInactiveSelectionIconForeground:VI,listInactiveFocusBackground:DE,listFocusOutline:Ho,listInactiveFocusOutline:Ho}),pickerGroup:{pickerGroupBorder:Bt(V7i),pickerGroupForeground:Bt(mqe)}}}};Mae=JQi([e$(0,Un),e$(1,Yn),e$(2,ll),e$(3,TA)],Mae);var PGe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},JI=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Fae=class extends Mae{constructor(e,t,i,r,o){super(t,i,r,new zse(e.getContainerDomNode(),o)),this.host=void 0;const s=g2.get(e);if(s){const a=s.widget;this.host={_serviceBrand:void 0,get hasContainer(){return!0},get container(){return a.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus(),offset:{top:0,quickPickTop:0}}}else this.host=void 0}createController(){return super.createController(this.host)}};Fae=PGe([JI(1,Un),JI(2,Yn),JI(3,ll),JI(4,Lr)],Fae);let Bae=class{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 i=t=this.instantiationService.createInstance(Fae,e);this.mapEditorToService.set(e,t),sw(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},i=Mi.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};Bae=PGe([JI(0,Un),JI(1,Lr)],Bae);class g2{static get(e){return e.getContribution(g2.ID)}constructor(e){this.editor=e,this.widget=new Pq(this.editor)}dispose(){this.widget.dispose()}}g2.ID="editor.controller.quickInput";class Pq{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return Pq.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}Pq.ID="editor.contrib.quickInputWidget";gr(g2.ID,g2,4);class eXi{constructor(e,t,i,r,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=r,this.background=o}}function tXi(n){if(!n||!Array.isArray(n))return[];const e=[];let t=0;for(let i=0,r=n.length;i<r;i++){const o=n[i];let s=-1;if(typeof o.fontStyle=="string"){s=0;const c=o.fontStyle.split(" ");for(let u=0,d=c.length;u<d;u++)switch(c[u]){case"italic":s=s|1;break;case"bold":s=s|2;break;case"underline":s=s|4;break;case"strikethrough":s=s|8;break}}let a=null;typeof o.foreground=="string"&&(a=o.foreground);let l=null;typeof o.background=="string"&&(l=o.background),e[t++]=new eXi(o.token||"",i,s,a,l)}return e}function nXi(n,e){n.sort((u,d)=>{const h=aXi(u.token,d.token);return h!==0?h:u.index-d.index});let t=0,i="000000",r="ffffff";for(;n.length>=1&&n[0].token==="";){const u=n.shift();u.fontStyle!==-1&&(t=u.fontStyle),u.foreground!==null&&(i=u.foreground),u.background!==null&&(r=u.background)}const o=new rXi;for(const u of e)o.getId(u);const s=o.getId(i),a=o.getId(r),l=new bve(t,s,a),c=new yve(l);for(let u=0,d=n.length;u<d;u++){const h=n[u];c.insert(h.token,h.fontStyle,o.getId(h.foreground),o.getId(h.background))}return new MGe(o,c)}const iXi=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class rXi{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(e===null)return 0;const t=e.match(iXi);if(!t)throw new Error("Illegal value for token color: "+e);e=t[1].toUpperCase();let i=this._color2id.get(e);return i||(i=++this._lastColorId,this._color2id.set(e,i),this._id2color[i]=De.fromHex("#"+e),i)}getColorMap(){return this._id2color.slice(0)}}class MGe{static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme(tXi(e),t)}static createFromParsedTokenTheme(e,t){return nXi(e,t)}constructor(e,t){this._colorMap=e,this._root=t,this._cache=new Map}getColorMap(){return this._colorMap.getColorMap()}_match(e){return this._root.match(e)}match(e,t){let i=this._cache.get(t);if(typeof i>"u"){const r=this._match(t),o=sXi(t);i=(r.metadata|o<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const oXi=/\b(comment|string|regex|regexp)\b/;function sXi(n){const e=n.match(oXi);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function aXi(n,e){return n<e?-1:n>e?1:0}class bve{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new bve(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),i!==0&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class yve{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 i,r;t===-1?(i=e,r=""):(i=e.substring(0,t),r=e.substring(t+1));const o=this._children.get(i);return typeof o<"u"?o.match(r):this._mainRule}insert(e,t,i,r){if(e===""){this._mainRule.acceptOverwrite(t,i,r);return}const o=e.indexOf(".");let s,a;o===-1?(s=e,a=""):(s=e.substring(0,o),a=e.substring(o+1));let l=this._children.get(s);typeof l>"u"&&(l=new yve(this._mainRule.clone()),this._children.set(s,l)),l.insert(a,t,i,r)}}function lXi(n){const e=[];for(let t=1,i=n.length;t<i;t++){const r=n[t];e[t]=`.mtk${t} { color: ${r}; }`}return e.push(".mtki { font-style: italic; }"),e.push(".mtkb { font-weight: bold; }"),e.push(".mtku { text-decoration: underline; text-underline-position: under; }"),e.push(".mtks { text-decoration: line-through; }"),e.push(".mtks.mtku { text-decoration: underline line-through; text-underline-position: under; }"),e.join(`
`)}const cXi={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:{[tl]:"#FFFFFE",[bp]:"#000000",[_qe]:"#E5EBF1",[E5]:"#D3D3D3",[x5]:"#939393",[s_e]:"#ADD6FF4D"}},uXi={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:{[tl]:"#1E1E1E",[bp]:"#D4D4D4",[_qe]:"#3A3D41",[E5]:"#404040",[x5]:"#707070",[s_e]:"#ADD6FF26"}},dXi={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:{[tl]:"#000000",[bp]:"#FFFFFF",[E5]:"#FFFFFF",[x5]:"#FFFFFF"}},hXi={base:"hc-light",inherit:!1,rules:[{token:"",foreground:"292929",background:"FFFFFF"},{token:"invalid",foreground:"B5200D"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"264F70"},{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:"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:"B5200D"},{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:"264F78"},{token:"attribute.value",foreground:"0451A5"},{token:"string",foreground:"A31515"},{token:"string.sql",foreground:"B5200D"},{token:"keyword",foreground:"0000FF"},{token:"keyword.flow",foreground:"AF00DB"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[tl]:"#FFFFFF",[bp]:"#292929",[E5]:"#292929",[x5]:"#292929"}},fXi={IconContribution:"base.contributions.icons"};var FAe;(function(n){function e(t,i){let r=t.defaults;for(;In.isThemeIcon(r);){const o=Hk.getIcon(r.id);if(!o)return;r=o.defaults}return r}n.getDefinition=e})(FAe||(FAe={}));var BAe;(function(n){function e(i){return{weight:i.weight,style:i.style,src:i.src.map(r=>({format:r.format,location:r.location.toString()}))}}n.toJSONObject=e;function t(i){const r=o=>Ku(o)?o:void 0;if(i&&Array.isArray(i.src)&&i.src.every(o=>Ku(o.format)&&Ku(o.location)))return{weight:r(i.weight),style:r(i.style),src:i.src.map(o=>({format:o.format,location:Tn.parse(o.location)}))}}n.fromJSONObject=t})(BAe||(BAe={}));class gXi{constructor(){this._onDidChange=new be,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:E("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:E("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${In.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,r){const o=this.iconsById[e];if(o){if(i&&!o.description){o.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=i),this._onDidChange.fire()}return o}const s={id:e,description:i,defaults:t,deprecationMessage:r};this.iconsById[e]=s;const a={$ref:"#/definitions/icons"};return r&&(a.deprecationMessage=r),i&&(a.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),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=(o,s)=>o.id.localeCompare(s.id),t=o=>{for(;In.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return`codicon codicon-${o?o.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const r=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of r.filter(s=>!!s.description).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|${In.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of r.filter(s=>!In.isThemeIcon(s.defaults)).sort(e))i.push(`|<i class="${t(o)}"></i>|${o.id}|`);return i.join(`
`)}}const Hk=new gXi;ds.add(fXi.IconContribution,Hk);function Js(n,e,t,i){return Hk.registerIcon(n,e,t,i)}function FGe(){return Hk}function pXi(){const n=Kje();for(const e in n){const t="\\"+n[e].toString(16);Hk.registerIcon(e,{fontCharacter:t})}}pXi();const BGe="vscode://schemas/icons",$Ge=ds.as(XU.JSONContribution);$Ge.registerSchema(BGe,Hk.getIconSchema());const $Ae=new so(()=>$Ge.notifySchemaChanged(BGe),200);Hk.onDidChange(()=>{$Ae.isScheduled()||$Ae.schedule()});const VGe=Js("widget-close",Ct.close,E("widgetClose","Icon for the close action in widgets."));Js("goto-previous-location",Ct.arrowUp,E("previousChangeIcon","Icon for goto previous editor location."));Js("goto-next-location",Ct.arrowDown,E("nextChangeIcon","Icon for goto next editor location."));In.modify(Ct.sync,"spin");In.modify(Ct.loading,"spin");function mXi(n){const e=new nt,t=e.add(new be),i=FGe();return e.add(i.onDidChange(()=>t.fire())),n&&e.add(n.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const r=n?n.getProductIconTheme():new HGe,o={},s=l=>{const c=r.getIcon(l);if(!c)return;const u=c.font;return u?(o[u.id]=u.definition,`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${RLe(u.id)}; }`):`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`},a=[];for(const l of i.getIcons()){const c=s(l);c&&a.push(c)}for(const l in o){const c=o[l],u=c.weight?`font-weight: ${c.weight};`:"",d=c.style?`font-style: ${c.style};`:"",h=c.src.map(g=>`${lw(g.location)} format('${g.format}')`).join(", ");a.push(`@font-face { src: ${h}; font-family: ${RLe(l)};${u}${d} font-display: block; }`)}return a.join(`
`)}}}class HGe{getIcon(e){const t=FGe();let i=e.defaults;for(;In.isThemeIcon(i);){const r=t.getIcon(i.id);if(!r)return;i=r.defaults}return i}}const ky="vs",UL="vs-dark",nx="hc-black",ix="hc-light",WGe=ds.as(hqe.ColorContribution),_Xi=ds.as(Lqe.ThemingContribution);class zGe{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(Q8(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),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(const t in this.themeData.colors)e.set(t,De.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=$ae(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,De.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=WGe.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case ky:return sg.LIGHT;case nx:return sg.HIGH_CONTRAST_DARK;case ix:return sg.HIGH_CONTRAST_LIGHT;default:return sg.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=$ae(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],r=this.themeData.colors["editor.background"];if(i||r){const o={token:""};i&&(o.foreground=i),r&&(o.background=r),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=MGe.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,s=dc.getForeground(o),a=dc.getFontStyle(o);return{foreground:s,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function Q8(n){return n===ky||n===UL||n===nx||n===ix}function $ae(n){switch(n){case ky:return cXi;case UL:return uXi;case nx:return dXi;case ix:return hXi}}function t$(n){const e=$ae(n);return new zGe(n,e)}class vXi extends Ae{constructor(){super(),this._onColorThemeChange=this._register(new be),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new be),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new HGe,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(ky,t$(ky)),this._knownThemes.set(UL,t$(UL)),this._knownThemes.set(nx,t$(nx)),this._knownThemes.set(ix,t$(ix));const e=this._register(mXi(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}
${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(ky),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),rUe("(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return OV(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Eg(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),Ae.None}_registerShadowDomContainer(e){const t=Eg(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;i<this._styleElements.length;i++)if(this._styleElements[i]===t){this._styleElements.splice(i,1);return}}}}defineTheme(e,t){if(!/^[a-z0-9\-]+$/i.test(e))throw new Error("Illegal theme name!");if(!Q8(t.base)&&!Q8(e))throw new Error("Illegal theme base!");this._knownThemes.set(e,new zGe(e,t)),Q8(e)&&this._knownThemes.forEach(i=>{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(ky),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=window.matchMedia("(forced-colors: active)").matches;if(e!==m_(this._theme.type)){let t;i2(this._theme.type)?t=e?nx:UL:t=e?ix:ky,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:s=>{t[s]||(e.push(s),t[s]=!0)}};_Xi.getThemingParticipants().forEach(s=>s(this._theme,i,this._environment));const r=[];for(const s of WGe.getColors()){const a=this._theme.getColor(s.id,!0);a&&r.push(`${n_e(s.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor { ${r.join(`
`)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(lXi(o)),this._themeCSS=e.join(`
`),this._updateCSS(),ps.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS}
${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const Ef=Vi("themeService");var bXi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},dJ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Vae=class extends Ae{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new be,this._onDidChangeReducedMotion=new be,this._accessibilityModeEnabledContext=b5.bindTo(this._contextKeyService);const r=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration("editor.accessibilitySupport")&&(r(),this._onDidChangeScreenReaderOptimized.fire()),s.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),r(),this._register(this.onDidChangeScreenReaderOptimized(()=>r()));const o=window.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){if(!this._layoutService.hasContainer)return;this._register(We(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.container.classList.toggle("reduce-motion",i),this._layoutService.container.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};Vae=bXi([dJ(0,Yn),dJ(1,TA),dJ(2,Ui)],Vae);var Mq=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},zx=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},rI,g1;let Hae=class{constructor(e,t){this._commandService=e,this._hiddenStates=new FH(t)}createMenu(e,t,i){return new zae(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};Hae=Mq([zx(0,Fs),zx(1,am)],Hae);let FH=rI=class{constructor(e){this._storageService=e,this._disposables=new nt,this._onDidChange=new be,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(rI._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,rI._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(rI._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var i;return(i=this._hiddenByDefaultCache.get(`${e.id}/${t}`))!==null&&i!==void 0?i:!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){var i,r;const o=this._isHiddenByDefault(e,t),s=(r=(i=this._data[e.id])===null||i===void 0?void 0:i.includes(t))!==null&&r!==void 0?r:!1;return o?!s:s}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const o=this._data[e.id];if(i)o?o.indexOf(t)<0&&o.push(t):this._data[e.id]=[t];else if(o){const s=o.indexOf(t);s>=0&&x5i(o,s),o.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(rI._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};FH._key="menu.hiddenCommands";FH=rI=Mq([zx(0,am)],FH);let Wae=g1=class{constructor(e,t,i,r,o){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=i,this._commandService=r,this._contextKeyService=o,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=jl.getMenuItems(this._id);let t;e.sort(g1._compareMenuItems);for(const i of e){const r=i.group||"";(!t||t[0]!==r)&&(t=[r,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_collectContextKeys(e){if(g1._fillInKbExprKeys(e.when,this._structureContextKeys),PI(e)){if(e.command.precondition&&g1._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;g1._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&jl.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[r,o]=i,s=[];for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const l=PI(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=yXi(this._id,l?a.command:a,this._hiddenStates);if(l)s.push(new qp(a.command,a.alt,e,c,this._contextKeyService,this._commandService));else{const u=new g1(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),d=El.join(...u.map(h=>h[1]));d.length>0&&s.push(new kM(a,c,d))}}s.length>0&&t.push([r,s])}return t}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}static _compareMenuItems(e,t){const i=e.group,r=t.group;if(i!==r){if(i){if(!r)return-1}else return 1;if(i==="navigation")return-1;if(r==="navigation")return 1;const a=i.localeCompare(r);if(a!==0)return a}const o=e.order||0,s=t.order||0;return o<s?-1:o>s?1:g1._compareTitles(PI(e)?e.command.title:e.title,PI(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,r=typeof t=="string"?t:t.original;return i.localeCompare(r)}};Wae=g1=Mq([zx(3,Fs),zx(4,Yn)],Wae);let zae=class{constructor(e,t,i,r,o){this._disposables=new nt,this._menuInfo=new Wae(e,t,i.emitEventsForSubmenuChanges,r,o);const s=new so(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(s),this._disposables.add(jl.onDidChangeMenu(u=>{u.has(e)&&s.schedule()}));const a=this._disposables.add(new nt),l=u=>{let d=!1,h=!1,g=!1;for(const p of u)if(d=d||p.isStructuralChange,h=h||p.isEnablementChange,g=g||p.isToggleChange,d&&h&&g)break;return{menu:this,isStructuralChange:d,isEnablementChange:h,isToggleChange:g}},c=()=>{a.add(o.onDidChangeContext(u=>{const d=u.affectsSome(this._menuInfo.structureContextKeys),h=u.affectsSome(this._menuInfo.preconditionContextKeys),g=u.affectsSome(this._menuInfo.toggledContextKeys);(d||h||g)&&this._onDidChange.fire({menu:this,isStructuralChange:d,isEnablementChange:h,isToggleChange:g})})),a.add(t.onDidChange(u=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new Mje({onWillAddFirstListener:c,onDidRemoveLastListener:a.clear.bind(a),delay:i.eventDebounceDelay,merge:l}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};zae=Mq([zx(3,Fs),zx(4,Yn)],zae);function yXi(n,e,t){const i=mBi(e)?e.submenu.id:e.id,r=typeof e.title=="string"?e.title:e.title.value,o=xL({id:`hide/${n.id}/${i}`,label:E("hide.label","Hide '{0}'",r),run(){t.updateHidden(n,i,!0)}}),s=xL({id:`toggle/${n.id}/${i}`,label:r,get checked(){return!t.isHidden(n,i)},run(){t.updateHidden(n,i,!!this.checked)}});return{hide:o,toggle:s,get isHidden(){return!s.checked}}}var CXi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},VAe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},LS=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let jae=class extends Ae{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],(b0||oUe)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const t=new UU;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(i=>LS(this,void 0,void 0,function*(){(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)}))};this.layoutService.hasContainer&&(this._register(We(this.layoutService.container,"click",e)),this._register(We(this.layoutService.container,"keydown",e)))}writeText(e,t){return LS(this,void 0,void 0,function*(){if(t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return yield navigator.clipboard.writeText(e)}catch(o){console.error(o)}const i=document.activeElement,r=document.body.appendChild(at("textarea",{"aria-hidden":!0}));r.style.height="1px",r.style.width="1px",r.style.position="absolute",r.value=e,r.focus(),r.select(),document.execCommand("copy"),i instanceof HTMLElement&&i.focus(),document.body.removeChild(r)})}readText(e){return LS(this,void 0,void 0,function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(t){return console.error(t),""}})}readFindText(){return LS(this,void 0,void 0,function*(){return this.findText})}writeFindText(e){return LS(this,void 0,void 0,function*(){this.findText=e})}writeResources(e){return LS(this,void 0,void 0,function*(){this.resources=e})}readResources(){return LS(this,void 0,void 0,function*(){return this.resources})}};jae=CXi([VAe(0,TA),VAe(1,Sf)],jae);const F0=Vi("clipboardService");var wXi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},SXi=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const XO="data-keybinding-context";let Cve=class{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return Object.assign({},this._value)}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}};class p2 extends Cve{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}p2.INSTANCE=new p2;class f4 extends Cve{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=HL.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(r=>{if(r.source===7){const o=Array.from(this._values,([s])=>s);this._values.clear(),i.fire(new WAe(o))}else{const o=[];for(const s of r.affectedKeys){const a=`config.${s}`,l=this._values.findSuperstr(a);l!==void 0&&(o.push(...Pi.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new WAe(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(f4._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(f4._keyPrefix.length),i=this._configurationService.getValue(t);let r;switch(typeof i){case"number":case"boolean":case"string":r=i;break;default:Array.isArray(i)?r=JSON.stringify(i):r=i}return this._values.set(e,r),r}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}f4._keyPrefix="config.";class EXi{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class HAe{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class WAe{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class xXi{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function kXi(n,e){return n.allKeysContainedIn(new Set(Object.keys(e)))}class jGe extends Ae{constructor(e){super(),this._onDidChangeContext=this._register(new Lx({merge:t=>new xXi(t)})),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 EXi(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 TXi(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):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new HAe(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new HAe(e))}getContext(e){return this._isDisposed?p2.INSTANCE:this.getContextValuesContainer(IXi(e))}dispose(){super.dispose(),this._isDisposed=!0}}let Uae=class extends jGe{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new f4(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?p2.INSTANCE:this._contexts.get(e)||p2.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new Cve(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};Uae=wXi([SXi(0,Ui)],Uae);class TXi extends jGe{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Zl),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(XO)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${i?": "+i:""}`)}this._domNode.setAttribute(XO,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;kXi(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(XO),super.dispose())}getContextValuesContainer(e){return this._isDisposed?p2.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 IXi(n){for(;n;){if(n.hasAttribute(XO)){const e=n.getAttribute(XO);return e?parseInt(e,10):NaN}n=n.parentElement}return 0}function LXi(n,e,t){n.get(Yn).createKey(String(e),DXi(t))}function DXi(n){return Sje(n,e=>{if(typeof e=="object"&&e.$mid===1)return Tn.revive(e).toString();if(e instanceof Tn)return e.toString()})}Xi.registerCommand("_setContext",LXi);Xi.registerCommand({id:"getContextKeyInfo",handler(){return[...Ft.all()].sort((n,e)=>n.key.localeCompare(e.key))},description:{description:E("getContextKeyInfo","A command that returns information about context keys"),args:[]}});Xi.registerCommand("_generateContextKeyInfo",function(){const n=[],e=new Set;for(const t of Ft.all())e.has(t.key)||(e.add(t.key),n.push(t));n.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(n,void 0,2))});let AXi=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class zAe{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),r=this.lookupOrInsertNode(t);i.outgoing.set(r.key,r),r.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new AXi(t,e),this._nodes.set(t,i)),i}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t}
(-> incoming)[${[...i.incoming.keys()].join(", ")}]
(outgoing ->)[${[...i.outgoing.keys()].join(",")}]
`);return e.join(`
`)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),r=this._findCycle(t,i);if(r)return r}}_findCycle(e,t){for(const[i,r]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const o=this._findCycle(r,t);if(o)return o;t.delete(i)}}}const RXi=!1;class jAe extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=(t=e.findCycleSlow())!==null&&t!==void 0?t:`UNABLE to detect cycle, dumping graph:
${e.toString()}`}}class BH{constructor(e=new gq,t=!1,i,r=RXi){var o;this._services=e,this._strict=t,this._parent=i,this._enableTracing=r,this._activeInstantiations=new Set,this._services.set(Un,this),this._globalGraph=r?(o=i==null?void 0:i._globalGraph)!==null&&o!==void 0?o:new zAe(s=>s):void 0}createChild(e){return new BH(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const i=bd.traceInvocation(this._enableTracing,e);let r=!1;try{return e({get:s=>{if(r)throw yme("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(s,i);if(!a)throw new Error(`[invokeFunction] unknown service '${s}'`);return a}},...t)}finally{r=!0,i.stop()}}createInstance(e,...t){let i,r;return e instanceof hv?(i=bd.traceCreation(this._enableTracing,e.ctor),r=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=bd.traceCreation(this._enableTracing,e),r=this._createInstance(e,t,i)),i.stop(),r}_createInstance(e,t=[],i){const r=i_.getServiceDependencies(e).sort((a,l)=>a.index-l.index),o=[];for(const a of r){const l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),o.push(l)}const s=r.length>0?r[0].index:t.length;if(t.length!==s){console.trace(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);const a=s-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,s)}return Reflect.construct(e,t.concat(o))}_setServiceInstance(e,t){if(this._services.get(e)instanceof hv)this._services.set(e,t);else if(this._parent)this._parent._setServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof hv?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){var r;const o=new zAe(l=>l.id.toString());let s=0;const a=[{id:e,desc:t,_trace:i}];for(;a.length;){const l=a.pop();if(o.lookupOrInsertNode(l),s++>1e3)throw new jAe(o);for(const c of i_.getServiceDependencies(l.desc.ctor)){const u=this._getServiceInstanceOrDescriptor(c.id);if(u||this._throwIfStrict(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`,!0),(r=this._globalGraph)===null||r===void 0||r.insertEdge(String(l.id),String(c.id)),u instanceof hv){const d={id:c.id,desc:u,_trace:l._trace.branch(c.id,!0)};o.insertEdge(l,d),a.push(d)}}}for(;;){const l=o.roots();if(l.length===0){if(!o.isEmpty())throw new jAe(o);break}for(const{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof hv){const d=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setServiceInstance(c.id,d)}o.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],r,o){if(this._services.get(e)instanceof hv)return this._createServiceInstance(e,t,i,r,o);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,r,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],r,o){if(r){const s=new BH(void 0,this._strict,this,this._enableTracing);s._globalGraphImplicitDependency=String(e);const a=new Map,l=new D8(()=>{const c=s._createInstance(t,i,o);for(const[u,d]of a){const h=c[u];if(typeof h=="function")for(const g of d)h.apply(c,g)}return a.clear(),c});return new Proxy(Object.create(null),{get(c,u){if(!l.isInitialized&&typeof u=="string"&&(u.startsWith("onDid")||u.startsWith("onWill"))){let g=a.get(u);return g||(g=new Hu,a.set(u,g)),(m,_,v)=>{const b=g.push([m,_,v]);return Gn(b)}}if(u in c)return c[u];const d=l.value;let h=d[u];return typeof h!="function"||(h=h.bind(d),c[u]=h),h},set(c,u,d){return l.value[u]=d,!0},getPrototypeOf(c){return t.prototype}})}else return this._createInstance(t,i,o)}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class bd{static traceInvocation(e,t){return e?new bd(2,t.name||new Error().stack.split(`
`).slice(3,4).join(`
`)):bd._None}static traceCreation(e,t){return e?new bd(1,t.name):bd._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new bd(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;bd._totals+=e;let t=!1;function i(o,s){const a=[],l=new Array(o+1).join(" ");for(const[c,u,d]of s._dep)if(u&&d){t=!0,a.push(`${l}CREATES -> ${c}`);const h=i(o+1,d);h&&a.push(h)}else a.push(`${l}uses -> ${c}`);return a.join(`
`)}const r=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${bd._totals.toFixed(2)}ms)`];(e>2||t)&&bd.all.add(r.join(`
`))}}bd.all=new Set;bd._None=new class extends bd{constructor(){super(0,null)}stop(){}branch(){return this}};bd._totals=0;const NXi=new Set([Si.inMemory,Si.vscodeSourceControl,Si.walkThrough,Si.walkThroughSnippet]);class OXi{constructor(){this._byResource=new Rc,this._byOwner=new Map}set(e,t,i){let r=this._byResource.get(e);r||(r=new Map,this._byResource.set(e,r)),r.set(t,i);let o=this._byOwner.get(t);o||(o=new Rc,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){const i=this._byResource.get(e);return i==null?void 0:i.get(t)}delete(e,t){let i=!1,r=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const s=this._byOwner.get(t);if(s&&(r=s.delete(e)),i!==r)throw new Error("illegal state");return i&&r}values(e){var t,i,r,o;return typeof e=="string"?(i=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&i!==void 0?i:Pi.empty():Tn.isUri(e)?(o=(r=this._byResource.get(e))===null||r===void 0?void 0:r.values())!==null&&o!==void 0?o:Pi.empty():Pi.map(Pi.concat(...this._byOwner.values()),s=>s[1])}}class PXi{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Rc,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const r=this._resourceStats(t);this._add(r),this._data.set(t,r)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(NXi.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===vs.Error?t.errors+=1:i===vs.Warning?t.warnings+=1:i===vs.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 S1{constructor(){this._onMarkerChanged=new Mje({delay:0,merge:S1._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new OXi,this._stats=new PXi(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(_je(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const r=[];for(const o of i){const s=S1._toMarker(e,t,o);s&&r.push(s)}this._data.set(t,e,r),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:r,severity:o,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:u,endColumn:d,relatedInformation:h,tags:g}=i;if(s)return l=l>0?l:1,c=c>0?c:1,u=u>=l?u:l,d=d>0?d:c,{resource:t,owner:e,code:r,severity:o,message:s,source:a,startLineNumber:l,startColumn:c,endLineNumber:u,endColumn:d,relatedInformation:h,tags:g}}changeAll(e,t){const i=[],r=this._data.values(e);if(r)for(const o of r){const s=Pi.first(o);s&&(i.push(s.resource),this._data.delete(s.resource,e))}if(Fc(t)){const o=new Rc;for(const{resource:s,marker:a}of t){const l=S1._toMarker(e,s,a);if(!l)continue;const c=o.get(s);c?c.push(l):(o.set(s,[l]),i.push(s))}for(const[s,a]of o)this._data.set(s,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:r,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const s=this._data.get(i,t);if(s){const a=[];for(const l of s)if(S1._accept(l,r)){const c=a.push(l);if(o>0&&c===o)break}return a}else return[]}else if(!t&&!i){const s=[];for(const a of this._data.values())for(const l of a)if(S1._accept(l,r)){const c=s.push(l);if(o>0&&c===o)return s}return s}else{const s=this._data.values(i??t),a=[];for(const l of s)for(const c of l)if(S1._accept(c,r)){const u=a.push(c);if(o>0&&u===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new Rc;for(const i of e)for(const r of i)t.set(r,!0);return Array.from(t.keys())}}class MXi extends Ae{constructor(){super(...arguments),this._configurationModel=new Lc}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new Lc;const e=ds.as(O_.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const r of e){const o=i[r],s=t[r];o!==void 0?this._configurationModel.addValue(r,o):s?this._configurationModel.addValue(r,s.default):this._configurationModel.removeValue(r)}}}const F5=Vi("audioCue");class Ei{static register(e){return new Ei(e.fileName)}constructor(e){this.fileName=e}}Ei.error=Ei.register({fileName:"error.mp3"});Ei.warning=Ei.register({fileName:"warning.mp3"});Ei.foldedArea=Ei.register({fileName:"foldedAreas.mp3"});Ei.break=Ei.register({fileName:"break.mp3"});Ei.quickFixes=Ei.register({fileName:"quickFixes.mp3"});Ei.taskCompleted=Ei.register({fileName:"taskCompleted.mp3"});Ei.taskFailed=Ei.register({fileName:"taskFailed.mp3"});Ei.terminalBell=Ei.register({fileName:"terminalBell.mp3"});Ei.diffLineInserted=Ei.register({fileName:"diffLineInserted.mp3"});Ei.diffLineDeleted=Ei.register({fileName:"diffLineDeleted.mp3"});Ei.diffLineModified=Ei.register({fileName:"diffLineModified.mp3"});Ei.chatRequestSent=Ei.register({fileName:"chatRequestSent.mp3"});Ei.chatResponsePending=Ei.register({fileName:"chatResponsePending.mp3"});Ei.chatResponseReceived1=Ei.register({fileName:"chatResponseReceived1.mp3"});Ei.chatResponseReceived2=Ei.register({fileName:"chatResponseReceived2.mp3"});Ei.chatResponseReceived3=Ei.register({fileName:"chatResponseReceived3.mp3"});Ei.chatResponseReceived4=Ei.register({fileName:"chatResponseReceived4.mp3"});class FXi{constructor(e){this.randomOneOf=e}}class ur{static register(e){const t=new FXi("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new ur(t,e.name,e.settingsKey);return ur._audioCues.add(i),i}constructor(e,t,i){this.sound=e,this.name=t,this.settingsKey=i}}ur._audioCues=new Set;ur.error=ur.register({name:E("audioCues.lineHasError.name","Error on Line"),sound:Ei.error,settingsKey:"audioCues.lineHasError"});ur.warning=ur.register({name:E("audioCues.lineHasWarning.name","Warning on Line"),sound:Ei.warning,settingsKey:"audioCues.lineHasWarning"});ur.foldedArea=ur.register({name:E("audioCues.lineHasFoldedArea.name","Folded Area on Line"),sound:Ei.foldedArea,settingsKey:"audioCues.lineHasFoldedArea"});ur.break=ur.register({name:E("audioCues.lineHasBreakpoint.name","Breakpoint on Line"),sound:Ei.break,settingsKey:"audioCues.lineHasBreakpoint"});ur.inlineSuggestion=ur.register({name:E("audioCues.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:Ei.quickFixes,settingsKey:"audioCues.lineHasInlineSuggestion"});ur.terminalQuickFix=ur.register({name:E("audioCues.terminalQuickFix.name","Terminal Quick Fix"),sound:Ei.quickFixes,settingsKey:"audioCues.terminalQuickFix"});ur.onDebugBreak=ur.register({name:E("audioCues.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:Ei.break,settingsKey:"audioCues.onDebugBreak"});ur.noInlayHints=ur.register({name:E("audioCues.noInlayHints","No Inlay Hints on Line"),sound:Ei.error,settingsKey:"audioCues.noInlayHints"});ur.taskCompleted=ur.register({name:E("audioCues.taskCompleted","Task Completed"),sound:Ei.taskCompleted,settingsKey:"audioCues.taskCompleted"});ur.taskFailed=ur.register({name:E("audioCues.taskFailed","Task Failed"),sound:Ei.taskFailed,settingsKey:"audioCues.taskFailed"});ur.terminalCommandFailed=ur.register({name:E("audioCues.terminalCommandFailed","Terminal Command Failed"),sound:Ei.error,settingsKey:"audioCues.terminalCommandFailed"});ur.terminalBell=ur.register({name:E("audioCues.terminalBell","Terminal Bell"),sound:Ei.terminalBell,settingsKey:"audioCues.terminalBell"});ur.notebookCellCompleted=ur.register({name:E("audioCues.notebookCellCompleted","Notebook Cell Completed"),sound:Ei.taskCompleted,settingsKey:"audioCues.notebookCellCompleted"});ur.notebookCellFailed=ur.register({name:E("audioCues.notebookCellFailed","Notebook Cell Failed"),sound:Ei.taskFailed,settingsKey:"audioCues.notebookCellFailed"});ur.diffLineInserted=ur.register({name:E("audioCues.diffLineInserted","Diff Line Inserted"),sound:Ei.diffLineInserted,settingsKey:"audioCues.diffLineInserted"});ur.diffLineDeleted=ur.register({name:E("audioCues.diffLineDeleted","Diff Line Deleted"),sound:Ei.diffLineDeleted,settingsKey:"audioCues.diffLineDeleted"});ur.diffLineModified=ur.register({name:E("audioCues.diffLineModified","Diff Line Modified"),sound:Ei.diffLineModified,settingsKey:"audioCues.diffLineModified"});ur.chatRequestSent=ur.register({name:E("audioCues.chatRequestSent","Chat Request Sent"),sound:Ei.chatRequestSent,settingsKey:"audioCues.chatRequestSent"});ur.chatResponseReceived=ur.register({name:E("audioCues.chatResponseReceived","Chat Response Received"),settingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[Ei.chatResponseReceived1,Ei.chatResponseReceived2,Ei.chatResponseReceived3,Ei.chatResponseReceived4]}});ur.chatResponsePending=ur.register({name:E("audioCues.chatResponsePending","Chat Response Pending"),sound:Ei.chatResponsePending,settingsKey:"audioCues.chatResponsePending"});class BXi extends Ae{constructor(e,t=[]){super(),this.logger=new vBi([e,...t]),this._register(e.onDidChangeLogLevel(i=>this.setLevel(i)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(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)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}}const UGe=[];function Fq(n){UGe.push(n)}function $Xi(){return UGe.slice(0)}var rS=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Wl=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},qL=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class VXi{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new be}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let qae=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new zFi(new VXi(t))):Promise.reject(new Error("Model not found"))}};qae=rS([Wl(0,ts)],qae);class Bq{show(){return Bq.NULL_PROGRESS_RUNNER}showWhile(e,t){return qL(this,void 0,void 0,function*(){yield e})}}Bq.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class HXi{withProgress(e,t,i){return t({report:()=>{}})}}class WXi{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class zXi{confirm(e){return qL(this,void 0,void 0,function*(){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}})}doConfirm(e,t){let i=e;return t&&(i=i+`
`+t),window.confirm(i)}prompt(e){var t,i;return qL(this,void 0,void 0,function*(){let r;if(this.doConfirm(e.message,e.detail)){const s=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&s.push(e.cancelButton),r=yield(i=s[0])===null||i===void 0?void 0:i.run({checkboxChecked:!1})}return{result:r}})}error(e,t){return qL(this,void 0,void 0,function*(){yield this.prompt({type:js.Error,message:e,detail:t})})}}class g4{info(e){return this.notify({severity:js.Info,message:e})}warn(e){return this.notify({severity:js.Warning,message:e})}error(e){return this.notify({severity:js.Error,message:e})}notify(e){switch(e.severity){case js.Error:console.error(e.message);break;case js.Warning:console.warn(e.message);break;default:console.log(e.message);break}return g4.NO_OP}prompt(e,t,i,r){return g4.NO_OP}status(e,t){return Ae.None}}g4.NO_OP=new KUi;let Kae=class{constructor(e){this._onWillExecuteCommand=new be,this._onDidExecuteCommand=new be,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=Xi.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const r=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(r)}catch(r){return Promise.reject(r)}}};Kae=rS([Wl(0,Un)],Kae);let m2=class extends tKi{constructor(e,t,i,r,o,s){super(e,t,i,r,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=g=>{const p=new nt;p.add(We(g,Lt.KEY_DOWN,m=>{const _=new Oo(m);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),p.add(We(g,Lt.KEY_UP,m=>{const _=new Oo(m);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new jXi(g,p))},l=g=>{for(let p=0;p<this._domNodeListeners.length;p++){const m=this._domNodeListeners[p];m.domNode===g&&(this._domNodeListeners.splice(p,1),m.dispose())}},c=g=>{g.getOption(61)||a(g.getContainerDomNode())},u=g=>{g.getOption(61)||l(g.getContainerDomNode())};this._register(s.onCodeEditorAdd(c)),this._register(s.onCodeEditorRemove(u)),s.listCodeEditors().forEach(c);const d=g=>{a(g.getContainerDomNode())},h=g=>{l(g.getContainerDomNode())};this._register(s.onDiffEditorAdd(d)),this._register(s.onDiffEditorRemove(h)),s.listDiffEditors().forEach(d)}addDynamicKeybinding(e,t,i,r){return Ip(Xi.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:r}]))}addDynamicKeybindings(e){const t=e.map(i=>{var r;return{keybinding:Yoe(i.keybinding,qh),command:(r=i.command)!==null&&r!==void 0?r:null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Gn(()=>{for(let i=0;i<this._dynamicKeybindings.length;i++)if(this._dynamicKeybindings[i]===t[0]){this._dynamicKeybindings.splice(i,t.length),this.updateResolver();return}})}updateResolver(){this._cachedResolver=null,this._onDidUpdateKeybindings.fire()}_getResolver(){if(!this._cachedResolver){const e=this._toNormalizedKeybindingItems(Ld.getDefaultKeybindings(),!0),t=this._toNormalizedKeybindingItems(this._dynamicKeybindings,!1);this._cachedResolver=new QO(e,t,i=>this._log(i))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let r=0;for(const o of e){const s=o.when||void 0,a=o.keybinding;if(!a)i[r++]=new tAe(void 0,o.command,o.commandArgs,s,t,null,!1);else{const l=e4.resolveKeybinding(a,qh);for(const c of l)i[r++]=new tAe(c,o.command,o.commandArgs,s,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new y0(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new e4([t],qh)}};m2=rS([Wl(0,Yn),Wl(1,Fs),Wl(2,wf),Wl(3,ga),Wl(4,Sf),Wl(5,Lr)],m2);class jXi extends Ae{constructor(e,t){super(),this.domNode=e,this._register(t)}}function UAe(n){return n&&typeof n=="object"&&(!n.overrideIdentifier||typeof n.overrideIdentifier=="string")&&(!n.resource||n.resource instanceof Tn)}class qGe{constructor(){this._onDidChangeConfiguration=new be,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new MXi;this._configuration=new vq(e.reload(),new Lc,new Lc,new Lc),e.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,r=UAe(e)?e:UAe(t)?t:{};return this._configuration.getValue(i,r,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const r of e){const[o,s]=r;this.getValue(o)!==s&&(this._configuration.updateValue(o,s),i.push(o))}if(i.length>0){const r=new Xqi({keys:i,overrides:[]},t,this._configuration);r.source=8,r.sourceConfig=null,this._onDidChangeConfiguration.fire(r)}return Promise.resolve()}updateValue(e,t,i,r){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let Gae=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new be,this.configurationService.onDidChangeConfiguration(r=>{this._onDidChangeConfiguration.fire({affectedKeys:r.affectedKeys,affectsConfiguration:(o,s)=>r.affectsConfiguration(s)})})}getValue(e,t,i){const r=Ce.isIPosition(t)?t:null,o=r?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,s=e?this.getLanguage(e,r):void 0;return typeof o>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:s}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:s})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};Gae=rS([Wl(0,Ui),Wl(1,ts),Wl(2,Qo)],Gae);let Yae=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&typeof i=="string"&&i!=="auto"?i:fu||Qi?`
`:`\r
`}};Yae=rS([Wl(0,Ui)],Yae);class UXi{publicLog2(){}}class p4{constructor(){const e=Tn.from({scheme:p4.SCHEME,authority:"model",path:"/"});this.workspace={id:FKe,folders:[new mKi({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===p4.SCHEME?this.workspace.folders[0]:null}}p4.SCHEME="inmemory";function $H(n,e,t){if(!e||!(n instanceof qGe))return;const i=[];Object.keys(e).forEach(r=>{qqi(r)&&i.push([`editor.${r}`,e[r]]),t&&Kqi(r)&&i.push([`diffEditor.${r}`,e[r]])}),i.length>0&&n.updateValues(i)}let Qae=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return qL(this,void 0,void 0,function*(){const i=Array.isArray(e)?e:$_e.convert(e),r=new Map;for(const a of i){if(!(a instanceof Xy))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=r.get(l);c||(c=[],r.set(l,c)),c.push(es.replaceMove(q.lift(a.textEdit.range),a.textEdit.text))}let o=0,s=0;for(const[a,l]of r)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),s+=1,o+=l.length;return{ariaSummary:Dx(eae.bulkEditServiceSummary,o,s),isApplied:o>0}})}};Qae=rS([Wl(0,ts)],Qae);class qXi{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return Tg(e)}}let Xae=class extends tae{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const r=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();r&&(t=r.getContainerDomNode())}return super.showContextView(e,t,i)}};Xae=rS([Wl(0,TA),Wl(1,Lr)],Xae);class KXi{constructor(){this._neverEmitter=new be,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class GXi extends i4{constructor(){super()}}class YXi extends BXi{constructor(){super(new _Bi)}}let Zae=class extends bae{constructor(e,t,i,r,o,s){super(e,t,i,r,o,s),this.configure({blockMouse:!1})}};Zae=rS([Wl(0,wf),Wl(1,ga),Wl(2,O0),Wl(3,mo),Wl(4,kb),Wl(5,Yn)],Zae);class QXi{playAudioCue(e,t){return qL(this,void 0,void 0,function*(){})}}Zi(Ui,qGe,0);Zi(Yme,Gae,0);Zi(rqe,Yae,0);Zi(Bx,p4,0);Zi(c2,qXi,0);Zi(wf,UXi,0);Zi(I5,zXi,0);Zi(M_e,WXi,0);Zi(ga,g4,0);Zi(Lb,S1,0);Zi(Qo,GXi,0);Zi(Ef,vXi,0);Zi(Sf,YXi,0);Zi(ts,LH,0);Zi(t_e,Eae,0);Zi(Yn,Uae,0);Zi(MKe,HXi,0);Zi(iS,Bq,0);Zi(am,rYi,0);Zi(lm,use,0);Zi(L5,Qae,0);Zi(BKe,KXi,0);Zi(Pd,qae,0);Zi(N0,Vae,0);Zi($g,yQi,0);Zi(Fs,Kae,0);Zi(mo,m2,0);Zi(P_,Bae,0);Zi(O0,Xae,0);Zi(mh,Sae,0);Zi(F0,jae,0);Zi(om,Zae,0);Zi(kb,Hae,0);Zi(F5,QXi,0);var $n;(function(n){const e=new gq;for(const[l,c]of HLe())e.set(l,c);const t=new BH(e,!0);e.set(Un,t);function i(l){r||s({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof hv?t.invokeFunction(u=>u.get(l)):c}n.get=i;let r=!1;const o=new be;function s(l){if(r)return t;r=!0;for(const[u,d]of HLe())e.get(u)||e.set(u,d);for(const u in l)if(l.hasOwnProperty(u)){const d=Vi(u);e.get(d)instanceof hv&&e.set(d,l[u])}const c=$Xi();for(const u of c)try{t.createInstance(u)}catch(d){fi(d)}return o.fire(),t}n.initialize=s;function a(l){if(r)return l();const c=new nt,u=c.add(o.event(()=>{u.dispose(),c.add(l())}));return c}n.withServices=a})($n||($n={}));let XXi;function Jy(){return XXi}let KGe;function ZXi(n){KGe=n}class GGe{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const i=t===void 0?void 0:e,r=t===void 0?e:t;return KGe({owner:i,debugName:()=>{const o=Wk(r);if(o!==void 0)return o;const a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(r.toString());if(a)return`${this.debugName}.${a[2]}`;if(!i)return`${this.debugName} (mapped)`}},o=>r(this.read(o),o))}}class B5 extends GGe{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const t=this.observers.size;this.observers.add(e),t===0&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&this.observers.size===0&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}}function Jo(n,e){const t=new YGe(n,e);try{n(t)}finally{t.finish()}}function Jae(n,e,t){n?e(n):Jo(e,t)}class YGe{constructor(e,t){var i;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(i=Jy())===null||i===void 0||i.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():Wk(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;const t=this.updatingObservers;this.updatingObservers=null;for(const{observer:i,observable:r}of t)i.endUpdate(r);(e=Jy())===null||e===void 0||e.handleEndTransaction()}}function wve(n,e,t,i){let r;if(n!==void 0)if(typeof n=="function"){if(r=n(),r!==void 0)return r}else return n;if(e!==void 0&&(r=Wk(e),r!==void 0))return r;if(t!==void 0){for(const o in t)if(t[o]===i)return o}}function Wk(n){const e=n.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),r=i?i[1]:void 0;return r==null?void 0:r.trim()}function No(n,e){return typeof n=="string"?new ele(void 0,n,e):new ele(n,void 0,e)}class ele extends B5{get debugName(){var e;return(e=wve(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"ObservableValue"}constructor(e,t,i){super(),this._owner=e,this._debugName=t,this._value=i}get(){return this._value}set(e,t,i){var r;if(this._value===e)return;let o;t||(t=o=new YGe(()=>{},()=>`Setting ${this.debugName}`));try{const s=this._value;this._setValue(e),(r=Jy())===null||r===void 0||r.handleObservableChanged(this,{oldValue:s,newValue:e,change:i,didChange:!0,hadValue:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,i)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function VH(n,e){return typeof n=="string"?new qAe(void 0,n,e):new qAe(n,void 0,e)}class qAe extends ele{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)===null||e===void 0||e.dispose()}}const m4=(n,e)=>n===e;function Ki(n,e){return e!==void 0?new v4(n,void 0,e,void 0,void 0,void 0,m4):new v4(void 0,void 0,n,void 0,void 0,void 0,m4)}function KAe(n,e){var t;return new v4(n.owner,n.debugName,e,void 0,void 0,void 0,(t=n.equalityComparer)!==null&&t!==void 0?t:m4)}function JXi(n,e){var t;return new v4(n.owner,n.debugName,e,n.createEmptyChangeSummary,n.handleChange,void 0,(t=n.equalityComparer)!==null&&t!==void 0?t:m4)}function _4(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);const r=new nt;return new v4(i,()=>{var o;return(o=Wk(t))!==null&&o!==void 0?o:"(anonymous)"},o=>(r.clear(),t(o,r)),void 0,void 0,()=>r.dispose(),m4)}ZXi(Ki);class v4 extends B5{get debugName(){var e;return(e=wve(this._debugName,this._computeFn,this._owner,this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,i,r,o,s=void 0,a){var l,c;super(),this._owner=e,this._debugName=t,this._computeFn=i,this.createChangeSummary=r,this._handleChange=o,this._handleLastObserverRemoved=s,this._equalityComparator=a,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=(l=this.createChangeSummary)===null||l===void 0?void 0:l.call(this),(c=Jy())===null||c===void 0||c.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const t of this.dependencies)t.removeObserver(this);this.dependencies.clear(),(e=this._handleLastObserverRemoved)===null||e===void 0||e.call(this)}get(){var e;if(this.observers.size===0){const t=this._computeFn(this,(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this));return this.onLastObserverRemoved(),t}else{do{if(this.state===1){for(const t of this.dependencies)if(t.reportChanges(),this.state===2)break}this.state===1&&(this.state=3),this._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var e,t;if(this.state===3)return;const i=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=i;const r=this.state!==0,o=this.value;this.state=3;const s=this.changeSummary;this.changeSummary=(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this);try{this.value=this._computeFn(this,s)}finally{for(const l of this.dependenciesToBeRemoved)l.removeObserver(this);this.dependenciesToBeRemoved.clear()}const a=r&&!this._equalityComparator(o,this.value);if((t=Jy())===null||t===void 0||t.handleDerivedRecomputed(this,{oldValue:o,newValue:this.value,change:void 0,didChange:a,hadValue:r}),a)for(const l of this.observers)l.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===3&&(this.state=1,!t))for(const i of this.observers)i.handlePossibleChange(this);if(t)for(const i of this.observers)i.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const i of t)i.endUpdate(this)}if(this.updateCount<0)throw new ya}handlePossibleChange(e){if(this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(const t of this.observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const i=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0,r=this.state===3;if(i&&(this.state===1||r)&&(this.state=2,r))for(const o of this.observers)o.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}function Sve(n,e){return new Vq(n.debugName,e,void 0,void 0)}function So(n){return new Vq(void 0,n,void 0,void 0)}function $q(n,e){return new Vq(n.debugName,e,n.createEmptyChangeSummary,n.handleChange)}function Gd(n){const e=new nt,t=Sve({debugName:()=>Wk(n)||"(anonymous)"},i=>{e.clear(),n(i,e)});return Gn(()=>{t.dispose(),e.dispose()})}class Vq{get debugName(){if(typeof this._debugName=="string")return this._debugName;if(typeof this._debugName=="function"){const t=this._debugName();if(t!==void 0)return t}const e=Wk(this._runFn);return e!==void 0?e:"(anonymous)"}constructor(e,t,i,r){var o,s;this._debugName=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=r,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(o=this.createChangeSummary)===null||o===void 0?void 0:o.call(this),(s=Jy())===null||s===void 0||s.handleAutorunCreated(this),this._runIfNeeded()}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}_runIfNeeded(){var e,t,i;if(this.state===3)return;const r=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=r,this.state=3;try{if(!this.disposed){(e=Jy())===null||e===void 0||e.handleAutorunTriggered(this);const o=this.changeSummary;this.changeSummary=(t=this.createChangeSummary)===null||t===void 0?void 0:t.call(this),this._runFn(this,o)}}finally{(i=Jy())===null||i===void 0||i.handleAutorunFinished(this);for(const o of this.dependenciesToBeRemoved)o.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===3&&(this.state=1),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===1){this.state=3;for(const e of this.dependencies)if(e.reportChanges(),this.state===2)break}this._runIfNeeded()}while(this.state!==3);this.updateCount--,xM(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:r=>r===e},this.changeSummary))&&(this.state=2)}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}}(function(n){n.Observer=Vq})(So||(So={}));function HH(n){return new eZi(n)}class eZi extends GGe{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function tZi(n,e){return new Promise(t=>{let i=!1,r=!1;const o=So(s=>{const a=n.read(s);e(a)&&(i?o.dispose():r=!0,t(a))});i=!0,r&&o.dispose()})}function Ul(n,e){return new QGe(n,e)}class QGe extends B5{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=i=>{var r;const o=this._getValue(i),s=!this.hasValue||this.value!==o;(r=Jy())===null||r===void 0||r.handleFromEventObservableTriggered(this,{oldValue:this.value,newValue:o,change:void 0,didChange:s,hadValue:this.hasValue}),s&&(this.value=o,this.hasValue&&Jo(a=>{for(const l of this.observers)a.updateObserver(l,this),l.handleChange(this,void 0)},()=>{const a=this.getDebugName();return"Event fired"+(a?`: ${a}`:"")}),this.hasValue=!0)}}getDebugName(){return Wk(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}(function(n){n.Observer=QGe})(Ul||(Ul={}));function $h(n,e){return new nZi(n,e)}class nZi extends B5{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{Jo(i=>{for(const r of this.observers)i.updateObserver(r,this),r.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function XGe(n){return typeof n=="string"?new GAe(n):new GAe(void 0,n)}class GAe extends B5{get debugName(){var e;return(e=wve(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){Jo(i=>{this.trigger(i,t)},()=>`Trigger signal ${this.debugName}`);return}for(const i of this.observers)e.updateObserver(i,this),i.handleChange(this,t)}get(){}}function b4(n){const e=new iZi(!0);return n.addObserver(e),n.reportChanges(),Gn(()=>{n.removeObserver(e)})}class iZi{constructor(e){this.forceRecompute=e,this.counter=0}beginUpdate(e){this.counter++}endUpdate(e){this.counter--,this.counter===0&&this.forceRecompute&&e.reportChanges()}handlePossibleChange(e){}handleChange(e,t){}}function ZGe(){return!!$je.VSCODE_DEV}function rZi(n){if(ZGe()){const e=oZi();return e.add(n),{dispose(){e.delete(n)}}}else return{dispose(){}}}function oZi(){n$||(n$=new Set);const n=globalThis;return n.$hotReload_applyNewExports||(n.$hotReload_applyNewExports=e=>{for(const t of n$){const i=t(e);if(i)return i}}),n$}let n$;function sZi(n,e,t,i){if(n.length===0)return e;if(e.length===0)return n;const r=[];let o=0,s=0;for(;o<n.length&&s<e.length;){const a=n[o],l=e[s],c=t(a),u=t(l);c<u?(r.push(a),o++):c>u?(r.push(l),s++):(r.push(i(a,l)),o++,s++)}for(;o<n.length;)r.push(n[o]),o++;for(;s<e.length;)r.push(e[s]),s++;return r}function WH(n,e){const t=new nt,i=n.createDecorationsCollection();return t.add(Sve({debugName:()=>`Apply decorations from ${e.debugName}`},r=>{const o=e.read(r);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function i$(n,e){return n.appendChild(e),Gn(()=>{n.removeChild(e)})}class aZi extends Ae{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new dqe(e,t)),this._width=No(this,this.elementSizeObserver.getWidth()),this._height=No(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>Jo(r=>{this._width.set(this.elementSizeObserver.getWidth(),r),this._height.set(this.elementSizeObserver.getHeight(),r)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function YAe(n,e){let t=n.get(),i=t,r=t;const o=No("animatedValue",t);let s=-1;const a=300;let l;e.add($q({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(u,d)=>(u.didChange(n)&&(d.animate=d.animate||u.change),!0)},(u,d)=>{l!==void 0&&(cancelAnimationFrame(l),l=void 0),i=r,t=n.read(u),s=Date.now()-(d.animate?0:a),c()}));function c(){const u=Date.now()-s;r=Math.floor(lZi(u,i,t-i,a)),u<a?l=requestAnimationFrame(c):r=t,o.set(r,void 0)}return o}function lZi(n,e,t,i){return n===i?e+t:t*(-Math.pow(2,-10*n/i)+1)+e}class JGe extends Ae{constructor(e,t,i){super(),this._register(new Hq(e,i)),this._register(BC(i,{height:t.actualHeight,top:t.actualTop}))}}class zH{get afterLineNumber(){return this._afterLineNumber.get()}constructor(e,t){this._afterLineNumber=e,this.heightInPx=t,this.domNode=document.createElement("div"),this._actualTop=No(this,void 0),this._actualHeight=No(this,void 0),this.actualTop=this._actualTop,this.actualHeight=this._actualHeight,this.showInHiddenAreas=!0,this.onChange=this._afterLineNumber,this.onDomNodeTop=i=>{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}class Hq{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${Hq._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}Hq._counter=0;function BC(n,e){return So(t=>{for(let[i,r]of Object.entries(e))r&&typeof r=="object"&&"read"in r&&(r=r.read(t)),typeof r=="number"&&(r=`${r}px`),i=i.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),n.style[i]=r})}function E1(n,e){return cZi([n],e),n}function cZi(n,e){ZGe()&&$h("reload",i=>rZi(r=>{if([...Object.values(r)].some(o=>n.includes(o)))return o=>(i(void 0),!0)})).read(e)}function jH(n,e,t){const i=new nt,r=[];return i.add(So(o=>{const s=e.read(o),a=new Map,l=new Map;t&&t(!0),n.changeViewZones(c=>{for(const u of r)c.removeZone(u);r.length=0;for(const u of s){const d=c.addZone(u);r.push(d),a.set(u,d)}}),t&&t(!1),i.add($q({createEmptyChangeSummary(){return[]},handleChange(c,u){const d=l.get(c.changedObservable);return d!==void 0&&u.push(d),!0}},(c,u)=>{for(const d of s)d.onChange&&(l.set(d.onChange,a.get(d)),d.onChange.read(c));t&&t(!0),n.changeViewZones(d=>{for(const h of u)d.layoutZone(h)}),t&&t(!1)}))})),i.add({dispose(){t&&t(!0),n.changeViewZones(o=>{for(const s of r)o.removeZone(s)}),t&&t(!1)}}),i}class uZi extends da{dispose(){super.dispose(!0)}}var Eve=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},xve=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},dZi=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const hZi=Js("diff-review-insert",Ct.add,E("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),fZi=Js("diff-review-remove",Ct.remove,E("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),gZi=Js("diff-review-close",Ct.close,E("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let iC=class extends Ae{constructor(e,t,i,r,o,s,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=r,this._width=o,this._height=s,this._diffs=a,this._editors=l,this._instantiationService=c,this.model=_4(this,(u,d)=>{const h=this._visible.read(u);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const g=d.add(this._instantiationService.createInstance(tle,this._diffs,this._editors,this._setVisible,this._canClose)),p=d.add(this._instantiationService.createInstance(nle,this._parentNode,g,this._width,this._height,this._editors));return{model:g,view:p}}),this._register(b4(this.model))}next(){Jo(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this.model.get().model.nextGroup(e)})}prev(){Jo(e=>{this._setVisible(!0,e),this.model.get().model.previousGroup(e)})}close(){Jo(e=>{this._setVisible(!1,e)})}};iC._ttPolicy=R0("diffReview",{createHTML:n=>n});iC=Eve([xve(8,Un)],iC);let tle=class extends Ae{constructor(e,t,i,r,o){super(),this._diffs=e,this._editors=t,this._setVisible=i,this.canClose=r,this._audioCueService=o,this._groups=No(this,[]),this._currentGroupIdx=No(this,0),this._currentElementIdx=No(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((s,a)=>this._groups.read(a)[s]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((s,a)=>{var l;return(l=this.currentGroup.read(a))===null||l===void 0?void 0:l.lines[s]}),this._register(So(s=>{const a=this._diffs.read(s);if(!a){this._groups.set([],void 0);return}const l=pZi(a,this._editors.original.getModel().getLineCount(),this._editors.modified.getModel().getLineCount());Jo(c=>{const u=this._editors.modified.getPosition();if(u){const d=l.findIndex(h=>(u==null?void 0:u.lineNumber)<h.range.modified.endLineNumberExclusive);d!==-1&&this._currentGroupIdx.set(d,c)}this._groups.set(l,c)})})),this._register(So(s=>{const a=this.currentElement.read(s);(a==null?void 0:a.type)===Ru.Deleted?this._audioCueService.playAudioCue(ur.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===Ru.Added&&this._audioCueService.playAudioCue(ur.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(So(s=>{var a;const l=this.currentElement.read(s);if(l&&l.type!==Ru.Header){const c=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._editors.modified.setSelection(q.fromPositions(new Ce(c,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||Jae(t,r=>{this._currentGroupIdx.set(Bi.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),r),this._currentElementIdx.set(0,r)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||Jo(i=>{this._currentElementIdx.set(Bi.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);i!==-1&&Jo(r=>{this._currentElementIdx.set(i,r)})}revealCurrentElementInEditor(){this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===Ru.Deleted?(this._editors.original.setSelection(q.fromPositions(new Ce(e.originalLineNumber,1))),this._editors.original.revealLine(e.originalLineNumber),this._editors.original.focus()):(e.type!==Ru.Header&&(this._editors.modified.setSelection(q.fromPositions(new Ce(e.modifiedLineNumber,1))),this._editors.modified.revealLine(e.modifiedLineNumber)),this._editors.modified.focus()))}close(){this._setVisible(!1,void 0),this._editors.modified.focus()}};tle=Eve([xve(4,F5)],tle);const YR=3;function pZi(n,e,t){const i=[];for(const r of pje(n,(o,s)=>s.modified.startLineNumber-o.modified.endLineNumberExclusive<2*YR)){const o=[];o.push(new _Zi);const s=new zi(Math.max(1,r[0].original.startLineNumber-YR),Math.min(r[r.length-1].original.endLineNumberExclusive+YR,e+1)),a=new zi(Math.max(1,r[0].modified.startLineNumber-YR),Math.min(r[r.length-1].modified.endLineNumberExclusive+YR,t+1));mje(r,(u,d)=>{const h=new zi(u?u.original.endLineNumberExclusive:s.startLineNumber,d?d.original.startLineNumber:s.endLineNumberExclusive),g=new zi(u?u.modified.endLineNumberExclusive:a.startLineNumber,d?d.modified.startLineNumber:a.endLineNumberExclusive);h.forEach(p=>{o.push(new yZi(p,g.startLineNumber+(p-h.startLineNumber)))}),d&&(d.original.forEach(p=>{o.push(new vZi(d,p))}),d.modified.forEach(p=>{o.push(new bZi(d,p))}))});const l=r[0].modified.join(r[r.length-1].modified),c=r[0].original.join(r[r.length-1].original);i.push(new mZi(new cb(l,c),o))}return i}var Ru;(function(n){n[n.Header=0]="Header",n[n.Unchanged=1]="Unchanged",n[n.Deleted=2]="Deleted",n[n.Added=3]="Added"})(Ru||(Ru={}));class mZi{constructor(e,t){this.range=e,this.lines=t}}class _Zi{constructor(){this.type=Ru.Header}}class vZi{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=Ru.Deleted,this.modifiedLineNumber=void 0}}class bZi{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=Ru.Added,this.originalLineNumber=void 0}}class yZi{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=Ru.Unchanged}}let nle=class extends Ae{constructor(e,t,i,r,o,s){super(),this._element=e,this._model=t,this._width=i,this._height=r,this._editors=o,this._languageService=s,this.domNode=this._element,this.domNode.className="diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new Ig(a)),this._register(So(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new Gu("diffreview.close",E("label.close","Close"),"close-diff-review "+In.asClassName(gZi),!0,()=>dZi(this,void 0,void 0,function*(){return t.close()})),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new S5(this._content,{})),Yl(this.domNode,this._scrollbar.getDomNode(),a),this._register(Gn(()=>{Yl(this.domNode)})),this._register(BC(this.domNode,{width:this._width,height:this._height})),this._register(BC(this._content,{width:this._width,height:this._height})),this._register(Gd((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(ua(this.domNode,"keydown",l=>{(l.equals(18)||l.equals(2066)||l.equals(530))&&(l.preventDefault(),this._model.goToNextLine()),(l.equals(16)||l.equals(2064)||l.equals(528))&&(l.preventDefault(),this._model.goToPreviousLine()),(l.equals(9)||l.equals(2057)||l.equals(521)||l.equals(1033))&&(l.preventDefault(),this._model.close()),(l.equals(10)||l.equals(3))&&(l.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._editors.original.getOptions(),i=this._editors.modified.getOptions(),r=document.createElement("div");r.className="diff-review-table",r.setAttribute("role","list"),r.setAttribute("aria-label",E("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),mc(r,i.get(50)),Yl(this._content,r);const o=this._editors.original.getModel(),s=this._editors.modified.getModel();if(!o||!s)return;const a=o.getOptions(),l=s.getOptions(),c=i.get(66),u=this._model.currentGroup.get();for(const d of(u==null?void 0:u.lines)||[]){if(!u)break;let h;if(d.type===Ru.Header){const p=document.createElement("div");p.className="diff-review-row",p.setAttribute("role","listitem");const m=u.range,_=this._model.currentGroupIndex.get(),v=this._model.groups.get().length,b=k=>k===0?E("no_lines_changed","no lines changed"):k===1?E("one_line_changed","1 line changed"):E("more_lines_changed","{0} lines changed",k),y=b(m.original.length),C=b(m.modified.length);p.setAttribute("aria-label",E({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}",_+1,v,m.original.startLineNumber,y,m.modified.startLineNumber,C));const x=document.createElement("div");x.className="diff-review-cell diff-review-summary",x.appendChild(document.createTextNode(`${_+1}/${v}: @@ -${m.original.startLineNumber},${m.original.length} +${m.modified.startLineNumber},${m.modified.length} @@`)),p.appendChild(x),h=p}else h=this._createRow(d,c,this._width.get(),t,o,a,i,s,l);r.appendChild(h);const g=Ki(p=>this._model.currentElement.read(p)===d);e.add(So(p=>{const m=g.read(p);h.tabIndex=m?0:-1,m&&h.focus()})),e.add(We(h,"focus",()=>{this._model.goToLine(d)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,r,o,s,a,l,c){const u=r.get(143),d=u.glyphMarginWidth+u.lineNumbersWidth,h=a.get(143),g=10+h.glyphMarginWidth+h.lineNumbersWidth;let p="diff-review-row",m="";const _="diff-review-spacer";let v=null;switch(e.type){case Ru.Added:p="diff-review-row line-insert",m=" char-insert",v=hZi;break;case Ru.Deleted:p="diff-review-row line-delete",m=" char-delete",v=fZi;break}const b=document.createElement("div");b.style.minWidth=i+"px",b.className=p,b.setAttribute("role","listitem"),b.ariaLevel="";const y=document.createElement("div");y.className="diff-review-cell",y.style.height=`${t}px`,b.appendChild(y);const C=document.createElement("span");C.style.width=d+"px",C.style.minWidth=d+"px",C.className="diff-review-line-number"+m,e.originalLineNumber!==void 0?C.appendChild(document.createTextNode(String(e.originalLineNumber))):C.innerText=" ",y.appendChild(C);const x=document.createElement("span");x.style.width=g+"px",x.style.minWidth=g+"px",x.style.paddingRight="10px",x.className="diff-review-line-number"+m,e.modifiedLineNumber!==void 0?x.appendChild(document.createTextNode(String(e.modifiedLineNumber))):x.innerText=" ",y.appendChild(x);const k=document.createElement("span");if(k.className=_,v){const D=document.createElement("span");D.className=In.asClassName(v),D.innerText="  ",k.appendChild(D)}else k.innerText="  ";y.appendChild(k);let I;if(e.modifiedLineNumber!==void 0){let D=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);iC._ttPolicy&&(D=iC._ttPolicy.createHTML(D)),y.insertAdjacentHTML("beforeend",D),I=l.getLineContent(e.modifiedLineNumber)}else{let D=this._getLineHtml(o,r,s.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);iC._ttPolicy&&(D=iC._ttPolicy.createHTML(D)),y.insertAdjacentHTML("beforeend",D),I=o.getLineContent(e.originalLineNumber)}I.length===0&&(I=E("blankLine","blank"));let L="";switch(e.type){case Ru.Unchanged:e.originalLineNumber===e.modifiedLineNumber?L=E({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",I,e.originalLineNumber):L=E("equalLine","{0} original line {1} modified line {2}",I,e.originalLineNumber,e.modifiedLineNumber);break;case Ru.Added:L=E("insertLine","+ {0} modified line {1}",I,e.modifiedLineNumber);break;case Ru.Deleted:L=E("deleteLine","- {0} original line {1}",I,e.originalLineNumber);break}return b.setAttribute("aria-label",L),b}_getLineHtml(e,t,i,r,o){const s=e.getLineContent(r),a=t.get(50),l=el.createEmpty(s,o),c=gf.isBasicASCII(s,e.mightContainNonBasicASCII()),u=gf.containsRTL(s,c,e.mightContainRTL());return tq(new tS(a.isMonospace&&!t.get(33),a.canUseHalfwidthRightwardsArrow,s,!1,c,u,0,l,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(116),t.get(98),t.get(93),t.get(51)!==Fh.OFF,null)).html}};nle=Eve([xve(5,Qo)],nle);const CZi=Js("diff-insert",Ct.add,E("diffInsertIcon","Line decoration for inserts in the diff editor.")),eYe=Js("diff-remove",Ct.remove,E("diffRemoveIcon","Line decoration for removals in the diff editor.")),QAe=hi.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+In.asClassName(CZi),marginClassName:"gutter-insert"}),XAe=hi.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+In.asClassName(eYe),marginClassName:"gutter-delete"}),ZAe=hi.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),JAe=hi.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),eRe=hi.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),wZi=hi.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),SZi=hi.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),ile=hi.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),EZi=hi.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),xZi=hi.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),kZi=hi.register({description:"diff-editor-arrow-revert-change",glyphMarginHoverMessage:new hc(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(E("revertChangeHoverMessage","Click to revert change")),glyphMarginClassName:"arrow-revert-change "+In.asClassName(Ct.arrowRight),zIndex:10001});class $C extends Ae{constructor(e,t,i,r,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=r,this._editors=o,this._originalScrollTop=Ul(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Ul(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=$h("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=No(this,0),this._modifiedViewZonesChangedSignal=$h("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=$h("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=_4((h,g)=>{var p;this._element.replaceChildren();const m=this._diffModel.read(h),_=(p=m==null?void 0:m.diff.read(h))===null||p===void 0?void 0:p.movedTexts;if(!_||_.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(h);const v=this._originalEditorLayoutInfo.read(h),b=this._modifiedEditorLayoutInfo.read(h);if(!v||!b){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(h),this._originalViewZonesChangedSignal.read(h);const y=_.map(R=>{function P(Y,ne){const se=ne.getTopForLineNumber(Y.startLineNumber,!0),he=ne.getTopForLineNumber(Y.endLineNumberExclusive,!0);return(se+he)/2}const M=P(R.lineRangeMapping.original,this._editors.original),O=this._originalScrollTop.read(h),B=P(R.lineRangeMapping.modified,this._editors.modified),F=this._modifiedScrollTop.read(h),H=M-O,V=B-F,$=Math.min(M,B),j=Math.max(M,B);return{range:new Bi($,j),from:H,to:V,fromWithoutScroll:M,toWithoutScroll:B,move:R}});y.sort(L5i(fg(R=>R.fromWithoutScroll>R.toWithoutScroll,D5i),fg(R=>R.fromWithoutScroll>R.toWithoutScroll?R.fromWithoutScroll:-R.toWithoutScroll,Gy)));const C=kve.compute(y.map(R=>R.range)),x=10,k=v.verticalScrollbarWidth,I=(C.getTrackCount()-1)*10+x*2,L=k+I+(b.contentLeft-$C.movedCodeBlockPadding);let D=0;for(const R of y){const P=C.getTrack(D),M=k+x+P*10,O=15,B=15,F=L,H=b.glyphMarginWidth+b.lineNumbersWidth,V=18,$=document.createElementNS("http://www.w3.org/2000/svg","rect");$.classList.add("arrow-rectangle"),$.setAttribute("x",`${F-H}`),$.setAttribute("y",`${R.to-V/2}`),$.setAttribute("width",`${H}`),$.setAttribute("height",`${V}`),this._element.appendChild($);const j=document.createElementNS("http://www.w3.org/2000/svg","g"),Y=document.createElementNS("http://www.w3.org/2000/svg","path");Y.setAttribute("d",`M 0 ${R.from} L ${M} ${R.from} L ${M} ${R.to} L ${F-B} ${R.to}`),Y.setAttribute("fill","none"),j.appendChild(Y);const ne=document.createElementNS("http://www.w3.org/2000/svg","polygon");ne.classList.add("arrow"),g.add(So(se=>{Y.classList.toggle("currentMove",R.move===m.activeMovedText.read(se)),ne.classList.toggle("currentMove",R.move===m.activeMovedText.read(se))})),ne.setAttribute("points",`${F-B},${R.to-O/2} ${F},${R.to} ${F-B},${R.to+O/2}`),j.appendChild(ne),this._element.appendChild(j),D++}this.width.set(I,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(Gn(()=>this._element.remove())),this._register(So(h=>{const g=this._originalEditorLayoutInfo.read(h),p=this._modifiedEditorLayoutInfo.read(h);!g||!p||(this._element.style.left=`${g.width-g.verticalScrollbarWidth}px`,this._element.style.height=`${g.height}px`,this._element.style.width=`${g.verticalScrollbarWidth+g.contentLeft-$C.movedCodeBlockPadding+this.width.read(h)}px`)})),this._register(b4(this._state));const s=Ki(h=>{const g=this._diffModel.read(h),p=g==null?void 0:g.diff.read(h);return p?p.movedTexts.map(m=>({move:m,original:new zH(HH(m.lineRangeMapping.original.startLineNumber-1),18),modified:new zH(HH(m.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(jH(this._editors.original,s.map(h=>h.map(g=>g.original)))),this._register(jH(this._editors.modified,s.map(h=>h.map(g=>g.modified)))),this._register(Gd((h,g)=>{const p=s.read(h);for(const m of p)g.add(new tRe(this._editors.original,m.original,m.move,"original",this._diffModel.get())),g.add(new tRe(this._editors.modified,m.modified,m.move,"modified",this._diffModel.get()))}));const a=Ul(this._editors.original.onDidChangeCursorPosition,()=>this._editors.original.getPosition()),l=Ul(this._editors.modified.onDidChangeCursorPosition,()=>this._editors.modified.getPosition()),c=$h("original.onDidFocusEditorWidget",h=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0))),u=$h("modified.onDidFocusEditorWidget",h=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0)));let d="modified";this._register($q({createEmptyChangeSummary:()=>{},handleChange:(h,g)=>(h.didChange(c)&&(d="original"),h.didChange(u)&&(d="modified"),!0)},h=>{c.read(h),u.read(h);const g=this._diffModel.read(h);if(!g)return;const p=g.diff.read(h);let m;if(p&&d==="original"){const _=a.read(h);_&&(m=p.movedTexts.find(v=>v.lineRangeMapping.original.contains(_.lineNumber)))}if(p&&d==="modified"){const _=l.read(h);_&&(m=p.movedTexts.find(v=>v.lineRangeMapping.modified.contains(_.lineNumber)))}m!==g.movedTextToCompare.get()&&g.movedTextToCompare.set(void 0,void 0),g.setActiveMovedText(m)}))}}$C.movedCodeBlockPadding=4;class kve{static compute(e){const t=[],i=[];for(const r of e){let o=t.findIndex(s=>!s.intersectsStrict(r));o===-1&&(t.length>=6?o=j8i(t,fg(a=>a.intersectWithRangeLength(r),Gy)):(o=t.length,t.push(new qme))),t[o].addRange(r),i.push(o)}return new kve(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class tRe extends JGe{constructor(e,t,i,r,o){const s=Fl("div.diff-hidden-lines-widget");super(e,t,s.root),this._editor=e,this._move=i,this._kind=r,this._diffModel=o,this._nodes=Fl("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Fl("div.text-content@textContent"),Fl("div.action-bar@actionBar")]),s.root.appendChild(this._nodes.root);const a=Ul(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(BC(this._nodes.root,{paddingRight:a.map(h=>h.verticalScrollbarWidth)}));let l;i.changes.length>0?l=this._kind==="original"?E("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):E("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?E("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):E("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new Ig(this._nodes.actionBar,{highlightToggledItems:!0})),u=new Gu("",l,"",!1);c.push(u,{icon:!1,label:!0});const d=new Gu("","Compare",In.asClassName(Ct.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(So(h=>{const g=this._diffModel.movedTextToCompare.read(h)===i;d.checked=g})),c.push(d,{icon:!1,label:!0})}}class TZi extends Ae{constructor(e,t,i){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=Ki(this,r=>{var o;const s=(o=this._diffModel.read(r))===null||o===void 0?void 0:o.diff.read(r);if(!s)return null;const a=this._diffModel.read(r).movedTextToCompare.read(r),l=this._options.renderIndicators.read(r),c=this._options.showEmptyDecorations.read(r),u=[],d=[];if(!a)for(const g of s.mappings){if(g.lineRangeMapping.original.isEmpty||u.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:l?XAe:JAe}),g.lineRangeMapping.modified.isEmpty||d.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:l?QAe:ZAe}),g.lineRangeMapping.modified.isEmpty||g.lineRangeMapping.original.isEmpty)g.lineRangeMapping.original.isEmpty||u.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:EZi}),g.lineRangeMapping.modified.isEmpty||d.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:wZi});else for(const p of g.lineRangeMapping.innerChanges||[])g.lineRangeMapping.original.contains(p.originalRange.startLineNumber)&&u.push({range:p.originalRange,options:p.originalRange.isEmpty()&&c?xZi:ile}),g.lineRangeMapping.modified.contains(p.modifiedRange.startLineNumber)&&d.push({range:p.modifiedRange,options:p.modifiedRange.isEmpty()&&c?SZi:eRe});!g.lineRangeMapping.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(r)&&!a&&d.push({range:q.fromPositions(new Ce(g.lineRangeMapping.modified.startLineNumber,1)),options:kZi})}if(a)for(const g of a.changes){const p=g.original.toInclusiveRange();p&&u.push({range:p,options:l?XAe:JAe});const m=g.modified.toInclusiveRange();m&&d.push({range:m,options:l?QAe:ZAe});for(const _ of g.innerChanges||[])u.push({range:_.originalRange,options:ile}),d.push({range:_.modifiedRange,options:eRe})}const h=this._diffModel.read(r).activeMovedText.read(r);for(const g of s.movedTexts)u.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(g===h?" currentMove":""),blockPadding:[$C.movedCodeBlockPadding,0,$C.movedCodeBlockPadding,$C.movedCodeBlockPadding]}}),d.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(g===h?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:u,modifiedDecorations:d}}),this._register(WH(this._editors.original,this._decorations.map(r=>(r==null?void 0:r.originalDecorations)||[]))),this._register(WH(this._editors.modified,this._decorations.map(r=>(r==null?void 0:r.modifiedDecorations)||[])))}}class IZi extends Ae{constructor(e,t,i){super(),this._options=e,this._domNode=t,this._dimensions=i,this._sashRatio=No(this,void 0),this.sashLeft=Ki(this,r=>{var o;const s=(o=this._sashRatio.read(r))!==null&&o!==void 0?o:this._options.splitViewDefaultRatio.read(r);return this._computeSashLeft(s,r)}),this._sash=this._register(new kc(this._domNode,{getVerticalSashTop:r=>0,getVerticalSashLeft:r=>this.sashLeft.get(),getVerticalSashHeight:r=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(r=>{const o=this._dimensions.width.get(),s=this._computeSashLeft((this._startSashPosition+(r.currentX-r.startX))/o,void 0);this._sashRatio.set(s/o,void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._sashRatio.set(void 0,void 0))),this._register(So(r=>{const o=this._options.enableSplitViewResizing.read(r);this._sash.state=o?3:0,this.sashLeft.read(r),this._dimensions.height.read(r),this._sash.layout()}))}setBoundarySashes(e){this._sash.orthogonalEndSash=e.bottom}_computeSashLeft(e,t){const i=this._dimensions.width.read(t),r=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):r,s=100;return i<=s*2?r:o<s?s:o>i-s?i-s:o}}let eL=class{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,t){let i;typeof e=="string"?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,t.children.get(i)!==void 0&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let r=i;for(let o=0;t.children.get(r)!==void 0;o++)r=`${i}_${o}`;return r}static empty(e){return e.children.size===0}},nRe=class extends eL{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}},LZi=class extends eL{constructor(e,t,i,r){super(),this.id=e,this.parent=t,this.label=i,this.order=r,this.children=new Map}},DZi=class QS extends eL{static create(e,t,i){const r=new da(i),o=new QS(t.uri),s=e.ordered(t),a=s.map((c,u)=>{var d;const h=eL.findId(`provider_${u}`,o),g=new LZi(h,o,(d=c.displayName)!==null&&d!==void 0?d:"Unknown Outline Provider",u);return Promise.resolve(c.provideDocumentSymbols(t,r.token)).then(p=>{for(const m of p||[])QS._makeOutlineElement(m,g);return g},p=>(Sa(p),g)).then(p=>{eL.empty(p)?p.remove():o._groups.set(h,p)})}),l=e.onDidChange(()=>{const c=e.ordered(t);Qs(c,s)||r.cancel()});return Promise.all(a).then(()=>r.token.isCancellationRequested&&!i.isCancellationRequested?QS.create(e,t,i):o._compact()).finally(()=>{r.dispose(),l.dispose()})}static _makeOutlineElement(e,t){const i=eL.findId(e,t),r=new nRe(i,t,e);if(e.children)for(const o of e.children)QS._makeOutlineElement(o,r);t.children.set(r.id,r)}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}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=Pi.first(this._groups.values());for(const[,i]of t.children)i.parent=this,this.children.set(i.id,i)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof nRe?e.push(t.symbol):e.push(...Pi.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>q.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return QS._flattenDocumentSymbols(t,e,""),t.sort((i,r)=>Ce.compare(q.getStartPosition(i.range),q.getStartPosition(r.range))||Ce.compare(q.getEndPosition(r.range),q.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const r of t)e.push({kind:r.kind,tags:r.tags,name:r.name,detail:r.detail,containerName:r.containerName||i,range:r.range,selectionRange:r.selectionRange,children:void 0}),r.children&&QS._flattenDocumentSymbols(e,r.children,r.name)}};var tYe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},nYe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},AZi=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let rle=class extends Ae{get isUpdatingViewZones(){return this._isUpdatingViewZones}constructor(e,t,i,r){super(),this._editors=e,this._diffModel=t,this._options=i,this._languageFeaturesService=r,this._isUpdatingViewZones=!1,this._modifiedOutlineSource=_4(this,(c,u)=>{const d=this._editors.modifiedModel.read(c);if(d)return u.add(new ole(this._languageFeaturesService,d))}),this._register(this._editors.original.onDidChangeCursorPosition(c=>{if(c.reason===3){const u=this._diffModel.get();Jo(d=>{for(const h of this._editors.original.getSelections()||[])u==null||u.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,d),u==null||u.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,d)})}})),this._register(this._editors.modified.onDidChangeCursorPosition(c=>{if(c.reason===3){const u=this._diffModel.get();Jo(d=>{for(const h of this._editors.modified.getSelections()||[])u==null||u.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,d),u==null||u.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,d)})}}));const o=this._diffModel.map((c,u)=>{var d,h;return((d=c==null?void 0:c.diff.read(u))===null||d===void 0?void 0:d.mappings.length)===0?[]:(h=c==null?void 0:c.unchangedRegions.read(u))!==null&&h!==void 0?h:[]}),s=_4(this,(c,u)=>{const d=this._modifiedOutlineSource.read(c);if(!d)return{origViewZones:[],modViewZones:[]};const h=[],g=[],p=this._options.renderSideBySide.read(c),m=o.read(c);for(const _ of m)if(!_.shouldHideControls(c)){{const v=Ki(y=>_.getHiddenOriginalRange(y).startLineNumber-1),b=new zH(v,24);h.push(b),u.add(new iRe(this._editors.original,b,_,_.originalUnchangedRange,!p,d,y=>this._diffModel.get().ensureModifiedLineIsVisible(y,void 0),this._options))}{const v=Ki(y=>_.getHiddenModifiedRange(y).startLineNumber-1),b=new zH(v,24);g.push(b),u.add(new iRe(this._editors.modified,b,_,_.modifiedUnchangedRange,!1,d,y=>this._diffModel.get().ensureModifiedLineIsVisible(y,void 0),this._options))}}return{origViewZones:h,modViewZones:g}}),a={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},l={description:"Fold Unchanged",glyphMarginHoverMessage:new hc(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(E("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+In.asClassName(Ct.fold),zIndex:10001};this._register(WH(this._editors.original,Ki(c=>{const u=o.read(c),d=u.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:a}));for(const h of u)h.shouldHideControls(c)&&d.push({range:q.fromPositions(new Ce(h.originalLineNumber,1)),options:l});return d}))),this._register(WH(this._editors.modified,Ki(c=>{const u=o.read(c),d=u.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:a}));for(const h of u)h.shouldHideControls(c)&&d.push({range:zi.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:l});return d}))),this._register(jH(this._editors.original,s.map(c=>c.origViewZones),c=>this._isUpdatingViewZones=c)),this._register(jH(this._editors.modified,s.map(c=>c.modViewZones),c=>this._isUpdatingViewZones=c)),this._register(So(c=>{const u=o.read(c);this._editors.original.setHiddenAreas(u.map(d=>d.getHiddenOriginalRange(c).toInclusiveRange()).filter(mM)),this._editors.modified.setHiddenAreas(u.map(d=>d.getHiddenModifiedRange(c).toInclusiveRange()).filter(mM))})),this._register(this._editors.modified.onMouseUp(c=>{var u;if(!c.event.rightButton&&c.target.position&&(!((u=c.target.element)===null||u===void 0)&&u.className.includes("fold-unchanged"))){const d=c.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const g=h.unchangedRegions.get().find(p=>p.modifiedUnchangedRange.includes(d));if(!g)return;g.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(c=>{var u;if(!c.event.rightButton&&c.target.position&&(!((u=c.target.element)===null||u===void 0)&&u.className.includes("fold-unchanged"))){const d=c.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const g=h.unchangedRegions.get().find(p=>p.originalUnchangedRange.includes(d));if(!g)return;g.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}}))}};rle=tYe([nYe(3,en)],rle);let ole=class extends Ae{constructor(e,t){super(),this._languageFeaturesService=e,this._textModel=t,this._currentModel=No(this,void 0);const i=$h("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),r=$h("_textModel.onDidChangeContent",Pt.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register(Gd((o,s)=>AZi(this,void 0,void 0,function*(){i.read(o),r.read(o);const a=s.add(new uZi),l=yield DZi.create(this._languageFeaturesService.documentSymbolProvider,this._textModel,a.token);s.isDisposed||this._currentModel.set(l,void 0)})))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const r=i.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return r.sort(yje(fg(o=>o.range.endLineNumber-o.range.startLineNumber,Gy))),r.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};ole=tYe([nYe(0,en)],ole);class iRe extends JGe{constructor(e,t,i,r,o,s,a,l){const c=Fl("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=r,this.hide=o,this._modifiedOutlineSource=s,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=Fl("div.diff-hidden-lines",[Fl("div.top@top",{title:E("diff.hiddenLines.top","Click or drag to show more above")}),Fl("div.center@content",{style:{display:"flex"}},[Fl("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[at("a",{title:E("showAll","Show all"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...PC("$(unfold)"))]),Fl("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Fl("div.bottom@bottom",{title:E("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root);const u=Ul(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this.hide?Yl(this._nodes.first):this._register(BC(this._nodes.first,{width:u.map(h=>h.contentLeft)}));const d=this._editor;this._register(We(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const g=h.clientY;let p=!1;const m=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set(!0,void 0);const _=We(window,"mousemove",b=>{const C=b.clientY-g;p=p||Math.abs(C)>2;const x=Math.round(C/d.getOption(66)),k=Math.max(0,Math.min(m+x,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(k,void 0)}),v=We(window,"mouseup",b=>{p||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(!1,void 0),_.dispose(),v.dispose()})})),this._register(We(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const g=h.clientY;let p=!1;const m=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set(!0,void 0);const _=We(window,"mousemove",b=>{const C=b.clientY-g;p=p||Math.abs(C)>2;const x=Math.round(C/d.getOption(66)),k=Math.max(0,Math.min(m-x,this._unchangedRegion.getMaxVisibleLineCountBottom())),I=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(k,void 0);const L=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(L-I))}),v=We(window,"mouseup",b=>{if(this._unchangedRegion.isDragged.set(!1,void 0),!p){const y=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const C=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(C-y))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),_.dispose(),v.dispose()})})),this._register(So(h=>{const g=[];if(!this.hide){const p=i.getHiddenModifiedRange(h).length,m=E("hiddenLines","{0} hidden lines",p),_=at("span",{title:E("diff.hiddenLines.expandAll","Double click to unfold")},m);_.addEventListener("dblclick",y=>{y.button===0&&(y.preventDefault(),this._unchangedRegion.showAll(void 0))}),g.push(_);const v=this._unchangedRegion.getHiddenModifiedRange(h),b=this._modifiedOutlineSource.getBreadcrumbItems(v,h);if(b.length>0){g.push(at("span",void 0,"  |  "));for(let y=0;y<b.length;y++){const C=b[y],x=TV.toIcon(C.kind),k=Fl("div.breadcrumb-item",{style:{display:"flex",alignItems:"center"}},[lae(x)," ",C.name,...y===b.length-1?[]:[lae(Ct.chevronRight)]]).root;g.push(k),k.onclick=()=>{this._revealModifiedHiddenLine(C.startLineNumber)}}}}Yl(this._nodes.others,...g)}))}}class k_{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new k_(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const r=e.getVisibleRanges();if(r.length>0){t=r[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}return new k_(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,r,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=r,this._cursorPosition=o}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i)}}var RZi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},rRe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},NZi=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},XS;let UH=XS=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new be,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)===null||e===void 0||e.dispose()}computeDiff(e,t,i,r){var o,s;return NZi(this,void 0,void 0,function*(){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,r);if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new kg(new zi(1,2),new zi(1,t.getLineCount()+1),[new hw(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const a=JSON.stringify([e.uri.toString(),t.uri.toString()]),l=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),c=XS.diffCache.get(a);if(c&&c.context===l)return c.result;const u=$c.create(),d=yield this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),h=u.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:h,timedOut:(o=d==null?void 0:d.quitEarly)!==null&&o!==void 0?o:!0,detectedMoves:i.computeMoves?(s=d==null?void 0:d.moves.length)!==null&&s!==void 0?s:0:-1}),r.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!d)throw new Error("no diff result available");return XS.diffCache.size>10&&XS.diffCache.delete(XS.diffCache.keys().next().value),XS.diffCache.set(a,{result:d,context:l}),d})}setOptions(e){var t;let i=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((t=this.diffAlgorithmOnDidChangeSubscription)===null||t===void 0||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),i=!0),i&&this.onDidChangeEventEmitter.fire()}};UH.diffCache=new Map;UH=XS=RZi([rRe(1,lm),rRe(2,wf)],UH);var OZi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},PZi=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const iYe=Vi("diffProviderFactoryService");let sle=class{constructor(e){this.instantiationService=e}createDiffProvider(e,t){return this.instantiationService.createInstance(UH,t)}};sle=OZi([PZi(0,Un)],sle);Zi(iYe,sle,1);var MZi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},FZi=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},oRe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let ale=class extends Ae{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i,r){super(),this.model=e,this._options=t,this._editor=i,this._diffProviderFactoryService=r,this._isDiffUpToDate=No(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=No(this,void 0),this.diff=this._diff,this._unchangedRegions=No(this,{regions:[],originalDecorationIds:[],modifiedDecorationIds:[]}),this.unchangedRegions=Ki(this,l=>this._options.hideUnchangedRegions.read(l)?this._unchangedRegions.read(l).regions:(Jo(c=>{for(const u of this._unchangedRegions.get().regions)u.collapseAll(c)}),[])),this.movedTextToCompare=No(this,void 0),this._activeMovedText=No(this,void 0),this._hoveredMovedText=No(this,void 0),this.activeMovedText=Ki(this,l=>{var c,u;return(u=(c=this.movedTextToCompare.read(l))!==null&&c!==void 0?c:this._hoveredMovedText.read(l))!==null&&u!==void 0?u:this._activeMovedText.read(l)}),this._cancellationTokenSource=new da,this._diffProvider=Ki(this,l=>{const c=this._diffProviderFactoryService.createDiffProvider(this._editor,{diffAlgorithm:this._options.diffAlgorithm.read(l)}),u=$h("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:u}}),this._register(Gn(()=>this._cancellationTokenSource.cancel()));const o=XGe("contentChangedSignal"),s=this._register(new so(()=>o.trigger(void 0),200)),a=(l,c,u)=>{const d=qH.fromDiffs(l.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(u),this._options.hideUnchangedRegionsContextLineCount.read(u)),h=this._unchangedRegions.get(),g=h.originalDecorationIds.map(v=>e.original.getDecorationRange(v)).filter(v=>!!v).map(v=>zi.fromRange(v)),p=h.modifiedDecorationIds.map(v=>e.modified.getDecorationRange(v)).filter(v=>!!v).map(v=>zi.fromRange(v)),m=e.original.deltaDecorations(h.originalDecorationIds,d.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),_=e.modified.deltaDecorations(h.modifiedDecorationIds,d.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));for(const v of d)for(let b=0;b<h.regions.length;b++)if(v.originalUnchangedRange.intersectsStrict(g[b])&&v.modifiedUnchangedRange.intersectsStrict(p[b])){v.setHiddenModifiedRange(h.regions[b].getHiddenModifiedRange(void 0),c);break}this._unchangedRegions.set({regions:d,originalDecorationIds:m,modifiedDecorationIds:_},c)};this._register(e.modified.onDidChangeContent(l=>{if(this._diff.get()){const u=Wy.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}s.schedule()})),this._register(e.original.onDidChangeContent(l=>{if(this._diff.get()){const u=Wy.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}s.schedule()})),this._register(Gd((l,c)=>oRe(this,void 0,void 0,function*(){var u,d;this._options.hideUnchangedRegionsMinimumLineCount.read(l),this._options.hideUnchangedRegionsContextLineCount.read(l),s.cancel(),o.read(l);const h=this._diffProvider.read(l);h.onChangeSignal.read(l),E1(nqe,l),E1(cse,l),this._isDiffUpToDate.set(!1,void 0);let g=[];c.add(e.original.onDidChangeContent(_=>{const v=Wy.fromModelContentChanges(_.changes);g=rH(g,v)}));let p=[];c.add(e.modified.onDidChangeContent(_=>{const v=Wy.fromModelContentChanges(_.changes);p=rH(p,v)}));let m=yield h.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(l),maxComputationTimeMs:this._options.maxComputationTimeMs.read(l),computeMoves:this._options.showMoves.read(l)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||(m=BZi(m,e.original,e.modified),m=(u=(e.original,e.modified,void 0))!==null&&u!==void 0?u:m,m=(d=(e.original,e.modified,void 0))!==null&&d!==void 0?d:m,Jo(_=>{a(m,_),this._lastDiff=m;const v=Tve.fromDiffResult(m);this._diff.set(v,_),this._isDiffUpToDate.set(!0,_);const b=this.movedTextToCompare.get();this.movedTextToCompare.set(b?this._lastDiff.moves.find(y=>y.lineRangeMapping.modified.intersect(b.lineRangeMapping.modified)):void 0,_)}))})))}ensureModifiedLineIsVisible(e,t){var i;if(((i=this.diff.get())===null||i===void 0?void 0:i.mappings.length)===0)return;const r=this._unchangedRegions.get().regions;for(const o of r)if(o.getHiddenModifiedRange(void 0).contains(e)){o.showModifiedLine(e,t);return}}ensureOriginalLineIsVisible(e,t){var i;if(((i=this.diff.get())===null||i===void 0?void 0:i.mappings.length)===0)return;const r=this._unchangedRegions.get().regions;for(const o of r)if(o.getHiddenOriginalRange(void 0).contains(e)){o.showOriginalLine(e,t);return}}waitForDiff(){return oRe(this,void 0,void 0,function*(){yield tZi(this.isDiffUpToDate,e=>e)})}serializeState(){return{collapsedRegions:this._unchangedRegions.get().regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){const t=e.collapsedRegions.map(r=>zi.deserialize(r.range)),i=this._unchangedRegions.get();Jo(r=>{for(const o of i.regions)for(const s of t)if(o.modifiedUnchangedRange.intersect(s)){o.setHiddenModifiedRange(s,r);break}})}};ale=MZi([FZi(3,iYe)],ale);function BZi(n,e,t){return{changes:n.changes.map(i=>new kg(i.original,i.modified,i.innerChanges?i.innerChanges.map(r=>$Zi(r,e,t)):void 0)),moves:n.moves,identical:n.identical,quitEarly:n.quitEarly}}function $Zi(n,e,t){let i=n.originalRange,r=n.modifiedRange;return(i.endColumn!==1||r.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&r.endColumn===t.getLineMaxColumn(r.endLineNumber)&&i.endLineNumber<e.getLineCount()&&r.endLineNumber<t.getLineCount()&&(i=i.setEndPosition(i.endLineNumber+1,1),r=r.setEndPosition(r.endLineNumber+1,1)),new hw(i,r)}class Tve{static fromDiffResult(e){return new Tve(e.changes.map(t=>new rYe(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,r){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=r}}class rYe{constructor(e){this.lineRangeMapping=e}}class qH{static fromDiffs(e,t,i,r,o){const s=kg.inverse(e,t,i),a=[];for(const l of s){let c=l.original.startLineNumber,u=l.modified.startLineNumber,d=l.original.length;const h=c===1&&u===1,g=c+d===t+1&&u+d===i+1;(h||g)&&d>=o+r?(h&&!g&&(d-=o),g&&!h&&(c+=o,u+=o,d-=o),a.push(new qH(c,u,d,0,0))):d>=o*2+r&&(c+=o,u+=o,d-=o*2,a.push(new qH(c,u,d,0,0)))}return a}get originalUnchangedRange(){return zi.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return zi.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,r,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=No(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=No(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=Ki(this,s=>this.visibleLineCountTop.read(s)+this.visibleLineCountBottom.read(s)===this.lineCount&&!this.isDragged.read(s)),this.isDragged=No(this,!1),this._visibleLineCountTop.set(r,void 0),this._visibleLineCountBottom.set(o,void 0)}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return zi.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return zi.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,r=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,r,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t){const i=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),r=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;i<r?this._visibleLineCountTop.set(this._visibleLineCountTop.get()+i,t):this._visibleLineCountBottom.set(this._visibleLineCountBottom.get()+r,t)}showOriginalLine(e,t){const i=e-this.originalLineNumber,r=this.originalLineNumber+this.lineCount-e;i<r?this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+r-i,this.getMaxVisibleLineCountTop()),t):this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+i-r,this.getMaxVisibleLineCountBottom()),t)}collapseAll(e){this._visibleLineCountTop.set(0,e),this._visibleLineCountBottom.set(0,e)}setState(e,t,i){e=Math.max(Math.min(e,this.lineCount),0),t=Math.max(Math.min(t,this.lineCount-e),0),this._visibleLineCountTop.set(e,i),this._visibleLineCountBottom.set(t,i)}}var hJ=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class VZi extends Ae{get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}constructor(e,t,i,r,o,s,a,l,c){super(),this._getViewZoneId=e,this._marginDomNode=t,this._modifiedEditor=i,this._diff=r,this._editor=o,this._viewLineCounts=s,this._originalTextModel=a,this._contextMenuService=l,this._clipboardService=c,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=In.asClassName(Ct.lightBulb)+" lightbulb-glyph",this._diffActions.style.position="absolute";const u=this._modifiedEditor.getOption(66);this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${u}px`,this._diffActions.style.lineHeight=`${u}px`,this._marginDomNode.appendChild(this._diffActions);let d=0;const h=i.getOption(126)&&!C_,g=(p,m)=>{var _;this._contextMenuService.showContextMenu({domForShadowRoot:h&&(_=i.getDomNode())!==null&&_!==void 0?_:void 0,getAnchor:()=>({x:p,y:m}),getActions:()=>{const v=[],b=r.modified.isEmpty;return v.push(new Gu("diff.clipboard.copyDeletedContent",b?r.original.length>1?E("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):E("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):r.original.length>1?E("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):E("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,()=>hJ(this,void 0,void 0,function*(){const C=this._originalTextModel.getValueInRange(r.original.toExclusiveRange());yield this._clipboardService.writeText(C)}))),r.original.length>1&&v.push(new Gu("diff.clipboard.copyDeletedLineContent",b?E("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",r.original.startLineNumber+d):E("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",r.original.startLineNumber+d),void 0,!0,()=>hJ(this,void 0,void 0,function*(){let C=this._originalTextModel.getLineContent(r.original.startLineNumber+d);C===""&&(C=this._originalTextModel.getEndOfLineSequence()===0?`
`:`\r
`),yield this._clipboardService.writeText(C)}))),i.getOption(90)||v.push(new Gu("diff.inline.revertChange",E("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>hJ(this,void 0,void 0,function*(){this._editor.revert(this._diff)}))),v},autoSelectFirstItem:!0})};this._register(ua(this._diffActions,"mousedown",p=>{const{top:m,height:_}=Oa(this._diffActions),v=Math.floor(u/3);p.preventDefault(),g(p.posx,m+_+v)})),this._register(i.onMouseMove(p=>{(p.target.type===8||p.target.type===5)&&p.target.detail.viewZoneId===this._getViewZoneId()?(d=this._updateLightBulbPosition(this._marginDomNode,p.event.browserEvent.y,u),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(p=>{p.event.rightButton&&(p.target.type===8||p.target.type===5)&&p.target.detail.viewZoneId===this._getViewZoneId()&&(p.event.preventDefault(),d=this._updateLightBulbPosition(this._marginDomNode,p.event.browserEvent.y,u),g(p.event.posx,p.event.posy+u))}))}_updateLightBulbPosition(e,t,i){const{top:r}=Oa(e),o=t-r,s=Math.floor(o/i),a=s*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;c<this._viewLineCounts.length;c++)if(l+=this._viewLineCounts[c],s<l)return c}return s}}const sRe=R0("diffEditorWidget",{createHTML:n=>n});function HZi(n,e,t,i){mc(i,e.fontInfo);const r=t.length>0,o=new SA(1e4);let s=0,a=0;const l=[];for(let h=0;h<n.lineTokens.length;h++){const g=h+1,p=n.lineTokens[h],m=n.lineBreakData[h],_=Jd.filter(t,g,1,Number.MAX_SAFE_INTEGER);if(m){let v=0;for(const b of m.breakOffsets){const y=p.sliceAndInflate(v,b,0);s=Math.max(s,aRe(a,y,Jd.extractWrapped(_,v,b),r,n.mightContainNonBasicASCII,n.mightContainRTL,e,o)),a++,v=b}l.push(m.breakOffsets.length)}else l.push(1),s=Math.max(s,aRe(a,p,_,r,n.mightContainNonBasicASCII,n.mightContainRTL,e,o)),a++}s+=e.scrollBeyondLastColumn;const c=o.build(),u=sRe?sRe.createHTML(c):c;i.innerHTML=u;const d=s*e.typicalHalfwidthCharacterWidth;return{heightInLines:a,minWidthInPx:d,viewLineCounts:l}}class WZi{constructor(e,t,i,r){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=r}}class Ive{static fromEditor(e){var t;const i=e.getOptions(),r=i.get(50),o=i.get(143);return new Ive(((t=e.getModel())===null||t===void 0?void 0:t.getOptions().tabSize)||0,r,i.get(33),r.typicalHalfwidthCharacterWidth,i.get(103),i.get(66),o.decorationsWidth,i.get(116),i.get(98),i.get(93),i.get(51))}constructor(e,t,i,r,o,s,a,l,c,u,d){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=r,this.scrollBeyondLastColumn=o,this.lineHeight=s,this.lineDecorationsWidth=a,this.stopRenderingLineAfter=l,this.renderWhitespace=c,this.renderControlCharacters=u,this.fontLigatures=d}}function aRe(n,e,t,i,r,o,s,a){a.appendString('<div class="view-line'),i||a.appendString(" char-delete"),a.appendString('" style="top:'),a.appendString(String(n*s.lineHeight)),a.appendString('px;width:1000000px;">');const l=e.getLineContent(),c=gf.isBasicASCII(l,r),u=gf.containsRTL(l,c,o),d=v5(new tS(s.fontInfo.isMonospace&&!s.disableMonospaceOptimizations,s.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,u,0,e,t,s.tabSize,0,s.fontInfo.spaceWidth,s.fontInfo.middotWidth,s.fontInfo.wsmiddotWidth,s.stopRenderingLineAfter,s.renderWhitespace,s.renderControlCharacters,s.fontLigatures!==Fh.OFF,null),a);return a.appendString("</div>"),d.characterMapping.getHorizontalOffset(d.characterMapping.length)}var zZi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},lRe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let lle=class extends Ae{constructor(e,t,i,r,o,s,a){super(),this._editors=e,this._diffModel=t,this._options=i,this._diffEditorWidget=r,this._canIgnoreViewZoneUpdateEvent=o,this._clipboardService=s,this._contextMenuService=a,this._originalTopPadding=No(this,0),this._originalScrollOffset=No(this,0),this._originalScrollOffsetAnimated=YAe(this._originalScrollOffset,this._store),this._modifiedTopPadding=No(this,0),this._modifiedScrollOffset=No(this,0),this._modifiedScrollOffsetAnimated=YAe(this._modifiedScrollOffset,this._store);let l=!1;const c=No("state",0),u=this._register(new so(()=>{c.set(c.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(C=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&u.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(C=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&u.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(C=>{(C.hasChanged(144)||C.hasChanged(66))&&u.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(C=>{(C.hasChanged(144)||C.hasChanged(66))&&u.schedule()}));const d=this._diffModel.map(C=>C?Ul(C.model.original.onDidChangeTokens,()=>C.model.original.tokenization.backgroundTokenizationState===2):void 0).map((C,x)=>C==null?void 0:C.read(x)),h=new Set,g=new Set,p=Ki(C=>{const x=this._diffModel.read(C),k=x==null?void 0:x.diff.read(C);if(!x||!k)return null;c.read(C);const L=this._options.renderSideBySide.read(C);return cRe(this._editors.original,this._editors.modified,k.mappings,h,g,L)}),m=Ki(C=>{var x;const k=(x=this._diffModel.read(C))===null||x===void 0?void 0:x.movedTextToCompare.read(C);if(!k)return null;c.read(C);const I=k.changes.map(L=>new rYe(L));return cRe(this._editors.original,this._editors.modified,I,h,g,!0)});function _(){const C=document.createElement("div");return C.className="diagonal-fill",C}const v=this._register(new nt),b=Ki(C=>{var x,k,I,L,D,R,P,M;v.clear();const O=p.read(C)||[],B=[],F=[],H=this._modifiedTopPadding.read(C);H>0&&F.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:H,showInHiddenAreas:!0,suppressMouseDown:!0});const V=this._originalTopPadding.read(C);V>0&&B.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:V,showInHiddenAreas:!0,suppressMouseDown:!0});const $=this._options.renderSideBySide.read(C),j=$||(x=this._editors.modified._getViewModel())===null||x===void 0?void 0:x.createLineBreaksComputer();if(j){for(const Re of O)if(Re.diff)for(let Ye=Re.originalRange.startLineNumber;Ye<Re.originalRange.endLineNumberExclusive;Ye++)j==null||j.addRequest(this._editors.original.getModel().getLineContent(Ye),null,null)}const Y=(k=j==null?void 0:j.finalize())!==null&&k!==void 0?k:[];let ne=0;const se=this._editors.modified.getOption(66),he=(I=this._diffModel.read(C))===null||I===void 0?void 0:I.movedTextToCompare.read(C),xe=(D=(L=this._editors.original.getModel())===null||L===void 0?void 0:L.mightContainNonBasicASCII())!==null&&D!==void 0?D:!1,_e=(P=(R=this._editors.original.getModel())===null||R===void 0?void 0:R.mightContainRTL())!==null&&P!==void 0?P:!1,Ie=Ive.fromEditor(this._editors.modified);for(const Re of O)if(Re.diff&&!$){if(!Re.originalRange.isEmpty){d.read(C);const Ze=document.createElement("div");Ze.classList.add("view-lines","line-delete","monaco-mouse-cursor-text");const tt=new WZi(Re.originalRange.mapToLineArray(Kt=>this._editors.original.getModel().tokenization.getLineTokens(Kt)),Re.originalRange.mapToLineArray(Kt=>Y[ne++]),xe,_e),Be=[];for(const Kt of Re.diff.innerChanges||[])Be.push(new OO(Kt.originalRange.delta(-(Re.diff.original.startLineNumber-1)),ile.className,0));const kt=HZi(tt,Ie,Be,Ze),Vt=document.createElement("div");if(Vt.className="inline-deleted-margin-view-zone",mc(Vt,Ie.fontInfo),this._options.renderIndicators.read(C))for(let Kt=0;Kt<kt.heightInLines;Kt++){const cn=document.createElement("div");cn.className=`delete-sign ${In.asClassName(eYe)}`,cn.setAttribute("style",`position:absolute;top:${Kt*se}px;width:${Ie.lineDecorationsWidth}px;height:${se}px;right:0;`),Vt.appendChild(cn)}let xt;v.add(new VZi(()=>xE(xt),Vt,this._editors.modified,Re.diff,this._diffEditorWidget,kt.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Kt=0;Kt<kt.viewLineCounts.length;Kt++){const cn=kt.viewLineCounts[Kt];cn>1&&B.push({afterLineNumber:Re.originalRange.startLineNumber+Kt,domNode:_(),heightInPx:(cn-1)*se,showInHiddenAreas:!0,suppressMouseDown:!0})}F.push({afterLineNumber:Re.modifiedRange.startLineNumber-1,domNode:Ze,heightInPx:kt.heightInLines*se,minWidthInPx:kt.minWidthInPx,marginDomNode:Vt,setZoneId(Kt){xt=Kt},showInHiddenAreas:!0,suppressMouseDown:!0})}const Ye=document.createElement("div");Ye.className="gutter-delete",B.push({afterLineNumber:Re.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:Re.modifiedHeightInPx,marginDomNode:Ye,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const Ye=Re.modifiedHeightInPx-Re.originalHeightInPx;if(Ye>0){if(he!=null&&he.lineRangeMapping.original.delta(-1).deltaLength(2).contains(Re.originalRange.endLineNumberExclusive-1))continue;B.push({afterLineNumber:Re.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:Ye,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let Ze=function(){const Be=document.createElement("div");return Be.className="arrow-revert-change "+In.asClassName(Ct.arrowRight),at("div",{},Be)};if(he!=null&&he.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(Re.modifiedRange.endLineNumberExclusive-1))continue;let tt;Re.diff&&Re.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(C)&&(tt=Ze()),F.push({afterLineNumber:Re.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-Ye,marginDomNode:tt,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const Re of(M=m.read(C))!==null&&M!==void 0?M:[]){if(!(he!=null&&he.lineRangeMapping.original.intersect(Re.originalRange))||!(he!=null&&he.lineRangeMapping.modified.intersect(Re.modifiedRange)))continue;const Ye=Re.modifiedHeightInPx-Re.originalHeightInPx;Ye>0?B.push({afterLineNumber:Re.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:Ye,showInHiddenAreas:!0,suppressMouseDown:!0}):F.push({afterLineNumber:Re.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-Ye,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:B,mod:F}});this._register(Gd(C=>{const x=k_.capture(this._editors.modified),k=b.read(C);l=!0,this._editors.original.changeViewZones(I=>{for(const L of h)I.removeZone(L);h.clear();for(const L of k.orig){const D=I.addZone(L);L.setZoneId&&L.setZoneId(D),h.add(D)}}),this._editors.modified.changeViewZones(I=>{for(const L of g)I.removeZone(L);g.clear();for(const L of k.mod){const D=I.addZone(L);L.setZoneId&&L.setZoneId(D),g.add(D)}}),l=!1,x.restore(this._editors.modified)})),this._register(Gn(()=>{this._editors.original.changeViewZones(C=>{for(const x of h)C.removeZone(x);h.clear()}),this._editors.modified.changeViewZones(C=>{for(const x of g)C.removeZone(x);g.clear()})}));let y=!1;this._register(this._editors.original.onDidScrollChange(C=>{C.scrollLeftChanged&&!y&&(y=!0,this._editors.modified.setScrollLeft(C.scrollLeft),y=!1)})),this._register(this._editors.modified.onDidScrollChange(C=>{C.scrollLeftChanged&&!y&&(y=!0,this._editors.original.setScrollLeft(C.scrollLeft),y=!1)})),this._originalScrollTop=Ul(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Ul(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(So(C=>{const x=this._originalScrollTop.read(C)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(C))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(C));x!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(x,1)})),this._register(So(C=>{const x=this._modifiedScrollTop.read(C)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(C))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(C));x!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(x,1)})),this._register(So(C=>{var x;const k=(x=this._diffModel.read(C))===null||x===void 0?void 0:x.movedTextToCompare.read(C);let I=0;if(k){const L=this._editors.original.getTopForLineNumber(k.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();I=this._editors.modified.getTopForLineNumber(k.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-L}I>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(I,void 0)):I<0?(this._modifiedTopPadding.set(-I,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-I,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+I,void 0,!0)}))}};lle=zZi([lRe(5,F0),lRe(6,om)],lle);function cRe(n,e,t,i,r,o){const s=new v0(uRe(n,i)),a=new v0(uRe(e,r)),l=n.getOption(66),c=e.getOption(66),u=[];let d=0,h=0;function g(p,m){for(;;){let _=s.peek(),v=a.peek();if(_&&_.lineNumber>=p&&(_=void 0),v&&v.lineNumber>=m&&(v=void 0),!_&&!v)break;const b=_?_.lineNumber-d:Number.MAX_VALUE,y=v?v.lineNumber-h:Number.MAX_VALUE;b<y?(s.dequeue(),v={lineNumber:_.lineNumber-d+h,heightInPx:0}):b>y?(a.dequeue(),_={lineNumber:v.lineNumber-h+d,heightInPx:0}):(s.dequeue(),a.dequeue()),u.push({originalRange:zi.ofLength(_.lineNumber,1),modifiedRange:zi.ofLength(v.lineNumber,1),originalHeightInPx:l+_.heightInPx,modifiedHeightInPx:c+v.heightInPx,diff:void 0})}}for(const p of t){let y=function(C,x){var k,I,L,D;if(C<b||x<v)return;if(_)_=!1;else if(C===b||x===v)return;const R=new zi(b,C),P=new zi(v,x);if(R.isEmpty&&P.isEmpty)return;const M=(I=(k=s.takeWhile(B=>B.lineNumber<C))===null||k===void 0?void 0:k.reduce((B,F)=>B+F.heightInPx,0))!==null&&I!==void 0?I:0,O=(D=(L=a.takeWhile(B=>B.lineNumber<x))===null||L===void 0?void 0:L.reduce((B,F)=>B+F.heightInPx,0))!==null&&D!==void 0?D:0;u.push({originalRange:R,modifiedRange:P,originalHeightInPx:R.length*l+M,modifiedHeightInPx:P.length*c+O,diff:p.lineRangeMapping}),b=C,v=x};const m=p.lineRangeMapping;g(m.original.startLineNumber,m.modified.startLineNumber);let _=!0,v=m.modified.startLineNumber,b=m.original.startLineNumber;if(o)for(const C of m.innerChanges||[])C.originalRange.startColumn>1&&C.modifiedRange.startColumn>1&&y(C.originalRange.startLineNumber,C.modifiedRange.startLineNumber),C.originalRange.endColumn<n.getModel().getLineMaxColumn(C.originalRange.endLineNumber)&&y(C.originalRange.endLineNumber,C.modifiedRange.endLineNumber);y(m.original.endLineNumberExclusive,m.modified.endLineNumberExclusive),d=m.original.endLineNumberExclusive,h=m.modified.endLineNumberExclusive}return g(Number.MAX_VALUE,Number.MAX_VALUE),u}function uRe(n,e){const t=[],i=[],r=n.getOption(144).wrappingColumn!==-1,o=n._getViewModel().coordinatesConverter,s=n.getOption(66);if(r)for(let l=1;l<=n.getModel().getLineCount();l++){const c=o.getModelLineViewLineCount(l);c>1&&i.push({lineNumber:l,heightInPx:s*(c-1)})}for(const l of n.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new Ce(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return sZi(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}var jZi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},UZi=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Im;let e0=Im=class extends Ae{constructor(e,t,i,r,o,s,a,l){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=r,this._rootHeight=o,this._modifiedEditorLayoutInfo=s,this._options=a,this._themeService=l;const c=Ul(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),u=Ki(g=>{const p=c.read(g),m=p.getColor(rVi)||(p.getColor(nVi)||_se).transparent(2),_=p.getColor(oVi)||(p.getColor(iVi)||vse).transparent(2);return{insertColor:m,removeColor:_}}),d=Ul(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),h=Ul(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollHeight());this._register(Gd((g,p)=>{if(!this._options.renderOverviewRuler.read(g))return;const m=Or(document.createElement("div"));m.setClassName("diffViewport"),m.setPosition("absolute");const _=Fl("div.diffOverview",{style:{position:"absolute",top:"0px",width:Im.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;p.add(i$(_,m.domNode)),p.add(ua(_,Lt.POINTER_DOWN,v=>{this._editors.modified.delegateVerticalScrollbarPointerDown(v)})),p.add(We(_,Lt.MOUSE_WHEEL,v=>{this._editors.modified.delegateScrollFromMouseWheelEvent(v)},{passive:!1})),p.add(i$(this._rootElement,_)),p.add(Gd((v,b)=>{const y=this._diffModel.read(v),C=this._editors.original.createOverviewRuler("original diffOverviewRuler");C&&(b.add(C),b.add(i$(_,C.getDomNode())));const x=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(x&&(b.add(x),b.add(i$(_,x.getDomNode()))),!C||!x)return;const k=$h("viewZoneChanged",this._editors.original.onDidChangeViewZones),I=$h("viewZoneChanged",this._editors.modified.onDidChangeViewZones),L=$h("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),D=$h("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);b.add(So(R=>{var P;k.read(R),I.read(R),L.read(R),D.read(R);const M=u.read(R),O=(P=y==null?void 0:y.diff.read(R))===null||P===void 0?void 0:P.mappings;function B(V,$,j){const Y=j._getViewModel();return Y?V.filter(ne=>ne.length>0).map(ne=>{const se=Y.coordinatesConverter.convertModelPositionToViewPosition(new Ce(ne.startLineNumber,1)),he=Y.coordinatesConverter.convertModelPositionToViewPosition(new Ce(ne.endLineNumberExclusive,1)),xe=he.lineNumber-se.lineNumber;return new Qqe(se.lineNumber,he.lineNumber,xe,$.toString())}):[]}const F=B((O||[]).map(V=>V.lineRangeMapping.original),M.removeColor,this._editors.original),H=B((O||[]).map(V=>V.lineRangeMapping.modified),M.insertColor,this._editors.modified);C==null||C.setZones(F),x==null||x.setZones(H)})),b.add(So(R=>{const P=this._rootHeight.read(R),M=this._rootWidth.read(R),O=this._modifiedEditorLayoutInfo.read(R);if(O){const B=Im.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Im.ONE_OVERVIEW_WIDTH;C.setLayout({top:0,height:P,right:B+Im.ONE_OVERVIEW_WIDTH,width:Im.ONE_OVERVIEW_WIDTH}),x.setLayout({top:0,height:P,right:0,width:Im.ONE_OVERVIEW_WIDTH});const F=d.read(R),H=h.read(R),V=this._editors.modified.getOption(102),$=new s2(V.verticalHasArrows?V.arrowSize:0,V.verticalScrollbarSize,0,O.height,H,F);m.setTop($.getSliderPosition()),m.setHeight($.getSliderSize())}else m.setTop(0),m.setHeight(0);_.style.height=P+"px",_.style.left=M-Im.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",m.setWidth(Im.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}))}};e0.ONE_OVERVIEW_WIDTH=15;e0.ENTIRE_DIFF_OVERVIEW_WIDTH=Im.ONE_OVERVIEW_WIDTH*2;e0=Im=jZi([UZi(7,ll)],e0);re("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},E("diffEditor.move.border","The border color for text that got moved in the diff editor."));re("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},E("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));class Wq extends Ae{constructor(){super(...arguments),this._id=++Wq.idCounter,this._onDidDispose=this._register(new be),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,r=!0){this._targetEditor.revealRange(e,t,i,r)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}Wq.idCounter=0;var qZi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},dRe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let cle=class extends Ae{constructor(e,t,i,r,o,s,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._createInnerEditor=o,this._instantiationService=s,this._keybindingService=a,this._onDidContentSizeChange=this._register(new be),this.original=this._register(this._createLeftHandSideEditor(i.editorOptions.get(),r.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(i.editorOptions.get(),r.modifiedEditor||{})),this.modifiedModel=Ul(this.modified.onDidChangeModel,()=>this.modified.getModel()),this._register($q({createEmptyChangeSummary:()=>({}),handleChange:(l,c)=>(l.didChange(i.editorOptions)&&Object.assign(c,l.change.changedOptions),!0)},(l,c)=>{i.editorOptions.read(l),this._options.renderSideBySide.read(l),this.modified.updateOptions(this._adjustOptionsForRightHandSide(l,c)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(l,c))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),r=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return r.setContextValue("isInDiffLeftEditor",!0),r}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),r=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return r.setContextValue("isInDiffRightEditor",!0),r}_constructInnerEditor(e,t,i,r){const o=this._createInnerEditor(e,t,i,r);return this._register(o.onDidContentSizeChange(s=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+e0.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:s.contentHeightChanged,contentWidthChanged:s.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=A_.revealHorizontalRightPadding.defaultValue+e0.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t=Object.assign(Object.assign({},e),{dimension:{height:0,width:0}});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.get(),t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var t;e||(e="");const i=E("diff-aria-navigation-tip"," use {0} to open the accessibility help.",(t=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))===null||t===void 0?void 0:t.getAriaLabel());return this._options.accessibilityVerbose.get()?e+i:e?e.replaceAll(i,""):""}};cle=qZi([dRe(5,Un),dRe(6,mo)],cle);class KZi{get editorOptions(){return this._options}constructor(e,t){this.diffEditorWidth=t,this.couldShowInlineViewBecauseOfSize=Ki(this,r=>this._options.read(r).renderSideBySide&&this.diffEditorWidth.read(r)<=this._options.read(r).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=Ki(this,r=>this._options.read(r).renderOverviewRuler),this.renderSideBySide=Ki(this,r=>this._options.read(r).renderSideBySide&&!(this._options.read(r).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(r))),this.readOnly=Ki(this,r=>this._options.read(r).readOnly),this.shouldRenderRevertArrows=Ki(this,r=>!(!this._options.read(r).renderMarginRevertIcon||!this.renderSideBySide.read(r)||this.readOnly.read(r))),this.renderIndicators=Ki(this,r=>this._options.read(r).renderIndicators),this.enableSplitViewResizing=Ki(this,r=>this._options.read(r).enableSplitViewResizing),this.splitViewDefaultRatio=Ki(this,r=>this._options.read(r).splitViewDefaultRatio),this.ignoreTrimWhitespace=Ki(this,r=>this._options.read(r).ignoreTrimWhitespace),this.maxComputationTimeMs=Ki(this,r=>this._options.read(r).maxComputationTime),this.showMoves=Ki(this,r=>this._options.read(r).experimental.showMoves&&this.renderSideBySide.read(r)),this.isInEmbeddedEditor=Ki(this,r=>this._options.read(r).isInEmbeddedEditor),this.diffWordWrap=Ki(this,r=>this._options.read(r).diffWordWrap),this.originalEditable=Ki(this,r=>this._options.read(r).originalEditable),this.diffCodeLens=Ki(this,r=>this._options.read(r).diffCodeLens),this.accessibilityVerbose=Ki(this,r=>this._options.read(r).accessibilityVerbose),this.diffAlgorithm=Ki(this,r=>this._options.read(r).diffAlgorithm),this.showEmptyDecorations=Ki(this,r=>this._options.read(r).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=Ki(this,r=>this._options.read(r).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=Ki(this,r=>this._options.read(r).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=Ki(this,r=>this._options.read(r).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=Ki(this,r=>this._options.read(r).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=Ki(this,r=>this._options.read(r).hideUnchangedRegions.minimumLineCount);const i=Object.assign(Object.assign({},e),hRe(e,Gc));this._options=No(this,i)}updateOptions(e){const t=hRe(e,this._options.get()),i=Object.assign(Object.assign(Object.assign({},this._options.get()),e),t);this._options.set(i,void 0,{changedOptions:e})}}function hRe(n,e){var t,i,r,o,s,a,l,c;return{enableSplitViewResizing:_n(n.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:X5i(n.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:_n(n.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:_n(n.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:US(n.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:US(n.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:_n(n.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:_n(n.renderIndicators,e.renderIndicators),originalEditable:_n(n.originalEditable,e.originalEditable),diffCodeLens:_n(n.diffCodeLens,e.diffCodeLens),renderOverviewRuler:_n(n.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:aa(n.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:aa(n.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:_n(n.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:_n((t=n.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:_n((i=n.experimental)===null||i===void 0?void 0:i.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:_n((o=(r=n.hideUnchangedRegions)===null||r===void 0?void 0:r.enabled)!==null&&o!==void 0?o:(s=n.experimental)===null||s===void 0?void 0:s.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:US((a=n.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:US((l=n.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:US((c=n.hideUnchangedRegions)===null||c===void 0?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:_n(n.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:_n(n.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:US(n.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:_n(n.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited)}}var GZi=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},QR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let jx=class extends Wq{constructor(e,t,i,r,o,s,a,l){var c;super(),this._domElement=e,this._parentContextKeyService=r,this._parentInstantiationService=o,this._audioCueService=a,this._editorProgressService=l,this.elements=Fl("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Fl("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[at("span",{},"No Changes")]),Fl("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Fl("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Fl("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=this._register(VH("diffModel",void 0)),this.onDidChangeModel=Pt.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new gq([Yn,this._contextKeyService])),this._boundarySashes=No(this,void 0),this._accessibleDiffViewerShouldBeVisible=No(this,!1),this._accessibleDiffViewerVisible=Ki(this,m=>this._options.onlyShowAccessibleDiffViewer.read(m)?!0:this._accessibleDiffViewerShouldBeVisible.read(m)),this.movedBlocksLinesPart=No(this,void 0),this._layoutInfo=Ki(this,m=>{var _,v,b;const y=this._rootSizeObserver.width.read(m),C=this._rootSizeObserver.height.read(m),x=(_=this._sash.read(m))===null||_===void 0?void 0:_.sashLeft.read(m),k=x??Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),I=y-k-(this._options.renderOverviewRuler.read(m)?e0.ENTIRE_DIFF_OVERVIEW_WIDTH:0),L=(b=(v=this.movedBlocksLinesPart.read(m))===null||v===void 0?void 0:v.width.read(m))!==null&&b!==void 0?b:0,D=k-L;return this.elements.original.style.width=D+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=I+"px",this.elements.modified.style.left=k+"px",this._editors.original.layout({width:D,height:C}),this._editors.modified.layout({width:I,height:C}),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((m,_)=>m==null?void 0:m.diff.read(_)),this.onDidUpdateDiff=Pt.fromObservableLight(this._diffValue),s.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(Gn(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new aZi(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((c=t.automaticLayout)!==null&&c!==void 0?c:!1),this._options=new KZi(t,this._rootSizeObserver.width),this._contextKeyService.createKey(ee.isEmbeddedDiffEditor.key,!1);const u=ee.isEmbeddedDiffEditor.bindTo(this._contextKeyService);this._register(So(m=>{u.set(this._options.isInEmbeddedEditor.read(m))}));const d=ee.comparingMovedCode.bindTo(this._contextKeyService);this._register(So(m=>{var _;d.set(!!(!((_=this._diffModel.read(m))===null||_===void 0)&&_.movedTextToCompare.read(m)))}));const h=ee.diffEditorRenderSideBySideInlineBreakpointReached.bindTo(this._contextKeyService);this._register(So(m=>{h.set(this._options.couldShowInlineViewBecauseOfSize.read(m))})),this._editors=this._register(this._instantiationService.createInstance(cle,this.elements.original,this.elements.modified,this._options,i,(m,_,v,b)=>this._createInnerEditor(m,_,v,b))),this._sash=_4(this,(m,_)=>{const v=this._options.renderSideBySide.read(m);if(this.elements.root.classList.toggle("side-by-side",v),!v)return;const b=_.add(new IZi(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((y,C)=>y-(this._options.renderOverviewRuler.read(C)?e0.ENTIRE_DIFF_OVERVIEW_WIDTH:0))}));return _.add(So(y=>{const C=this._boundarySashes.read(y);C&&b.setBoundarySashes(C)})),b}),this._register(b4(this._sash)),this._register(Gd((m,_)=>{this.unchangedRangesFeature=_.add(this._instantiationService.createInstance(E1(rle,m),this._editors,this._diffModel,this._options))})),this._register(Gd((m,_)=>{_.add(new(E1(TZi,m))(this._editors,this._diffModel,this._options))})),this._register(Gd((m,_)=>{_.add(this._instantiationService.createInstance(E1(lle,m),this._editors,this._diffModel,this._options,this,()=>this.unchangedRangesFeature.isUpdatingViewZones))})),this._register(Gd((m,_)=>{_.add(this._instantiationService.createInstance(E1(e0,m),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(v=>v.modifiedEditor),this._options))})),this._register(Gd((m,_)=>{this._accessibleDiffViewer=_.add(this._register(this._instantiationService.createInstance(E1(iC,m),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(v,b)=>this._accessibleDiffViewerShouldBeVisible.set(v,b),this._options.onlyShowAccessibleDiffViewer.map(v=>!v),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((v,b)=>{var y;return(y=v==null?void 0:v.diff.read(b))===null||y===void 0?void 0:y.mappings.map(C=>C.lineRangeMapping)}),this._editors)))}));const g=this._accessibleDiffViewerVisible.map(m=>m?"hidden":"visible");this._register(BC(this.elements.modified,{visibility:g})),this._register(BC(this.elements.original,{visibility:g})),this._createDiffEditorContributions(),s.addDiffEditor(this),this._register(b4(this._layoutInfo)),this._register(Gd((m,_)=>{this.movedBlocksLinesPart.set(_.add(new(E1($C,m))(this.elements.root,this._diffModel,this._layoutInfo.map(v=>v.originalEditor),this._layoutInfo.map(v=>v.modifiedEditor),this._editors)),void 0)})),this._register(BC(this.elements.overlay,{width:this._layoutInfo.map((m,_)=>m.originalEditor.width+(this._options.renderSideBySide.read(_)?0:m.modifiedEditor.width)),visibility:Ki(m=>{var _,v;return this._options.hideUnchangedRegions.read(m)&&((v=(_=this._diffModel.read(m))===null||_===void 0?void 0:_.diff.read(m))===null||v===void 0?void 0:v.mappings.length)===0?"visible":"hidden"})})),this._register(this._editors.modified.onMouseDown(m=>{var _,v;if(!m.event.rightButton&&m.target.position&&(!((_=m.target.element)===null||_===void 0)&&_.className.includes("arrow-revert-change"))){const b=m.target.position.lineNumber,y=m.target,C=this._diffModel.get();if(!C)return;const x=(v=C.diff.get())===null||v===void 0?void 0:v.mappings;if(!x)return;const k=x.find(I=>(y==null?void 0:y.detail.afterLineNumber)===I.lineRangeMapping.modified.startLineNumber-1||I.lineRangeMapping.modified.startLineNumber===b);if(!k)return;this.revert(k.lineRangeMapping),m.event.stopPropagation()}})),this._register(Pt.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,m=>{var _,v;if((m==null?void 0:m.reason)===3){const b=(v=(_=this._diffModel.get())===null||_===void 0?void 0:_.diff.get())===null||v===void 0?void 0:v.mappings.find(y=>y.lineRangeMapping.modified.contains(m.position.lineNumber));b!=null&&b.lineRangeMapping.modified.isEmpty?this._audioCueService.playAudioCue(ur.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):b!=null&&b.lineRangeMapping.original.isEmpty?this._audioCueService.playAudioCue(ur.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):b&&this._audioCueService.playAudioCue(ur.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}));const p=this._diffModel.map((m,_)=>m==null?void 0:m.isDiffUpToDate.read(_));this._register(Gd((m,_)=>{if(p.read(m)===!1){const v=this._editorProgressService.show(!0,1e3);_.add(Gn(()=>v.done()))}}))}_createInnerEditor(e,t,i,r){return e.createInstance(l2,t,i,r)}_createDiffEditorContributions(){const e=kL.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){fi(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return _5.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;const t=this._editors.original.saveViewState(),i=this._editors.modified.saveViewState();return{original:t,modified:i,modelState:(e=this._diffModel.get())===null||e===void 0?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const i=e;this._editors.original.restoreViewState(i.original),this._editors.modified.restoreViewState(i.modified),i.modelState&&((t=this._diffModel.get())===null||t===void 0||t.restoreSerializedState(i.modelState))}}createViewModel(e){return this._instantiationService.createInstance(ale,e,this._options,this)}getModel(){var e,t;return(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.model)!==null&&t!==void 0?t:null}setModel(e){!e&&this._diffModel.get()&&this._accessibleDiffViewer.close();const t=e?"model"in e?e:this.createViewModel(e):void 0;this._editors.original.setModel(t?t.model.original:null),this._editors.modified.setModel(t?t.model.modified:null),Jo(i=>{this._diffModel.set(t,i)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get();return t?XZi(t):null}revert(e){var t;const i=(t=this._diffModel.get())===null||t===void 0?void 0:t.model;if(!i)return;const r=e.innerChanges?e.innerChanges.map(o=>({range:o.modifiedRange,text:i.original.getValueInRange(o.originalRange)})):[{range:e.modified.toExclusiveRange(),text:i.original.getValueInRange(e.original.toExclusiveRange())}];this._editors.modified.executeEdits("diffEditor",r)}accessibleDiffViewerNext(){this._accessibleDiffViewer.next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.prev()}mapToOtherSide(){var e,t;const i=this._editors.modified.hasWidgetFocus(),r=i?this._editors.modified:this._editors.original,o=i?this._editors.original:this._editors.modified;let s;const a=r.getSelection();if(a){const l=(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get())===null||t===void 0?void 0:t.mappings.map(c=>i?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=fRe(a.getStartPosition(),l),u=fRe(a.getEndPosition(),l);s=q.plusRange(c,u)}}return{destination:o,destinationSelection:s}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&Jo(i=>{for(const r of t)r.collapseAll(i)})}showAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&Jo(i=>{for(const r of t)r.showAll(i)})}};jx=GZi([QR(3,Yn),QR(4,Un),QR(5,Lr),QR(6,F5),QR(7,iS)],jx);function fRe(n,e){const t=HV(e,r=>r.original.startLineNumber<=n.lineNumber);if(!t)return q.fromPositions(n);if(t.original.endLineNumberExclusive<=n.lineNumber){const r=n.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return q.fromPositions(new Ce(r,n.column))}if(!t.innerChanges)return q.fromPositions(new Ce(t.modified.startLineNumber,1));const i=HV(t.innerChanges,r=>r.originalRange.getStartPosition().isBeforeOrEqual(n));if(!i){const r=n.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return q.fromPositions(new Ce(r,n.column))}if(i.originalRange.containsPosition(n))return i.modifiedRange;{const r=YZi(i.originalRange.getEndPosition(),n);return q.fromPositions(QZi(i.modifiedRange.getEndPosition(),r))}}function YZi(n,e){return n.lineNumber===e.lineNumber?new GM(0,e.column-n.column):new GM(e.lineNumber-n.lineNumber,e.column-1)}function QZi(n,e){return e.lineCount===0?new Ce(n.lineNumber,n.column+e.columnCount):new Ce(n.lineNumber+e.lineCount,e.columnCount+1)}function XZi(n){return n.mappings.map(e=>{const t=e.lineRangeMapping;let i,r,o,s,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,r=0,a=void 0):(i=t.original.startLineNumber,r=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,s=0,a=void 0):(o=t.modified.startLineNumber,s=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:r,modifiedStartLineNumber:o,modifiedEndLineNumber:s,charChanges:a==null?void 0:a.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}var Lve=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ko=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let ZZi=0,gRe=!1;function JZi(n){if(!n){if(gRe)return;gRe=!0}e7i(n||document.body)}let KH=class extends l2{constructor(e,t,i,r,o,s,a,l,c,u,d,h){const g=Object.assign({},t);g.ariaLabel=g.ariaLabel||vH.editorViewAccessibleLabel,g.ariaLabel=g.ariaLabel+";"+vH.accessibilityHelpMessage,super(e,g,{},i,r,o,s,l,c,u,d,h),a instanceof m2?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,JZi(g.ariaContainerElement)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const r="DYNAMIC_"+ ++ZZi,o=Ke.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(r,e,t,o),r}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Ae.None;const t=e.id,i=e.label,r=Ke.and(Ke.equals("editorId",this.getId()),Ke.deserialize(e.precondition)),o=e.keybindings,s=Ke.and(r,Ke.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(g,...p)=>Promise.resolve(e.run(this,...p)),u=new nt,d=this.getId()+":"+t;if(u.add(Xi.registerCommand(d,c)),a){const g={command:{id:d,title:i},when:r,group:a,order:l};u.add(jl.appendMenuItem(J.EditorContext,g))}if(Array.isArray(o))for(const g of o)u.add(this._standaloneKeybindingService.addDynamicKeybinding(d,g,c,s));const h=new Xqe(d,i,i,r,(...g)=>Promise.resolve(e.run(this,...g)),this._contextKeyService);return this._actions.set(t,h),u.add(Gn(()=>{this._actions.delete(t)})),u}_triggerCommand(e,t){if(this._codeEditorService instanceof uH)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};KH=Lve([Ko(2,Un),Ko(3,Lr),Ko(4,Fs),Ko(5,Yn),Ko(6,mo),Ko(7,ll),Ko(8,ga),Ko(9,N0),Ko(10,xo),Ko(11,en)],KH);let ule=class extends KH{constructor(e,t,i,r,o,s,a,l,c,u,d,h,g,p,m){const _=Object.assign({},t);$H(u,_,!1);const v=l.registerEditorContainer(e);typeof _.theme=="string"&&l.setTheme(_.theme),typeof _.autoDetectHighContrast<"u"&&l.setAutoDetectHighContrast(!!_.autoDetectHighContrast);const b=_.model;delete _.model,super(e,_,i,r,o,s,a,l,c,d,p,m),this._configurationService=u,this._standaloneThemeService=l,this._register(v);let y;if(typeof b>"u"){const C=g.getLanguageIdByMimeType(_.language)||_.language||nf;y=oYe(h,g,_.value||"",C,void 0),this._ownsModel=!0}else y=b,this._ownsModel=!1;if(this._attachModel(y),y){const C={oldModelUrl:null,newModelUrl:y.uri};this._onDidChangeModel.fire(C)}}dispose(){super.dispose()}updateOptions(e){$H(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};ule=Lve([Ko(2,Un),Ko(3,Lr),Ko(4,Fs),Ko(5,Yn),Ko(6,mo),Ko(7,Ef),Ko(8,ga),Ko(9,Ui),Ko(10,N0),Ko(11,ts),Ko(12,Qo),Ko(13,xo),Ko(14,en)],ule);let dle=class extends jx{constructor(e,t,i,r,o,s,a,l,c,u,d,h){const g=Object.assign({},t);$H(l,g,!0);const p=s.registerEditorContainer(e);typeof g.theme=="string"&&s.setTheme(g.theme),typeof g.autoDetectHighContrast<"u"&&s.setAutoDetectHighContrast(!!g.autoDetectHighContrast),super(e,g,{},r,i,o,h,u),this._configurationService=l,this._standaloneThemeService=s,this._register(p)}dispose(){super.dispose()}updateOptions(e){$H(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(KH,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};dle=Lve([Ko(2,Un),Ko(3,Yn),Ko(4,Lr),Ko(5,Ef),Ko(6,ga),Ko(7,Ui),Ko(8,om),Ko(9,iS),Ko(10,F0),Ko(11,F5)],dle);function oYe(n,e,t,i,r){if(t=t||"",!i){const o=t.indexOf(`
`);let s=t;return o!==-1&&(s=t.substring(0,o)),pRe(n,t,e.createByFilepathOrFirstLine(r||null,s),r)}return pRe(n,t,e.createById(i),r)}function pRe(n,e,t,i){return n.createModel(e,t,i)}var sYe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function eJi(n,e,t){return $n.initialize(t||{}).createInstance(ule,n,e)}function tJi(n){return $n.get(Lr).onCodeEditorAdd(t=>{n(t)})}function nJi(n){return $n.get(Lr).onDiffEditorAdd(t=>{n(t)})}function iJi(){return $n.get(Lr).listCodeEditors()}function rJi(){return $n.get(Lr).listDiffEditors()}function oJi(n,e,t){return $n.initialize(t||{}).createInstance(dle,n,e)}function sJi(n){if(typeof n.id!="string"||typeof n.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Xi.registerCommand(n.id,n.run)}function aJi(n){if(typeof n.id!="string"||typeof n.label!="string"||typeof n.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=Ke.deserialize(n.precondition),t=(r,...o)=>kl.runEditorCommand(r,o,e,(s,a,l)=>Promise.resolve(n.run(a,...l))),i=new nt;if(i.add(Xi.registerCommand(n.id,t)),n.contextMenuGroupId){const r={command:{id:n.id,title:n.label},when:e,group:n.contextMenuGroupId,order:n.contextMenuOrder||0};i.add(jl.appendMenuItem(J.EditorContext,r))}if(Array.isArray(n.keybindings)){const r=$n.get(mo);if(!(r instanceof m2))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=Ke.and(e,Ke.deserialize(n.keybindingContext));i.add(r.addDynamicKeybindings(n.keybindings.map(s=>({keybinding:s,command:n.id,when:o}))))}}return i}function lJi(n){return aYe([n])}function aYe(n){const e=$n.get(mo);return e instanceof m2?e.addDynamicKeybindings(n.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:Ke.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Ae.None)}function cJi(n,e,t){const i=$n.get(Qo),r=i.getLanguageIdByMimeType(e)||e;return oYe($n.get(ts),i,n,r,t)}function uJi(n,e){const t=$n.get(Qo),i=t.getLanguageIdByMimeType(e)||e||nf;n.setLanguage(t.createById(i))}function dJi(n,e,t){n&&$n.get(Lb).changeOne(e,n.uri,t)}function hJi(n){$n.get(Lb).changeAll(n,[])}function fJi(n){return $n.get(Lb).read(n)}function gJi(n){return $n.get(Lb).onMarkerChanged(n)}function pJi(n){return $n.get(ts).getModel(n)}function mJi(){return $n.get(ts).getModels()}function _Ji(n){return $n.get(ts).onModelAdded(n)}function vJi(n){return $n.get(ts).onModelRemoved(n)}function bJi(n){return $n.get(ts).onModelLanguageChanged(t=>{n({model:t.model,oldLanguage:t.oldLanguageId})})}function yJi(n){return T9i($n.get(ts),$n.get(xo),n)}function CJi(n,e){const t=$n.get(Qo),i=$n.get(Ef);return e_e.colorizeElement(i,t,n,e).then(()=>{i.registerEditorContainer(n)})}function wJi(n,e,t){const i=$n.get(Qo);return $n.get(Ef).registerEditorContainer(document.body),e_e.colorize(i,n,e,t)}function SJi(n,e,t=4){return $n.get(Ef).registerEditorContainer(document.body),e_e.colorizeModelLine(n,e,t)}function EJi(n){const e=ps.get(n);return e||{getInitialState:()=>JD,tokenize:(t,i,r)=>Xme(n,r)}}function xJi(n,e){ps.getOrCreate(e);const t=EJi(e),i=ab(n),r=[];let o=t.getInitialState();for(let s=0,a=i.length;s<a;s++){const l=i[s],c=t.tokenize(l,!0,o);r[s]=c.tokens,o=c.endState}return r}function kJi(n,e){$n.get(Ef).defineTheme(n,e)}function TJi(n){$n.get(Ef).setTheme(n)}function IJi(){Uoe.clearAllFontInfos()}function LJi(n,e){return Xi.registerCommand({id:n,handler:e})}function DJi(n){return $n.get(mh).registerOpener({open(t){return sYe(this,void 0,void 0,function*(){return typeof t=="string"&&(t=Tn.parse(t)),n.open(t)})}})}function AJi(n){return $n.get(Lr).registerCodeEditorOpenHandler((t,i,r)=>sYe(this,void 0,void 0,function*(){var o;if(!i)return null;const s=(o=t.options)===null||o===void 0?void 0:o.selection;let a;return s&&typeof s.endLineNumber=="number"&&typeof s.endColumn=="number"?a=s:s&&(a={lineNumber:s.startLineNumber,column:s.startColumn}),(yield n.openCodeEditor(i,t.resource,a))?i:null}))}function RJi(){return{create:eJi,getEditors:iJi,getDiffEditors:rJi,onDidCreateEditor:tJi,onDidCreateDiffEditor:nJi,createDiffEditor:oJi,addCommand:sJi,addEditorAction:aJi,addKeybindingRule:lJi,addKeybindingRules:aYe,createModel:cJi,setModelLanguage:uJi,setModelMarkers:dJi,getModelMarkers:fJi,removeAllMarkers:hJi,onDidChangeMarkers:gJi,getModels:mJi,getModel:pJi,onDidCreateModel:_Ji,onWillDisposeModel:vJi,onDidChangeModelLanguage:bJi,createWebWorker:yJi,colorizeElement:CJi,colorize:wJi,colorizeModelLine:SJi,tokenize:xJi,defineTheme:kJi,setTheme:TJi,remeasureFonts:IJi,registerCommand:LJi,registerLinkOpener:DJi,registerEditorOpener:AJi,AccessibilitySupport:ioe,ContentWidgetPositionPreference:coe,CursorChangeReason:uoe,DefaultEndOfLine:doe,EditorAutoIndentStrategy:foe,EditorOption:goe,EndOfLinePreference:poe,EndOfLineSequence:moe,MinimapPosition:xoe,MouseTargetType:koe,OverlayWidgetPositionPreference:Toe,OverviewRulerLane:Ioe,GlyphMarginLane:_oe,RenderLineNumbersType:Doe,RenderMinimap:Aoe,ScrollbarVisibility:Noe,ScrollType:Roe,TextEditorCursorBlinkingStyle:Boe,TextEditorCursorStyle:$oe,TrackedRangeStickiness:Voe,WrappingIndent:Hoe,InjectedTextCursorStops:boe,PositionAffinity:Loe,ConfigurationChangedEvent:Rje,BareFontInfo:QE,FontInfo:joe,TextModelResolvedOptions:R8,FindMatch:LM,ApplyUpdateResult:AO,EditorZoom:Yf,EditorType:_5,EditorOptions:A_}}function NJi(n,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!n(t))return!1;return!0}function r$(n,e){return typeof n=="boolean"?n:e}function mRe(n,e){return typeof n=="string"?n:e}function OJi(n){const e={};for(const t of n)e[t]=!0;return e}function _Re(n,e=!1){e&&(n=n.map(function(i){return i.toLowerCase()}));const t=OJi(n);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function hle(n,e){e=e.replace(/@@/g,"");let t=0,i;do i=!1,e=e.replace(/@(\w+)/g,function(o,s){i=!0;let a="";if(typeof n[s]=="string")a=n[s];else if(n[s]&&n[s]instanceof RegExp)a=n[s].source;else throw n[s]===void 0?$o(n,"language definition does not contain attribute '"+s+"', used at: "+e):$o(n,"attribute reference '"+s+"' must be a string, used at: "+e);return nI(a)?"":"(?:"+a+")"}),t++;while(i&&t<5);e=e.replace(/\x01/g,"@");const r=(n.ignoreCase?"i":"")+(n.unicode?"u":"");return new RegExp(e,r)}function PJi(n,e,t,i){if(i<0)return n;if(i<e.length)return e[i];if(i>=100){i=i-100;const r=t.split(".");if(r.unshift(t),i<r.length)return r[i]}return null}function MJi(n,e,t,i){let r=-1,o=t,s=t.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);s&&(s[3]&&(r=parseInt(s[3]),s[2]&&(r=r+100)),o=s[4]);let a="~",l=o;!o||o.length===0?(a="!=",l=""):/^\w*$/.test(l)?a="==":(s=o.match(/^(@|!@|~|!~|==|!=)(.*)$/),s&&(a=s[1],l=s[2]));let c;if((a==="~"||a==="!~")&&/^(\w|\|)*$/.test(l)){const u=_Re(l.split("|"),n.ignoreCase);c=function(d){return a==="~"?u(d):!u(d)}}else if(a==="@"||a==="!@"){const u=n[l];if(!u)throw $o(n,"the @ match target '"+l+"' is not defined, in rule: "+e);if(!NJi(function(h){return typeof h=="string"},u))throw $o(n,"the @ match target '"+l+"' must be an array of strings, in rule: "+e);const d=_Re(u,n.ignoreCase);c=function(h){return a==="@"?d(h):!d(h)}}else if(a==="~"||a==="!~")if(l.indexOf("$")<0){const u=hle(n,"^"+l+"$");c=function(d){return a==="~"?u.test(d):!u.test(d)}}else c=function(u,d,h,g){return hle(n,"^"+R1(n,l,d,h,g)+"$").test(u)};else if(l.indexOf("$")<0){const u=RC(n,l);c=function(d){return a==="=="?d===u:d!==u}}else{const u=RC(n,l);c=function(d,h,g,p,m){const _=R1(n,u,h,g,p);return a==="=="?d===_:d!==_}}return r===-1?{name:t,value:i,test:function(u,d,h,g){return c(u,u,d,h,g)}}:{name:t,value:i,test:function(u,d,h,g){const p=PJi(u,d,h,r);return c(p||"",u,d,h,g)}}}function fle(n,e,t){if(t){if(typeof t=="string")return t;if(t.token||t.token===""){if(typeof t.token!="string")throw $o(n,"a 'token' attribute must be of type string, in rule: "+e);{const i={token:t.token};if(t.token.indexOf("$")>=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=1;else if(t.bracket==="@close")i.bracket=-1;else throw $o(n,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw $o(n,"the next state must be a string value in rule: "+e);{let r=t.next;if(!/^(@pop|@push|@popall)$/.test(r)&&(r[0]==="@"&&(r=r.substr(1)),r.indexOf("$")<0&&!q9i(n,R1(n,r,"",[],""))))throw $o(n,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=r}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,n.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let r=0,o=t.length;r<o;r++)i[r]=fle(n,e,t[r]);return{group:i}}else if(t.cases){const i=[];for(const o in t.cases)if(t.cases.hasOwnProperty(o)){const s=fle(n,e,t.cases[o]);o==="@default"||o==="@"||o===""?i.push({test:void 0,value:s,name:o}):o==="@eos"?i.push({test:function(a,l,c,u){return u},value:s,name:o}):i.push(MJi(n,e,o,s))}const r=n.defaultToken;return{test:function(o,s,a,l){for(const c of i)if(!c.test||c.test(o,s,a,l))return c.value;return r}}}else throw $o(n,"an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: "+e)}else return{token:""}}class FJi{constructor(e){this.regex=new RegExp(""),this.action={token:""},this.matchOnlyAtLineStart=!1,this.name="",this.name=e}setRegex(e,t){let i;if(typeof t=="string")i=t;else if(t instanceof RegExp)i=t.source;else throw $o(e,"rules must start with a match string or regular expression: "+this.name);this.matchOnlyAtLineStart=i.length>0&&i[0]==="^",this.name=this.name+": "+i,this.regex=hle(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=fle(e,this.name,t)}}function lYe(n,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=n,t.includeLF=r$(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=r$(e.ignoreCase,!1),t.unicode=r$(e.unicode,!1),t.tokenPostfix=mRe(e.tokenPostfix,"."+t.languageId),t.defaultToken=mRe(e.defaultToken,"source"),t.usesEmbedded=!1;const i=e;i.languageId=n,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function r(s,a,l){for(const c of l){let u=c.include;if(u){if(typeof u!="string")throw $o(t,"an 'include' attribute must be a string at: "+s);if(u[0]==="@"&&(u=u.substr(1)),!e.tokenizer[u])throw $o(t,"include target '"+u+"' is not defined at: "+s);r(s+"."+u,a,e.tokenizer[u])}else{const d=new FJi(s);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(d.setRegex(i,c[0]),c.length>=3)if(typeof c[1]=="string")d.setAction(i,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const h=c[1];h.next=c[2],d.setAction(i,h)}else throw $o(t,"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: "+s);else d.setAction(i,c[1]);else{if(!c.regex)throw $o(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+s);c.name&&typeof c.name=="string"&&(d.name=c.name),c.matchOnlyAtStart&&(d.matchOnlyAtLineStart=r$(c.matchOnlyAtLineStart,!1)),d.setRegex(i,c.regex),d.setAction(i,c.action)}a.push(d)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw $o(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const s in e.tokenizer)if(e.tokenizer.hasOwnProperty(s)){t.start||(t.start=s);const a=e.tokenizer[s];t.tokenizer[s]=new Array,r("tokenizer."+s,t.tokenizer[s],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw $o(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const s of e.brackets){let a=s;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw $o(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+`
hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:RC(t,a.open),close:RC(t,a.close)});else throw $o(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}var BJi=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function $Ji(n){XD.registerLanguage(n)}function VJi(){let n=[];return n=n.concat(XD.getLanguages()),n}function HJi(n){return $n.get(Qo).languageIdCodec.encodeLanguageId(n)}function WJi(n,e){return $n.withServices(()=>{const i=$n.get(Qo).onDidRequestRichLanguageFeatures(r=>{r===n&&(i.dispose(),e())});return i})}function zJi(n,e){return $n.withServices(()=>{const i=$n.get(Qo).onDidRequestBasicLanguageFeatures(r=>{r===n&&(i.dispose(),e())});return i})}function jJi(n,e){if(!$n.get(Qo).isRegisteredLanguageId(n))throw new Error(`Cannot set configuration for unknown language ${n}`);return $n.get(xo).register(n,e,100)}class UJi{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return y4.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const r=this._actual.tokenizeEncoded(e,i);return new DU(r.tokens,r.endState)}}class y4{constructor(e,t,i,r){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=r}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let r=0;for(let o=0,s=e.length;o<s;o++){const a=e[o];let l=a.startIndex;o===0?l=0:l<r&&(l=r),i[o]=new bM(l,a.scopes,t),r=l}return i}static adaptTokenize(e,t,i,r){const o=t.tokenize(i,r),s=y4._toClassicTokens(o.tokens,e);let a;return o.endState.equals(r)?a=r:a=o.endState,new Tme(s,a)}tokenize(e,t,i){return y4.adaptTokenize(this._languageId,this._actual,e,i)}_toBinaryTokens(e,t){const i=e.encodeLanguageId(this._languageId),r=this._standaloneThemeService.getColorTheme().tokenTheme,o=[];let s=0,a=0;for(let c=0,u=t.length;c<u;c++){const d=t[c],h=r.match(i,d.scopes)|1024;if(s>0&&o[s-1]===h)continue;let g=d.startIndex;c===0?g=0:g<a&&(g=a),o[s++]=g,o[s++]=h,a=g}const l=new Uint32Array(s);for(let c=0;c<s;c++)l[c]=o[c];return l}tokenizeEncoded(e,t,i){const r=this._actual.tokenize(e,i),o=this._toBinaryTokens(this._languageService.languageIdCodec,r.tokens);let s;return r.endState.equals(i)?s=i:s=r.endState,new DU(o,s)}}function qJi(n){return typeof n.getInitialState=="function"}function KJi(n){return"tokenizeEncoded"in n}function cYe(n){return n&&typeof n.then=="function"}function GJi(n){const e=$n.get(Ef);if(n){const t=[null];for(let i=1,r=n.length;i<r;i++)t[i]=De.fromHex(n[i]);e.setColorMapOverride(t)}else e.setColorMapOverride(null)}function uYe(n,e){return KJi(e)?new UJi(n,e):new y4(n,e,$n.get(Qo),$n.get(Ef))}function Dve(n,e){const t=new S6i(()=>BJi(this,void 0,void 0,function*(){const i=yield Promise.resolve(e.create());return i?qJi(i)?uYe(n,i):new MM($n.get(Qo),$n.get(Ef),n,lYe(n,i),$n.get(Ui)):null}));return ps.registerFactory(n,t)}function YJi(n,e){if(!$n.get(Qo).isRegisteredLanguageId(n))throw new Error(`Cannot set tokens provider for unknown language ${n}`);return cYe(e)?Dve(n,{create:()=>e}):ps.register(n,uYe(n,e))}function QJi(n,e){const t=i=>new MM($n.get(Qo),$n.get(Ef),n,lYe(n,i),$n.get(Ui));return cYe(e)?Dve(n,{create:()=>e}):ps.register(n,t(e))}function XJi(n,e){return $n.get(en).referenceProvider.register(n,e)}function ZJi(n,e){return $n.get(en).renameProvider.register(n,e)}function JJi(n,e){return $n.get(en).signatureHelpProvider.register(n,e)}function eer(n,e){return $n.get(en).hoverProvider.register(n,{provideHover:(i,r,o)=>{const s=i.getWordAtPosition(r);return Promise.resolve(e.provideHover(i,r,o)).then(a=>{if(a)return!a.range&&s&&(a.range=new q(r.lineNumber,s.startColumn,r.lineNumber,s.endColumn)),a.range||(a.range=new q(r.lineNumber,r.column,r.lineNumber,r.column)),a})}})}function ter(n,e){return $n.get(en).documentSymbolProvider.register(n,e)}function ner(n,e){return $n.get(en).documentHighlightProvider.register(n,e)}function ier(n,e){return $n.get(en).linkedEditingRangeProvider.register(n,e)}function rer(n,e){return $n.get(en).definitionProvider.register(n,e)}function oer(n,e){return $n.get(en).implementationProvider.register(n,e)}function ser(n,e){return $n.get(en).typeDefinitionProvider.register(n,e)}function aer(n,e){return $n.get(en).codeLensProvider.register(n,e)}function ler(n,e,t){return $n.get(en).codeActionProvider.register(n,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(r,o,s,a)=>{const c=$n.get(Lb).read({resource:r.uri}).filter(u=>q.areIntersectingOrTouching(u,o));return e.provideCodeActions(r,o,{markers:c,only:s.only,trigger:s.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function cer(n,e){return $n.get(en).documentFormattingEditProvider.register(n,e)}function uer(n,e){return $n.get(en).documentRangeFormattingEditProvider.register(n,e)}function der(n,e){return $n.get(en).onTypeFormattingEditProvider.register(n,e)}function her(n,e){return $n.get(en).linkProvider.register(n,e)}function fer(n,e){return $n.get(en).completionProvider.register(n,e)}function ger(n,e){return $n.get(en).colorProvider.register(n,e)}function per(n,e){return $n.get(en).foldingRangeProvider.register(n,e)}function mer(n,e){return $n.get(en).declarationProvider.register(n,e)}function _er(n,e){return $n.get(en).selectionRangeProvider.register(n,e)}function ver(n,e){return $n.get(en).documentSemanticTokensProvider.register(n,e)}function ber(n,e){return $n.get(en).documentRangeSemanticTokensProvider.register(n,e)}function yer(n,e){return $n.get(en).inlineCompletionsProvider.register(n,e)}function Cer(n,e){return $n.get(en).inlayHintsProvider.register(n,e)}function wer(){return{register:$Ji,getLanguages:VJi,onLanguage:WJi,onLanguageEncountered:zJi,getEncodedLanguageId:HJi,setLanguageConfiguration:jJi,setColorMap:GJi,registerTokensProviderFactory:Dve,setTokensProvider:YJi,setMonarchTokensProvider:QJi,registerReferenceProvider:XJi,registerRenameProvider:ZJi,registerCompletionItemProvider:fer,registerSignatureHelpProvider:JJi,registerHoverProvider:eer,registerDocumentSymbolProvider:ter,registerDocumentHighlightProvider:ner,registerLinkedEditingRangeProvider:ier,registerDefinitionProvider:rer,registerImplementationProvider:oer,registerTypeDefinitionProvider:ser,registerCodeLensProvider:aer,registerCodeActionProvider:ler,registerDocumentFormattingEditProvider:cer,registerDocumentRangeFormattingEditProvider:uer,registerOnTypeFormattingEditProvider:der,registerLinkProvider:her,registerColorProvider:ger,registerFoldingRangeProvider:per,registerDeclarationProvider:mer,registerSelectionRangeProvider:_er,registerDocumentSemanticTokensProvider:ver,registerDocumentRangeSemanticTokensProvider:ber,registerInlineCompletionsProvider:yer,registerInlayHintsProvider:Cer,DocumentHighlightKind:hoe,CompletionItemKind:soe,CompletionItemTag:aoe,CompletionItemInsertTextRule:ooe,SymbolKind:Moe,SymbolTag:Foe,IndentAction:voe,CompletionTriggerKind:loe,SignatureHelpTriggerKind:Poe,InlayHintKind:yoe,InlineCompletionTriggerKind:Coe,CodeActionTriggerType:roe,FoldingRangeKind:Wu,SelectedSuggestionInfo:Gje}}const Ave=Vi("IEditorCancelService"),dYe=new Ft("cancellableOperation",!1,E("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));Zi(Ave,class{constructor(){this._tokens=new WeakMap}add(n,e){let t=this._tokens.get(n);t||(t=n.invokeWithinContext(r=>{const o=dYe.bindTo(r.get(Yn)),s=new Hu;return{key:o,tokens:s}}),this._tokens.set(n,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(n){const e=this._tokens.get(n);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class Ser extends da{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(Ave).add(e,this))}dispose(){this._unregister(),super.dispose()}}Et(new class extends kl{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:dYe})}runEditorCommand(n,e){n.get(Ave).cancel(e)}});let hYe=class gle{constructor(e,t){if(this.flags=t,this.flags&1){const i=e.getModel();this.modelVersionId=i?Dx("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof gle))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 gle(e,this.flags))}};class bw extends Ser{constructor(e,t,i,r){super(e,r),this._listener=new nt,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!q.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!q.containsRange(i,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class Rve extends da{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function mb(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===_5.ICodeEditor:!1}function fYe(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===_5.IDiffEditor:!1}function Eer(n){return!!n&&typeof n=="object"&&typeof n.onDidChangeActiveEditor=="function"}function gYe(n){return mb(n)?n:fYe(n)?n.getModifiedEditor():Eer(n)&&mb(n.activeCodeEditor)?n.activeCodeEditor:null}class _2{static _handleEolEdits(e,t){let i;const r=[];for(const o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&r.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),r}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),r=i.validateRange(t.range);return i.getFullModelRange().equalsRange(r)}static execute(e,t,i){i&&e.pushUndoStop();const r=k_.capture(e),o=_2._handleEolEdits(e,t);o.length===1&&_2._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(s=>es.replace(q.lift(s.range),s.text))):e.executeEdits("formatEditsCommand",o.map(s=>es.replaceMove(q.lift(s.range),s.text))),i&&e.pushUndoStop(),r.restoreRelativeVerticalPositionOfCursor(e)}}class vRe{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class xer{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(vRe.toKey(e))}has(e){return this._set.has(vRe.toKey(e))}}var T_=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function Nve(n){if(n=n.filter(r=>r.range),!n.length)return;let{range:e}=n[0];for(let r=1;r<n.length;r++)e=q.plusRange(e,n[r].range);const{startLineNumber:t,endLineNumber:i}=e;t===i?n.length===1?Pc(E("hint11","Made 1 formatting edit on line {0}",t)):Pc(E("hintn1","Made {0} formatting edits on line {1}",n.length,t)):n.length===1?Pc(E("hint1n","Made 1 formatting edit between lines {0} and {1}",t,i)):Pc(E("hintnn","Made {0} formatting edits between lines {1} and {2}",n.length,t,i))}function pYe(n,e,t){const i=[],r=new xer,o=n.ordered(t);for(const a of o)i.push(a),a.extensionId&&r.add(a.extensionId);const s=e.ordered(t);for(const a of s){if(a.extensionId){if(r.has(a.extensionId))continue;r.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,u){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,u)}})}return i}class Ux{static setFormatterSelector(e){return{dispose:Ux._selectors.unshift(e)}}static select(e,t,i){return T_(this,void 0,void 0,function*(){if(e.length===0)return;const r=Pi.first(Ux._selectors);if(r)return yield r(e,t,i)})}}Ux._selectors=new Hu;function mYe(n,e,t,i,r,o){return T_(this,void 0,void 0,function*(){const s=n.get(Un),{documentRangeFormattingEditProvider:a}=n.get(en),l=mb(e)?e.getModel():e,c=a.ordered(l),u=yield Ux.select(c,l,i);u&&(r.report(u),yield s.invokeFunction(ker,u,e,t,o))})}function ker(n,e,t,i,r){var o,s;return T_(this,void 0,void 0,function*(){const a=n.get(lm),l=n.get(Sf);let c,u;mb(t)?(c=t.getModel(),u=new bw(t,5,void 0,r)):(c=t,u=new Rve(t,r));const d=[];let h=0;for(const v of pme(i).sort(q.compareRangesUsingStarts))h>0&&q.areIntersectingOrTouching(d[h-1],v)?d[h-1]=q.fromPositions(d[h-1].getStartPosition(),v.getEndPosition()):h=d.push(v);const g=v=>T_(this,void 0,void 0,function*(){var b,y;l.trace("[format][provideDocumentRangeFormattingEdits] (request)",(b=e.extensionId)===null||b===void 0?void 0:b.value,v);const C=(yield e.provideDocumentRangeFormattingEdits(c,v,c.getFormattingOptions(),u.token))||[];return l.trace("[format][provideDocumentRangeFormattingEdits] (response)",(y=e.extensionId)===null||y===void 0?void 0:y.value,C),C}),p=(v,b)=>{if(!v.length||!b.length)return!1;const y=v.reduce((C,x)=>q.plusRange(C,x.range),v[0].range);if(!b.some(C=>q.intersectRanges(y,C.range)))return!1;for(const C of v)for(const x of b)if(q.intersectRanges(C.range,x.range))return!0;return!1},m=[],_=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){l.trace("[format][provideDocumentRangeFormattingEdits] (request)",(o=e.extensionId)===null||o===void 0?void 0:o.value,d);const v=(yield e.provideDocumentRangesFormattingEdits(c,d,c.getFormattingOptions(),u.token))||[];l.trace("[format][provideDocumentRangeFormattingEdits] (response)",(s=e.extensionId)===null||s===void 0?void 0:s.value,v),_.push(v)}else{for(const v of d){if(u.token.isCancellationRequested)return!0;_.push(yield g(v))}for(let v=0;v<d.length;++v)for(let b=v+1;b<d.length;++b){if(u.token.isCancellationRequested)return!0;if(p(_[v],_[b])){const y=q.plusRange(d[v],d[b]),C=yield g(y);d.splice(b,1),d.splice(v,1),d.push(y),_.splice(b,1),_.splice(v,1),_.push(C),v=0,b=0}}}for(const v of _){if(u.token.isCancellationRequested)return!0;const b=yield a.computeMoreMinimalEdits(c.uri,v);b&&m.push(...b)}}finally{u.dispose()}if(m.length===0)return!1;if(mb(t))_2.execute(t,m,!0),Nve(m),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:v}]=m,b=new ln(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn);c.pushEditOperations([b],m.map(y=>({text:y.text,range:q.lift(y.range),forceMoveMarkers:!0})),y=>{for(const{range:C}of y)if(q.areIntersectingOrTouching(C,b))return[new ln(C.startLineNumber,C.startColumn,C.endLineNumber,C.endColumn)];return null})}return!0})}function Ter(n,e,t,i,r){return T_(this,void 0,void 0,function*(){const o=n.get(Un),s=n.get(en),a=mb(e)?e.getModel():e,l=pYe(s.documentFormattingEditProvider,s.documentRangeFormattingEditProvider,a),c=yield Ux.select(l,a,t);c&&(i.report(c),yield o.invokeFunction(Ier,c,e,t,r))})}function Ier(n,e,t,i,r){return T_(this,void 0,void 0,function*(){const o=n.get(lm);let s,a;mb(t)?(s=t.getModel(),a=new bw(t,5,void 0,r)):(s=t,a=new Rve(t,r));let l;try{const c=yield e.provideDocumentFormattingEdits(s,s.getFormattingOptions(),a.token);if(l=yield o.computeMoreMinimalEdits(s.uri,c),a.token.isCancellationRequested)return!0}finally{a.dispose()}if(!l||l.length===0)return!1;if(mb(t))_2.execute(t,l,i!==2),i!==2&&(Nve(l),t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1));else{const[{range:c}]=l,u=new ln(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn);s.pushEditOperations([u],l.map(d=>({text:d.text,range:q.lift(d.range),forceMoveMarkers:!0})),d=>{for(const{range:h}of d)if(q.areIntersectingOrTouching(h,u))return[new ln(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn)];return null})}return!0})}function Ler(n,e,t,i,r,o){return T_(this,void 0,void 0,function*(){const s=e.documentRangeFormattingEditProvider.ordered(t);for(const a of s){const l=yield Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,r,o)).catch(Sa);if(Fc(l))return yield n.computeMoreMinimalEdits(t.uri,l)}})}function Der(n,e,t,i,r){return T_(this,void 0,void 0,function*(){const o=pYe(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const s of o){const a=yield Promise.resolve(s.provideDocumentFormattingEdits(t,i,r)).catch(Sa);if(Fc(a))return yield n.computeMoreMinimalEdits(t.uri,a)}})}function _Ye(n,e,t,i,r,o,s){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(r)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,r,o,s)).catch(Sa).then(l=>n.computeMoreMinimalEdits(t.uri,l))}Xi.registerCommand("_executeFormatRangeProvider",function(n,...e){return T_(this,void 0,void 0,function*(){const[t,i,r]=e;to(Tn.isUri(t)),to(q.isIRange(i));const o=n.get(Pd),s=n.get(lm),a=n.get(en),l=yield o.createModelReference(t);try{return Ler(s,a,l.object.textEditorModel,q.lift(i),r,Mi.None)}finally{l.dispose()}})});Xi.registerCommand("_executeFormatDocumentProvider",function(n,...e){return T_(this,void 0,void 0,function*(){const[t,i]=e;to(Tn.isUri(t));const r=n.get(Pd),o=n.get(lm),s=n.get(en),a=yield r.createModelReference(t);try{return Der(o,s,a.object.textEditorModel,i,Mi.None)}finally{a.dispose()}})});Xi.registerCommand("_executeFormatOnTypeProvider",function(n,...e){return T_(this,void 0,void 0,function*(){const[t,i,r,o]=e;to(Tn.isUri(t)),to(Ce.isIPosition(i)),to(typeof r=="string");const s=n.get(Pd),a=n.get(lm),l=n.get(en),c=yield s.createModelReference(t);try{return _Ye(a,l,c.object.textEditorModel,Ce.lift(i),r,o,Mi.None)}finally{c.dispose()}})});A_.wrappingIndent.defaultValue=0;A_.glyphMargin.defaultValue=!1;A_.autoIndent.defaultValue=3;A_.overviewRulerLanes.defaultValue=2;Ux.setFormatterSelector((n,e,t)=>Promise.resolve(n[0]));const ed=Yje();ed.editor=RJi();ed.languages=wer();const vYe=ed.CancellationTokenSource,bYe=ed.Emitter,yYe=ed.KeyCode,CYe=ed.KeyMod,wYe=ed.Position,SYe=ed.Range,EYe=ed.Selection,xYe=ed.SelectionDirection,kYe=ed.MarkerSeverity,TYe=ed.MarkerTag,IYe=ed.Uri,LYe=ed.Token,DYe=ed.editor,AYe=ed.languages,fJ=globalThis.MonacoEnvironment;(fJ!=null&&fJ.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=ed);typeof globalThis.require<"u"&&typeof globalThis.require.config=="function"&&globalThis.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"]});const $5=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:vYe,Emitter:bYe,KeyCode:yYe,KeyMod:CYe,MarkerSeverity:kYe,MarkerTag:TYe,Position:wYe,Range:SYe,Selection:EYe,SelectionDirection:xYe,Token:LYe,Uri:IYe,editor:DYe,languages:AYe},Symbol.toStringTag,{value:"Module"}));/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var Aer=Object.defineProperty,Rer=Object.getOwnPropertyDescriptor,Ner=Object.getOwnPropertyNames,Oer=Object.prototype.hasOwnProperty,bRe=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ner(e))!Oer.call(n,r)&&r!==t&&Aer(n,r,{get:()=>e[r],enumerable:!(i=Rer(e,r))||i.enumerable});return n},Per=(n,e,t)=>(bRe(n,e,"default"),t&&bRe(t,e,"default")),VN={};Per(VN,$5);var RYe={},gJ={},NYe=class{constructor(n){xs(this,"_languageId");xs(this,"_loadingTriggered");xs(this,"_lazyLoadPromise");xs(this,"_lazyLoadPromiseResolve");xs(this,"_lazyLoadPromiseReject");this._languageId=n,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((e,t)=>{this._lazyLoadPromiseResolve=e,this._lazyLoadPromiseReject=t})}static getOrCreate(n){return gJ[n]||(gJ[n]=new NYe(n)),gJ[n]}load(){return this._loadingTriggered||(this._loadingTriggered=!0,RYe[this._languageId].loader().then(n=>this._lazyLoadPromiseResolve(n),n=>this._lazyLoadPromiseReject(n))),this._lazyLoadPromise}};function yn(n){const e=n.id;RYe[e]=n,VN.languages.register(n);const t=NYe.getOrCreate(e);VN.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),VN.languages.onLanguageEncountered(e,async()=>{const i=await t.load();VN.languages.setLanguageConfiguration(e,i.conf)})}yn({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>X(()=>import("./bundle309.js"),[])});yn({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>X(()=>import("./bundle310.js"),[])});yn({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>X(()=>import("./bundle311.js"),[])});yn({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>X(()=>import("./bundle312.js"),[])});yn({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>X(()=>import("./bundle313.js"),[])});yn({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>X(()=>import("./bundle314.js"),[])});yn({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>X(()=>import("./bundle315.js"),[])});yn({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>X(()=>import("./bundle316.js"),[])});yn({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>X(()=>import("./bundle317.js"),[])});yn({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>X(()=>import("./bundle317.js"),[])});yn({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>X(()=>import("./bundle318.js"),[])});yn({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>X(()=>import("./bundle319.js"),[])});yn({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>X(()=>import("./bundle320.js"),[])});yn({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>X(()=>import("./bundle321.js"),[])});yn({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>X(()=>import("./bundle322.js"),[])});yn({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>X(()=>import("./bundle323.js"),[])});yn({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>X(()=>import("./bundle324.js"),[])});yn({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>X(()=>import("./bundle325.js"),[])});yn({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>X(()=>import("./bundle326.js"),[])});yn({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>X(()=>import("./bundle327.js"),[])});yn({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>X(()=>import("./bundle328.js"),[]).then(n=>n.TagAutoInterpolationDollar)});yn({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>X(()=>import("./bundle328.js"),[]).then(n=>n.TagAngleInterpolationDollar)});yn({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>X(()=>import("./bundle328.js"),[]).then(n=>n.TagBracketInterpolationDollar)});yn({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>X(()=>import("./bundle328.js"),[]).then(n=>n.TagAngleInterpolationBracket)});yn({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>X(()=>import("./bundle328.js"),[]).then(n=>n.TagBracketInterpolationBracket)});yn({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>X(()=>import("./bundle328.js"),[]).then(n=>n.TagAutoInterpolationDollar)});yn({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>X(()=>import("./bundle328.js"),[]).then(n=>n.TagAutoInterpolationBracket)});yn({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>X(()=>import("./bundle329.js"),[])});yn({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>X(()=>import("./bundle330.js"),[])});yn({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>X(()=>import("./bundle331.js"),[])});yn({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>X(()=>import("./bundle332.js"),[])});yn({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:()=>X(()=>import("./bundle333.js"),[])});yn({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>X(()=>import("./bundle334.js"),[])});yn({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>X(()=>import("./bundle335.js"),[])});yn({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>X(()=>import("./bundle336.js"),["bundle336.js","bundle384.js"])});yn({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>X(()=>import("./bundle337.js"),[])});yn({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>X(()=>import("./bundle338.js"),[])});yn({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>X(()=>import("./bundle339.js"),[])});yn({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>X(()=>import("./bundle340.js"),[])});yn({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>X(()=>import("./bundle341.js"),[])});yn({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>X(()=>import("./bundle342.js"),[])});yn({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>X(()=>import("./bundle343.js"),[])});yn({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>X(()=>import("./bundle344.js"),[])});yn({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>X(()=>import("./bundle345.js"),[])});yn({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>X(()=>import("./bundle346.js"),[])});yn({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>X(()=>import("./bundle347.js"),[])});yn({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>X(()=>import("./bundle348.js"),[])});yn({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>X(()=>import("./bundle349.js"),[])});yn({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>X(()=>import("./bundle350.js"),[])});yn({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>X(()=>import("./bundle351.js"),[])});yn({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>X(()=>import("./bundle352.js"),[])});yn({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>X(()=>import("./bundle353.js"),[])});yn({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>X(()=>import("./bundle354.js"),[])});yn({id:"pla",extensions:[".pla"],loader:()=>X(()=>import("./bundle355.js"),[])});yn({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>X(()=>import("./bundle356.js"),[])});yn({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>X(()=>import("./bundle357.js"),[])});yn({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>X(()=>import("./bundle358.js"),[])});yn({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>X(()=>import("./bundle359.js"),[])});yn({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>X(()=>import("./bundle360.js"),[])});yn({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>X(()=>import("./bundle361.js"),[])});yn({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>X(()=>import("./bundle362.js"),[])});yn({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>X(()=>import("./bundle363.js"),[])});yn({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>X(()=>import("./bundle364.js"),[])});yn({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>X(()=>import("./bundle365.js"),[])});yn({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>X(()=>import("./bundle366.js"),[])});yn({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>X(()=>import("./bundle367.js"),[])});yn({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>X(()=>import("./bundle368.js"),[])});yn({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>X(()=>import("./bundle369.js"),[])});yn({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>X(()=>import("./bundle370.js"),[])});yn({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:()=>X(()=>import("./bundle371.js"),[])});yn({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>X(()=>import("./bundle372.js"),[])});yn({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>X(()=>import("./bundle373.js"),[])});yn({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>X(()=>import("./bundle374.js"),[])});yn({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>X(()=>import("./bundle375.js"),[])});yn({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>X(()=>import("./bundle376.js"),[])});yn({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>X(()=>import("./bundle377.js"),[])});yn({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>X(()=>import("./bundle378.js"),[])});yn({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>X(()=>import("./bundle379.js"),[])});yn({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>X(()=>import("./bundle380.js"),[])});yn({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>X(()=>import("./bundle381.js"),[])});yn({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>X(()=>import("./bundle381.js"),[])});yn({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>X(()=>import("./bundle382.js"),[])});yn({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>X(()=>import("./bundle383.js"),[])});yn({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>X(()=>import("./bundle384.js"),[])});yn({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>X(()=>import("./bundle385.js"),[])});yn({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>X(()=>import("./bundle386.js"),[])});yn({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",aliases:["XML","xml"],mimetypes:["text/xml","application/xml","application/xaml+xml","application/xml-dtd"],loader:()=>X(()=>import("./bundle387.js"),[])});yn({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>X(()=>import("./bundle388.js"),[])});/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var Mer=Object.defineProperty,Fer=Object.getOwnPropertyDescriptor,Ber=Object.getOwnPropertyNames,$er=Object.prototype.hasOwnProperty,yRe=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ber(e))!$er.call(n,r)&&r!==t&&Mer(n,r,{get:()=>e[r],enumerable:!(i=Fer(e,r))||i.enumerable});return n},Ver=(n,e,t)=>(yRe(n,e,"default"),t&&yRe(t,e,"default")),AA={};Ver(AA,$5);var Ove=class{constructor(e,t,i){xs(this,"_onDidChange",new AA.Emitter);xs(this,"_options");xs(this,"_modeConfiguration");xs(this,"_languageId");this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},Pve={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},Mve={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},OYe=new Ove("css",Pve,Mve),PYe=new Ove("scss",Pve,Mve),MYe=new Ove("less",Pve,Mve);AA.languages.css={cssDefaults:OYe,lessDefaults:MYe,scssDefaults:PYe};function Fve(){return X(()=>import("./bundle389.js"),[])}AA.languages.onLanguage("less",()=>{Fve().then(n=>n.setupMode(MYe))});AA.languages.onLanguage("scss",()=>{Fve().then(n=>n.setupMode(PYe))});AA.languages.onLanguage("css",()=>{Fve().then(n=>n.setupMode(OYe))});/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var Her=Object.defineProperty,Wer=Object.getOwnPropertyDescriptor,zer=Object.getOwnPropertyNames,jer=Object.prototype.hasOwnProperty,CRe=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of zer(e))!jer.call(n,r)&&r!==t&&Her(n,r,{get:()=>e[r],enumerable:!(i=Wer(e,r))||i.enumerable});return n},Uer=(n,e,t)=>(CRe(n,e,"default"),t&&CRe(t,e,"default")),zq={};Uer(zq,$5);var qer=class{constructor(e,t,i){xs(this,"_onDidChange",new zq.Emitter);xs(this,"_options");xs(this,"_modeConfiguration");xs(this,"_languageId");this._languageId=e,this.setOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},Ker={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},jq={format:Ker,suggest:{},data:{useDefaultDataProvider:!0}};function Uq(n){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:n===ZO,documentFormattingEdits:n===ZO,documentRangeFormattingEdits:n===ZO}}var ZO="html",wRe="handlebars",SRe="razor",FYe=qq(ZO,jq,Uq(ZO)),Ger=FYe.defaults,BYe=qq(wRe,jq,Uq(wRe)),Yer=BYe.defaults,$Ye=qq(SRe,jq,Uq(SRe)),Qer=$Ye.defaults;zq.languages.html={htmlDefaults:Ger,razorDefaults:Qer,handlebarDefaults:Yer,htmlLanguageService:FYe,handlebarLanguageService:BYe,razorLanguageService:$Ye,registerHTMLLanguageService:qq};function Xer(){return X(()=>import("./bundle390.js"),[])}function qq(n,e=jq,t=Uq(n)){const i=new qer(n,e,t);let r;const o=zq.languages.onLanguage(n,async()=>{r=(await Xer()).setupMode(i)});return{defaults:i,dispose(){o.dispose(),r==null||r.dispose(),r=void 0}}}/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var Zer=Object.defineProperty,Jer=Object.getOwnPropertyDescriptor,etr=Object.getOwnPropertyNames,ttr=Object.prototype.hasOwnProperty,ERe=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of etr(e))!ttr.call(n,r)&&r!==t&&Zer(n,r,{get:()=>e[r],enumerable:!(i=Jer(e,r))||i.enumerable});return n},ntr=(n,e,t)=>(ERe(n,e,"default"),t&&ERe(t,e,"default")),V5={};ntr(V5,$5);var itr=class{constructor(e,t,i){xs(this,"_onDidChange",new V5.Emitter);xs(this,"_diagnosticsOptions");xs(this,"_modeConfiguration");xs(this,"_languageId");this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}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)}},rtr={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},otr={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},VYe=new itr("json",rtr,otr);V5.languages.json={jsonDefaults:VYe};function str(){return X(()=>import("./bundle391.js"),[])}V5.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});V5.languages.onLanguage("json",()=>{str().then(n=>n.setupMode(VYe))});/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/var atr=Object.defineProperty,ltr=Object.getOwnPropertyDescriptor,ctr=Object.getOwnPropertyNames,utr=Object.prototype.hasOwnProperty,xRe=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ctr(e))!utr.call(n,r)&&r!==t&&atr(n,r,{get:()=>e[r],enumerable:!(i=ltr(e,r))||i.enumerable});return n},dtr=(n,e,t)=>(xRe(n,e,"default"),t&&xRe(t,e,"default")),htr="5.0.2",v2={};dtr(v2,$5);var HYe=(n=>(n[n.None=0]="None",n[n.CommonJS=1]="CommonJS",n[n.AMD=2]="AMD",n[n.UMD=3]="UMD",n[n.System=4]="System",n[n.ES2015=5]="ES2015",n[n.ESNext=99]="ESNext",n))(HYe||{}),WYe=(n=>(n[n.None=0]="None",n[n.Preserve=1]="Preserve",n[n.React=2]="React",n[n.ReactNative=3]="ReactNative",n[n.ReactJSX=4]="ReactJSX",n[n.ReactJSXDev=5]="ReactJSXDev",n))(WYe||{}),zYe=(n=>(n[n.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",n[n.LineFeed=1]="LineFeed",n))(zYe||{}),jYe=(n=>(n[n.ES3=0]="ES3",n[n.ES5=1]="ES5",n[n.ES2015=2]="ES2015",n[n.ES2016=3]="ES2016",n[n.ES2017=4]="ES2017",n[n.ES2018=5]="ES2018",n[n.ES2019=6]="ES2019",n[n.ES2020=7]="ES2020",n[n.ESNext=99]="ESNext",n[n.JSON=100]="JSON",n[n.Latest=99]="Latest",n))(jYe||{}),UYe=(n=>(n[n.Classic=1]="Classic",n[n.NodeJs=2]="NodeJs",n))(UYe||{}),qYe=class{constructor(n,e,t,i,r){xs(this,"_onDidChange",new v2.Emitter);xs(this,"_onDidExtraLibsChange",new v2.Emitter);xs(this,"_extraLibs");xs(this,"_removedExtraLibs");xs(this,"_eagerModelSync");xs(this,"_compilerOptions");xs(this,"_diagnosticsOptions");xs(this,"_workerOptions");xs(this,"_onDidExtraLibsChangeTimeout");xs(this,"_inlayHintsOptions");xs(this,"_modeConfiguration");this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(n),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(r),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(n,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===n)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:n,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let r=this._extraLibs[t];r&&r.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(n){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),n&&n.length>0)for(const e of n){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let r=1;this._removedExtraLibs[t]&&(r=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:r}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(n){this._compilerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(n){this._diagnosticsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(n){this._workerOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(n){this._inlayHintsOptions=n||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(n){}setEagerModelSync(n){this._eagerModelSync=n}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(void 0)}},ftr=htr,KYe={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},GYe=new qYe({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},KYe),YYe=new qYe({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},KYe),gtr=()=>Kq().then(n=>n.getTypeScriptWorker()),ptr=()=>Kq().then(n=>n.getJavaScriptWorker());v2.languages.typescript={ModuleKind:HYe,JsxEmit:WYe,NewLineKind:zYe,ScriptTarget:jYe,ModuleResolutionKind:UYe,typescriptVersion:ftr,typescriptDefaults:GYe,javascriptDefaults:YYe,getTypeScriptWorker:gtr,getJavaScriptWorker:ptr};function Kq(){return X(()=>import("./bundle392.js"),[])}v2.languages.onLanguage("typescript",()=>Kq().then(n=>n.setupTypeScript(GYe)));v2.languages.onLanguage("javascript",()=>Kq().then(n=>n.setupJavaScript(YYe)));class mtr extends Cf{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:E("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:Ct.map,toggled:Ke.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:Ke.has("isInDiffEditor"),menu:{when:Ke.has("isInDiffEditor"),id:J.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Ui),r=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",r)}}jo(mtr);class QYe extends Cf{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:E("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:Ke.has("isInDiffEditor")})}run(e,...t){const i=e.get(Ui),r=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",r)}}jo(QYe);class XYe extends Cf{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:E("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:Ke.has("isInDiffEditor")})}run(e,...t){const i=e.get(Ui),r=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",r)}}jo(XYe);jl.appendMenuItem(J.EditorTitle,{command:{id:new XYe().desc.id,title:E("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:Ke.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:Ke.has("isInDiffEditor")},order:11,group:"1_diff",when:Ke.and(ee.diffEditorRenderSideBySideInlineBreakpointReached,Ke.has("isInDiffEditor"))});jl.appendMenuItem(J.EditorTitle,{command:{id:new QYe().desc.id,title:E("showMoves","Show Moved Code Blocks"),icon:Ct.move,toggled:yA.create("config.diffEditor.experimental.showMoves",!0),precondition:Ke.has("isInDiffEditor")},order:10,group:"1_diff",when:Ke.has("isInDiffEditor")});const Gq={value:E("diffEditor","Diff Editor"),original:"Diff Editor"};class _tr extends N_{constructor(){super({id:"diffEditor.switchSide",title:{value:E("switchSide","Switch Side"),original:"Switch Side"},icon:Ct.arrowSwap,precondition:Ke.has("isInDiffEditor"),f1:!0,category:Gq})}runEditorCommand(e,t,i){const r=NA(e);if(r instanceof jx){if(i&&i.dryRun)return{destinationSelection:r.mapToOtherSide().destinationSelection};r.switchSide()}}}jo(_tr);class vtr extends N_{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:E("exitCompareMove","Exit Compare Move"),original:"Exit Compare Move"},icon:Ct.close,precondition:ee.comparingMovedCode,f1:!1,category:Gq,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const r=NA(e);r instanceof jx&&r.exitCompareMove()}}jo(vtr);class btr extends N_{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:E("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:Ct.fold,precondition:Ke.has("isInDiffEditor"),f1:!0,category:Gq})}runEditorCommand(e,t,...i){const r=NA(e);r instanceof jx&&r.collapseAllUnchangedRegions()}}jo(btr);class ytr extends N_{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:E("showAllUnchangedRegions","Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:Ct.unfold,precondition:Ke.has("isInDiffEditor"),f1:!0,category:Gq})}runEditorCommand(e,t,...i){const r=NA(e);r instanceof jx&&r.showAllUnchangedRegions()}}jo(ytr);const ZYe={value:E("accessibleDiffViewer","Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class RA extends Cf{constructor(){super({id:RA.id,title:{value:E("editor.action.accessibleDiffViewer.next","Go to Next Difference"),original:"Go to Next Difference"},category:ZYe,precondition:Ke.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=NA(e);t==null||t.accessibleDiffViewerNext()}}RA.id="editor.action.accessibleDiffViewer.next";jl.appendMenuItem(J.EditorTitle,{command:{id:RA.id,title:E("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:Ke.has("isInDiffEditor")},order:10,group:"2_diff",when:Ke.and(ee.accessibleDiffViewerVisible.negate(),Ke.has("isInDiffEditor"))});class H5 extends Cf{constructor(){super({id:H5.id,title:{value:E("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),original:"Go to Previous Difference"},category:ZYe,precondition:Ke.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=NA(e);t==null||t.accessibleDiffViewerPrev()}}H5.id="editor.action.accessibleDiffViewer.prev";function NA(n){var e;const t=n.get(Lr),i=t.listDiffEditors(),r=(e=t.getFocusedCodeEditor())!==null&&e!==void 0?e:t.getActiveCodeEditor();if(!r)return null;for(let s=0,a=i.length;s<a;s++){const l=i[s];if(l.getModifiedEditor().getId()===r.getId()||l.getOriginalEditor().getId()===r.getId())return l}const o=Lp();if(o)for(const s of i){const a=s.getContainerDomNode();if(Ctr(a,o))return s}return null}function Ctr(n,e){let t=e;for(;t;){if(t===n)return!0;t=t.parentElement}return!1}Xi.registerCommandAlias("editor.action.diffReview.next",RA.id);jo(RA);Xi.registerCommandAlias("editor.action.diffReview.prev",H5.id);jo(H5);var wtr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Str=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Yq=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},ple;const Qq=new Ft("selectionAnchorSet",!1);let C0=ple=class{static get(e){return e.getContribution(ple.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Qq.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(ln.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new hc().appendText(E("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Pc(E("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(ln.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};C0.ID="editor.contrib.selectionAnchorController";C0=ple=wtr([Str(1,Yn)],C0);class Etr extends Gt{constructor(){super({id:"editor.action.setSelectionAnchor",label:E("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2080),weight:100}})}run(e,t){var i;return Yq(this,void 0,void 0,function*(){(i=C0.get(t))===null||i===void 0||i.setSelectionAnchor()})}}class xtr extends Gt{constructor(){super({id:"editor.action.goToSelectionAnchor",label:E("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:Qq})}run(e,t){var i;return Yq(this,void 0,void 0,function*(){(i=C0.get(t))===null||i===void 0||i.goToSelectionAnchor()})}}class ktr extends Gt{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:E("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:Qq,kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2089),weight:100}})}run(e,t){var i;return Yq(this,void 0,void 0,function*(){(i=C0.get(t))===null||i===void 0||i.selectFromAnchorToCursor()})}}class Ttr extends Gt{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:E("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:Qq,kbOpts:{kbExpr:ee.editorTextFocus,primary:9,weight:100}})}run(e,t){var i;return Yq(this,void 0,void 0,function*(){(i=C0.get(t))===null||i===void 0||i.cancelSelectionAnchor()})}}gr(C0.ID,C0,4);ht(Etr);ht(xtr);ht(ktr);ht(Ttr);const Itr=re("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},E("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class Ltr extends Gt{constructor(){super({id:"editor.action.jumpToBracket",label:E("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:ee.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=Dp.get(t))===null||i===void 0||i.jumpToBracket()}}class Dtr extends Gt{constructor(){super({id:"editor.action.selectToBracket",label:E("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,i){var r;let o=!0;i&&i.selectBrackets===!1&&(o=!1),(r=Dp.get(t))===null||r===void 0||r.selectToBracket(o)}}class Atr extends Gt{constructor(){super({id:"editor.action.removeBrackets",label:E("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:ee.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=Dp.get(t))===null||i===void 0||i.removeBrackets(this.id)}}class Rtr{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class Dp extends Ae{static get(e){return e.getContribution(Dp.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new so(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(71),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(71)&&(this._matchBrackets=this._editor.getOption(71),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const r=i.getStartPosition(),o=e.bracketPairs.matchBracket(r);let s=null;if(o)o[0].containsPosition(r)&&!o[1].containsPosition(r)?s=o[1].getStartPosition():o[1].containsPosition(r)&&(s=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(r);if(a)s=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(r);l&&l.range&&(s=l.range.getStartPosition())}}return s?new ln(s.lineNumber,s.column,s.lineNumber,s.column):new ln(r.lineNumber,r.column,r.lineNumber,r.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(r=>{const o=r.getStartPosition();let s=t.bracketPairs.matchBracket(o);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(o),!s)){const c=t.bracketPairs.findNextBracket(o);c&&c.range&&(s=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(s){s.sort(q.compareRangesUsingStarts);const[c,u]=s;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?u.getEndPosition():u.getStartPosition(),u.containsPosition(o)){const d=a;a=l,l=d}}a&&l&&i.push(new ln(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const r=i.getPosition();let o=t.bracketPairs.matchBracket(r);o||(o=t.bracketPairs.findEnclosingBrackets(r)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const r=i.brackets;r&&(e[t++]={range:r[0],options:i.options},e[t++]={range:r[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let r=[];this._lastVersionId===i&&(r=this._lastBracketsData);const o=[];let s=0;for(let d=0,h=e.length;d<h;d++){const g=e[d];g.isEmpty()&&(o[s++]=g.getStartPosition())}o.length>1&&o.sort(Ce.compare);const a=[];let l=0,c=0;const u=r.length;for(let d=0,h=o.length;d<h;d++){const g=o[d];for(;c<u&&r[c].position.isBefore(g);)c++;if(c<u&&r[c].position.equals(g))a[l++]=r[c];else{let p=t.bracketPairs.matchBracket(g,20),m=Dp._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!p&&this._matchBrackets==="always"&&(p=t.bracketPairs.findEnclosingBrackets(g,20),m=Dp._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),a[l++]=new Rtr(g,p,m)}}this._lastBracketsData=a,this._lastVersionId=i}}Dp.ID="editor.contrib.bracketMatchingController";Dp._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=hi.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:ms(Itr),position:ff.Center}});Dp._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=hi.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});gr(Dp.ID,Dp,1);ht(Dtr);ht(Ltr);ht(Atr);jl.appendMenuItem(J.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:E({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class Ntr{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,r=this._selection.startColumn,o=this._selection.endColumn;if(!(this._isMovingLeft&&r===1)&&!(!this._isMovingLeft&&o===e.getLineMaxColumn(i)))if(this._isMovingLeft){const s=new q(i,r-1,i,r),a=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new q(i,o,i,o),a)}else{const s=new q(i,o,i,o+1),a=e.getValueInRange(s);t.addEditOperation(s,null),t.addEditOperation(new q(i,r,i,r),a)}}computeCursorState(e,t){return this._isMovingLeft?new ln(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new ln(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class JYe extends Gt{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],r=t.getSelections();for(const o of r)i.push(new Ntr(o,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class Otr extends JYe{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:E("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:ee.writable})}}class Ptr extends JYe{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:E("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:ee.writable})}}ht(Otr);ht(Ptr);class Mtr extends Gt{constructor(){super({id:"editor.action.transposeLetters",label:E("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:ee.writable,kbOpts:{kbExpr:ee.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),r=[],o=t.getSelections();for(const s of o){if(!s.isEmpty())continue;const a=s.startLineNumber,l=s.startColumn,c=i.getLineMaxColumn(a);if(a===1&&(l===1||l===2&&c===2))continue;const u=l===c?s.getPosition():Mr.rightPosition(i,s.getPosition().lineNumber,s.getPosition().column),d=Mr.leftPosition(i,u),h=Mr.leftPosition(i,d),g=i.getValueInRange(q.fromPositions(h,d)),p=i.getValueInRange(q.fromPositions(d,u)),m=q.fromPositions(h,u);r.push(new oc(m,p+g))}r.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}}ht(Mtr);var Ftr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const qx="9_cutcopypaste",Btr=h_||document.queryCommandSupported("cut"),eQe=h_||document.queryCommandSupported("copy"),$tr=typeof navigator.clipboard>"u"||wg?document.queryCommandSupported("paste"):!0;function Bve(n){return n.register(),n}const Vtr=Btr?Bve(new wA({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:h_?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:J.MenubarEditMenu,group:"2_ccp",title:E({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:J.EditorContext,group:qx,title:E("actions.clipboard.cutLabel","Cut"),when:ee.writable,order:1},{menuId:J.CommandPalette,group:"",title:E("actions.clipboard.cutLabel","Cut"),order:1},{menuId:J.SimpleEditorContext,group:qx,title:E("actions.clipboard.cutLabel","Cut"),when:ee.writable,order:1}]})):void 0,Htr=eQe?Bve(new wA({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:h_?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:J.MenubarEditMenu,group:"2_ccp",title:E({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:J.EditorContext,group:qx,title:E("actions.clipboard.copyLabel","Copy"),order:2},{menuId:J.CommandPalette,group:"",title:E("actions.clipboard.copyLabel","Copy"),order:1},{menuId:J.SimpleEditorContext,group:qx,title:E("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;jl.appendMenuItem(J.MenubarEditMenu,{submenu:J.MenubarCopy,title:{value:E("copy as","Copy As"),original:"Copy As"},group:"2_ccp",order:3});jl.appendMenuItem(J.EditorContext,{submenu:J.EditorContextCopy,title:{value:E("copy as","Copy As"),original:"Copy As"},group:qx,order:3});jl.appendMenuItem(J.EditorContext,{submenu:J.EditorContextShare,title:{value:E("share","Share"),original:"Share"},group:"11_share",order:-1,when:Ke.and(Ke.notEquals("resourceScheme","output"),ee.editorTextFocus)});jl.appendMenuItem(J.EditorTitleContext,{submenu:J.EditorTitleContextShare,title:{value:E("share","Share"),original:"Share"},group:"11_share",order:-1});jl.appendMenuItem(J.ExplorerContext,{submenu:J.ExplorerContextShare,title:{value:E("share","Share"),original:"Share"},group:"11_share",order:-1});const pJ=$tr?Bve(new wA({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:h_?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:J.MenubarEditMenu,group:"2_ccp",title:E({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:J.EditorContext,group:qx,title:E("actions.clipboard.pasteLabel","Paste"),when:ee.writable,order:4},{menuId:J.CommandPalette,group:"",title:E("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:J.SimpleEditorContext,group:qx,title:E("actions.clipboard.pasteLabel","Paste"),when:ee.writable,order:4}]})):void 0;class Wtr extends Gt{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:E("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:ee.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(yse.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),yse.forceCopyWithSyntaxHighlighting=!1)}}function tQe(n,e){n&&(n.addImplementation(1e4,"code-editor",(t,i)=>{const r=t.get(Lr).getFocusedCodeEditor();if(r&&r.hasTextFocus()){const o=r.getOption(37),s=r.getSelection();return s&&s.isEmpty()&&!o||r.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),n.addImplementation(0,"generic-dom",(t,i)=>(WU().execCommand(e),!0)))}tQe(Vtr,"cut");tQe(Htr,"copy");pJ&&(pJ.addImplementation(1e4,"code-editor",(n,e)=>{const t=n.get(Lr),i=n.get(F0),r=t.getFocusedCodeEditor();return r&&r.hasTextFocus()?!r.getContainerDomNode().ownerDocument.execCommand("paste")&&Qw?(()=>Ftr(void 0,void 0,void 0,function*(){const s=yield i.readText();if(s!==""){const a=zM.INSTANCE.get(s);let l=!1,c=null,u=null;a&&(l=r.getOption(37)&&!!a.isFromEmptySelection,c=typeof a.multicursorText<"u"?a.multicursorText:null,u=a.mode),r.trigger("keyboard","paste",{text:s,pasteOnNewLine:l,multicursorText:c,mode:u})}}))():!0:!1}),pJ.addImplementation(0,"generic-dom",(n,e)=>(WU().execCommand("paste"),!0)));eQe&&ht(Wtr);var ztr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Fn{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+Fn.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Fn(this.value+Fn.sep+e)}}Fn.sep=".";Fn.None=new Fn("@@none@@");Fn.Empty=new Fn("");Fn.QuickFix=new Fn("quickfix");Fn.Refactor=new Fn("refactor");Fn.RefactorExtract=Fn.Refactor.append("extract");Fn.RefactorInline=Fn.Refactor.append("inline");Fn.RefactorMove=Fn.Refactor.append("move");Fn.RefactorRewrite=Fn.Refactor.append("rewrite");Fn.Notebook=new Fn("notebook");Fn.Source=new Fn("source");Fn.SourceOrganizeImports=Fn.Source.append("organizeImports");Fn.SourceFixAll=Fn.Source.append("fixAll");Fn.SurroundWith=Fn.Refactor.append("surround");var hh;(function(n){n.Refactor="refactor",n.RefactorPreview="refactor preview",n.Lightbulb="lightbulb",n.Default="other (default)",n.SourceAction="source action",n.QuickFix="quick fix action",n.FixAll="fix all",n.OrganizeImports="organize imports",n.AutoFix="auto fix",n.QuickFixHover="quick fix hover window",n.OnSave="save participants",n.ProblemsView="problems view"})(hh||(hh={}));function jtr(n,e){return!(n.include&&!n.include.intersects(e)||n.excludes&&n.excludes.some(t=>nQe(e,t,n.include))||!n.includeSourceActions&&Fn.Source.contains(e))}function Utr(n,e){const t=e.kind?new Fn(e.kind):void 0;return!(n.include&&(!t||!n.include.contains(t))||n.excludes&&t&&n.excludes.some(i=>nQe(t,i,n.include))||!n.includeSourceActions&&t&&Fn.Source.contains(t)||n.onlyIncludePreferredActions&&!e.isPreferred)}function nQe(n,e,t){return!(!e.contains(n)||t&&e.contains(t))}class Tv{static fromUser(e,t){return!e||typeof e!="object"?new Tv(t.kind,t.apply,!1):new Tv(Tv.getKindFromUser(e,t.kind),Tv.getApplyFromUser(e,t.apply),Tv.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new Fn(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class qtr{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}resolve(e){var t;return ztr(this,void 0,void 0,function*(){if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let i;try{i=yield this.provider.resolveCodeAction(this.action,e)}catch(r){Sa(r)}i&&(this.action.edit=i.edit)}return this})}}var GH=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const iQe="editor.action.codeAction",$ve="editor.action.quickFix",rQe="editor.action.autoFix",oQe="editor.action.refactor",sQe="editor.action.sourceAction",Vve="editor.action.organizeImports",Hve="editor.action.fixAll";class JO extends Ae{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return Fc(e.diagnostics)?Fc(t.diagnostics)?JO.codeActionsPreferredComparator(e,t):-1:Fc(t.diagnostics)?1:JO.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(JO.codeActionsComparator),this.validActions=this.allActions.filter(({action:r})=>!r.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Fn.QuickFix.contains(new Fn(e.kind))&&!!e.isPreferred)}}const kRe={actions:[],documentation:void 0};function eP(n,e,t,i,r,o){var s;return GH(this,void 0,void 0,function*(){const a=i.filter||{},l=Object.assign(Object.assign({},a),{excludes:[...a.excludes||[],Fn.Notebook]}),c={only:(s=a.include)===null||s===void 0?void 0:s.value,trigger:i.type},u=new Rve(e,o),d=i.type===2,h=Ktr(n,e,d?l:a),g=new nt,p=h.map(_=>GH(this,void 0,void 0,function*(){try{r.report(_);const v=yield _.provideCodeActions(e,t,c,u.token);if(v&&g.add(v),u.token.isCancellationRequested)return kRe;const b=((v==null?void 0:v.actions)||[]).filter(C=>C&&Utr(a,C)),y=Ytr(_,b,a.include);return{actions:b.map(C=>new qtr(C,_)),documentation:y}}catch(v){if(R_(v))throw v;return Sa(v),kRe}})),m=n.onDidChange(()=>{const _=n.all(e);Qs(_,h)||u.cancel()});try{const _=yield Promise.all(p),v=_.map(y=>y.actions).flat(),b=[...ob(_.map(y=>y.documentation)),...Gtr(n,e,i,v)];return new JO(v,b,g)}finally{m.dispose(),u.dispose()}})}function Ktr(n,e,t){return n.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(r=>jtr(t,new Fn(r))):!0)}function*Gtr(n,e,t,i){var r,o,s;if(e&&i.length)for(const a of n.all(e))a._getAdditionalMenuItems&&(yield*(r=a._getAdditionalMenuItems)===null||r===void 0?void 0:r.call(a,{trigger:t.type,only:(s=(o=t.filter)===null||o===void 0?void 0:o.include)===null||s===void 0?void 0:s.value},i.map(l=>l.action)))}function Ytr(n,e,t){if(!n.documentation)return;const i=n.documentation.map(r=>({kind:new Fn(r.kind),command:r.command}));if(t){let r;for(const o of i)o.kind.contains(t)&&(r?r.kind.contains(o.kind)&&(r=o):r=o);if(r)return r==null?void 0:r.command}for(const r of e)if(r.kind){for(const o of i)if(o.kind.contains(new Fn(r.kind)))return o.command}}var YH;(function(n){n.OnSave="onSave",n.FromProblemsView="fromProblemsView",n.FromCodeActions="fromCodeActions"})(YH||(YH={}));function Qtr(n,e,t,i,r=Mi.None){var o;return GH(this,void 0,void 0,function*(){const s=n.get(L5),a=n.get(Fs),l=n.get(wf),c=n.get(ga);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),yield e.resolve(r),!r.isCancellationRequested&&!(!((o=e.action.edit)===null||o===void 0)&&o.edits.length&&!(yield s.apply(e.action.edit,{editor:i==null?void 0:i.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==YH.OnSave,showPreview:i==null?void 0:i.preview})).isApplied)&&e.action.command)try{yield a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(u){const d=Xtr(u);c.error(typeof d=="string"?d:E("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function Xtr(n){return typeof n=="string"?n:n instanceof Error&&typeof n.message=="string"?n.message:void 0}Xi.registerCommand("_executeCodeActionProvider",function(n,e,t,i,r){return GH(this,void 0,void 0,function*(){if(!(e instanceof Tn))throw gg();const{codeActionProvider:o}=n.get(en),s=n.get(ts).getModel(e);if(!s)throw gg();const a=ln.isISelection(t)?ln.liftSelection(t):q.isIRange(t)?s.validateRange(t):void 0;if(!a)throw gg();const l=typeof i=="string"?new Fn(i):void 0,c=yield eP(o,s,a,{type:1,triggerAction:hh.Default,filter:{includeSourceActions:!0,include:l}},Zy.None,Mi.None),u=[],d=Math.min(c.validActions.length,typeof r=="number"?r:0);for(let h=0;h<d;h++)u.push(c.validActions[h].resolve(Mi.None));try{return yield Promise.all(u),c.validActions.map(h=>h.action)}finally{setTimeout(()=>c.dispose(),100)}})});var Ztr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Jtr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},mle;let QH=mle=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Jw(()=>this.keybindingService.getKeybindings().filter(t=>mle.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===Vve?i={kind:Fn.SourceOrganizeImports.value}:t.command===Hve&&(i={kind:Fn.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},Tv.fromUser(i,{kind:Fn.None,apply:"never"}))}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i==null?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Fn(e.kind);return t.filter(r=>r.kind.contains(i)).filter(r=>r.preferred?e.isPreferred:!0).reduceRight((r,o)=>r?r.kind.contains(o.kind)?o:r:o,void 0)}};QH.codeActionCommands=[oQe,iQe,sQe,Vve,Hve];QH=mle=Ztr([Jtr(0,mo)],QH);re("symbolIcon.arrayForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.booleanForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},E("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.colorForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.constantForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},E("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},E("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},E("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},E("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},E("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.fileForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.folderForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},E("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},E("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.keyForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.keywordForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},E("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.moduleForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.namespaceForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.nullForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.numberForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.objectForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.operatorForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.packageForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.propertyForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.referenceForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.snippetForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.stringForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.structForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.textForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.typeParameterForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.unitForeground",{dark:pt,light:pt,hcDark:pt,hcLight:pt},E("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));re("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},E("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const aQe=Object.freeze({kind:Fn.Empty,title:E("codeAction.widget.id.more","More Actions...")}),enr=Object.freeze([{kind:Fn.QuickFix,title:E("codeAction.widget.id.quickfix","Quick Fix")},{kind:Fn.RefactorExtract,title:E("codeAction.widget.id.extract","Extract"),icon:Ct.wrench},{kind:Fn.RefactorInline,title:E("codeAction.widget.id.inline","Inline"),icon:Ct.wrench},{kind:Fn.RefactorRewrite,title:E("codeAction.widget.id.convert","Rewrite"),icon:Ct.wrench},{kind:Fn.RefactorMove,title:E("codeAction.widget.id.move","Move"),icon:Ct.wrench},{kind:Fn.SurroundWith,title:E("codeAction.widget.id.surround","Surround With"),icon:Ct.symbolSnippet},{kind:Fn.Source,title:E("codeAction.widget.id.source","Source Action"),icon:Ct.symbolFile},aQe]);function tnr(n,e,t){if(!e)return n.map(o=>{var s;return{kind:"action",item:o,group:aQe,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!(!((s=o.action.edit)===null||s===void 0)&&s.edits.length)}});const i=enr.map(o=>({group:o,actions:[]}));for(const o of n){const s=o.action.kind?new Fn(o.action.kind):Fn.None;for(const a of i)if(a.group.kind.contains(s)){a.actions.push(o);break}}const r=[];for(const o of i)if(o.actions.length){r.push({kind:"header",group:o.group});for(const s of o.actions)r.push({kind:"action",item:s,group:o.group,label:s.action.title,disabled:!!s.action.disabled,keybinding:t(s.action)})}return r}var nnr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},inr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},_le,tL;(function(n){n.Hidden={type:0};class e{constructor(i,r,o,s){this.actions=i,this.trigger=r,this.editorPosition=o,this.widgetPosition=s,this.type=1}}n.Showing=e})(tL||(tL={}));let Kx=_le=class extends Ae{constructor(e,t){super(),this._editor=e,this._onClick=this._register(new be),this.onClick=this._onClick.event,this._state=tL.Hidden,this._domNode=at("div.lightBulbWidget"),this._register(bo.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const r=this._editor.getModel();(this.state.type!==1||!r||this.state.editorPosition.lineNumber>=r.getLineCount())&&this.hide()})),this._register(ZBi(this._domNode,i=>{if(this.state.type!==1)return;this._editor.focus(),i.preventDefault();const{top:r,height:o}=Oa(this._domNode),s=this._editor.getOption(66);let a=Math.floor(s/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber<this.state.editorPosition.lineNumber&&(a+=s),this._onClick.fire({x:i.posx,y:r+o+a,actions:this.state.actions,trigger:this.state.trigger})})),this._register(We(this._domNode,"mouseenter",i=>{(i.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(64)&&!this._editor.getOption(64).enabled&&this.hide()})),this._register(Pt.runAndSubscribe(t.onDidUpdateKeybindings,()=>{var i,r,o,s;this._preferredKbLabel=(r=(i=t.lookupKeybinding(rQe))===null||i===void 0?void 0:i.getLabel())!==null&&r!==void 0?r:void 0,this._quickFixKbLabel=(s=(o=t.lookupKeybinding($ve))===null||o===void 0?void 0:o.getLabel())!==null&&s!==void 0?s:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();const r=this._editor.getOptions();if(!r.get(64).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:s,column:a}=o.validatePosition(i),l=o.getOptions().tabSize,c=r.get(50),u=o.getLineContent(s),d=uq(u,l),h=c.spaceWidth*d>22,g=m=>m>2&&this._editor.getTopForLineNumber(m)===this._editor.getTopForLineNumber(m-1);let p=s;if(!h){if(s>1&&!g(s-1))p-=1;else if(!g(s+1))p+=1;else if(a*c.spaceWidth<22)return this.hide()}this.state=new tL.Showing(e,t,i,{position:{lineNumber:p,column:1},preference:_le._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==tL.Hidden&&(this.state=tL.Hidden,this._editor.layoutContentWidget(this))}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){if(this.state.type===1&&this.state.actions.hasAutoFix&&(this._domNode.classList.remove(...In.asClassNameArray(Ct.lightBulb)),this._domNode.classList.add(...In.asClassNameArray(Ct.lightbulbAutofix)),this._preferredKbLabel)){this.title=E("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel);return}this._domNode.classList.remove(...In.asClassNameArray(Ct.lightbulbAutofix)),this._domNode.classList.add(...In.asClassNameArray(Ct.lightBulb)),this._quickFixKbLabel?this.title=E("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=E("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};Kx.ID="editor.contrib.lightbulbWidget";Kx._posPref=[0];Kx=_le=nnr([inr(1,mo)],Kx);var rnr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},TRe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},lQe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},vle;let w0=vle=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new be,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const r=new nt,o=r.add(wq(e,Object.assign(Object.assign({},this._getRenderOptions(e,r)),t),i));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>r.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:(i,r)=>lQe(this,void 0,void 0,function*(){var o,s,a;let l;i?l=this._languageService.getLanguageIdByLanguageName(i):this._options.editor&&(l=(o=this._options.editor.getModel())===null||o===void 0?void 0:o.getLanguageId()),l||(l=nf);const c=yield IUi(this._languageService,r,l),u=document.createElement("span");if(u.innerHTML=(a=(s=vle._ttpTokenizer)===null||s===void 0?void 0:s.createHTML(c))!==null&&a!==void 0?a:c,this._options.editor){const d=this._options.editor.getOption(50);mc(u,d)}else this._options.codeBlockFontFamily&&(u.style.fontFamily=this._options.codeBlockFontFamily);return this._options.codeBlockFontSize!==void 0&&(u.style.fontSize=this._options.codeBlockFontSize),u}),asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:i=>cQe(this._openerService,i,e.isTrusted),disposables:t}}}};w0._ttpTokenizer=R0("tokenizeToString",{createHTML(n){return n}});w0=vle=rnr([TRe(1,Qo),TRe(2,mh)],w0);function cQe(n,e,t){return lQe(this,void 0,void 0,function*(){try{return yield n.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:onr(t)})}catch(i){return fi(i),!1}})}function onr(n){return n===!0?!0:n&&Array.isArray(n.enabledCommands)?n.enabledCommands:!1}var snr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},IRe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},X8;let oh=X8=class{static get(e){return e.getContribution(X8.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Zl,this._messageListeners=new nt,this._mouseOverMessage=!1,this._editor=e,this._visible=X8.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){Pc(OC(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=OC(e)?wq(e,{actionHandler:{callback:r=>cQe(this._openerService,r,OC(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new LRe(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(Pt.debounce(this._editor.onDidBlurEditorText,(r,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&gc(Lp(),this._messageWidget.value.getDomNode())||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(We(this._messageWidget.value.getDomNode(),Lt.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(We(this._messageWidget.value.getDomNode(),Lt.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(r=>{r.target.position&&(i?i.containsPosition(r.target.position)||this.closeMessage():i=new q(t.lineNumber-3,1,r.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(LRe.fadeOut(this._messageWidget.value))}};oh.ID="editor.contrib.messageController";oh.MESSAGE_VISIBLE=new Ft("messageVisible",!1,E("messageVisible","Whether the editor is currently showing an inline message"));oh=X8=snr([IRe(1,Yn),IRe(2,mh)],oh);const anr=kl.bindToContribution(oh.get);Et(new anr({id:"leaveEditorMessage",precondition:oh.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:100+30,primary:9}}));let LRe=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},r){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const s=document.createElement("div");typeof r=="string"?(s.classList.add("message"),s.textContent=r):(r.classList.add("message"),s.appendChild(r)),this._domNode.appendChild(s);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};gr(oh.ID,oh,4);var uQe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ble=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},lnr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const dQe="acceptSelectedCodeAction",hQe="previewSelectedCodeAction";class cnr{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){var r,o;i.text.textContent=(o=(r=e.group)===null||r===void 0?void 0:r.title)!==null&&o!==void 0?o:""}disposeTemplate(e){}}let yle=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const r=new O5(e,qh);return{container:e,icon:t,text:i,keybinding:r}}renderElement(e,t,i){var r,o,s;if(!((r=e.group)===null||r===void 0)&&r.icon?(i.icon.className=In.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=Bt(e.group.icon.color.id))):(i.icon.className=In.asClassName(Ct.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=fQe(e.label),i.keybinding.set(e.keybinding),c$i(!!e.keybinding,i.keybinding.element);const a=(o=this._keybindingService.lookupKeybinding(dQe))===null||o===void 0?void 0:o.getLabel(),l=(s=this._keybindingService.lookupKeybinding(hQe))===null||s===void 0?void 0:s.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?i.container.title=E({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):i.container.title=E({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):i.container.title=""}disposeTemplate(e){}};yle=uQe([ble(1,mo)],yle);class unr extends UIEvent{constructor(){super("acceptSelectedAction")}}class DRe extends UIEvent{constructor(){super("previewSelectedAction")}}function dnr(n){if(n.kind==="action")return n.label}let Cle=class extends Ae{constructor(e,t,i,r,o,s){super(),this._delegate=r,this._contextViewService=o,this._keybindingService=s,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new da),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:l=>l.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:l=>l.kind};this._list=this._register(new sm(e,this.domNode,a,[new yle(t,this._keybindingService),new cnr],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:dnr},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?fQe(l==null?void 0:l.label):"";return l.disabled&&(c=E({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",c,l.disabled)),c}return null},getWidgetAriaLabel:()=>E({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(Bk),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(c=>c.kind==="header").length,r=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(r);const o=this._allMenuItems.map((c,u)=>{const d=document.getElementById(this._list.getElementID(u));if(d){d.style.width="auto";const h=d.getBoundingClientRect().width;return d.style.width="",h}return 0}),s=Math.max(...o,e),a=.7,l=Math.min(r,document.body.clientHeight*a);return this._list.layout(l,s),this.domNode.style.height=`${l}px`,this._list.domFocus(),s}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],r=this._list.element(i);if(!this.focusCondition(r))return;const o=e?new DRe:new unr;this._list.setSelection([i],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof DRe):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();const i=this._list.getFocus();if(i.length===0)return;const r=i[0],o=this._list.element(r);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,o.item)}onListHover(e){return lnr(this,void 0,void 0,function*(){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const i=yield this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])})}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};Cle=uQe([ble(4,O0),ble(5,mo)],Cle);function fQe(n){return n.replace(/\r\n|\r|\n/g," ")}var hnr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},mJ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};re("actionBar.toggledBackground",{dark:IE,light:IE,hcDark:IE,hcLight:IE},E("actionBar.toggledBackground","Background color for toggled action items in action bar."));const Gx={Visible:new Ft("codeActionMenuVisible",!1,E("codeActionMenuVisible","Whether the action widget list is visible"))},zk=Vi("actionWidgetService");let Yx=class extends Ae{get isVisible(){return Gx.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Zl)}show(e,t,i,r,o,s,a){const l=Gx.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance(Cle,e,t,i,r);this._contextViewService.showContextView({getAnchor:()=>o,render:u=>(l.set(!0),this._renderWidget(u,c,a??[])),onHide:u=>{l.reset(),this._onWidgetClosed(u)}},s,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,t,i){var r;const o=document.createElement("div");if(o.classList.add("action-widget"),e.appendChild(o),this._list.value=t,this._list.value)o.appendChild(this._list.value.domNode);else throw new Error("List has no value");const s=new nt,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),s.add(We(l,Lt.MOUSE_DOWN,p=>p.stopPropagation()));const c=document.createElement("div"),u=e.appendChild(c);u.classList.add("context-view-pointerBlock"),s.add(We(u,Lt.POINTER_MOVE,()=>u.remove())),s.add(We(u,Lt.MOUSE_DOWN,()=>u.remove()));let d=0;if(i.length){const p=this._createActionBar(".action-widget-action-bar",i);p&&(o.appendChild(p.getContainer().parentElement),s.add(p),d=p.getContainer().offsetWidth)}const h=(r=this._list.value)===null||r===void 0?void 0:r.layout(d);o.style.width=`${h}px`;const g=s.add(lb(e));return s.add(g.onDidBlur(()=>this.hide())),s}_createActionBar(e,t){if(!t.length)return;const i=at(e),r=new Ig(i);return r.push(t,{icon:!1,label:!0}),r}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};Yx=hnr([mJ(0,O0),mJ(1,Yn),mJ(2,Un)],Yx);Zi(zk,Yx,1);const W5=100+1e3;jo(class extends Cf{constructor(){super({id:"hideCodeActionWidget",title:{value:E("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:Gx.Visible,keybinding:{weight:W5,primary:9,secondary:[1033]}})}run(n){n.get(zk).hide()}});jo(class extends Cf{constructor(){super({id:"selectPrevCodeAction",title:{value:E("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:Gx.Visible,keybinding:{weight:W5,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(n){const e=n.get(zk);e instanceof Yx&&e.focusPrevious()}});jo(class extends Cf{constructor(){super({id:"selectNextCodeAction",title:{value:E("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:Gx.Visible,keybinding:{weight:W5,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(n){const e=n.get(zk);e instanceof Yx&&e.focusNext()}});jo(class extends Cf{constructor(){super({id:dQe,title:{value:E("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:Gx.Visible,keybinding:{weight:W5,primary:3,secondary:[2137]}})}run(n){const e=n.get(zk);e instanceof Yx&&e.acceptSelected()}});jo(class extends Cf{constructor(){super({id:hQe,title:{value:E("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:Gx.Visible,keybinding:{weight:W5,primary:2051}})}run(n){const e=n.get(zk);e instanceof Yx&&e.acceptSelected(!0)}});var fnr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const gQe=new Ft("supportedCodeAction","");class gnr extends Ae{constructor(e,t,i,r=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=r,this._autoTriggerTimer=this._register(new nm),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>C_e(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:hh.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._editor.getSelection();if(i.isEmpty()&&e.type===2){const{lineNumber:r,column:o}=i.getPosition(),s=t.getLineContent(r);if(s.length===0)return;if(o===1){if(/\s/.test(s[0]))return}else if(o===t.getLineMaxColumn(r)){if(/\s/.test(s[s.length-1]))return}else if(/\s/.test(s[o-2])&&/\s/.test(s[o-1]))return}return i}}var fE;(function(n){n.Empty={type:0};class e{constructor(i,r,o){this.trigger=i,this.position=r,this._cancellablePromise=o,this.type=1,this.actions=o.catch(s=>{if(R_(s))return pQe;throw s})}cancel(){this._cancellablePromise.cancel()}}n.Triggered=e})(fE||(fE={}));const pQe=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class pnr extends Ae{constructor(e,t,i,r,o,s){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._configurationService=s,this._codeActionOracle=this._register(new Zl),this._state=fE.Empty,this._onDidChangeState=this._register(new be),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=gQe.bindTo(r),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(fE.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickfixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(fE.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap(i=>{var r;return(r=i.providedCodeActionKinds)!==null&&r!==void 0?r:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new gnr(this._editor,this._markerService,i=>{var r;if(!i){this.setState(fE.Empty);return}const o=i.selection.getStartPosition(),s=za(a=>fnr(this,void 0,void 0,function*(){var l,c,u,d,h,g;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===hh.QuickFix||!((c=(l=i.trigger.filter)===null||l===void 0?void 0:l.include)===null||c===void 0)&&c.contains(Fn.QuickFix))){const p=yield eP(this._registry,e,i.selection,i.trigger,Zy.None,a);if(a.isCancellationRequested)return pQe;if(!((u=p.validActions)===null||u===void 0?void 0:u.some(_=>_.action.kind?Fn.QuickFix.contains(new Fn(_.action.kind)):!1))){const _=this._markerService.read({resource:e.uri});if(_.length>0){const v=i.selection.getPosition();let b=v,y=Number.MAX_VALUE,C=!1;for(const x of _){const k=x.endColumn,I=x.endLineNumber,L=x.startLineNumber;(I===v.lineNumber||L===v.lineNumber)&&Math.abs(v.column-k)<y&&(y=Math.abs(v.column-k),C=!0,b=new Ce(I,k))}if(C){const x={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:!((d=i.trigger.filter)===null||d===void 0)&&d.include?(h=i.trigger.filter)===null||h===void 0?void 0:h.include:Fn.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:((g=i.trigger.context)===null||g===void 0?void 0:g.notAvailableMessage)||"",position:b}},k=new ln(b.lineNumber,b.column,b.lineNumber,b.column),I=yield eP(this._registry,e,k,x,Zy.None,a),L=[...p.validActions];return I.validActions.length!==0&&(I.validActions.forEach(D=>{D.highlightRange=D.action.isPreferred}),L.push(...I.validActions)),{validActions:L,allActions:p.allActions,documentation:p.documentation,hasAutoFix:p.hasAutoFix,dispose:()=>{p.dispose()}}}}}}return eP(this._registry,e,i.selection,i.trigger,Zy.None,a)}));i.trigger.type===1&&((r=this._progressService)===null||r===void 0||r.showWhile(s,250)),this.setState(new fE.Triggered(i.trigger,o,s))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:hh.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var mnr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Jb=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},XR=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Z8;const _nr="quickfix-edit-highlight";let yw=Z8=class extends Ae{static get(e){return e.getContribution(Z8.ID)}constructor(e,t,i,r,o,s,a,l,c,u){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=u,this._activeCodeActions=this._register(new Zl),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new pnr(this._editor,o.codeActionProvider,t,i,s,l)),this._register(this._model.onDidChangeState(d=>this.update(d))),this._lightBulbWidget=new Jw(()=>{const d=this._editor.getContribution(Kx.ID);return d&&this._register(d.onClick(h=>this.showCodeActionList(h.actions,h,{includeDisabledActions:!1,fromLightbulb:!0}))),d}),this._resolver=r.createInstance(QH),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,r){var o;if(!this._editor.hasModel())return;(o=oh.get(this._editor))===null||o===void 0||o.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:r,context:{notAvailableMessage:e,position:s}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e,t,i){return XR(this,void 0,void 0,function*(){try{yield this._instantiationService.invokeFunction(Qtr,e,YH.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:hh.QuickFix,filter:{}})}})}update(e){var t,i,r,o,s,a,l;return XR(this,void 0,void 0,function*(){if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let c;try{c=yield e.actions}catch(u){fi(u);return}if(!this._disposed)if((i=this._lightBulbWidget.value)===null||i===void 0||i.update(c,e.trigger,e.position),e.trigger.type===1){if(!((r=e.trigger.filter)===null||r===void 0)&&r.include){const d=this.tryGetValidActionToApply(e.trigger,c);if(d){try{(o=this._lightBulbWidget.value)===null||o===void 0||o.hide(),yield this._applyCodeAction(d,!1,!1)}finally{c.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,c);if(h&&h.action.disabled){(s=oh.get(this._editor))===null||s===void 0||s.showMessage(h.action.disabled,e.trigger.context.position),c.dispose();return}}}const u=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!c.allActions.length||!u&&!c.validActions.length)){(l=oh.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=c,c.dispose();return}this._activeCodeActions.value=c,this.showCodeActionList(c,this.toCoords(e.position),{includeDisabledActions:u,fromLightbulb:!1})}else this._actionWidgetService.isVisible?c.dispose():this._activeCodeActions.value=c})}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}showCodeActionList(e,t,i){return XR(this,void 0,void 0,function*(){const r=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const s=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!s.length)return;const a=Ce.isIPosition(t)?this.toCoords(t):t,l={onSelect:(c,u)=>XR(this,void 0,void 0,function*(){this._applyCodeAction(c,!0,!!u),this._actionWidgetService.hide(),r.clear()}),onHide:()=>{var c;(c=this._editor)===null||c===void 0||c.focus(),r.clear()},onHover:(c,u)=>XR(this,void 0,void 0,function*(){var d;if(yield c.resolve(u),!u.isCancellationRequested)return{canPreview:!!(!((d=c.action.edit)===null||d===void 0)&&d.edits.length)}}),onFocus:c=>{var u,d;if(c&&c.highlightRange&&c.action.diagnostics){const h=[{range:c.action.diagnostics[0],options:Z8.DECORATION}];r.set(h);const g=c.action.diagnostics[0],p=(d=(u=this._editor.getModel())===null||u===void 0?void 0:u.getWordAtPosition({lineNumber:g.startLineNumber,column:g.startColumn}))===null||d===void 0?void 0:d.word;fw(E("editingNewSelection","Context: {0} at line {1} and column {2}.",p,g.startLineNumber,g.startColumn))}else r.clear()}};this._actionWidgetService.show("codeActionWidget",!0,tnr(s,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,o,this._getActionBarActions(e,t,i))})}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),i=Oa(this._editor.getDomNode()),r=i.left+t.left,o=i.top+t.top+t.height;return{x:r,y:o}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t==null?void 0:t.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const r=e.documentation.map(o=>{var s;return{id:o.id,label:o.title,tooltip:(s=o.tooltip)!==null&&s!==void 0?s:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(o.id,...(a=o.arguments)!==null&&a!==void 0?a:[])}}});return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&r.push(this._showDisabled?{id:"hideMoreActions",label:E("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:E("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),r}};yw.ID="editor.contrib.codeActionController";yw.DECORATION=hi.register({description:"quickfix-highlight",className:_nr});yw=Z8=mnr([Jb(1,Lb),Jb(2,Yn),Jb(3,Un),Jb(4,en),Jb(5,iS),Jb(6,Fs),Jb(7,Ui),Jb(8,zk),Jb(9,Un)],yw);rm((n,e)=>{((r,o)=>{o&&e.addRule(`.monaco-editor ${r} { background-color: ${o}; }`)})(".quickfix-edit-highlight",n.getColor($v));const i=n.getColor(Z1);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${m_(n.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function z5(n){return Ke.regex(gQe.keys()[0],new RegExp("(\\s|^)"+hf(n.value)+"\\b"))}const Wve={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:E("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:E("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[E("args.schema.apply.first","Always apply the first returned code action."),E("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),E("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:E("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function jk(n,e,t,i,r=hh.Default){if(n.hasModel()){const o=yw.get(n);o==null||o.manualTriggerAtCurrentPosition(e,r,t,i)}}class vnr extends Gt{constructor(){super({id:$ve,label:E("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:Ke.and(ee.writable,ee.hasCodeActionsProvider),kbOpts:{kbExpr:ee.textInputFocus,primary:2137,weight:100}})}run(e,t){return jk(t,E("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,hh.QuickFix)}}class bnr extends kl{constructor(){super({id:iQe,precondition:Ke.and(ee.writable,ee.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:Wve}]}})}runEditorCommand(e,t,i){const r=Tv.fromUser(i,{kind:Fn.Empty,apply:"ifSingle"});return jk(t,typeof(i==null?void 0:i.kind)=="string"?r.preferred?E("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",i.kind):E("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",i.kind):r.preferred?E("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):E("editor.action.codeAction.noneMessage","No code actions available"),{include:r.kind,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply)}}class ynr extends Gt{constructor(){super({id:oQe,label:E("refactor.label","Refactor..."),alias:"Refactor...",precondition:Ke.and(ee.writable,ee.hasCodeActionsProvider),kbOpts:{kbExpr:ee.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:Ke.and(ee.writable,z5(Fn.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:Wve}]}})}run(e,t,i){const r=Tv.fromUser(i,{kind:Fn.Refactor,apply:"never"});return jk(t,typeof(i==null?void 0:i.kind)=="string"?r.preferred?E("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",i.kind):E("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",i.kind):r.preferred?E("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):E("editor.action.refactor.noneMessage","No refactorings available"),{include:Fn.Refactor.contains(r.kind)?r.kind:Fn.None,onlyIncludePreferredActions:r.preferred},r.apply,hh.Refactor)}}class Cnr extends Gt{constructor(){super({id:sQe,label:E("source.label","Source Action..."),alias:"Source Action...",precondition:Ke.and(ee.writable,ee.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:Ke.and(ee.writable,z5(Fn.Source))},description:{description:"Source Action...",args:[{name:"args",schema:Wve}]}})}run(e,t,i){const r=Tv.fromUser(i,{kind:Fn.Source,apply:"never"});return jk(t,typeof(i==null?void 0:i.kind)=="string"?r.preferred?E("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",i.kind):E("editor.action.source.noneMessage.kind","No source actions for '{0}' available",i.kind):r.preferred?E("editor.action.source.noneMessage.preferred","No preferred source actions available"):E("editor.action.source.noneMessage","No source actions available"),{include:Fn.Source.contains(r.kind)?r.kind:Fn.None,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply,hh.SourceAction)}}class wnr extends Gt{constructor(){super({id:Vve,label:E("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:Ke.and(ee.writable,z5(Fn.SourceOrganizeImports)),kbOpts:{kbExpr:ee.textInputFocus,primary:1581,weight:100}})}run(e,t){return jk(t,E("editor.action.organize.noneMessage","No organize imports action available"),{include:Fn.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",hh.OrganizeImports)}}class Snr extends Gt{constructor(){super({id:Hve,label:E("fixAll.label","Fix All"),alias:"Fix All",precondition:Ke.and(ee.writable,z5(Fn.SourceFixAll))})}run(e,t){return jk(t,E("fixAll.noneMessage","No fix all action available"),{include:Fn.SourceFixAll,includeSourceActions:!0},"ifSingle",hh.FixAll)}}class Enr extends Gt{constructor(){super({id:rQe,label:E("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:Ke.and(ee.writable,z5(Fn.QuickFix)),kbOpts:{kbExpr:ee.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return jk(t,E("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Fn.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",hh.AutoFix)}}gr(yw.ID,yw,3);gr(Kx.ID,Kx,4);ht(vnr);ht(ynr);ht(Cnr);ht(wnr);ht(Enr);ht(Snr);Et(new bnr);ds.as(O_.Configuration).registerConfiguration(Object.assign(Object.assign({},_q),{properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:E("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}}));ds.as(O_.Configuration).registerConfiguration(Object.assign(Object.assign({},_q),{properties:{"editor.codeActionWidget.includeNearbyQuickfixes":{type:"boolean",scope:5,description:E("includeNearbyQuickfixes","Enable/disable showing nearest quickfix within a line when not currently on a diagnostic."),default:!1}}}));var ARe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class wle{constructor(){this.lenses=[],this._disposables=new nt}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}}function mQe(n,e,t){return ARe(this,void 0,void 0,function*(){const i=n.ordered(e),r=new Map,o=new wle,s=i.map((a,l)=>ARe(this,void 0,void 0,function*(){r.set(a,l);try{const c=yield Promise.resolve(a.provideCodeLenses(e,t));c&&o.add(c,a)}catch(c){Sa(c)}}));return yield Promise.all(s),o.lenses=o.lenses.sort((a,l)=>a.symbol.range.startLineNumber<l.symbol.range.startLineNumber?-1:a.symbol.range.startLineNumber>l.symbol.range.startLineNumber?1:r.get(a.provider)<r.get(l.provider)?-1:r.get(a.provider)>r.get(l.provider)?1:a.symbol.range.startColumn<l.symbol.range.startColumn?-1:a.symbol.range.startColumn>l.symbol.range.startColumn?1:0),o})}Xi.registerCommand("_executeCodeLensProvider",function(n,...e){let[t,i]=e;to(Tn.isUri(t)),to(typeof i=="number"||!i);const{codeLensProvider:r}=n.get(en),o=n.get(ts).getModel(t);if(!o)throw gg();const s=[],a=new nt;return mQe(r,o,Mi.None).then(l=>{a.add(l);const c=[];for(const u of l.lenses)i==null||u.symbol.command?s.push(u.symbol):i-- >0&&u.provider.resolveCodeLens&&c.push(Promise.resolve(u.provider.resolveCodeLens(o,u.symbol,Mi.None)).then(d=>s.push(d||u.symbol)));return Promise.all(c)}).then(()=>s).finally(()=>{setTimeout(()=>a.dispose(),100)})});var xnr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},knr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const _Qe=Vi("ICodeLensCache");class RRe{constructor(e,t){this.lineCount=e,this.data=t}}let Sle=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new eS(20,.75);const t="codelens/cache";Py(()=>e.remove(t,1));const i="codelens/cache2",r=e.get(i,1,"{}");this._deserialize(r),Pt.once(e.onWillSaveState)(o=>{o.reason===wH.SHUTDOWN&&e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(s=>{var a;return{range:s.symbol.range,command:s.symbol.command&&{id:"",title:(a=s.symbol.command)===null||a===void 0?void 0:a.title}}}),r=new wle;r.add({lenses:i,dispose:()=>{}},this._fakeProvider);const o=new RRe(e.getLineCount(),r);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,i]of this._cache){const r=new Set;for(const o of i.data.lenses)r.add(o.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...r.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const r=t[i],o=[];for(const a of r.lines)o.push({range:new q(a,1,a,11)});const s=new wle;s.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(i,new RRe(r.lineCount,s))}}catch{}}};Sle=xnr([knr(0,am)],Sle);Zi(_Qe,Sle,1);class Tnr{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class Xq{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${Xq._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let r=!1;for(let o=0;o<e.length;o++){const s=e[o];if(s&&(r=!0,s.command)){const a=PC(s.command.title.trim());s.command.id?(i.push(at("a",{id:String(o),title:s.command.tooltip,role:"button"},...a)),this._commands.set(String(o),s.command)):i.push(at("span",{title:s.command.tooltip},...a)),o+1<e.length&&i.push(at("span",void 0," | "))}}r?(Yl(this._domNode,...i),this._isEmpty&&t&&this._domNode.classList.add("fadein"),this._isEmpty=!1):Yl(this._domNode,at("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}}Xq._idPool=0;class _J{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){const t=e.deltaDecorations(this._removeDecorations,this._addDecorations);for(let i=0,r=t.length;i<r;i++)this._addDecorationsCallbacks[i](t[i])}}const NRe=hi.register({collapseOnReplaceEdit:!0,description:"codelens"});class ORe{constructor(e,t,i,r,o,s){this._isDisposed=!1,this._editor=t,this._data=e,this._decorationIds=[];let a;const l=[];this._data.forEach((c,u)=>{c.symbol.command&&l.push(c.symbol),i.addDecoration({range:c.symbol.range,options:NRe},d=>this._decorationIds[u]=d),a?a=q.plusRange(a,c.symbol.range):a=q.lift(c.symbol.range)}),this._viewZone=new Tnr(a.startLineNumber-1,o,s),this._viewZoneId=r.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new Xq(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||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 i=this._editor.getModel().getDecorationRange(e),r=this._data[t].symbol;return!!(i&&q.isEmpty(r.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,r)=>{t.addDecoration({range:i.symbol.range,options:NRe},o=>this._decorationIds[r]=o)})}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 i=e.getDecorationRange(this._decorationIds[t]);i&&(this._data[t].symbol.range=i)}return this._data}updateCommands(e){this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(e,!0);for(let t=0;t<this._data.length;t++){const i=e[t];if(i){const{symbol:r}=this._data[t];r.command=i.command||r.command}}}getCommand(e){var t;return(t=this._contentWidget)===null||t===void 0?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)))}}}var Inr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ZR=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},vQe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let b2=class{constructor(e,t,i,r,o,s){this._editor=e,this._languageFeaturesService=t,this._commandService=r,this._notificationService=o,this._codeLensCache=s,this._disposables=new nt,this._localToDispose=new nt,this._lenses=[],this._oldCodeLensModels=new nt,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new so(()=>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(a=>{(a.hasChanged(50)||a.hasChanged(19)||a.hasChanged(18))&&this._updateLensStyle(),a.hasChanged(17)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(66)/this._editor.getOption(52));let t=this._editor.getOption(19);return(!t||t<5)&&(t=this._editor.getOption(52)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(18),r=this._editor.getOption(50),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",r.fontFeatureSettings),i&&(o.setProperty("--vscode-editorCodeLens-fontFamily",i),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",ih.fontFamily)),this._editor.changeViewZones(s=>{for(const a of this._lenses)a.updateHeight(e,s)})}_localDispose(){var e,t,i;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(i=this._currentCodeLensModel)===null||i===void 0||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(17)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&this._localToDispose.add(uw(()=>{const r=this._codeLensCache.get(e);t===r&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3));return}for(const r of this._languageFeaturesService.codeLensProvider.all(e))if(typeof r.onDidChange=="function"){const o=r.onDidChange(()=>i.schedule());this._localToDispose.add(o)}const i=new so(()=>{var r;const o=Date.now();(r=this._getCodeLensModelPromise)===null||r===void 0||r.cancel(),this._getCodeLensModelPromise=za(s=>mQe(this._languageFeaturesService.codeLensProvider,e,s)),this._getCodeLensModelPromise.then(s=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=s,this._codeLensCache.put(e,s);const a=this._provideCodeLensDebounce.update(e,Date.now()-o);i.delay=a,this._renderCodeLensSymbols(s),this._resolveCodeLensesInViewportSoon()},fi)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(Gn(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var r;this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{const a=[];let l=-1;this._lenses.forEach(u=>{!u.isValid()||l===u.getLineNumber()?a.push(u):(u.update(s),l=u.getLineNumber())});const c=new _J;a.forEach(u=>{u.dispose(c,s),this._lenses.splice(this._lenses.indexOf(u),1)}),c.commit(o)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),(r=this._resolveCodeLensesPromise)===null||r===void 0||r.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(r=>{r.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Gn(()=>{if(this._editor.getModel()){const r=k_.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{this._disposeAllLenses(o,s)})}),r.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(r=>{if(r.target.type!==9)return;let o=r.target.element;if((o==null?void 0:o.tagName)==="SPAN"&&(o=o.parentElement),(o==null?void 0:o.tagName)==="A")for(const s of this._lenses){const a=s.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new _J;for(const r of this._lenses)r.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let r;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(r&&r[r.length-1].symbol.range.startLineNumber===l?r.push(a):(r=[a],i.push(r)))}if(!i.length&&!this._lenses.length)return;const o=k_.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new _J;let u=0,d=0;for(;d<i.length&&u<this._lenses.length;){const h=i[d][0].symbol.range.startLineNumber,g=this._lenses[u].getLineNumber();g<h?(this._lenses[u].dispose(c,l),this._lenses.splice(u,1)):g===h?(this._lenses[u].updateCodeLensSymbols(i[d],c),d++,u++):(this._lenses.splice(u,0,new ORe(i[d],this._editor,c,l,s.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),u++,d++)}for(;u<this._lenses.length;)this._lenses[u].dispose(c,l),this._lenses.splice(u,1);for(;d<i.length;)this._lenses.push(new ORe(i[d],this._editor,c,l,s.codeLensHeight,()=>this._resolveCodeLensesInViewportSoon())),d++;c.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const i=[],r=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(i.push(l),r.push(a))}),i.length===0)return;const o=Date.now(),s=za(a=>{const l=i.map((c,u)=>{const d=new Array(c.length),h=c.map((g,p)=>!g.symbol.command&&typeof g.provider.resolveCodeLens=="function"?Promise.resolve(g.provider.resolveCodeLens(t,g.symbol,a)).then(m=>{d[p]=m},Sa):(d[p]=g.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!r[u].isDisposed()&&r[u].updateCommands(d)})});return Promise.all(l)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-o);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{fi(a),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}getModel(){var e;return vQe(this,void 0,void 0,function*(){return yield this._getCodeLensModelPromise,yield this._resolveCodeLensesPromise,!((e=this._currentCodeLensModel)===null||e===void 0)&&e.isDisposed?void 0:this._currentCodeLensModel})}};b2.ID="css.editor.codeLens";b2=Inr([ZR(1,en),ZR(2,Fg),ZR(3,Fs),ZR(4,ga),ZR(5,_Qe)],b2);gr(b2.ID,b2,1);ht(class extends Gt{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:ee.hasCodeLensProvider,label:E("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return vQe(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(P_),r=e.get(Fs),o=e.get(ga),s=t.getSelection().positionLineNumber,a=t.getContribution(b2.ID);if(!a)return;const l=yield a.getModel();if(!l)return;const c=[];for(const h of l.lenses)h.symbol.command&&h.symbol.range.startLineNumber===s&&c.push({label:h.symbol.command.title,command:h.symbol.command});if(c.length===0)return;const u=yield i.pick(c,{canPickMany:!1,placeHolder:E("placeHolder","Select a command")});if(!u)return;let d=u.command;if(l.isDisposed){const h=yield a.getModel(),g=h==null?void 0:h.lenses.find(p=>{var m;return p.symbol.range.startLineNumber===s&&((m=p.symbol.command)===null||m===void 0?void 0:m.title)===d.title});if(!g||!g.symbol.command)return;d=g.symbol.command}try{yield r.executeCommand(d.id,...d.arguments||[])}catch(h){o.error(h)}})}});var Lnr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},vJ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Dnr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class zve{constructor(e,t){this._editorWorkerClient=new Qme(e,!1,"editorWorkerService",t)}provideDocumentColors(e,t){return Dnr(this,void 0,void 0,function*(){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)})}provideColorPresentations(e,t,i){const r=t.range,o=t.color,s=o.alpha,a=new De(new Yi(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),s)),l=s?De.Format.CSS.formatRGB(a):De.Format.CSS.formatRGBA(a),c=s?De.Format.CSS.formatHSL(a):De.Format.CSS.formatHSLA(a),u=s?De.Format.CSS.formatHex(a):De.Format.CSS.formatHexA(a),d=[];return d.push({label:l,textEdit:{range:r,text:l}}),d.push({label:c,textEdit:{range:r,text:c}}),d.push({label:u,textEdit:{range:r,text:u}}),d}}let Ele=class extends Ae{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new zve(e,t)))}};Ele=Lnr([vJ(0,ts),vJ(1,xo),vJ(2,en)],Ele);Fq(Ele);var j5=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function bQe(n,e,t,i=!0){return j5(this,void 0,void 0,function*(){return jve(new Anr,n,e,t,i)})}function yQe(n,e,t,i){return Promise.resolve(t.provideColorPresentations(n,e,i))}class Anr{constructor(){}compute(e,t,i,r){return j5(this,void 0,void 0,function*(){const o=yield e.provideDocumentColors(t,i);if(Array.isArray(o))for(const s of o)r.push({colorInfo:s,provider:e});return Array.isArray(o)})}}class Rnr{constructor(){}compute(e,t,i,r){return j5(this,void 0,void 0,function*(){const o=yield e.provideDocumentColors(t,i);if(Array.isArray(o))for(const s of o)r.push({range:s.range,color:[s.color.red,s.color.green,s.color.blue,s.color.alpha]});return Array.isArray(o)})}}class Nnr{constructor(e){this.colorInfo=e}compute(e,t,i,r){return j5(this,void 0,void 0,function*(){const o=yield e.provideColorPresentations(t,this.colorInfo,Mi.None);return Array.isArray(o)&&r.push(...o),Array.isArray(o)})}}function jve(n,e,t,i,r){return j5(this,void 0,void 0,function*(){let o=!1,s;const a=[],l=e.ordered(t);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u instanceof zve)s=u;else try{(yield n.compute(u,t,i,a))&&(o=!0)}catch(d){Sa(d)}}return o?a:s&&r?(yield n.compute(s,t,i,a),a):[]})}function CQe(n,e){const{colorProvider:t}=n.get(en),i=n.get(ts).getModel(e);if(!i)throw gg();const r=n.get(Ui).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:r}}Xi.registerCommand("_executeDocumentColorProvider",function(n,...e){const[t]=e;if(!(t instanceof Tn))throw gg();const{model:i,colorProviderRegistry:r,isDefaultColorDecoratorsEnabled:o}=CQe(n,t);return jve(new Rnr,r,i,Mi.None,o)});Xi.registerCommand("_executeColorPresentationProvider",function(n,...e){const[t,i]=e,{uri:r,range:o}=i;if(!(r instanceof Tn)||!Array.isArray(t)||t.length!==4||!q.isIRange(o))throw gg();const{model:s,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=CQe(n,r),[c,u,d,h]=t;return jve(new Nnr({range:o,color:{red:c,green:u,blue:d,alpha:h}}),a,s,Mi.None,l)});var Onr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},bJ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},PRe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},xle;const wQe=Object.create({});let Cw=xle=class extends Ae{constructor(e,t,i,r){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new nt),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new y5(this._editor),this._decoratorLimitReporter=new Pnr,this._colorDecorationClassRefs=this._register(new nt),this._debounceInformation=r.for(i.colorProvider,"Document Colors",{min:xle.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(o=>{const s=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const a=s!==this._isColorDecoratorsEnabled||o.hasChanged(21),l=o.hasChanged(145);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const r=i.colorDecorators;if(r&&r.enable!==void 0&&!r.enable)return r.enable}return this._editor.getOption(20)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new nm,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}beginCompute(){return PRe(this,void 0,void 0,function*(){this._computePromise=za(e=>PRe(this,void 0,void 0,function*(){const t=this._editor.getModel();if(!t)return[];const i=new $c(!1),r=yield bQe(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),r}));try{const e=yield this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){fi(e)}})}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(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:hi.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((r,o)=>this._colorDatas.set(r,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(21);for(let o=0;o<e.length&&t.length<i;o++){const{red:s,green:a,blue:l,alpha:c}=e[o].colorInfo.color,u=new Yi(Math.round(s*255),Math.round(a*255),Math.round(l*255),c),d=`rgba(${u.r}, ${u.g}, ${u.b}, ${u.a})`,h=this._colorDecorationClassRefs.add(this._ruleFactory.createClassNameRef({backgroundColor:d}));t.push({range:{startLineNumber:e[o].colorInfo.range.startLineNumber,startColumn:e[o].colorInfo.range.startColumn,endLineNumber:e[o].colorInfo.range.endLineNumber,endColumn:e[o].colorInfo.range.endColumn},options:{description:"colorDetector",before:{content:iUe,inlineClassName:`${h.className} colorpicker-color-decoration`,inlineClassNameAffectsLetterSpacing:!0,attachedData:wQe}}})}const r=i<e.length?i:!1;this._decoratorLimitReporter.update(e.length,r),this._colorDecoratorIds.set(t)}removeAllDecorations(){this._editor.removeDecorations(this._decorationsIds),this._decorationsIds=[],this._colorDecoratorIds.clear(),this._colorDecorationClassRefs.clear()}getColorData(e){const t=this._editor.getModel();if(!t)return null;const i=t.getDecorationsInRange(q.fromPositions(e,e)).filter(r=>this._colorDatas.has(r.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};Cw.ID="editor.contrib.colorDetector";Cw.RECOMPUTE_TIME=1e3;Cw=xle=Onr([bJ(1,Ui),bJ(2,en),bJ(3,Fg)],Cw);class Pnr{constructor(){this._onDidChange=new be,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}gr(Cw.ID,Cw,1);class Mnr{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)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new be,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new be,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new be,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let r=0;r<this.colorPresentations.length;r++)if(t.toLowerCase()===this.colorPresentations[r].label){i=r;break}if(i===-1){const r=t.split("(")[0].toLowerCase();for(let o=0;o<this.colorPresentations.length;o++)if(this.colorPresentations[o].label.toLowerCase().startsWith(r)){i=o;break}}i!==-1&&i!==this.presentationIndex&&(this.presentationIndex=i,this._onDidChangePresentation.fire(this.presentation))}flushColor(){this._onColorFlushed.fire(this._color)}}const Vh=at;class Fnr extends Ae{constructor(e,t,i,r=!1){super(),this.model=t,this.showingStandaloneColorPicker=r,this._closeButton=null,this._domNode=Vh(".colorpicker-header"),Ge(e,this._domNode),this._pickedColorNode=Ge(this._domNode,Vh(".picked-color")),Ge(this._pickedColorNode,Vh("span.codicon.codicon-color-mode")),this._pickedColorPresentation=Ge(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");const o=E("clickToToggleColorOptions","Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",o),this._originalColorNode=Ge(this._domNode,Vh(".original-color")),this._originalColorNode.style.backgroundColor=De.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(KV)||De.white,this._register(i.onDidColorThemeChange(s=>{this.backgroundColor=s.getColor(KV)||De.white})),this._register(We(this._pickedColorNode,Lt.CLICK,()=>this.model.selectNextColorPresentation())),this._register(We(this._originalColorNode,Lt.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=De.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),this.showingStandaloneColorPicker&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new Bnr(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=De.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}class Bnr extends Ae{constructor(e){super(),this._onClicked=this._register(new be),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),Ge(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),Ge(this._button,t),Ge(t,Vh(".button"+In.asCSSSelector(Js("color-picker-close",Ct.close,E("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class $nr extends Ae{constructor(e,t,i,r=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=Vh(".colorpicker-body"),Ge(e,this._domNode),this._saturationBox=new Vnr(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 Hnr(this._domNode,this.model,r),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new Wnr(this._domNode,this.model,r),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),r&&(this._insertButton=this._register(new znr(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new De(new Nv(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new De(new Nv(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new De(new Nv(i===360?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class Vnr extends Ae{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new be,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new be,this.onColorFlushed=this._onColorFlushed.event,this._domNode=Vh(".saturation-wrap"),Ge(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",Ge(this._domNode,this._canvas),this.selection=Vh(".saturation-selection"),Ge(this._domNode,this.selection),this.layout(),this._register(We(this._domNode,Lt.POINTER_DOWN,r=>this.onPointerDown(r))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new xA);const t=Oa(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>this.onDidChangePosition(r.pageX-t.left,r.pageY-t.top),()=>null);const i=We(e.target.ownerDocument,Lt.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),r=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,r),this._onDidChange.fire({s:i,v:r})}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 De(new Nv(e.h,1,1,1)),i=this._canvas.getContext("2d"),r=i.createLinearGradient(0,0,this._canvas.width,0);r.addColorStop(0,"rgba(255, 255, 255, 1)"),r.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),r.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=De.Format.CSS.format(t),i.fill(),i.fillStyle=r,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class SQe extends Ae{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new be,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new be,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=Ge(e,Vh(".standalone-strip")),this.overlay=Ge(this.domNode,Vh(".standalone-overlay"))):(this.domNode=Ge(e,Vh(".strip")),this.overlay=Ge(this.domNode,Vh(".overlay"))),this.slider=Ge(this.domNode,Vh(".slider")),this.slider.style.top="0px",this._register(We(this.domNode,Lt.POINTER_DOWN,r=>this.onPointerDown(r))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new xA),i=Oa(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-i.top),()=>null);const r=We(e.target.ownerDocument,Lt.POINTER_UP,()=>{this._onColorFlushed.fire(),r.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 Hnr extends SQe{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:r}=e.rgba,o=new De(new Yi(t,i,r,1)),s=new De(new Yi(t,i,r,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class Wnr extends SQe{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class znr extends Ae{constructor(e){super(),this._onClicked=this._register(new be),this.onClicked=this._onClicked.event,this._button=Ge(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._button.onclick=t=>{this._onClicked.fire()}}get button(){return this._button}}class jnr extends im{constructor(e,t,i,r,o=!1){super(),this.model=t,this.pixelRatio=i,this._register(SM.onDidChange(()=>this.layout()));const s=Vh(".colorpicker-widget");e.appendChild(s),this.header=this._register(new Fnr(s,this.model,r,o)),this.body=this._register(new $nr(s,this.model,this.pixelRatio,o))}layout(){this.body.layout()}}var EQe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},xQe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},y2=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Unr{constructor(e,t,i,r){this.owner=e,this.range=t,this.model=i,this.provider=r,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let XH=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return ba.fromPromise(this._computeAsync(e,t,i))}_computeAsync(e,t,i){return y2(this,void 0,void 0,function*(){if(!this._editor.hasModel())return[];const r=Cw.get(this._editor);if(!r)return[];for(const o of t){if(!r.isColorDecoration(o))continue;const s=r.getColorData(o.range.getStartPosition());if(s)return[yield kQe(this,this._editor.getModel(),s.colorInfo,s.provider)]}return[]})}renderHoverParts(e,t){return TQe(this,this._editor,this._themeService,t,e)}};XH=EQe([xQe(1,ll)],XH);class qnr{constructor(e,t,i,r){this.owner=e,this.range=t,this.model=i,this.provider=r}}let C4=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}createColorHover(e,t,i){return y2(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!Cw.get(this._editor))return null;const o=yield bQe(i,this._editor.getModel(),Mi.None);let s=null,a=null;for(const d of o){const h=d.colorInfo;q.containsRange(h.range,e.range)&&(s=h,a=d.provider)}const l=s??e,c=a??t,u=!!s;return{colorHover:yield kQe(this,this._editor.getModel(),l,c),foundInEditor:u}})}updateEditorModel(e){return y2(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=e.model;let i=new q(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(yield J8(this._editor.getModel(),t,this._color,i,e),i=IQe(this._editor,i,t))})}renderHoverParts(e,t){return TQe(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};C4=EQe([xQe(1,ll)],C4);function kQe(n,e,t,i){return y2(this,void 0,void 0,function*(){const r=e.getValueInRange(t.range),{red:o,green:s,blue:a,alpha:l}=t.color,c=new Yi(Math.round(o*255),Math.round(s*255),Math.round(a*255),l),u=new De(c),d=yield yQe(e,t,i,Mi.None),h=new Mnr(u,[],0);return h.colorPresentations=d||[],h.guessColorPresentation(u,r),n instanceof XH?new Unr(n,q.lift(t.range),h,i):new qnr(n,q.lift(t.range),h,i)})}function TQe(n,e,t,i,r){if(i.length===0||!e.hasModel())return Ae.None;if(r.setMinimumDimensions){const h=e.getOption(66)+8;r.setMinimumDimensions(new vr(302,h))}const o=new nt,s=i[0],a=e.getModel(),l=s.model,c=o.add(new jnr(r.fragment,l,e.getOption(141),t,n instanceof C4));r.setColorPicker(c);let u=!1,d=new q(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn);if(n instanceof C4){const h=i[0].model.color;n.color=h,J8(a,l,h,d,s),o.add(l.onColorFlushed(g=>{n.color=g}))}else o.add(l.onColorFlushed(h=>y2(this,void 0,void 0,function*(){yield J8(a,l,h,d,s),u=!0,d=IQe(e,d,l,r)})));return o.add(l.onDidChangeColor(h=>{J8(a,l,h,d,s)})),o.add(e.onDidChangeModelContent(h=>{u?u=!1:(r.hide(),e.focus())})),o}function IQe(n,e,t,i){let r,o;if(t.presentation.textEdit){r=[t.presentation.textEdit],o=new q(t.presentation.textEdit.range.startLineNumber,t.presentation.textEdit.range.startColumn,t.presentation.textEdit.range.endLineNumber,t.presentation.textEdit.range.endColumn);const s=n.getModel()._setTrackedRange(null,o,3);n.pushUndoStop(),n.executeEdits("colorpicker",r),o=n.getModel()._getTrackedRange(s)||o}else r=[{range:e,text:t.presentation.label,forceMoveMarkers:!1}],o=e.setEndPosition(e.endLineNumber,e.startColumn+t.presentation.label.length),n.pushUndoStop(),n.executeEdits("colorpicker",r);return t.presentation.additionalTextEdits&&(r=[...t.presentation.additionalTextEdits],n.executeEdits("colorpicker",r),i&&i.hide()),n.pushUndoStop(),o}function J8(n,e,t,i,r){return y2(this,void 0,void 0,function*(){const o=yield yQe(n,{range:i,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},r.provider,Mi.None);e.colorPresentations=o||[]})}function kle(n,e){return!!n[e]}class yJ{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=kle(e.event,t.triggerModifier),this.hasSideBySideModifier=kle(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class MRe{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=kle(e,t.triggerModifier)}}class o${constructor(e,t,i,r){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=r}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function FRe(n){return n==="altKey"?Qi?new o$(57,"metaKey",6,"altKey"):new o$(5,"ctrlKey",6,"altKey"):Qi?new o$(6,"altKey",57,"metaKey"):new o$(6,"altKey",5,"ctrlKey")}class Zq extends Ae{constructor(e,t){var i;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new be),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new be),this.onExecute=this._onExecute.event,this._onCancel=this._register(new be),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(i=t==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&i!==void 0?i:r=>r.target.position?r.target.position.lineNumber:0,this._opts=FRe(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(r=>{if(r.hasChanged(77)){const o=FRe(this._editor.getOption(77));if(this._opts.equals(o))return;this._opts=o,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(r=>this._onEditorMouseMove(new yJ(r,this._opts)))),this._register(this._editor.onMouseDown(r=>this._onEditorMouseDown(new yJ(r,this._opts)))),this._register(this._editor.onMouseUp(r=>this._onEditorMouseUp(new yJ(r,this._opts)))),this._register(this._editor.onKeyDown(r=>this._onEditorKeyDown(new MRe(r,this._opts)))),this._register(this._editor.onKeyUp(r=>this._onEditorKeyUp(new MRe(r,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(r=>this._onDidChangeCursorSelection(r))),this._register(this._editor.onDidChangeModel(r=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(r=>{(r.scrollTopChanged||r.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=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);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 Knr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ey=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let ww=class extends l2{constructor(e,t,i,r,o,s,a,l,c,u,d,h,g){super(e,Object.assign(Object.assign({},r.getRawOptions()),{overflowWidgetsDomNode:r.getOverflowWidgetsDomNode()}),i,o,s,a,l,c,u,d,h,g),this._parentEditor=r,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(r.onDidChangeConfiguration(p=>this._onParentConfigurationChanged(p)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){IU(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};ww=Knr([ey(4,Un),ey(5,Lr),ey(6,Fs),ey(7,Yn),ey(8,ll),ey(9,ga),ey(10,N0),ey(11,xo),ey(12,en)],ww);const BRe=new De(new Yi(0,122,204)),Gnr={showArrow:!0,showFrame:!0,className:"",frameColor:BRe,arrowColor:BRe,keepEditorSelection:!1},Ynr="vs.editor.contrib.zoneWidget";class Qnr{constructor(e,t,i,r,o,s,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=r,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=o,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class Xnr{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class Jq{constructor(e){this._editor=e,this._ruleName=Jq._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),DLe(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(){DLe(this._ruleName),Zoe(`.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){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:q.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}Jq._IdGenerator=new Q_e(".arrow-decoration-");class Znr{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new nt,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=py(t),IU(this.options,Gnr,!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(i=>{const r=this._getWidth(i);this.domNode.style.width=r+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(r)}))}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._positionMarkerId.clear(),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 Jq(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){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const 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&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const i=e-this._decoratingElementsHeight();this.container.style.height=`${i}px`;const r=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(r))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=q.isIRange(e)?q.lift(e):q.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:hi.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(66);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),r=this.editor.getLayoutInfo(),o=this._getWidth(r);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(r)+"px";const s=document.createElement("div");s.style.overflow="hidden";const a=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){const h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}let l=0,c=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(c=Math.round(a/9)),this.editor.changeViewZones(h=>{this._viewZone&&h.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new Qnr(s,i.lineNumber,i.column,t,g=>this._onViewZoneTop(g),g=>this._onViewZoneHeight(g),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new Xnr(Ynr+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"px"}const u=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=u+"px",this.container.style.overflow="hidden"),this._doLayout(u,o),this.options.keepEditorSelection||this.editor.setSelection(e);const d=this.editor.getModel();if(d){const h=d.validateRange(new q(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.startLineNumber===d.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(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;this._resizeSash=this._disposables.add(new kc(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;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){const i=(t.currentY-e.startY)/this.editor.getOption(66),r=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+r;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var LQe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},DQe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const AQe=Vi("IPeekViewService");Zi(AQe,class{constructor(){this._widgets=new Map}addExclusiveWidget(n,e){const t=this._widgets.get(n);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const r=this._widgets.get(n);r&&r.widget===e&&(r.listener.dispose(),this._widgets.delete(n))};this._widgets.set(n,{widget:e,listener:e.onDidClose(i)})}},1);var Dd;(function(n){n.inPeekEditor=new Ft("inReferenceSearchEditor",!0,E("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(Dd||(Dd={}));let w4=class{constructor(e,t){e instanceof ww&&Dd.inPeekEditor.bindTo(t)}dispose(){}};w4.ID="editor.contrib.referenceController";w4=LQe([DQe(1,Yn)],w4);gr(w4.ID,w4,0);function Jnr(n){const e=n.get(Lr).getFocusedCodeEditor();return e instanceof ww?e.getParentEditor():e}const eir={headerBackgroundColor:De.white,primaryHeadingColor:De.fromHex("#333333"),secondaryHeadingColor:De.fromHex("#6c6c6cb3")};let ZH=class extends Znr{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new be,this.onDidClose=this._onDidClose.event,IU(this.options,eir,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){const 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();const 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=at(".head"),this._bodyElement=at(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=at(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),ua(this._titleElement,"click",o=>this._onTitleClick(o))),Ge(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=at("span.filename"),this._secondaryHeading=at("span.dirname"),this._metaHeading=at("span.meta"),Ge(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=at(".peekview-actions");Ge(this._headElement,i);const r=this._getActionBarOptions();this._actionbarWidget=new Ig(i,r),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Gu("peekview.close",E("label.close","Close"),In.asClassName(Ct.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:fYi.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:Gl(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Yd(this._metaHeading)):Au(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(66)*1.2),r=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(r,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`)}};ZH=LQe([DQe(2,Un)],ZH);const tir=re("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:De.black,hcLight:De.white},E("peekViewTitleBackground","Background color of the peek view title area.")),RQe=re("peekViewTitleLabel.foreground",{dark:De.white,light:De.black,hcDark:De.white,hcLight:bp},E("peekViewTitleForeground","Color of the peek view title.")),NQe=re("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},E("peekViewTitleInfoForeground","Color of the peek view title info.")),nir=re("peekView.border",{dark:xd,light:xd,hcDark:ji,hcLight:ji},E("peekViewBorder","Color of the peek view borders and arrow.")),iir=re("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:De.black,hcLight:De.white},E("peekViewResultsBackground","Background color of the peek view result list."));re("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:De.white,hcLight:bp},E("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));re("peekViewResult.fileForeground",{dark:De.white,light:"#1E1E1E",hcDark:De.white,hcLight:bp},E("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));re("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},E("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));re("peekViewResult.selectionForeground",{dark:De.white,light:"#6C6C6C",hcDark:De.white,hcLight:bp},E("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const rC=re("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:De.black,hcLight:De.white},E("peekViewEditorBackground","Background color of the peek view editor."));re("peekViewEditorGutter.background",{dark:rC,light:rC,hcDark:rC,hcLight:rC},E("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));re("peekViewEditorStickyScroll.background",{dark:rC,light:rC,hcDark:rC,hcLight:rC},E("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));re("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},E("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));re("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},E("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));re("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Ho,hcLight:Ho},E("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var rir=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Sw{constructor(e,t,i,r){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=r,this.id=cae.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?E({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"{0} in {1} on line {2} at column {3}",t.value,Tg(this.uri),this.range.startLineNumber,this.range.startColumn):E("aria.oneReference","in {0} on line {1} at column {2}",Tg(this.uri),this.range.startLineNumber,this.range.startColumn)}}class oir{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:r,startColumn:o,endLineNumber:s,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:r,column:o-t}),c=new q(r,l.startColumn,r,o),u=new q(s,a,s,1073741824),d=i.getValueInRange(c).replace(/^\s+/,""),h=i.getValueInRange(e),g=i.getValueInRange(u).replace(/\s+$/,"");return{value:d+h+g,highlight:{start:d.length,end:d.length+h.length}}}}class S4{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Rc}dispose(){Hr(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?E("aria.fileReferences.1","1 symbol in {0}, full path {1}",Tg(this.uri),this.uri.fsPath):E("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,Tg(this.uri),this.uri.fsPath)}resolve(e){return rir(this,void 0,void 0,function*(){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=yield e.createModelReference(t.uri);this._previews.set(t.uri,new oir(i))}catch(i){fi(i)}return this})}}class sh{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new be,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(sh._compareReferences);let r;for(const o of e)if((!r||!Wo.isEqual(r.uri,o.uri,!0))&&(r=new S4(this,o.uri),this.groups.push(r)),r.children.length===0||sh._compareReferences(o,r.children[r.children.length-1])!==0){const s=new Sw(i===o,r,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(s),r.children.push(s)}}dispose(){Hr(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new sh(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?E("aria.result.0","No results found"):this.references.length===1?E("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?E("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):E("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let r=i.children.indexOf(e);const o=i.children.length,s=i.parent.groups.length;return s===1||t&&r+1<o||!t&&r>0?(t?r=(r+1)%o:r=(r+o-1)%o,i.children[r]):(r=i.parent.groups.indexOf(i),t?(r=(r+1)%s,i.parent.groups[r].children[0]):(r=(r+s-1)%s,i.parent.groups[r].children[i.parent.groups[r].children.length-1]))}nearestReference(e,t){const i=this.references.map((r,o)=>({idx:o,prefixLen:Ax(r.uri.toString(),e.toString()),offsetDist:Math.abs(r.range.startLineNumber-t.lineNumber)*100+Math.abs(r.range.startColumn-t.column)})).sort((r,o)=>r.prefixLen>o.prefixLen?-1:r.prefixLen<o.prefixLen?1:r.offsetDist<o.offsetDist?-1:r.offsetDist>o.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&q.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Wo.compare(e.uri,t.uri)||q.compareRangesUsingStarts(e.range,t.range)}}var eK=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},tK=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Tle;let Ile=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof sh||e instanceof S4}getChildren(e){if(e instanceof sh)return e.groups;if(e instanceof S4)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};Ile=eK([tK(0,Pd)],Ile);class sir{getHeight(){return 23}getTemplateId(e){return e instanceof S4?E4.id:U5.id}}let Lle=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof Sw){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return Tg(e.uri)}};Lle=eK([tK(0,mo)],Lle);class air{getId(e){return e instanceof Sw?e.id:e.uri}}let Dle=class extends Ae{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new MH(i,{supportHighlights:!0})),this.badge=new Nae(Ge(i,at(".count")),{},sGe),e.appendChild(i)}set(e,t){const i=hq(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const r=e.children.length;this.badge.setCount(r),r>1?this.badge.setTitleFormat(E("referencesCount","{0} references",r)):this.badge.setTitleFormat(E("referenceCount","{0} reference",r))}};Dle=eK([tK(1,c2)],Dle);let E4=Tle=class{constructor(e){this._instantiationService=e,this.templateId=Tle.id}renderTemplate(e){return this._instantiationService.createInstance(Dle,e)}renderElement(e,t,i){i.set(e.element,D5(e.filterData))}disposeTemplate(e){e.dispose()}};E4.id="FileReferencesRenderer";E4=Tle=eK([tK(0,Un)],E4);class lir{constructor(e){this.label=new FC(e)}set(e,t){var i;const r=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!r||!r.value)this.label.set(`${Tg(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:s}=r;t&&!__.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,D5(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[s]))}}}class U5{constructor(){this.templateId=U5.id}renderTemplate(e){return new lir(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}U5.id="OneReferenceRenderer";class cir{getWidgetAriaLabel(){return E("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var uir=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ty=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},$Re=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class nK{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new nt,this._callOnModelChange=new nt,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(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let r=0,o=e.children.length;r<o;r++){const s=e.children[r];this._decorationIgnoreSet.has(s.id)||s.uri.toString()===this._editor.getModel().uri.toString()&&(t.push({range:s.range,options:nK.DecorationOptions}),i.push(r))}this._editor.changeDecorations(r=>{const o=r.deltaDecorations([],t);for(let s=0;s<o.length;s++)this._decorations.set(o[s],e.children[i[s]])})}_onDecorationChanged(){const e=[],t=this._editor.getModel();if(t){for(const[i,r]of this._decorations){const o=t.getDecorationRange(i);if(!o)continue;let s=!1;if(!q.equalsRange(o,r.range)){if(q.spansMultipleLines(o))s=!0;else{const a=r.range.endColumn-r.range.startColumn,l=o.endColumn-o.startColumn;a!==l&&(s=!0)}s?(this._decorationIgnoreSet.add(r.id),e.push(i)):r.range=o}}for(let i=0,r=e.length;i<r;i++)this._decorations.delete(e[i]);this._editor.removeDecorations(e)}}removeDecorations(){this._editor.removeDecorations([...this._decorations.keys()]),this._decorations.clear()}}nK.DecorationOptions=hi.register({description:"reference-decoration",stickiness:1,className:"reference-decoration"});class dir{constructor(){this.ratio=.7,this.heightInLines=18}static fromJSON(e){let t,i;try{const r=JSON.parse(e);t=r.ratio,i=r.heightInLines}catch{}return{ratio:t||.7,heightInLines:i||18}}}class hir extends Lae{}let Ale=class extends ZH{constructor(e,t,i,r,o,s,a,l,c,u,d,h){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},s),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=o,this._instantiationService=s,this._peekViewService=a,this._uriLabel=l,this._undoRedoService=c,this._keybindingService=u,this._languageService=d,this._languageConfigurationService=h,this._disposeOnNewModel=new nt,this._callOnDispose=new nt,this._onDidSelectReference=new be,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new vr(0,0),this._applyTheme(r.getColorTheme()),this._callOnDispose.add(r.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}dispose(){this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),Hr(this._preview),Hr(this._previewNotAvailableMessage),Hr(this._tree),Hr(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(nir)||De.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(tir)||De.transparent,primaryHeadingColor:e.getColor(RQe),secondaryHeadingColor:e.getColor(NQe)})}show(e){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=Ge(e,at("div.messages")),Au(this._messageContainer),this._splitView=new hGe(e,{orientation:1}),this._previewContainer=Ge(e,at("div.preview.inline"));const t={scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!0},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}};this._preview=this._instantiationService.createInstance(ww,this._previewContainer,t,{},this.editor),Au(this._previewContainer),this._previewNotAvailableMessage=new hb(E("missingPreviewMessage","no preview available"),nf,hb.DEFAULT_CREATION_OPTIONS,null,this._undoRedoService,this._languageService,this._languageConfigurationService),this._treeContainer=Ge(e,at("div.ref-tree.inline"));const i={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new cir,keyboardNavigationLabelProvider:this._instantiationService.createInstance(Lle),identityProvider:new air,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:iir}};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(ua(this._treeContainer,"keydown",o=>{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(hir,"ReferencesWidget",this._treeContainer,new sir,[this._instantiationService.createInstance(E4),this._instantiationService.createInstance(U5)],this._instantiationService.createInstance(Ile),i),this._splitView.addView({onDidChange:Pt.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},RH.Distribute),this._splitView.addView({onDidChange:Pt.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},RH.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const r=(o,s)=>{o instanceof Sw&&(s==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:s,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?r(o.element,"side"):o.editorOptions.pinned?r(o.element,"goto"):r(o.element,"show")}),Au(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new vr(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=E("noResults","No results"),Yd(this._messageContainer),Promise.resolve(void 0)):(Au(this._messageContainer),this._decorationsManager=new nK(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:i}=e;if(t.detail!==2)return;const r=this._getFocusedReference();r&&this._onDidSelectReference.fire({element:{uri:r.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Yd(this._treeContainer),Yd(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof Sw)return e;if(e instanceof S4&&e.children.length>0)return e.children[0]}revealReference(e){return $Re(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return $Re(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==Si.inMemory?this.setTitle(tji(e.uri),this._uriLabel.getUriLabel(hq(e.uri))):this.setTitle(E("peekView.alternateTitle","References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),yield this._tree.expand(e.parent),this._tree.reveal(e));const r=yield i;if(!this._model){r.dispose();return}Hr(this._previewModelReference);const o=r.object;if(o){const s=this._preview.getModel()===o.textEditorModel?0:1,a=q.lift(e.range).collapseToStart();this._previewModelReference=r,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,s)}else this._preview.setModel(this._previewNotAvailableMessage),r.dispose()})}};Ale=uir([ty(3,ll),ty(4,Pd),ty(5,Un),ty(6,AQe),ty(7,c2),ty(8,fq),ty(9,mo),ty(10,Qo),ty(11,xo)],Ale);var fir=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},VT=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},VRe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},e9;const Uk=new Ft("referenceSearchVisible",!1,E("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let Ew=e9=class{static get(e){return e.getContribution(e9.ID)}constructor(e,t,i,r,o,s,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=r,this._notificationService=o,this._instantiationService=s,this._storageService=a,this._configurationService=l,this._disposables=new nt,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=Uk.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let r;if(this._widget&&(r=this._widget.position),this.closeWidget(),r&&e.containsPosition(r))return;this._peekMode=i,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",s=dir.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(Ale,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(E("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(l=>{const{element:c,kind:u}=l;if(c)switch(u){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(c,!1,!1);break;case"side":this.openReference(c,!0,!1);break;case"goto":i?this._gotoReference(c,!0):this.openReference(c,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var c;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(c=this._model)===null||c===void 0||c.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(E("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const u=this._editor.getModel().uri,d=new Ce(e.startLineNumber,e.startColumn),h=this._model.nearestReference(u,d);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(86)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return VRe(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const r=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(r),yield this._gotoReference(r,!1),o?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()})}revealReference(e){return VRe(this,void 0,void 0,function*(){!this._editor.hasModel()||!this._model||!this._widget||(yield this._widget.revealReference(e))})}closeWidget(e=!0){var t,i;(t=this._widget)===null||t===void 0||t.dispose(),(i=this._model)===null||i===void 0||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){var i;(i=this._widget)===null||i===void 0||i.hide(),this._ignoreModelChangeEvent=!0;const r=q.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:r,selectionSource:"code.jump",pinned:t}},this._editor).then(o=>{var s;if(this._ignoreModelChangeEvent=!1,!o||!this._widget){this.closeWidget();return}if(this._editor===o)this._widget.show(r),this._widget.focusOnReferenceTree();else{const a=e9.get(o),l=this._model.clone();this.closeWidget(),o.focus(),a==null||a.toggleWidget(r,za(c=>Promise.resolve(l)),(s=this._peekMode)!==null&&s!==void 0?s:!1)}},o=>{this._ignoreModelChangeEvent=!1,fi(o)})}openReference(e,t,i){t||this.closeWidget();const{uri:r,range:o}=e;this._editorService.openCodeEditor({resource:r,options:{selection:o,selectionSource:"code.jump",pinned:i}},this._editor,t)}};Ew.ID="editor.contrib.referencesController";Ew=e9=fir([VT(2,Yn),VT(3,Lr),VT(4,ga),VT(5,Un),VT(6,am),VT(7,Ui)],Ew);function qk(n,e){const t=Jnr(n);if(!t)return;const i=Ew.get(t);i&&e(i)}Ld.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Ma(2089,60),when:Ke.or(Uk,Dd.inPeekEditor),handler(n){qk(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Ld.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:Ke.or(Uk,Dd.inPeekEditor),handler(n){qk(n,e=>{e.goToNextOrPreviousReference(!0)})}});Ld.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:Ke.or(Uk,Dd.inPeekEditor),handler(n){qk(n,e=>{e.goToNextOrPreviousReference(!1)})}});Xi.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");Xi.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");Xi.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");Xi.registerCommand("closeReferenceSearch",n=>qk(n,e=>e.closeWidget()));Ld.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:Ke.and(Dd.inPeekEditor,Ke.not("config.editor.stablePeek"))});Ld.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:Ke.and(Uk,Ke.not("config.editor.stablePeek"))});Ld.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:Ke.and(Uk,TGe,hve.negate(),fve.negate()),handler(n){var e;const i=(e=n.get($g).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Sw&&qk(n,r=>r.revealReference(i[0]))}});Ld.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:Ke.and(Uk,TGe,hve.negate(),fve.negate()),handler(n){var e;const i=(e=n.get($g).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Sw&&qk(n,r=>r.openReference(i[0],!0,!0))}});Xi.registerCommand("openReference",n=>{var e;const i=(e=n.get($g).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof Sw&&qk(n,r=>r.openReference(i[0],!1,!0))});var OQe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},HN=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const Uve=new Ft("hasSymbols",!1,E("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),iK=Vi("ISymbolNavigationService");let Rle=class{constructor(e,t,i,r){this._editorService=t,this._notificationService=i,this._keybindingService=r,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=Uve.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new Nle(this._editorService),r=i.onDidChange(o=>{if(this._ignoreEditorChange)return;const s=this._editorService.getActiveCodeEditor();if(!s)return;const a=s.getModel(),l=s.getPosition();if(!a||!l)return;let c=!1,u=!1;for(const d of t.references)if(C_e(d.uri,a.uri))c=!0,u=u||q.containsPosition(d.range,l);else if(c)break;(!c||!u)&&this.reset()});this._currentState=Ip(i,r)}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:q.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?E("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):E("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};Rle=OQe([HN(0,Yn),HN(1,Lr),HN(2,ga),HN(3,mo)],Rle);Zi(iK,Rle,1);Et(new class extends kl{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:Uve,kbOpts:{weight:100,primary:70}})}runEditorCommand(n,e){return n.get(iK).revealNext(e)}});Ld.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:Uve,primary:9,handler(n){n.get(iK).reset()}});let Nle=class{constructor(e){this._listener=new Map,this._disposables=new nt,this._onDidChange=new be,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(),Hr(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Ip(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};Nle=OQe([HN(0,Lr)],Nle);var qve=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function q5(n,e,t,i){return qve(this,void 0,void 0,function*(){const o=t.ordered(n).map(a=>Promise.resolve(i(a,n,e)).then(void 0,l=>{Sa(l)})),s=yield Promise.all(o);return ob(s.flat())})}function rK(n,e,t,i){return q5(e,t,n,(r,o,s)=>r.provideDefinition(o,s,i))}function PQe(n,e,t,i){return q5(e,t,n,(r,o,s)=>r.provideDeclaration(o,s,i))}function MQe(n,e,t,i){return q5(e,t,n,(r,o,s)=>r.provideImplementation(o,s,i))}function FQe(n,e,t,i){return q5(e,t,n,(r,o,s)=>r.provideTypeDefinition(o,s,i))}function oK(n,e,t,i,r){return q5(e,t,n,(o,s,a)=>qve(this,void 0,void 0,function*(){const l=yield o.provideReferences(s,a,{includeDeclaration:!0},r);if(!i||!l||l.length!==2)return l;const c=yield o.provideReferences(s,a,{includeDeclaration:!1},r);return c&&c.length===1?c:l}))}function K5(n){return qve(this,void 0,void 0,function*(){const e=yield n(),t=new sh(e,""),i=t.references.map(r=>r.link);return t.dispose(),i})}Ib("_executeDefinitionProvider",(n,e,t)=>{const i=n.get(en),r=rK(i.definitionProvider,e,t,Mi.None);return K5(()=>r)});Ib("_executeTypeDefinitionProvider",(n,e,t)=>{const i=n.get(en),r=FQe(i.typeDefinitionProvider,e,t,Mi.None);return K5(()=>r)});Ib("_executeDeclarationProvider",(n,e,t)=>{const i=n.get(en),r=PQe(i.declarationProvider,e,t,Mi.None);return K5(()=>r)});Ib("_executeReferenceProvider",(n,e,t)=>{const i=n.get(en),r=oK(i.referenceProvider,e,t,!1,Mi.None);return K5(()=>r)});Ib("_executeImplementationProvider",(n,e,t)=>{const i=n.get(en),r=MQe(i.implementationProvider,e,t,Mi.None);return K5(()=>r)});var Ap=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},JR,eN,tN,s$,a$,l$,c$,u$;jl.appendMenuItem(J.EditorContext,{submenu:J.EditorContextPeek,title:E("peek.submenu","Peek"),group:"navigation",order:100});class C2{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof C2||Ce.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class ou extends N_{static all(){return ou._allSymbolNavigationCommands.values()}static _patchConfig(e){const t=Object.assign(Object.assign({},e),{f1:!0});if(t.menu)for(const i of Pi.wrap(t.menu))(i.id===J.EditorContext||i.id===J.EditorContextPeek)&&(i.when=Ke.and(e.precondition,i.when));return t}constructor(e,t){super(ou._patchConfig(t)),this.configuration=e,ou._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,r){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(ga),s=e.get(Lr),a=e.get(iS),l=e.get(iK),c=e.get(en),u=e.get(Un),d=t.getModel(),h=t.getPosition(),g=C2.is(i)?i:new C2(d,h),p=new bw(t,5),m=jU(this._getLocationModel(c,g.model,g.position,p.token),p.token).then(_=>Ap(this,void 0,void 0,function*(){var v;if(!_||p.token.isCancellationRequested)return;Pc(_.ariaMessage);let b;if(_.referenceAt(d.uri,h)){const C=this._getAlternativeCommand(t);!ou._activeAlternativeCommands.has(C)&&ou._allSymbolNavigationCommands.has(C)&&(b=ou._allSymbolNavigationCommands.get(C))}const y=_.references.length;if(y===0){if(!this.configuration.muteMessage){const C=d.getWordAtPosition(h);(v=oh.get(t))===null||v===void 0||v.showMessage(this._getNoResultFoundMessage(C),h)}}else if(y===1&&b)ou._activeAlternativeCommands.add(this.desc.id),u.invokeFunction(C=>b.runEditorCommand(C,t,i,r).finally(()=>{ou._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(s,l,t,_,r)}),_=>{o.error(_)}).finally(()=>{p.dispose()});return a.showWhile(m,250),m}_onResult(e,t,i,r,o){return Ap(this,void 0,void 0,function*(){const s=this._getGoToPreference(i);if(!(i instanceof ww)&&(this.configuration.openInPeek||s==="peek"&&r.references.length>1))this._openInPeek(i,r,o);else{const a=r.firstReference(),l=r.references.length>1&&s==="gotoAndPeek",c=yield this._openReference(i,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,r,o):r.dispose(),s==="goto"&&t.put(a)}})}_openReference(e,t,i,r,o){return Ap(this,void 0,void 0,function*(){let s;if(y6i(i)&&(s=i.targetSelectionRange),s||(s=i.range),!s)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:q.collapseToStart(s),selectionRevealType:3,selectionSource:"code.jump"}},e,r);if(a){if(o){const l=a.getModel(),c=a.createDecorationsCollection([{range:s,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}})}_openInPeek(e,t,i){const r=Ew.get(e);r&&e.hasModel()?r.toggleWidget(i??e.getSelection(),za(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}ou._allSymbolNavigationCommands=new Map;ou._activeAlternativeCommands=new Set;class G5 extends ou{_getLocationModel(e,t,i,r){return Ap(this,void 0,void 0,function*(){return new sh(yield rK(e.definitionProvider,t,i,r),E("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?E("noResultWord","No definition found for '{0}'",e.word):E("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}jo((JR=class extends G5{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:JR.id,title:{value:E("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:E({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:Ke.and(ee.hasDefinitionProvider,ee.isInWalkThroughSnippet.toNegated()),keybinding:[{when:ee.editorTextFocus,primary:70,weight:100},{when:Ke.and(ee.editorTextFocus,EGe),primary:2118,weight:100}],menu:[{id:J.EditorContext,group:"navigation",order:1.1},{id:J.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Xi.registerCommandAlias("editor.action.goToDeclaration",JR.id)}},JR.id="editor.action.revealDefinition",JR));jo((eN=class extends G5{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:eN.id,title:{value:E("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:Ke.and(ee.hasDefinitionProvider,ee.isInWalkThroughSnippet.toNegated()),keybinding:[{when:ee.editorTextFocus,primary:Ma(2089,70),weight:100},{when:Ke.and(ee.editorTextFocus,EGe),primary:Ma(2089,2118),weight:100}]}),Xi.registerCommandAlias("editor.action.openDeclarationToTheSide",eN.id)}},eN.id="editor.action.revealDefinitionAside",eN));jo((tN=class extends G5{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:tN.id,title:{value:E("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:Ke.and(ee.hasDefinitionProvider,Dd.notInPeekEditor,ee.isInWalkThroughSnippet.toNegated()),keybinding:{when:ee.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:J.EditorContextPeek,group:"peek",order:2}}),Xi.registerCommandAlias("editor.action.previewDeclaration",tN.id)}},tN.id="editor.action.peekDefinition",tN));class BQe extends ou{_getLocationModel(e,t,i,r){return Ap(this,void 0,void 0,function*(){return new sh(yield PQe(e.declarationProvider,t,i,r),E("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?E("decl.noResultWord","No declaration found for '{0}'",e.word):E("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}jo((s$=class extends BQe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:s$.id,title:{value:E("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:E({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:Ke.and(ee.hasDeclarationProvider,ee.isInWalkThroughSnippet.toNegated()),menu:[{id:J.EditorContext,group:"navigation",order:1.3},{id:J.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?E("decl.noResultWord","No declaration found for '{0}'",e.word):E("decl.generic.noResults","No declaration found")}},s$.id="editor.action.revealDeclaration",s$));jo(class extends BQe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:E("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:Ke.and(ee.hasDeclarationProvider,Dd.notInPeekEditor,ee.isInWalkThroughSnippet.toNegated()),menu:{id:J.EditorContextPeek,group:"peek",order:3}})}});class $Qe extends ou{_getLocationModel(e,t,i,r){return Ap(this,void 0,void 0,function*(){return new sh(yield FQe(e.typeDefinitionProvider,t,i,r),E("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?E("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):E("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}jo((a$=class extends $Qe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:a$.ID,title:{value:E("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:E({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:Ke.and(ee.hasTypeDefinitionProvider,ee.isInWalkThroughSnippet.toNegated()),keybinding:{when:ee.editorTextFocus,primary:0,weight:100},menu:[{id:J.EditorContext,group:"navigation",order:1.4},{id:J.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},a$.ID="editor.action.goToTypeDefinition",a$));jo((l$=class extends $Qe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:l$.ID,title:{value:E("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:Ke.and(ee.hasTypeDefinitionProvider,Dd.notInPeekEditor,ee.isInWalkThroughSnippet.toNegated()),menu:{id:J.EditorContextPeek,group:"peek",order:4}})}},l$.ID="editor.action.peekTypeDefinition",l$));class VQe extends ou{_getLocationModel(e,t,i,r){return Ap(this,void 0,void 0,function*(){return new sh(yield MQe(e.implementationProvider,t,i,r),E("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?E("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):E("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}jo((c$=class extends VQe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:c$.ID,title:{value:E("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:E({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:Ke.and(ee.hasImplementationProvider,ee.isInWalkThroughSnippet.toNegated()),keybinding:{when:ee.editorTextFocus,primary:2118,weight:100},menu:[{id:J.EditorContext,group:"navigation",order:1.45},{id:J.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},c$.ID="editor.action.goToImplementation",c$));jo((u$=class extends VQe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:u$.ID,title:{value:E("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:Ke.and(ee.hasImplementationProvider,Dd.notInPeekEditor,ee.isInWalkThroughSnippet.toNegated()),keybinding:{when:ee.editorTextFocus,primary:3142,weight:100},menu:{id:J.EditorContextPeek,group:"peek",order:5}})}},u$.ID="editor.action.peekImplementation",u$));class HQe extends ou{_getNoResultFoundMessage(e){return e?E("references.no","No references found for '{0}'",e.word):E("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}jo(class extends HQe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:E("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:E({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:Ke.and(ee.hasReferenceProvider,Dd.notInPeekEditor,ee.isInWalkThroughSnippet.toNegated()),keybinding:{when:ee.editorTextFocus,primary:1094,weight:100},menu:[{id:J.EditorContext,group:"navigation",order:1.45},{id:J.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,t,i,r){return Ap(this,void 0,void 0,function*(){return new sh(yield oK(e.referenceProvider,t,i,!0,r),E("ref.title","References"))})}});jo(class extends HQe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:E("references.action.label","Peek References"),original:"Peek References"},precondition:Ke.and(ee.hasReferenceProvider,Dd.notInPeekEditor,ee.isInWalkThroughSnippet.toNegated()),menu:{id:J.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i,r){return Ap(this,void 0,void 0,function*(){return new sh(yield oK(e.referenceProvider,t,i,!1,r),E("ref.title","References"))})}});class gir extends ou{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:E("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:Ke.and(Dd.notInPeekEditor,ee.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i,r){return Ap(this,void 0,void 0,function*(){return new sh(this._references,E("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&E("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}Xi.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:Tn},{name:"position",description:"The position at which to start",constraint:Ce.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:(n,e,t,i,r,o,s)=>Ap(void 0,void 0,void 0,function*(){to(Tn.isUri(e)),to(Ce.isIPosition(t)),to(Array.isArray(i)),to(typeof r>"u"||typeof r=="string"),to(typeof s>"u"||typeof s=="boolean");const a=n.get(Lr),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(mb(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const u=new class extends gir{_getNoResultFoundMessage(d){return o||super._getNoResultFoundMessage(d)}}({muteMessage:!o,openInPeek:!!s,openToSide:!1},i,r);c.get(Un).invokeFunction(u.run.bind(u),l)})})});Xi.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:Tn},{name:"position",description:"The position at which to start",constraint:Ce.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:(n,e,t,i,r)=>Ap(void 0,void 0,void 0,function*(){n.get(Fs).executeCommand("editor.action.goToLocations",e,t,i,r,void 0,!0)})});Xi.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{to(Tn.isUri(e)),to(Ce.isIPosition(t));const i=n.get(en),r=n.get(Lr);return r.openCodeEditor({resource:e},r.getFocusedCodeEditor()).then(o=>{if(!mb(o)||!o.hasModel())return;const s=Ew.get(o);if(!s)return;const a=za(c=>oK(i.referenceProvider,o.getModel(),Ce.lift(t),!1,c).then(u=>new sh(u,E("ref.title","References")))),l=new q(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(s.toggleWidget(l,a,!1))})}});Xi.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var pir=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},CJ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},HRe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},WN;let Qx=WN=class{constructor(e,t,i,r){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=r,this.toUnhook=new nt,this.toUnhookForKeyboard=new nt,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new Zq(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([s,a])=>{this.startFindDefinitionFromMouse(s,a??void 0)})),this.toUnhook.add(o.onExecute(s=>{this.isEnabled(s)&&this.gotoDefinition(s.target.position,s.hasSideBySideModifier).catch(a=>{fi(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(WN.ID)}startFindDefinitionFromCursor(e){return HRe(this,void 0,void 0,function*(){yield this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))})}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}startFindDefinition(e){var t;return HRe(this,void 0,void 0,function*(){this.toUnhookForKeyboard.clear();const i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;const r=new hYe(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=za(a=>this.findDefinition(e,a));let o;try{o=yield this.previousPromise}catch(a){fi(a);return}if(!o||!o.length||!r.validate(this.editor)){this.removeLinkDecorations();return}const s=o[0].originSelectionRange?q.lift(o[0].originSelectionRange):new q(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(o.length>1){let a=s;for(const{originSelectionRange:l}of o)l&&(a=q.plusRange(a,l));this.addDecoration(a,new hc().appendText(E("multipleResults","Click to show {0} definitions.",o.length)))}else{const a=o[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:c}}=l,{startLineNumber:u}=a.range;if(u<1||u>c.getLineCount()){l.dispose();return}const d=this.getPreviewValue(c,u,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(s,d?new hc().appendCodeblock(h||"",d):void 0),l.dispose()})}})}getPreviewValue(e,t,i){let r=i.range;return r.endLineNumber-r.startLineNumber>=WN.MAX_SOURCE_PREVIEW_LINES&&(r=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,r)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a<i.endLineNumber;a++){const l=e.getLineFirstNonWhitespaceColumn(a);o=Math.min(o,l)}return e.getValueInRange(i).replace(new RegExp(`^\\s{${o-1}}`,"gm"),"").trim()}getPreviewRangeBasedOnIndentation(e,t){const i=e.getLineFirstNonWhitespaceColumn(t),r=Math.min(e.getLineCount(),t+WN.MAX_SOURCE_PREVIEW_LINES);let o=t+1;for(;o<r;o++){const s=e.getLineFirstNonWhitespaceColumn(o);if(i===s)break}return new q(t,1,o+1,1)}addDecoration(e,t){const i={range:e,options:{description:"goto-definition-link",inlineClassName:"goto-definition-link",hoverMessage:t}};this.linkDecorations.set([i])}removeLinkDecorations(){this.linkDecorations.clear()}isEnabled(e,t){var i;return this.editor.hasModel()&&e.isLeftClick&&e.isNoneOrSingleMouseDown&&e.target.type===6&&!(((i=e.target.detail.injectedText)===null||i===void 0?void 0:i.options)instanceof vw)&&(e.hasTriggerModifier||(t?t.keyCodeIsTriggerKey:!1))&&this.languageFeaturesService.definitionProvider.has(this.editor.getModel())}findDefinition(e,t){const i=this.editor.getModel();return i?rK(this.languageFeaturesService.definitionProvider,i,e,t):Promise.resolve(null)}gotoDefinition(e,t){return this.editor.setPosition(e),this.editor.invokeWithinContext(i=>{const r=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(i);return new G5({openToSide:t,openInPeek:r,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Yn);return Dd.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};Qx.ID="editor.contrib.gotodefinitionatposition";Qx.MAX_SOURCE_PREVIEW_LINES=8;Qx=WN=pir([CJ(1,Pd),CJ(2,Qo),CJ(3,en)],Qx);gr(Qx.ID,Qx,2);const d$=at;class WQe extends Ae{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 S5(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class Kve extends Ae{static render(e,t,i){return new Kve(e,t,i)}constructor(e,t,i){super(),this.actionContainer=Ge(e,d$("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=Ge(this.actionContainer,d$("a.action")),this.action.setAttribute("role","button"),t.iconClass&&Ge(this.action,d$(`span.icon.${t.iconClass}`));const r=Ge(this.action,d$("span"));r.textContent=i?`${t.label} (${i})`:t.label,this._register(We(this.actionContainer,Lt.CLICK,o=>{o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer)})),this._register(We(this.actionContainer,Lt.KEY_DOWN,o=>{const s=new Oo(o);(s.equals(3)||s.equals(10))&&(o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function mir(n,e){return n&&e?E("acessibleViewHint","Inspect this in the accessible view with {0}.",e):n?E("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}var _ir=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},vir=globalThis&&globalThis.__asyncValues||function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof __values=="function"?__values(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=n[o]&&function(s){return new Promise(function(a,l){s=n[o](s),r(a,l,s.done,s.value)})}}function r(o,s,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},s)}};let bir=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class zQe extends Ae{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new be),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new so(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new so(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new so(()=>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(60).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=w$i(e=>this._computer.computeAsync(e)),_ir(this,void 0,void 0,function*(){var e,t,i,r;try{try{for(var o=!0,s=vir(this._asyncIterable),a;a=yield s.next(),e=a.done,!e;o=!0){r=a.value,o=!1;const l=r;l&&(this._result.push(l),this._fireResult())}}catch(l){t={error:l}}finally{try{!o&&!e&&(i=s.return)&&(yield i.call(s))}finally{if(t)throw t.error}}this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(l){fi(l)}})):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){this._state===3&&this._setState(4)}_fireResult(){if(this._state===1||this._state===2)return;const e=this._state===0,t=this._state===4;this._onResult.fire(new bir(this._result.slice(0),e,t))}start(e){if(e===0)this._state===0&&(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();break}}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 wJ{constructor(e,t,i,r){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=r,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class t9{constructor(e,t,i,r,o,s){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=r,this.initialMousePosY=o,this.supportsMarkerHover=s,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}const Kk=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class Gve{constructor(){this._onDidWillResize=new be,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new be,this.onDidResize=this._onDidResize.event,this._sashListener=new nt,this._size=new vr(0,0),this._minSize=new vr(0,0),this._maxSize=new vr(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new kc(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new kc(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new kc(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:DH.North}),this._southSash=new kc(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:DH.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(Pt.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(Pt.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(r=>{e&&(i=r.currentX-r.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(r=>{e&&(i=-(r.currentX-r.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(r=>{e&&(t=-(r.currentY-r.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(r=>{e&&(t=r.currentY-r.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(Pt.any(this._eastSash.onDidReset,this._westSash.onDidReset)(r=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(Pt.any(this._northSash.onDidReset,this._southSash.onDidReset)(r=>{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,i,r){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=r?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:r}=this._minSize,{height:o,width:s}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(r,Math.min(s,t));const a=new vr(t,e);vr.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,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}}const yir=30,Cir=24;class wir extends Ae{constructor(e,t=new vr(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new Gve),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=vr.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new vr(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?Ce.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:Oa(t).top+i.top-yir}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const r=Oa(t),o=CA(t.ownerDocument.body),s=r.top+i.top+i.height;return o.height-s-Cir}_findPositionPreference(e,t){var i,r;const o=Math.min((i=this._availableVerticalSpaceBelow(t))!==null&&i!==void 0?i:1/0,e),s=Math.min((r=this._availableVerticalSpaceAbove(t))!==null&&r!==void 0?r:1/0,e),a=Math.min(Math.max(s,o),e),l=Math.min(e,a);let c;return this._editor.getOption(60).above?c=l<=s?1:2:c=l<=o?2:1,c===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),c}_resize(e){this._resizableNode.layout(e.height,e.width)}}var Yve=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},PE=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},n9,J_;const WRe=at;let JH=n9=class extends Ae{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(VC,this._editor)),this._participants=[];for(const r of Kk.getAll())this._participants.push(this._instantiationService.createInstance(r,this._editor));this._participants.sort((r,o)=>r.hoverOrdinal-o.hoverOrdinal),this._computer=new tW(this._editor,this._participants),this._hoverOperation=this._register(new zQe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(r=>{if(!this._computer.anchor)return;const o=r.hasLoadingMessage?this._addLoadingMessage(r.value):r.value;this._withResult(new jQe(this._computer.anchor,o,r.isComplete))})),this._register(ua(this._widget.getDomNode(),"keydown",r=>{r.equals(9)&&this.hide()})),this._register(ps.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}get widget(){return this._widget}maybeShowAt(e){if(this._widget.isResizing)return!0;const t=[];for(const r of this._participants)if(r.suggestHoverAnchor){const o=r.suggestHoverAnchor(e);o&&t.push(o)}const i=e.target;if(i.type===6&&t.push(new wJ(0,i.range,e.event.posx,e.event.posy)),i.type===7){const r=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToText<r&&t.push(new wJ(0,i.range,e.event.posx,e.event.posy))}return t.length===0?this._startShowingOrUpdateHover(null,0,0,!1,e):(t.sort((r,o)=>o.priority-r.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,r){this._startShowingOrUpdateHover(new wJ(0,e,void 0,void 0),t,i,r,null)}_startShowingOrUpdateHover(e,t,i,r,o){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,r,!1),!0):!1:this._editor.getOption(60).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,r,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,r,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,r,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,r,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=r,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:r,highlightRange:o}=n9.computeHoverRanges(this._editor,e.range,t),s=new nt,a=s.add(new eW(this._keybindingService)),l=document.createDocumentFragment();let c=null;const u={fragment:l,statusBar:a,setColorPicker:h=>c=h,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:h=>this._widget.setMinimumDimensions(h),hide:()=>this.hide()};for(const h of this._participants){const g=t.filter(p=>p.owner===h);g.length>0&&s.add(h.renderHoverParts(u,g))}const d=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(o){const h=this._editor.createDecorationsCollection();h.set([{range:o,options:n9._DECORATION_OPTIONS}]),s.add(Gn(()=>{h.clear()}))}this._widget.showAt(l,new Eir(c,i,r,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,d,e.initialMousePosX,e.initialMousePosY,s))}else s.dispose()}static computeHoverRanges(e,t,i){let r=1;if(e.hasModel()){const c=e._getViewModel(),u=c.coordinatesConverter,d=u.convertModelRangeToViewRange(t),h=new Ce(d.startLineNumber,c.getLineMinColumn(d.startLineNumber));r=u.convertViewPositionToModelPosition(h).column}const o=t.startLineNumber;let s=t.startColumn,a=i[0].range,l=null;for(const c of i)a=q.plusRange(a,c.range),c.range.startLineNumber===o&&c.range.endLineNumber===o&&(s=Math.max(Math.min(s,c.range.startColumn),r)),c.forceShowAtRange&&(l=c.range);return{showAtPosition:l?l.getStartPosition():new Ce(o,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new Ce(o,s),highlightRange:a}}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}};JH._DECORATION_OPTIONS=hi.register({description:"content-hover-highlight",className:"hoverHighlight"});JH=n9=Yve([PE(1,Un),PE(2,mo)],JH);class jQe{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new Sir(this,this.anchor,t,this.isComplete)}}class Sir extends jQe{constructor(e,t,i,r){super(t,i,r),this.original=e}filter(e){return this.original.filter(e)}}class Eir{constructor(e,t,i,r,o,s,a,l,c,u){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=i,this.preferAbove=r,this.stoleFocus=o,this.source=s,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=c,this.disposables=u,this.closestMouseDistance=void 0}}const zRe=30,SJ=10,xir=6;let VC=J_=class extends wir{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,i,r,o){const s=e.getOption(66)+8,a=150,l=new vr(a,s);super(e,l),this._configurationService=i,this._accessibilityService=r,this._keybindingService=o,this._hover=this._register(new WQe),this._minimumSize=l,this._hoverVisibleKey=ee.hoverVisible.bindTo(t),this._hoverFocusedKey=ee.hoverFocused.bindTo(t),Ge(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>this._layout())),this._register(this._editor.onDidChangeConfiguration(u=>{u.hasChanged(50)&&this._updateFont()}));const c=this._register(lb(this._resizableNode.domNode));this._register(c.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(c.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._layout(),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return J_.ID}static _applyDimensions(e,t,i){const r=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.width=r,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return J_._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return J_._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const r=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.maxWidth=r,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){J_._applyMaxDimensions(this._hover.contentsDomNode,e,t),J_._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,i-SJ))}_updateResizableNodeMaxDimensions(){var e,t;const i=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,r=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new vr(i,r),this._setHoverWidgetMaxDimensions(i,r)}_resize(e){var t,i;J_._lastDimensions=new vr(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(i=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||i===void 0||i.layout()}_findAvailableSpaceVertically(){var e;const t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=xir;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),this._hasHorizontalScrollbar()&&(t+=SJ),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth<t?CA(this._hover.containerDomNode.ownerDocument.body).width-14:this._hover.containerDomNode.clientWidth+2}isMouseGettingCloser(e,t){if(!this._visibleData)return!1;if(typeof this._visibleData.initialMousePosX>"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=Oa(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=jRe(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const r=jRe(e,t,i.left,i.top,i.width,i.height);return r>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,r),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_layout(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,this._updateMaxDimensions()}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,J_._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,J_._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var i,r,o,s;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=TE(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(i=this._findPositionPreference(a,l))!==null&&i!==void 0?i:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(r=t.colorPicker)===null||r===void 0||r.layout();const c=mir(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(s=(o=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||o===void 0?void 0:o.getAriaLabel())!==null&&s!==void 0?s:"");c&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+c)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new vr(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(e){var t;const i=this._hover.containerDomNode,r=this._hover.contentsDomNode,o=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(_d(i),Math.min(o,e)),this._setContentsDomNodeDimensions(_d(r),Math.min(o,e-SJ))}setMinimumDimensions(e){this._minimumSize=new vr(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new vr(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=TE(t),r=_d(t);if(this._resizableNode.layout(i,r),this._setHoverWidgetDimensions(r,i),i=TE(t),r=_d(t),this._contentWidth=r,this._updateMinimumWidth(),this._resizableNode.layout(i,r),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(i)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const o=TE(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(o,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-zRe})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+zRe})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};VC.ID="editor.contrib.resizableContentHoverWidget";VC._lastDimensions=new vr(0,0);VC=J_=Yve([PE(1,Yn),PE(2,Ui),PE(3,N0),PE(4,mo)],VC);let eW=class extends Ae{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=WRe("div.hover-row.status-bar"),this.actionsElement=Ge(this.hoverElement,WRe("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(Kve.render(this.actionsElement,e,i))}append(e){const t=Ge(this.actionsElement,e);return this._hasContent=!0,t}};eW=Yve([PE(0,mo)],eW);class tW{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const i=e.getModel(),r=t.range.startLineNumber;if(r>i.getLineCount())return[];const o=i.getLineMaxColumn(r);return e.getLineDecorations(r).filter(s=>{if(s.options.isWholeLine)return!0;const a=s.range.startLineNumber===r?s.range.startColumn:1,l=s.range.endLineNumber===r?s.range.endColumn:o;if(s.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return ba.EMPTY;const i=tW._getLineDecorations(this._editor,t);return ba.merge(this._participants.map(r=>r.computeAsync?r.computeAsync(t,i,e):ba.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=tW._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return ob(t)}}function jRe(n,e,t,i,r,o){const s=t+r/2,a=i+o/2,l=Math.max(Math.abs(n-s)-r/2,0),c=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(l*l+c*c)}const URe=at;class KL extends Ae{constructor(e,t,i){super(),this._renderDisposeables=this._register(new nt),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new WQe),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new w0({editor:this._editor},t,i)),this._computer=new kir(this._editor),this._hoverOperation=this._register(new zQe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(r=>{this._withResult(r.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return KL.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_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 i=document.createDocumentFragment();for(const r of t){const o=URe("div.hover-row.markdown-hover"),s=Ge(o,URe("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(r.value));s.appendChild(a.element),i.appendChild(o)}this._updateContents(i),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(),i=this._editor.getTopForLineNumber(e),r=this._editor.getScrollTop(),o=this._editor.getOption(66),s=this._hover.containerDomNode.clientHeight,a=i-r-(s-o)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}KL.ID="editor.contrib.modesGlyphHoverWidget";class kir{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=r=>({value:r}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const r of t){if(!r.options.glyphMarginClassName)continue;const o=r.options.glyphMarginHoverMessage;!o||h2(o)||i.push(...pme(o).map(e))}return i}}var Tir=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Iir{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}function Lir(n,e,t,i,r){return Tir(this,void 0,void 0,function*(){try{const o=yield Promise.resolve(n.provideHover(t,i,r));if(o&&Air(o))return new Iir(n,o,e)}catch(o){Sa(o)}})}function Qve(n,e,t,i){const o=n.ordered(e).map((s,a)=>Lir(s,a,e,t,i));return ba.fromPromises(o).coalesce()}function Dir(n,e,t,i){return Qve(n,e,t,i).map(r=>r.hover).toPromise()}Ib("_executeHoverProvider",(n,e,t)=>{const i=n.get(en);return Dir(i.hoverProvider,e,t,Mi.None)});function Air(n){const e=typeof n.range<"u",t=typeof n.contents<"u"&&n.contents&&n.contents.length>0;return e&&t}var Rir=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},h$=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const qRe=at;class Xm{constructor(e,t,i,r,o){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=r,this.ordinal=o}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let nW=class{constructor(e,t,i,r,o){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=r,this._languageFeaturesService=o,this.hoverOrdinal=3}createLoadingMessage(e){return new Xm(this,e.range,[new hc().appendText(E("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),r=e.range.startLineNumber,o=i.getLineMaxColumn(r),s=[];let a=1e3;const l=i.getLineLength(r),c=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),u=this._editor.getOption(116),d=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});let h=!1;u>=0&&l>u&&e.range.startColumn>=u&&(h=!0,s.push(new Xm(this,e.range,[{value:E("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof d=="number"&&l>=d&&s.push(new Xm(this,e.range,[{value:E("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let g=!1;for(const p of t){const m=p.range.startLineNumber===r?p.range.startColumn:1,_=p.range.endLineNumber===r?p.range.endColumn:o,v=p.options.hoverMessage;if(!v||h2(v))continue;p.options.beforeContentClassName&&(g=!0);const b=new q(e.range.startLineNumber,m,e.range.startLineNumber,_);s.push(new Xm(this,b,pme(v),g,a++))}return s}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return ba.EMPTY;const r=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(r))return ba.EMPTY;const o=new Ce(e.range.startLineNumber,e.range.startColumn);return Qve(this._languageFeaturesService.hoverProvider,r,o,i).filter(s=>!h2(s.hover.contents)).map(s=>{const a=s.hover.range?q.lift(s.hover.range):e.range;return new Xm(this,a,s.hover.contents,!1,s.ordinal)})}renderHoverParts(e,t){return UQe(e,t,this._editor,this._languageService,this._openerService)}};nW=Rir([h$(1,Qo),h$(2,mh),h$(3,Ui),h$(4,en)],nW);function UQe(n,e,t,i,r){e.sort((s,a)=>s.ordinal-a.ordinal);const o=new nt;for(const s of e)for(const a of s.contents){if(h2(a))continue;const l=qRe("div.hover-row.markdown-hover"),c=Ge(l,qRe("div.hover-contents")),u=o.add(new w0({editor:t},i,r));o.add(u.onDidRenderAsync(()=>{c.className="hover-contents code-hover-contents",n.onContentsChanged()}));const d=o.add(u.render(a));c.appendChild(d.element),n.fragment.appendChild(l)}return o}var qQe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},iW=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class KRe{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let Ole=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new be,this.onDidChange=this._onDidChange.event,this._dispoables=new nt,this._markers=[],this._nextIdx=-1,Tn.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const r=this._configService.getValue("problems.sortOrder"),o=(a,l)=>{let c=wM(a.resource.toString(),l.resource.toString());return c===0&&(r==="position"?c=q.compareRangesUsingStarts(a,l)||vs.compare(a.severity,l.severity):c=vs.compare(a.severity,l.severity)||q.compareRangesUsingStarts(a,l)),c},s=()=>{this._markers=this._markerService.read({resource:Tn.isUri(e)?e:void 0,severities:vs.Error|vs.Warning|vs.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(o)};s(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(s(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new KRe(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let r=!1,o=this._markers.findIndex(s=>s.resource.toString()===e.uri.toString());o<0&&(o=gM(this._markers,{resource:e.uri},(s,a)=>wM(s.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let s=o;s<this._markers.length;s++){let a=q.lift(this._markers[s]);if(a.isEmpty()){const l=e.getWordAtPosition(a.getStartPosition());l&&(a=new q(a.startLineNumber,l.startColumn,a.startLineNumber,l.endColumn))}if(t&&(a.containsPosition(t)||t.isBeforeOrEqual(a.getStartPosition()))){this._nextIdx=s,r=!0;break}if(this._markers[s].resource.toString()!==e.uri.toString())break}r||(this._nextIdx=i?0:this._markers.length-1),this._nextIdx<0&&(this._nextIdx=this._markers.length-1)}resetIndex(){this._nextIdx=-1}move(e,t,i){if(this._markers.length===0)return!1;const r=this._nextIdx;return this._nextIdx===-1?this._initIdx(t,i,e):e?this._nextIdx=(this._nextIdx+1)%this._markers.length:e||(this._nextIdx=(this._nextIdx-1+this._markers.length)%this._markers.length),r!==this._nextIdx}find(e,t){let i=this._markers.findIndex(r=>r.resource.toString()===e.toString());if(!(i<0)){for(;i<this._markers.length;i++)if(q.containsPosition(this._markers[i],t))return new KRe(this._markers[i],i+1,this._markers.length)}}};Ole=qQe([iW(1,Lb),iW(2,Ui)],Ole);const KQe=Vi("IMarkerNavigationService");let Ple=class{constructor(e,t){this._markerService=e,this._configService=t,this._provider=new Hu}getMarkerList(e){for(const t of this._provider){const i=t.getMarkerList(e);if(i)return i}return new Ole(e,this._markerService,this._configService)}};Ple=qQe([iW(0,Lb),iW(1,Ui)],Ple);Zi(KQe,Ple,1);var Mle;(function(n){function e(t){switch(t){case js.Ignore:return"severity-ignore "+In.asClassName(Ct.info);case js.Info:return In.asClassName(Ct.info);case js.Warning:return In.asClassName(Ct.warning);case js.Error:return In.asClassName(Ct.error);default:return""}}n.className=e})(Mle||(Mle={}));var Nir=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},HT=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Fle;class Oir{constructor(e,t,i,r,o){this._openerService=r,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new nt,this._editor=t;const s=document.createElement("div");s.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),s.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),s.appendChild(this._relatedBlock),this._disposables.add(ua(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new Iqe(s,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{s.style.left=`-${a.scrollLeft}px`,s.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){Hr(this._disposables)}update(e){const{source:t,message:i,relatedInformation:r,code:o}=e;let s=((t==null?void 0:t.length)||0)+2;o&&(typeof o=="string"?s+=o.length:s+=o.value.length);const a=ab(i);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+s,this._longestLineLength);Gl(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||o){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const g=document.createElement("span");g.innerText=t,g.classList.add("source"),h.appendChild(g)}if(o)if(typeof o=="string"){const g=document.createElement("span");g.innerText=`(${o})`,g.classList.add("code"),h.appendChild(g)}else{this._codeLink=at("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=p=>{this._openerService.open(o.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()};const g=Ge(this._codeLink,at("span"));g.innerText=o.value,h.appendChild(this._codeLink)}}if(Gl(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Fc(r)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(66)*.66)}px`,this._lines+=1;for(const g of r){const p=document.createElement("div"),m=document.createElement("a");m.classList.add("filename"),m.innerText=`${this._labelService.getUriBasenameLabel(g.resource)}(${g.startLineNumber}, ${g.startColumn}): `,m.title=this._labelService.getUriLabel(g.resource),this._relatedDiagnostics.set(m,g);const _=document.createElement("span");_.innerText=g.message,p.appendChild(m),p.appendChild(_),this._lines+=1,h.appendChild(p)}}const c=this._editor.getOption(50),u=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),d=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:u,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 vs.Error:t=E("Error","Error");break;case vs.Warning:t=E("Warning","Warning");break;case vs.Info:t=E("Info","Info");break;case vs.Hint:t=E("Hint","Hint");break}let i=E("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const r=this._editor.getModel();return r&&e.startLineNumber<=r.getLineCount()&&e.startLineNumber>=1&&(i=`${r.getLineContent(e.startLineNumber)}, ${i}`),i}}let w2=Fle=class extends ZH{constructor(e,t,i,r,o,s,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=r,this._contextKeyService=s,this._labelService=a,this._callOnDispose=new nt,this._onDidSelectRelatedInformation=new be,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=vs.Warning,this._backgroundColor=De.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(Bir);let t=Ble,i=Pir;this._severity===vs.Warning?(t=i9,i=Mir):this._severity===vs.Info&&(t=$le,i=Fir);const r=e.getColor(t),o=e.getColor(i);this.style({arrowColor:r,frameColor:r,headerBackgroundColor:o,primaryHeadingColor:e.getColor(RQe),secondaryHeadingColor:e.getColor(NQe)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(r=>this.editor.focus()));const t=[],i=this._menuService.createMenu(Fle.TitleMenu,this._contextKeyService);lGe(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=Ge(e,at(""))}_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 Oir(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const r=q.lift(e),o=this.editor.getPosition(),s=o&&r.containsPosition(o)?o:r.getStartPosition();super.show(s,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?E("problems","{0} of {1} problems",t,i):E("change","{0} of {1} problem",t,i);this.setTitle(Tg(a.uri),l)}this._icon.className=`codicon ${Mle.className(vs.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(s,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()}};w2.TitleMenu=new J("gotoErrorTitleMenu");w2=Fle=Nir([HT(1,ll),HT(2,mh),HT(3,kb),HT(4,Un),HT(5,Yn),HT(6,c2)],w2);const GRe=VM(Mv,P7i),YRe=VM(Gh,BM),QRe=VM(xd,$M),Ble=re("editorMarkerNavigationError.background",{dark:GRe,light:GRe,hcDark:ji,hcLight:ji},E("editorMarkerNavigationError","Editor marker navigation widget error color.")),Pir=re("editorMarkerNavigationError.headerBackground",{dark:mn(Ble,.1),light:mn(Ble,.1),hcDark:null,hcLight:null},E("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),i9=re("editorMarkerNavigationWarning.background",{dark:YRe,light:YRe,hcDark:ji,hcLight:ji},E("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),Mir=re("editorMarkerNavigationWarning.headerBackground",{dark:mn(i9,.1),light:mn(i9,.1),hcDark:"#0C141F",hcLight:mn(i9,.2)},E("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),$le=re("editorMarkerNavigationInfo.background",{dark:QRe,light:QRe,hcDark:ji,hcLight:ji},E("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),Fir=re("editorMarkerNavigationInfo.headerBackground",{dark:mn($le,.1),light:mn($le,.1),hcDark:null,hcLight:null},E("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),Bir=re("editorMarkerNavigation.background",{dark:tl,light:tl,hcDark:tl,hcLight:tl},E("editorMarkerNavigationBackground","Editor marker navigation widget background."));var $ir=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},f$=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},GQe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},zN;let xw=zN=class{static get(e){return e.getContribution(zN.ID)}constructor(e,t,i,r,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=r,this._instantiationService=o,this._sessionDispoables=new nt,this._editor=e,this._widgetVisible=YQe.bindTo(this._contextKeyService)}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(w2,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(i=>{var r,o,s;(!(!((r=this._model)===null||r===void 0)&&r.selected)||!q.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,i.position))&&((s=this._model)===null||s===void 0||s.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:q.lift(i).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 Ce(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){var i,r;return GQe(this,void 0,void 0,function*(){if(this._editor.hasModel()){const o=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(o.move(e,this._editor.getModel(),this._editor.getPosition()),!o.selected)return;if(o.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=yield this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);s&&((i=zN.get(s))===null||i===void 0||i.close(),(r=zN.get(s))===null||r===void 0||r.nagivate(e,t))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}})}};xw.ID="editor.contrib.markerController";xw=zN=$ir([f$(1,KQe),f$(2,Yn),f$(3,Lr),f$(4,Un)],xw);class sK extends Gt{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){var i;return GQe(this,void 0,void 0,function*(){t.hasModel()&&((i=xw.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))})}}class HC extends sK{constructor(){super(!0,!1,{id:HC.ID,label:HC.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:ee.focus,primary:578,weight:100},menuOpts:{menuId:w2.TitleMenu,title:HC.LABEL,icon:Js("marker-navigation-next",Ct.arrowDown,E("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}HC.ID="editor.action.marker.next";HC.LABEL=E("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class rx extends sK{constructor(){super(!1,!1,{id:rx.ID,label:rx.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:ee.focus,primary:1602,weight:100},menuOpts:{menuId:w2.TitleMenu,title:rx.LABEL,icon:Js("marker-navigation-previous",Ct.arrowUp,E("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}rx.ID="editor.action.marker.prev";rx.LABEL=E("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class Vir extends sK{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:E("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:ee.focus,primary:66,weight:100},menuOpts:{menuId:J.MenubarGoMenu,title:E({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class Hir extends sK{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:E("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:ee.focus,primary:1090,weight:100},menuOpts:{menuId:J.MenubarGoMenu,title:E({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}gr(xw.ID,xw,4);ht(HC);ht(rx);ht(Vir);ht(Hir);const YQe=new Ft("markersNavigationVisible",!1),Wir=kl.bindToContribution(xw.get);Et(new Wir({id:"closeMarkersNavigation",precondition:YQe,handler:n=>n.close(),kbOpts:{weight:100+50,kbExpr:ee.focus,primary:9,secondary:[1033]}}));var zir=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},EJ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const rp=at;class jir{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const XRe={type:1,filter:{include:Fn.QuickFix},triggerAction:hh.QuickFixHover};let Vle=class{constructor(e,t,i,r){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=r,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),r=e.range.startLineNumber,o=i.getLineMaxColumn(r),s=[];for(const a of t){const l=a.range.startLineNumber===r?a.range.startColumn:1,c=a.range.endLineNumber===r?a.range.endColumn:o,u=this._markerDecorationsService.getMarker(i.uri,a);if(!u)continue;const d=new q(e.range.startLineNumber,l,e.range.startLineNumber,c);s.push(new jir(this,d,u))}return s}renderHoverParts(e,t){if(!t.length)return Ae.None;const i=new nt;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,i)));const r=t.length===1?t[0]:t.sort((o,s)=>vs.compare(o.marker.severity,s.marker.severity))[0];return this.renderMarkerStatusbar(e,r,i),i}renderMarkerHover(e,t){const i=rp("div.hover-row"),r=Ge(i,rp("div.marker.hover-contents")),{source:o,message:s,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(r);const c=Ge(r,rp("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=s,o||a)if(a&&typeof a!="string"){const u=rp("span");if(o){const p=Ge(u,rp("span"));p.innerText=o}const d=Ge(u,rp("a.code-link"));d.setAttribute("href",a.target.toString()),t.add(We(d,"click",p=>{this._openerService.open(a.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()}));const h=Ge(d,rp("span"));h.innerText=a.value;const g=Ge(r,u);g.style.opacity="0.6",g.style.paddingLeft="6px"}else{const u=Ge(r,rp("span"));u.style.opacity="0.6",u.style.paddingLeft="6px",u.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(Fc(l))for(const{message:u,resource:d,startLineNumber:h,startColumn:g}of l){const p=Ge(r,rp("div"));p.style.marginTop="8px";const m=Ge(p,rp("a"));m.innerText=`${Tg(d)}(${h}, ${g}): `,m.style.cursor="pointer",t.add(We(m,"click",v=>{v.stopPropagation(),v.preventDefault(),this._openerService&&this._openerService.open(d,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:g}}}).catch(fi)}));const _=Ge(p,rp("span"));_.innerText=u,this._editor.applyFontInfo(_)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===vs.Error||t.marker.severity===vs.Warning||t.marker.severity===vs.Info)&&e.statusBar.addAction({label:E("view problem","View Problem"),commandId:HC.ID,run:()=>{var r;e.hide(),(r=xw.get(this._editor))===null||r===void 0||r.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const r=e.statusBar.append(rp("div"));this.recentMarkerCodeActionsInfo&&(IH.makeKey(this.recentMarkerCodeActionsInfo.marker)===IH.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(r.textContent=E("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?Ae.None:i.add(uw(()=>r.textContent=E("checkingForQuickFixes","Checking for quick fixes..."),200));r.textContent||(r.textContent=String.fromCharCode(160));const s=this.getCodeActions(t.marker);i.add(Gn(()=>s.cancel())),s.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),r.textContent=E("noQuickFixes","No quick fixes available");return}r.style.display="none";let l=!1;i.add(Gn(()=>{l||a.dispose()})),e.statusBar.addAction({label:E("quick fixes","Quick Fix..."),commandId:$ve,run:c=>{l=!0;const u=yw.get(this._editor),d=Oa(c);e.hide(),u==null||u.showCodeActions(XRe,a,{x:d.left,y:d.top,width:d.width,height:d.height})}})},fi)}}getCodeActions(e){return za(t=>eP(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new q(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),XRe,Zy.None,t))}};Vle=zir([EJ(1,t_e),EJ(2,mh),EJ(3,en)],Vle);const QQe="editor.action.inlineSuggest.commit",XQe="editor.action.inlineSuggest.showPrevious",ZQe="editor.action.inlineSuggest.showNext";var Uir=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class qir extends Ae{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new QFi),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new nt),this.options=i,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new x4(()=>{var r;return(r=this.toggleMenuActionViewItem)===null||r===void 0?void 0:r.show()},i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new Ig(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,actionViewItemProvider:(r,o)=>{var s;if(r.id===x4.ID)return this.toggleMenuActionViewItem=new CH(r,r.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:In.asClassNameArray((s=i.moreIcon)!==null&&s!==void 0?s:Ct.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const a=i.actionViewItemProvider(r,o);if(a)return a}if(r instanceof YD){const a=new CH(r,r.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:r.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry});return a.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(a),this.disposables.add(this._onDidChangeDropdownVisibility.add(a.onDidChangeVisibility)),a}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(r=>{this.actionBar.push(r,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(r)})})}getKeybindingLabel(e){var t,i,r;const o=this.lookupKeybindings?(i=(t=this.options).getKeyBinding)===null||i===void 0?void 0:i.call(t,e):void 0;return(r=o==null?void 0:o.getLabel())!==null&&r!==void 0?r:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class x4 extends Gu{constructor(e,t){t=t||E("moreActions","More Actions..."),super(x4.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return Uir(this,void 0,void 0,function*(){this.toggleDropdownMenu()})}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}x4.ID="toolbar.toggle.more";var Kir=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},nN=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Hle=class extends qir{constructor(e,t,i,r,o,s,a){super(e,o,Object.assign(Object.assign({getKeyBinding:c=>{var u;return(u=s.lookupKeybinding(c.id))!==null&&u!==void 0?u:void 0}},t),{allowContextMenu:!0,skipTelemetry:typeof(t==null?void 0:t.telemetrySource)=="string"})),this._options=t,this._menuService=i,this._contextKeyService=r,this._contextMenuService=o,this._sessionDisposables=this._store.add(new nt);const l=t==null?void 0:t.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(c=>a.publicLog2("workbenchActionExecuted",{id:c.action.id,from:l})))}setActions(e,t=[],i){var r,o,s;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),c=[];let u=0;const d=[];let h=!1;if(((r=this._options)===null||r===void 0?void 0:r.hiddenItemStrategy)!==-1)for(let g=0;g<a.length;g++){const p=a[g];!(p instanceof qp)&&!(p instanceof kM)||p.hideActions&&(c.push(p.hideActions.toggle),p.hideActions.toggle.checked&&u++,p.hideActions.isHidden&&(h=!0,a[g]=void 0,((o=this._options)===null||o===void 0?void 0:o.hiddenItemStrategy)!==0&&(d[g]=p)))}if(((s=this._options)===null||s===void 0?void 0:s.overflowBehavior)!==void 0){const g=yYi(new Set(this._options.overflowBehavior.exempted),Pi.map(a,_=>_==null?void 0:_.id)),p=this._options.overflowBehavior.maxItems-g.size;let m=0;for(let _=0;_<a.length;_++){const v=a[_];v&&(m++,!g.has(v.id)&&m>=p&&(a[_]=void 0,d[_]=v))}}nLe(a),nLe(d),super.setActions(a,El.join(d,l)),c.length>0&&this._sessionDisposables.add(We(this.getElement(),"contextmenu",g=>{var p,m,_,v,b;const y=new og(g),C=this.getItemAction(y.target);if(!C)return;y.preventDefault(),y.stopPropagation();let x=!1;if(u===1&&((p=this._options)===null||p===void 0?void 0:p.hiddenItemStrategy)===0){x=!0;for(let L=0;L<c.length;L++)if(c[L].checked){c[L]=xL({id:C.id,label:C.label,checked:!0,enabled:!1,run(){}});break}}let k;if(!x&&(C instanceof qp||C instanceof kM)){if(!C.hideActions)return;k=C.hideActions.hide}else k=xL({id:"label",label:E("hide","Hide"),enabled:!1,run(){}});const I=El.join([k],c);!((m=this._options)===null||m===void 0)&&m.resetMenu&&!i&&(i=[this._options.resetMenu]),h&&i&&(I.push(new El),I.push(xL({id:"resetThisMenu",label:E("resetThisMenu","Reset Menu"),run:()=>this._menuService.resetHiddenStates(i)}))),this._contextMenuService.showContextMenu({getAnchor:()=>y,getActions:()=>I,menuId:(_=this._options)===null||_===void 0?void 0:_.contextMenu,menuActionOptions:Object.assign({renderShortTitle:!0},(v=this._options)===null||v===void 0?void 0:v.menuOptions),skipTelemetry:typeof((b=this._options)===null||b===void 0?void 0:b.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};Hle=Kir([nN(2,kb),nN(3,Yn),nN(4,om),nN(5,mo),nN(6,wf)],Hle);var Xve=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Zm=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},r9;let Wle=class extends Ae{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Ul(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=Ki(this,r=>{var o,s,a;const l=(o=this.model.read(r))===null||o===void 0?void 0:o.ghostText.read(r);if(!this.alwaysShowToolbar.read(r)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const c=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const u=new Ce(l.lineNumber,Math.min(c,(a=(s=this.sessionPosition)===null||s===void 0?void 0:s.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=u,u}),this._register(Gd((r,o)=>{const s=this.model.read(r);if(!s||!this.alwaysShowToolbar.read(r))return;const a=o.add(this.instantiationService.createInstance(kw,this.editor,!0,this.position,s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.selectedInlineCompletion.map(l=>{var c;return(c=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&c!==void 0?c:[]})));e.addContentWidget(a),o.add(Gn(()=>e.removeContentWidget(a))),o.add(So(l=>{this.position.read(l)&&s.lastTriggerKind.read(l)!==Yy.Explicit&&s.triggerExplicitly()}))}))}};Wle=Xve([Zm(2,Un)],Wle);const Gir=Js("inline-suggestion-hints-next",Ct.chevronRight,E("parameterHintsNextIcon","Icon for show next parameter hint.")),Yir=Js("inline-suggestion-hints-previous",Ct.chevronLeft,E("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let kw=r9=class extends Ae{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const r=new Gu(e,t,i,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let s=t;return o&&(s=E({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,o.getLabel())),r.tooltip=s,r}constructor(e,t,i,r,o,s,a,l,c,u,d){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=r,this._suggestionCount=o,this._extraCommands=s,this._commandService=a,this.keybindingService=c,this._contextKeyService=u,this._menuService=d,this.id=`InlineSuggestionHintsContentWidget${r9.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Fl("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[Fl("div@toolBar")]),this.previousAction=this.createCommandAction(XQe,E("previous","Previous"),In.asClassName(Yir)),this.availableSuggestionCountAction=new Gu("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(ZQe,E("next","Next"),In.asClassName(Gir)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(J.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new so(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new so(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(zle,this.nodes.toolBar,J.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,g)=>{if(h instanceof qp)return l.createInstance(Xir,h,void 0);if(h===this.availableSuggestionCountAction){const p=new Qir(void 0,h,{label:!0,icon:!1});return p.setClass("availableSuggestionCount"),p}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(h=>{r9._dropDownVisible=h})),this._register(So(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(So(h=>{const g=this._suggestionCount.read(h),p=this._currentSuggestionIdx.read(h);g!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${p+1}/${g}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),g!==void 0&&g>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(So(h=>{const g=this._extraCommands.read(h);if(Qs(this.lastCommands,g))return;this.lastCommands=g;const p=g.map(m=>({class:void 0,id:m.id,enabled:!0,tooltip:m.tooltip||"",label:m.title,run:_=>this._commandService.executeCommand(m.id)}));for(const[m,_]of this.inlineCompletionsActionsMenus.getActions())for(const v of _)v instanceof qp&&p.push(v);p.length>0&&p.unshift(new El),this.toolBar.setAdditionalSecondaryActions(p)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};kw._dropDownVisible=!1;kw.id=0;kw=r9=Xve([Zm(6,Fs),Zm(7,Un),Zm(8,mo),Zm(9,Yn),Zm(10,kb)],kw);class Qir extends f2{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}let Xir=class extends Vx{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Fl("div.keybinding").root;new O5(t,qh,Object.assign({disableTitle:!0},BQi)).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}},zle=class extends Hle{constructor(e,t,i,r,o,s,a,l){super(e,Object.assign({resetMenu:t},i),r,o,s,a,l),this.menuId=t,this.options2=i,this.menuService=r,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,i,r,o,s,a;const l=[],c=[];lGe(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:c},(i=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||i===void 0?void 0:i.primaryGroup,(o=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(a=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),c.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,c)}setPrependedPrimaryActions(e){Qs(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Qs(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};zle=Xve([Zm(3,kb),Zm(4,Yn),Zm(5,om),Zm(6,mo),Zm(7,wf)],zle);var Zir=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},g$=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},jle;const Jir=!1;let Ad=jle=class extends Ae{static get(e){return e.getContribution(jle.ID)}constructor(e,t,i,r,o){super(),this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=r,this._keybindingService=o,this._toUnhook=new nt,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new so(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())})),this._register(this._editor.onMouseLeave(()=>{this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}))}_hookEvents(){const e=()=>this._hideWidgets(),t=this._editor.getOption(60);this._isHoverEnabled=t.enabled,this._isHoverSticky=t.sticky,this._hidingDelay=t.hidingDelay,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown(i=>this._onEditorMouseDown(i))),this._toUnhook.add(this._editor.onMouseUp(i=>this._onEditorMouseUp(i))),this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))):(this._toUnhook.add(this._editor.onMouseMove(i=>this._onEditorMouseMove(i))),this._toUnhook.add(this._editor.onKeyDown(i=>this._onKeyDown(i)))),this._toUnhook.add(this._editor.onMouseLeave(i=>this._onEditorMouseLeave(i))),this._toUnhook.add(this._editor.onDidChangeModel(e)),this._toUnhook.add(this._editor.onDidScrollChange(i=>this._onEditorScrollChanged(i)))}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._isMouseDown=!0;const i=e.target;if(i.type===9&&i.detail===VC.ID){this._hoverClicked=!0;return}i.type===12&&i.detail===KL.ID||(i.type!==12&&(this._hoverClicked=!1),!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t,i;const r=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||!((i=this._contentWidget)===null||i===void 0)&&i.containsNode(r)||this._hideWidgets()}_isMouseOverWidget(e){var t,i,r,o,s;const a=e.target;return!!(this._isHoverSticky&&a.type===9&&a.detail===VC.ID||this._isHoverSticky&&(!((t=this._contentWidget)===null||t===void 0)&&t.containsNode((i=e.event.browserEvent.view)===null||i===void 0?void 0:i.document.activeElement))&&!(!((o=(r=e.event.browserEvent.view)===null||r===void 0?void 0:r.getSelection())===null||o===void 0)&&o.isCollapsed)||!this._isHoverSticky&&a.type===9&&a.detail===VC.ID&&(!((s=this._contentWidget)===null||s===void 0)&&s.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===KL.ID)}_onEditorMouseMove(e){var t,i,r,o;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((i=this._contentWidget)===null||i===void 0)&&i.isResizing||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&(!((r=this._contentWidget)===null||r===void 0)&&r.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(!((o=this._contentWidget)===null||o===void 0)&&o.isVisible&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,i,r;if(!e)return;const o=e.target,s=(t=o.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),a=this._editor.getOption(146);if(s&&(a==="click"&&!this._hoverActivatedByColorDecoratorClick||a==="hover"&&!this._isHoverEnabled&&!Jir||a==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!s&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(i=this._glyphWidget)===null||i===void 0||i.hide();return}if(o.type===2&&o.position){(r=this._contentWidget)===null||r===void 0||r.hide(),this._glyphWidget||(this._glyphWidget=new KL(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(o.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),r=i.kind===1||i.kind===2&&i.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&!r&&this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||kw.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(i=this._contentWidget)===null||i===void 0||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(JH,this._editor)),this._contentWidget}showContentHover(e,t,i,r,o=!1){this._hoverActivatedByColorDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,r)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};Ad.ID="editor.contrib.hover";Ad=jle=Zir([g$(1,Un),g$(2,mh),g$(3,Qo),g$(4,mo)],Ad);class err extends Gt{constructor(){super({id:"editor.action.showHover",label:E({key:"showOrFocusHover",comment:["Label for action that will trigger the showing/focusing of a hover in the editor.","If the hover is not visible, it will show the hover.","This allows for users to show the hover without using the mouse.","If the hover is already visible, it will take focus."]},"Show or Focus Hover"),description:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if when triggered with the keyboard, the hover should take focus immediately.",type:"boolean",default:!1}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const r=Ad.get(t);if(!r)return;const o=t.getPosition(),s=new q(o.lineNumber,o.column,o.lineNumber,o.column),a=t.getOption(2)===2||!!(i!=null&&i.focus);r.isHoverVisible?r.focus():r.showContentHover(s,1,1,a)}}class trr extends Gt{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:E({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 i=Ad.get(t);if(!i)return;const r=t.getPosition();if(!r)return;const o=new q(r.lineNumber,r.column,r.lineNumber,r.column),s=Qx.get(t);if(!s)return;s.startFindDefinitionFromCursor(r).then(()=>{i.showContentHover(o,1,1,!0)})}}class nrr extends Gt{constructor(){super({id:"editor.action.scrollUpHover",label:E({key:"scrollUpHover",comment:["Action that allows to scroll up in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:ee.hoverFocused,kbOpts:{kbExpr:ee.hoverFocused,primary:16,weight:100}})}run(e,t){const i=Ad.get(t);i&&i.scrollUp()}}class irr extends Gt{constructor(){super({id:"editor.action.scrollDownHover",label:E({key:"scrollDownHover",comment:["Action that allows to scroll down in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:ee.hoverFocused,kbOpts:{kbExpr:ee.hoverFocused,primary:18,weight:100}})}run(e,t){const i=Ad.get(t);i&&i.scrollDown()}}class rrr extends Gt{constructor(){super({id:"editor.action.scrollLeftHover",label:E({key:"scrollLeftHover",comment:["Action that allows to scroll left in the hover widget with the left arrow when the hover widget is focused."]},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:ee.hoverFocused,kbOpts:{kbExpr:ee.hoverFocused,primary:15,weight:100}})}run(e,t){const i=Ad.get(t);i&&i.scrollLeft()}}class orr extends Gt{constructor(){super({id:"editor.action.scrollRightHover",label:E({key:"scrollRightHover",comment:["Action that allows to scroll right in the hover widget with the right arrow when the hover widget is focused."]},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:ee.hoverFocused,kbOpts:{kbExpr:ee.hoverFocused,primary:17,weight:100}})}run(e,t){const i=Ad.get(t);i&&i.scrollRight()}}class srr extends Gt{constructor(){super({id:"editor.action.pageUpHover",label:E({key:"pageUpHover",comment:["Action that allows to page up in the hover widget with the page up command when the hover widget is focused."]},"Page Up Hover"),alias:"Page Up Hover",precondition:ee.hoverFocused,kbOpts:{kbExpr:ee.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=Ad.get(t);i&&i.pageUp()}}class arr extends Gt{constructor(){super({id:"editor.action.pageDownHover",label:E({key:"pageDownHover",comment:["Action that allows to page down in the hover widget with the page down command when the hover widget is focused."]},"Page Down Hover"),alias:"Page Down Hover",precondition:ee.hoverFocused,kbOpts:{kbExpr:ee.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=Ad.get(t);i&&i.pageDown()}}class lrr extends Gt{constructor(){super({id:"editor.action.goToTopHover",label:E({key:"goToTopHover",comment:["Action that allows to go to the top of the hover widget with the home command when the hover widget is focused."]},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:ee.hoverFocused,kbOpts:{kbExpr:ee.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=Ad.get(t);i&&i.goToTop()}}class crr extends Gt{constructor(){super({id:"editor.action.goToBottomHover",label:E({key:"goToBottomHover",comment:["Action that allows to go to the bottom in the hover widget with the end command when the hover widget is focused."]},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:ee.hoverFocused,kbOpts:{kbExpr:ee.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=Ad.get(t);i&&i.goToBottom()}}gr(Ad.ID,Ad,2);ht(err);ht(trr);ht(nrr);ht(irr);ht(rrr);ht(orr);ht(srr);ht(arr);ht(lrr);ht(crr);Kk.register(nW);Kk.register(Vle);rm((n,e)=>{const t=n.getColor(Q7i);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});class Ule extends Ae{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(146);if(t!=="click"&&t!=="clickAndHover")return;const i=e.target;if(i.type!==6||!i.detail.injectedText||i.detail.injectedText.options.attachedData!==wQe||!i.range)return;const r=this._editor.getContribution(Ad.ID);if(r&&!r.isColorPickerVisible){const o=new q(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);r.showContentHover(o,1,0,!1,!0)}}}Ule.ID="editor.contrib.colorContribution";gr(Ule.ID,Ule,2);Kk.register(XH);var JQe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},qm=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ZRe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},qle,Kle;let Tw=qle=class extends Ae{constructor(e,t,i,r,o,s,a){super(),this._editor=e,this._modelService=i,this._keybindingService=r,this._instantiationService=o,this._languageFeatureService=s,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=ee.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=ee.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)===null||e===void 0||e.focus():this._standaloneColorPickerWidget=new rW(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)===null||e===void 0||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)===null||e===void 0||e.updateEditor(),this.hide()}static get(e){return e.getContribution(qle.ID)}};Tw.ID="editor.contrib.standaloneColorPickerController";Tw=qle=JQe([qm(1,Yn),qm(2,ts),qm(3,mo),qm(4,Un),qm(5,en),qm(6,xo)],Tw);gr(Tw.ID,Tw,1);const JRe=8,urr=22;let rW=Kle=class extends Ae{constructor(e,t,i,r,o,s,a,l){var c;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=o,this._keybindingService=s,this._languageFeaturesService=a,this._languageConfigurationService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new be),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=r.createInstance(C4,this._editor),this._position=(c=this._editor._getViewModel())===null||c===void 0?void 0:c.getPrimaryCursorState().modelState.position;const u=this._editor.getSelection(),d=u?{startLineNumber:u.startLineNumber,startColumn:u.startColumn,endLineNumber:u.endLineNumber,endColumn:u.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(lb(this._body));this._register(h.onDidBlur(g=>{this.hide()})),this._register(h.onDidFocus(g=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(g=>{var p;const m=(p=g.target.element)===null||p===void 0?void 0:p.classList;m&&m.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(g=>{this._render(g.value,g.foundInEditor)})),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return Kle.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}_start(e){return ZRe(this,void 0,void 0,function*(){const t=yield this._computeAsync(e);t&&this._onResult.fire(new drr(t.result,t.foundInEditor))})}_computeAsync(e){return ZRe(this,void 0,void 0,function*(){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=yield this._standaloneColorPickerParticipant.createColorHover(t,new zve(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null})}_render(e,t){const i=document.createDocumentFragment(),r=this._register(new eW(this._keybindingService));let o;const s={fragment:i,statusBar:r,setColorPicker:m=>o=m,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(s,[e])),o===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),o.layout();const a=o.body,l=a.saturationBox.domNode.clientWidth,c=a.domNode.clientWidth-l-urr-JRe,u=o.body.enterButton;u==null||u.onClicked(()=>{this.updateEditor(),this.hide()});const d=o.header,h=d.pickedColorNode;h.style.width=l+JRe+"px";const g=d.originalColorNode;g.style.width=c+"px";const p=o.header.closeButton;p==null||p.onClicked(()=>{this.hide()}),t&&(u&&(u.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};rW.ID="editor.contrib.standaloneColorPickerWidget";rW=Kle=JQe([qm(3,Un),qm(4,ts),qm(5,mo),qm(6,en),qm(7,xo)],rW);class drr{constructor(e,t){this.value=e,this.foundInEditor=t}}class hrr extends N_{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:E("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:E({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:J.CommandPalette}]})}runEditorCommand(e,t){var i;(i=Tw.get(t))===null||i===void 0||i.showOrFocus()}}class frr extends Gt{constructor(){super({id:"editor.action.hideColorPicker",label:E({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:ee.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;(i=Tw.get(t))===null||i===void 0||i.hide()}}class grr extends Gt{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:E({key:"insertColorWithStandaloneColorPicker",comment:["Action that inserts color with standalone color picker"]},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:ee.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;(i=Tw.get(t))===null||i===void 0||i.insertColor()}}ht(frr);ht(grr);jo(hrr);class oC{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const r=t.length,o=e.length;if(i+r>o)return!1;for(let s=0;s<r;s++){const a=e.charCodeAt(i+s),l=t.charCodeAt(s);if(a!==l&&!(a>=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,r,o,s){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,u=e.endColumn,d=o.getLineContent(a),h=o.getLineContent(c);let g=d.lastIndexOf(t,l-1+t.length),p=h.indexOf(i,u-1-i.length);if(g!==-1&&p!==-1)if(a===c)d.substring(g+t.length,p).indexOf(i)>=0&&(g=-1,p=-1);else{const _=d.substring(g+t.length),v=h.substring(0,p);(_.indexOf(i)>=0||v.indexOf(i)>=0)&&(g=-1,p=-1)}let m;g!==-1&&p!==-1?(r&&g+t.length<d.length&&d.charCodeAt(g+t.length)===32&&(t=t+" "),r&&p>0&&h.charCodeAt(p-1)===32&&(i=" "+i,p-=1),m=oC._createRemoveBlockCommentOperations(new q(a,g+t.length+1,c,p+1),t,i)):(m=oC._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=m.length===1?i:null);for(const _ of m)s.addTrackedEditOperation(_.range,_.text)}static _createRemoveBlockCommentOperations(e,t,i){const r=[];return q.isEmpty(e)?r.push(es.delete(new q(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(r.push(es.delete(new q(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),r.push(es.delete(new q(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),r}static _createAddBlockCommentOperations(e,t,i,r){const o=[];return q.isEmpty(e)?o.push(es.replace(new q(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(es.insert(new Ce(e.startLineNumber,e.startColumn),t+(r?" ":""))),o.push(es.insert(new Ce(e.endLineNumber,e.endColumn),(r?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,r=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,r),s=this.languageConfigurationService.getLanguageConfiguration(o).comments;!s||!s.blockCommentStartToken||!s.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,s.blockCommentStartToken,s.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const r=i[0],o=i[1];return new ln(r.range.endLineNumber,r.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const r=i[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new ln(r.endLineNumber,r.endColumn+o,r.endLineNumber,r.endColumn+o)}}}class fy{constructor(e,t,i,r,o,s,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=i,this._type=r,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=s,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,r){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),s=r.getLanguageConfiguration(o).comments,a=s?s.lineCommentToken:null;if(!a)return null;const l=[];for(let c=0,u=i-t+1;c<u;c++)l[c]={ignore:!1,commentStr:a,commentStrOffset:0,commentStrLength:a.length};return l}static _analyzeLines(e,t,i,r,o,s,a,l){let c=!0,u;e===0?u=!0:e===1?u=!1:u=!0;for(let d=0,h=r.length;d<h;d++){const g=r[d],p=o+d;if(p===o&&a){g.ignore=!0;continue}const m=i.getLineContent(p),_=cu(m);if(_===-1){g.ignore=s,g.commentStrOffset=m.length;continue}if(c=!1,g.ignore=!1,g.commentStrOffset=_,u&&!oC._haystackHasNeedleAtOffset(m,g.commentStr,_)&&(e===0?u=!1:e===1||(g.ignore=!0)),u&&t){const v=_+g.commentStrLength;v<m.length&&m.charCodeAt(v)===32&&(g.commentStrLength+=1)}}if(e===0&&c){u=!1;for(let d=0,h=r.length;d<h;d++)r[d].ignore=!1}return{supported:!0,shouldRemoveComments:u,lines:r}}static _gatherPreflightData(e,t,i,r,o,s,a,l){const c=fy._gatherPreflightCommentStrings(i,r,o,l);return c===null?{supported:!1}:fy._analyzeLines(e,t,i,c,r,s,a,l)}_executeLineComments(e,t,i,r){let o;i.shouldRemoveComments?o=fy._createRemoveLineCommentsOperations(i.lines,r.startLineNumber):(fy._normalizeInsertionPoint(e,i.lines,r.startLineNumber,this._tabSize),o=this._createAddLineCommentsOperations(i.lines,r.startLineNumber));const s=new Ce(r.positionLineNumber,r.positionColumn);for(let a=0,l=o.length;a<l;a++)t.addEditOperation(o[a].range,o[a].text),q.isEmpty(o[a].range)&&q.getStartPosition(o[a].range).equals(s)&&e.getLineContent(s.lineNumber).length+1===s.column&&(this._deltaColumn=(o[a].text||"").length);this._selectionId=t.trackSelection(r)}_attemptRemoveBlockComment(e,t,i,r){let o=t.startLineNumber,s=t.endLineNumber;const a=r.length+Math.max(e.getLineFirstNonWhitespaceColumn(t.startLineNumber),t.startColumn);let l=e.getLineContent(o).lastIndexOf(i,a-1),c=e.getLineContent(s).indexOf(r,t.endColumn-1-i.length);return l!==-1&&c===-1&&(c=e.getLineContent(o).indexOf(r,l+i.length),s=o),l===-1&&c!==-1&&(l=e.getLineContent(s).lastIndexOf(i,c),o=s),t.isEmpty()&&(l===-1||c===-1)&&(l=e.getLineContent(o).indexOf(i),l!==-1&&(c=e.getLineContent(o).indexOf(r,l+i.length))),l!==-1&&e.getLineContent(o).charCodeAt(l+i.length)===32&&(i+=" "),c!==-1&&e.getLineContent(s).charCodeAt(c-1)===32&&(r=" "+r,c-=1),l!==-1&&c!==-1?oC._createRemoveBlockCommentOperations(new q(o,l+i.length+1,s,c+1),i,r):null}_executeBlockComment(e,t,i){e.tokenization.tokenizeIfCheap(i.startLineNumber);const r=e.getLanguageIdAtPosition(i.startLineNumber,1),o=this.languageConfigurationService.getLanguageConfiguration(r).comments;if(!o||!o.blockCommentStartToken||!o.blockCommentEndToken)return;const s=o.blockCommentStartToken,a=o.blockCommentEndToken;let l=this._attemptRemoveBlockComment(e,i,s,a);if(!l){if(i.isEmpty()){const c=e.getLineContent(i.startLineNumber);let u=cu(c);u===-1&&(u=c.length),l=oC._createAddBlockCommentOperations(new q(i.startLineNumber,u+1,i.startLineNumber,c.length+1),s,a,this._insertSpace)}else l=oC._createAddBlockCommentOperations(new q(i.startLineNumber,e.getLineFirstNonWhitespaceColumn(i.startLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),s,a,this._insertSpace);l.length===1&&(this._deltaColumn=s.length+1)}this._selectionId=t.trackSelection(i);for(const c of l)t.addEditOperation(c.range,c.text)}getEditOperations(e,t){let i=this._selection;if(this._moveEndPositionDown=!1,i.startLineNumber===i.endLineNumber&&this._ignoreFirstLine){t.addEditOperation(new q(i.startLineNumber,e.getLineMaxColumn(i.startLineNumber),i.startLineNumber+1,1),i.startLineNumber===e.getLineCount()?"":`
`),this._selectionId=t.trackSelection(i);return}i.startLineNumber<i.endLineNumber&&i.endColumn===1&&(this._moveEndPositionDown=!0,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const r=fy._gatherPreflightData(this._type,this._insertSpace,e,i.startLineNumber,i.endLineNumber,this._ignoreEmptyLines,this._ignoreFirstLine,this.languageConfigurationService);return r.supported?this._executeLineComments(e,t,r,i):this._executeBlockComment(e,t,i)}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),new ln(i.selectionStartLineNumber,i.selectionStartColumn+this._deltaColumn,i.positionLineNumber,i.positionColumn+this._deltaColumn)}static _createRemoveLineCommentsOperations(e,t){const i=[];for(let r=0,o=e.length;r<o;r++){const s=e[r];s.ignore||i.push(es.delete(new q(t+r,s.commentStrOffset+1,t+r,s.commentStrOffset+s.commentStrLength+1)))}return i}_createAddLineCommentsOperations(e,t){const i=[],r=this._insertSpace?" ":"";for(let o=0,s=e.length;o<s;o++){const a=e[o];a.ignore||i.push(es.insert(new Ce(t+o,a.commentStrOffset+1),a.commentStr+r))}return i}static nextVisibleColumn(e,t,i,r){return i?e+(t-e%t):e+r}static _normalizeInsertionPoint(e,t,i,r){let o=1073741824,s,a;for(let l=0,c=t.length;l<c;l++){if(t[l].ignore)continue;const u=e.getLineContent(i+l);let d=0;for(let h=0,g=t[l].commentStrOffset;d<o&&h<g;h++)d=fy.nextVisibleColumn(d,r,u.charCodeAt(h)===9,1);d<o&&(o=d)}o=Math.floor(o/r)*r;for(let l=0,c=t.length;l<c;l++){if(t[l].ignore)continue;const u=e.getLineContent(i+l);let d=0;for(s=0,a=t[l].commentStrOffset;d<o&&s<a;s++)d=fy.nextVisibleColumn(d,r,u.charCodeAt(s)===9,1);d>o?t[l].commentStrOffset=s-1:t[l].commentStrOffset=s}}}class Zve extends Gt{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(xo);if(!t.hasModel())return;const r=t.getModel(),o=[],s=r.getOptions(),a=t.getOption(23),l=t.getSelections().map((u,d)=>({selection:u,index:d,ignoreFirstLine:!1}));l.sort((u,d)=>q.compareRangesUsingStarts(u.selection,d.selection));let c=l[0];for(let u=1;u<l.length;u++){const d=l[u];c.selection.endLineNumber===d.selection.startLineNumber&&(c.index<d.index?d.ignoreFirstLine=!0:(c.ignoreFirstLine=!0,c=d))}for(const u of l)o.push(new fy(i,u.selection,s.tabSize,this._type,a.insertSpace,a.ignoreEmptyLines,u.ignoreFirstLine));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class prr extends Zve{constructor(){super(0,{id:"editor.action.commentLine",label:E("comment.line","Toggle Line Comment"),alias:"Toggle Line Comment",precondition:ee.writable,kbOpts:{kbExpr:ee.editorTextFocus,primary:2138,weight:100},menuOpts:{menuId:J.MenubarEditMenu,group:"5_insert",title:E({key:"miToggleLineComment",comment:["&& denotes a mnemonic"]},"&&Toggle Line Comment"),order:1}})}}class mrr extends Zve{constructor(){super(1,{id:"editor.action.addCommentLine",label:E("comment.line.add","Add Line Comment"),alias:"Add Line Comment",precondition:ee.writable,kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2081),weight:100}})}}class _rr extends Zve{constructor(){super(2,{id:"editor.action.removeCommentLine",label:E("comment.line.remove","Remove Line Comment"),alias:"Remove Line Comment",precondition:ee.writable,kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2099),weight:100}})}}class vrr extends Gt{constructor(){super({id:"editor.action.blockComment",label:E("comment.block","Toggle Block Comment"),alias:"Toggle Block Comment",precondition:ee.writable,kbOpts:{kbExpr:ee.editorTextFocus,primary:1567,linux:{primary:3103},weight:100},menuOpts:{menuId:J.MenubarEditMenu,group:"5_insert",title:E({key:"miToggleBlockComment",comment:["&& denotes a mnemonic"]},"Toggle &&Block Comment"),order:2}})}run(e,t){const i=e.get(xo);if(!t.hasModel())return;const r=t.getOption(23),o=[],s=t.getSelections();for(const a of s)o.push(new oC(a,r.insertSpace,i));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}ht(prr);ht(mrr);ht(_rr);ht(vrr);var brr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},DS=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Gle;let S2=Gle=class{static get(e){return e.getContribution(Gle.ID)}constructor(e,t,i,r,o,s,a,l){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=r,this._keybindingService=o,this._menuService=s,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new nt,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(c=>this._onContextMenu(c))),this._toDispose.add(this._editor.onMouseWheel(c=>{if(this._contextMenuIsBeingShownCount>0){const u=this._contextViewService.getContextViewElement(),d=c.srcElement;d.shadowRoot&&Px(u)===d.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(c=>{this._editor.getOption(24)&&c.keyCode===58&&(c.preventDefault(),c.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(24)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||e.target.type===6&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===11)return this._showScrollbarContextMenu(e.event);if(e.target.type!==6&&e.target.type!==7&&e.target.type!==1)return;if(this._editor.focus(),e.target.position){let i=!1;for(const r of this._editor.getSelections())if(r.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(24)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?J.SimpleEditorContext:J.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],r=this._menuService.createMenu(t,this._contextKeyService),o=r.getActions({arg:e.uri});r.dispose();for(const s of o){const[,a]=s;let l=0;for(const c of a)if(c instanceof kM){const u=this._getMenuActions(e,c.item.submenu);u.length>0&&(i.push(new YD(c.id,c.label,u)),l++)}else i.push(c),l++;l&&i.push(new El)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let r=t;if(!r){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const s=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=Oa(this._editor.getDomNode()),l=a.left+s.left,c=a.top+s.top+s.height;r={x:l,y:c}}const o=this._editor.getOption(126)&&!C_;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getDomNode():void 0,getAnchor:()=>r,getActions:()=>e,getActionViewItem:s=>{const a=this._keybindingFor(s);if(a)return new f2(s,s,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=s;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new f2(s,s,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:s=>this._keybindingFor(s),onHide:s=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||_Ki(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(72);let i=0;const r=c=>({id:`menu-action-${++i}`,label:c.label,tooltip:"",class:void 0,enabled:typeof c.enabled>"u"?!0:c.enabled,checked:c.checked,run:c.run}),o=(c,u)=>new YD(`menu-action-${++i}`,c,u,void 0),s=(c,u,d,h,g)=>{if(!u)return r({label:c,enabled:u,run:()=>{}});const p=_=>()=>{this._configurationService.updateValue(d,_)},m=[];for(const _ of g)m.push(r({label:_.label,checked:h===_.value,run:p(_.value)}));return o(c,m)},a=[];a.push(r({label:E("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new El),a.push(r({label:E("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(s(E("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:E("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:E("context.minimap.size.fill","Fill"),value:"fill"},{label:E("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(s(E("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:E("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:E("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(126)&&!C_;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:c=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};S2.ID="editor.contrib.contextmenu";S2=Gle=brr([DS(1,om),DS(2,O0),DS(3,Yn),DS(4,mo),DS(5,kb),DS(6,Ui),DS(7,Bx)],S2);class yrr extends Gt{constructor(){super({id:"editor.action.showContextMenu",label:E("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:ee.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;(i=S2.get(t))===null||i===void 0||i.showContextMenu()}}gr(S2.ID,S2,2);ht(yrr);class xJ{constructor(e){this.selections=e}equals(e){const t=this.selections.length,i=e.selections.length;if(t!==i)return!1;for(let r=0;r<t;r++)if(!this.selections[r].equalsSelection(e.selections[r]))return!1;return!0}}class kJ{constructor(e,t,i){this.cursorState=e,this.scrollTop=t,this.scrollLeft=i}}class Xx extends Ae{static get(e){return e.getContribution(Xx.ID)}constructor(e){super(),this._editor=e,this._isCursorUndoRedo=!1,this._undoStack=[],this._redoStack=[],this._register(e.onDidChangeModel(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new xJ(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new kJ(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new kJ(new xJ(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new kJ(new xJ(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}}Xx.ID="editor.contrib.cursorUndoRedoController";class Crr extends Gt{constructor(){super({id:"cursorUndo",label:E("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:ee.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var r;(r=Xx.get(t))===null||r===void 0||r.cursorUndo()}}class wrr extends Gt{constructor(){super({id:"cursorRedo",label:E("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var r;(r=Xx.get(t))===null||r===void 0||r.cursorRedo()}}gr(Xx.ID,Xx,0);ht(Crr);ht(wrr);class Srr{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){const i=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new q(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new ln(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);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new ln(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);return}if(this.targetPosition.lineNumber<this.selection.endLineNumber){this.targetSelection=new ln(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);return}this.selection.endColumn<=this.targetPosition.column?this.targetSelection=new ln(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.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 ln(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column+this.selection.endColumn-this.selection.startColumn)}computeCursorState(e,t){return this.targetSelection}}function WT(n){return Qi?n.altKey:n.ctrlKey}class t0 extends Ae{constructor(e){super(),this._editor=e,this._dndDecorationIds=this._editor.createDecorationsCollection(),this._register(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),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(35)||this._editor.getOption(22)||(WT(e)&&(this._modifierPressed=!0),this._mouseDown&&WT(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(WT(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===t0.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){const t=e.target;if(this._dragSelection===null){const r=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(r.length===1)this._dragSelection=r[0];else return}WT(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){const t=new Ce(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){const r=this._editor.getSelection();if(r){const{selectionStartLineNumber:o,selectionStartColumn:s}=r;i=[new ln(o,s,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(r=>r.containsPosition(t)?new ln(t.lineNumber,t.column,t.lineNumber,t.column):r);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(WT(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(t0.ID,new Srr(this._dragSelection,t,WT(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){this._dndDecorationIds.set([{range:new q(e.lineNumber,e.column,e.lineNumber,e.column),options:t0._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===6||e.type===7}_hitMargin(e){return e.type===2||e.type===3||e.type===4}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}t0.ID="editor.contrib.dragAndDrop";t0.TRIGGER_KEY_VALUE=Qi?6:5;t0._DECORATION_OPTIONS=hi.register({description:"dnd-target",className:"dnd-target"});gr(t0.ID,t0,2);const aK=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let n;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?n=crypto.getRandomValues.bind(crypto):n=function(i){for(let r=0;r<i.length;r++)i[r]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){n(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let r=0,o="";return o+=t[e[r++]],o+=t[e[r++]],o+=t[e[r++]],o+=t[e[r++]],o+="-",o+=t[e[r++]],o+=t[e[r++]],o+="-",o+=t[e[r++]],o+=t[e[r++]],o+="-",o+=t[e[r++]],o+=t[e[r++]],o+="-",o+=t[e[r++]],o+=t[e[r++]],o+=t[e[r++]],o+=t[e[r++]],o+=t[e[r++]],o+=t[e[r++]],o}}();var eXe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function Jve(n){return{asString:()=>eXe(this,void 0,void 0,function*(){return n}),asFile:()=>{},value:typeof n=="string"?n:void 0}}function Err(n,e,t){const i={id:aK(),name:n,uri:e,data:t};return{asString:()=>eXe(this,void 0,void 0,function*(){return""}),asFile:()=>i,value:void 0}}class tXe{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return Pi.some(this,([i,r])=>r.asFile())&&t.push("files"),iXe(oW(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))===null||t===void 0?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return oW(e)}}function oW(n){return n.toLowerCase()}function nXe(n,e){return iXe(oW(n),e.map(oW))}function iXe(n,e){if(n==="*/*")return e.length>0;if(e.includes(n))return!0;const t=n.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,r,o]=t;return o==="*"?e.some(s=>s.startsWith(r+"/")):!1}const lK=Object.freeze({create:n=>rw(n.map(e=>e.toString())).join(`\r
`),split:n=>n.split(`\r
`),parse:n=>lK.split(n).filter(e=>!e.startsWith("#"))}),eNe={EDITORS:"CodeEditors",FILES:"CodeFiles"};class xrr{}const krr={DragAndDropContribution:"workbench.contributions.dragAndDrop"};ds.add(krr.DragAndDropContribution,new xrr);class k4{constructor(){}static getInstance(){return k4.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}k4.INSTANCE=new k4;var Trr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function rXe(n){const e=new tXe;for(const t of n.items){const i=t.type;if(t.kind==="string"){const r=new Promise(o=>t.getAsString(o));e.append(i,Jve(r))}else if(t.kind==="file"){const r=t.getAsFile();r&&e.append(i,Irr(r))}}return e}function Irr(n){const e=n.path?Tn.parse(n.path):void 0;return Err(n.name,e,()=>Trr(this,void 0,void 0,function*(){return new Uint8Array(yield n.arrayBuffer())}))}const Lrr=Object.freeze([eNe.EDITORS,eNe.FILES,r4.RESOURCES,r4.INTERNAL_URI_LIST]);function oXe(n,e=!1){const t=rXe(n),i=t.get(r4.INTERNAL_URI_LIST);if(i)t.replace(Ks.uriList,i);else if(e||!t.has(Ks.uriList)){const r=[];for(const o of n.items){const s=o.getAsFile();if(s){const a=s.path;try{a?r.push(Tn.file(a).toString()):r.push(Tn.parse(s.name,!0).toString())}catch{}}}r.length&&t.replace(Ks.uriList,Jve(lK.create(r)))}for(const r of Lrr)t.delete(r);return t}function Drr(n,e,t){var i,r;return{edits:[...e.map(o=>new Xy(n,typeof t.insertText=="string"?{range:o,text:t.insertText,insertAsSnippet:!1}:{range:o,text:t.insertText.snippet,insertAsSnippet:!0})),...(r=(i=t.additionalEdit)===null||i===void 0?void 0:i.edits)!==null&&r!==void 0?r:[]]}}function sXe(n){var e;function t(a,l){return"providerId"in a&&a.providerId===l.providerId||"mimeType"in a&&a.mimeType===l.handledMimeType}const i=new Map;for(const a of n)for(const l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(const c of n)if(c!==a&&t(l,c)){let u=i.get(a);u||(u=[],i.set(a,u)),u.push(c)}if(!i.size)return Array.from(n);const r=new Set,o=[];function s(a){if(!a.length)return[];const l=a[0];if(o.includes(l))return console.warn(`Yield to cycle detected for ${l.providerId}`),a;if(r.has(l))return s(a.slice(1));let c=[];const u=i.get(l);return u&&(o.push(l),c=s(u),o.pop()),r.add(l),[...c,l,...s(a.slice(1))]}return s(Array.from(n))}var Arr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Rrr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Nrr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const Orr=hi.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:iUe,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class cK extends Ae{constructor(e,t,i,r,o){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(r),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=at(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=at("span.icon");this.domNode.append(t),t.classList.add(...In.asClassNameArray(Ct.loading),"codicon-modifier-spin");const i=()=>{const r=this.editor.getOption(66);this.domNode.style.height=`${r}px`,this.domNode.style.width=`${Math.ceil(.8*r)}px`};i(),this._register(this.editor.onDidChangeConfiguration(r=>{(r.hasChanged(52)||r.hasChanged(66))&&i()})),this._register(We(this.domNode,Lt.CLICK,r=>{this.delegate.cancel()}))}getId(){return cK.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}}cK.baseId="editor.widget.inlineProgressWidget";let sW=class extends Ae{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Zl),this._currentWidget=new Zl,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}showWhile(e,t,i){return Nrr(this,void 0,void 0,function*(){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=uw(()=>{const o=q.fromPositions(e);this._currentDecorations.set([{range:o,options:Orr}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(cK,this.id,this._editor,o,t,i))},this._showDelay);try{return yield i}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}})}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};sW=Arr([Rrr(2,Un)],sW);var aXe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},tP=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},tNe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Yle;let aW=Yle=class extends Ae{constructor(e,t,i,r,o,s,a,l,c,u){super(),this.typeId=e,this.editor=t,this.showCommand=r,this.range=o,this.edits=s,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=u,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(c),this.visibleContext.set(!0),this._register(Gn(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Gn(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(d=>{o.containsPosition(d.position)||this.dispose()})),this._register(Pt.runAndSubscribe(u.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var e;const t=(e=this._keybindingService.lookupKeybinding(this.showCommand.id))===null||e===void 0?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(t?` (${t})`:"")}create(){this.domNode=at(".post-edit-widget"),this.button=this._register(new Rae(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(We(this.domNode,Lt.CLICK,()=>this.showSelector()))}getId(){return Yle.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Oa(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>xL({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};aW.baseId="editor.widget.postEditWidget";aW=Yle=aXe([tP(7,om),tP(8,Yn),tP(9,mo)],aW);let lW=class extends Ae{constructor(e,t,i,r,o,s){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=r,this._instantiationService=o,this._bulkEditService=s,this._currentWidget=this._register(new Zl),this._register(Pt.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}applyEditAndShowIfNeeded(e,t,i,r){var o,s;return tNe(this,void 0,void 0,function*(){const a=this._editor.getModel();if(!a||!e.length)return;const l=t.allEdits[t.activeEditIndex];if(!l)return;let c=[];(typeof l.insertText=="string"?l.insertText==="":l.insertText.snippet==="")?c=[]:c=e.map(_=>new Xy(a.uri,typeof l.insertText=="string"?{range:_,text:l.insertText,insertAsSnippet:!1}:{range:_,text:l.insertText.snippet,insertAsSnippet:!0}));const d={edits:[...c,...(s=(o=l.additionalEdit)===null||o===void 0?void 0:o.edits)!==null&&s!==void 0?s:[]]},h=e[0],g=a.deltaDecorations([],[{range:h,options:{description:"paste-line-suffix",stickiness:0}}]);let p,m;try{p=yield this._bulkEditService.apply(d,{editor:this._editor,token:r}),m=a.getDecorationRange(g[0])}finally{a.deltaDecorations(g,[])}i&&p.isApplied&&t.allEdits.length>1&&this.show(m??h,t,_=>tNe(this,void 0,void 0,function*(){const v=this._editor.getModel();v&&(yield v.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:_,allEdits:t.allEdits},i,r))}))})}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(aW,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};lW=aXe([tP(4,Un),tP(5,L5)],lW);var Prr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},zT=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},ny=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Qle;const lXe="editor.changePasteType",cXe=new Ft("pasteWidgetVisible",!1,E("pasteWidgetVisible","Whether the paste widget is showing")),TJ="application/vnd.code.copyMetadata";let Zx=Qle=class extends Ae{static get(e){return e.getContribution(Qle.ID)}constructor(e,t,i,r,o,s,a){super(),this._bulkEditService=i,this._clipboardService=r,this._languageFeaturesService=o,this._quickInputService=s,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(We(l,"copy",c=>this.handleCopy(c))),this._register(We(l,"cut",c=>this.handleCopy(c))),this._register(We(l,"paste",c=>this.handlePaste(c),!0)),this._pasteProgressManager=this._register(new sW("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(lW,"pasteIntoEditor",e,cXe,{id:lXe,label:E("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},WU().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(84).enabled&&!this._editor.getOption(90)}handleCopy(e){var t,i;if(!this._editor.hasTextFocus()||(Qw&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const r=this._editor.getModel(),o=this._editor.getSelections();if(!r||!(o!=null&&o.length))return;const s=this._editor.getOption(37);let a=o;const l=o.length===1&&o[0].isEmpty();if(l){if(!s)return;a=[new q(a[0].startLineNumber,1,a[0].startLineNumber,1+r.getLineLength(a[0].startLineNumber))]}const c=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(o,s,vc),d={multicursorText:Array.isArray(c)?c:null,pasteOnNewLine:l,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(r).filter(v=>!!v.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:d});return}const g=rXe(e.clipboardData),p=h.flatMap(v=>{var b;return(b=v.copyMimeTypes)!==null&&b!==void 0?b:[]}),m=aK();this.setCopyMetadata(e.clipboardData,{id:m,providerCopyMimeTypes:p,defaultPastePayload:d});const _=za(v=>ny(this,void 0,void 0,function*(){const b=ob(yield Promise.all(h.map(y=>ny(this,void 0,void 0,function*(){try{return yield y.prepareDocumentPaste(r,a,g,v)}catch(C){console.error(C);return}}))));b.reverse();for(const y of b)for(const[C,x]of y)g.replace(C,x);return g}));(i=this._currentCopyOperation)===null||i===void 0||i.dataTransferPromise.cancel(),this._currentCopyOperation={handle:m,dataTransferPromise:_}}handlePaste(e){var t,i;return ny(this,void 0,void 0,function*(){if(!e.clipboardData||!this._editor.hasTextFocus())return;(t=this._currentPasteOperation)===null||t===void 0||t.cancel(),this._currentPasteOperation=void 0;const r=this._editor.getModel(),o=this._editor.getSelections();if(!(o!=null&&o.length)||!r||!this.isPasteAsEnabled())return;const s=this.fetchCopyMetadata(e),a=oXe(e.clipboardData);a.delete(TJ);const l=[...e.clipboardData.types,...(i=s==null?void 0:s.providerCopyMimeTypes)!==null&&i!==void 0?i:[],Ks.uriList],c=this._languageFeaturesService.documentPasteEditProvider.ordered(r).filter(u=>{var d;return(d=u.pasteMimeTypes)===null||d===void 0?void 0:d.some(h=>nXe(h,l))});c.length&&(e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,c,o,a,s):this.doPasteInline(c,o,a,s))})}doPasteInline(e,t,i,r){const o=za(s=>ny(this,void 0,void 0,function*(){const a=this._editor;if(!a.hasModel())return;const l=a.getModel(),c=new bw(a,3,void 0,s);try{if(yield this.mergeInDataFromCopy(i,r,c.token),c.token.isCancellationRequested)return;const u=e.filter(h=>nNe(h,i));if(!u.length||u.length===1&&u[0].id==="text"){yield this.applyDefaultPasteHandler(i,r,c.token);return}const d=yield this.getPasteEdits(u,i,l,t,c.token);if(c.token.isCancellationRequested)return;if(d.length===1&&d[0].providerId==="text"){yield this.applyDefaultPasteHandler(i,r,c.token);return}if(d.length){const h=a.getOption(84).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:d},h,c.token)}yield this.applyDefaultPasteHandler(i,r,c.token)}finally{c.dispose(),this._currentPasteOperation===o&&(this._currentPasteOperation=void 0)}}));this._pasteProgressManager.showWhile(t[0].getEndPosition(),E("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),o),this._currentPasteOperation=o}showPasteAsPick(e,t,i,r,o){const s=za(a=>ny(this,void 0,void 0,function*(){const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),u=new bw(l,3,void 0,a);try{if(yield this.mergeInDataFromCopy(r,o,u.token),u.token.isCancellationRequested)return;let d=t.filter(m=>nNe(m,r));e&&(d=d.filter(m=>m.id===e));const h=yield this.getPasteEdits(d,r,c,i,u.token);if(u.token.isCancellationRequested||!h.length)return;let g;if(e)g=h.at(0);else{const m=yield this._quickInputService.pick(h.map(_=>({label:_.label,description:_.providerId,detail:_.detail,edit:_})),{placeHolder:E("pasteAsPickerPlaceholder","Select Paste Action")});g=m==null?void 0:m.edit}if(!g)return;const p=Drr(c.uri,i,g);yield this._bulkEditService.apply(p,{editor:this._editor})}finally{u.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}}));this._progressService.withProgress({location:10,title:E("pasteAsProgress","Running paste handlers")},()=>s)}setCopyMetadata(e,t){e.setData(TJ,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const i=e.clipboardData.getData(TJ);if(i)try{return JSON.parse(i)}catch{return}const[r,o]=Cse.getTextData(e.clipboardData);if(o)return{defaultPastePayload:{mode:o.mode,multicursorText:(t=o.multicursorText)!==null&&t!==void 0?t:null,pasteOnNewLine:!!o.isFromEmptySelection}}}mergeInDataFromCopy(e,t,i){var r;return ny(this,void 0,void 0,function*(){if(t!=null&&t.id&&((r=this._currentCopyOperation)===null||r===void 0?void 0:r.handle)===t.id){const o=yield this._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[s,a]of o)e.replace(s,a)}if(!e.has(Ks.uriList)){const o=yield this._clipboardService.readResources();if(i.isCancellationRequested)return;o.length&&e.append(Ks.uriList,Jve(lK.create(o)))}})}getPasteEdits(e,t,i,r,o){return ny(this,void 0,void 0,function*(){const s=yield jU(Promise.all(e.map(l=>ny(this,void 0,void 0,function*(){var c;try{const u=yield(c=l.provideDocumentPasteEdits)===null||c===void 0?void 0:c.call(l,i,r,t,o);if(u)return Object.assign(Object.assign({},u),{providerId:l.id})}catch(u){console.error(u)}}))),o),a=ob(s??[]);return sXe(a)})}applyDefaultPasteHandler(e,t,i){var r,o,s;return ny(this,void 0,void 0,function*(){const a=(r=e.get(Ks.text))!==null&&r!==void 0?r:e.get("text");if(!a)return;const l=yield a.asString();if(i.isCancellationRequested)return;const c={text:l,pasteOnNewLine:(o=t==null?void 0:t.defaultPastePayload.pasteOnNewLine)!==null&&o!==void 0?o:!1,multicursorText:(s=t==null?void 0:t.defaultPastePayload.multicursorText)!==null&&s!==void 0?s:null,mode:null};this._editor.trigger("keyboard","paste",c)})}};Zx.ID="editor.contrib.copyPasteActionController";Zx=Qle=Prr([zT(1,Un),zT(2,L5),zT(3,F0),zT(4,en),zT(5,P_),zT(6,MKe)],Zx);function nNe(n,e){var t;return!!(!((t=n.pasteMimeTypes)===null||t===void 0)&&t.some(i=>e.matches(i)))}var ebe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},T4=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},E2=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const tbe=E("builtIn","Built-in");class nbe{provideDocumentPasteEdits(e,t,i,r){return E2(this,void 0,void 0,function*(){const o=yield this.getEdit(i,r);return o?{insertText:o.insertText,label:o.label,detail:o.detail,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}:void 0})}provideDocumentOnDropEdits(e,t,i,r){return E2(this,void 0,void 0,function*(){const o=yield this.getEdit(i,r);return o?{insertText:o.insertText,label:o.label,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}:void 0})}}class uXe extends nbe{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[Ks.text],this.pasteMimeTypes=[Ks.text]}getEdit(e,t){return E2(this,void 0,void 0,function*(){const i=e.get(Ks.text);if(!i||e.has(Ks.uriList))return;const r=yield i.asString();return{handledMimeType:Ks.text,label:E("text.label","Insert Plain Text"),detail:tbe,insertText:r}})}}class dXe extends nbe{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[Ks.uriList],this.pasteMimeTypes=[Ks.uriList]}getEdit(e,t){return E2(this,void 0,void 0,function*(){const i=yield hXe(e);if(!i.length||t.isCancellationRequested)return;let r=0;const o=i.map(({uri:a,originalText:l})=>a.scheme===Si.file?a.fsPath:(r++,l)).join(" ");let s;return r>0?s=i.length>1?E("defaultDropProvider.uriList.uris","Insert Uris"):E("defaultDropProvider.uriList.uri","Insert Uri"):s=i.length>1?E("defaultDropProvider.uriList.paths","Insert Paths"):E("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:Ks.uriList,insertText:o,label:s,detail:tbe}})}}let cW=class extends nbe{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[Ks.uriList],this.pasteMimeTypes=[Ks.uriList]}getEdit(e,t){return E2(this,void 0,void 0,function*(){const i=yield hXe(e);if(!i.length||t.isCancellationRequested)return;const r=ob(i.map(({uri:o})=>{const s=this._workspaceContextService.getWorkspaceFolder(o);return s?oji(s.uri,o):void 0}));if(r.length)return{handledMimeType:Ks.uriList,insertText:r.join(" "),label:i.length>1?E("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):E("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:tbe}})}};cW=ebe([T4(0,Bx)],cW);function hXe(n){return E2(this,void 0,void 0,function*(){const e=n.get(Ks.uriList);if(!e)return[];const t=yield e.asString(),i=[];for(const r of lK.parse(t))try{i.push({uri:Tn.parse(r),originalText:r})}catch{}return i})}let Xle=class extends Ae{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new uXe)),this._register(e.documentOnDropEditProvider.register("*",new dXe)),this._register(e.documentOnDropEditProvider.register("*",new cW(t)))}};Xle=ebe([T4(0,en),T4(1,Bx)],Xle);let Zle=class extends Ae{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new uXe)),this._register(e.documentPasteEditProvider.register("*",new dXe)),this._register(e.documentPasteEditProvider.register("*",new cW(t)))}};Zle=ebe([T4(0,en),T4(1,Bx)],Zle);gr(Zx.ID,Zx,0);Fq(Zle);Et(new class extends kl{constructor(){super({id:lXe,precondition:cXe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e,t){var i;return(i=Zx.get(e))===null||i===void 0?void 0:i.changePasteType()}});ht(class extends Gt{constructor(){super({id:"editor.action.pasteAs",label:E("pasteAs","Paste As..."),alias:"Paste As...",precondition:void 0,description:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:E("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(n,e,t){var i;const r=typeof(t==null?void 0:t.id)=="string"?t.id:void 0;return(i=Zx.get(e))===null||i===void 0?void 0:i.pasteAs(r)}});class Mrr{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}}class iNe{constructor(e){this.identifier=e}}const fXe=Vi("treeViewsDndService");Zi(fXe,Mrr,1);var Frr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},p$=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},iN=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Jle;const gXe="editor.experimental.dropIntoEditor.defaultProvider",pXe="editor.changeDropType",mXe=new Ft("dropWidgetVisible",!1,E("dropWidgetVisible","Whether the drop widget is showing"));let x2=Jle=class extends Ae{static get(e){return e.getContribution(Jle.ID)}constructor(e,t,i,r,o){super(),this._configService=i,this._languageFeaturesService=r,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=k4.getInstance(),this._dropProgressManager=this._register(t.createInstance(sW,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(lW,"dropIntoEditor",e,mXe,{id:pXe,label:E("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(s=>this.onDropIntoEditor(e,s.position,s.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}onDropIntoEditor(e,t,i){var r;return iN(this,void 0,void 0,function*(){if(!i.dataTransfer||!e.hasModel())return;(r=this._currentOperation)===null||r===void 0||r.cancel(),e.focus(),e.setPosition(t);const o=za(s=>iN(this,void 0,void 0,function*(){const a=new bw(e,1,void 0,s);try{const l=yield this.extractDataTransferData(i);if(l.size===0||a.token.isCancellationRequested)return;const c=e.getModel();if(!c)return;const u=this._languageFeaturesService.documentOnDropEditProvider.ordered(c).filter(h=>h.dropMimeTypes?h.dropMimeTypes.some(g=>l.matches(g)):!0),d=yield this.getDropEdits(u,c,t,l,a);if(a.token.isCancellationRequested)return;if(d.length){const h=this.getInitialActiveEditIndex(c,d),g=e.getOption(36).showDropSelector==="afterDrop";yield this._postDropWidgetManager.applyEditAndShowIfNeeded([q.fromPositions(t)],{activeEditIndex:h,allEdits:d},g,s)}}finally{a.dispose(),this._currentOperation===o&&(this._currentOperation=void 0)}}));this._dropProgressManager.showWhile(t,E("dropIntoEditorProgress","Running drop handlers. Click to cancel"),o),this._currentOperation=o})}getDropEdits(e,t,i,r,o){return iN(this,void 0,void 0,function*(){const s=yield jU(Promise.all(e.map(l=>iN(this,void 0,void 0,function*(){try{const c=yield l.provideDocumentOnDropEdits(t,i,r,o.token);if(c)return Object.assign(Object.assign({},c),{providerId:l.id})}catch(c){console.error(c)}}))),o.token),a=ob(s??[]);return sXe(a)})}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(gXe,{resource:e.uri});for(const[r,o]of Object.entries(i)){const s=t.findIndex(a=>o===a.providerId&&a.handledMimeType&&nXe(r,[a.handledMimeType]));if(s>=0)return s}return 0}extractDataTransferData(e){return iN(this,void 0,void 0,function*(){if(!e.dataTransfer)return new tXe;const t=oXe(e.dataTransfer);if(this.treeItemsTransfer.hasData(iNe.prototype)){const i=this.treeItemsTransfer.getData(iNe.prototype);if(Array.isArray(i))for(const r of i){const o=yield this._treeViewsDragAndDropService.removeDragOperationTransfer(r.identifier);if(o)for(const[s,a]of o)t.replace(s,a)}}return t})}};x2.ID="editor.contrib.dropIntoEditorController";x2=Jle=Frr([p$(1,Un),p$(2,Ui),p$(3,en),p$(4,fXe)],x2);gr(x2.ID,x2,2);Et(new class extends kl{constructor(){super({id:pXe,precondition:mXe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e,t){var i;(i=x2.get(e))===null||i===void 0||i.changeDropType()}});Fq(Xle);ds.as(O_.Configuration).registerConfiguration(Object.assign(Object.assign({},_q),{properties:{[gXe]:{type:"object",scope:5,description:E("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}}));class eu{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.removeDecorations(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(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);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}getDecorationRangeAt(e){const t=e<this._decorations.length?this._decorations[e]:null;return t?this._editor.getModel().getDecorationRange(t):null}getCurrentMatchesPosition(e){const t=this._editor.getModel().getDecorationsInRange(e);for(const i of t){const r=i.options;if(r===eu._FIND_MATCH_DECORATION||r===eu._CURRENT_FIND_MATCH_DECORATION)return this._getDecorationIndex(i.id)}return 0}setCurrentFindMatch(e){let t=null,i=0;if(e)for(let r=0,o=this._decorations.length;r<o;r++){const s=this._editor.getModel().getDecorationRange(this._decorations[r]);if(e.equalsRange(s)){t=this._decorations[r],i=r+1;break}}return(this._highlightedDecorationId!==null||t!==null)&&this._editor.changeDecorations(r=>{if(this._highlightedDecorationId!==null&&(r.changeDecorationOptions(this._highlightedDecorationId,eu._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,r.changeDecorationOptions(this._highlightedDecorationId,eu._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(r.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const s=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(s);o=new q(o.startLineNumber,o.startColumn,s,a)}this._rangeHighlightDecorationId=r.addDecoration(o,eu._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let r=eu._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){r=eu._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),c=this._editor.getLayoutInfo().height/a,u=Math.max(2,Math.ceil(3/c));let d=e[0].range.startLineNumber,h=e[0].range.endLineNumber;for(let g=1,p=e.length;g<p;g++){const m=e[g].range;h+u>=m.startLineNumber?m.endLineNumber>h&&(h=m.endLineNumber):(o.push({range:new q(d,1,h,1),options:eu._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),d=m.startLineNumber,h=m.endLineNumber)}o.push({range:new q(d,1,h,1),options:eu._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const s=new Array(e.length);for(let a=0,l=e.length;a<l;a++)s[a]={range:e[a].range,options:r};this._decorations=i.deltaDecorations(this._decorations,s),this._overviewRulerApproximateDecorations=i.deltaDecorations(this._overviewRulerApproximateDecorations,o),this._rangeHighlightDecorationId&&(i.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),this._findScopeDecorationIds.length&&(this._findScopeDecorationIds.forEach(a=>i.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,eu._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],r=this._editor.getModel().getDecorationRange(i);if(!(!r||r.endLineNumber>e.lineNumber)){if(r.endLineNumber<e.lineNumber)return r;if(!(r.endColumn>e.column))return r}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;t<i;t++){const r=this._decorations[t],o=this._editor.getModel().getDecorationRange(r);if(!(!o||o.startLineNumber<e.lineNumber)){if(o.startLineNumber>e.lineNumber)return o;if(!(o.startColumn<e.column))return o}}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}}eu._CURRENT_FIND_MATCH_DECORATION=hi.register({description:"current-find-match",stickiness:1,zIndex:13,className:"currentFindMatch",showIfCollapsed:!0,overviewRuler:{color:ms(a_e),position:ff.Center},minimap:{color:ms(jI),position:rh.Inline}});eu._FIND_MATCH_DECORATION=hi.register({description:"find-match",stickiness:1,zIndex:10,className:"findMatch",showIfCollapsed:!0,overviewRuler:{color:ms(a_e),position:ff.Center},minimap:{color:ms(jI),position:rh.Inline}});eu._FIND_MATCH_NO_OVERVIEW_DECORATION=hi.register({description:"find-match-no-overview",stickiness:1,className:"findMatch",showIfCollapsed:!0});eu._FIND_MATCH_ONLY_OVERVIEW_DECORATION=hi.register({description:"find-match-only-overview",stickiness:1,overviewRuler:{color:ms(a_e),position:ff.Center}});eu._RANGE_HIGHLIGHT_DECORATION=hi.register({description:"find-range-highlight",stickiness:1,className:"rangeHighlight",isWholeLine:!0});eu._FIND_SCOPE_DECORATION=hi.register({description:"find-scope",className:"findScope",isWholeLine:!0});class Brr{constructor(e,t,i){this._editorSelection=e,this._ranges=t,this._replaceStrings=i,this._trackedEditorSelectionId=null}getEditOperations(e,t){if(this._ranges.length>0){const i=[];for(let s=0;s<this._ranges.length;s++)i.push({range:this._ranges[s],text:this._replaceStrings[s]});i.sort((s,a)=>q.compareRangesUsingStarts(s.range,a.range));const r=[];let o=i[0];for(let s=1;s<i.length;s++)o.range.endLineNumber===i[s].range.startLineNumber&&o.range.endColumn===i[s].range.startColumn?(o.range=o.range.plusRange(i[s].range),o.text=o.text+i[s].text):(r.push(o),o=i[s]);r.push(o);for(const s of r)t.addEditOperation(s.range,s.text)}this._trackedEditorSelectionId=t.trackSelection(this._editorSelection)}computeCursorState(e,t){return t.getTrackedSelection(this._trackedEditorSelectionId)}}function _Xe(n,e){if(n&&n[0]!==""){const t=rNe(n,e,"-"),i=rNe(n,e,"_");return t&&!i?oNe(n,e,"-"):!t&&i?oNe(n,e,"_"):n[0].toUpperCase()===n[0]?e.toUpperCase():n[0].toLowerCase()===n[0]?e.toLowerCase():P6i(n[0][0])&&e.length>0?e[0].toUpperCase()+e.substr(1):n[0][0].toUpperCase()!==n[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function rNe(n,e,t){return n[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&n[0].split(t).length===e.split(t).length}function oNe(n,e,t){const i=e.split(t),r=n[0].split(t);let o="";return i.forEach((s,a)=>{o+=_Xe([r[a]],s)+t}),o.slice(0,-1)}class sNe{constructor(e){this.staticValue=e,this.kind=0}}class $rr{constructor(e){this.pieces=e,this.kind=1}}class k2{static fromStaticValue(e){return new k2([ox.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new sNe(""):e.length===1&&e[0].staticValue!==null?this._state=new sNe(e[0].staticValue):this._state=new $rr(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?_Xe(e,this._state.staticValue):this._state.staticValue;let i="";for(let r=0,o=this._state.pieces.length;r<o;r++){const s=this._state.pieces[r];if(s.staticValue!==null){i+=s.staticValue;continue}let a=k2._substitute(s.matchIndex,e);if(s.caseOps!==null&&s.caseOps.length>0){const l=[],c=s.caseOps.length;let u=0;for(let d=0,h=a.length;d<h;d++){if(u>=c){l.push(a.slice(d));break}switch(s.caseOps[u]){case"U":l.push(a[d].toUpperCase());break;case"u":l.push(a[d].toUpperCase()),u++;break;case"L":l.push(a[d].toLowerCase());break;case"l":l.push(a[d].toLowerCase()),u++;break;default:l.push(a[d])}}a=l.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e<t.length)return(t[e]||"")+i;i=String(e%10)+i,e=Math.floor(e/10)}return"$"+i}}class ox{static staticValue(e){return new ox(e,-1,null)}static caseOps(e,t){return new ox(null,e,t)}constructor(e,t,i){this.staticValue=e,this.matchIndex=t,!i||i.length===0?this.caseOps=null:this.caseOps=i.slice(0)}}class Vrr{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){e.length!==0&&(this._currentStaticPiece+=e)}emitMatchIndex(e,t,i){this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=ox.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),this._result[this._resultLen++]=ox.caseOps(e,i),this._lastCharIndex=t}finalize(){return this.emitUnchanged(this._source.length),this._currentStaticPiece.length!==0&&(this._result[this._resultLen++]=ox.staticValue(this._currentStaticPiece),this._currentStaticPiece=""),new k2(this._result)}}function Hrr(n){if(!n||n.length===0)return new k2(null);const e=[],t=new Vrr(n);for(let i=0,r=n.length;i<r;i++){const o=n.charCodeAt(i);if(o===92){if(i++,i>=r)break;const s=n.charCodeAt(i);switch(s){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(`
`,i+1);break;case 116:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(s));break}continue}if(o===36){if(i++,i>=r)break;const s=n.charCodeAt(i);if(s===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(s===48||s===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=s&&s<=57){let a=s-48;if(i+1<r){const l=n.charCodeAt(i+1);if(48<=l&&l<=57){i++,a=a*10+(l-48),t.emitUnchanged(i-2),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}t.emitUnchanged(i-1),t.emitMatchIndex(a,i+1,e),e.length=0;continue}}}return t.finalize()}const B0=new Ft("findWidgetVisible",!1);B0.toNegated();const uK=new Ft("findInputFocussed",!1),ibe=new Ft("replaceInputFocussed",!1),m$={primary:545,mac:{primary:2593}},_$={primary:565,mac:{primary:2613}},v$={primary:560,mac:{primary:2608}},b$={primary:554,mac:{primary:2602}},y$={primary:558,mac:{primary:2606}},Lo={StartFindAction:"actions.find",StartFindWithSelection:"actions.findWithSelection",StartFindWithArgs:"editor.actions.findWithArgs",NextMatchFindAction:"editor.action.nextMatchFindAction",PreviousMatchFindAction:"editor.action.previousMatchFindAction",GoToMatchFindAction:"editor.action.goToMatchFindAction",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"},sC=19999,Wrr=240;class nP{constructor(e,t){this._toDispose=new nt,this._editor=e,this._state=t,this._isDisposed=!1,this._startSearchingTimer=new nm,this._decorations=new eu(e),this._toDispose.add(this._decorations),this._updateDecorationsScheduler=new so(()=>this.research(!1),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===3||i.reason===5||i.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,Hr(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){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)},Wrr)):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 i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new q(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const r=this._findMatches(i,!1,sC);this._decorations.set(r,i);const o=this._editor.getSelection();let s=this._decorations.getCurrentMatchesPosition(o);if(s===0&&r.length>0){const a=RM(r.map(l=>l.range),l=>q.compareRangesUsingStarts(l,o)>=0);s=a>0?a-1+1:s}this._state.changeMatchInfo(s,this._decorations.getCount(),void 0),e&&this._editor.getOption(41).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:r}=e;const o=this._editor.getModel();return t||r===1?(i===1?i=o.getLineCount():i--,r=o.getLineMaxColumn(i)):r--,new Ce(i,r)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const u=this._decorations.matchAfterPosition(e);u&&this._setCurrentFindMatch(u);return}if(this._decorations.getCount()<sC){let u=this._decorations.matchBeforePosition(e);u&&u.isEmpty()&&u.getStartPosition().equals(e)&&(e=this._prevSearchPosition(e),u=this._decorations.matchBeforePosition(e)),u&&this._setCurrentFindMatch(u);return}if(this._cannotFind())return;const i=this._decorations.getFindScope(),r=nP._getSearchRange(this._editor.getModel(),i);r.getEndPosition().isBefore(e)&&(e=r.getEndPosition()),e.isBefore(r.getStartPosition())&&(e=r.getEndPosition());const{lineNumber:o,column:s}=e,a=this._editor.getModel();let l=new Ce(o,s),c=a.findPreviousMatch(this._state.searchString,l,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,!1);if(c&&c.range.isEmpty()&&c.range.getStartPosition().equals(l)&&(l=this._prevSearchPosition(l),c=a.findPreviousMatch(this._state.searchString,l,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,!1)),!!c){if(!t&&!r.containsRange(c.range))return this._moveToPrevMatch(c.range.getStartPosition(),!0);this._setCurrentFindMatch(c.range)}}moveToPrevMatch(){this._moveToPrevMatch(this._editor.getSelection().getStartPosition())}_nextSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:r}=e;const o=this._editor.getModel();return t||r===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,r=1):r++,new Ce(i,r)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()<sC){let i=this._decorations.matchAfterPosition(e);i&&i.isEmpty()&&i.getStartPosition().equals(e)&&(e=this._nextSearchPosition(e),i=this._decorations.matchAfterPosition(e)),i&&this._setCurrentFindMatch(i);return}const t=this._getNextMatch(e,!1,!0);t&&this._setCurrentFindMatch(t.range)}_getNextMatch(e,t,i,r=!1){if(this._cannotFind())return null;const o=this._decorations.getFindScope(),s=nP._getSearchRange(this._editor.getModel(),o);s.getEndPosition().isBefore(e)&&(e=s.getStartPosition()),e.isBefore(s.getStartPosition())&&(e=s.getStartPosition());const{lineNumber:a,column:l}=e,c=this._editor.getModel();let u=new Ce(a,l),d=c.findNextMatch(this._state.searchString,u,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,t);return i&&d&&d.range.isEmpty()&&d.range.getStartPosition().equals(u)&&(u=this._nextSearchPosition(u),d=c.findNextMatch(this._state.searchString,u,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,t)),d?!r&&!s.containsRange(d.range)?this._getNextMatch(d.range.getEndPosition(),t,i,!0):d:null}moveToNextMatch(){this._moveToNextMatch(this._editor.getSelection().getEndPosition())}_moveToMatch(e){const t=this._decorations.getDecorationRangeAt(e);t&&this._setCurrentFindMatch(t)}moveToMatch(e){this._moveToMatch(e)}_getReplacePattern(){return this._state.isRegex?Hrr(this._state.replaceString):k2.fromStaticValue(this._state.replaceString)}replace(){if(!this._hasMatches())return;const e=this._getReplacePattern(),t=this._editor.getSelection(),i=this._getNextMatch(t.getStartPosition(),!0,!1);if(i)if(t.equalsRange(i.range)){const r=e.buildReplaceString(i.matches,this._state.preserveCase),o=new oc(t,r);this._executeEditorCommand("replace",o),this._decorations.setStartPosition(new Ce(t.startLineNumber,t.startColumn+r.length)),this.research(!0)}else this._decorations.setStartPosition(this._editor.getPosition()),this._setCurrentFindMatch(i.range)}_findMatches(e,t,i){const r=(e||[null]).map(o=>nP._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,r,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=sC?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new KS(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let d="mu";i.ignoreCase&&(d+="i"),i.global&&(d+="g"),i=new RegExp(i.source,d)}const r=this._editor.getModel(),o=r.getValue(1),s=r.getFullModelRange(),a=this._getReplacePattern();let l;const c=this._state.preserveCase;a.hasReplacementPatterns||c?l=o.replace(i,function(){return a.buildReplaceString(arguments,c)}):l=o.replace(i,a.buildReplaceString(null,c));const u=new p_e(s,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",u)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),r=[];for(let s=0,a=i.length;s<a;s++)r[s]=t.buildReplaceString(i[s].matches,this._state.preserveCase);const o=new Brr(this._editor.getSelection(),i.map(s=>s.range),r);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,1073741824).map(o=>new ln(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const r=this._editor.getSelection();for(let o=0,s=i.length;o<s;o++)if(i[o].equalsRange(r)){i=[r].concat(i.slice(0,o)).concat(i.slice(o+1));break}this._editor.setSelections(i)}_executeEditorCommand(e,t){try{this._ignoreModelContentChanged=!0,this._editor.pushUndoStop(),this._editor.executeCommand(e,t),this._editor.pushUndoStop()}finally{this._ignoreModelContentChanged=!1}}}class dK extends im{constructor(e,t,i){super(),this._hideSoon=this._register(new so(()=>this._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const r={inputActiveOptionBorder:Bt(r_e),inputActiveOptionForeground:Bt(o_e),inputActiveOptionBackground:Bt(IE)};this.caseSensitive=this._register(new fGe(Object.assign({appendTitle:this._keybindingLabelFor(Lo.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase},r))),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new gGe(Object.assign({appendTitle:this._keybindingLabelFor(Lo.ToggleWholeWordCommand),isChecked:this._state.wholeWord},r))),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new pGe(Object.assign({appendTitle:this._keybindingLabelFor(Lo.ToggleRegexCommand),isChecked:this._state.isRegex},r))),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(o=>{let s=!1;o.isRegex&&(this.regex.checked=this._state.isRegex,s=!0),o.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,s=!0),o.matchCase&&(this.caseSensitive.checked=this._state.matchCase,s=!0),!this._state.isRevealed&&s&&this._revealTemporarily()})),this._register(We(this._domNode,Lt.MOUSE_LEAVE,o=>this._onMouseLeave())),this._register(We(this._domNode,"mouseover",o=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return dK.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){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")}}dK.ID="editor.contrib.findOptionsWidget";function C$(n,e){return n===1?!0:n===2?!1:e}class zrr extends Ae{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return C$(this._isRegexOverride,this._isRegex)}get wholeWord(){return C$(this._wholeWordOverride,this._wholeWord)}get matchCase(){return C$(this._matchCaseOverride,this._matchCase)}get preserveCase(){return C$(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}constructor(){super(),this._onFindReplaceStateChange=this._register(new be),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}changeMatchInfo(e,t,i){const r={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};let o=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,r.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,r.matchesCount=!0,o=!0),typeof i<"u"&&(q.equalsRange(this._currentMatch,i)||(this._currentMatch=i,r.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(r)}change(e,t,i=!0){var r;const o={moveCursor:t,updateHistory:i,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};let s=!1;const a=this.isRegex,l=this.wholeWord,c=this.matchCase,u=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,o.searchString=!0,s=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,o.replaceString=!0,s=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,o.isRevealed=!0,s=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,o.isReplaceRevealed=!0,s=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(!((r=e.searchScope)===null||r===void 0)&&r.every(d=>{var h;return(h=this._searchScope)===null||h===void 0?void 0:h.some(g=>!q.equalsRange(g,d))})||(this._searchScope=e.searchScope,o.searchScope=!0,s=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,o.loop=!0,s=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,o.isSearching=!0,s=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,o.filters=!0,s=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,a!==this.isRegex&&(s=!0,o.isRegex=!0),l!==this.wholeWord&&(s=!0,o.wholeWord=!0),c!==this.matchCase&&(s=!0,o.matchCase=!0),u!==this.preserveCase&&(s=!0,o.preserveCase=!0),s&&this._onFindReplaceStateChange.fire(o)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition<this.matchesCount}canNavigateInLoop(){return this._loop||this.matchesCount>=sC}}const jrr=E("defaultLabel","input"),Urr=E("label.preserveCaseToggle","Preserve Case");class qrr extends DA{constructor(e){super({icon:Ct.preserveCase,title:Urr+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class Krr extends im{constructor(e,t,i,r){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new be),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new be),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new be),this._onInput=this._register(new be),this._onKeyUp=this._register(new be),this._onPreserveCaseKeyDown=this._register(new be),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=r.placeholder||"",this.validation=r.validation,this.label=r.label||jrr;const o=r.appendPreserveCaseLabel||"",s=r.history||[],a=!!r.flexibleHeight,l=!!r.flexibleWidth,c=r.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new mGe(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:s,showHistoryHint:r.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:r.inputBoxStyles})),this.preserveCase=this._register(new qrr(Object.assign({appendTitle:o,isChecked:!1},r.toggleStyles))),this._register(this.preserveCase.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(h=>{this._onPreserveCaseKeyDown.fire(h)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const u=[this.preserveCase.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const g=u.indexOf(document.activeElement);if(g>=0){let p=-1;h.equals(17)?p=(g+1)%u.length:h.equals(15)&&(g===0?p=u.length-1:p=g-1),h.equals(9)?(u[g].blur(),this.inputBox.focus()):p>=0&&u[p].focus(),yi.stop(h,!0)}}});const d=document.createElement("div");d.className="controls",d.style.display=this._showOptionButtons?"block":"none",d.appendChild(this.preserveCase.domNode),this.domNode.appendChild(d),e==null||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,h=>this._onKeyDown.fire(h)),this.onkeyup(this.inputBox.inputElement,h=>this._onKeyUp.fire(h)),this.oninput(this.inputBox.inputElement,h=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,h=>this._onMouseDown.fire(h))}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()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){var e;(e=this.inputBox)===null||e===void 0||e.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var vXe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},bXe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const rbe=new Ft("suggestWidgetVisible",!1,E("suggestWidgetVisible","Whether suggestion are visible")),obe="historyNavigationWidgetFocus",yXe="historyNavigationForwardsEnabled",CXe="historyNavigationBackwardsEnabled";let n0;const w$=[];function wXe(n,e){if(w$.includes(e))throw new Error("Cannot register the same widget multiple times");w$.push(e);const t=new nt,i=new Ft(obe,!1).bindTo(n),r=new Ft(yXe,!0).bindTo(n),o=new Ft(CXe,!0).bindTo(n),s=()=>{i.set(!0),n0=e},a=()=>{i.set(!1),n0===e&&(n0=void 0)};return e.element===document.activeElement&&s(),t.add(e.onDidFocus(()=>s())),t.add(e.onDidBlur(()=>a())),t.add(Gn(()=>{w$.splice(w$.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:r,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let ece=class extends _Ge{constructor(e,t,i,r){super(e,t,i);const o=this._register(r.createScoped(this.inputBox.element));this._register(wXe(o,this.inputBox))}};ece=vXe([bXe(3,Yn)],ece);let tce=class extends Krr{constructor(e,t,i,r,o=!1){super(e,t,o,i);const s=this._register(r.createScoped(this.inputBox.element));this._register(wXe(s,this.inputBox))}};tce=vXe([bXe(3,Yn)],tce);Ld.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:Ke.and(Ke.has(obe),Ke.equals(CXe,!0),Ke.not("isComposing"),rbe.isEqualTo(!1)),primary:16,secondary:[528],handler:n=>{n0==null||n0.showPreviousValue()}});Ld.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:Ke.and(Ke.has(obe),Ke.equals(yXe,!0),Ke.not("isComposing"),rbe.isEqualTo(!1)),primary:18,secondary:[530],handler:n=>{n0==null||n0.showNextValue()}});function aNe(n){var e,t;return((e=n.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((t=n.lookupKeybinding("history.showNext"))===null||t===void 0?void 0:t.getElectronAccelerator())==="Down"}var Grr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const Yrr=Js("find-selection",Ct.selection,E("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),lNe=Js("find-collapsed",Ct.chevronRight,E("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),cNe=Js("find-expanded",Ct.chevronDown,E("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),Qrr=Js("find-replace",Ct.replace,E("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),Xrr=Js("find-replace-all",Ct.replaceAll,E("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),Zrr=Js("find-previous-match",Ct.arrowUp,E("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),Jrr=Js("find-next-match",Ct.arrowDown,E("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),eor=E("label.findDialog","Find / Replace"),tor=E("label.find","Find"),nor=E("placeholder.find","Find"),ior=E("label.previousMatchButton","Previous Match"),ror=E("label.nextMatchButton","Next Match"),oor=E("label.toggleSelectionFind","Find in Selection"),sor=E("label.closeButton","Close"),aor=E("label.replace","Replace"),lor=E("placeholder.replace","Replace"),cor=E("label.replaceButton","Replace"),uor=E("label.replaceAllButton","Replace All"),dor=E("label.toggleReplaceButton","Toggle Replace"),hor=E("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",sC),gor=E("label.matchesLocation","{0} of {1}"),uNe=E("label.noResults","No results"),Y_=419,por=275,mor=por-54;let rN=69;const _or=33,dNe="ctrlEnterReplaceAll.windows.donotask",hNe=Qi?256:2048;class IJ{constructor(e){this.afterLineNumber=e,this.heightInPx=_or,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function fNe(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){n.stopPropagation();return}}function gNe(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEnd<t.value.length){n.stopPropagation();return}}class hK extends im{constructor(e,t,i,r,o,s,a,l,c){super(),this._cachedHeight=null,this._revealTimeouts=[],this._codeEditor=e,this._controller=t,this._state=i,this._contextViewProvider=r,this._keybindingService=o,this._contextKeyService=s,this._storageService=l,this._notificationService=c,this._ctrlEnterReplaceAllWarningPrompted=!!l.getBoolean(dNe,0),this._isVisible=!1,this._isReplaceVisible=!1,this._ignoreChangeEvent=!1,this._updateHistoryDelayer=new Gp(500),this._register(Gn(()=>this._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(u=>this._onStateChanged(u))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(u=>{if(u.hasChanged(90)&&(this._codeEditor.getOption(90)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),u.hasChanged(143)&&this._tryUpdateWidgetWidth(),u.hasChanged(2)&&this.updateAccessibilitySupport(),u.hasChanged(41)){const d=this._codeEditor.getOption(41).loop;this._state.change({loop:d},!1);const h=this._codeEditor.getOption(41).addExtraSpaceOnTop;h&&!this._viewZone&&(this._viewZone=new IJ(0),this._showViewZone()),!h&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>Grr(this,void 0,void 0,function*(){if(this._isVisible){const u=yield this._controller.getGlobalBufferTerm();u&&u!==this._state.searchString&&(this._state.change({searchString:u},!1),this._findInput.select())}}))),this._findInputFocused=uK.bindTo(s),this._findFocusTracker=this._register(lb(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=ibe.bindTo(s),this._replaceFocusTracker=this._register(lb(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(41).addExtraSpaceOnTop&&(this._viewZone=new IJ(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(u=>{if(u.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return hK.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(90)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=_d(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){const t=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",t),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,fi)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=rN+"px",this._state.matchesCount>=sC?this._matchesCount.title=hor:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild);let e;if(this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=sC&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=Dx(gor,i,t)}else e=uNe;this._matchesCount.appendChild(document.createTextNode(e)),Pc(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),rN=Math.max(rN,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===uNe)return i===""?E("ariaSearchNoResultEmpty","{0} found",e):E("ariaSearchNoResult","{0} found for '{1}'",e,i);if(t){const r=E("ariaSearchNoResultWithLineNum","{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${r}`:r}return E("ariaSearchNoResultWithLineNumNoCurrentMatch","{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,i=this._toggleSelectionFind.checked;this._isVisible&&(i||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);const 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);const i=!this._codeEditor.getOption(90);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(41).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;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(41).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const r=Oa(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),s=r.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&a<this._viewZone.heightInPx){e.endLineNumber>e.startLineNumber&&(t=!1);const l=SUe(this._domNode).left;s>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());r.left+(c?c.left:0)>l&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),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(41).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(r=>{i.heightInPx=this._getHeight(),this._viewZoneId=r.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new IJ(0));const i=this._viewZone;this._codeEditor.changeViewZones(r=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===i.heightInPx)return;const s=o-i.heightInPx;i.heightInPx=o,r.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+s);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(83).top,o<=0)return;i.heightInPx=o,this._viewZoneId=r.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!Vme(this._domNode))return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const i=e.width,r=e.minimap.minimapWidth;let o=!1,s=!1,a=!1;if(this._resized&&_d(this._domNode)>Y_){this._domNode.style.maxWidth=`${i-28-r-15}px`,this._replaceInput.width=_d(this._findInput.domNode);return}if(Y_+28+r>=i&&(s=!0),Y_+28+r-rN>=i&&(a=!0),Y_+28+r-rN>=i+50&&(o=!0),this._domNode.classList.toggle("collapsed-find-widget",o),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",s),!a&&!o&&(this._domNode.style.maxWidth=`${i-28-r-15}px`),this._findInput.layout({collapsedFindWidget:o,narrowFindWidget:a,reducedFindWidget:s}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=_d(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 this._cachedHeight!==null&&this._cachedHeight===e?!1:(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){const e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const i=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!q.equalsRange(t,i)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(hNe|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(`
`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return fNe(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return gNe(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(hNe|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{vc&&h_&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(E("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(dNe,!0,0,0)),this._replaceInput.inputBox.insertAtCursor(`
`),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return fNe(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return gNe(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){this._findInput=this._register(new ece(null,this._contextViewProvider,{width:mor,label:tor,placeholder:nor,appendCaseSensitiveLabel:this._keybindingLabelFor(Lo.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Lo.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Lo.ToggleRegexCommand),validation:l=>{if(l.length===0||!this._findInput.getRegex())return null;try{return new RegExp(l,"gu"),null}catch(c){return{content:c.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>aNe(this._keybindingService),inputBoxStyles:EH,toggleStyles:SH},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(l=>this._onFindInputKeyDown(l))),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(l=>{l.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),l.preventDefault())})),this._register(this._findInput.onRegexKeyDown(l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),l.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(l=>{this._tryUpdateHeight()&&this._showViewZone()})),fu&&this._register(this._findInput.onMouseDown(l=>this._onFindInputMouseDown(l))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new jT({label:ior+this._keybindingLabelFor(Lo.PreviousMatchFindAction),icon:Zrr,onTrigger:()=>{xE(this._codeEditor.getAction(Lo.PreviousMatchFindAction)).run().then(void 0,fi)}})),this._nextBtn=this._register(new jT({label:ror+this._keybindingLabelFor(Lo.NextMatchFindAction),icon:Jrr,onTrigger:()=>{xE(this._codeEditor.getAction(Lo.NextMatchFindAction)).run().then(void 0,fi)}}));const i=document.createElement("div");i.className="find-part",i.appendChild(this._findInput.domNode);const r=document.createElement("div");r.className="find-actions",i.appendChild(r),r.appendChild(this._matchesCount),r.appendChild(this._prevBtn.domNode),r.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new DA({icon:Yrr,title:oor+this._keybindingLabelFor(Lo.ToggleSearchScopeCommand),isChecked:!1,inputActiveOptionBackground:Bt(IE),inputActiveOptionBorder:Bt(r_e),inputActiveOptionForeground:Bt(o_e)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){const l=this._codeEditor.getSelections();l.map(c=>(c.endColumn===1&&c.endLineNumber>c.startLineNumber&&(c=c.setEndPosition(c.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(c.endLineNumber-1))),c.isEmpty()?null:c)).filter(c=>!!c),l.length&&this._state.change({searchScope:l},!0)}}else this._state.change({searchScope:null},!0)})),r.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new jT({label:sor+this._keybindingLabelFor(Lo.CloseFindWidgetCommand),icon:VGe,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),l.preventDefault())}})),this._replaceInput=this._register(new tce(null,void 0,{label:aor,placeholder:lor,appendPreserveCaseLabel:this._keybindingLabelFor(Lo.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>aNe(this._keybindingService),inputBoxStyles:EH,toggleStyles:SH},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(l=>this._onReplaceInputKeyDown(l))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(l=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(l=>{l.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(),l.preventDefault())})),this._replaceBtn=this._register(new jT({label:cor+this._keybindingLabelFor(Lo.ReplaceOneAction),icon:Qrr,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new jT({label:uor+this._keybindingLabelFor(Lo.ReplaceAllAction),icon:Xrr,onTrigger:()=>{this._controller.replaceAll()}}));const o=document.createElement("div");o.className="replace-part",o.appendChild(this._replaceInput.domNode);const s=document.createElement("div");s.className="replace-actions",o.appendChild(s),s.appendChild(this._replaceBtn.domNode),s.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new jT({label:dor,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=_d(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.ariaLabel=eor,this._domNode.role="dialog",this._domNode.style.width=`${Y_}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(i),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(o),this._resizeSash=new kc(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=Y_;this._register(this._resizeSash.onDidStart(()=>{a=_d(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;const c=a+l.startX-l.currentX;if(c<Y_)return;const u=parseFloat(HU(this._domNode).maxWidth)||0;c>u||(this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=_d(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=_d(this._domNode);if(l<Y_)return;let c=Y_;if(!this._resized||l===Y_){const u=this._codeEditor.getLayoutInfo();c=u.width-28-u.minimap.minimapWidth-15,this._resized=!0}this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=_d(this._findInput.domNode)),this._findInput.inputBox.layout()}))}updateAccessibilitySupport(){const e=this._codeEditor.getOption(2);this._findInput.setFocusInputOnOptionClick(e!==2)}}hK.ID="editor.contrib.findWidget";class jT extends im{constructor(e){super(),this._opts=e;let t="button";this._opts.className&&(t=t+" "+this._opts.className),this._opts.icon&&(t=t+" "+In.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,i=>{this._opts.onTrigger(),i.preventDefault()}),this.onkeydown(this._domNode,i=>{var r,o;if(i.equals(10)||i.equals(3)){this._opts.onTrigger(),i.preventDefault();return}(o=(r=this._opts).onKeyDown)===null||o===void 0||o.call(r,i)})}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(...In.asClassNameArray(lNe)),this._domNode.classList.add(...In.asClassNameArray(cNe))):(this._domNode.classList.remove(...In.asClassNameArray(cNe)),this._domNode.classList.add(...In.asClassNameArray(lNe)))}}rm((n,e)=>{const t=(m,_)=>{_&&e.addRule(`.monaco-editor ${m} { background-color: ${_}; }`)};t(".findMatch",n.getColor($v)),t(".currentFindMatch",n.getColor(q7i)),t(".findScope",n.getColor(K7i));const i=n.getColor(As);t(".find-widget",i);const r=n.getColor(Ov);r&&e.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${r}; }`);const o=n.getColor(i_e);o&&e.addRule(`.monaco-editor .find-widget { border-left: 1px solid ${o}; border-right: 1px solid ${o}; border-bottom: 1px solid ${o}; }`);const s=n.getColor(Z1);s&&e.addRule(`.monaco-editor .findMatch { border: 1px ${m_(n.type)?"dotted":"solid"} ${s}; box-sizing: border-box; }`);const a=n.getColor(G7i);a&&e.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${a}; padding: 1px; box-sizing: border-box; }`);const l=n.getColor(Y7i);l&&e.addRule(`.monaco-editor .findScope { border: 1px ${m_(n.type)?"dashed":"solid"} ${l}; }`);const c=n.getColor(ji);c&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${c}; }`);const u=n.getColor(Fv);u&&e.addRule(`.monaco-editor .find-widget { color: ${u}; }`);const d=n.getColor(p7i);d&&e.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${d}; }`);const h=n.getColor(F7i);if(h)e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${h}; }`);else{const m=n.getColor(Bv);m&&e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${m}; }`)}const g=n.getColor(bse);g&&e.addRule(`
.monaco-editor .find-widget .button:not(.disabled):hover,
.monaco-editor .find-widget .codicon-find-selection:hover {
background-color: ${g} !important;
}
`);const p=n.getColor(Kh);p&&e.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${p}; }`)});var SXe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Fm=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Jx=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},nce;const vor=524288;function ice(n,e="single",t=!1){if(!n.hasModel())return null;const i=n.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const r=n.getConfiguredWordAtPosition(i.getStartPosition());if(r&&t===!1)return r.word}else if(n.getModel().getValueLengthInRange(i)<vor)return n.getModel().getValueInRange(i)}return null}let Xu=nce=class extends Ae{get editor(){return this._editor}static get(e){return e.getContribution(nce.ID)}constructor(e,t,i,r,o){super(),this._editor=e,this._findWidgetVisible=B0.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=r,this._notificationService=o,this._updateHistoryDelayer=new Gp(500),this._state=this._register(new zrr),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange(s=>this._onStateChanged(s))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const s=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),s&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(41).loop})}))}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,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}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!!uK.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()){const e=this._editor.getSelections();e.map(t=>(t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._editor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()?null:t)).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=hf(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e,t){return Jx(this,void 0,void 0,function*(){if(this.disposeModel(),!this._editor.hasModel())return;const i=Object.assign(Object.assign({},t),{isRevealed:!0});if(e.seedSearchStringFromSelection==="single"){const r=ice(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);r&&(this._state.isRegex?i.searchString=hf(r):i.searchString=r)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const r=ice(this._editor,e.seedSearchStringFromSelection);r&&(i.searchString=r)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const r=yield this.getGlobalBufferTerm();if(!this._editor.hasModel())return;r&&(i.searchString=r)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const r=this._editor.getSelections();r.some(o=>!o.isEmpty())&&(i.searchScope=r)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new nP(this._editor,this._state))})}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){var e;return this._model?!((e=this._editor.getModel())===null||e===void 0)&&e.isTooLargeForHeapOperation()?(this._notificationService.warn(E("too.large.for.replaceall","The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}getGlobalBufferTerm(){return Jx(this,void 0,void 0,function*(){return this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""})}setGlobalBufferTerm(e){this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};Xu.ID="editor.contrib.findController";Xu=nce=SXe([Fm(1,Yn),Fm(2,am),Fm(3,F0),Fm(4,ga)],Xu);let rce=class extends Xu{constructor(e,t,i,r,o,s,a,l){super(e,i,a,l,s),this._contextViewService=t,this._keybindingService=r,this._themeService=o,this._widget=null,this._findOptionsWidget=null}_start(e,t){const i=Object.create(null,{_start:{get:()=>super._start}});return Jx(this,void 0,void 0,function*(){this._widget||this._createFindWidget();const r=this._editor.getSelection();let o=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":o=!0;break;case"never":o=!1;break;case"multiline":{o=!!r&&r.startLineNumber!==r.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||o,yield i._start.call(this,e,t),this._widget&&(e.shouldFocus===2?this._widget.focusReplaceInput():e.shouldFocus===1&&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 hK(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new dK(this._editor,this._state,this._keybindingService))}};rce=SXe([Fm(1,O0),Fm(2,Yn),Fm(3,mo),Fm(4,ll),Fm(5,ga),Fm(6,am),Fm(7,F0)],rce);const bor=AUe(new DUe({id:Lo.StartFindAction,label:E("startFindAction","Find"),alias:"Find",precondition:Ke.or(ee.focus,Ke.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:J.MenubarEditMenu,group:"3_find",title:E({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));bor.addImplementation(0,(n,e,t)=>{const i=Xu.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop}):!1});const yor={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:E("actions.find.isRegexOverride",`Overrides "Use Regular Expression" flag.
The flag will not be saved for the future.
0: Do Nothing
1: True
2: False`)},wholeWord:{type:"boolean"},wholeWordOverride:{type:"number",description:E("actions.find.wholeWordOverride",`Overrides "Match Whole Word" flag.
The flag will not be saved for the future.
0: Do Nothing
1: True
2: False`)},matchCase:{type:"boolean"},matchCaseOverride:{type:"number",description:E("actions.find.matchCaseOverride",`Overrides "Math Case" flag.
The flag will not be saved for the future.
0: Do Nothing
1: True
2: False`)},preserveCase:{type:"boolean"},preserveCaseOverride:{type:"number",description:E("actions.find.preserveCaseOverride",`Overrides "Preserve Case" flag.
The flag will not be saved for the future.
0: Do Nothing
1: True
2: False`)},findInSelection:{type:"boolean"}}}}]};class Cor extends Gt{constructor(){super({id:Lo.StartFindWithArgs,label:E("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:yor})}run(e,t,i){return Jx(this,void 0,void 0,function*(){const r=Xu.get(t);if(r){const o=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:i.replaceString!==void 0,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};yield r.start({forceRevealReplace:!1,seedSearchStringFromSelection:r.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(i==null?void 0:i.findInSelection)||!1,loop:t.getOption(41).loop},o),r.setGlobalBufferTerm(r.getState().searchString)}})}}class wor extends Gt{constructor(){super({id:Lo.StartFindWithSelection,label:E("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 Jx(this,void 0,void 0,function*(){const i=Xu.get(t);i&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),i.setGlobalBufferTerm(i.getState().searchString))})}}class EXe extends Gt{run(e,t){return Jx(this,void 0,void 0,function*(){const i=Xu.get(t);i&&!this._run(i)&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(i))})}}class Sor extends EXe{constructor(){super({id:Lo.NextMatchFindAction,label:E("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:ee.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:Ke.and(ee.focus,uK),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class Eor extends EXe{constructor(){super({id:Lo.PreviousMatchFindAction,label:E("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:ee.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:Ke.and(ee.focus,uK),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class xor extends Gt{constructor(){super({id:Lo.GoToMatchFindAction,label:E("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:B0}),this._highlightDecorations=[]}run(e,t,i){const r=Xu.get(t);if(!r)return;const o=r.getState().matchesCount;if(o<1){e.get(ga).notify({severity:pq.Warning,message:E("findMatchAction.noResults","No matches. Try searching for something else.")});return}const a=e.get(P_).createInputBox();a.placeholder=E("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",o);const l=u=>{const d=parseInt(u);if(isNaN(d))return;const h=r.getState().matchesCount;if(d>0&&d<=h)return d-1;if(d<0&&d>=-h)return h+d},c=u=>{const d=l(u);if(typeof d=="number"){a.validationMessage=void 0,r.goToMatch(d);const h=r.getState().currentMatch;h&&this.addDecorations(t,h)}else a.validationMessage=E("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",r.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(u=>{c(u)}),a.onDidAccept(()=>{const u=l(a.value);typeof u=="number"?(r.goToMatch(u),a.hide()):a.validationMessage=E("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",r.getState().matchesCount)}),a.onDidHide(()=>{this.clearDecorations(t),a.dispose()}),a.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(i=>{this._highlightDecorations=i.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:ms(Nqe),position:ff.Full}}}])})}}class xXe extends Gt{run(e,t){return Jx(this,void 0,void 0,function*(){const i=Xu.get(t);if(!i)return;const r=ice(t,"single",!1);r&&i.setSearchString(r),this._run(i)||(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(i))})}}class kor extends xXe{constructor(){super({id:Lo.NextSelectionMatchFindAction,label:E("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:ee.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class Tor extends xXe{constructor(){super({id:Lo.PreviousSelectionMatchFindAction,label:E("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:ee.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const Ior=AUe(new DUe({id:Lo.StartFindReplaceAction,label:E("startReplace","Replace"),alias:"Replace",precondition:Ke.or(ee.focus,Ke.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:J.MenubarEditMenu,group:"3_find",title:E({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));Ior.addImplementation(0,(n,e,t)=>{if(!e.hasModel()||e.getOption(90))return!1;const i=Xu.get(e);if(!i)return!1;const r=e.getSelection(),o=i.isFindInputFocused(),s=!r.isEmpty()&&r.startLineNumber===r.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!o,a=o||s?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:s?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop})});gr(Xu.ID,rce,0);ht(Cor);ht(wor);ht(Sor);ht(Eor);ht(xor);ht(kor);ht(Tor);const M_=kl.bindToContribution(Xu.get);Et(new M_({id:Lo.CloseFindWidgetCommand,precondition:B0,handler:n=>n.closeFindWidget(),kbOpts:{weight:100+5,kbExpr:Ke.and(ee.focus,Ke.not("isComposing")),primary:9,secondary:[1033]}}));Et(new M_({id:Lo.ToggleCaseSensitiveCommand,precondition:void 0,handler:n=>n.toggleCaseSensitive(),kbOpts:{weight:100+5,kbExpr:ee.focus,primary:m$.primary,mac:m$.mac,win:m$.win,linux:m$.linux}}));Et(new M_({id:Lo.ToggleWholeWordCommand,precondition:void 0,handler:n=>n.toggleWholeWords(),kbOpts:{weight:100+5,kbExpr:ee.focus,primary:_$.primary,mac:_$.mac,win:_$.win,linux:_$.linux}}));Et(new M_({id:Lo.ToggleRegexCommand,precondition:void 0,handler:n=>n.toggleRegex(),kbOpts:{weight:100+5,kbExpr:ee.focus,primary:v$.primary,mac:v$.mac,win:v$.win,linux:v$.linux}}));Et(new M_({id:Lo.ToggleSearchScopeCommand,precondition:void 0,handler:n=>n.toggleSearchScope(),kbOpts:{weight:100+5,kbExpr:ee.focus,primary:b$.primary,mac:b$.mac,win:b$.win,linux:b$.linux}}));Et(new M_({id:Lo.TogglePreserveCaseCommand,precondition:void 0,handler:n=>n.togglePreserveCase(),kbOpts:{weight:100+5,kbExpr:ee.focus,primary:y$.primary,mac:y$.mac,win:y$.win,linux:y$.linux}}));Et(new M_({id:Lo.ReplaceOneAction,precondition:B0,handler:n=>n.replace(),kbOpts:{weight:100+5,kbExpr:ee.focus,primary:3094}}));Et(new M_({id:Lo.ReplaceOneAction,precondition:B0,handler:n=>n.replace(),kbOpts:{weight:100+5,kbExpr:Ke.and(ee.focus,ibe),primary:3}}));Et(new M_({id:Lo.ReplaceAllAction,precondition:B0,handler:n=>n.replaceAll(),kbOpts:{weight:100+5,kbExpr:ee.focus,primary:2563}}));Et(new M_({id:Lo.ReplaceAllAction,precondition:B0,handler:n=>n.replaceAll(),kbOpts:{weight:100+5,kbExpr:Ke.and(ee.focus,ibe),primary:void 0,mac:{primary:2051}}}));Et(new M_({id:Lo.SelectAllMatchesAction,precondition:B0,handler:n=>n.selectAllMatches(),kbOpts:{weight:100+5,kbExpr:ee.focus,primary:515}}));const Lor={0:" ",1:"u",2:"r"},pNe=65535,Bm=16777215,mNe=4278190080;class LJ{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<<i)!==0}set(e,t){const i=e/32|0,r=e%32,o=this._states[i];t?this._states[i]=o|1<<r:this._states[i]=o&~(1<<r)}}class Ph{constructor(e,t,i){if(e.length!==t.length||e.length>pNe)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new LJ(e.length),this._userDefinedStates=new LJ(e.length),this._recoveredStates=new LJ(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,r)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=r};for(let i=0,r=this._startIndexes.length;i<r;i++){const o=this._startIndexes[i],s=this._endIndexes[i];if(o>Bm||s>Bm)throw new Error("startLineNumber or endLineNumber must not exceed "+Bm);for(;e.length>0&&!t(o,s);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=o+((a&255)<<24),this._endIndexes[i]=s+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Bm}getEndLineNumber(e){return this._endIndexes[e]&Bm}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let r=0;r<this._types.length;r++)this._types[r]===e&&(this.setCollapsed(r,t),i=!0);return i}toRegion(e){return new Dor(this,e)}getParentIndex(e){this.ensureParentIndices();const t=((this._startIndexes[e]&mNe)>>>24)+((this._endIndexes[e]&mNe)>>>16);return t===pNe?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t<i;){const r=Math.floor((t+i)/2);e<this.getStartLineNumber(r)?i=r:t=r+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);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;t<this.length;t++)e[t]=`[${Lor[this.getSource(t)]}${this.isCollapsed(t)?"+":"-"}] ${this.getStartLineNumber(t)}/${this.getEndLineNumber(t)}`;return e.join(", ")}toFoldRange(e){return{startLineNumber:this._startIndexes[e]&Bm,endLineNumber:this._endIndexes[e]&Bm,type:this._types?this._types[e]:void 0,isCollapsed:this.isCollapsed(e),source:this.getSource(e)}}static fromFoldRanges(e){const t=e.length,i=new Uint32Array(t),r=new Uint32Array(t);let o=[],s=!1;for(let l=0;l<t;l++){const c=e[l];i[l]=c.startLineNumber,r[l]=c.endLineNumber,o.push(c.type),c.type&&(s=!0)}s||(o=void 0);const a=new Ph(i,r,o);for(let l=0;l<t;l++)e[l].isCollapsed&&a.setCollapsed(l,!0),a.setSource(l,e[l].source);return a}static sanitizeAndMerge(e,t,i){i=i??Number.MAX_VALUE;const r=(m,_)=>Array.isArray(m)?v=>v<_?m[v]:void 0:v=>v<_?m.toFoldRange(v):void 0,o=r(e,e.length),s=r(t,t.length);let a=0,l=0,c=o(0),u=s(0);const d=[];let h,g=0;const p=[];for(;c||u;){let m;if(u&&(!c||c.startLineNumber>=u.startLineNumber))c&&c.startLineNumber===u.startLineNumber?(u.source===1?m=u:(m=c,m.isCollapsed=u.isCollapsed&&c.endLineNumber===u.endLineNumber,m.source=0),c=o(++a)):(m=u,u.isCollapsed&&u.source===0&&(m.source=2)),u=s(++l);else{let _=l,v=u;for(;;){if(!v||v.startLineNumber>c.endLineNumber){m=c;break}if(v.source===1&&v.endLineNumber>c.endLineNumber)break;v=s(++_)}c=o(++a)}if(m){for(;h&&h.endLineNumber<m.startLineNumber;)h=d.pop();m.endLineNumber>m.startLineNumber&&m.startLineNumber>g&&m.endLineNumber<=i&&(!h||h.endLineNumber>=m.endLineNumber)&&(p.push(m),g=m.startLineNumber,h&&d.push(h),h=m)}}return p}}class Dor{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 Aor{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new be,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new Ph(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,r)=>i.regionIndex-r.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let r=0,o=-1,s=-1;const a=l=>{for(;r<l;){const c=this._regions.getEndLineNumber(r),u=this._regions.isCollapsed(r);if(c<=o){const d=this.regions.getSource(r)!==0;i.changeDecorationOptions(this._editorDecorationIds[r],this._decorationProvider.getDecorationOption(u,c<=s,d))}u&&c>s&&(s=c),r++}};for(const l of e){const c=l.regionIndex,u=this._editorDecorationIds[c];if(u&&!t[u]){t[u]=!0,a(c);const d=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,d),o=Math.max(o,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=r=>{for(const o of e)if(!(o.startLineNumber>r.endLineNumber||r.startLineNumber>o.endLineNumber))return!0;return!1};for(let r=0;r<this._regions.length;r++){const o=this._regions.toFoldRange(r);(o.source===0||!i(o))&&t.push(o)}this.updatePost(Ph.fromFoldRanges(t))}update(e,t=[]){const i=this._currentFoldedOrManualRanges(t),r=Ph.sanitizeAndMerge(e,i,this._textModel.getLineCount());this.updatePost(Ph.fromFoldRanges(r))}updatePost(e){const t=[];let i=-1;for(let r=0,o=e.length;r<o;r++){const s=e.getStartLineNumber(r),a=e.getEndLineNumber(r),l=e.isCollapsed(r),c=e.getSource(r)!==0,u={startLineNumber:s,startColumn:this._textModel.getLineMaxColumn(s),endLineNumber:a,endColumn:this._textModel.getLineMaxColumn(a)+1};t.push({range:u,options:this._decorationProvider.getDecorationOption(l,a<=i,c)}),l&&a>i&&(i=a)}this._decorationProvider.changeDecorations(r=>this._editorDecorationIds=r.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(r,o)=>{for(const s of e)if(r<s&&s<=o)return!0;return!1},i=[];for(let r=0,o=this._regions.length;r<o;r++){let s=this.regions.isCollapsed(r);const a=this.regions.getSource(r);if(s||a!==0){const l=this._regions.toFoldRange(r),c=this._textModel.getDecorationRange(this._editorDecorationIds[r]);c&&(s&&t(c.startLineNumber,c.endLineNumber)&&(s=!1),i.push({startLineNumber:c.startLineNumber,endLineNumber:c.endLineNumber,type:l.type,isCollapsed:s,source:a}))}}return i}getMemento(){const e=this._currentFoldedOrManualRanges(),t=[],i=this._textModel.getLineCount();for(let r=0,o=e.length;r<o;r++){const s=e[r];if(s.startLineNumber>=s.endLineNumber||s.startLineNumber<1||s.endLineNumber>i)continue;const a=this._getLinesChecksum(s.startLineNumber+1,s.endLineNumber);t.push({startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,isCollapsed:s.isCollapsed,source:s.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){var t,i;if(!Array.isArray(e))return;const r=[],o=this._textModel.getLineCount();for(const a of e){if(a.startLineNumber>=a.endLineNumber||a.startLineNumber<1||a.endLineNumber>o)continue;const l=this._getLinesChecksum(a.startLineNumber+1,a.endLineNumber);(!a.checksum||l===a.checksum)&&r.push({startLineNumber:a.startLineNumber,endLineNumber:a.endLineNumber,type:void 0,isCollapsed:(t=a.isCollapsed)!==null&&t!==void 0?t:!0,source:(i=a.source)!==null&&i!==void 0?i:0})}const s=Ph.sanitizeAndMerge(this._regions,r,o);this.updatePost(Ph.fromFoldRanges(s))}_getLinesChecksum(e,t){return QUe(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let r=this._regions.findRange(e),o=1;for(;r>=0;){const s=this._regions.toRegion(r);(!t||t(s,o))&&i.push(s),o++,r=s.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],r=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const s=[];for(let a=r,l=this._regions.length;a<l;a++){const c=this._regions.toRegion(a);if(this._regions.getStartLineNumber(a)<o){for(;s.length>0&&!c.containedBy(s[s.length-1]);)s.pop();s.push(c),t(c,s.length)&&i.push(c)}else break}}else for(let s=r,a=this._regions.length;s<a;s++){const l=this._regions.toRegion(s);if(this._regions.getStartLineNumber(s)<o)(!t||t(l))&&i.push(l);else break}return i}}function kXe(n,e,t){const i=[];for(const r of t){const o=n.getRegionAtLine(r);if(o){const s=!o.isCollapsed;if(i.push(o),e>1){const a=n.getRegionsInside(o,(l,c)=>l.isCollapsed!==s&&c<e);i.push(...a)}}}n.toggleCollapseState(i)}function OA(n,e,t=Number.MAX_VALUE,i){const r=[];if(i&&i.length>0)for(const o of i){const s=n.getRegionAtLine(o);if(s&&(s.isCollapsed!==e&&r.push(s),t>1)){const a=n.getRegionsInside(s,(l,c)=>l.isCollapsed!==e&&c<t);r.push(...a)}}else{const o=n.getRegionsInside(null,(s,a)=>s.isCollapsed!==e&&a<t);r.push(...o)}n.toggleCollapseState(r)}function TXe(n,e,t,i){const r=[];for(const o of i){const s=n.getAllRegionsAtLine(o,(a,l)=>a.isCollapsed!==e&&l<=t);r.push(...s)}n.toggleCollapseState(r)}function Ror(n,e,t){const i=[];for(const r of t){const o=n.getAllRegionsAtLine(r,s=>s.isCollapsed!==e);o.length>0&&i.push(o[0])}n.toggleCollapseState(i)}function Nor(n,e,t,i){const r=(s,a)=>a===e&&s.isCollapsed!==t&&!i.some(l=>s.containsLine(l)),o=n.getRegionsInside(null,r);n.toggleCollapseState(o)}function IXe(n,e,t){const i=[];for(const s of t){const a=n.getAllRegionsAtLine(s,void 0);a.length>0&&i.push(a[0])}const r=s=>i.every(a=>!a.containedBy(s)&&!s.containedBy(a))&&s.isCollapsed!==e,o=n.getRegionsInside(null,r);n.toggleCollapseState(o)}function sbe(n,e,t){const i=n.textModel,r=n.regions,o=[];for(let s=r.length-1;s>=0;s--)if(t!==r.isCollapsed(s)){const a=r.getStartLineNumber(s);e.test(i.getLineContent(a))&&o.push(r.toRegion(s))}n.toggleCollapseState(o)}function abe(n,e,t){const i=n.regions,r=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&r.push(i.toRegion(o));n.toggleCollapseState(r)}function Oor(n,e){let t=null;const i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){const r=i.parentIndex;r!==-1?t=e.regions.getStartLineNumber(r):t=null}return t}function Por(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let r=0;for(i!==-1&&(r=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=r)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber<n)return t.startLineNumber;t.regionIndex>0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function Mor(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){const i=t.parentIndex;let r=0;if(i!==-1)r=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;r=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex<e.regions.length){if(t=e.regions.toRegion(t.regionIndex+1),t.startLineNumber>=r)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>n)return t.startLineNumber;t.regionIndex<e.regions.length?t=e.regions.toRegion(t.regionIndex+1):t=null}return null}class For{get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}constructor(e){this._updateEventEmitter=new be,this._hasLineChanges=!1,this._foldingModel=e,this._foldingModelListener=e.onDidChange(t=>this.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||pw(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,r=0,o=Number.MAX_VALUE,s=-1;const a=this._foldingModel.regions;for(;i<a.length;i++){if(!a.isCollapsed(i))continue;const l=a.getStartLineNumber(i)+1,c=a.getEndLineNumber(i);o<=l&&c<=s||(!e&&r<this._hiddenRanges.length&&this._hiddenRanges[r].startLineNumber===l&&this._hiddenRanges[r].endLineNumber===c?(t.push(this._hiddenRanges[r]),r++):(e=!0,t.push(new q(l,1,c,1))),o=l,s=c)}(this._hasLineChanges||e||r<this._hiddenRanges.length)&&this.applyHiddenRanges(t)}applyHiddenRanges(e){this._hiddenRanges=e,this._hasLineChanges=!1,this._updateEventEmitter.fire(e)}hasRanges(){return this._hiddenRanges.length>0}isHidden(e){return _Ne(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let r=null;const o=s=>((!r||!Bor(s,r))&&(r=_Ne(this._hiddenRanges,s)),r?r.startLineNumber-1:null);for(let s=0,a=e.length;s<a;s++){let l=e[s];const c=o(l.startLineNumber);c&&(l=l.setStartPosition(c,i.getLineMaxColumn(c)),t=!0);const u=o(l.endLineNumber);u&&(l=l.setEndPosition(u,i.getLineMaxColumn(u)),t=!0),e[s]=l}return t}dispose(){this.hiddenRanges.length>0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function Bor(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function _Ne(n,e){const t=RM(n,i=>e<i.startLineNumber)-1;return t>=0&&n[t].endLineNumber>=e?n[t]:null}const $or=5e3,Vor="indent";class lbe{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=Vor}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,r=t&&t.markers;return Promise.resolve(zor(this.editorModel,i,r,this.foldingRangesLimit))}}let Hor=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Bm||t>Bm)return;const r=this._length;this._startIndexes[r]=e,this._endIndexes[r]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),r=new Uint32Array(this._length);for(let o=this._length-1,s=0;o>=0;o--,s++)i[s]=this._startIndexes[o],r[s]=this._endIndexes[o];return new Ph(i,r)}else{this._foldingRangesLimit.update(this._length,t);let i=0,r=this._indentOccurrences.length;for(let l=0;l<this._indentOccurrences.length;l++){const c=this._indentOccurrences[l];if(c){if(c+i>t){r=l;break}i+=c}}const o=e.getOptions().tabSize,s=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const u=this._startIndexes[l],d=e.getLineContent(u),h=uq(d,o);(h<r||h===r&&i++<t)&&(s[c]=u,a[c]=this._endIndexes[l],c++)}return new Ph(s,a)}}};const Wor={limit:$or,update:()=>{}};function zor(n,e,t,i=Wor){const r=n.getOptions().tabSize,o=new Hor(i);let s;t&&(s=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=n.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=n.getLineCount();c>0;c--){const u=n.getLineContent(c),d=uq(u,r);let h=a[a.length-1];if(d===-1){e&&(h.endAbove=c);continue}let g;if(s&&(g=u.match(s)))if(g[1]){let p=a.length-1;for(;p>0&&a[p].indent!==-2;)p--;if(p>0){a.length=p+1,h=a[p],o.insertFirst(c,h.line,d),h.line=c,h.indent=d,h.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(h.indent>d){do a.pop(),h=a[a.length-1];while(h.indent>d);const p=h.endAbove-1;p-c>=1&&o.insertFirst(c,p,d)}h.indent===d?h.endAbove=c:a.push({indent:d,endAbove:c,line:c})}return o.toIndentRanges(n)}const jor=re("editor.foldBackground",{light:mn(X1,.3),dark:mn(X1,.3),hcDark:null,hcLight:null},E("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);re("editorGutter.foldingControlForeground",{dark:Q1,light:Q1,hcDark:Q1,hcLight:Q1},E("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const fK=Js("folding-expanded",Ct.chevronDown,E("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),gK=Js("folding-collapsed",Ct.chevronRight,E("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),LXe=Js("folding-manual-collapsed",gK,E("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),DXe=Js("folding-manual-expanded",fK,E("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),cbe={color:ms(jor),position:rh.Inline};class va{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?va.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?va.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:va.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:va.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?va.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:va.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?va.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:va.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?va.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:va.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?va.MANUALLY_EXPANDED_VISUAL_DECORATION:va.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}va.COLLAPSED_VISUAL_DECORATION=hi.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:In.asClassName(gK)});va.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=hi.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:cbe,isWholeLine:!0,firstLineDecorationClassName:In.asClassName(gK)});va.MANUALLY_COLLAPSED_VISUAL_DECORATION=hi.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:In.asClassName(LXe)});va.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=hi.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:cbe,isWholeLine:!0,firstLineDecorationClassName:In.asClassName(LXe)});va.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=hi.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0});va.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=hi.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:cbe,isWholeLine:!0});va.EXPANDED_VISUAL_DECORATION=hi.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+In.asClassName(fK)});va.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=hi.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:In.asClassName(fK)});va.MANUALLY_EXPANDED_VISUAL_DECORATION=hi.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+In.asClassName(DXe)});va.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=hi.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:In.asClassName(DXe)});va.NO_CONTROLS_EXPANDED_RANGE_DECORATION=hi.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});va.HIDDEN_RANGE_DECORATION=hi.register({description:"folding-hidden-range-decoration",stickiness:1});const Uor={},qor="syntax";class ube{constructor(e,t,i,r,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=r,this.fallbackRangeProvider=o,this.id=qor,this.disposables=new nt,o&&this.disposables.add(o);for(const s of t)typeof s.onDidChange=="function"&&this.disposables.add(s.onDidChange(i))}compute(e){return Kor(this.providers,this.editorModel,e).then(t=>{var i,r;return t?Yor(t,this.foldingRangesLimit):(r=(i=this.fallbackRangeProvider)===null||i===void 0?void 0:i.compute(e))!==null&&r!==void 0?r:null})}dispose(){this.disposables.dispose()}}function Kor(n,e,t){let i=null;const r=n.map((o,s)=>Promise.resolve(o.provideFoldingRanges(e,Uor,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&i.push({start:c.start,end:c.end,rank:s,kind:c.kind})}},Sa));return Promise.all(r).then(o=>i)}class Gor{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,r){if(e>Bm||t>Bm)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=r,this._types[o]=i,this._length++,r<30&&(this._nestingLevelCounts[r]=(this._nestingLevelCounts[r]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let r=0;r<this._length;r++)t[r]=this._startIndexes[r],i[r]=this._endIndexes[r];return new Ph(t,i,this._types)}else{this._foldingRangesLimit.update(this._length,e);let t=0,i=this._nestingLevelCounts.length;for(let a=0;a<this._nestingLevelCounts.length;a++){const l=this._nestingLevelCounts[a];if(l){if(l+t>e){i=a;break}t+=l}}const r=new Uint32Array(e),o=new Uint32Array(e),s=[];for(let a=0,l=0;a<this._length;a++){const c=this._nestingLevels[a];(c<i||c===i&&t++<e)&&(r[l]=this._startIndexes[a],o[l]=this._endIndexes[a],s[l]=this._types[a],l++)}return new Ph(r,o,s)}}}function Yor(n,e){const t=n.sort((s,a)=>{let l=s.start-a.start;return l===0&&(l=s.rank-a.rank),l}),i=new Gor(e);let r;const o=[];for(const s of t)if(!r)r=s,i.add(s.start,s.end,s.kind&&s.kind.value,o.length);else if(s.start>r.start)if(s.end<=r.end)o.push(r),r=s,i.add(s.start,s.end,s.kind&&s.kind.value,o.length);else{if(s.start>r.end){do r=o.pop();while(r&&s.start>r.end);r&&o.push(r),r=s}i.add(s.start,s.end,s.kind&&s.kind.value,o.length)}return i.toIndentRanges()}var Qor=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},oN=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Xor=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},oI;const Wc=new Ft("foldingEnabled",!1);let _b=oI=class extends Ae{static get(e){return e.getContribution(oI.ID)}static getFoldingRangeProviders(e,t){var i,r;const o=e.foldingRangeProvider.ordered(t);return(r=(i=oI._foldingRangeSelector)===null||i===void 0?void 0:i.call(oI,o,t))!==null&&r!==void 0?r:o}constructor(e,t,i,r,o,s){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=s,this.localToDispose=this._register(new nt),this.editor=e,this._foldingLimitReporter=new AXe(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=o.for(s.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new va(e),this.foldingDecorationProvider.showFoldingControls=a.get(109),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=Wc.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(47)&&this.onModelChanged(),l.hasChanged(109)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(109),this.foldingDecorationProvider.showFoldingHighlights=c.get(45),this.triggerFoldingModelChanged()}l.hasChanged(44)&&(this._useFoldingProviders=this.editor.getOptions().get(44)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),l.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new Aor(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new For(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Gp(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new so(()=>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(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{var t,i;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)===null||t===void 0||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(i=this.rangeProvider)===null||i===void 0||i.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)===null||e===void 0||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new lbe(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=oI.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new ube(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)===null||t===void 0||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 $c,i=this.getRangeProvider(e.textModel),r=this.foldingRegionPromise=za(o=>i.compute(o));return r.then(o=>{if(o&&r===this.foldingRegionPromise){let s;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const u=o.setCollapsedAllOfType(Wu.Imports.value,!0);u&&(s=k_.capture(this.editor),this._currentModelHasFoldedImports=u)}const a=this.editor.getSelections(),l=a?a.map(u=>u.startLineNumber):[];e.update(o,l),s==null||s.restore(this.editor);const c=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=c)}return e})}).then(void 0,e=>(fi(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const r=[];for(const o of i){const s=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(s)&&r.push(...t.getAllRegionsAtLine(s,a=>a.isCollapsed&&s>a.startLineNumber))}r.length&&(t.toggleCollapseState(r),this.reveal(i[0].getPosition()))}}}).then(void 0,fi)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const r=e.target.detail,o=e.target.element.offsetLeft;if(r.offsetX-o<4)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const r=this.editor.getModel();if(r&&t.startColumn===r.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,r=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(r){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(i))return}const s=t.getRegionAtLine(i);if(s&&s.startLineNumber===i){const a=s.isCollapsed;if(r||a){const l=e.event.altKey;let c=[];if(l){const u=h=>!h.containedBy(s)&&!s.containedBy(h),d=t.getRegionsInside(null,u);for(const h of d)h.isCollapsed&&c.push(h);c.length===0&&(c=d)}else{const u=e.event.middleButton||e.event.shiftKey;if(u)for(const d of t.getRegionsInside(s))d.isCollapsed===a&&c.push(d);(a||!u||c.length===0)&&c.push(s)}t.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};_b.ID="editor.contrib.folding";_b=oI=Qor([oN(1,Yn),oN(2,xo),oN(3,ga),oN(4,Fg),oN(5,en)],_b);class AXe{constructor(e){this.editor=e,this._onDidChange=new be,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class mu extends Gt{runEditorCommand(e,t,i){const r=e.get(xo),o=_b.get(t);if(!o)return;const s=o.getFoldingModel();if(s)return this.reportTelemetry(e,t),s.then(a=>{if(a){this.invoke(o,a,t,i,r);const l=t.getSelection();l&&o.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function RXe(n){if(!Xd(n)){if(!Vu(n))return!1;const e=n;if(!Xd(e.levels)&&!ow(e.levels)||!Xd(e.direction)&&!Ku(e.direction)||!Xd(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(ow)))return!1}return!0}class Zor extends mu{constructor(){super({id:"editor.unfold",label:E("unfoldAction.label","Unfold"),alias:"Unfold",precondition:Wc,kbOpts:{kbExpr:ee.editorTextFocus,primary:3166,mac:{primary:2654},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:
* 'levels': Number of levels to unfold. If not set, defaults to 1.
* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.
* 'selectionLines': Array of 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.
`,constraint:RXe,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,i,r){const o=r&&r.levels||1,s=this.getLineNumbers(r,i);r&&r.direction==="up"?TXe(t,!1,o,s):OA(t,!1,o,s)}}class Jor extends mu{constructor(){super({id:"editor.unfoldRecursively",label:E("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:Wc,kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2142),weight:100}})}invoke(e,t,i,r){OA(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class esr extends mu{constructor(){super({id:"editor.fold",label:E("foldAction.label","Fold"),alias:"Fold",precondition:Wc,kbOpts:{kbExpr:ee.editorTextFocus,primary:3164,mac:{primary:2652},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:
* 'levels': Number of levels to fold.
* 'direction': If 'up', folds given number of levels up otherwise folds down.
* 'selectionLines': Array of 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.
If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.
`,constraint:RXe,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,r){const o=this.getLineNumbers(r,i),s=r&&r.levels,a=r&&r.direction;typeof s!="number"&&typeof a!="string"?Ror(t,!0,o):a==="up"?TXe(t,!0,s||1,o):OA(t,!0,s||1,o)}}class tsr extends mu{constructor(){super({id:"editor.toggleFold",label:E("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:Wc,kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2090),weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);kXe(t,1,r)}}class nsr extends mu{constructor(){super({id:"editor.foldRecursively",label:E("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:Wc,kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2140),weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);OA(t,!0,Number.MAX_VALUE,r)}}class isr extends mu{constructor(){super({id:"editor.foldAllBlockComments",label:E("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:Wc,kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2138),weight:100}})}invoke(e,t,i,r,o){if(t.regions.hasTypes())abe(t,Wu.Comment.value,!0);else{const s=i.getModel();if(!s)return;const a=o.getLanguageConfiguration(s.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+hf(a.blockCommentStartToken));sbe(t,l,!0)}}}}class rsr extends mu{constructor(){super({id:"editor.foldAllMarkerRegions",label:E("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:Wc,kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2077),weight:100}})}invoke(e,t,i,r,o){if(t.regions.hasTypes())abe(t,Wu.Region.value,!0);else{const s=i.getModel();if(!s)return;const a=o.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);sbe(t,l,!0)}}}}class osr extends mu{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:E("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:Wc,kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2078),weight:100}})}invoke(e,t,i,r,o){if(t.regions.hasTypes())abe(t,Wu.Region.value,!1);else{const s=i.getModel();if(!s)return;const a=o.getLanguageConfiguration(s.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);sbe(t,l,!1)}}}}class ssr extends mu{constructor(){super({id:"editor.foldAllExcept",label:E("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:Wc,kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2136),weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);IXe(t,!0,r)}}class asr extends mu{constructor(){super({id:"editor.unfoldAllExcept",label:E("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:Wc,kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2134),weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);IXe(t,!1,r)}}class lsr extends mu{constructor(){super({id:"editor.foldAll",label:E("foldAllAction.label","Fold All"),alias:"Fold All",precondition:Wc,kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2069),weight:100}})}invoke(e,t,i){OA(t,!0)}}class csr extends mu{constructor(){super({id:"editor.unfoldAll",label:E("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:Wc,kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2088),weight:100}})}invoke(e,t,i){OA(t,!1)}}class ek extends mu{getFoldingLevel(){return parseInt(this.id.substr(ek.ID_PREFIX.length))}invoke(e,t,i){Nor(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}ek.ID_PREFIX="editor.foldLevel";ek.ID=n=>ek.ID_PREFIX+n;class usr extends mu{constructor(){super({id:"editor.gotoParentFold",label:E("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:Wc,kbOpts:{kbExpr:ee.editorTextFocus,weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);if(r.length>0){const o=Oor(r[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class dsr extends mu{constructor(){super({id:"editor.gotoPreviousFold",label:E("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:Wc,kbOpts:{kbExpr:ee.editorTextFocus,weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);if(r.length>0){const o=Por(r[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class hsr extends mu{constructor(){super({id:"editor.gotoNextFold",label:E("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:Wc,kbOpts:{kbExpr:ee.editorTextFocus,weight:100}})}invoke(e,t,i){const r=this.getSelectedLines(i);if(r.length>0){const o=Mor(r[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class fsr extends mu{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:E("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:Wc,kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2135),weight:100}})}invoke(e,t,i){var r;const o=[],s=i.getSelections();if(s){for(const a of s){let l=a.endLineNumber;a.endColumn===1&&--l,l>a.startLineNumber&&(o.push({startLineNumber:a.startLineNumber,endLineNumber:l,type:void 0,isCollapsed:!0,source:1}),i.setSelection({startLineNumber:a.startLineNumber,startColumn:1,endLineNumber:a.startLineNumber,endColumn:1}))}if(o.length>0){o.sort((l,c)=>l.startLineNumber-c.startLineNumber);const a=Ph.sanitizeAndMerge(t.regions,o,(r=i.getModel())===null||r===void 0?void 0:r.getLineCount());t.updatePost(Ph.fromFoldRanges(a))}}}}class gsr extends mu{constructor(){super({id:"editor.removeManualFoldingRanges",label:E("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:Wc,kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2137),weight:100}})}invoke(e,t,i){const r=i.getSelections();if(r){const o=[];for(const s of r){const{startLineNumber:a,endLineNumber:l}=s;o.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}gr(_b.ID,_b,0);ht(Zor);ht(Jor);ht(esr);ht(nsr);ht(lsr);ht(csr);ht(isr);ht(rsr);ht(osr);ht(ssr);ht(asr);ht(tsr);ht(usr);ht(dsr);ht(hsr);ht(fsr);ht(gsr);for(let n=1;n<=7;n++)p$i(new ek({id:ek.ID(n),label:E("foldLevelAction.label","Fold Level {0}",n),alias:`Fold Level ${n}`,precondition:Wc,kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2048|21+n),weight:100}}));Xi.registerCommand("_executeFoldingRangeProvider",function(n,...e){return Xor(this,void 0,void 0,function*(){const[t]=e;if(!(t instanceof Tn))throw gg();const i=n.get(en),r=n.get(ts).getModel(t);if(!r)throw gg();const o=n.get(Ui);if(!o.getValue("editor.folding",{resource:t}))return[];const s=n.get(xo),a=o.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(g,p)=>{}},c=new lbe(r,s,l);let u=c;if(a!=="indentation"){const g=_b.getFoldingRangeProviders(i,r);g.length&&(u=new ube(r,g,()=>{},l,c))}const d=yield u.compute(Mi.None),h=[];try{if(d)for(let g=0;g<d.length;g++){const p=d.getType(g);h.push({start:d.getStartLineNumber(g),end:d.getEndLineNumber(g),kind:p?Wu.fromValue(p):void 0})}return h}finally{u.dispose()}})});class psr extends Gt{constructor(){super({id:"editor.action.fontZoomIn",label:E("EditorFontZoomIn.label","Editor Font Zoom In"),alias:"Editor Font Zoom In",precondition:void 0})}run(e,t){Yf.setZoomLevel(Yf.getZoomLevel()+1)}}class msr extends Gt{constructor(){super({id:"editor.action.fontZoomOut",label:E("EditorFontZoomOut.label","Editor Font Zoom Out"),alias:"Editor Font Zoom Out",precondition:void 0})}run(e,t){Yf.setZoomLevel(Yf.getZoomLevel()-1)}}class _sr extends Gt{constructor(){super({id:"editor.action.fontZoomReset",label:E("EditorFontZoomReset.label","Editor Font Zoom Reset"),alias:"Editor Font Zoom Reset",precondition:void 0})}run(e,t){Yf.setZoomLevel(0)}}ht(psr);ht(msr);ht(_sr);var NXe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},uW=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},dbe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let I4=class{constructor(e,t,i){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._disposables=new nt,this._sessionDisposables=new nt,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(r=>{r.hasChanged(56)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(56)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new $V;for(const r of t.autoFormatTriggerCharacters)i.add(r.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(r=>{const o=r.charCodeAt(r.length-1);i.has(o)&&this._trigger(String.fromCharCode(o))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),r=new da,o=this._editor.onDidChangeModelContent(s=>{if(s.isFlush){r.cancel(),o.dispose();return}for(let a=0,l=s.changes.length;a<l;a++)if(s.changes[a].range.endLineNumber<=i.lineNumber){r.cancel(),o.dispose();return}});_Ye(this._workerService,this._languageFeaturesService,t,i,e,t.getFormattingOptions(),r.token).then(s=>{r.token.isCancellationRequested||Fc(s)&&(_2.execute(this._editor,s,!0),Nve(s))}).finally(()=>{o.dispose()})}};I4.ID="editor.contrib.autoFormat";I4=NXe([uW(1,en),uW(2,lm)],I4);let L4=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new nt,this._callOnModel=new nt,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(55)&&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(mYe,this.editor,e,2,Zy.None,Mi.None).catch(fi))}};L4.ID="editor.contrib.formatOnPaste";L4=NXe([uW(1,en),uW(2,Un)],L4);class vsr extends Gt{constructor(){super({id:"editor.action.formatDocument",label:E("formatDocument.label","Format Document"),alias:"Format Document",precondition:Ke.and(ee.notInCompositeEditor,ee.writable,ee.hasDocumentFormattingProvider),kbOpts:{kbExpr:ee.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}run(e,t){return dbe(this,void 0,void 0,function*(){if(t.hasModel()){const i=e.get(Un);yield e.get(iS).showWhile(i.invokeFunction(Ter,t,1,Zy.None,Mi.None),250)}})}}class bsr extends Gt{constructor(){super({id:"editor.action.formatSelection",label:E("formatSelection.label","Format Selection"),alias:"Format Selection",precondition:Ke.and(ee.writable,ee.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2084),weight:100},contextMenuOpts:{when:ee.hasNonEmptySelection,group:"1_modification",order:1.31}})}run(e,t){return dbe(this,void 0,void 0,function*(){if(!t.hasModel())return;const i=e.get(Un),r=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new q(a.startLineNumber,1,a.startLineNumber,r.getLineMaxColumn(a.startLineNumber)):a);yield e.get(iS).showWhile(i.invokeFunction(mYe,t,o,1,Zy.None,Mi.None),250)})}}gr(I4.ID,I4,2);gr(L4.ID,L4,2);ht(vsr);ht(bsr);Xi.registerCommand("editor.action.format",n=>dbe(void 0,void 0,void 0,function*(){const e=n.get(Lr).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=n.get(Fs);e.getSelection().isEmpty()?yield t.executeCommand("editor.action.formatDocument"):yield t.executeCommand("editor.action.formatSelection")}));var ysr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},DJ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Csr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class nL{remove(){var e;(e=this.parent)===null||e===void 0||e.children.delete(this.id)}static findId(e,t){let i;typeof e=="string"?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,t.children.get(i)!==void 0&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let r=i;for(let o=0;t.children.get(r)!==void 0;o++)r=`${i}_${o}`;return r}static empty(e){return e.children.size===0}}class oce extends nL{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class OXe extends nL{constructor(e,t,i,r){super(),this.id=e,this.parent=t,this.label=i,this.order=r,this.children=new Map}}class by extends nL{static create(e,t,i){const r=new da(i),o=new by(t.uri),s=e.ordered(t),a=s.map((c,u)=>{var d;const h=nL.findId(`provider_${u}`,o),g=new OXe(h,o,(d=c.displayName)!==null&&d!==void 0?d:"Unknown Outline Provider",u);return Promise.resolve(c.provideDocumentSymbols(t,r.token)).then(p=>{for(const m of p||[])by._makeOutlineElement(m,g);return g},p=>(Sa(p),g)).then(p=>{nL.empty(p)?p.remove():o._groups.set(h,p)})}),l=e.onDidChange(()=>{const c=e.ordered(t);Qs(c,s)||r.cancel()});return Promise.all(a).then(()=>r.token.isCancellationRequested&&!i.isCancellationRequested?by.create(e,t,i):o._compact()).finally(()=>{r.dispose(),l.dispose(),r.dispose()})}static _makeOutlineElement(e,t){const i=nL.findId(e,t),r=new oce(i,t,e);if(e.children)for(const o of e.children)by._makeOutlineElement(o,r);t.children.set(r.id,r)}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}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=Pi.first(this._groups.values());for(const[,i]of t.children)i.parent=this,this.children.set(i.id,i)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof oce?e.push(t.symbol):e.push(...Pi.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>q.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return by._flattenDocumentSymbols(t,e,""),t.sort((i,r)=>Ce.compare(q.getStartPosition(i.range),q.getStartPosition(r.range))||Ce.compare(q.getEndPosition(r.range),q.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const r of t)e.push({kind:r.kind,tags:r.tags,name:r.name,detail:r.detail,containerName:r.containerName||i,range:r.range,selectionRange:r.selectionRange,children:void 0}),r.children&&by._flattenDocumentSymbols(e,r.children,r.name)}}const pK=Vi("IOutlineModelService");let sce=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new nt,this._cache=new eS(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved(r=>{this._cache.delete(r.id)}))}dispose(){this._disposables.dispose()}getOrCreate(e,t){return Csr(this,void 0,void 0,function*(){const i=this._languageFeaturesService.documentSymbolProvider,r=i.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!Qs(o.provider,r)){const a=new da;o={versionId:e.getVersionId(),provider:r,promiseCnt:0,source:a,promise:by.create(i,e,a.token),model:void 0},this._cache.set(e.id,o);const l=Date.now();o.promise.then(c=>{o.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(o.model)return o.model;o.promiseCnt+=1;const s=t.onCancellationRequested(()=>{--o.promiseCnt===0&&(o.source.cancel(),this._cache.delete(e.id))});try{return yield o.promise}finally{s.dispose()}})}};sce=ysr([DJ(0,en),DJ(1,Fg),DJ(2,ts)],sce);Zi(pK,sce,1);var wsr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};Xi.registerCommand("_executeDocumentSymbolProvider",function(n,...e){return wsr(this,void 0,void 0,function*(){const[t]=e;to(Tn.isUri(t));const i=n.get(pK),o=yield n.get(Pd).createModelReference(t);try{return(yield i.getOrCreate(o.object.textEditorModel,Mi.None)).getTopLevelSymbols()}finally{o.dispose()}})});class yl extends Ae{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=yl.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=yl.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=yl.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=yl.suppressSuggestions.bindTo(this.contextKeyService),this._register(So(i=>{const r=this.model.read(i),o=r==null?void 0:r.state.read(i),s=!!(o!=null&&o.inlineCompletion)&&(o==null?void 0:o.ghostText)!==void 0&&!(o!=null&&o.ghostText.isEmpty());this.inlineCompletionVisible.set(s),o!=null&&o.ghostText&&(o!=null&&o.inlineCompletion)&&this.suppressSuggestions.set(o.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)})),this._register(So(i=>{const r=this.model.read(i);let o=!1,s=!0;const a=r==null?void 0:r.ghostText.read(i);if(r!=null&&r.selectedSuggestItem&&a&&a.parts.length>0){const{column:l,lines:c}=a.parts[0],u=c[0],d=r.textModel.getLineIndentColumn(a.lineNumber);if(l<=d){let g=cu(u);g===-1&&(g=u.length-1),o=g>0;const p=r.textModel.getOptions().tabSize;s=Va.visibleColumnFromColumn(u,g+1,p)<p}}this.inlineCompletionSuggestsIndentation.set(o),this.inlineCompletionSuggestsIndentationLessThanTabSize.set(s)}))}}yl.inlineSuggestionVisible=new Ft("inlineSuggestionVisible",!1,E("inlineSuggestionVisible","Whether an inline suggestion is visible"));yl.inlineSuggestionHasIndentation=new Ft("inlineSuggestionHasIndentation",!1,E("inlineSuggestionHasIndentation","Whether the inline suggestion starts with whitespace"));yl.inlineSuggestionHasIndentationLessThanTabSize=new Ft("inlineSuggestionHasIndentationLessThanTabSize",!0,E("inlineSuggestionHasIndentationLessThanTabSize","Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab"));yl.suppressSuggestions=new Ft("inlineSuggestionSuppressSuggestions",void 0,E("suppressSuggestions","Whether suggestions should be suppressed for the current suggestion"));function Ssr(n,e){const t=new Esr(n),i=e.map(r=>{const o=q.lift(r.range);return{startOffset:t.getOffset(o.getStartPosition()),endOffset:t.getOffset(o.getEndPosition()),text:r.text}});i.sort((r,o)=>o.startOffset-r.startOffset);for(const r of i)n=n.substring(0,r.startOffset)+r.text+n.substring(r.endOffset);return n}class Esr{constructor(e){this.lineStartOffsetByLineIdx=[],this.lineStartOffsetByLineIdx.push(0);for(let t=0;t<e.length;t++)e.charAt(t)===`
`&&this.lineStartOffsetByLineIdx.push(t+1)}getOffset(e){return this.lineStartOffsetByLineIdx[e.lineNumber-1]+e.column-1}}const xsr=[];function ksr(){return xsr}class Tsr{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new ya(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new q(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function Isr(n,e){const t=new nt,i=n.createDecorationsCollection();return t.add(Sve({debugName:()=>`Apply decorations from ${e.debugName}`},r=>{const o=e.read(r);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function ace(n,e){return new Ce(n.lineNumber+e.lineNumber-1,e.lineNumber===1?n.column+e.column-1:e.column)}function lce(n){let e=1,t=1;for(const i of n)i===`
`?(e++,t=1):t++;return new Ce(e,t)}class dW{constructor(e,t){this.lineNumber=e,this.parts=t}equals(e){return this.lineNumber===e.lineNumber&&this.parts.length===e.parts.length&&this.parts.every((t,i)=>t.equals(e.parts[i]))}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],i=e.substr(0,t.column-1);return Ssr(i,this.parts.map(o=>({range:{startLineNumber:1,endLineNumber:1,startColumn:o.column,endColumn:o.column},text:o.lines.join(`
`)}))).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}}class cce{constructor(e,t,i){this.column=e,this.lines=t,this.preview=i}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t===e.lines[i])}}class uce{constructor(e,t,i,r=0){this.lineNumber=e,this.columnRange=t,this.newLines=i,this.additionalReservedLineCount=r,this.parts=[new cce(this.columnRange.endColumnExclusive,this.newLines,!1)]}renderForScreenReader(e){return this.newLines.join(`
`)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function vNe(n,e){return n===e?!0:!n||!e?!1:n instanceof dW&&e instanceof dW||n instanceof uce&&e instanceof uce?n.equals(e):!1}var Lsr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Dsr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const bNe="ghost-text";let dce=class extends Ae{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=No(this,!1),this.currentTextModel=Ul(this.editor.onDidChangeModel,()=>this.editor.getModel()),this.uiState=Ki(this,r=>{if(this.isDisposed.read(r))return;const o=this.currentTextModel.read(r);if(o!==this.model.targetTextModel.read(r))return;const s=this.model.ghostText.read(r);if(!s)return;const a=s instanceof uce?s.columnRange:void 0,l=[],c=[];function u(m,_){if(c.length>0){const v=c[c.length-1];_&&v.decorations.push(new Jd(v.content.length+1,v.content.length+1+m[0].length,_,0)),v.content+=m[0],m=m.slice(1)}for(const v of m)c.push({content:v,decorations:_?[new Jd(1,v.length+1,_,0)]:[]})}const d=o.getLineContent(s.lineNumber);let h,g=0;for(const m of s.parts){let _=m.lines;h===void 0?(l.push({column:m.column,text:_[0],preview:m.preview}),_=_.slice(1)):u([d.substring(g,m.column-1)],void 0),_.length>0&&(u(_,bNe),h===void 0&&m.column<=d.length&&(h=m.column)),g=m.column-1}h!==void 0&&u([d.substring(g)],void 0);const p=h!==void 0?new Tsr(h,d.length+1):void 0;return{replacedRange:a,inlineTexts:l,additionalLines:c,hiddenRange:p,lineNumber:s.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(r),targetTextModel:o}}),this.decorations=Ki(this,r=>{const o=this.uiState.read(r);if(!o)return[];const s=[];o.replacedRange&&s.push({range:o.replacedRange.toRange(o.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),o.hiddenRange&&s.push({range:o.hiddenRange.toRange(o.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const a of o.inlineTexts)s.push({range:q.fromPositions(new Ce(o.lineNumber,a.column)),options:{description:bNe,after:{content:a.text,inlineClassName:a.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:r_.Left},showIfCollapsed:!0}});return s}),this.additionalLinesWidget=this._register(new Asr(this.editor,this.languageService.languageIdCodec,Ki(r=>{const o=this.uiState.read(r);return o?{lineNumber:o.lineNumber,additionalLines:o.additionalLines,minReservedLineCount:o.additionalReservedLineCount,targetTextModel:o.targetTextModel}:void 0}))),this._register(Gn(()=>{this.isDisposed.set(!0,void 0)})),this._register(Isr(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};dce=Lsr([Dsr(2,Qo)],dce);class Asr extends Ae{get viewZoneId(){return this._viewZoneId}constructor(e,t,i){super(),this.editor=e,this.languageIdCodec=t,this.lines=i,this._viewZoneId=void 0,this.editorOptionsChanged=$h("editorOptionChanged",Pt.filter(this.editor.onDidChangeConfiguration,r=>r.hasChanged(33)||r.hasChanged(116)||r.hasChanged(98)||r.hasChanged(93)||r.hasChanged(51)||r.hasChanged(50)||r.hasChanged(66))),this._register(So(r=>{const o=this.lines.read(r);this.editorOptionsChanged.read(r),o?this.updateLines(o.lineNumber,o.additionalLines,o.minReservedLineCount):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this.editor.changeViewZones(e=>{this._viewZoneId&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0)})}updateLines(e,t,i){const r=this.editor.getModel();if(!r)return;const{tabSize:o}=r.getOptions();this.editor.changeViewZones(s=>{this._viewZoneId&&(s.removeZone(this._viewZoneId),this._viewZoneId=void 0);const a=Math.max(t.length,i);if(a>0){const l=document.createElement("div");Rsr(l,o,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=s.addZone({afterLineNumber:e,heightInLines:a,domNode:l,afterColumnAffinity:1})}})}}function Rsr(n,e,t,i,r){const o=i.get(33),s=i.get(116),a="none",l=i.get(93),c=i.get(51),u=i.get(50),d=i.get(66),h=new SA(1e4);h.appendString('<div class="suggest-preview-text">');for(let m=0,_=t.length;m<_;m++){const v=t[m],b=v.content;h.appendString('<div class="view-line'),h.appendString('" style="top:'),h.appendString(String(m*d)),h.appendString('px;width:1000000px;">');const y=f5(b),C=qD(b),x=el.createEmpty(b,r);v5(new tS(u.isMonospace&&!o,u.canUseHalfwidthRightwardsArrow,b,!1,y,C,0,x,v.decorations,e,0,u.spaceWidth,u.middotWidth,u.wsmiddotWidth,s,a,l,c!==Fh.OFF,null),h),h.appendString("</div>")}h.appendString("</div>"),mc(n,u);const g=h.build(),p=yNe?yNe.createHTML(g):g;n.innerHTML=p}const yNe=R0("editorGhostText",{createHTML:n=>n});function Nsr(n,e){const t=new Jqe,i=new tKe(t,c=>e.getLanguageConfiguration(c)),r=new eKe(new Osr([n]),i),o=Tse(r,[],void 0,!0);let s="";const a=n.getLineContent();function l(c,u){if(c.kind===2)if(l(c.openingBracket,u),u=_s(u,c.openingBracket.length),c.child&&(l(c.child,u),u=_s(u,c.child.length)),c.closingBracket)l(c.closingBracket,u),u=_s(u,c.closingBracket.length);else{const h=i.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);s+=h}else if(c.kind!==3){if(c.kind===0||c.kind===1)s+=a.substring(u,_s(u,c.length));else if(c.kind===4)for(const d of c.children)l(d,u),u=_s(u,d.length)}}return l(o,zu),s}class Osr{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}class cp{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||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};const e=this.pos;let t=0,i=this.value.charCodeAt(e),r;if(r=cp._table[i],typeof r=="number")return this.pos+=1,{type:r,pos:e,len:1};if(cp.isDigitCharacter(i)){r=8;do t+=1,i=this.value.charCodeAt(e+t);while(cp.isDigitCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}if(cp.isVariableCharacter(i)){r=9;do i=this.value.charCodeAt(e+ ++t);while(cp.isVariableCharacter(i)||cp.isDigitCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}r=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof cp._table[i]>"u"&&!cp.isDigitCharacter(i)&&!cp.isVariableCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}}cp._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};class PA{constructor(){this._children=[]}appendChild(e){return e instanceof Nu&&this._children[this._children.length-1]instanceof Nu?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,r=i.children.indexOf(e),o=i.children.slice(0);o.splice(r,1,...t),i._children=o,function s(a,l){for(const c of a)c.parent=l,s(c.children,c)}(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof Y5)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class Nu extends PA{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new Nu(this.value)}}class PXe extends PA{}class Uf extends PXe{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}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof MA?this._children[0]:void 0}clone(){const e=new Uf(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class MA extends PA{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof Nu&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new MA;return this.options.forEach(e.appendChild,e),e}}class hbe extends PA{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,r=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(o=>o instanceof $m&&!!o.elseValue)&&(r=this._replace([])),r}_replace(e){let t="";for(const i of this._children)if(i instanceof $m){let r=e[i.index]||"";r=i.resolve(r),t+=r}else t+=i.toString();return t}toString(){return""}clone(){const e=new hbe;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class $m extends PA{constructor(e,t,i,r){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=r}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,r)=>r===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new $m(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class D4 extends PXe{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new Nu(t)],!0):!1}clone(){const e=new D4(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function CNe(n,e){const t=[...n];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class Y5 extends PA{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof Uf&&(e.push(i),t=!t||t.index<i.index?i:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk(r=>r===e?(i=!0,!1):(t+=r.len(),!0)),i?t:-1}fullLen(e){let t=0;return CNe([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof Uf&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof D4&&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(){const e=new Y5;return this._children=this.children.map(t=>t.clone()),e}walk(e){CNe(this.children,e)}}class T2{constructor(){this._scanner=new cp,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,i){const r=new Y5;return this.parseFragment(e,r),this.ensureFinalTabstop(r,i??!1,t??!1),r}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const r=new Map,o=[];t.walk(l=>(l instanceof Uf&&(l.isFinalTabstop?r.set(0,void 0):!r.has(l.index)&&l.children.length>0?r.set(l.index,l.children):o.push(l)),!0));const s=(l,c)=>{const u=r.get(l.index);if(!u)return;const d=new Uf(l.index);d.transform=l.transform;for(const h of u){const g=h.clone();d.appendChild(g),g instanceof Uf&&r.has(g.index)&&!c.has(g.index)&&(c.add(g.index),s(g,c),c.delete(g.index))}t.replace(l,[d])},a=new Set;for(const l of o)s(l,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new Uf(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}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(this._token.type===14)return!1;if(this._token.type===5){const r=this._scanner.next();if(r.type!==0&&r.type!==4&&r.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_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 Nu(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Uf(Number(t)):new D4(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const o=new Uf(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Nu("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const s=new MA;for(;;){if(this._parseChoiceElement(s)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(s),this._accept(4)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let r;if((r=this._accept(5,!0))?r=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||r:r=this._accept(void 0,!0),!r)return this._backTo(t),!1;i.push(r)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new Nu(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const o=new D4(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new Nu("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){const t=new hbe;let i="",r="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,i+=o;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new Nu(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){r+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,r)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const r=this._accept(8,!0);if(r)if(i){if(this._accept(4))return e.appendChild(new $m(Number(r))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new $m(Number(r))),!0;else return this._backTo(t),!1;if(this._accept(6)){const o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new $m(Number(r),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new $m(Number(r),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new $m(Number(r),void 0,void 0,o)),!0}else if(this._accept(13)){const o=this._until(1);if(o){const s=this._until(4);if(s)return e.appendChild(new $m(Number(r),void 0,o,s)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new $m(Number(r),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new Nu(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}var AJ=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function Psr(n,e,t,i,r=Mi.None,o){return AJ(this,void 0,void 0,function*(){const s=Bsr(e,t),a=n.all(t),l=new Kme;for(const v of a)v.groupId&&l.add(v.groupId,v);function c(v){if(!v.yieldsToGroupIds)return[];const b=[];for(const y of v.yieldsToGroupIds||[]){const C=l.get(y);for(const x of C)b.push(x)}return b}const u=new Map,d=new Set;function h(v,b){if(b=[...b,v],d.has(v))return b;d.add(v);try{const y=c(v);for(const C of y){const x=h(C,b);if(x)return x}}finally{d.delete(v)}}function g(v){const b=u.get(v);if(b)return b;const y=h(v,[]);y&&Sa(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${y.map(x=>x.toString?x.toString():""+x).join(" -> ")}`));const C=new UU;return u.set(v,C.p),(()=>AJ(this,void 0,void 0,function*(){if(!y){const x=c(v);for(const k of x){const I=yield g(k);if(I&&I.items.length>0)return}}try{return yield v.provideInlineCompletions(t,e,i,r)}catch(x){Sa(x);return}}))().then(x=>C.complete(x),x=>C.error(x)),C.p}const p=yield Promise.all(a.map(v=>AJ(this,void 0,void 0,function*(){return{provider:v,completions:yield g(v)}}))),m=new Map,_=[];for(const v of p){const b=v.completions;if(!b)continue;const y=new Fsr(b,v.provider);_.push(y);for(const C of b.items){const x=hW.from(C,y,s,t,o);m.set(x.hash(),x)}}return new Msr(Array.from(m.values()),new Set(m.keys()),_)})}class Msr{constructor(e,t,i){this.completions=e,this.hashs=t,this.providerResults=i}has(e){return this.hashs.has(e.hash())}dispose(){for(const e of this.providerResults)e.removeRef()}}class Fsr{constructor(e,t){this.inlineCompletions=e,this.provider=t,this.refCount=1}addRef(){this.refCount++}removeRef(){this.refCount--,this.refCount===0&&this.provider.freeInlineCompletions(this.inlineCompletions)}}class hW{static from(e,t,i,r,o){let s,a,l=e.range?q.lift(e.range):i;if(typeof e.insertText=="string"){if(s=e.insertText,o&&e.completeBracketPairs){s=wNe(s,l.getStartPosition(),r,o);const c=s.length-e.insertText.length;c!==0&&(l=new q(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+c))}a=void 0}else if("snippet"in e.insertText){const c=e.insertText.snippet.length;if(o&&e.completeBracketPairs){e.insertText.snippet=wNe(e.insertText.snippet,l.getStartPosition(),r,o);const d=e.insertText.snippet.length-c;d!==0&&(l=new q(l.startLineNumber,l.startColumn,l.endLineNumber,l.endColumn+d))}const u=new T2().parse(e.insertText.snippet);u.children.length===1&&u.children[0]instanceof Nu?(s=u.children[0].value,a=void 0):(s=u.toString(),a={snippet:e.insertText.snippet,range:l})}else VU(e.insertText);return new hW(s,e.command,l,s,a,e.additionalTextEdits||ksr(),e,t)}constructor(e,t,i,r,o,s,a,l){this.filterText=e,this.command=t,this.range=i,this.insertText=r,this.snippetInfo=o,this.additionalTextEdits=s,this.sourceInlineCompletion=a,this.source=l,e=e.replace(/\r\n|\r/g,`
`),r=e.replace(/\r\n|\r/g,`
`)}withRange(e){return new hW(this.filterText,this.command,e,this.insertText,this.snippetInfo,this.additionalTextEdits,this.sourceInlineCompletion,this.source)}hash(){return JSON.stringify({insertText:this.insertText,range:this.range.toString()})}}function Bsr(n,e){const t=e.getWordAtPosition(n),i=e.getLineMaxColumn(n.lineNumber);return t?new q(n.lineNumber,t.startColumn,n.lineNumber,i):q.fromPositions(n,n.with(void 0,i))}function wNe(n,e,t,i){const o=t.getLineContent(e.lineNumber).substring(0,e.column-1)+n,s=t.tokenization.tokenizeLineWithEdit(e,o.length-(e.column-1),n),a=s==null?void 0:s.sliceAndInflate(e.column-1,o.length,0);return a?Nsr(a,i):n}class I2{constructor(e,t){this.range=e,this.text=t}removeCommonPrefix(e,t){const i=t?this.range.intersectRanges(t):this.range;if(!i)return this;const r=e.getValueInRange(i,1),o=Ax(r,this.text),s=ace(this.range.getStartPosition(),lce(r.substring(0,o))),a=this.text.substring(o),l=q.fromPositions(s,this.range.getEndPosition());return new I2(l,a)}augments(e){return this.text.startsWith(e.text)&&$sr(this.range,e.range)}computeGhostText(e,t,i,r=0){let o=this.removeCommonPrefix(e);if(o.range.endLineNumber!==o.range.startLineNumber)return;const s=e.getLineContent(o.range.startLineNumber),a=go(s).length;if(o.range.startColumn-1<=a){const p=go(o.text).length,m=s.substring(o.range.startColumn-1,a),[_,v]=[o.range.getStartPosition(),o.range.getEndPosition()],b=_.column+m.length<=v.column?_.delta(0,m.length):v,y=q.fromPositions(b,v),C=o.text.startsWith(m)?o.text.substring(m.length):o.text.substring(p);o=new I2(y,C)}const c=e.getValueInRange(o.range),u=Vsr(c,o.text);if(!u)return;const d=o.range.startLineNumber,h=new Array;if(t==="prefix"){const p=u.filter(m=>m.originalLength===0);if(p.length>1||p.length===1&&p[0].originalStart!==c.length)return}const g=o.text.length-r;for(const p of u){const m=o.range.startColumn+p.originalStart+p.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===o.range.startLineNumber&&m<i.column||p.originalLength>0)return;if(p.modifiedLength===0)continue;const _=p.modifiedStart+p.modifiedLength,v=Math.max(p.modifiedStart,Math.min(_,g)),b=o.text.substring(p.modifiedStart,v),y=o.text.substring(v,Math.max(p.modifiedStart,_));if(b.length>0){const C=ab(b);h.push(new cce(m,C,!1))}if(y.length>0){const C=ab(y);h.push(new cce(m,C,!0))}}return new dW(d,h)}}function $sr(n,e){return e.getStartPosition().equals(n.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(n.getEndPosition())}let Q_;function Vsr(n,e){if((Q_==null?void 0:Q_.originalValue)===n&&(Q_==null?void 0:Q_.newValue)===e)return Q_==null?void 0:Q_.changes;{let t=ENe(n,e,!0);if(t){const i=SNe(t);if(i>0){const r=ENe(n,e,!1);r&&SNe(r)<i&&(t=r)}}return Q_={originalValue:n,newValue:e,changes:t},t}}function SNe(n){let e=0;for(const t of n)e+=t.originalLength;return e}function ENe(n,e,t){if(n.length>5e3||e.length>5e3)return;function i(c){let u=0;for(let d=0,h=c.length;d<h;d++){const g=c.charCodeAt(d);g>u&&(u=g)}return u}const r=Math.max(i(n),i(e));function o(c){if(c<0)throw new Error("unexpected");return r+c+1}function s(c){let u=0,d=0;const h=new Int32Array(c.length);for(let g=0,p=c.length;g<p;g++)if(t&&c[g]==="("){const m=d*100+u;h[g]=o(2*m),u++}else if(t&&c[g]===")"){u=Math.max(u-1,0);const m=d*100+u;h[g]=o(2*m+1),u===0&&d++}else h[g]=c.charCodeAt(g);return h}const a=s(n),l=s(e);return new yv({getElements:()=>a},{getElements:()=>l}).ComputeDiff(!1).changes}var Hsr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},xNe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Wsr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let hce=class extends Ae{constructor(e,t,i,r,o){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=r,this.languageConfigurationService=o,this._updateOperation=this._register(new Zl),this.inlineCompletions=VH("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=VH("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent(()=>{this._updateOperation.clear()}))}fetch(e,t,i){var r,o;const s=new jsr(e,t,this.textModel.getVersionId()),a=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(!((r=this._updateOperation.value)===null||r===void 0)&&r.request.satisfies(s))return this._updateOperation.value.promise;if(!((o=a.get())===null||o===void 0)&&o.request.satisfies(s))return Promise.resolve(!0);const l=!!this._updateOperation.value;this._updateOperation.clear();const c=new da,u=(()=>Wsr(this,void 0,void 0,function*(){if((l||t.triggerKind===Yy.Automatic)&&(yield zsr(this._debounceValue.get(this.textModel))),c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const g=new Date,p=yield Psr(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,c.token,this.languageConfigurationService);if(c.token.isCancellationRequested||this.textModel.getVersionId()!==s.versionId)return!1;const m=new Date;this._debounceValue.update(this.textModel,m.getTime()-g.getTime());const _=new Ksr(p,s,this.textModel,this.versionId);if(i){const v=i.toInlineCompletion(void 0);i.canBeReused(this.textModel,e)&&!p.has(v)&&_.prepend(i.inlineCompletion,v.range,!0)}return this._updateOperation.clear(),Jo(v=>{a.set(_,v)}),!0}))(),d=new qsr(s,c,u);return this._updateOperation.value=d,u}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){var t;!((t=this._updateOperation.value)===null||t===void 0)&&t.request.context.selectedSuggestionInfo&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};hce=Hsr([xNe(3,en),xNe(4,xo)],hce);function zsr(n,e){return new Promise(t=>{let i;const r=setTimeout(()=>{i&&i.dispose(),t()},n);e&&(i=e.onCancellationRequested(()=>{clearTimeout(r),i&&i.dispose(),t()}))})}class jsr{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&Usr(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,(t,i)=>t.equals(i))&&(e.context.triggerKind===Yy.Automatic||this.context.triggerKind===Yy.Explicit)&&this.versionId===e.versionId}}function Usr(n,e,t){return!n||!e?n===e:t(n,e)}class qsr{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class Ksr{get inlineCompletions(){return this._inlineCompletions}constructor(e,t,i,r){this.inlineCompletionProviderResult=e,this.request=t,this.textModel=i,this.versionId=r,this._refCount=1,this._prependedInlineCompletionItems=[],this._rangeVersionIdValue=0,this._rangeVersionId=Ki(this,s=>{this.versionId.read(s);let a=!1;for(const l of this._inlineCompletions)a=a||l._updateRange(this.textModel);return a&&this._rangeVersionIdValue++,this._rangeVersionIdValue});const o=i.deltaDecorations([],e.completions.map(s=>({range:s.range,options:{description:"inline-completion-tracking-range"}})));this._inlineCompletions=e.completions.map((s,a)=>new kNe(s,o[a],this._rangeVersionId))}clone(){return this._refCount++,this}dispose(){if(this._refCount--,this._refCount===0){setTimeout(()=>{this.textModel.isDisposed()||this.textModel.deltaDecorations(this._inlineCompletions.map(e=>e.decorationId),[])},0),this.inlineCompletionProviderResult.dispose();for(const e of this._prependedInlineCompletionItems)e.source.removeRef()}}prepend(e,t,i){i&&e.source.addRef();const r=this.textModel.deltaDecorations([],[{range:t,options:{description:"inline-completion-tracking-range"}}])[0];this._inlineCompletions.unshift(new kNe(e,r,this._rangeVersionId,t)),this._prependedInlineCompletionItems.push(e)}}class kNe{get forwardStable(){var e;return(e=this.inlineCompletion.source.inlineCompletions.enableForwardStability)!==null&&e!==void 0?e:!1}constructor(e,t,i,r){this.inlineCompletion=e,this.decorationId=t,this.rangeVersion=i,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._isValid=!0,this._updatedRange=r??e.range}toInlineCompletion(e){return this.inlineCompletion.withRange(this._getUpdatedRange(e))}toSingleTextEdit(e){return new I2(this._getUpdatedRange(e),this.inlineCompletion.insertText)}isVisible(e,t,i){const r=this._toFilterTextReplacement(i).removeCommonPrefix(e);if(!this._isValid||!this.inlineCompletion.range.getStartPosition().equals(this._getUpdatedRange(i).getStartPosition())||t.lineNumber!==r.range.startLineNumber)return!1;const o=e.getValueInRange(r.range,1).toLowerCase(),s=r.text.toLowerCase(),a=Math.max(0,t.column-r.range.startColumn);let l=s.substring(0,a),c=s.substring(a),u=o.substring(0,a),d=o.substring(a);const h=e.getLineIndentColumn(r.range.startLineNumber);return r.range.startColumn<=h&&(u=u.trimStart(),u.length===0&&(d=d.trimStart()),l=l.trimStart(),l.length===0&&(c=c.trimStart())),l.startsWith(u)&&!!WKe(d,c)}canBeReused(e,t){return this._isValid&&this._getUpdatedRange(void 0).containsPosition(t)&&this.isVisible(e,t,void 0)&&!this._isSmallerThanOriginal(void 0)}_toFilterTextReplacement(e){return new I2(this._getUpdatedRange(e),this.inlineCompletion.filterText)}_isSmallerThanOriginal(e){return TNe(this._getUpdatedRange(e)).isBefore(TNe(this.inlineCompletion.range))}_getUpdatedRange(e){return this.rangeVersion.read(e),this._updatedRange}_updateRange(e){const t=e.getDecorationRange(this.decorationId);return t?this._updatedRange.equalsRange(t)?!1:(this._updatedRange=t,!0):(this._isValid=!1,!0)}}function TNe(n){return n.startLineNumber===n.endLineNumber?new Ce(1,1+n.endColumn-n.startColumn):new Ce(1+n.endLineNumber-n.startLineNumber,n.endColumn)}var iP=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const mi={Visible:rbe,HasFocusedSuggestion:new Ft("suggestWidgetHasFocusedSuggestion",!1,E("suggestWidgetHasSelection","Whether any suggestion is focused")),DetailsVisible:new Ft("suggestWidgetDetailsVisible",!1,E("suggestWidgetDetailsVisible","Whether suggestion details are visible")),MultipleSuggestions:new Ft("suggestWidgetMultipleSuggestions",!1,E("suggestWidgetMultipleSuggestions","Whether there are multiple suggestions to pick from")),MakesTextEdit:new Ft("suggestionMakesTextEdit",!0,E("suggestionMakesTextEdit","Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new Ft("acceptSuggestionOnEnter",!0,E("acceptSuggestionOnEnter","Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new Ft("suggestionHasInsertAndReplaceRange",!1,E("suggestionHasInsertAndReplaceRange","Whether the current suggestion has insert and replace behaviour")),InsertMode:new Ft("suggestionInsertMode",void 0,{type:"string",description:E("suggestionInsertMode","Whether the default behaviour is to insert or replace")}),CanResolve:new Ft("suggestionCanResolve",!1,E("suggestionCanResolve","Whether the current suggestion supports to resolve further details"))},WC=new J("suggestWidgetStatusBar");class Gsr{constructor(e,t,i,r){var o;this.position=e,this.completion=t,this.container=i,this.provider=r,this.isInvalid=!1,this.score=__.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(o=t.label)===null||o===void 0?void 0:o.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,q.isIRange(t.range)?(this.editStart=new Ce(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new Ce(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new Ce(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||q.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new Ce(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new Ce(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new Ce(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||q.spansMultipleLines(t.range.insert)||q.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),typeof r.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return this._resolveDuration!==void 0}get resolveDuration(){return this._resolveDuration!==void 0?this._resolveDuration:-1}resolve(e){return iP(this,void 0,void 0,function*(){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),i=new $c(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(r=>{Object.assign(this.completion,r),this._resolveDuration=i.elapsed()},r=>{R_(r)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache})}}class A4{constructor(e=2,t=new Set,i=new Set,r=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=r,this.showDeprecated=o}}A4.default=new A4;let Ysr;function Qsr(){return Ysr}class Xsr{constructor(e,t,i,r){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=r}}function fbe(n,e,t,i=A4.default,r={triggerKind:0},o=Mi.None){return iP(this,void 0,void 0,function*(){const s=new $c;t=t.clone();const a=e.getWordAtPosition(t),l=a?new q(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):q.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},u=[],d=new nt,h=[];let g=!1;const p=(_,v,b)=>{var y,C,x;let k=!1;if(!v)return k;for(const I of v.suggestions)if(!i.kindFilter.has(I.kind)){if(!i.showDeprecated&&(!((y=I==null?void 0:I.tags)===null||y===void 0)&&y.includes(1)))continue;I.range||(I.range=c),I.sortText||(I.sortText=typeof I.label=="string"?I.label:I.label.label),!g&&I.insertTextRules&&I.insertTextRules&4&&(g=T2.guessNeedsClipboard(I.insertText)),u.push(new Gsr(t,I,v,_)),k=!0}return Cme(v)&&d.add(v),h.push({providerName:(C=_._debugDisplayName)!==null&&C!==void 0?C:"unknown_provider",elapsedProvider:(x=v.duration)!==null&&x!==void 0?x:-1,elapsedOverall:b.elapsed()}),k},m=(()=>iP(this,void 0,void 0,function*(){}))();for(const _ of n.orderedGroups(e)){let v=!1;if(yield Promise.all(_.map(b=>iP(this,void 0,void 0,function*(){if(i.providerItemsToReuse.has(b)){const y=i.providerItemsToReuse.get(b);y.forEach(C=>u.push(C)),v=v||y.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(b)))try{const y=new $c,C=yield b.provideCompletionItems(e,t,r,o);v=p(b,C,y)||v}catch(y){Sa(y)}}))),v||o.isCancellationRequested)break}return yield m,o.isCancellationRequested?(d.dispose(),Promise.reject(new Xw)):new Xsr(u.sort(ear(i.snippetSortOrder)),g,{entries:h,elapsed:s.elapsed()},d)})}function gbe(n,e){if(n.sortTextLow&&e.sortTextLow){if(n.sortTextLow<e.sortTextLow)return-1;if(n.sortTextLow>e.sortTextLow)return 1}return n.textLabel<e.textLabel?-1:n.textLabel>e.textLabel?1:n.completion.kind-e.completion.kind}function Zsr(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return-1;if(e.completion.kind===27)return 1}return gbe(n,e)}function Jsr(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===27)return 1;if(e.completion.kind===27)return-1}return gbe(n,e)}const mK=new Map;mK.set(0,Zsr);mK.set(2,Jsr);mK.set(1,gbe);function ear(n){return mK.get(n)}Xi.registerCommand("_executeCompletionItemProvider",(n,...e)=>iP(void 0,void 0,void 0,function*(){const[t,i,r,o]=e;to(Tn.isUri(t)),to(Ce.isIPosition(i)),to(typeof r=="string"||!r),to(typeof o=="number"||!o);const{completionProvider:s}=n.get(en),a=yield n.get(Pd).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],u=a.object.textEditorModel.validatePosition(i),d=yield fbe(s,a.object.textEditorModel,u,void 0,{triggerCharacter:r??void 0,triggerKind:r?1:0});for(const h of d.items)c.length<(o??0)&&c.push(h.resolve(Mi.None)),l.incomplete=l.incomplete||h.container.incomplete,l.suggestions.push(h.completion);try{return yield Promise.all(c),l}finally{setTimeout(()=>d.disposable.dispose(),100)}}finally{a.dispose()}}));function tar(n,e){var t;(t=n.getContribution("editor.contrib.suggestController"))===null||t===void 0||t.triggerSuggest(new Set().add(e),void 0,!0)}class iL{static isAllOff(e){return e.other==="off"&&e.comments==="off"&&e.strings==="off"}static isAllOn(e){return e.other==="on"&&e.comments==="on"&&e.strings==="on"}static valueFor(e,t){switch(t){case 1:return e.comments;case 2:return e.strings;default:return e.other}}}function INe(n,e=vc){return Jzi(n,e)?n.charAt(0).toUpperCase()+n.slice(1):n}var nar=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},iar=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class LNe{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(i!==void 0)return i}}}class DNe{constructor(e,t,i,r){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=r}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,r=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(i=o.value,r=o.multiline)}if(i&&r&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),s=go(o,0,this._selection.startColumn-1);let a=s;e.snippet.walk(c=>c===e?!1:(c instanceof Nu&&(a=go(ab(c.value).pop())),!0));const l=Ax(a,s);i=i.replace(/(\r\n|\r|\n)(.*)/g,(c,u,d)=>`${u}${a.substr(l)}${d}`)}return i}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const i=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return i&&i.word||void 0}else{if(t==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(t==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber);if(t==="CURSOR_INDEX")return String(this._selectionIdx);if(t==="CURSOR_NUMBER")return String(this._selectionIdx+1)}}}}class ANe{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return LC(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=LC(this._model.uri.fsPath),r=i.lastIndexOf(".");return r<=0?i:i.slice(0,r)}else{if(t==="TM_DIRECTORY")return zje(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(hq(this._model.uri));if(t==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class RNe{constructor(e,t,i,r){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=r}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const i=t.split(/\r\n|\n|\r/).filter(r=>!Qje(r));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let fW=class{constructor(e,t,i){this._model=e,this._selection=t,this._languageConfigurationService=i}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),r=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(r){if(t==="LINE_COMMENT")return r.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return r.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return r.blockCommentEndToken||void 0}}};fW=nar([iar(2,xo)],fW);class o_{constructor(){this._date=new Date}resolve(e){const{name:t}=e;if(t==="CURRENT_YEAR")return String(this._date.getFullYear());if(t==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(t==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(t==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(t==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(t==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(t==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(t==="CURRENT_DAY_NAME")return o_.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return o_.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return o_.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return o_.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const i=this._date.getTimezoneOffset(),r=i>0?"-":"+",o=Math.trunc(Math.abs(i/60)),s=o<10?"0"+o:o,a=Math.abs(i)-o*60,l=a<10?"0"+a:a;return r+s+":"+l}}}o_.dayNames=[E("Sunday","Sunday"),E("Monday","Monday"),E("Tuesday","Tuesday"),E("Wednesday","Wednesday"),E("Thursday","Thursday"),E("Friday","Friday"),E("Saturday","Saturday")];o_.dayNamesShort=[E("SundayShort","Sun"),E("MondayShort","Mon"),E("TuesdayShort","Tue"),E("WednesdayShort","Wed"),E("ThursdayShort","Thu"),E("FridayShort","Fri"),E("SaturdayShort","Sat")];o_.monthNames=[E("January","January"),E("February","February"),E("March","March"),E("April","April"),E("May","May"),E("June","June"),E("July","July"),E("August","August"),E("September","September"),E("October","October"),E("November","November"),E("December","December")];o_.monthNamesShort=[E("JanuaryShort","Jan"),E("FebruaryShort","Feb"),E("MarchShort","Mar"),E("AprilShort","Apr"),E("MayShort","May"),E("JuneShort","Jun"),E("JulyShort","Jul"),E("AugustShort","Aug"),E("SeptemberShort","Sep"),E("OctoberShort","Oct"),E("NovemberShort","Nov"),E("DecemberShort","Dec")];class NNe{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=gKi(this._workspaceService.getWorkspace());if(!dKi(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(Yse(e))return LC(e.uri.path);let t=LC(e.configPath.path);return t.endsWith(Qse)&&(t=t.substr(0,t.length-Qse.length-1)),t}_resoveWorkspacePath(e){if(Yse(e))return INe(e.uri.fsPath);const t=LC(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?INe(i):"/"}}class ONe{resolve(e){const{name:t}=e;if(t==="RANDOM")return Math.random().toString().slice(-6);if(t==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(t==="UUID")return aK()}}var rar=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},oar=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},km;class Hf{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=tLe(t.placeholders,Uf.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(this._offset===-1)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(t=>{for(const i of this._snippet.placeholders){const r=this._snippet.offset(i),o=this._snippet.fullLen(i),s=q.fromPositions(e.getPositionAt(this._offset+r),e.getPositionAt(this._offset+r+o)),a=i.isFinalTabstop?Hf._decor.inactiveFinal:Hf._decor.inactive,l=t.addDecoration(s,a);this._placeholderDecorations.set(i,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const r=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx])if(o.transform){const s=this._placeholderDecorations.get(o),a=this._editor.getModel().getDecorationRange(s),l=this._editor.getModel().getValueInRange(a),c=o.transform.resolve(l).split(/\r\n|\r|\n/);for(let u=1;u<c.length;u++)c[u]=this._editor.getModel().normalizeIndentation(this._snippetLineLeadingWhitespace+c[u]);r.push(es.replace(a,c.join(this._editor.getModel().getEOL())))}r.length>0&&this._editor.executeEdits("snippet.placeholderTransform",r)}let t=!1;e===!0&&this._placeholderGroupsIdx<this._placeholderGroups.length-1?(this._placeholderGroupsIdx+=1,t=!0):e===!1&&this._placeholderGroupsIdx>0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(r=>{const o=new Set,s=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),c=this._editor.getModel().getDecorationRange(l);s.push(new ln(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),r.changeDecorationOptions(l,a.isFinalTabstop?Hf._decor.activeFinal:Hf._decor.active),o.add(a);for(const u of this._snippet.enclosingPlaceholders(a)){const d=this._placeholderDecorations.get(u);r.changeDecorationOptions(d,u.isFinalTabstop?Hf._decor.activeFinal:Hf._decor.active),o.add(u)}}for(const[a,l]of this._placeholderDecorations)o.has(a)||r.changeDecorationOptions(l,a.isFinalTabstop?Hf._decor.inactiveFinal:Hf._decor.inactive);return s});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof Uf){const i=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(i).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(this._snippet.placeholders.length===0)return!0;if(this._snippet.placeholders.length===1){const[e]=this._snippet.placeholders;if(e.isFinalTabstop&&this._snippet.rightMostDescendant===e)return!0}return!1}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const r of t){if(r.isFinalTabstop)break;i||(i=[],e.set(r.index,i));const o=this._placeholderDecorations.get(r),s=this._editor.getModel().getDecorationRange(o);if(!s){e.delete(r.index);break}i.push(s)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!(e!=null&&e.choice))return;const t=this._placeholderDecorations.get(e);if(!t)return;const i=this._editor.getModel().getDecorationRange(t);if(i)return{range:i,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof MA,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const r of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(o._offset!==-1),console.assert(!o._placeholderDecorations);const s=o._snippet.placeholderInfo.last.index;for(const l of o._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=r.index+(s+1)/this._nestingLevel:l.index=r.index+l.index/this._nestingLevel;this._snippet.replace(r,o._snippet.children);const a=this._placeholderDecorations.get(r);i.removeDecoration(a),this._placeholderDecorations.delete(r);for(const l of o._snippet.placeholders){const c=o._snippet.offset(l),u=o._snippet.fullLen(l),d=q.fromPositions(t.getPositionAt(o._offset+c),t.getPositionAt(o._offset+c+u)),h=i.addDecoration(d,Hf._decor.inactive);this._placeholderDecorations.set(l,h)}}this._placeholderGroups=tLe(this._snippet.placeholders,Uf.compareByIndex)})}}Hf._decor={active:hi.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:hi.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:hi.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:hi.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const PNe={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let gW=km=class{static adjustWhitespace(e,t,i,r,o){const s=e.getLineContent(t.lineNumber),a=go(s,0,t.column-1);let l;return r.walk(c=>{if(!(c instanceof Nu)||c.parent instanceof MA||o&&!o.has(c))return!0;const u=c.value.split(/\r\n|\r|\n/);if(i){const h=r.offset(c);if(h===0)u[0]=e.normalizeIndentation(u[0]);else{l=l??r.toString();const g=l.charCodeAt(h-1);(g===10||g===13)&&(u[0]=e.normalizeIndentation(a+u[0]))}for(let g=1;g<u.length;g++)u[g]=e.normalizeIndentation(a+u[g])}const d=u.join(e.getEOL());return d!==c.value&&(c.parent.replace(c,[new Nu(d)]),l=void 0),!0}),a}static adjustSelection(e,t,i,r){if(i!==0||r!==0){const{positionLineNumber:o,positionColumn:s}=t,a=s-i,l=s+r,c=e.validateRange({startLineNumber:o,startColumn:a,endLineNumber:o,endColumn:l});t=ln.createWithDirection(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn,t.getDirection())}return t}static createEditsAndSnippetsFromSelections(e,t,i,r,o,s,a,l,c){const u=[],d=[];if(!e.hasModel())return{edits:u,snippets:d};const h=e.getModel(),g=e.invokeWithinContext(C=>C.get(Bx)),p=e.invokeWithinContext(C=>new ANe(C.get(c2),h)),m=()=>a,_=h.getValueInRange(km.adjustSelection(h,e.getSelection(),i,0)),v=h.getValueInRange(km.adjustSelection(h,e.getSelection(),0,r)),b=h.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),y=e.getSelections().map((C,x)=>({selection:C,idx:x})).sort((C,x)=>q.compareRangesUsingStarts(C.selection,x.selection));for(const{selection:C,idx:x}of y){let k=km.adjustSelection(h,C,i,0),I=km.adjustSelection(h,C,0,r);_!==h.getValueInRange(k)&&(k=C),v!==h.getValueInRange(I)&&(I=C);const L=C.setStartPosition(k.startLineNumber,k.startColumn).setEndPosition(I.endLineNumber,I.endColumn),D=new T2().parse(t,!0,o),R=L.getStartPosition(),P=km.adjustWhitespace(h,R,s||x>0&&b!==h.getLineFirstNonWhitespaceColumn(C.positionLineNumber),D);D.resolveVariables(new LNe([p,new RNe(m,x,y.length,e.getOption(78)==="spread"),new DNe(h,C,x,l),new fW(h,C,c),new o_,new NNe(g),new ONe])),u[x]=es.replace(L,D.toString()),u[x].identifier={major:x,minor:0},u[x]._isTracked=!0,d[x]=new Hf(e,D,P)}return{edits:u,snippets:d}}static createEditsAndSnippetsFromEdits(e,t,i,r,o,s,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],c=e.getModel(),u=new T2,d=new Y5,h=new LNe([e.invokeWithinContext(p=>new ANe(p.get(c2),c)),new RNe(()=>o,0,e.getSelections().length,e.getOption(78)==="spread"),new DNe(c,e.getSelection(),0,s),new fW(c,e.getSelection(),a),new o_,new NNe(e.invokeWithinContext(p=>p.get(Bx))),new ONe]);t=t.sort((p,m)=>q.compareRangesUsingStarts(p.range,m.range));let g=0;for(let p=0;p<t.length;p++){const{range:m,template:_}=t[p];if(p>0){const x=t[p-1].range,k=q.fromPositions(x.getEndPosition(),m.getStartPosition()),I=new Nu(c.getValueInRange(k));d.appendChild(I),g+=I.value.length}const v=u.parseFragment(_,d);km.adjustWhitespace(c,m.getStartPosition(),!0,d,new Set(v)),d.resolveVariables(h);const b=d.toString(),y=b.slice(g);g=b.length;const C=es.replace(m,y);C.identifier={major:p,minor:0},C._isTracked=!0,l.push(C)}return u.ensureFinalTabstop(d,i,!0),{edits:l,snippets:[new Hf(e,d,"")]}}constructor(e,t,i=PNe,r){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=r,this._templateMerges=[],this._snippets=[]}dispose(){Hr(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}=typeof this._template=="string"?km.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):km.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=t,this._editor.executeEdits("snippet",e,i=>{const r=i.filter(o=>!!o.identifier);for(let o=0;o<t.length;o++)t[o].initialize(r[o].textChange);return this._snippets[0].hasPlaceholder?this._move(!0):r.map(o=>ln.fromPositions(o.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=PNe){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:r}=km.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,o=>{const s=o.filter(l=>!!l.identifier);for(let l=0;l<r.length;l++)r[l].initialize(s[l].textChange);const a=r[0].isTrivialSnippet;if(!a){for(const l of this._snippets)l.merge(r);console.assert(r.length===0)}return this._snippets[0].hasPlaceholder&&!a?this._move(void 0):s.map(l=>ln.fromPositions(l.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 i of this._snippets){const r=i.move(e);t.push(...r)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length<this._snippets.length)return!1;const t=new Map;for(const i of this._snippets){const r=i.computePossibleSelections();if(t.size===0)for(const[o,s]of r){s.sort(q.compareRangesUsingStarts);for(const a of e)if(s[0].containsRange(a)){t.set(o,[]);break}}if(t.size===0)return!1;t.forEach((o,s)=>{o.push(...r.get(s))})}e.sort(q.compareRangesUsingStarts);for(const[i,r]of t){if(r.length!==e.length){t.delete(i);continue}r.sort(q.compareRangesUsingStarts);for(let o=0;o<r.length;o++)if(!r[o].containsRange(e[o])){t.delete(i);continue}}return t.size>0}};gW=km=rar([oar(3,xo)],gW);var sar=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},S$=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},sI;const MNe={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let Jl=sI=class{static get(e){return e.getContribution(sI.ID)}constructor(e,t,i,r,o){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=o,this._snippetListener=new nt,this._modelVersionId=-1,this._inSnippet=sI.InSnippetMode.bindTo(r),this._hasNextTabstop=sI.HasNextTabstop.bindTo(r),this._hasPrevTabstop=sI.HasPrevTabstop.bindTo(r)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)===null||e===void 0||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t>"u"?MNe:Object.assign(Object.assign({},MNe),t))}catch(i){this.cancel(),this._logService.error(i),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){var i;if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(to(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new gW(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),!((i=this._session)===null||i===void 0)&&i.hasChoice){const r={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(u,d)=>{if(!this._session||u!==this._editor.getModel()||!Ce.equals(this._editor.getPosition(),d))return;const{activeChoice:h}=this._session;if(!h||h.choice.options.length===0)return;const g=u.getValueInRange(h.range),p=!!h.choice.options.find(_=>_.value===g),m=[];for(let _=0;_<h.choice.options.length;_++){const v=h.choice.options[_];m.push({kind:13,label:v.value,insertText:v.value,sortText:"a".repeat(_+1),range:h.range,filterText:p?`${g}_${v.value}`:void 0,command:{id:"jumpToNextSnippetPlaceholder",title:E("next","Go to next placeholder...")}})}return{suggestions:m}}},o=this._editor.getModel();let s,a=!1;const l=()=>{s==null||s.dispose(),a=!1},c=()=>{a||(s=this._languageFeaturesService.completionProvider.register({language:o.getLanguageId(),pattern:o.uri.fsPath,scheme:o.uri.scheme,exclusive:!0},r),this._snippetListener.add(s),a=!0)};this._choiceCompletions={provider:r,enable:c,disable:l}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(r=>r.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(){var e;if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:t}=this._session;if(!t||!this._choiceCompletions){(e=this._choiceCompletions)===null||e===void 0||e.disable(),this._currentChoice=void 0;return}this._currentChoice!==t.choice&&(this._currentChoice=t.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{tar(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,(t=this._session)===null||t===void 0||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;(e=this._session)===null||e===void 0||e.prev(),this._updateState()}next(){var e;(e=this._session)===null||e===void 0||e.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}};Jl.ID="snippetController2";Jl.InSnippetMode=new Ft("inSnippetMode",!1,E("inSnippetMode","Whether the editor in current in snippet mode"));Jl.HasNextTabstop=new Ft("hasNextTabstop",!1,E("hasNextTabstop","Whether there is a next tab stop when in snippet mode"));Jl.HasPrevTabstop=new Ft("hasPrevTabstop",!1,E("hasPrevTabstop","Whether there is a previous tab stop when in snippet mode"));Jl=sI=sar([S$(1,Sf),S$(2,en),S$(3,Yn),S$(4,xo)],Jl);gr(Jl.ID,Jl,4);const _K=kl.bindToContribution(Jl.get);Et(new _K({id:"jumpToNextSnippetPlaceholder",precondition:Ke.and(Jl.InSnippetMode,Jl.HasNextTabstop),handler:n=>n.next(),kbOpts:{weight:100+30,kbExpr:ee.editorTextFocus,primary:2}}));Et(new _K({id:"jumpToPrevSnippetPlaceholder",precondition:Ke.and(Jl.InSnippetMode,Jl.HasPrevTabstop),handler:n=>n.prev(),kbOpts:{weight:100+30,kbExpr:ee.editorTextFocus,primary:1026}}));Et(new _K({id:"leaveSnippet",precondition:Jl.InSnippetMode,handler:n=>n.cancel(!0),kbOpts:{weight:100+30,kbExpr:ee.editorTextFocus,primary:9,secondary:[1033]}}));Et(new _K({id:"acceptSnippet",precondition:Jl.InSnippetMode,handler:n=>n.finish()}));var aar=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},RJ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},iy=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Lh;(function(n){n[n.Undo=0]="Undo",n[n.Redo=1]="Redo",n[n.AcceptWord=2]="AcceptWord",n[n.Other=3]="Other"})(Lh||(Lh={}));let fce=class extends Ae{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,r,o,s,a,l,c,u,d,h){super(),this.textModel=e,this.selectedSuggestItem=t,this.cursorPosition=i,this.textModelVersionId=r,this._debounceValue=o,this._suggestPreviewEnabled=s,this._suggestPreviewMode=a,this._inlineSuggestMode=l,this._enabled=c,this._instantiationService=u,this._commandService=d,this._languageConfigurationService=h,this._source=this._register(this._instantiationService.createInstance(hce,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=No(this,!1),this._forceUpdate=XGe("forceUpdate"),this._selectedInlineCompletionId=No(this,void 0),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([Lh.Redo,Lh.Undo,Lh.AcceptWord]),this._fetchInlineCompletions=JXi({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:Yy.Automatic}),handleChange:(p,m)=>(p.didChange(this.textModelVersionId)&&this._preserveCurrentCompletionReasons.has(p.change)?m.preserveCurrentCompletion=!0:p.didChange(this._forceUpdate)&&(m.inlineCompletionTriggerKind=p.change),!0)},(p,m)=>{if(this._forceUpdate.read(p),!(this._enabled.read(p)&&this.selectedSuggestItem.read(p)||this._isActive.read(p))){this._source.cancelUpdate();return}this.textModelVersionId.read(p);const v=this.selectedInlineCompletion.get(),b=m.preserveCurrentCompletion||v!=null&&v.forwardStable?v:void 0,y=this._source.suggestWidgetInlineCompletions.get(),C=this.selectedSuggestItem.read(p);if(y&&!C){const I=this._source.inlineCompletions.get();Jo(L=>{I&&y.request.versionId>I.request.versionId&&this._source.inlineCompletions.set(y.clone(),L),this._source.clearSuggestWidgetInlineCompletions(L)})}const x=this.cursorPosition.read(p),k={triggerKind:m.inlineCompletionTriggerKind,selectedSuggestionInfo:C==null?void 0:C.toSelectedSuggestionInfo()};return this._source.fetch(x,k,b)}),this._filteredInlineCompletionItems=Ki(this,p=>{const m=this._source.inlineCompletions.read(p);if(!m)return[];const _=this.cursorPosition.read(p);return m.inlineCompletions.filter(b=>b.isVisible(this.textModel,_,p))}),this.selectedInlineCompletionIndex=Ki(this,p=>{const m=this._selectedInlineCompletionId.read(p),_=this._filteredInlineCompletionItems.read(p),v=this._selectedInlineCompletionId===void 0?-1:_.findIndex(b=>b.semanticId===m);return v===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):v}),this.selectedInlineCompletion=Ki(this,p=>{const m=this._filteredInlineCompletionItems.read(p),_=this.selectedInlineCompletionIndex.read(p);return m[_]}),this.lastTriggerKind=this._source.inlineCompletions.map(p=>p==null?void 0:p.request.context.triggerKind),this.inlineCompletionsCount=Ki(this,p=>{if(this.lastTriggerKind.read(p)===Yy.Explicit)return this._filteredInlineCompletionItems.read(p).length}),this.state=KAe({owner:this,equalityComparer:(p,m)=>!p||!m?p===m:vNe(p.ghostText,m.ghostText)&&p.inlineCompletion===m.inlineCompletion&&p.suggestItem===m.suggestItem},p=>{var m;const _=this.textModel,v=this.selectedSuggestItem.read(p);if(v){const b=v.toSingleTextEdit().removeCommonPrefix(_),y=this._computeAugmentedCompletion(b,p);if(!this._suggestPreviewEnabled.read(p)&&!y)return;const x=(m=y==null?void 0:y.edit)!==null&&m!==void 0?m:b,k=y?y.edit.text.length-b.text.length:0,I=this._suggestPreviewMode.read(p),L=this.cursorPosition.read(p),D=x.computeGhostText(_,I,L,k);return{ghostText:D??new dW(x.range.endLineNumber,[]),inlineCompletion:y==null?void 0:y.completion,suggestItem:v}}else{if(!this._isActive.read(p))return;const b=this.selectedInlineCompletion.read(p);if(!b)return;const y=b.toSingleTextEdit(p),C=this._inlineSuggestMode.read(p),x=this.cursorPosition.read(p),k=y.computeGhostText(_,C,x);return k?{ghostText:k,inlineCompletion:b,suggestItem:void 0}:void 0}}),this.ghostText=KAe({owner:this,equalityComparer:vNe},p=>{const m=this.state.read(p);if(m)return m.ghostText}),this._register(b4(this._fetchInlineCompletions));let g;this._register(So(p=>{var m,_;const v=this.state.read(p),b=v==null?void 0:v.inlineCompletion;if((b==null?void 0:b.semanticId)!==(g==null?void 0:g.semanticId)&&(g=b,b)){const y=b.inlineCompletion,C=y.source;(_=(m=C.provider).handleItemDidShow)===null||_===void 0||_.call(m,C.inlineCompletions,y.sourceInlineCompletion,y.insertText)}}))}trigger(e){return iy(this,void 0,void 0,function*(){this._isActive.set(!0,e),yield this._fetchInlineCompletions.get()})}triggerExplicitly(e){return iy(this,void 0,void 0,function*(){Jae(e,t=>{this._isActive.set(!0,t),this._forceUpdate.trigger(t,Yy.Explicit)}),yield this._fetchInlineCompletions.get()})}stop(e){Jae(e,t=>{this._isActive.set(!1,t),this._source.clear(t)})}_computeAugmentedCompletion(e,t){const i=this.textModel,r=this._source.suggestWidgetInlineCompletions.read(t),o=r?r.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(mM);return U8i(o,a=>{let l=a.toSingleTextEdit(t);return l=l.removeCommonPrefix(i,q.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),l.augments(e)?{edit:l,completion:a}:void 0})}_deltaSelectedInlineCompletionIndex(e){return iy(this,void 0,void 0,function*(){yield this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)})}next(){return iy(this,void 0,void 0,function*(){yield this._deltaSelectedInlineCompletionIndex(1)})}previous(){return iy(this,void 0,void 0,function*(){yield this._deltaSelectedInlineCompletionIndex(-1)})}accept(e){var t;return iy(this,void 0,void 0,function*(){if(e.getModel()!==this.textModel)throw new ya;const i=this.state.get();if(!i||i.ghostText.isEmpty()||!i.inlineCompletion)return;const r=i.inlineCompletion.toInlineCompletion(void 0);e.pushUndoStop(),r.snippetInfo?(e.executeEdits("inlineSuggestion.accept",[es.replaceMove(r.range,""),...r.additionalTextEdits]),e.setPosition(r.snippetInfo.range.getStartPosition()),(t=Jl.get(e))===null||t===void 0||t.insert(r.snippetInfo.snippet,{undoStopBefore:!1})):e.executeEdits("inlineSuggestion.accept",[es.replaceMove(r.range,r.insertText),...r.additionalTextEdits]),r.command&&r.source.addRef(),Jo(o=>{this._source.clear(o),this._isActive.set(!1,o)}),r.command&&(yield this._commandService.executeCommand(r.command.id,...r.command.arguments||[]).then(void 0,Sa),r.source.removeRef())})}acceptNextWord(e){return iy(this,void 0,void 0,function*(){yield this._acceptNext(e,(t,i)=>{const r=this.textModel.getLanguageIdAtPosition(t.lineNumber,t.column),o=this._languageConfigurationService.getLanguageConfiguration(r),s=new RegExp(o.wordDefinition.source,o.wordDefinition.flags.replace("g","")),a=i.match(s);let l=0;a&&a.index!==void 0?a.index===0?l=a[0].length:l=a.index:l=i.length;const u=/\s+/g.exec(i);return u&&u.index!==void 0&&u.index+u[0].length<l&&(l=u.index+u[0].length),l})})}acceptNextLine(e){return iy(this,void 0,void 0,function*(){yield this._acceptNext(e,(t,i)=>{const r=i.match(/\n/);return r&&r.index!==void 0?r.index+1:i.length})})}_acceptNext(e,t){return iy(this,void 0,void 0,function*(){if(e.getModel()!==this.textModel)throw new ya;const i=this.state.get();if(!i||i.ghostText.isEmpty()||!i.inlineCompletion)return;const r=i.ghostText,o=i.inlineCompletion.toInlineCompletion(void 0);if(o.snippetInfo||o.filterText!==o.insertText){yield this.accept(e);return}const s=r.parts[0],a=new Ce(r.lineNumber,s.column),l=s.lines.join(`
`),c=t(a,l);if(c===l.length&&r.parts.length===1){this.accept(e);return}const u=l.substring(0,c);this._isAcceptingPartially=!0;try{e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[es.replace(q.fromPositions(a),u)]);const d=lce(u);e.setPosition(ace(a,d))}finally{this._isAcceptingPartially=!1}if(o.source.provider.handlePartialAccept){const d=q.fromPositions(o.range.getStartPosition(),ace(a,lce(u))),h=e.getModel().getValueInRange(d,1);o.source.provider.handlePartialAccept(o.source.inlineCompletions,o.sourceInlineCompletion,h.length)}})}handleSuggestAccepted(e){var t,i;const r=e.toSingleTextEdit().removeCommonPrefix(this.textModel),o=this._computeAugmentedCompletion(r,void 0);if(!o)return;const s=o.completion.inlineCompletion;(i=(t=s.source.provider).handlePartialAccept)===null||i===void 0||i.call(t,s.source.inlineCompletions,s.sourceInlineCompletion,r.text.length)}};fce=aar([RJ(9,Un),RJ(10,Fs),RJ(11,xo)],fce);var lar=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},FNe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},jN;class pbe{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const r=i[0].score[0];for(let o=0;o<i.length;o++){const{score:s,completion:a}=i[o];if(s[0]!==r)break;if(a.preselect)return o}return 0}}class MXe extends pbe{constructor(){super("first")}memorize(e,t,i){}toJSON(){}fromJSON(){}}class car extends pbe{constructor(){super("recentlyUsed"),this._cache=new eS(300,.66),this._seq=0}memorize(e,t,i){const r=`${e.getLanguageId()}/${i.textLabel}`;this._cache.set(r,{touch:this._seq++,type:i.completion.kind,insertText:i.completion.insertText})}select(e,t,i){if(i.length===0)return 0;const r=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(r))return super.select(e,t,i);const o=i[0].score[0];let s=-1,a=-1,l=-1;for(let c=0;c<i.length&&i[c].score[0]===o;c++){const u=`${e.getLanguageId()}/${i[c].textLabel}`,d=this._cache.peek(u);if(d&&d.touch>l&&d.type===i[c].completion.kind&&d.insertText===i[c].completion.insertText&&(l=d.touch,a=c),i[c].completion.preselect&&s===-1)return s=c}return a!==-1?a:s!==-1?s:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,r]of e)r.touch=t,r.type=typeof r.type=="number"?r.type:yM.fromString(r.type),this._cache.set(i,r);this._seq=this._cache.size}}class uar extends pbe{constructor(){super("recentlyUsedByPrefix"),this._trie=HL.forStrings(),this._seq=0}memorize(e,t,i){const{word:r}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${r}`;this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:r}=e.getWordUntilPosition(t);if(!r)return super.select(e,t,i);const o=`${e.getLanguageId()}/${r}`;let s=this._trie.get(o);if(s||(s=this._trie.findSubstr(o)),s)for(let a=0;a<i.length;a++){const{kind:l,insertText:c}=i[a].completion;if(l===s.type&&c===s.insertText)return a}return super.select(e,t,i)}toJSON(){const e=[];return this._trie.forEach((t,i)=>e.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:yM.fromString(i.type),this._trie.set(t,i)}}}let R4=jN=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new nt,this._persistSoon=new so(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===wH.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){var i;const r=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((i=this._strategy)===null||i===void 0?void 0:i.name)!==r){this._saveState();const o=jN._strategyCtors.get(r)||MXe;this._strategy=new o;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${jN._storagePrefix}/${r}`,a);l&&this._strategy.fromJSON(JSON.parse(l))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,i=JSON.stringify(this._strategy);this._storageService.store(`${jN._storagePrefix}/${this._strategy.name}`,i,t,1)}}};R4._strategyCtors=new Map([["recentlyUsedByPrefix",uar],["recentlyUsed",car],["first",MXe]]);R4._storagePrefix="suggest/memories";R4=jN=lar([FNe(0,am),FNe(1,Ui)],R4);const vK=Vi("ISuggestMemories");Zi(vK,R4,1);var dar=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},har=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},gce;let N4=gce=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=gce.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(122)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)===null||e===void 0||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(122)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const i=this._editor.getModel(),r=this._editor.getSelection(),o=i.getWordAtPosition(r.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===r.getStartPosition().column)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};N4.AtEnd=new Ft("atEndOfWord",!1);N4=gce=dar([har(1,Yn)],N4);var far=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},gar=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},UN;let tk=UN=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=UN.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)===null||e===void 0||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){if(e.items.length===0){this.reset();return}if(UN._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,i){let r=i;for(let o=t.items.length;o>0&&(r=(r+t.items.length+(e?1:-1))%t.items.length,!(r===i||!t.items[r].completion.additionalTextEdits));o--);return r}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=UN._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};tk.OtherSuggestions=new Ft("hasOtherSuggestions",!1);tk=UN=far([gar(1,Yn)],tk);class par{constructor(e,t,i,r){this._disposables=new nt,this._disposables.add(i.onDidSuggest(o=>{o.completionModel.items.length===0&&this.reset()})),this._disposables.add(i.onDidCancel(o=>{this.reset()})),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(o=>{if(this._active&&!t.isFrozen()&&i.state!==0){const s=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(s)&&e.getOption(0)&&r(this._active.item)}}))}_onItem(e){if(!e||!Fc(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new $V;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}var mar=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Dh{provideSelectionRanges(e,t){return mar(this,void 0,void 0,function*(){const i=[];for(const r of t){const o=[];i.push(o);const s=new Map;yield new Promise(a=>Dh._bracketsRightYield(a,0,e,r,s)),yield new Promise(a=>Dh._bracketsLeftYield(a,0,e,r,s,o))}return i})}static _bracketsRightYield(e,t,i,r,o){const s=new Map,a=Date.now();for(;;){if(t>=Dh._maxRounds){e();break}if(!r){e();break}const l=i.bracketPairs.findNextBracket(r);if(!l){e();break}if(Date.now()-a>Dh._maxDuration){setTimeout(()=>Dh._bracketsRightYield(e,t+1,i,r,o));break}if(l.bracketInfo.isOpeningBracket){const u=l.bracketInfo.bracketText,d=s.has(u)?s.get(u):0;s.set(u,d+1)}else{const u=l.bracketInfo.getOpeningBrackets()[0].bracketText;let d=s.has(u)?s.get(u):0;if(d-=1,s.set(u,Math.max(0,d)),d<0){let h=o.get(u);h||(h=new Hu,o.set(u,h)),h.push(l.range)}}r=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,r,o,s){const a=new Map,l=Date.now();for(;;){if(t>=Dh._maxRounds&&o.size===0){e();break}if(!r){e();break}const c=i.bracketPairs.findPrevBracket(r);if(!c){e();break}if(Date.now()-l>Dh._maxDuration){setTimeout(()=>Dh._bracketsLeftYield(e,t+1,i,r,o,s));break}if(c.bracketInfo.isOpeningBracket){const d=c.bracketInfo.bracketText;let h=a.has(d)?a.get(d):0;if(h-=1,a.set(d,Math.max(0,h)),h<0){const g=o.get(d);if(g){const p=g.shift();g.size===0&&o.delete(d);const m=q.fromPositions(c.range.getEndPosition(),p.getStartPosition()),_=q.fromPositions(c.range.getStartPosition(),p.getEndPosition());s.push({range:m}),s.push({range:_}),Dh._addBracketLeading(i,_,s)}}}else{const d=c.bracketInfo.getOpeningBrackets()[0].bracketText,h=a.has(d)?a.get(d):0;a.set(d,h+1)}r=c.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const r=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(r);o!==0&&o!==t.startColumn&&(i.push({range:q.fromPositions(new Ce(r,o),t.getEndPosition())}),i.push({range:q.fromPositions(new Ce(r,1),t.getEndPosition())}));const s=r-1;if(s>0){const a=e.getLineFirstNonWhitespaceColumn(s);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(s)&&(i.push({range:q.fromPositions(new Ce(s,a),t.getEndPosition())}),i.push({range:q.fromPositions(new Ce(s,1),t.getEndPosition())}))}}}Dh._maxDuration=30;Dh._maxRounds=2;var _ar=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Km{static create(e,t){return _ar(this,void 0,void 0,function*(){if(!t.getOption(117).localityBonus||!t.hasModel())return Km.None;const i=t.getModel(),r=t.getPosition();if(!e.canComputeWordRanges(i.uri))return Km.None;const[o]=yield new Dh().provideSelectionRanges(i,[r]);if(o.length===0)return Km.None;const s=yield e.computeWordRanges(i.uri,o[0].range);if(!s)return Km.None;const a=i.getWordUntilPosition(r);return delete s[a.word],new class extends Km{distance(l,c){if(!r.equals(t.getPosition()))return 0;if(c.kind===17)return 2<<20;const u=typeof c.label=="string"?c.label:c.label.label,d=s[u];if(_je(d))return 2<<20;const h=gM(d,q.fromPositions(l),q.compareRangesUsingStarts),g=h>=0?d[h]:d[Math.max(0,~h-1)];let p=o.length;for(const m of o){if(!q.containsRange(m.range,g))break;p-=1}return p}}})}}Km.None=new class extends Km{distance(){return 0}};let BNe=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};class M1{constructor(e,t,i,r,o,s,a=Cq.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=M1._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=r,this._options=o,this._refilterKind=1,this._lineContext=i,this._fuzzyScoreOptions=a,s==="top"?this._snippetCompareFn=M1._compareCompletionItemsSnippetsUp:s==="bottom"&&(this._snippetCompareFn=M1._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}getItemsByProvider(){return this._ensureCachedState(),this._itemsByProvider}getIncompleteProvider(){this._ensureCachedState();const e=new Set;for(const[t,i]of this.getItemsByProvider())i.length>0&&i[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==0&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let r="",o="";const s=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||s.length>2e3?$x:WKi;for(let c=0;c<s.length;c++){const u=s[c];if(u.isInvalid)continue;const d=this._itemsByProvider.get(u.provider);d?d.push(u):this._itemsByProvider.set(u.provider,[u]);const h=u.position.column-u.editStart.column,g=h+i-(u.position.column-this._column);if(r.length!==g&&(r=g===0?"":t.slice(-g),o=r.toLowerCase()),u.word=r,g===0)u.score=__.Default;else{let p=0;for(;p<h;){const m=r.charCodeAt(p);if(m===32||m===9)p+=1;else break}if(p>=g)u.score=__.Default;else if(typeof u.completion.filterText=="string"){const m=l(r,o,p,u.completion.filterText,u.filterTextLow,0,this._fuzzyScoreOptions);if(!m)continue;Woe(u.completion.filterText,u.textLabel)===0?u.score=m:(u.score=BKi(r,o,p,u.textLabel,u.labelLow,0),u.score[0]=m[0])}else{const m=l(r,o,p,u.textLabel,u.labelLow,0,this._fuzzyScoreOptions);if(!m)continue;u.score=m}}u.idx=c,u.distance=this._wordDistance.distance(u.position,u.completion),a.push(u),e.push(u.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?qre(e.length-.85,e,(c,u)=>c-u):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(e.completion.kind===27)return 1;if(t.completion.kind===27)return-1}return M1._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===27)return-1;if(t.completion.kind===27)return 1}return M1._compareCompletionItems(e,t)}}var bar=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},r1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},yar=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},pce;class AS{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const r=t.getWordAtPosition(i);return!(!r||r.endColumn!==i.column&&r.startColumn+1!==i.column||!isNaN(Number(r.word)))}constructor(e,t,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.triggerOptions=i}}function Car(n,e,t){if(!e.getContextKeyValue(yl.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(yl.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(62).suppressSuggestions}function war(n,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(yl.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(62).suppressSuggestions}let mce=pce=class{constructor(e,t,i,r,o,s,a,l,c){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=r,this._logService=o,this._contextKeyService=s,this._configurationService=a,this._languageFeaturesService=l,this._envService=c,this._toDispose=new nt,this._triggerCharacterListener=new nt,this._triggerQuickSuggest=new nm,this._triggerState=void 0,this._completionDisposables=new nt,this._onDidCancel=new be,this._onDidTrigger=new be,this._onDidSuggest=new be,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new ln(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._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let u=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{u=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{u=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(d=>{u||this._onCursorChange(d)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!u&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){Hr(this._triggerCharacterListener),Hr([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(90)||!this._editor.hasModel()||!this._editor.getOption(120))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const r of i.triggerCharacters||[]){let o=e.get(r);o||(o=new Set,o.add(Qsr()),e.set(r,o)),o.add(i)}const t=i=>{var r;if(!war(this._editor,this._contextKeyService,this._configurationService)||AS.shouldAutoTrigger(this._editor))return;if(!i){const a=this._editor.getPosition();i=this._editor.getModel().getLineContent(a.lineNumber).substr(0,a.column-1)}let o="";Rx(i.charCodeAt(i.length-1))?Za(i.charCodeAt(i.length-2))&&(o=i.substr(i.length-2)):o=i.charAt(i.length-1);const s=e.get(o);if(s){const a=new Map;if(this._completionModel)for(const[l,c]of this._completionModel.getItemsByProvider())s.has(l)||a.set(l,c);this.trigger({auto:!0,triggerKind:1,triggerCharacter:o,retrigger:!!this._completionModel,clipboardText:(r=this._completionModel)===null||r===void 0?void 0:r.clipboardText,completionOptions:{providerFilter:s,providerItemsToReuse:a}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){var t;this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),(t=this._requestToken)===null||t===void 0||t.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._triggerState!==void 0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._triggerState.auto,retrigger:!0}))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===0?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;iL.isAllOff(this._editor.getOption(88))||this._editor.getOption(117).snippetsPreventQuickSuggestions&&(!((e=Jl.get(this._editor))===null||e===void 0)&&e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!AS.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const t=this._editor.getModel(),i=this._editor.getPosition(),r=this._editor.getOption(88);if(!iL.isAllOff(r)){if(!iL.isAllOn(r)){t.tokenization.tokenizeIfCheap(i.lineNumber);const o=t.tokenization.getLineTokens(i.lineNumber),s=o.getStandardTokenType(o.findTokenIndexAtOffset(Math.max(i.column-1-1,0)));if(iL.valueFor(r,s)!=="on")return}Car(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(t)&&this.trigger({auto:!0})}},this._editor.getOption(89)))}_refilterCompletionItems(){to(this._editor.hasModel()),to(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new AS(e,t,Object.assign(Object.assign({},this._triggerState),{refilter:!0}));this._onNewContext(i)}trigger(e){var t,i,r,o,s,a;if(!this._editor.hasModel())return;const l=this._editor.getModel(),c=new AS(l,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:(t=e.shy)!==null&&t!==void 0?t:!1,position:this._editor.getPosition()}),this._context=c;let u={triggerKind:(i=e.triggerKind)!==null&&i!==void 0?i:0};e.triggerCharacter&&(u={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new da;const d=this._editor.getOption(111);let h=1;switch(d){case"top":h=0;break;case"bottom":h=2;break}const{itemKind:g,showDeprecated:p}=pce._createSuggestFilter(this._editor),m=new A4(h,(o=(r=e.completionOptions)===null||r===void 0?void 0:r.kindFilter)!==null&&o!==void 0?o:g,(s=e.completionOptions)===null||s===void 0?void 0:s.providerFilter,(a=e.completionOptions)===null||a===void 0?void 0:a.providerItemsToReuse,p),_=Km.create(this._editorWorkerService,this._editor),v=fbe(this._languageFeaturesService.completionProvider,l,this._editor.getPosition(),m,u,this._requestToken.token);Promise.all([v,_]).then(([b,y])=>yar(this,void 0,void 0,function*(){var C;if((C=this._requestToken)===null||C===void 0||C.dispose(),!this._editor.hasModel())return;let x=e==null?void 0:e.clipboardText;if(!x&&b.needsClipboard&&(x=yield this._clipboardService.readText()),this._triggerState===void 0)return;const k=this._editor.getModel(),I=new AS(k,this._editor.getPosition(),e),L=Object.assign(Object.assign({},Cq.default),{firstMatchCanBeWeak:!this._editor.getOption(117).matchOnWordStartOnly});if(this._completionModel=new M1(b.items,this._context.column,{leadingLineContent:I.leadingLineContent,characterCountDelta:I.column-this._context.column},y,this._editor.getOption(117),this._editor.getOption(111),L,x),this._completionDisposables.add(b.disposable),this._onNewContext(I),this._reportDurationsTelemetry(b.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const D of b.items)D.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${D.provider._debugDisplayName}`,D.completion)})).catch(fi)}_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;e.getOption(111)==="none"&&t.add(27);const r=e.getOption(117);return r.showMethods||t.add(0),r.showFunctions||t.add(1),r.showConstructors||t.add(2),r.showFields||t.add(3),r.showVariables||t.add(4),r.showClasses||t.add(5),r.showStructs||t.add(6),r.showInterfaces||t.add(7),r.showModules||t.add(8),r.showProperties||t.add(9),r.showEvents||t.add(10),r.showOperators||t.add(11),r.showUnits||t.add(12),r.showValues||t.add(13),r.showConstants||t.add(14),r.showEnums||t.add(15),r.showEnumMembers||t.add(16),r.showKeywords||t.add(17),r.showWords||t.add(18),r.showColors||t.add(19),r.showFiles||t.add(20),r.showReferences||t.add(21),r.showColors||t.add(22),r.showFolders||t.add(23),r.showTypeParameters||t.add(24),r.showSnippets||t.add(27),r.showUsers||t.add(25),r.showIssues||t.add(26),{itemKind:t,showDeprecated:r.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(go(e.leadingLineContent)!==go(this._context.leadingLineContent)){this.cancel();return}if(e.column<this._context.column){e.leadingWord.word?this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0}):this.cancel();return}if(this._completionModel){if(e.leadingWord.word.length!==0&&e.leadingWord.startColumn>this._context.leadingWord.startColumn){if(AS.shouldAutoTrigger(this._editor)&&this._context){const i=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:i}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,i=new Set;for(const[r,o]of this._completionModel.getItemsByProvider())o.length>0&&o[0].container.incomplete?i.add(r):t.set(r,o);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:i,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const r=AS.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(r&&this._context.leadingWord.endColumn<e.leadingWord.startColumn){this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0});return}if(this._context.triggerOptions.auto){this.cancel();return}else if(this._completionModel.lineContext=t,i=this._completionModel.items.length>0,i&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}}}};mce=pce=bar([r1(1,lm),r1(2,F0),r1(3,wf),r1(4,Sf),r1(5,Yn),r1(6,Ui),r1(7,en),r1(8,M_e)],mce);class bK{constructor(e,t){this._disposables=new nt,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const i=e.getSelections(),r=i.length;let o=!1;for(let a=0;a<r;a++)if(!i[a].isEmpty()){o=!0;break}if(!o){this._lastOvertyped.length!==0&&(this._lastOvertyped.length=0);return}this._lastOvertyped=[];const s=e.getModel();for(let a=0;a<r;a++){const l=i[a];if(s.getValueLengthInRange(l)>bK._maxSelectionLength)return;this._lastOvertyped[a]={value:s.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}})),this._disposables.add(t.onDidTrigger(i=>{this._locked=!0})),this._disposables.add(t.onDidCancel(i=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e<this._lastOvertyped.length)return this._lastOvertyped[e]}dispose(){this._disposables.dispose()}}bK._maxSelectionLength=51200;var Sar=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},NJ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class mbe extends Vx{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=E({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",this._action.label,mbe.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return(t=e.getLabel())===null||t===void 0?void 0:t.replace(/\benter\b/gi,"⏎")}}let _ce=class{constructor(e,t,i,r,o){this._menuId=t,this._menuService=r,this._contextKeyService=o,this._menuDisposables=new nt,this.element=Ge(e,at(".suggest-status-bar"));const s=a=>a instanceof qp?i.createInstance(mbe,a,void 0):void 0;this._leftActions=new Ig(this.element,{actionViewItemProvider:s}),this._rightActions=new Ig(this.element,{actionViewItemProvider:s}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const i=[],r=[];for(const[o,s]of e.getActions())o==="left"?i.push(...s):r.push(...s);this._leftActions.clear(),this._leftActions.push(i),this._rightActions.clear(),this._rightActions.push(r)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};_ce=Sar([NJ(2,Un),NJ(3,kb),NJ(4,Yn)],_ce);var Ear=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},xar=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};function _be(n){return!!n&&!!(n.completion.documentation||n.completion.detail&&n.completion.detail!==n.completion.label)}let vce=class{constructor(e,t){this._editor=e,this._onDidClose=new be,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new be,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new nt,this._renderDisposeable=new nt,this._borderWidth=1,this._size=new vr(330,0),this.domNode=at(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(w0,{editor:e}),this._body=at(".body"),this._scrollbar=new S5(this._body,{alwaysConsumeMouseWheel:!0}),Ge(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=Ge(this._body,at(".header")),this._close=Ge(this._header,at("span"+In.asCSSSelector(Ct.close))),this._close.title=E("details.close","Close"),this._type=Ge(this._header,at("p.type")),this._docs=Ge(this._body,at("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(50)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(50),i=t.getMassagedFontFamily(),r=e.get(118)||t.fontSize,o=e.get(119)||t.lineHeight,s=t.fontWeight,a=`${r}px`,l=`${o}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${o/r}`,this.domNode.style.fontWeight=s,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=l,this._close.style.width=l}getLayoutInfo(){const e=this._editor.getOption(119)||this._editor.getOption(50).lineHeight,t=this._borderWidth,i=t*2;return{lineHeight:e,borderWidth:t,borderHeight:i,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=E("loading","Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(e,t){var i,r;this._renderDisposeable.clear();let{detail:o,documentation:s}=e.completion;if(t){let a="";a+=`score: ${e.score[0]}
`,a+=`prefix: ${(i=e.word)!==null&&i!==void 0?i:"(no prefix)"}
`,a+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}
`,a+=`distance: ${e.distance} (localityBonus-setting)
`,a+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}
`,a+=`commit_chars: ${(r=e.completion.commitCharacters)===null||r===void 0?void 0:r.join("")}
`,s=new hc().appendCodeblock("empty",a),o=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!_be(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),o){const a=o.length>1e5?`${o.substr(0,1e5)}…`:o;this._type.textContent=a,this._type.title=a,Yd(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(a))}else Gl(this._type),this._type.title="",Au(this._type),this.domNode.classList.add("no-type");if(Gl(this._docs),typeof s=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),Gl(this._docs);const a=this._markdownRenderer.render(s);this._docs.appendChild(a.element),this._renderDisposeable.add(a),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=a=>{a.preventDefault(),a.stopPropagation()},this._close.onclick=a=>{a.preventDefault(),a.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get size(){return this._size}layout(e,t){const i=new vr(e,t);vr.equals(i,this._size)||(this._size=i,e$i(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}};vce=Ear([xar(1,Un)],vce);class kar{constructor(e,t){this.widget=e,this._editor=t,this._disposables=new nt,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new Gve,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,r,o=0,s=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,r=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&r){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(s=r.width-a.dimension.width,l=!0),a.north&&(o=r.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+o,left:i.left+s})}a.done&&(i=void 0,r=void 0,o=0,s=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{var a;this._anchorBox&&this._placeAtAnchor(this._anchorBox,(a=this._userSize)!==null&&a!==void 0?a: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 i;const r=e.getBoundingClientRect();this._anchorBox=r,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,(i=this._userSize)!==null&&i!==void 0?i:this.widget.size,t)}_placeAtAnchor(e,t,i){var r;const o=CA(this.getDomNode().ownerDocument.body),s=this.widget.getLayoutInfo(),a=new vr(220,2*s.lineHeight),l=e.top,c=function(){const y=o.width-(e.left+e.width+s.borderWidth+s.horizontalPadding),C=-s.borderWidth+e.left+e.width,x=new vr(y,o.height-e.top-s.borderHeight-s.verticalPadding),k=x.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:C,fit:y-t.width,maxSizeTop:x,maxSizeBottom:k,minSize:a.with(Math.min(y,a.width))}}(),u=function(){const y=e.left-s.borderWidth-s.horizontalPadding,C=Math.max(s.horizontalPadding,e.left-t.width-s.borderWidth),x=new vr(y,o.height-e.top-s.borderHeight-s.verticalPadding),k=x.with(void 0,e.top+e.height-s.borderHeight-s.verticalPadding);return{top:l,left:C,fit:y-t.width,maxSizeTop:x,maxSizeBottom:k,minSize:a.with(Math.min(y,a.width))}}(),d=function(){const y=e.left,C=-s.borderWidth+e.top+e.height,x=new vr(e.width-s.borderHeight,o.height-e.top-e.height-s.verticalPadding);return{top:C,left:y,fit:x.height-t.height,maxSizeBottom:x,maxSizeTop:x,minSize:a.with(x.width)}}(),h=[c,u,d],g=(r=h.find(y=>y.fit>=0))!==null&&r!==void 0?r:h.sort((y,C)=>C.fit-y.fit)[0],p=e.top+e.height-s.borderHeight;let m,_=t.height;const v=Math.max(g.maxSizeTop.height,g.maxSizeBottom.height);_>v&&(_=v);let b;i?_<=g.maxSizeTop.height?(m=!0,b=g.maxSizeTop):(m=!1,b=g.maxSizeBottom):_<=g.maxSizeBottom.height?(m=!1,b=g.maxSizeBottom):(m=!0,b=g.maxSizeTop),this._applyTopLeft({left:g.left,top:m?g.top:p-_}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!m,g===c,m,g!==c),this._resizable.minSize=g.minSize,this._resizable.maxSize=b,this._resizable.layout(_,Math.min(b.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 zy;(function(n){n[n.FILE=0]="FILE",n[n.FOLDER=1]="FOLDER",n[n.ROOT_FOLDER=2]="ROOT_FOLDER"})(zy||(zy={}));const Tar=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function E$(n,e,t,i){const r=i===zy.ROOT_FOLDER?["rootfolder-icon"]:i===zy.FOLDER?["folder-icon"]:["file-icon"];if(t){let o;if(t.scheme===Si.data)o=mw.parseMetaData(t).get(mw.META_DATA_LABEL);else{const s=t.path.match(Tar);s?(o=x$(s[2].toLowerCase()),s[1]&&r.push(`${x$(s[1].toLowerCase())}-name-dir-icon`)):o=x$(t.authority.toLowerCase())}if(i===zy.FOLDER)r.push(`${o}-name-folder-icon`);else{if(o){if(r.push(`${o}-name-file-icon`),r.push("name-file-icon"),o.length<=255){const a=o.split(".");for(let l=1;l<a.length;l++)r.push(`${a.slice(l).join(".")}-ext-file-icon`)}r.push("ext-file-icon")}const s=Iar(n,e,t);s&&r.push(`${x$(s)}-lang-file-icon`)}}return r}function Iar(n,e,t){if(!t)return null;let i=null;if(t.scheme===Si.data){const o=mw.parseMetaData(t).get(mw.META_DATA_MIME);o&&(i=e.getLanguageIdByMimeType(o))}else{const r=n.getModel(t);r&&(i=r.getLanguageId())}return i&&i!==nf?i:e.guessLanguageIdByFilepathOrFirstLine(t)}function x$(n){return n.replace(/[\11\12\14\15\40]/g,"/")}var Lar=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},OJ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},o1;function FXe(n){return`suggest-aria-id:${n}`}const Dar=Js("suggest-more-info",Ct.chevronRight,E("suggestMoreInfoIcon","Icon for more information in the suggest widget.")),Aar=new(o1=class{extract(e,t){if(e.textLabel.match(o1._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(o1._regexStrict))return t[0]=e.completion.detail,!0;if(typeof e.completion.documentation=="string"){const i=o1._regexRelaxed.exec(e.completion.documentation);if(i&&(i.index===0||i.index+i[0].length===e.completion.documentation.length))return t[0]=i[0],!0}return!1}},o1._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*\))/,o1._regexStrict=new RegExp(`^${o1._regexRelaxed.source}$`,"i"),o1);let bce=class{constructor(e,t,i,r){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=r,this._onDidToggleDetails=new be,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new nt,i=e;i.classList.add("show-file-icons");const r=Ge(e,at(".icon")),o=Ge(r,at("span.colorspan")),s=Ge(e,at(".contents")),a=Ge(s,at(".main")),l=Ge(a,at(".icon-label.codicon")),c=Ge(a,at("span.left")),u=Ge(a,at("span.right")),d=new MH(c,{supportHighlights:!0,supportIcons:!0});t.add(d);const h=Ge(c,at("span.signature-label")),g=Ge(c,at("span.qualifier-label")),p=Ge(u,at("span.details-label")),m=Ge(u,at("span.readMore"+In.asCSSSelector(Dar)));m.title=E("readMore","Read More");const _=()=>{const v=this._editor.getOptions(),b=v.get(50),y=b.getMassagedFontFamily(),C=b.fontFeatureSettings,x=v.get(118)||b.fontSize,k=v.get(119)||b.lineHeight,I=b.fontWeight,L=b.letterSpacing,D=`${x}px`,R=`${k}px`,P=`${L}px`;i.style.fontSize=D,i.style.fontWeight=I,i.style.letterSpacing=P,a.style.fontFamily=y,a.style.fontFeatureSettings=C,a.style.lineHeight=R,r.style.height=R,r.style.width=R,m.style.height=R,m.style.width=R};return _(),t.add(this._editor.onDidChangeConfiguration(v=>{(v.hasChanged(50)||v.hasChanged(118)||v.hasChanged(119))&&_()})),{root:i,left:c,right:u,icon:r,colorspan:o,iconLabel:d,iconContainer:l,parametersLabel:h,qualifierLabel:g,detailsLabel:p,readMore:m,disposables:t}}renderElement(e,t,i){const{completion:r}=e;i.root.id=FXe(t),i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:D5(e.score)},s=[];if(r.kind===19&&Aar.extract(e,s))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=s[0];else if(r.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=E$(this._modelService,this._languageService,Tn.from({scheme:"fake",path:e.textLabel}),zy.FILE),l=E$(this._modelService,this._languageService,Tn.from({scheme:"fake",path:r.detail}),zy.FILE);o.extraClasses=a.length>l.length?a:l}else r.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",o.extraClasses=[E$(this._modelService,this._languageService,Tn.from({scheme:"fake",path:e.textLabel}),zy.FOLDER),E$(this._modelService,this._languageService,Tn.from({scheme:"fake",path:r.detail}),zy.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...In.asClassNameArray(yM.toIcon(r.kind))));r.tags&&r.tags.indexOf(1)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,o),typeof r.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=PJ(r.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=PJ(r.label.detail||""),i.detailsLabel.textContent=PJ(r.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(117).showInlineDetails?Yd(i.detailsLabel):Au(i.detailsLabel),_be(e)?(i.right.classList.add("can-expand-details"),Yd(i.readMore),i.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},i.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),Au(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};bce=Lar([OJ(1,ts),OJ(2,Qo),OJ(3,ll)],bce);function PJ(n){return n.replace(/\r\n|\r|\n/g,"")}var Rar=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},k$=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Nar=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},aI;re("editorSuggestWidget.background",{dark:As,light:As,hcDark:As,hcLight:As},E("editorSuggestWidgetBackground","Background color of the suggest widget."));re("editorSuggestWidget.border",{dark:Bv,light:Bv,hcDark:Bv,hcLight:Bv},E("editorSuggestWidgetBorder","Border color of the suggest widget."));const T$=re("editorSuggestWidget.foreground",{dark:bp,light:bp,hcDark:bp,hcLight:bp},E("editorSuggestWidgetForeground","Foreground color of the suggest widget."));re("editorSuggestWidget.selectedForeground",{dark:LE,light:LE,hcDark:LE,hcLight:LE},E("editorSuggestWidgetSelectedForeground","Foreground color of the selected entry in the suggest widget."));re("editorSuggestWidget.selectedIconForeground",{dark:VI,light:VI,hcDark:VI,hcLight:VI},E("editorSuggestWidgetSelectedIconForeground","Icon foreground color of the selected entry in the suggest widget."));const Oar=re("editorSuggestWidget.selectedBackground",{dark:DE,light:DE,hcDark:DE,hcLight:DE},E("editorSuggestWidgetSelectedBackground","Background color of the selected entry in the suggest widget."));re("editorSuggestWidget.highlightForeground",{dark:yp,light:yp,hcDark:yp,hcLight:yp},E("editorSuggestWidgetHighlightForeground","Color of the match highlights in the suggest widget."));re("editorSuggestWidget.focusHighlightForeground",{dark:EB,light:EB,hcDark:EB,hcLight:EB},E("editorSuggestWidgetFocusHighlightForeground","Color of the match highlights in the suggest widget when an item is focused."));re("editorSuggestWidgetStatus.foreground",{dark:mn(T$,.5),light:mn(T$,.5),hcDark:mn(T$,.5),hcLight:mn(T$,.5)},E("editorSuggestWidgetStatusForeground","Foreground color of the suggest widget status."));class Par{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof ww}`}restore(){var e;const t=(e=this._service.get(this._key,0))!==null&&e!==void 0?e:"";try{const i=JSON.parse(t);if(vr.is(i))return vr.lift(i)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let O4=aI=class{constructor(e,t,i,r,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Zl,this._pendingShowDetails=new Zl,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new nm,this._disposables=new nt,this._onDidSelect=new Lx,this._onDidFocus=new Lx,this._onDidHide=new be,this._onDidShow=new be,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new be,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new Gve,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new Mar(this,e),this._persistedSize=new Par(t,e);class s{constructor(g,p,m=!1,_=!1){this.persistedSize=g,this.currentSize=p,this.persistHeight=m,this.persistWidth=_}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new s(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(h=>{var g,p,m,_;if(this._resize(h.dimension.width,h.dimension.height),a&&(a.persistHeight=a.persistHeight||!!h.north||!!h.south,a.persistWidth=a.persistWidth||!!h.east||!!h.west),!!h.done){if(a){const{itemHeight:v,defaultSize:b}=this.getLayoutInfo(),y=Math.round(v/2);let{width:C,height:x}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-x)<=y)&&(x=(p=(g=a.persistedSize)===null||g===void 0?void 0:g.height)!==null&&p!==void 0?p:b.height),(!a.persistWidth||Math.abs(a.currentSize.width-C)<=y)&&(C=(_=(m=a.persistedSize)===null||m===void 0?void 0:m.width)!==null&&_!==void 0?_:b.width),this._persistedSize.store(new vr(C,x))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=Ge(this.element.domNode,at(".message")),this._listElement=Ge(this.element.domNode,at(".tree"));const l=this._disposables.add(o.createInstance(vce,this.editor));l.onDidClose(this.toggleDetails,this,this._disposables),this._details=new kar(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(117).showIcons);c();const u=o.createInstance(bce,this.editor);this._disposables.add(u),this._disposables.add(u.onDidToggleDetails(()=>this.toggleDetails())),this._list=new sm("SuggestWidget",this._listElement,{getHeight:h=>this.getLayoutInfo().itemHeight,getTemplateId:h=>"suggestion"},[u],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>E("suggest","Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:h=>{let g=h.textLabel;if(typeof h.completion.label!="string"){const{detail:v,description:b}=h.completion.label;v&&b?g=E("label.full","{0} {1}, {2}",g,v,b):v?g=E("label.detail","{0} {1}",g,v):b&&(g=E("label.desc","{0}, {1}",g,b))}if(!h.isResolved||!this._isDetailsVisible())return g;const{documentation:p,detail:m}=h.completion,_=Dx("{0}{1}",m||"",p?typeof p=="string"?p:p.value:"");return E("ariaCurrenttSuggestionReadDetails","{0}, docs: {1}",g,_)}}}),this._list.style(IA({listInactiveFocusBackground:Oar,listInactiveFocusOutline:Ho})),this._status=o.createInstance(_ce,this.element.domNode,WC);const d=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(117).showStatusBar);d(),this._disposables.add(r.onDidColorThemeChange(h=>this._onThemeChange(h))),this._onThemeChange(r.getColorTheme()),this._disposables.add(this._list.onMouseDown(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onTap(h=>this._onListMouseDownOrTap(h))),this._disposables.add(this._list.onDidChangeSelection(h=>this._onListSelection(h))),this._disposables.add(this._list.onDidChangeFocus(h=>this._onListFocus(h))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(h=>{h.hasChanged(117)&&(d(),c())})),this._ctxSuggestWidgetVisible=mi.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=mi.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=mi.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=mi.HasFocusedSuggestion.bindTo(i),this._disposables.add(ua(this._details.widget.domNode,"keydown",h=>{this._onDetailsKeydown.fire(h)})),this._disposables.add(this.editor.onMouseDown(h=>this._onEditorMouseDown(h)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.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(){this._state!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(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 i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onThemeChange(e){this._details.widget.borderWidth=m_(e.type)?2:1}_onListFocus(e){var t;if(this._ignoreFocusEvents)return;if(!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const i=e.elements[0],r=e.indexes[0];i!==this._focusedItem&&((t=this._currentSuggestionDetails)===null||t===void 0||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=i,this._list.reveal(r),this._currentSuggestionDetails=za(o=>Nar(this,void 0,void 0,function*(){const s=uw(()=>{this._isDetailsVisible()&&this.showDetails(!0)},250),a=o.onCancellationRequested(()=>s.dispose());try{return yield i.resolve(o)}finally{s.dispose(),a.dispose()}})),this._currentSuggestionDetails.then(()=>{r>=this._list.length||i!==this._list.element(r)||(this._ignoreFocusEvents=!0,this._list.splice(r,1,[i]),this._list.setFocus([r]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:FXe(r)}))}).catch(fi)),this._onDidFocus.fire({item:i,index:r,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===4),this.element.domNode.classList.remove("message"),e){case 0:Au(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.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=aI.LOADING_MESSAGE,Au(this._listElement,this._status.element),Yd(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,fw(aI.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=aI.NO_SUGGESTIONS_MESSAGE,Au(this._listElement,this._status.element),Yd(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,fw(aI.NO_SUGGESTIONS_MESSAGE);break;case 3:Au(this._messageElement),Yd(this._listElement,this._status.element),this._show();break;case 4:Au(this._messageElement),Yd(this._listElement,this._status.element),this._show();break;case 5:Au(this._messageElement),Yd(this._listElement,this._status.element),this._details.show(),this._show();break}}_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){this._state===0&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=uw(()=>this._setState(1),t)))}showSuggestions(e,t,i,r,o){var s,a;if(this._contentWidget.setPosition(this.editor.getPosition()),(s=this._loadingTimeout)===null||s===void 0||s.dispose(),(a=this._currentSuggestionDetails)===null||a===void 0||a.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==2&&this._state!==0){this._setState(4);return}const l=this._completionModel.items.length,c=l===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(l>1),c){this._setState(r?0:2),this._completionModel=void 0;return}this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?4:3),this._list.reveal(t,0),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=NV(()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")})}focusSelected(){this._list.length>0&&this._list.setFocus([0])}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(this._state!==0&&this._state!==2&&this._state!==1&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===5?(this._setState(3),this._details.widget.domNode.classList.remove("focused")):this._state===3&&this._isDetailsVisible()&&(this._setState(5),this._details.widget.domNode.classList.add("focused"))}toggleDetails(){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(_be(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===3||this._state===5||this._state===4)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=NV(()=>{this._pendingShowDetails.clear(),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;this._pendingLayout.clear(),this._pendingShowDetails.clear(),(e=this._loadingTimeout)===null||e===void 0||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),i=Math.ceil(this.getLayoutInfo().itemHeight*4.3);t&&t.height<i&&this._persistedSize.store(t.with(void 0,i))}isFrozen(){return this._state===4}_afterRender(e){if(e===null){this._isDetailsVisible()&&this._details.hide();return}this._state===2||this._state===1||(this._isDetailsVisible()&&this._details.show(),this._positionDetails())}_layout(e){var t,i,r;if(!this.editor.hasModel()||!this.editor.getDomNode())return;const o=CA(this.element.domNode.ownerDocument.body),s=this.getLayoutInfo();e||(e=s.defaultSize);let a=e.height,l=e.width;if(this._status.element.style.height=`${s.itemHeight}px`,this._state===2||this._state===1)a=s.itemHeight+s.borderHeight,l=s.defaultSize.width/2,this.element.enableSashes(!1,!1,!1,!1),this.element.minSize=this.element.maxSize=new vr(l,a),this._contentWidget.setPreference(2);else{const c=o.width-s.borderHeight-2*s.horizontalPadding;l>c&&(l=c);const u=this._completionModel?this._completionModel.stats.pLabelLen*s.typicalHalfwidthCharacterWidth:l,d=s.statusBarHeight+this._list.contentHeight+s.borderHeight,h=s.itemHeight+s.statusBarHeight,g=Oa(this.editor.getDomNode()),p=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),m=g.top+p.top+p.height,_=Math.min(o.height-m-s.verticalPadding,d),v=g.top+p.top-s.verticalPadding,b=Math.min(v,d);let y=Math.min(Math.max(b,_)+s.borderHeight,d);a===((t=this._cappedHeight)===null||t===void 0?void 0:t.capped)&&(a=this._cappedHeight.wanted),a<h&&(a=h),a>y&&(a=y);const C=150;a>_||this._forceRenderingAbove&&v>C?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),y=b):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),y=_),this.element.preferredSize=new vr(u,s.defaultSize.height),this.element.maxSize=new vr(c,y),this.element.minSize=new vr(220,h),this._cappedHeight=a===d?{wanted:(r=(i=this._cappedHeight)===null||i===void 0?void 0:i.wanted)!==null&&r!==void 0?r:e.height,capped:a}:void 0}this._resize(l,a)}_resize(e,t){const{width:i,height:r}=this.element.maxSize;e=Math.min(i,e),t=Math.min(r,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,((e=this._contentWidget.getPosition())===null||e===void 0?void 0:e.preference[0])===2)}getLayoutInfo(){const e=this.editor.getOption(50),t=qd(this.editor.getOption(119)||e.lineHeight,8,1e3),i=!this.editor.getOption(117).showStatusBar||this._state===2||this._state===1?0:t,r=this._details.widget.borderWidth,o=2*r;return{itemHeight:t,statusBarHeight:i,borderWidth:r,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new vr(430,i+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}};O4.LOADING_MESSAGE=E("suggestWidget.loading","Loading...");O4.NO_SUGGESTIONS_MESSAGE=E("suggestWidget.noSuggestions","No suggestions.");O4=aI=Rar([k$(1,am),k$(2,Yn),k$(3,ll),k$(4,Un)],O4);class Mar{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?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:r}=this._widget.getLayoutInfo();return new vr(t+2*i+r,e+2*i)}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 Far=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},UT=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},yce;class Bar{constructor(e,t){if(this._model=e,this._position=t,e.getLineMaxColumn(t.lineNumber)!==t.column){const r=e.getOffsetAt(t),o=e.getPositionAt(r+1);this._marker=e.deltaDecorations([],[{range:q.fromPositions(t,o),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)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let wp=yce=class{static get(e){return e.getContribution(yce.ID)}constructor(e,t,i,r,o,s,a){this._memoryService=t,this._commandService=i,this._contextKeyService=r,this._instantiationService=o,this._logService=s,this._telemetryService=a,this._lineSuffix=new Zl,this._toDispose=new nt,this._selectors=new $ar(d=>d.priority),this._onWillInsertSuggestItem=new be,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=o.createInstance(mce,this.editor),this._selectors.register({priority:0,select:(d,h,g)=>this._memoryService.select(d,h,g)});const l=mi.InsertMode.bindTo(r);l.set(e.getOption(117).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(117).insertMode))),this.widget=this._toDispose.add(new D8(()=>{const d=this._instantiationService.createInstance(O4,this.editor);this._toDispose.add(d),this._toDispose.add(d.onDidSelect(_=>this._insertSuggestion(_,0),this));const h=new par(this.editor,d,this.model,_=>this._insertSuggestion(_,2));this._toDispose.add(h);const g=mi.MakesTextEdit.bindTo(this._contextKeyService),p=mi.HasInsertAndReplaceRange.bindTo(this._contextKeyService),m=mi.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Gn(()=>{g.reset(),p.reset(),m.reset()})),this._toDispose.add(d.onDidFocus(({item:_})=>{const v=this.editor.getPosition(),b=_.editStart.column,y=v.column;let C=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!_.completion.additionalTextEdits&&!(_.completion.insertTextRules&4)&&y-b===_.completion.insertText.length&&(C=this.editor.getModel().getValueInRange({startLineNumber:v.lineNumber,startColumn:b,endLineNumber:v.lineNumber,endColumn:y})!==_.completion.insertText),g.set(C),p.set(!Ce.equals(_.editInsertEnd,_.editReplaceEnd)),m.set(!!_.provider.resolveCompletionItem||!!_.completion.documentation||_.completion.detail!==_.completion.label)})),this._toDispose.add(d.onDetailsKeyDown(_=>{if(_.toKeyCodeChord().equals(new y0(!0,!1,!1,!1,33))||Qi&&_.toKeyCodeChord().equals(new y0(!1,!1,!1,!0,33))){_.stopPropagation();return}_.toKeyCodeChord().isModifierKey()||this.editor.focus()})),d})),this._overtypingCapturer=this._toDispose.add(new D8(()=>this._toDispose.add(new bK(this.editor,this.model)))),this._alternatives=this._toDispose.add(new D8(()=>this._toDispose.add(new tk(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(N4,e)),this._toDispose.add(this.model.onDidTrigger(d=>{this.widget.value.showTriggered(d.auto,d.shy?250:50),this._lineSuffix.value=new Bar(this.editor.getModel(),d.position)})),this._toDispose.add(this.model.onDidSuggest(d=>{if(d.triggerOptions.shy)return;let h=-1;for(const p of this._selectors.itemsOrderedByPriorityDesc)if(h=p.select(this.editor.getModel(),this.editor.getPosition(),d.completionModel.items),h!==-1)break;h===-1&&(h=0);let g=!1;if(d.triggerOptions.auto){const p=this.editor.getOption(117);p.selectionMode==="never"||p.selectionMode==="always"?g=p.selectionMode==="never":p.selectionMode==="whenTriggerCharacter"?g=d.triggerOptions.triggerKind!==1:p.selectionMode==="whenQuickSuggestion"&&(g=d.triggerOptions.triggerKind===1&&!d.triggerOptions.refilter)}this.widget.value.showSuggestions(d.completionModel,h,d.isFrozen,d.triggerOptions.auto,g)})),this._toDispose.add(this.model.onDidCancel(d=>{d.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const c=mi.AcceptSuggestionsOnEnter.bindTo(r),u=()=>{const d=this.editor.getOption(1);c.set(d==="on"||d==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>u())),u()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(e,t){if(!e||!e.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const i=Jl.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const r=this.editor.getModel(),o=r.getAlternativeVersionId(),{item:s}=e,a=[],l=new da;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(s,!!(t&8));this._memoryService.memorize(r,this.editor.getPosition(),s);const u=s.isResolved;let d=-1,h=-1;if(Array.isArray(s.completion.additionalTextEdits)){this.model.cancel();const p=k_.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",s.completion.additionalTextEdits.map(m=>es.replaceMove(q.lift(m.range),m.text))),p.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!u){const p=new $c;let m;const _=r.onDidChangeContent(C=>{if(C.isFlush){l.cancel(),_.dispose();return}for(const x of C.changes){const k=q.getEndPosition(x.range);(!m||Ce.isBefore(k,m))&&(m=k)}}),v=t;t|=2;let b=!1;const y=this.editor.onWillType(()=>{y.dispose(),b=!0,v&2||this.editor.pushUndoStop()});a.push(s.resolve(l.token).then(()=>{if(!s.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(m&&s.completion.additionalTextEdits.some(x=>Ce.isBefore(m,q.getStartPosition(x.range))))return!1;b&&this.editor.pushUndoStop();const C=k_.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",s.completion.additionalTextEdits.map(x=>es.replaceMove(q.lift(x.range),x.text))),C.restoreRelativeVerticalPositionOfCursor(this.editor),(b||!(v&2))&&this.editor.pushUndoStop(),!0}).then(C=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",p.elapsed(),C),h=C===!0?1:C===!1?0:-2}).finally(()=>{_.dispose(),y.dispose()}))}let{insertText:g}=s.completion;if(s.completion.insertTextRules&4||(g=T2.escape(g)),this.model.cancel(),i.insert(g,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(s.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),t&2||this.editor.pushUndoStop(),s.completion.command)if(s.completion.command.id===Q5.id)this.model.trigger({auto:!0,retrigger:!0});else{const p=new $c;a.push(this._commandService.executeCommand(s.completion.command.id,...s.completion.command.arguments?[...s.completion.command.arguments]:[]).catch(m=>{s.completion.extensionId?Sa(m):fi(m)}).finally(()=>{d=p.elapsed()}))}t&4&&this._alternatives.value.set(e,p=>{for(l.cancel();r.canUndo();){o!==r.getAlternativeVersionId()&&r.undo(),this._insertSuggestion(p,3|(t&8?8:0));break}}),this._alertCompletionItem(s),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(s,r,u,d,h),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,r,o){var s,a,l;Math.floor(Math.random()*100)!==0&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:(a=(s=e.extensionId)===null||s===void 0?void 0:s.value)!==null&&a!==void 0?a:"unknown",providerId:(l=e.provider._debugDisplayName)!==null&&l!==void 0?l:"unknown",kind:e.completion.kind,basenameHash:QUe(Tg(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:nji(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:r,additionalEditsAsync:o})}getOverwriteInfo(e,t){to(this.editor.hasModel());let i=this.editor.getOption(117).insertMode==="replace";t&&(i=!i);const r=e.position.column-e.editStart.column,o=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,s=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:r+s,overwriteAfter:o+a}}_alertCompletionItem(e){if(Fc(e.completion.additionalTextEdits)){const t=E("aria.alert.snippet","Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);Pc(t)}}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,completionOptions:{providerFilter:e,kindFilter:i?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},r=o=>{if(o.completion.insertTextRules&4||o.completion.additionalTextEdits)return!0;const s=this.editor.getPosition(),a=o.editStart.column,l=s.column;return l-a!==o.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:s.lineNumber,startColumn:a,endLineNumber:s.lineNumber,endColumn:l})!==o.completion.insertText};Pt.once(this.model.onDidTrigger)(o=>{const s=[];Pt.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{Hr(s),i()},void 0,s),this.model.onDidSuggest(({completionModel:a})=>{if(Hr(s),a.items.length===0){i();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),c=a.items[l];if(!r(c)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:c,model:a},7)},void 0,s)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let r=0;e&&(r|=4),t&&(r|=8),this._insertSuggestion(i,r)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}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)}};wp.ID="editor.contrib.suggestController";wp=yce=Far([UT(1,vK),UT(2,Fs),UT(3,Yn),UT(4,Un),UT(5,Sf),UT(6,wf)],wp);class $ar{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(this._items.indexOf(e)!==-1)throw new Error("Value is already registered");return this._items.push(e),this._items.sort((t,i)=>this.prioritySelector(i)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class Q5 extends Gt{constructor(){super({id:Q5.id,label:E("suggest.trigger.label","Trigger Suggest"),alias:"Trigger Suggest",precondition:Ke.and(ee.writable,ee.hasCompletionItemProvider,mi.Visible.toNegated()),kbOpts:{kbExpr:ee.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const r=wp.get(t);if(!r)return;let o;i&&typeof i=="object"&&i.auto===!0&&(o=!0),r.triggerSuggest(void 0,o,void 0)}}Q5.id="editor.action.triggerSuggest";gr(wp.ID,wp,2);ht(Q5);const pf=100+90,td=kl.bindToContribution(wp.get);Et(new td({id:"acceptSelectedSuggestion",precondition:Ke.and(mi.Visible,mi.HasFocusedSuggestion),handler(n){n.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:Ke.and(mi.Visible,ee.textInputFocus),weight:pf},{primary:3,kbExpr:Ke.and(mi.Visible,ee.textInputFocus,mi.AcceptSuggestionsOnEnter,mi.MakesTextEdit),weight:pf}],menuOpts:[{menuId:WC,title:E("accept.insert","Insert"),group:"left",order:1,when:mi.HasInsertAndReplaceRange.toNegated()},{menuId:WC,title:E("accept.insert","Insert"),group:"left",order:1,when:Ke.and(mi.HasInsertAndReplaceRange,mi.InsertMode.isEqualTo("insert"))},{menuId:WC,title:E("accept.replace","Replace"),group:"left",order:1,when:Ke.and(mi.HasInsertAndReplaceRange,mi.InsertMode.isEqualTo("replace"))}]}));Et(new td({id:"acceptAlternativeSelectedSuggestion",precondition:Ke.and(mi.Visible,ee.textInputFocus,mi.HasFocusedSuggestion),kbOpts:{weight:pf,kbExpr:ee.textInputFocus,primary:1027,secondary:[1026]},handler(n){n.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:WC,group:"left",order:2,when:Ke.and(mi.HasInsertAndReplaceRange,mi.InsertMode.isEqualTo("insert")),title:E("accept.replace","Replace")},{menuId:WC,group:"left",order:2,when:Ke.and(mi.HasInsertAndReplaceRange,mi.InsertMode.isEqualTo("replace")),title:E("accept.insert","Insert")}]}));Xi.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");Et(new td({id:"hideSuggestWidget",precondition:mi.Visible,handler:n=>n.cancelSuggestWidget(),kbOpts:{weight:pf,kbExpr:ee.textInputFocus,primary:9,secondary:[1033]}}));Et(new td({id:"selectNextSuggestion",precondition:Ke.and(mi.Visible,Ke.or(mi.MultipleSuggestions,mi.HasFocusedSuggestion.negate())),handler:n=>n.selectNextSuggestion(),kbOpts:{weight:pf,kbExpr:ee.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));Et(new td({id:"selectNextPageSuggestion",precondition:Ke.and(mi.Visible,Ke.or(mi.MultipleSuggestions,mi.HasFocusedSuggestion.negate())),handler:n=>n.selectNextPageSuggestion(),kbOpts:{weight:pf,kbExpr:ee.textInputFocus,primary:12,secondary:[2060]}}));Et(new td({id:"selectLastSuggestion",precondition:Ke.and(mi.Visible,Ke.or(mi.MultipleSuggestions,mi.HasFocusedSuggestion.negate())),handler:n=>n.selectLastSuggestion()}));Et(new td({id:"selectPrevSuggestion",precondition:Ke.and(mi.Visible,Ke.or(mi.MultipleSuggestions,mi.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevSuggestion(),kbOpts:{weight:pf,kbExpr:ee.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));Et(new td({id:"selectPrevPageSuggestion",precondition:Ke.and(mi.Visible,Ke.or(mi.MultipleSuggestions,mi.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevPageSuggestion(),kbOpts:{weight:pf,kbExpr:ee.textInputFocus,primary:11,secondary:[2059]}}));Et(new td({id:"selectFirstSuggestion",precondition:Ke.and(mi.Visible,Ke.or(mi.MultipleSuggestions,mi.HasFocusedSuggestion.negate())),handler:n=>n.selectFirstSuggestion()}));Et(new td({id:"focusSuggestion",precondition:Ke.and(mi.Visible,mi.HasFocusedSuggestion.negate()),handler:n=>n.focusSuggestion(),kbOpts:{weight:pf,kbExpr:ee.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));Et(new td({id:"focusAndAcceptSuggestion",precondition:Ke.and(mi.Visible,mi.HasFocusedSuggestion.negate()),handler:n=>{n.focusSuggestion(),n.acceptSelectedSuggestion(!0,!1)}}));Et(new td({id:"toggleSuggestionDetails",precondition:Ke.and(mi.Visible,mi.HasFocusedSuggestion),handler:n=>n.toggleSuggestionDetails(),kbOpts:{weight:pf,kbExpr:ee.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:WC,group:"right",order:1,when:Ke.and(mi.DetailsVisible,mi.CanResolve),title:E("detail.more","show less")},{menuId:WC,group:"right",order:1,when:Ke.and(mi.DetailsVisible.toNegated(),mi.CanResolve),title:E("detail.less","show more")}]}));Et(new td({id:"toggleExplainMode",precondition:mi.Visible,handler:n=>n.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));Et(new td({id:"toggleSuggestionFocus",precondition:mi.Visible,handler:n=>n.toggleSuggestionFocus(),kbOpts:{weight:pf,kbExpr:ee.textInputFocus,primary:2570,mac:{primary:778}}}));Et(new td({id:"insertBestCompletion",precondition:Ke.and(ee.textInputFocus,Ke.equals("config.editor.tabCompletion","on"),N4.AtEnd,mi.Visible.toNegated(),tk.OtherSuggestions.toNegated(),Jl.InSnippetMode.toNegated()),handler:(n,e)=>{n.triggerSuggestAndAcceptBest(Vu(e)?Object.assign({fallback:"tab"},e):{fallback:"tab"})},kbOpts:{weight:pf,primary:2}}));Et(new td({id:"insertNextSuggestion",precondition:Ke.and(ee.textInputFocus,Ke.equals("config.editor.tabCompletion","on"),tk.OtherSuggestions,mi.Visible.toNegated(),Jl.InSnippetMode.toNegated()),handler:n=>n.acceptNextSuggestion(),kbOpts:{weight:pf,kbExpr:ee.textInputFocus,primary:2}}));Et(new td({id:"insertPrevSuggestion",precondition:Ke.and(ee.textInputFocus,Ke.equals("config.editor.tabCompletion","on"),tk.OtherSuggestions,mi.Visible.toNegated(),Jl.InSnippetMode.toNegated()),handler:n=>n.acceptPrevSuggestion(),kbOpts:{weight:pf,kbExpr:ee.textInputFocus,primary:1026}}));ht(class extends Gt{constructor(){super({id:"editor.action.resetSuggestSize",label:E("suggest.reset.label","Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(n,e){var t;(t=wp.get(e))===null||t===void 0||t.resetWidgetSize()}});class Var extends Ae{get selectedItem(){return this._selectedItem}constructor(e,t,i,r){super(),this.editor=e,this.suggestControllerPreselector=t,this.checkModelVersion=i,this.onWillAccept=r,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=No(this,void 0),this._register(e.onKeyDown(s=>{s.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(s=>{s.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const o=wp.get(this.editor);if(o){this._register(o.registerSelector({priority:100,select:(l,c,u)=>{var d;Jo(v=>this.checkModelVersion(v));const h=this.editor.getModel();if(!h)return-1;const g=(d=this.suggestControllerPreselector())===null||d===void 0?void 0:d.removeCommonPrefix(h);if(!g)return-1;const p=Ce.lift(c),m=u.map((v,b)=>{const C=rP.fromSuggestion(o,h,p,v,this.isShiftKeyPressed).toSingleTextEdit().removeCommonPrefix(h),x=g.augments(C);return{index:b,valid:x,prefixLength:C.text.length,suggestItem:v}}).filter(v=>v&&v.valid&&v.prefixLength>0),_=JUe(m,fg(v=>v.prefixLength,Gy));return _?_.index:-1}}));let s=!1;const a=()=>{s||(s=!0,this._register(o.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(o.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(o.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(Pt.once(o.model.onDidTrigger)(l=>{a()})),this._register(o.onWillInsertSuggestItem(l=>{const c=this.editor.getPosition(),u=this.editor.getModel();if(!c||!u)return;const d=rP.fromSuggestion(o,u,c,l.item,this.isShiftKeyPressed);this.onWillAccept(d)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!Har(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,Jo(i=>{this.checkModelVersion(i),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,i)}))}getSuggestItemInfo(){const e=wp.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),r=this.editor.getModel();if(!(!t||!i||!r))return rP.fromSuggestion(e,r,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=wp.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=wp.get(this.editor);e==null||e.forceRenderingAbove()}}class rP{static fromSuggestion(e,t,i,r,o){let{insertText:s}=r.completion,a=!1;if(r.completion.insertTextRules&4){const c=new T2().parse(s);c.children.length<100&&gW.adjustWhitespace(t,i,!0,c),s=c.toString(),a=!0}const l=e.getOverwriteInfo(r,o);return new rP(q.fromPositions(i.delta(0,-l.overwriteBefore),i.delta(0,Math.max(l.overwriteAfter,0))),s,r.completion.kind,a)}constructor(e,t,i,r){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=r}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new Gje(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new I2(this.range,this.insertText)}}function Har(n,e){return n===e?!0:!n||!e?!1:n.equals(e)}var War=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},s1=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Cce;let mf=Cce=class extends Ae{static get(e){return e.getContribution(Cce.ID)}constructor(e,t,i,r,o,s,a,l,c){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.configurationService=r,this.commandService=o,this.debounceService=s,this.languageFeaturesService=a,this.audioCueService=l,this._keybindingService=c,this.model=VH("inlineCompletionModel",void 0),this.textModelVersionId=No(this,-1),this.cursorPosition=No(this,new Ce(1,1)),this.suggestWidgetAdaptor=this._register(new Var(this.editor,()=>{var h,g;return(g=(h=this.model.get())===null||h===void 0?void 0:h.selectedInlineCompletion.get())===null||g===void 0?void 0:g.toSingleTextEdit(void 0)},h=>this.updateObservables(h,Lh.Other),h=>{Jo(g=>{var p;this.updateObservables(g,Lh.Other),(p=this.model.get())===null||p===void 0||p.handleSuggestAccepted(h)})})),this._enabled=Ul(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).enabled),this.ghostTextWidget=this._register(this.instantiationService.createInstance(dce,this.editor,{ghostText:this.model.map((h,g)=>h==null?void 0:h.ghostText.read(g)),minReservedLineCount:HH(0),targetTextModel:this.model.map(h=>h==null?void 0:h.textModel)})),this._debounceValue=this.debounceService.for(this.languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._register(new yl(this.contextKeyService,this.model)),this._register(Pt.runAndSubscribe(e.onDidChangeModel,()=>Jo(h=>{this.model.set(void 0,h),this.updateObservables(h,Lh.Other);const g=e.getModel();if(g){const p=t.createInstance(fce,g,this.suggestWidgetAdaptor.selectedItem,this.cursorPosition,this.textModelVersionId,this._debounceValue,Ul(e.onDidChangeConfiguration,()=>e.getOption(117).preview),Ul(e.onDidChangeConfiguration,()=>e.getOption(117).previewMode),Ul(e.onDidChangeConfiguration,()=>e.getOption(62).mode),this._enabled);this.model.set(p,h)}})));const u=h=>{var g;return h.isUndoing?Lh.Undo:h.isRedoing?Lh.Redo:!((g=this.model.get())===null||g===void 0)&&g.isAcceptingPartially?Lh.AcceptWord:Lh.Other};this._register(e.onDidChangeModelContent(h=>Jo(g=>this.updateObservables(g,u(h))))),this._register(e.onDidChangeCursorPosition(h=>Jo(g=>{var p;this.updateObservables(g,Lh.Other),(h.reason===3||h.source==="api")&&((p=this.model.get())===null||p===void 0||p.stop(g))}))),this._register(e.onDidType(()=>Jo(h=>{var g;this.updateObservables(h,Lh.Other),this._enabled.get()&&((g=this.model.get())===null||g===void 0||g.trigger(h))}))),this._register(this.commandService.onDidExecuteCommand(h=>{new Set([PL.Tab.id,PL.DeleteLeft.id,PL.DeleteRight.id,QQe,"acceptSelectedSuggestion"]).has(h.commandId)&&e.hasTextFocus()&&this._enabled.get()&&Jo(p=>{var m;(m=this.model.get())===null||m===void 0||m.trigger(p)})})),this._register(this.editor.onDidBlurEditorWidget(()=>{this.contextKeyService.getContextKeyValue("accessibleViewIsShown")||this.configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||kw.dropDownVisible||Jo(h=>{var g;(g=this.model.get())===null||g===void 0||g.stop(h)})})),this._register(So(h=>{var g;const p=(g=this.model.read(h))===null||g===void 0?void 0:g.state.read(h);p!=null&&p.suggestItem?p.ghostText.lineCount>=2&&this.suggestWidgetAdaptor.forceRenderingAbove():this.suggestWidgetAdaptor.stopForceRenderingAbove()})),this._register(Gn(()=>{this.suggestWidgetAdaptor.stopForceRenderingAbove()}));let d;this._register(So(h=>{const g=this.model.read(h),p=g==null?void 0:g.state.read(h);if(!g||!p||!p.inlineCompletion){d=void 0;return}if(p.inlineCompletion.semanticId!==d){d=p.inlineCompletion.semanticId;const m=g.textModel.getLineContent(p.ghostText.lineNumber);this.audioCueService.playAudioCue(ur.inlineSuggestion).then(()=>{this.editor.getOption(8)&&this.provideScreenReaderUpdate(p.ghostText.renderForScreenReader(m))})}})),this._register(new Wle(this.editor,this.model,this.instantiationService)),this._register(this.configurationService.onDidChangeConfiguration(h=>{h.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this.configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this.configurationService.getValue("accessibility.verbosity.inlineCompletions")})}provideScreenReaderUpdate(e){const t=this.contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let r;!t&&i&&this.editor.getOption(147)&&(r=E("showAccessibleViewHint","Inspect this in the accessible view ({0})",i.getAriaLabel())),Pc(r?e+", "+r:e)}updateObservables(e,t){var i,r;const o=this.editor.getModel();this.textModelVersionId.set((i=o==null?void 0:o.getVersionId())!==null&&i!==void 0?i:-1,e,t),this.cursorPosition.set((r=this.editor.getPosition())!==null&&r!==void 0?r:new Ce(1,1),e)}shouldShowHoverAt(e){var t;const i=(t=this.model.get())===null||t===void 0?void 0:t.ghostText.get();return i?i.parts.some(r=>e.containsPosition(new Ce(i.lineNumber,r.column))):!1}shouldShowHoverAtViewZone(e){return this.ghostTextWidget.ownsViewZone(e)}};mf.ID="editor.contrib.inlineCompletionsController";mf=Cce=War([s1(1,Un),s1(2,Yn),s1(3,Ui),s1(4,Fs),s1(5,Fg),s1(6,en),s1(7,F5),s1(8,mo)],mf);var oS=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class yK extends Gt{constructor(){super({id:yK.ID,label:E("action.inlineSuggest.showNext","Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:Ke.and(ee.writable,yl.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}run(e,t){var i;return oS(this,void 0,void 0,function*(){const r=mf.get(t);(i=r==null?void 0:r.model.get())===null||i===void 0||i.next()})}}yK.ID=ZQe;class CK extends Gt{constructor(){super({id:CK.ID,label:E("action.inlineSuggest.showPrevious","Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:Ke.and(ee.writable,yl.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}run(e,t){var i;return oS(this,void 0,void 0,function*(){const r=mf.get(t);(i=r==null?void 0:r.model.get())===null||i===void 0||i.previous()})}}CK.ID=XQe;class zar extends Gt{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:E("action.inlineSuggest.trigger","Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:ee.writable})}run(e,t){var i;return oS(this,void 0,void 0,function*(){const r=mf.get(t);(i=r==null?void 0:r.model.get())===null||i===void 0||i.triggerExplicitly()})}}class jar extends Gt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:E("action.inlineSuggest.acceptNextWord","Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:Ke.and(ee.writable,yl.inlineSuggestionVisible),kbOpts:{weight:100+1,primary:2065,kbExpr:Ke.and(ee.writable,yl.inlineSuggestionVisible)},menuOpts:[{menuId:J.InlineSuggestionToolbar,title:E("acceptWord","Accept Word"),group:"primary",order:2}]})}run(e,t){var i;return oS(this,void 0,void 0,function*(){const r=mf.get(t);yield(i=r==null?void 0:r.model.get())===null||i===void 0?void 0:i.acceptNextWord(r.editor)})}}class Uar extends Gt{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:E("action.inlineSuggest.acceptNextLine","Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:Ke.and(ee.writable,yl.inlineSuggestionVisible),kbOpts:{weight:100+1},menuOpts:[{menuId:J.InlineSuggestionToolbar,title:E("acceptLine","Accept Line"),group:"secondary",order:2}]})}run(e,t){var i;return oS(this,void 0,void 0,function*(){const r=mf.get(t);yield(i=r==null?void 0:r.model.get())===null||i===void 0?void 0:i.acceptNextLine(r.editor)})}}class qar extends Gt{constructor(){super({id:QQe,label:E("action.inlineSuggest.accept","Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:yl.inlineSuggestionVisible,menuOpts:[{menuId:J.InlineSuggestionToolbar,title:E("accept","Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:Ke.and(yl.inlineSuggestionVisible,ee.tabMovesFocus.toNegated(),yl.inlineSuggestionHasIndentationLessThanTabSize,mi.Visible.toNegated(),ee.hoverFocused.toNegated())}})}run(e,t){var i;return oS(this,void 0,void 0,function*(){const r=mf.get(t);r&&((i=r.model.get())===null||i===void 0||i.accept(r.editor),r.editor.focus())})}}class wK extends Gt{constructor(){super({id:wK.ID,label:E("action.inlineSuggest.hide","Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:yl.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}run(e,t){return oS(this,void 0,void 0,function*(){const i=mf.get(t);Jo(r=>{var o;(o=i==null?void 0:i.model.get())===null||o===void 0||o.stop(r)})})}}wK.ID="editor.action.inlineSuggest.hide";class SK extends Cf{constructor(){super({id:SK.ID,title:E("action.inlineSuggest.alwaysShowToolbar","Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:J.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:Ke.equals("config.editor.inlineSuggest.showToolbar","always")})}run(e,t){return oS(this,void 0,void 0,function*(){const i=e.get(Ui),o=i.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";i.updateValue("editor.inlineSuggest.showToolbar",o)})}}SK.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";var Kar=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},sN=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};class Gar{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let wce=class{constructor(e,t,i,r,o,s){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=r,this._instantiationService=o,this._telemetryService=s,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=mf.get(this._editor);if(!t)return null;const i=e.target;if(i.type===8){const r=i.detail;if(t.shouldShowHoverAtViewZone(r.viewZoneId))return new t9(1e3,this,q.fromPositions(this._editor.getModel().validatePosition(r.positionBefore||r.position)),e.event.posx,e.event.posy,!1)}return i.type===7&&t.shouldShowHoverAt(i.range)?new t9(1e3,this,i.range,e.event.posx,e.event.posy,!1):i.type===6&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range)?new t9(1e3,this,i.range,e.event.posx,e.event.posy,!1):null}computeSync(e,t){if(this._editor.getOption(62).showToolbar==="always")return[];const i=mf.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new Gar(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new nt,r=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&this.renderScreenReaderText(e,r,i);const o=r.controller.model.get(),s=this._instantiationService.createInstance(kw,this._editor,!1,HH(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.selectedInlineCompletion.map(a=>{var l;return(l=a==null?void 0:a.inlineCompletion.source.inlineCompletions.commands)!==null&&l!==void 0?l:[]}));return e.fragment.appendChild(s.getDomNode()),o.triggerExplicitly(),i.add(s),i}renderScreenReaderText(e,t,i){const r=at,o=r("div.hover-row.markdown-hover"),s=Ge(o,r("div.hover-contents",{"aria-live":"assertive"})),a=i.add(new w0({editor:this._editor},this._languageService,this._openerService)),l=c=>{i.add(a.onDidRenderAsync(()=>{s.className="hover-contents code-hover-contents",e.onContentsChanged()}));const u=E("inlineSuggestionFollows","Suggestion:"),d=i.add(a.render(new hc().appendText(u).appendCodeblock("text",c)));s.replaceChildren(d.element)};i.add(So(c=>{var u;const d=(u=t.controller.model.read(c))===null||u===void 0?void 0:u.ghostText.read(c);if(d){const h=this._editor.getModel().getLineContent(d.lineNumber);l(d.renderForScreenReader(h))}else Yl(s)})),e.fragment.appendChild(o)}};wce=Kar([sN(1,Qo),sN(2,mh),sN(3,N0),sN(4,Un),sN(5,wf)],wce);gr(mf.ID,mf,3);ht(zar);ht(yK);ht(CK);ht(jar);ht(Uar);ht(qar);ht(wK);jo(SK);Kk.register(wce);function jd(n,e){let t=0;for(let i=0;i<n.length;i++)n.charAt(i)===" "?t+=e:t++;return t}function oP(n,e,t){n=n<0?0:n;let i="";if(!t){const r=Math.floor(n/e);n=n%e;for(let o=0;o<r;o++)i+=" "}for(let r=0;r<n;r++)i+=" ";return i}var Yar=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Qar=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};function BXe(n,e,t,i,r){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return[];const o=e.getLanguageConfiguration(n.getLanguageId()).indentationRules;if(!o)return[];for(i=Math.min(i,n.getLineCount());t<=i&&o.unIndentedLinePattern;){const _=n.getLineContent(t);if(!o.unIndentedLinePattern.test(_))break;t++}if(t>i-1)return[];const{tabSize:s,indentSize:a,insertSpaces:l}=n.getOptions(),c=(_,v)=>(v=v||1,Xf.shiftIndent(_,_.length+v,s,a,l)),u=(_,v)=>(v=v||1,Xf.unshiftIndent(_,_.length+v,s,a,l)),d=[];let h;const g=n.getLineContent(t);let p=g;if(r!=null){h=r;const _=go(g);p=h+g.substring(_.length),o.decreaseIndentPattern&&o.decreaseIndentPattern.test(p)&&(h=u(h),p=h+g.substring(_.length)),g!==p&&d.push(es.replaceMove(new ln(t,1,t,_.length+1),XV(h,a,l)))}else h=go(g);let m=h;o.increaseIndentPattern&&o.increaseIndentPattern.test(p)?(m=c(m),h=c(h)):o.indentNextLinePattern&&o.indentNextLinePattern.test(p)&&(m=c(m)),t++;for(let _=t;_<=i;_++){const v=n.getLineContent(_),b=go(v),y=m+v.substring(b.length);o.decreaseIndentPattern&&o.decreaseIndentPattern.test(y)&&(m=u(m),h=u(h)),b!==m&&d.push(es.replaceMove(new ln(_,1,_,b.length+1),XV(m,a,l))),!(o.unIndentedLinePattern&&o.unIndentedLinePattern.test(v))&&(o.increaseIndentPattern&&o.increaseIndentPattern.test(y)?(h=c(h),m=h):o.indentNextLinePattern&&o.indentNextLinePattern.test(y)?m=c(m):m=h)}return d}class EK extends Gt{constructor(){super({id:EK.ID,label:E("indentationToSpaces","Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:ee.writable})}run(e,t){const i=t.getModel();if(!i)return;const r=i.getOptions(),o=t.getSelection();if(!o)return;const s=new elr(o,r.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}}EK.ID="editor.action.indentationToSpaces";class xK extends Gt{constructor(){super({id:xK.ID,label:E("indentationToTabs","Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:ee.writable})}run(e,t){const i=t.getModel();if(!i)return;const r=i.getOptions(),o=t.getSelection();if(!o)return;const s=new tlr(o,r.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}}xK.ID="editor.action.indentationToTabs";class vbe extends Gt{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(P_),r=e.get(ts),o=t.getModel();if(!o)return;const s=r.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),a=o.getOptions(),l=[1,2,3,4,5,6,7,8].map(u=>({id:u.toString(),label:u.toString(),description:u===s.tabSize&&u===a.tabSize?E("configuredTabSize","Configured Tab Size"):u===s.tabSize?E("defaultTabSize","Default Tab Size"):u===a.tabSize?E("currentTabSize","Current Tab Size"):void 0})),c=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(l,{placeHolder:E({key:"selectTabWidth",comment:["Tab corresponds to the tab key"]},"Select Tab Size for Current File"),activeItem:l[c]}).then(u=>{if(u&&o&&!o.isDisposed()){const d=parseInt(u.label,10);this.displaySizeOnly?o.updateOptions({tabSize:d}):o.updateOptions({tabSize:d,indentSize:d,insertSpaces:this.insertSpaces})}})},50)}}class kK extends vbe{constructor(){super(!1,!1,{id:kK.ID,label:E("indentUsingTabs","Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}kK.ID="editor.action.indentUsingTabs";class TK extends vbe{constructor(){super(!0,!1,{id:TK.ID,label:E("indentUsingSpaces","Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}TK.ID="editor.action.indentUsingSpaces";class IK extends vbe{constructor(){super(!0,!0,{id:IK.ID,label:E("changeTabDisplaySize","Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0})}}IK.ID="editor.action.changeTabDisplaySize";class LK extends Gt{constructor(){super({id:LK.ID,label:E("detectIndentation","Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const i=e.get(ts),r=t.getModel();if(!r)return;const o=i.getCreationOptions(r.getLanguageId(),r.uri,r.isForSimpleWidget);r.detectIndentation(o.insertSpaces,o.tabSize)}}LK.ID="editor.action.detectIndentation";class Xar extends Gt{constructor(){super({id:"editor.action.reindentlines",label:E("editor.reindentlines","Reindent Lines"),alias:"Reindent Lines",precondition:ee.writable})}run(e,t){const i=e.get(xo),r=t.getModel();if(!r)return;const o=BXe(r,i,1,r.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class Zar extends Gt{constructor(){super({id:"editor.action.reindentselectedlines",label:E("editor.reindentselectedlines","Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:ee.writable})}run(e,t){const i=e.get(xo),r=t.getModel();if(!r)return;const o=t.getSelections();if(o===null)return;const s=[];for(const a of o){let l=a.startLineNumber,c=a.endLineNumber;if(l!==c&&a.endColumn===1&&c--,l===1){if(l===c)continue}else l--;const u=BXe(r,i,l,c);s.push(...u)}s.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}}class Jar{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const i of e)i.range&&typeof i.text=="string"&&this._edits.push(i)}getEditOperations(e,t){for(const r of this._edits)t.addEditOperation(q.lift(r.range),r.text);let i=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}let P4=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new nt,this.callOnModel=new nt,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(12)<4||this.editor.getOption(55))&&this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste(({range:e})=>{this.trigger(e)}))}trigger(e){const t=this.editor.getSelections();if(t===null||t.length>1)return;const i=this.editor.getModel();if(!i||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const r=this.editor.getOption(12),{tabSize:o,indentSize:s,insertSpaces:a}=i.getOptions(),l=[],c={shiftIndent:g=>Xf.shiftIndent(g,g.length+1,o,s,a),unshiftIndent:g=>Xf.unshiftIndent(g,g.length+1,o,s,a)};let u=e.startLineNumber;for(;u<=e.endLineNumber;){if(this.shouldIgnoreLine(i,u)){u++;continue}break}if(u>e.endLineNumber)return;let d=i.getLineContent(u);if(!/\S/.test(d.substring(0,e.startColumn-1))){const g=FO(r,i,i.getLanguageId(),u,c,this._languageConfigurationService);if(g!==null){const p=go(d),m=jd(g,o),_=jd(p,o);if(m!==_){const v=oP(m,o,a);l.push({range:new q(u,1,u,p.length+1),text:v}),d=v+d.substr(p.length)}else{const v=Hqe(i,u,this._languageConfigurationService);if(v===0||v===8)return}}}const h=u;for(;u<e.endLineNumber;){if(!/\S/.test(i.getLineContent(u+1))){u++;continue}break}if(u!==e.endLineNumber){const p=FO(r,{tokenization:{getLineTokens:m=>i.tokenization.getLineTokens(m),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(m,_)=>i.getLanguageIdAtPosition(m,_)},getLineContent:m=>m===h?d:i.getLineContent(m)},i.getLanguageId(),u+1,c,this._languageConfigurationService);if(p!==null){const m=jd(p,o),_=jd(go(i.getLineContent(u+1)),o);if(m!==_){const v=m-_;for(let b=u+1;b<=e.endLineNumber;b++){const y=i.getLineContent(b),C=go(y),k=jd(C,o)+v,I=oP(k,o,a);I!==C&&l.push({range:new q(b,1,b,C.length+1),text:I})}}}}if(l.length>0){this.editor.pushUndoStop();const g=new Jar(l,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",g),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const i=e.getLineFirstNonWhitespaceColumn(t);if(i===0)return!0;const r=e.tokenization.getLineTokens(t);if(r.getCount()>0){const o=r.findTokenIndexAtOffset(i);if(o>=0&&r.getStandardTokenType(o)===1)return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};P4.ID="editor.contrib.autoIndentOnPaste";P4=Yar([Qar(1,xo)],P4);function $Xe(n,e,t,i){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let r="";for(let s=0;s<t;s++)r+=" ";const o=new RegExp(r,"gi");for(let s=1,a=n.getLineCount();s<=a;s++){let l=n.getLineFirstNonWhitespaceColumn(s);if(l===0&&(l=n.getLineMaxColumn(s)),l===1)continue;const c=new q(s,1,s,l),u=n.getValueInRange(c),d=i?u.replace(/\t/ig,r):u.replace(o," ");e.addEditOperation(c,d)}}class elr{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),$Xe(e,t,this.tabSize,!0)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}class tlr{constructor(e,t){this.selection=e,this.tabSize=t,this.selectionId=null}getEditOperations(e,t){this.selectionId=t.trackSelection(this.selection),$Xe(e,t,this.tabSize,!1)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}}gr(P4.ID,P4,2);ht(EK);ht(xK);ht(kK);ht(TK);ht(IK);ht(LK);ht(Xar);ht(Zar);var pW=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class VXe{constructor(e,t){this.range=e,this.direction=t}}class bbe{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new bbe(this.hint,e.anchor,this.provider);return t._isResolved=this._isResolved,t._currentResolve=this._currentResolve,t}resolve(e){return pW(this,void 0,void 0,function*(){if(typeof this.provider.resolveInlayHint=="function"){if(this._currentResolve)return yield this._currentResolve,e.isCancellationRequested?void 0:this.resolve(e);this._isResolved||(this._currentResolve=this._doResolve(e).finally(()=>this._currentResolve=void 0)),yield this._currentResolve}})}_doResolve(e){var t,i;return pW(this,void 0,void 0,function*(){try{const r=yield Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=(t=r==null?void 0:r.tooltip)!==null&&t!==void 0?t:this.hint.tooltip,this.hint.label=(i=r==null?void 0:r.label)!==null&&i!==void 0?i:this.hint.label,this._isResolved=!0}catch(r){Sa(r),this._isResolved=!1}})}}class M4{static create(e,t,i,r){return pW(this,void 0,void 0,function*(){const o=[],s=e.ordered(t).reverse().map(a=>i.map(l=>pW(this,void 0,void 0,function*(){try{const c=yield a.provideInlayHints(t,l,r);c!=null&&c.hints.length&&o.push([c,a])}catch(c){Sa(c)}})));if(yield Promise.all(s.flat()),r.isCancellationRequested||t.isDisposed())throw new Xw;return new M4(i,o,t)})}constructor(e,t,i){this._disposables=new nt,this.ranges=e,this.provider=new Set;const r=[];for(const[o,s]of t){this._disposables.add(o),this.provider.add(s);for(const a of o.hints){const l=i.validatePosition(a.position);let c="before";const u=M4._getRangeAtPosition(i,l);let d;u.getStartPosition().isBefore(l)?(d=q.fromPositions(u.getStartPosition(),l),c="after"):(d=q.fromPositions(l,u.getEndPosition()),c="before"),r.push(new bbe(a,new VXe(d,c),s))}}this.items=r.sort((o,s)=>Ce.compare(o.hint.position,s.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,r=e.getWordAtPosition(t);if(r)return new q(i,r.startColumn,i,r.endColumn);e.tokenization.tokenizeIfCheap(i);const o=e.tokenization.getLineTokens(i),s=t.column-1,a=o.findTokenIndexAtOffset(s);let l=o.getStartOffset(a),c=o.getEndOffset(a);return c-l===1&&(l===s&&a>1?(l=o.getStartOffset(a-1),c=o.getEndOffset(a-1)):c===s&&a<o.getCount()-1&&(l=o.getStartOffset(a+1),c=o.getEndOffset(a+1))),new q(i,l+1,i,c+1)}}function nlr(n){return Tn.from({scheme:Si.command,path:n.id,query:n.arguments&&encodeURIComponent(JSON.stringify(n.arguments))}).toString()}var sP=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function ilr(n,e,t,i){var r;return sP(this,void 0,void 0,function*(){const o=n.get(Pd),s=n.get(om),a=n.get(Fs),l=n.get(Un),c=n.get(ga);if(yield i.item.resolve(Mi.None),!i.part.location)return;const u=i.part.location,d=[],h=new Set(jl.getMenuItems(J.EditorContext).map(p=>PI(p)?p.command.id:aK()));for(const p of ou.all())h.has(p.desc.id)&&d.push(new Gu(p.desc.id,qp.label(p.desc,{renderShortTitle:!0}),void 0,!0,()=>sP(this,void 0,void 0,function*(){const m=yield o.createModelReference(u.uri);try{const _=new C2(m.object.textEditorModel,q.getStartPosition(u.range)),v=i.item.anchor.range;yield l.invokeFunction(p.runEditorCommand.bind(p),e,_,v)}finally{m.dispose()}})));if(i.part.command){const{command:p}=i.part;d.push(new El),d.push(new Gu(p.id,p.title,void 0,!0,()=>sP(this,void 0,void 0,function*(){var m;try{yield a.executeCommand(p.id,...(m=p.arguments)!==null&&m!==void 0?m:[])}catch(_){c.notify({severity:pq.Error,source:i.item.provider.displayName,message:_})}})))}const g=e.getOption(126);s.showContextMenu({domForShadowRoot:g&&(r=e.getDomNode())!==null&&r!==void 0?r:void 0,getAnchor:()=>{const p=Oa(t);return{x:p.left,y:p.top+p.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})})}function HXe(n,e,t,i){return sP(this,void 0,void 0,function*(){const o=yield n.get(Pd).createModelReference(i.uri);yield t.invokeWithinContext(s=>sP(this,void 0,void 0,function*(){const a=e.hasSideBySideModifier,l=s.get(Yn),c=Dd.inPeekEditor.getValue(l),u=!a&&t.getOption(87)&&!c;return new G5({openToSide:a,openInPeek:u,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(s,new C2(o.object.textEditorModel,q.getStartPosition(i.range)),q.lift(i.range))})),o.dispose()})}var rlr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},qT=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},lI=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},o9;class mW{constructor(){this._entries=new eS(50)}get(e){const t=mW._key(e);return this._entries.get(t)}set(e,t){const i=mW._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const WXe=Vi("IInlayHintsCache");Zi(WXe,mW,1);class Sce{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return typeof e=="string"?{label:e}:e[this.index]}}class olr{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let nk=o9=class{static get(e){var t;return(t=e.getContribution(o9.ID))!==null&&t!==void 0?t:void 0}constructor(e,t,i,r,o,s,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=r,this._commandService=o,this._notificationService=s,this._instaService=a,this._disposables=new nt,this._sessionDisposables=new nt,this._decorationsMetadata=new Map,this._ruleFactory=new y5(this._editor),this._activeRenderMode=0,this._debounceInfo=i.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(l=>{l.hasChanged(139)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(139);if(e.enabled==="off")return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;const i=this._inlayHintsCache.get(t);i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(Gn(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let r;const o=new Set,s=new so(()=>lI(this,void 0,void 0,function*(){const a=Date.now();r==null||r.dispose(!0),r=new da;const l=t.onWillDispose(()=>r==null?void 0:r.cancel());try{const c=r.token,u=yield M4.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),c);if(s.delay=this._debounceInfo.update(t,Date.now()-a),c.isCancellationRequested){u.dispose();return}for(const d of u.provider)typeof d.onDidChangeInlayHints=="function"&&!o.has(d)&&(o.add(d),this._sessionDisposables.add(d.onDidChangeInlayHints(()=>{s.isScheduled()||s.schedule()})));this._sessionDisposables.add(u),this._updateHintsDecorators(u.ranges,u.items),this._cacheHintsForFastRestore(t)}catch(c){fi(c)}finally{r.dispose(),l.dispose()}}),this._debounceInfo.get(t));if(this._sessionDisposables.add(s),this._sessionDisposables.add(Gn(()=>r==null?void 0:r.dispose(!0))),s.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(a=>{(a.scrollTopChanged||!s.isScheduled())&&s.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeModelContent(a=>{const l=Math.max(s.delay,1250);s.schedule(l)})),e.enabled==="on")this._activeRenderMode=0;else{let a,l;e.enabled==="onUnlessPressed"?(a=0,l=1):(a=1,l=0),this._activeRenderMode=a,this._sessionDisposables.add(Oy.getInstance().event(c=>{if(!this._editor.hasModel())return;const u=c.altKey&&c.ctrlKey&&!(c.shiftKey||c.metaKey)?l:a;if(u!==this._activeRenderMode){this._activeRenderMode=u;const d=this._editor.getModel(),h=this._copyInlayHintsWithCurrentAnchor(d);this._updateHintsDecorators([d.getFullModelRange()],h),s.schedule(0)}}))}this._sessionDisposables.add(this._installDblClickGesture(()=>s.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new nt,t=e.add(new Zq(this._editor)),i=new nt;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(r=>{const[o]=r,s=this._getInlayHintLabelPart(o),a=this._editor.getModel();if(!s||!a){i.clear();return}const l=new da;i.add(Gn(()=>l.dispose(!0))),s.item.resolve(l.token),this._activeInlayHintPart=s.part.command||s.part.location?new olr(s,o.hasTriggerModifier):void 0;const c=a.validatePosition(s.item.hint.position).lineNumber,u=new q(c,1,c,a.getLineMaxColumn(c)),d=this._getInlineHintsForRange(u);this._updateHintsDecorators([u],d),i.add(Gn(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([u],d)}))})),e.add(t.onCancel(()=>i.clear())),e.add(t.onExecute(r=>lI(this,void 0,void 0,function*(){const o=this._getInlayHintLabelPart(r);if(o){const s=o.part;s.location?this._instaService.invokeFunction(HXe,r,this._editor,s.location):noe.is(s.command)&&(yield this._invokeCommand(s.command,o.item))}}))),e}_getInlineHintsForRange(e){const t=new Set;for(const i of this._decorationsMetadata.values())e.containsRange(i.item.anchor.range)&&t.add(i.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(t=>lI(this,void 0,void 0,function*(){if(t.event.detail!==2)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),yield i.item.resolve(Mi.None),Fc(i.item.hint.textEdits))){const r=i.item.hint.textEdits.map(o=>es.replace(q.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",r),e()}}))}_installContextMenu(){return this._editor.onContextMenu(e=>lI(this,void 0,void 0,function*(){if(!(e.event.target instanceof HTMLElement))return;const t=this._getInlayHintLabelPart(e);t&&(yield this._instaService.invokeFunction(ilr,this._editor,e.event.target,t))}))}_getInlayHintLabelPart(e){var t;if(e.target.type!==6)return;const i=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;if(i instanceof vw&&(i==null?void 0:i.attachedData)instanceof Sce)return i.attachedData}_invokeCommand(e,t){var i;return lI(this,void 0,void 0,function*(){try{yield this._commandService.executeCommand(e.id,...(i=e.arguments)!==null&&i!==void 0?i:[])}catch(r){this._notificationService.notify({severity:pq.Error,source:t.provider.displayName,message:r})}})}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[i,r]of this._decorationsMetadata){if(t.has(r.item))continue;const o=e.getDecorationRange(i);if(o){const s=new VXe(o,r.item.anchor.direction),a=r.item.with({anchor:s});t.set(r.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),r=[];for(const o of i.sort(q.compareRangesUsingStarts)){const s=t.validateRange(new q(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));r.length===0||!q.areIntersectingOrTouching(r[r.length-1],s)?r.push(s):r[r.length-1]=q.plusRange(r[r.length-1],s)}return r}_updateHintsDecorators(e,t){var i,r;const o=[],s=(m,_,v,b,y)=>{const C={content:v,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:_.className,cursorStops:b,attachedData:y};o.push({item:m,classNameRef:_,decoration:{range:m.anchor.range,options:{description:"InlayHint",showIfCollapsed:m.anchor.range.isEmpty(),collapseOnReplaceEdit:!m.anchor.range.isEmpty(),stickiness:0,[m.anchor.direction]:this._activeRenderMode===0?C:void 0}}})},a=(m,_)=>{const v=this._ruleFactory.createClassNameRef({width:`${l/3|0}px`,display:"inline-block"});s(m,v,"",_?r_.Right:r_.None)},{fontSize:l,fontFamily:c,padding:u,isUniform:d}=this._getLayoutInfo(),h="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(h,c);for(const m of t){m.hint.paddingLeft&&a(m,!1);const _=typeof m.hint.label=="string"?[{label:m.hint.label}]:m.hint.label;for(let v=0;v<_.length;v++){const b=_[v],y=v===0,C=v===_.length-1,x={fontSize:`${l}px`,fontFamily:`var(${h}), ${ih.fontFamily}`,verticalAlign:d?"baseline":"middle",unicodeBidi:"isolate"};Fc(m.hint.textEdits)&&(x.cursor="default"),this._fillInColors(x,m.hint),(b.command||b.location)&&((i=this._activeInlayHintPart)===null||i===void 0?void 0:i.part.item)===m&&this._activeInlayHintPart.part.index===v&&(x.textDecoration="underline",this._activeInlayHintPart.hasTriggerModifier&&(x.color=ms(X7i),x.cursor="pointer")),u&&(y&&C?(x.padding=`1px ${Math.max(1,l/4)|0}px`,x.borderRadius=`${l/4|0}px`):y?(x.padding=`1px 0 1px ${Math.max(1,l/4)|0}px`,x.borderRadius=`${l/4|0}px 0 0 ${l/4|0}px`):C?(x.padding=`1px ${Math.max(1,l/4)|0}px 1px 0`,x.borderRadius=`0 ${l/4|0}px ${l/4|0}px 0`):x.padding="1px 0 1px 0"),s(m,this._ruleFactory.createClassNameRef(x),slr(b.label),C&&!m.hint.paddingRight?r_.Right:r_.None,new Sce(m,v))}if(m.hint.paddingRight&&a(m,!0),o.length>o9._MAX_DECORATORS)break}const g=[];for(const m of e)for(const{id:_}of(r=this._editor.getDecorationsInRange(m))!==null&&r!==void 0?r:[]){const v=this._decorationsMetadata.get(_);v&&(g.push(_),v.classNameRef.dispose(),this._decorationsMetadata.delete(_))}const p=k_.capture(this._editor);this._editor.changeDecorations(m=>{const _=m.deltaDecorations(g,o.map(v=>v.decoration));for(let v=0;v<_.length;v++){const b=o[v];this._decorationsMetadata.set(_[v],b)}}),p.restore(this._editor)}_fillInColors(e,t){t.kind===IV.Parameter?(e.backgroundColor=ms(tVi),e.color=ms(eVi)):t.kind===IV.Type?(e.backgroundColor=ms(J7i),e.color=ms(Z7i)):(e.backgroundColor=ms($y),e.color=ms(By))}_getLayoutInfo(){const e=this._editor.getOption(139),t=e.padding,i=this._editor.getOption(52),r=this._editor.getOption(49);let o=e.fontSize;(!o||o<5||o>i)&&(o=i);const s=e.fontFamily||r;return{fontSize:o,fontFamily:s,padding:t,isUniform:!t&&s===r&&o===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};nk.ID="editor.contrib.InlayHints";nk._MAX_DECORATORS=1500;nk=o9=rlr([qT(1,en),qT(2,Fg),qT(3,WXe),qT(4,Fs),qT(5,ga),qT(6,Un)],nk);function slr(n){const e=" ";return n.replace(/[ \t]/g,e)}Xi.registerCommand("_executeInlayHintProvider",(n,...e)=>lI(void 0,void 0,void 0,function*(){const[t,i]=e;to(Tn.isUri(t)),to(q.isIRange(i));const{inlayHintsProvider:r}=n.get(en),o=yield n.get(Pd).createModelReference(t);try{const s=yield M4.create(r,o.object.textEditorModel,[q.lift(i)],Mi.None),a=s.items.map(l=>l.hint);return setTimeout(()=>s.dispose(),0),a}finally{o.dispose()}}));var alr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},aN=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},$Ne=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},llr=globalThis&&globalThis.__asyncValues||function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof __values=="function"?__values(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=n[o]&&function(s){return new Promise(function(a,l){s=n[o](s),r(a,l,s.done,s.value)})}}function r(o,s,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},s)}};class VNe extends t9{constructor(e,t,i,r){super(10,t,e.item.anchor.range,i,r,!0),this.part=e}}let Ece=class extends nW{constructor(e,t,i,r,o,s){super(e,t,i,r,s),this._resolverService=o,this.hoverOrdinal=6}suggestHoverAnchor(e){var t;if(!nk.get(this._editor)||e.target.type!==6)return null;const r=(t=e.target.detail.injectedText)===null||t===void 0?void 0:t.options;return r instanceof vw&&r.attachedData instanceof Sce?new VNe(r.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof VNe?new ba(r=>$Ne(this,void 0,void 0,function*(){var o,s,a,l;const{part:c}=e;if(yield c.item.resolve(i),i.isCancellationRequested)return;let u;typeof c.item.hint.tooltip=="string"?u=new hc().appendText(c.item.hint.tooltip):c.item.hint.tooltip&&(u=c.item.hint.tooltip),u&&r.emitOne(new Xm(this,e.range,[u],!1,0)),Fc(c.item.hint.textEdits)&&r.emitOne(new Xm(this,e.range,[new hc().appendText(E("hint.dbl","Double-click to insert"))],!1,10001));let d;if(typeof c.part.tooltip=="string"?d=new hc().appendText(c.part.tooltip):c.part.tooltip&&(d=c.part.tooltip),d&&r.emitOne(new Xm(this,e.range,[d],!1,1)),c.part.location||c.part.command){let _;const b=this._editor.getOption(77)==="altKey"?Qi?E("links.navigate.kb.meta.mac","cmd + click"):E("links.navigate.kb.meta","ctrl + click"):Qi?E("links.navigate.kb.alt.mac","option + click"):E("links.navigate.kb.alt","alt + click");c.part.location&&c.part.command?_=new hc().appendText(E("hint.defAndCommand","Go to Definition ({0}), right click for more",b)):c.part.location?_=new hc().appendText(E("hint.def","Go to Definition ({0})",b)):c.part.command&&(_=new hc(`[${E("hint.cmd","Execute Command")}](${nlr(c.part.command)} "${c.part.command.title}") (${b})`,{isTrusted:!0})),_&&r.emitOne(new Xm(this,e.range,[_],!1,1e4))}const h=yield this._resolveInlayHintLabelPartHover(c,i);try{for(var g=!0,p=llr(h),m;m=yield p.next(),o=m.done,!o;g=!0){l=m.value,g=!1;const _=l;r.emitOne(_)}}catch(_){s={error:_}}finally{try{!g&&!o&&(a=p.return)&&(yield a.call(p))}finally{if(s)throw s.error}}})):ba.EMPTY}_resolveInlayHintLabelPartHover(e,t){return $Ne(this,void 0,void 0,function*(){if(!e.part.location)return ba.EMPTY;const{uri:i,range:r}=e.part.location,o=yield this._resolverService.createModelReference(i);try{const s=o.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(s)?Qve(this._languageFeaturesService.hoverProvider,s,new Ce(r.startLineNumber,r.startColumn),t).filter(a=>!h2(a.hover.contents)).map(a=>new Xm(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal)):ba.EMPTY}finally{o.dispose()}})}};Ece=alr([aN(1,Qo),aN(2,mh),aN(3,Ui),aN(4,Pd),aN(5,en)],Ece);gr(nk.ID,nk,1);Kk.register(Ece);class clr{constructor(e,t,i){this._editRange=e,this._originalSelection=t,this._text=i}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const r=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new ln(r.endLineNumber,Math.min(this._originalSelection.positionColumn,r.endColumn),r.endLineNumber,Math.min(this._originalSelection.positionColumn,r.endColumn)):new ln(r.endLineNumber,r.endColumn-this._text.length,r.endLineNumber,r.endColumn)}}var ulr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},dlr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},s9;let Iw=s9=class{static get(e){return e.getContribution(s9.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var i;(i=this.currentRequest)===null||i===void 0||i.cancel();const r=this.editor.getSelection(),o=this.editor.getModel();if(!o||!r)return;let s=r;if(s.startLineNumber!==s.endLineNumber)return;const a=new hYe(this.editor,5),l=o.uri;return this.editorWorkerService.canNavigateValueSet(l)?(this.currentRequest=za(c=>this.editorWorkerService.navigateValueSet(l,s,t)),this.currentRequest.then(c=>{var u;if(!c||!c.range||!c.value||!a.validate(this.editor))return;const d=q.lift(c.range);let h=c.range;const g=c.value.length-(s.endColumn-s.startColumn);h={startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.startColumn+c.value.length},g>1&&(s=new ln(s.startLineNumber,s.startColumn,s.endLineNumber,s.endColumn+g-1));const p=new clr(d,s,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,p),this.editor.pushUndoStop(),this.decorations.set([{range:h,options:s9.DECORATION}]),(u=this.decorationRemover)===null||u===void 0||u.cancel(),this.decorationRemover=cw(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(fi)}).catch(fi)):Promise.resolve(void 0)}};Iw.ID="editor.contrib.inPlaceReplaceController";Iw.DECORATION=hi.register({description:"in-place-replace",className:"valueSetReplacement"});Iw=s9=ulr([dlr(1,lm)],Iw);class hlr extends Gt{constructor(){super({id:"editor.action.inPlaceReplace.up",label:E("InPlaceReplaceAction.previous.label","Replace with Previous Value"),alias:"Replace with Previous Value",precondition:ee.writable,kbOpts:{kbExpr:ee.editorTextFocus,primary:3159,weight:100}})}run(e,t){const i=Iw.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class flr extends Gt{constructor(){super({id:"editor.action.inPlaceReplace.down",label:E("InPlaceReplaceAction.next.label","Replace with Next Value"),alias:"Replace with Next Value",precondition:ee.writable,kbOpts:{kbExpr:ee.editorTextFocus,primary:3161,weight:100}})}run(e,t){const i=Iw.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}gr(Iw.ID,Iw,4);ht(hlr);ht(flr);class glr extends Gt{constructor(){super({id:"expandLineSelection",label:E("expandLineSelection","Expand Line Selection"),alias:"Expand Line Selection",precondition:void 0,kbOpts:{weight:0,kbExpr:ee.textInputFocus,primary:2090}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const r=t._getViewModel();r.model.pushStackElement(),r.setCursorStates(i.source,3,Nl.expandLineSelection(r,r.getCursorStates())),r.revealPrimaryCursor(i.source,!0)}}ht(glr);class plr{constructor(e,t){this._selection=e,this._cursors=t,this._selectionId=null}getEditOperations(e,t){const i=mlr(e,this._cursors);for(let r=0,o=i.length;r<o;r++){const s=i[r];t.addEditOperation(s.range,s.text)}this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}function mlr(n,e){e.sort((s,a)=>s.lineNumber===a.lineNumber?s.column-a.column:s.lineNumber-a.lineNumber);for(let s=e.length-2;s>=0;s--)e[s].lineNumber===e[s+1].lineNumber&&e.splice(s,1);const t=[];let i=0,r=0;const o=e.length;for(let s=1,a=n.getLineCount();s<=a;s++){const l=n.getLineContent(s),c=l.length+1;let u=0;if(r<o&&e[r].lineNumber===s&&(u=e[r].column,r++,u===c)||l.length===0)continue;const d=g_(l);let h=0;if(d===-1)h=1;else if(d!==l.length-1)h=d+2;else continue;h=Math.max(u,h),t[i++]=es.delete(new q(s,h,s,c))}return t}class zXe{constructor(e,t,i){this._selection=e,this._isCopyingDown=t,this._noop=i||!1,this._selectionDirection=0,this._selectionId=null,this._startLineNumberDelta=0,this._endLineNumberDelta=0}getEditOperations(e,t){let i=this._selection;this._startLineNumberDelta=0,this._endLineNumberDelta=0,i.startLineNumber<i.endLineNumber&&i.endColumn===1&&(this._endLineNumberDelta=1,i=i.setEndPosition(i.endLineNumber-1,e.getLineMaxColumn(i.endLineNumber-1)));const r=[];for(let s=i.startLineNumber;s<=i.endLineNumber;s++)r.push(e.getLineContent(s));const o=r.join(`
`);o===""&&this._isCopyingDown&&(this._startLineNumberDelta++,this._endLineNumberDelta++),this._noop?t.addEditOperation(new q(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber+1,1),i.endLineNumber===e.getLineCount()?"":`
`):this._isCopyingDown?t.addEditOperation(new q(i.startLineNumber,1,i.startLineNumber,1),o+`
`):t.addEditOperation(new q(i.endLineNumber,e.getLineMaxColumn(i.endLineNumber),i.endLineNumber,e.getLineMaxColumn(i.endLineNumber)),`
`+o),this._selectionId=t.trackSelection(i),this._selectionDirection=this._selection.getDirection()}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);if(this._startLineNumberDelta!==0||this._endLineNumberDelta!==0){let r=i.startLineNumber,o=i.startColumn,s=i.endLineNumber,a=i.endColumn;this._startLineNumberDelta!==0&&(r=r+this._startLineNumberDelta,o=1),this._endLineNumberDelta!==0&&(s=s+this._endLineNumberDelta,a=1),i=ln.createWithDirection(r,o,s,a,this._selectionDirection)}return i}}var _lr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},vlr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let xce=class{constructor(e,t,i,r){this._languageConfigurationService=r,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===i){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let r=this._selection;r.startLineNumber<r.endLineNumber&&r.endColumn===1&&(this._moveEndPositionDown=!0,r=r.setEndPosition(r.endLineNumber-1,e.getLineMaxColumn(r.endLineNumber-1)));const{tabSize:o,indentSize:s,insertSpaces:a}=e.getOptions(),l=this.buildIndentConverter(o,s,a),c={tokenization:{getLineTokens:u=>e.tokenization.getLineTokens(u),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(u,d)=>e.getLanguageIdAtPosition(u,d)},getLineContent:null};if(r.startLineNumber===r.endLineNumber&&e.getLineMaxColumn(r.startLineNumber)===1){const u=r.startLineNumber,d=this._isMovingDown?u+1:u-1;e.getLineMaxColumn(d)===1?t.addEditOperation(new q(1,1,1,1),null):(t.addEditOperation(new q(u,1,u,1),e.getLineContent(d)),t.addEditOperation(new q(d,1,d,e.getLineMaxColumn(d)),null)),r=new ln(d,1,d,1)}else{let u,d;if(this._isMovingDown){u=r.endLineNumber+1,d=e.getLineContent(u),t.addEditOperation(new q(u-1,e.getLineMaxColumn(u-1),u,e.getLineMaxColumn(u)),null);let h=d;if(this.shouldAutoIndent(e,r)){const g=this.matchEnterRule(e,l,o,u,r.startLineNumber-1);if(g!==null){const m=go(e.getLineContent(u)),_=g+jd(m,o);h=oP(_,o,a)+this.trimStart(d)}else{c.getLineContent=_=>_===r.startLineNumber?e.getLineContent(u):e.getLineContent(_);const m=FO(this._autoIndent,c,e.getLanguageIdAtPosition(u,1),r.startLineNumber,l,this._languageConfigurationService);if(m!==null){const _=go(e.getLineContent(u)),v=jd(m,o),b=jd(_,o);v!==b&&(h=oP(v,o,a)+this.trimStart(d))}}t.addEditOperation(new q(r.startLineNumber,1,r.startLineNumber,1),h+`
`);const p=this.matchEnterRuleMovingDown(e,l,o,r.startLineNumber,u,h);if(p!==null)p!==0&&this.getIndentEditsOfMovingBlock(e,t,r,o,a,p);else{c.getLineContent=_=>_===r.startLineNumber?h:_>=r.startLineNumber+1&&_<=r.endLineNumber+1?e.getLineContent(_-1):e.getLineContent(_);const m=FO(this._autoIndent,c,e.getLanguageIdAtPosition(u,1),r.startLineNumber+1,l,this._languageConfigurationService);if(m!==null){const _=go(e.getLineContent(r.startLineNumber)),v=jd(m,o),b=jd(_,o);if(v!==b){const y=v-b;this.getIndentEditsOfMovingBlock(e,t,r,o,a,y)}}}}else t.addEditOperation(new q(r.startLineNumber,1,r.startLineNumber,1),h+`
`)}else if(u=r.startLineNumber-1,d=e.getLineContent(u),t.addEditOperation(new q(u,1,u+1,1),null),t.addEditOperation(new q(r.endLineNumber,e.getLineMaxColumn(r.endLineNumber),r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),`
`+d),this.shouldAutoIndent(e,r)){c.getLineContent=g=>g===u?e.getLineContent(r.startLineNumber):e.getLineContent(g);const h=this.matchEnterRule(e,l,o,r.startLineNumber,r.startLineNumber-2);if(h!==null)h!==0&&this.getIndentEditsOfMovingBlock(e,t,r,o,a,h);else{const g=FO(this._autoIndent,c,e.getLanguageIdAtPosition(r.startLineNumber,1),u,l,this._languageConfigurationService);if(g!==null){const p=go(e.getLineContent(r.startLineNumber)),m=jd(g,o),_=jd(p,o);if(m!==_){const v=m-_;this.getIndentEditsOfMovingBlock(e,t,r,o,a,v)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,i){return{shiftIndent:r=>Xf.shiftIndent(r,r.length+1,e,t,i),unshiftIndent:r=>Xf.unshiftIndent(r,r.length+1,e,t,i)}}parseEnterResult(e,t,i,r,o){if(o){let s=o.indentation;o.indentAction===Ca.None||o.indentAction===Ca.Indent?s=o.indentation+o.appendText:o.indentAction===Ca.IndentOutdent?s=o.indentation:o.indentAction===Ca.Outdent&&(s=t.unshiftIndent(o.indentation)+o.appendText);const a=e.getLineContent(r);if(this.trimStart(a).indexOf(this.trimStart(s))>=0){const l=go(e.getLineContent(r));let c=go(s);const u=Hqe(e,r,this._languageConfigurationService);u!==null&&u&2&&(c=t.unshiftIndent(c));const d=jd(c,i),h=jd(l,i);return d-h}}return null}matchEnterRuleMovingDown(e,t,i,r,o,s){if(g_(s)>=0){const a=e.getLineMaxColumn(o),l=OL(this._autoIndent,e,new q(o,a,o,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,r,l)}else{let a=r-1;for(;a>=1;){const u=e.getLineContent(a);if(g_(u)>=0)break;a--}if(a<1||r>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=OL(this._autoIndent,e,new q(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,r,c)}}matchEnterRule(e,t,i,r,o,s){let a=o;for(;a>=1;){let u;if(a===o&&s!==void 0?u=s:u=e.getLineContent(a),g_(u)>=0)break;a--}if(a<1||r>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=OL(this._autoIndent,e,new q(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,r,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1),r=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(i!==r||this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,i,r,o,s){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){const l=e.getLineContent(a),c=go(l),d=jd(c,r)+s,h=oP(d,r,o);h!==c&&(t.addEditOperation(new q(a,1,a,c.length+1),h),a===i.endLineNumber&&i.endColumn<=c.length+1&&h===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber<i.endLineNumber&&(i=i.setEndPosition(i.endLineNumber,2)),i}};xce=_lr([vlr(3,xo)],xce);class zC{static getCollator(){return zC._COLLATOR||(zC._COLLATOR=new Intl.Collator),zC._COLLATOR}constructor(e,t){this.selection=e,this.descending=t,this.selectionId=null}getEditOperations(e,t){const i=blr(e,this.selection,this.descending);i&&t.addEditOperation(i.range,i.text),this.selectionId=t.trackSelection(this.selection)}computeCursorState(e,t){return t.getTrackedSelection(this.selectionId)}static canRun(e,t,i){if(e===null)return!1;const r=jXe(e,t,i);if(!r)return!1;for(let o=0,s=r.before.length;o<s;o++)if(r.before[o]!==r.after[o])return!0;return!1}}zC._COLLATOR=null;function jXe(n,e,t){const i=e.startLineNumber;let r=e.endLineNumber;if(e.endColumn===1&&r--,i>=r)return null;const o=[];for(let a=i;a<=r;a++)o.push(n.getLineContent(a));let s=o.slice(0);return s.sort(zC.getCollator().compare),t===!0&&(s=s.reverse()),{startLineNumber:i,endLineNumber:r,before:o,after:s}}function blr(n,e,t){const i=jXe(n,e,t);return i?es.replace(new q(i.startLineNumber,1,i.endLineNumber,n.getLineMaxColumn(i.endLineNumber)),i.after.join(`
`)):null}class UXe extends Gt{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((s,a)=>({selection:s,index:a,ignore:!1}));i.sort((s,a)=>q.compareRangesUsingStarts(s.selection,a.selection));let r=i[0];for(let s=1;s<i.length;s++){const a=i[s];r.selection.endLineNumber===a.selection.startLineNumber&&(r.index<a.index?a.ignore=!0:(r.ignore=!0,r=a))}const o=[];for(const s of i)o.push(new zXe(s.selection,this.down,s.ignore));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class ylr extends UXe{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:E("lines.copyUp","Copy Line Up"),alias:"Copy Line Up",precondition:ee.writable,kbOpts:{kbExpr:ee.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:J.MenubarSelectionMenu,group:"2_line",title:E({key:"miCopyLinesUp",comment:["&& denotes a mnemonic"]},"&&Copy Line Up"),order:1}})}}class Clr extends UXe{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:E("lines.copyDown","Copy Line Down"),alias:"Copy Line Down",precondition:ee.writable,kbOpts:{kbExpr:ee.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:J.MenubarSelectionMenu,group:"2_line",title:E({key:"miCopyLinesDown",comment:["&& denotes a mnemonic"]},"Co&&py Line Down"),order:2}})}}class wlr extends Gt{constructor(){super({id:"editor.action.duplicateSelection",label:E("duplicateSelection","Duplicate Selection"),alias:"Duplicate Selection",precondition:ee.writable,menuOpts:{menuId:J.MenubarSelectionMenu,group:"2_line",title:E({key:"miDuplicateSelection",comment:["&& denotes a mnemonic"]},"&&Duplicate Selection"),order:5}})}run(e,t,i){if(!t.hasModel())return;const r=[],o=t.getSelections(),s=t.getModel();for(const a of o)if(a.isEmpty())r.push(new zXe(a,!0));else{const l=new ln(a.endLineNumber,a.endColumn,a.endLineNumber,a.endColumn);r.push(new wWi(l,s.getValueInRange(a)))}t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}class qXe extends Gt{constructor(e,t){super(t),this.down=e}run(e,t){const i=e.get(xo),r=[],o=t.getSelections()||[],s=t.getOption(12);for(const a of o)r.push(new xce(a,this.down,s,i));t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}class Slr extends qXe{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:E("lines.moveUp","Move Line Up"),alias:"Move Line Up",precondition:ee.writable,kbOpts:{kbExpr:ee.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:J.MenubarSelectionMenu,group:"2_line",title:E({key:"miMoveLinesUp",comment:["&& denotes a mnemonic"]},"Mo&&ve Line Up"),order:3}})}}class Elr extends qXe{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:E("lines.moveDown","Move Line Down"),alias:"Move Line Down",precondition:ee.writable,kbOpts:{kbExpr:ee.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:J.MenubarSelectionMenu,group:"2_line",title:E({key:"miMoveLinesDown",comment:["&& denotes a mnemonic"]},"Move &&Line Down"),order:4}})}}class KXe extends Gt{constructor(e,t){super(t),this.descending=e}run(e,t){const i=t.getSelections()||[];for(const o of i)if(!zC.canRun(t.getModel(),o,this.descending))return;const r=[];for(let o=0,s=i.length;o<s;o++)r[o]=new zC(i[o],this.descending);t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop()}}class xlr extends KXe{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:E("lines.sortAscending","Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:ee.writable})}}class klr extends KXe{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:E("lines.sortDescending","Sort Lines Descending"),alias:"Sort Lines Descending",precondition:ee.writable})}}class Tlr extends Gt{constructor(){super({id:"editor.action.removeDuplicateLines",label:E("lines.deleteDuplicates","Delete Duplicate Lines"),alias:"Delete Duplicate Lines",precondition:ee.writable})}run(e,t){if(!t.hasModel())return;const i=t.getModel();if(i.getLineCount()===1&&i.getLineMaxColumn(1)===1)return;const r=[],o=[];let s=0;for(const a of t.getSelections()){const l=new Set,c=[];for(let g=a.startLineNumber;g<=a.endLineNumber;g++){const p=i.getLineContent(g);l.has(p)||(c.push(p),l.add(p))}const u=new ln(a.startLineNumber,1,a.endLineNumber,i.getLineMaxColumn(a.endLineNumber)),d=a.startLineNumber-s,h=new ln(d,1,d+c.length-1,c[c.length-1].length);r.push(es.replace(u,c.join(`
`))),o.push(h),s+=a.endLineNumber-a.startLineNumber+1-c.length}t.pushUndoStop(),t.executeEdits(this.id,r,o),t.pushUndoStop()}}class DK extends Gt{constructor(){super({id:DK.ID,label:E("lines.trimTrailingWhitespace","Trim Trailing Whitespace"),alias:"Trim Trailing Whitespace",precondition:ee.writable,kbOpts:{kbExpr:ee.editorTextFocus,primary:Ma(2089,2102),weight:100}})}run(e,t,i){let r=[];i.reason==="auto-save"&&(r=(t.getSelections()||[]).map(a=>new Ce(a.positionLineNumber,a.positionColumn)));const o=t.getSelection();if(o===null)return;const s=new plr(o,r);t.pushUndoStop(),t.executeCommands(this.id,[s]),t.pushUndoStop()}}DK.ID="editor.action.trimTrailingWhitespace";class Ilr extends Gt{constructor(){super({id:"editor.action.deleteLines",label:E("lines.delete","Delete Line"),alias:"Delete Line",precondition:ee.writable,kbOpts:{kbExpr:ee.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),r=t.getModel();if(r.getLineCount()===1&&r.getLineMaxColumn(1)===1)return;let o=0;const s=[],a=[];for(let l=0,c=i.length;l<c;l++){const u=i[l];let d=u.startLineNumber,h=u.endLineNumber,g=1,p=r.getLineMaxColumn(h);h<r.getLineCount()?(h+=1,p=1):d>1&&(d-=1,g=r.getLineMaxColumn(d)),s.push(es.replace(new ln(d,g,h,p),"")),a.push(new ln(d-o,u.positionColumn,d-o,u.positionColumn)),o+=u.endLineNumber-u.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,s,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(o=>{let s=o.endLineNumber;return o.startLineNumber<o.endLineNumber&&o.endColumn===1&&(s-=1),{startLineNumber:o.startLineNumber,selectionStartColumn:o.selectionStartColumn,endLineNumber:s,positionColumn:o.positionColumn}});t.sort((o,s)=>o.startLineNumber===s.startLineNumber?o.endLineNumber-s.endLineNumber:o.startLineNumber-s.startLineNumber);const i=[];let r=t[0];for(let o=1;o<t.length;o++)r.endLineNumber+1>=t[o].startLineNumber?r.endLineNumber=t[o].endLineNumber:(i.push(r),r=t[o]);return i.push(r),i}}class Llr extends Gt{constructor(){super({id:"editor.action.indentLines",label:E("lines.indent","Indent Line"),alias:"Indent Line",precondition:ee.writable,kbOpts:{kbExpr:ee.editorTextFocus,primary:2142,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,ls.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class Dlr extends Gt{constructor(){super({id:"editor.action.outdentLines",label:E("lines.outdent","Outdent Line"),alias:"Outdent Line",precondition:ee.writable,kbOpts:{kbExpr:ee.editorTextFocus,primary:2140,weight:100}})}run(e,t){PL.Outdent.runEditorCommand(e,t,null)}}class Alr extends Gt{constructor(){super({id:"editor.action.insertLineBefore",label:E("lines.insertBefore","Insert Line Above"),alias:"Insert Line Above",precondition:ee.writable,kbOpts:{kbExpr:ee.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,ls.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}class Rlr extends Gt{constructor(){super({id:"editor.action.insertLineAfter",label:E("lines.insertAfter","Insert Line Below"),alias:"Insert Line Below",precondition:ee.writable,kbOpts:{kbExpr:ee.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,ls.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}class GXe extends Gt{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),r=this._getRangesToDelete(t),o=[];for(let l=0,c=r.length-1;l<c;l++){const u=r[l],d=r[l+1];q.intersectRanges(u,d)===null?o.push(u):r[l+1]=q.plusRange(u,d)}o.push(r[r.length-1]);const s=this._getEndCursorState(i,o),a=o.map(l=>es.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,s),t.pushUndoStop()}}class Nlr extends GXe{constructor(){super({id:"deleteAllLeft",label:E("lines.deleteAllLeft","Delete All Left"),alias:"Delete All Left",precondition:ee.writable,kbOpts:{kbExpr:ee.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let i=null;const r=[];let o=0;return t.forEach(s=>{let a;if(s.endColumn===1&&o>0){const l=s.startLineNumber-o;a=new ln(l,s.startColumn,l,s.startColumn)}else a=new ln(s.startLineNumber,s.startColumn,s.startLineNumber,s.startColumn);o+=s.endLineNumber-s.startLineNumber,s.intersectRanges(e)?i=a:r.push(a)}),i&&r.unshift(i),r}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let i=t;const r=e.getModel();return r===null?[]:(i.sort(q.compareRangesUsingStarts),i=i.map(o=>{if(o.isEmpty())if(o.startColumn===1){const s=Math.max(1,o.startLineNumber-1),a=o.startLineNumber===1?1:r.getLineLength(s)+1;return new q(s,a,o.startLineNumber,1)}else return new q(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new q(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),i)}}class Olr extends GXe{constructor(){super({id:"deleteAllRight",label:E("lines.deleteAllRight","Delete All Right"),alias:"Delete All Right",precondition:ee.writable,kbOpts:{kbExpr:ee.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let i=null;const r=[];for(let o=0,s=t.length,a=0;o<s;o++){const l=t[o],c=new ln(l.startLineNumber-a,l.startColumn,l.startLineNumber-a,l.startColumn);l.intersectRanges(e)?i=c:r.push(c)}return i&&r.unshift(i),r}_getRangesToDelete(e){const t=e.getModel();if(t===null)return[];const i=e.getSelections();if(i===null)return[];const r=i.map(o=>{if(o.isEmpty()){const s=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===s?new q(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new q(o.startLineNumber,o.startColumn,o.startLineNumber,s)}return o});return r.sort(q.compareRangesUsingStarts),r}}class Plr extends Gt{constructor(){super({id:"editor.action.joinLines",label:E("lines.joinLines","Join Lines"),alias:"Join Lines",precondition:ee.writable,kbOpts:{kbExpr:ee.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){const i=t.getSelections();if(i===null)return;let r=t.getSelection();if(r===null)return;i.sort(q.compareRangesUsingStarts);const o=[],s=i.reduce((h,g)=>h.isEmpty()?h.endLineNumber===g.startLineNumber?(r.equalsSelection(h)&&(r=g),g):g.startLineNumber>h.endLineNumber+1?(o.push(h),g):new ln(h.startLineNumber,h.startColumn,g.endLineNumber,g.endColumn):g.startLineNumber>h.endLineNumber?(o.push(h),g):new ln(h.startLineNumber,h.startColumn,g.endLineNumber,g.endColumn));o.push(s);const a=t.getModel();if(a===null)return;const l=[],c=[];let u=r,d=0;for(let h=0,g=o.length;h<g;h++){const p=o[h],m=p.startLineNumber,_=1;let v=0,b,y;const C=a.getLineLength(p.endLineNumber)-p.endColumn;if(p.isEmpty()||p.startLineNumber===p.endLineNumber){const I=p.getStartPosition();I.lineNumber<a.getLineCount()?(b=m+1,y=a.getLineMaxColumn(b)):(b=I.lineNumber,y=a.getLineMaxColumn(I.lineNumber))}else b=p.endLineNumber,y=a.getLineMaxColumn(b);let x=a.getLineContent(m);for(let I=m+1;I<=b;I++){const L=a.getLineContent(I),D=a.getLineFirstNonWhitespaceColumn(I);if(D>=1){let R=!0;x===""&&(R=!1),R&&(x.charAt(x.length-1)===" "||x.charAt(x.length-1)===" ")&&(R=!1,x=x.replace(/[\s\uFEFF\xA0]+$/g," "));const P=L.substr(D-1);x+=(R?" ":"")+P,R?v=P.length+1:v=P.length}else v=0}const k=new q(m,_,b,y);if(!k.isEmpty()){let I;p.isEmpty()?(l.push(es.replace(k,x)),I=new ln(k.startLineNumber-d,x.length-v+1,m-d,x.length-v+1)):p.startLineNumber===p.endLineNumber?(l.push(es.replace(k,x)),I=new ln(p.startLineNumber-d,p.startColumn,p.endLineNumber-d,p.endColumn)):(l.push(es.replace(k,x)),I=new ln(p.startLineNumber-d,p.startColumn,p.startLineNumber-d,x.length-C)),q.intersectRanges(k,r)!==null?u=I:c.push(I)}d+=k.endLineNumber-k.startLineNumber}c.unshift(u),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class Mlr extends Gt{constructor(){super({id:"editor.action.transpose",label:E("editor.transpose","Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:ee.writable})}run(e,t){const i=t.getSelections();if(i===null)return;const r=t.getModel();if(r===null)return;const o=[];for(let s=0,a=i.length;s<a;s++){const l=i[s];if(!l.isEmpty())continue;const c=l.getStartPosition(),u=r.getLineMaxColumn(c.lineNumber);if(c.column>=u){if(c.lineNumber===r.getLineCount())continue;const d=new q(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h=r.getValueInRange(d).split("").reverse().join("");o.push(new oc(new ln(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),h))}else{const d=new q(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),h=r.getValueInRange(d).split("").reverse().join("");o.push(new p_e(d,h,new ln(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class FA extends Gt{run(e,t){const i=t.getSelections();if(i===null)return;const r=t.getModel();if(r===null)return;const o=t.getOption(129),s=[];for(const a of i)if(a.isEmpty()){const l=a.getStartPosition(),c=t.getConfiguredWordAtPosition(l);if(!c)continue;const u=new q(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),d=r.getValueInRange(u);s.push(es.replace(u,this._modifyText(d,o)))}else{const l=r.getValueInRange(a);s.push(es.replace(a,this._modifyText(l,o)))}t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop()}}class Flr extends FA{constructor(){super({id:"editor.action.transformToUppercase",label:E("editor.transformToUppercase","Transform to Uppercase"),alias:"Transform to Uppercase",precondition:ee.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}class Blr extends FA{constructor(){super({id:"editor.action.transformToLowercase",label:E("editor.transformToLowercase","Transform to Lowercase"),alias:"Transform to Lowercase",precondition:ee.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}class Gk{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{}}return this._actual}isSupported(){return this.get()!==null}}class F4 extends FA{constructor(){super({id:"editor.action.transformToTitlecase",label:E("editor.transformToTitlecase","Transform to Title Case"),alias:"Transform to Title Case",precondition:ee.writable})}_modifyText(e,t){const i=F4.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,r=>r.toLocaleUpperCase()):e}}F4.titleBoundary=new Gk("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class jC extends FA{constructor(){super({id:"editor.action.transformToSnakecase",label:E("editor.transformToSnakecase","Transform to Snake Case"),alias:"Transform to Snake Case",precondition:ee.writable})}_modifyText(e,t){const i=jC.caseBoundary.get(),r=jC.singleLetters.get();return!i||!r?e:e.replace(i,"$1_$2").replace(r,"$1_$2$3").toLocaleLowerCase()}}jC.caseBoundary=new Gk("(\\p{Ll})(\\p{Lu})","gmu");jC.singleLetters=new Gk("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");class B4 extends FA{constructor(){super({id:"editor.action.transformToCamelcase",label:E("editor.transformToCamelcase","Transform to Camel Case"),alias:"Transform to Camel Case",precondition:ee.writable})}_modifyText(e,t){const i=B4.wordBoundary.get();if(!i)return e;const r=e.split(i);return r.shift()+r.map(s=>s.substring(0,1).toLocaleUpperCase()+s.substring(1)).join("")}}B4.wordBoundary=new Gk("[_\\s-]","gm");class i0 extends FA{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:E("editor.transformToKebabcase","Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:ee.writable})}_modifyText(e,t){const i=i0.caseBoundary.get(),r=i0.singleLetters.get(),o=i0.underscoreBoundary.get();return!i||!r||!o?e:e.replace(o,"$1-$3").replace(i,"$1-$2").replace(r,"$1-$2").toLocaleLowerCase()}}i0.caseBoundary=new Gk("(\\p{Ll})(\\p{Lu})","gmu");i0.singleLetters=new Gk("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu");i0.underscoreBoundary=new Gk("(\\S)(_)(\\S)","gm");ht(ylr);ht(Clr);ht(wlr);ht(Slr);ht(Elr);ht(xlr);ht(klr);ht(Tlr);ht(DK);ht(Ilr);ht(Llr);ht(Dlr);ht(Alr);ht(Rlr);ht(Nlr);ht(Olr);ht(Plr);ht(Mlr);ht(Flr);ht(Blr);jC.caseBoundary.isSupported()&&jC.singleLetters.isSupported()&&ht(jC);B4.wordBoundary.isSupported()&&ht(B4);F4.titleBoundary.isSupported()&&ht(F4);i0.isSupported()&&ht(i0);var $lr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},I$=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},kce=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},a9;const YXe=new Ft("LinkedEditingInputVisible",!1),Vlr="linked-editing-decoration";let Lw=a9=class extends Ae{static get(e){return e.getContribution(a9.ID)}constructor(e,t,i,r,o){super(),this.languageConfigurationService=r,this._syncRangesToken=0,this._localToDispose=this._register(new nt),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=YXe.bindTo(t),this._debounceInformation=o.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new nt),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(s=>{(s.hasChanged(69)||s.hasChanged(92))&&this.reinitialize(!1)})),this._register(this._providers.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}reinitialize(e){const t=this._editor.getModel(),i=t!==null&&(this._editor.getOption(69)||this._editor.getOption(92))&&this._providers.has(t);if(i===this._enabled&&!e||(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||t===null))return;this._localToDispose.add(Pt.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const r=new Gp(this._debounceInformation.get(t)),o=()=>{var l;this._rangeUpdateTriggerPromise=r.trigger(()=>this.updateRanges(),(l=this._debounceDuration)!==null&&l!==void 0?l:this._debounceInformation.get(t))},s=new Gp(0),a=l=>{this._rangeSyncTriggerPromise=s.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(l=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const c=this._currentDecorations.getRange(0);if(c&&l.changes.every(u=>c.intersectRanges(u.range))){a(this._syncRangesToken);return}}o()})),this._localToDispose.add({dispose:()=>{r.dispose(),s.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),i=this._currentDecorations.getRange(0);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const r=t.getValueInRange(i);if(this._currentWordPattern){const s=r.match(this._currentWordPattern);if((s?s[0].length:0)!==r.length)return this.clearRanges()}const o=[];for(let s=1,a=this._currentDecorations.length;s<a;s++){const l=this._currentDecorations.getRange(s);if(l)if(l.startLineNumber!==l.endLineNumber)o.push({range:l,text:r});else{let c=t.getValueInRange(l),u=r,d=l.startColumn,h=l.endColumn;const g=Ax(c,u);d+=g,c=c.substr(g),u=u.substr(g);const p=DV(c,u);h-=p,c=c.substr(0,c.length-p),u=u.substr(0,u.length-p),(d!==h||u.length!==0)&&o.push({range:new q(l.startLineNumber,d,l.endLineNumber,h),text:u})}}if(o.length!==0)try{this._editor.popUndoStop(),this._ignoreChangeEvent=!0;const s=this._editor._getViewModel().getPrevEditOperationType();this._editor.executeEdits("linkedEditing",o),this._editor._getViewModel().setPrevEditOperationType(s)}finally{this._ignoreChangeEvent=!1}}dispose(){this.clearRanges(),super.dispose()}clearRanges(){this._visibleContextKey.set(!1),this._currentDecorations.clear(),this._currentRequest&&(this._currentRequest.cancel(),this._currentRequest=null,this._currentRequestPosition=null)}updateRanges(e=!1){return kce(this,void 0,void 0,function*(){if(!this._editor.hasModel()){this.clearRanges();return}const t=this._editor.getPosition();if(!this._enabled&&!e||this._editor.getSelections().length>1){this.clearRanges();return}const i=this._editor.getModel(),r=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===r){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const s=this._currentDecorations.getRange(0);if(s&&s.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=r;const o=za(s=>kce(this,void 0,void 0,function*(){try{const a=new $c(!1),l=yield QXe(this._providers,i,t,s);if(this._debounceInformation.update(i,a.elapsed()),o!==this._currentRequest||(this._currentRequest=null,r!==i.getVersionId()))return;let c=[];l!=null&&l.ranges&&(c=l.ranges),this._currentWordPattern=(l==null?void 0:l.wordPattern)||this._languageWordPattern;let u=!1;for(let h=0,g=c.length;h<g;h++)if(q.containsPosition(c[h],t)){if(u=!0,h!==0){const p=c[h];c.splice(h,1),c.unshift(p)}break}if(!u){this.clearRanges();return}const d=c.map(h=>({range:h,options:a9.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(d),this._syncRangesToken++}catch(a){R_(a)||fi(a),(this._currentRequest===o||!this._currentRequest)&&this.clearRanges()}}));return this._currentRequest=o,o})}};Lw.ID="editor.contrib.linkedEditing";Lw.DECORATION=hi.register({description:"linked-editing",stickiness:0,className:Vlr});Lw=a9=$lr([I$(1,Yn),I$(2,en),I$(3,xo),I$(4,Fg)],Lw);class Hlr extends Gt{constructor(){super({id:"editor.action.linkedEditing",label:E("linkedEditing.label","Start Linked Editing"),alias:"Start Linked Editing",precondition:Ke.and(ee.writable,ee.hasRenameProvider),kbOpts:{kbExpr:ee.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(Lr),[r,o]=Array.isArray(t)&&t||[void 0,void 0];return Tn.isUri(r)&&Ce.isIPosition(o)?i.openCodeEditor({resource:r},i.getActiveCodeEditor()).then(s=>{s&&(s.setPosition(o),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},fi):super.runCommand(e,t)}run(e,t){const i=Lw.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const Wlr=kl.bindToContribution(Lw.get);Et(new Wlr({id:"cancelLinkedEditingInput",precondition:YXe,handler:n=>n.clearRanges(),kbOpts:{kbExpr:ee.editorTextFocus,weight:100+99,primary:9,secondary:[1033]}}));function QXe(n,e,t,i){const r=n.ordered(e);return MUe(r.map(o=>()=>kce(this,void 0,void 0,function*(){try{return yield o.provideLinkedEditingRanges(e,t,i)}catch(s){Sa(s);return}})),o=>!!o&&Fc(o==null?void 0:o.ranges))}re("editor.linkedEditingBackground",{dark:De.fromHex("#f00").transparent(.3),light:De.fromHex("#f00").transparent(.3),hcDark:De.fromHex("#f00").transparent(.3),hcLight:De.white},E("editorLinkedEditingBackground","Background color when the editor auto renames on type."));Ib("_executeLinkedEditingProvider",(n,e,t)=>{const{linkedEditingRangeProvider:i}=n.get(en);return QXe(i,e,t,Mi.None)});gr(Lw.ID,Lw,1);ht(Hlr);var XXe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let zlr=class{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 XXe(this,void 0,void 0,function*(){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?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 _W{constructor(e){this._disposables=new nt;let t=[];for(const[i,r]of e){const o=i.links.map(s=>new zlr(s,r));t=_W._union(t,o),Cme(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const i=[];let r,o,s,a;for(r=0,s=0,o=e.length,a=t.length;r<o&&s<a;){const l=e[r],c=t[s];if(q.areIntersectingOrTouching(l.range,c.range)){r++;continue}q.compareRangesUsingStarts(l.range,c.range)<0?(i.push(l),r++):(i.push(c),s++)}for(;r<o;r++)i.push(e[r]);for(;s<a;s++)i.push(t[s]);return i}}function ZXe(n,e,t){const i=[],r=n.ordered(e).reverse().map((o,s)=>Promise.resolve(o.provideLinks(e,t)).then(a=>{a&&(i[s]=[a,o])},Sa));return Promise.all(r).then(()=>{const o=new _W(ob(i));return t.isCancellationRequested?(o.dispose(),new _W([])):o})}Xi.registerCommand("_executeLinkProvider",(n,...e)=>XXe(void 0,void 0,void 0,function*(){let[t,i]=e;to(t instanceof Tn),typeof i!="number"&&(i=0);const{linkProvider:r}=n.get(en),o=n.get(ts).getModel(t);if(!o)return[];const s=yield ZXe(r,o,Mi.None);if(!s)return[];for(let l=0;l<Math.min(i,s.links.length);l++)yield s.links[l].resolve(Mi.None);const a=s.links.slice(0);return s.dispose(),a}));var jlr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},L$=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Ulr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Tce;let L2=Tce=class extends Ae{static get(e){return e.getContribution(Tce.ID)}constructor(e,t,i,r,o){super(),this.editor=e,this.openerService=t,this.notificationService=i,this.languageFeaturesService=r,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=o.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new so(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const s=this._register(new Zq(e));this._register(s.onMouseMoveOrRelevantKeyDown(([a,l])=>{this._onEditorMouseMove(a,l)})),this._register(s.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(s.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{a.hasChanged(70)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))})),this._register(e.onDidChangeModelContent(a=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))})),this._register(e.onDidChangeModel(a=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)})),this._register(e.onDidChangeModelLanguage(a=>{this.stop(),this.computeLinks.schedule(0)})),this._register(this.providers.onDidChange(a=>{this.stop(),this.computeLinks.schedule(0)})),this.computeLinks.schedule(0)}computeLinksNow(){return Ulr(this,void 0,void 0,function*(){if(!this.editor.hasModel()||!this.editor.getOption(70))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=za(t=>ZXe(this.providers,e,t));try{const t=new $c(!1);if(this.activeLinksList=yield this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){fi(t)}finally{this.computePromise=null}}})}updateDecorations(e){const t=this.editor.getOption(77)==="altKey",i=[],r=Object.keys(this.currentOccurrences);for(const s of r){const a=this.currentOccurrences[s];i.push(a.decorationId)}const o=[];if(e)for(const s of e)o.push(GL.decoration(s,t));this.editor.changeDecorations(s=>{const a=s.deltaDecorations(i,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,c=a.length;l<c;l++){const u=new GL(e[l],a[l]);this.currentOccurrences[u.decorationId]=u}})}_onEditorMouseMove(e,t){const i=this.editor.getOption(77)==="altKey";if(this.isEnabled(e,t)){this.cleanUpActiveLinkDecoration();const r=this.getLinkOccurrence(e.target.position);r&&this.editor.changeDecorations(o=>{r.activate(o,i),this.activeLinkDecorationId=r.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(77)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(i=>{t.deactivate(i,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,i=!1){if(!this.openerService)return;const{link:r}=e;r.resolve(Mi.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const s=this.editor.getModel().uri;if(s.scheme===Si.file&&o.startsWith(`${Si.file}:`)){const a=Tn.parse(o);if(a.scheme===Si.file){const l=Z_(a);let c=null;l.startsWith("/./")?c=`.${l.substr(1)}`:l.startsWith("//./")&&(c=`.${l.substr(2)}`),c&&(o=iji(s,c))}}}return this.openerService.open(o,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},o=>{const s=o instanceof Error?o.message:o;s==="invalid"?this.notificationService.warn(E("invalid.url","Failed to open this link because it is not well-formed: {0}",r.url.toString())):s==="missing"?this.notificationService.warn(E("missing.url","Failed to open this link because its target is missing.")):fi(o)})}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 i of t){const r=this.currentOccurrences[i.id];if(r)return r}return null}isEnabled(e,t){return!!(e.target.type===6&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&((e=this.activeLinksList)===null||e===void 0||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};L2.ID="editor.linkDetector";L2=Tce=jlr([L$(1,mh),L$(2,ga),L$(3,en),L$(4,Fg)],L2);const HNe={general:hi.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:hi.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class GL{static decoration(e,t){return{range:e.range,options:GL._getOptions(e,t,!1)}}static _getOptions(e,t,i){const r=Object.assign({},i?HNe.active:HNe.general);return r.hoverMessage=qlr(e,t),r}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,GL._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,GL._getOptions(this.link,t,!1))}}function qlr(n,e){const t=n.url&&/^command:/i.test(n.url.toString()),i=n.tooltip?n.tooltip:t?E("links.navigate.executeCmd","Execute command"):E("links.navigate.follow","Follow link"),r=e?Qi?E("links.navigate.kb.meta.mac","cmd + click"):E("links.navigate.kb.meta","ctrl + click"):Qi?E("links.navigate.kb.alt.mac","option + click"):E("links.navigate.kb.alt","alt + click");if(n.url){let o="";if(/^command:/i.test(n.url.toString())){const a=n.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];o=E("tooltip.explanation","Execute command {0}",l)}}return new hc("",!0).appendLink(n.url.toString(!0).replace(/ /g,"%20"),i,o).appendMarkdown(` (${r})`)}else return new hc().appendText(`${i} (${r})`)}class Klr extends Gt{constructor(){super({id:"editor.action.openLink",label:E("label","Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=L2.get(t);if(!i||!t.hasModel())return;const r=t.getSelections();for(const o of r){const s=i.getLinkOccurrence(o.getEndPosition());s&&i.openLinkOccurrence(s,!1)}}}gr(L2.ID,L2,1);ht(Klr);class Ice extends Ae{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const i=this._editor.getOption(116);i>=0&&t.target.type===6&&t.target.position.column>=i&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}}Ice.ID="editor.contrib.longLinesHelper";gr(Ice.ID,Ice,2);const D$=re("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},E("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);re("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},E("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);re("editor.wordHighlightTextBackground",{light:D$,dark:D$,hcDark:D$,hcLight:D$},E("wordHighlightText","Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const A$=re("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Ho,hcLight:Ho},E("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));re("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Ho,hcLight:Ho},E("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));re("editor.wordHighlightTextBorder",{light:A$,dark:A$,hcDark:A$,hcLight:A$},E("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const Glr=re("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},E("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Ylr=re("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},E("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Qlr=re("editorOverviewRuler.wordHighlightTextForeground",{dark:NN,light:NN,hcDark:NN,hcLight:NN},E("overviewRulerWordHighlightTextForeground","Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0),Xlr=hi.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:ms(Ylr),position:ff.Center},minimap:{color:ms(iq),position:rh.Inline}}),Zlr=hi.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:ms(Qlr),position:ff.Center},minimap:{color:ms(iq),position:rh.Inline}}),Jlr=hi.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:ms(NN),position:ff.Center},minimap:{color:ms(iq),position:rh.Inline}}),ecr=hi.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),tcr=hi.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:ms(Glr),position:ff.Center},minimap:{color:ms(iq),position:rh.Inline}});function ncr(n){return n===CM.Write?Xlr:n===CM.Text?Zlr:tcr}function icr(n){return n?ecr:Jlr}rm((n,e)=>{const t=n.getColor(s_e);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var rcr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ocr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Lce;function sS(n,e){const t=e.filter(i=>!n.find(r=>r.equals(i)));if(t.length>=1){const i=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),r=t.length===1?E("cursorAdded","Cursor added: {0}",i):E("cursorsAdded","Cursors added: {0}",i);fw(r)}}class scr extends Gt{constructor(){super({id:"editor.action.insertCursorAbove",label:E("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:ee.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:J.MenubarSelectionMenu,group:"3_multi",title:E({key:"miInsertCursorAbove",comment:["&& denotes a mnemonic"]},"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let r=!0;i&&i.logicalLine===!1&&(r=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(i.source,3,Nl.addCursorUp(o,s,r)),o.revealTopMostCursor(i.source),sS(s,o.getCursorStates())}}class acr extends Gt{constructor(){super({id:"editor.action.insertCursorBelow",label:E("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:ee.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:J.MenubarSelectionMenu,group:"3_multi",title:E({key:"miInsertCursorBelow",comment:["&& denotes a mnemonic"]},"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let r=!0;i&&i.logicalLine===!1&&(r=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const s=o.getCursorStates();o.setCursorStates(i.source,3,Nl.addCursorDown(o,s,r)),o.revealBottomMostCursor(i.source),sS(s,o.getCursorStates())}}class lcr extends Gt{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:E("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:ee.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:J.MenubarSelectionMenu,group:"3_multi",title:E({key:"miInsertCursorAtEndOfEachLineSelected",comment:["&& denotes a mnemonic"]},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let r=e.startLineNumber;r<e.endLineNumber;r++){const o=t.getLineMaxColumn(r);i.push(new ln(r,o,r,o))}e.endColumn>1&&i.push(new ln(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),r=t.getSelections(),o=t._getViewModel(),s=o.getCursorStates(),a=[];r.forEach(l=>this.getCursorsForSelection(l,i,a)),a.length>0&&t.setSelections(a),sS(s,o.getCursorStates())}}class ccr extends Gt{constructor(){super({id:"editor.action.addCursorsToBottom",label:E("mutlicursor.addCursorsToBottom","Add Cursors To Bottom"),alias:"Add Cursors To Bottom",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),r=t.getModel().getLineCount(),o=[];for(let l=i[0].startLineNumber;l<=r;l++)o.push(new ln(l,i[0].startColumn,l,i[0].endColumn));const s=t._getViewModel(),a=s.getCursorStates();o.length>0&&t.setSelections(o),sS(a,s.getCursorStates())}}class ucr extends Gt{constructor(){super({id:"editor.action.addCursorsToTop",label:E("mutlicursor.addCursorsToTop","Add Cursors To Top"),alias:"Add Cursors To Top",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),r=[];for(let a=i[0].startLineNumber;a>=1;a--)r.push(new ln(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),s=o.getCursorStates();r.length>0&&t.setSelections(r),sS(s,o.getCursorStates())}}class R${constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class $4{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new $4(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let r=!1,o,s;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(r=!0,o=!0,s=!0):(o=i.wholeWord,s=i.matchCase);const l=e.getSelection();let c,u=null;if(l.isEmpty()){const d=e.getConfiguredWordAtPosition(l.getStartPosition());if(!d)return null;c=d.word,u=new ln(l.startLineNumber,d.startColumn,l.startLineNumber,d.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,`
`);return new $4(e,t,r,c,o,s,u)}constructor(e,t,i,r,o,s,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=r,this.wholeWord=o,this.matchCase=s,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new R$(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 R$(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const r=this.currentMatch;return this.currentMatch=null,r}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return i?new ln(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.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 R$(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 R$(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const r=this.currentMatch;return this.currentMatch=null,r}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return i?new ln(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824)}}class ik extends Ae{static get(e){return e.getContribution(ik.ID)}constructor(e){super(),this._sessionDispose=this._register(new nt),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=$4.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(r=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(r=>{(r.matchCase||r.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 i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new ln(t.startLineNumber,i.startColumn,t.startLineNumber,i.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 r=e.getState().matchCase;if(!JXe(this._editor.getModel(),t,r)){const s=this._editor.getModel(),a=[];for(let l=0,c=t.length;l<c;l++)a[l]=this._expandEmptyToWord(s,t[l]);this._editor.setSelections(a);return}}}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 i=e.getState();if(i.isRevealed&&i.searchString.length>0&&i.isRegex){const r=this._editor.getModel();i.searchScope?t=r.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824):t=r.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const r=this._editor.getSelection();for(let o=0,s=t.length;o<s;o++){const a=t[o];if(a.range.intersectRanges(r)){t[o]=t[0],t[0]=a;break}}this._setSelections(t.map(o=>new ln(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}}ik.ID="editor.contrib.multiCursorController";class BA extends Gt{run(e,t){const i=ik.get(t);if(!i)return;const r=t._getViewModel();if(r){const o=r.getCursorStates(),s=Xu.get(t);if(s)this._run(i,s);else{const a=e.get(Un).createInstance(Xu,t);this._run(i,a),a.dispose()}sS(o,r.getCursorStates())}}}class dcr extends BA{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:E("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:ee.focus,primary:2082,weight:100},menuOpts:{menuId:J.MenubarSelectionMenu,group:"3_multi",title:E({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class hcr extends BA{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:E("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:J.MenubarSelectionMenu,group:"3_multi",title:E({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class fcr extends BA{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:E("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:ee.focus,primary:Ma(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class gcr extends BA{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:E("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 pcr extends BA{constructor(){super({id:"editor.action.selectHighlights",label:E("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:ee.focus,primary:3114,weight:100},menuOpts:{menuId:J.MenubarSelectionMenu,group:"3_multi",title:E({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class mcr extends BA{constructor(){super({id:"editor.action.changeAll",label:E("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:Ke.and(ee.writable,ee.editorTextFocus),kbOpts:{kbExpr:ee.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class _cr{constructor(e,t,i,r,o){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=r,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 this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(q.compareRangesUsingStarts)),this._cachedFindMatches}}let V4=Lce=class extends Ae{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(107),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new so(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(r=>{this._isEnabled=e.getOption(107)})),this._register(e.onDidChangeCursorSelection(r=>{this._isEnabled&&(r.selection.isEmpty()?r.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(r=>{this._setState(null)})),this._register(e.onDidChangeModelContent(r=>{this._isEnabled&&this.updateSoon.schedule()}));const i=Xu.get(e);i&&this._register(i.getState().onFindReplaceStateChange(r=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(Lce._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,i){if(!t||!i.hasModel())return null;const r=i.getSelection();if(r.startLineNumber!==r.endLineNumber)return null;const o=ik.get(i);if(!o)return null;const s=Xu.get(i);if(!s)return null;let a=o.getSession(s);if(!a){const u=i.getSelections();if(u.length>1){const h=s.getState().matchCase;if(!JXe(i.getModel(),u,h))return null}a=$4.create(i,s)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const l=s.getState(),c=l.matchCase;if(l.isRevealed){let u=l.searchString;c||(u=u.toLowerCase());let d=a.searchText;if(c||(d=d.toLowerCase()),u===d&&a.matchCase===l.matchCase&&a.wholeWord===l.wholeWord&&!l.isRegex)return null}return new _cr(i.getModel(),a.searchText,a.matchCase,a.wholeWord?i.getOption(129):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),r=this.editor.getSelections();r.sort(q.compareRangesUsingStarts);const o=[];for(let l=0,c=0,u=i.length,d=r.length;l<u;){const h=i[l];if(c>=d)o.push(h),l++;else{const g=q.compareRangesUsingStarts(h,r[c]);g<0?((r[c].isEmpty()||!q.areIntersecting(h,r[c]))&&o.push(h),l++):(g>0||l++,c++)}}const s=this._languageFeaturesService.documentHighlightProvider.has(t)&&this.editor.getOption(80),a=o.map(l=>({range:l,options:icr(s)}));this._decorations.set(a)}dispose(){this._setState(null),super.dispose()}};V4.ID="editor.contrib.selectionHighlighter";V4=Lce=rcr([ocr(1,en)],V4);function JXe(n,e,t){const i=WNe(n,e[0],!t);for(let r=1,o=e.length;r<o;r++){const s=e[r];if(s.isEmpty())return!1;const a=WNe(n,s,!t);if(i!==a)return!1}return!0}function WNe(n,e,t){const i=n.getValueInRange(e);return t?i.toLowerCase():i}class vcr extends Gt{constructor(){super({id:"editor.action.focusNextCursor",label:E("mutlicursor.focusNextCursor","Focus Next Cursor"),description:{description:E("mutlicursor.focusNextCursor.description","Focuses the next cursor"),args:[]},alias:"Focus Next Cursor",precondition:void 0})}run(e,t,i){if(!t.hasModel())return;const r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();const o=Array.from(r.getCursorStates()),s=o.shift();s&&(o.push(s),r.setCursorStates(i.source,3,o),r.revealPrimaryCursor(i.source,!0),sS(o,r.getCursorStates()))}}class bcr extends Gt{constructor(){super({id:"editor.action.focusPreviousCursor",label:E("mutlicursor.focusPreviousCursor","Focus Previous Cursor"),description:{description:E("mutlicursor.focusPreviousCursor.description","Focuses the previous cursor"),args:[]},alias:"Focus Previous Cursor",precondition:void 0})}run(e,t,i){if(!t.hasModel())return;const r=t._getViewModel();if(r.cursorConfig.readOnly)return;r.model.pushStackElement();const o=Array.from(r.getCursorStates()),s=o.pop();s&&(o.unshift(s),r.setCursorStates(i.source,3,o),r.revealPrimaryCursor(i.source,!0),sS(o,r.getCursorStates()))}}gr(ik.ID,ik,4);gr(V4.ID,V4,1);ht(scr);ht(acr);ht(lcr);ht(dcr);ht(hcr);ht(fcr);ht(gcr);ht(pcr);ht(mcr);ht(ccr);ht(ucr);ht(vcr);ht(bcr);var eZe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const rk={Visible:new Ft("parameterHintsVisible",!1),MultipleSignatures:new Ft("parameterHintsMultipleSignatures",!1)};function tZe(n,e,t,i,r){return eZe(this,void 0,void 0,function*(){const o=n.ordered(e);for(const s of o)try{const a=yield s.provideSignatureHelp(e,t,r,i);if(a)return a}catch(a){Sa(a)}})}Xi.registerCommand("_executeSignatureHelpProvider",(n,...e)=>eZe(void 0,void 0,void 0,function*(){const[t,i,r]=e;to(Tn.isUri(t)),to(Ce.isIPosition(i)),to(typeof r=="string"||!r);const o=n.get(en),s=yield n.get(Pd).createModelReference(t);try{const a=yield tZe(o.signatureHelpProvider,s.object.textEditorModel,Ce.lift(i),{triggerKind:Qv.Invoke,isRetrigger:!1,triggerCharacter:r},Mi.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{s.dispose()}}));var ycr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},x1;(function(n){n.Default={type:0};class e{constructor(r,o){this.request=r,this.previouslyActiveHints=o,this.type=2}}n.Pending=e;class t{constructor(r){this.hints=r,this.type=1}}n.Active=t})(x1||(x1={}));class AK extends Ae{constructor(e,t,i=AK.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new be),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=x1.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Zl),this.triggerChars=new $V,this.retriggerChars=new $V,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Gp(i),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(r=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(r=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(r=>this.onCursorChange(r))),this._register(this.editor.onDidChangeModelContent(r=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(r=>this.onDidType(r))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=x1.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!this.providers.has(i))return;const r=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(r),t).catch(fi)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,r=this.editor.getOption(85).cycle;if((e<2||i)&&!r){this.cancel();return}this.updateActiveSignature(i&&r?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,r=this.editor.getOption(85).cycle;if((e<2||i)&&!r){this.cancel();return}this.updateActiveSignature(i&&r?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new x1.Active(Object.assign(Object.assign({},this.state.hints),{activeSignature:e})),this._onChangedHints.fire(this.state.hints))}doTrigger(e){return ycr(this,void 0,void 0,function*(){const t=this.state.type===1||this.state.type===2,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const r=this._pendingTriggers.reduce(Ccr);this._pendingTriggers=[];const o={triggerKind:r.triggerKind,triggerCharacter:r.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const s=this.editor.getModel(),a=this.editor.getPosition();this.state=new x1.Pending(za(l=>tZe(this.providers,s,a,o,l)),i);try{const l=yield this.state.request;return e!==this.triggerId?(l==null||l.dispose(),!1):!l||!l.value.signatures||l.value.signatures.length===0?(l==null||l.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new x1.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=x1.Default),fi(l),!1}})}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const i of t.signatureHelpTriggerCharacters||[])if(i.length){const r=i.charCodeAt(0);this.triggerChars.add(r),this.retriggerChars.add(r)}for(const i of t.signatureHelpRetriggerCharacters||[])i.length&&this.retriggerChars.add(i.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:Qv.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:Qv.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:Qv.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(85).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}AK.DEFAULT_DELAY=120;function Ccr(n,e){switch(e.triggerKind){case Qv.Invoke:return e;case Qv.ContentChange:return n;case Qv.TriggerCharacter:default:return e}}var wcr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},MJ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Dce;const xh=at,Scr=Js("parameter-hints-next",Ct.chevronDown,E("parameterHintsNextIcon","Icon for show next parameter hint.")),Ecr=Js("parameter-hints-previous",Ct.chevronUp,E("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let vW=Dce=class extends Ae{constructor(e,t,i,r,o){super(),this.editor=e,this.model=t,this.renderDisposeables=this._register(new nt),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new w0({editor:e},o,r)),this.keyVisible=rk.Visible.bindTo(i),this.keyMultipleSignatures=rk.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=xh(".editor-widget.parameter-hints-widget"),t=Ge(e,xh(".phwrapper"));t.tabIndex=-1;const i=Ge(t,xh(".controls")),r=Ge(i,xh(".button"+In.asCSSSelector(Ecr))),o=Ge(i,xh(".overloads")),s=Ge(i,xh(".button"+In.asCSSSelector(Scr)));this._register(We(r,"click",h=>{yi.stop(h),this.previous()})),this._register(We(s,"click",h=>{yi.stop(h),this.next()}));const a=xh(".body"),l=new S5(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=Ge(a,xh(".signature")),u=Ge(a,xh(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:o,docs:u,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(h=>{this.visible&&this.editor.layoutContentWidget(this)}));const d=()=>{if(!this.domNodes)return;const h=this.editor.getOption(50);this.domNodes.element.style.fontSize=`${h.fontSize}px`,this.domNodes.element.style.lineHeight=`${h.lineHeight/h.fontSize}`};d(),this._register(Pt.chain(this.editor.onDidChangeConfiguration.bind(this.editor),h=>h.filter(g=>g.hasChanged(50)))(d)),this._register(this.editor.onDidLayoutChange(h=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var e;(e=this.domNodes)===null||e===void 0||e.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(e=this.domNodes)===null||e===void 0||e.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 i=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",i),this.keyMultipleSignatures.set(i),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const r=e.signatures[e.activeSignature];if(!r)return;const o=Ge(this.domNodes.signature,xh(".code")),s=this.editor.getOption(50);o.style.fontSize=`${s.fontSize}px`,o.style.fontFamily=s.fontFamily;const a=r.parameters.length>0,l=(t=r.activeParameter)!==null&&t!==void 0?t:e.activeParameter;if(a)this.renderParameters(o,r,l);else{const d=Ge(o,xh("span"));d.textContent=r.label}const c=r.parameters[l];if(c!=null&&c.documentation){const d=xh("span.documentation");if(typeof c.documentation=="string")d.textContent=c.documentation;else{const h=this.renderMarkdownDocs(c.documentation);d.appendChild(h.element)}Ge(this.domNodes.docs,xh("p",{},d))}if(r.documentation!==void 0)if(typeof r.documentation=="string")Ge(this.domNodes.docs,xh("p",{},r.documentation));else{const d=this.renderMarkdownDocs(r.documentation);Ge(this.domNodes.docs,d.element)}const u=this.hasDocs(r,c);if(this.domNodes.signature.classList.toggle("has-docs",u),this.domNodes.docs.classList.toggle("empty",!u),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,c){let d="";const h=r.parameters[l];Array.isArray(h.label)?d=r.label.substring(h.label[0],h.label[1]):d=h.label,h.documentation&&(d+=typeof h.documentation=="string"?`, ${h.documentation}`:`, ${h.documentation.value}`),r.documentation&&(d+=typeof r.documentation=="string"?`, ${r.documentation}`:`, ${r.documentation.value}`),this.announcedLabel!==d&&(Pc(E("hint","{0}, hint",d)),this.announcedLabel=d)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var i;(i=this.domNodes)===null||i===void 0||i.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&xE(t.documentation).length>0||t&&typeof t.documentation=="object"&&xE(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&xE(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&xE(e.documentation.value).length>0)}renderParameters(e,t,i){const[r,o]=this.getParameterLabelOffsets(t,i),s=document.createElement("span");s.textContent=t.label.substring(0,r);const a=document.createElement("span");a.textContent=t.label.substring(r,o),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(o),Ge(e,s,a,l)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const r=new RegExp(`(\\W|^)${hf(i.label)}(?=\\W|$)`,"g");r.test(e.label);const o=r.lastIndex-i.label.length;return o>=0?[o,r.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return Dce.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const i=this.domNodes.element.getElementsByClassName("phwrapper");i.length&&(i[0].style.maxHeight=t)}};vW.ID="editor.widget.parameterHintsWidget";vW=Dce=wcr([MJ(2,Yn),MJ(3,mh),MJ(4,Qo)],vW);re("editorHoverWidget.highlightForeground",{dark:yp,light:yp,hcDark:yp,hcLight:yp},E("editorHoverWidgetHighlightForeground","Foreground color of the active item in the parameter hint."));var xcr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},zNe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Ace;let ok=Ace=class extends Ae{static get(e){return e.getContribution(Ace.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new AK(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(r=>{var o;r?(this.widget.value.show(),this.widget.value.render(r)):(o=this.widget.rawValue)===null||o===void 0||o.hide()})),this.widget=new Jw(()=>this._register(t.createInstance(vW,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)===null||e===void 0||e.previous()}next(){var e;(e=this.widget.rawValue)===null||e===void 0||e.next()}trigger(e){this.model.trigger(e,0)}};ok.ID="editor.controller.parameterHints";ok=Ace=xcr([zNe(1,Un),zNe(2,en)],ok);class kcr extends Gt{constructor(){super({id:"editor.action.triggerParameterHints",label:E("parameterHints.trigger.label","Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:ee.hasSignatureHelpProvider,kbOpts:{kbExpr:ee.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=ok.get(t);i==null||i.trigger({triggerKind:Qv.Invoke})}}gr(ok.ID,ok,2);ht(kcr);const ybe=100+75,Cbe=kl.bindToContribution(ok.get);Et(new Cbe({id:"closeParameterHints",precondition:rk.Visible,handler:n=>n.cancel(),kbOpts:{weight:ybe,kbExpr:ee.focus,primary:9,secondary:[1033]}}));Et(new Cbe({id:"showPrevParameterHint",precondition:Ke.and(rk.Visible,rk.MultipleSignatures),handler:n=>n.previous(),kbOpts:{weight:ybe,kbExpr:ee.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));Et(new Cbe({id:"showNextParameterHint",precondition:Ke.and(rk.Visible,rk.MultipleSignatures),handler:n=>n.next(),kbOpts:{weight:ybe,kbExpr:ee.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));var Tcr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},FJ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const RK=new Ft("renameInputVisible",!1,E("renameInputVisible","Whether the rename input widget is visible"));let Rce=class{constructor(e,t,i,r,o){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=r,this._disposables=new nt,this.allowEditorOverflow=!0,this._visibleContextKey=RK.bindTo(o),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(50)&&this._updateFont()})),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return 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",E("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),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){var t,i,r,o;if(!this._input||!this._domNode)return;const s=e.getColor(Ov),a=e.getColor(i_e);this._domNode.style.backgroundColor=String((t=e.getColor(As))!==null&&t!==void 0?t:""),this._domNode.style.boxShadow=s?` 0 0 8px 2px ${s}`:"",this._domNode.style.border=a?`1px solid ${a}`:"",this._domNode.style.color=String((i=e.getColor(gqe))!==null&&i!==void 0?i:""),this._input.style.backgroundColor=String((r=e.getColor(fqe))!==null&&r!==void 0?r:"");const l=e.getColor(pqe);this._input.style.borderWidth=l?"1px":"0px",this._input.style.borderStyle=l?"solid":"none",this._input.style.borderColor=(o=l==null?void 0:l.toString())!==null&&o!==void 0?o:"none"}_updateFont(){if(!this._input||!this._label)return;const e=this._editor.getOption(50);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize=`${e.fontSize}px`,this._label.style.fontSize=`${e.fontSize*.8}px`}getPosition(){return this._visible?{position:this._position,preference:[2,1]}:null}beforeRender(){var e,t;const[i,r]=this._acceptKeybindings;return this._label.innerText=E({key:"label",comment:['placeholders are keybindings, e.g "F2 to Rename, Shift+F2 to Preview"']},"{0} to Rename, {1} to Preview",(e=this._keybindingService.lookupKeybinding(i))===null||e===void 0?void 0:e.getLabel(),(t=this._keybindingService.lookupKeybinding(r))===null||t===void 0?void 0:t.getLabel()),null}afterRender(e){e||this.cancelInput(!0)}acceptInput(e){var t;(t=this._currentAcceptInput)===null||t===void 0||t.call(this,e)}cancelInput(e){var t;(t=this._currentCancelInput)===null||t===void 0||t.call(this,e)}getInput(e,t,i,r,o,s){this._domNode.classList.toggle("preview",o),this._position=new Ce(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",i.toString()),this._input.setAttribute("selectionEnd",r.toString()),this._input.size=Math.max((e.endColumn-e.startColumn)*1.1,20);const a=new nt;return new Promise(l=>{this._currentCancelInput=c=>(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,l(c),!0),this._currentAcceptInput=c=>{if(this._input.value.trim().length===0||this._input.value===t){this.cancelInput(!0);return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,l({newName:this._input.value,wantsPreview:o&&c})},a.add(s.onCancellationRequested(()=>this.cancelInput(!0))),a.add(this._editor.onDidBlurEditorWidget(()=>{var c;return this.cancelInput(!(!((c=this._domNode)===null||c===void 0)&&c.ownerDocument.hasFocus()))})),this._show()}).finally(()=>{a.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)}};Rce=Tcr([FJ(2,ll),FJ(3,mo),FJ(4,Yn)],Rce);var Icr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},RS=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},sx=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Nce;class wbe{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}resolveRenameLocation(e){return sx(this,void 0,void 0,function*(){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx<this._providers.length;this._providerRenameIdx++){const r=this._providers[this._providerRenameIdx];if(!r.resolveRenameLocation)break;const o=yield r.resolveRenameLocation(this.model,this.position,e);if(o){if(o.rejectReason){t.push(o.rejectReason);continue}return o}}const i=this.model.getWordAtPosition(this.position);return i?{range:new q(this.position.lineNumber,i.startColumn,this.position.lineNumber,i.endColumn),text:i.word,rejectReason:t.length>0?t.join(`
`):void 0}:{range:q.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(`
`):void 0}})}provideRenameEdits(e,t){return sx(this,void 0,void 0,function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)})}_provideRenameEdits(e,t,i,r){return sx(this,void 0,void 0,function*(){const o=this._providers[t];if(!o)return{edits:[],rejectReason:i.join(`
`)};const s=yield o.provideRenameEdits(this.model,this.position,e,r);if(s){if(s.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(s.rejectReason),r)}else return this._provideRenameEdits(e,t+1,i.concat(E("no result","No result.")),r);return s})}}function Lcr(n,e,t,i){return sx(this,void 0,void 0,function*(){const r=new wbe(e,t,n),o=yield r.resolveRenameLocation(Mi.None);return o!=null&&o.rejectReason?{edits:[],rejectReason:o.rejectReason}:r.provideRenameEdits(i,Mi.None)})}let sk=Nce=class{static get(e){return e.getContribution(Nce.ID)}constructor(e,t,i,r,o,s,a,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=r,this._progressService=o,this._logService=s,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new nt,this._cts=new da,this._renameInputField=this._disposableStore.add(this._instaService.createInstance(Rce,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}run(){var e,t;return sx(this,void 0,void 0,function*(){if(this._cts.dispose(!0),this._cts=new da,!this.editor.hasModel())return;const i=this.editor.getPosition(),r=new wbe(this.editor.getModel(),i,this._languageFeaturesService.renameProvider);if(!r.hasProvider())return;const o=new bw(this.editor,5,void 0,this._cts.token);let s;try{const p=r.resolveRenameLocation(o.token);this._progressService.showWhile(p,250),s=yield p}catch(p){(e=oh.get(this.editor))===null||e===void 0||e.showMessage(p||E("resolveRenameLocationFailed","An unknown error occurred while resolving rename location"),i);return}finally{o.dispose()}if(!s)return;if(s.rejectReason){(t=oh.get(this.editor))===null||t===void 0||t.showMessage(s.rejectReason,i);return}if(o.token.isCancellationRequested)return;const a=new bw(this.editor,5,s.range,this._cts.token),l=this.editor.getSelection();let c=0,u=s.text.length;!q.isEmpty(l)&&!q.spansMultipleLines(l)&&q.containsRange(s.range,l)&&(c=Math.max(0,l.startColumn-s.range.startColumn),u=Math.min(s.range.endColumn,l.endColumn)-s.range.startColumn);const d=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),h=yield this._renameInputField.getInput(s.range,s.text,c,u,d,a.token);if(typeof h=="boolean"){h&&this.editor.focus(),a.dispose();return}this.editor.focus();const g=jU(r.provideRenameEdits(h.newName,a.token),a.token).then(p=>sx(this,void 0,void 0,function*(){if(!(!p||!this.editor.hasModel())){if(p.rejectReason){this._notificationService.info(p.rejectReason);return}this.editor.setSelection(q.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(p,{editor:this.editor,showPreview:h.wantsPreview,label:E("label","Renaming '{0}' to '{1}'",s==null?void 0:s.text,h.newName),code:"undoredo.rename",quotableLabel:E("quotableLabel","Renaming {0} to {1}",s==null?void 0:s.text,h.newName),respectAutoSaveConfig:!0}).then(m=>{m.ariaSummary&&Pc(E("aria","Successfully renamed '{0}' to '{1}'. Summary: {2}",s.text,h.newName,m.ariaSummary))}).catch(m=>{this._notificationService.error(E("rename.failedApply","Rename failed to apply edits")),this._logService.error(m)})}}),p=>{this._notificationService.error(E("rename.failed","Rename failed to compute edits")),this._logService.error(p)}).finally(()=>{a.dispose()});return this._progressService.showWhile(g,250),g})}acceptRenameInput(e){this._renameInputField.acceptInput(e)}cancelRenameInput(){this._renameInputField.cancelInput(!0)}};sk.ID="editor.contrib.renameController";sk=Nce=Icr([RS(1,Un),RS(2,ga),RS(3,L5),RS(4,iS),RS(5,Sf),RS(6,Yme),RS(7,en)],sk);class Dcr extends Gt{constructor(){super({id:"editor.action.rename",label:E("rename.label","Rename Symbol"),alias:"Rename Symbol",precondition:Ke.and(ee.writable,ee.hasRenameProvider),kbOpts:{kbExpr:ee.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(Lr),[r,o]=Array.isArray(t)&&t||[void 0,void 0];return Tn.isUri(r)&&Ce.isIPosition(o)?i.openCodeEditor({resource:r},i.getActiveCodeEditor()).then(s=>{s&&(s.setPosition(o),s.invokeWithinContext(a=>(this.reportTelemetry(a,s),this.run(a,s))))},fi):super.runCommand(e,t)}run(e,t){const i=sk.get(t);return i?i.run():Promise.resolve()}}gr(sk.ID,sk,4);ht(Dcr);const Sbe=kl.bindToContribution(sk.get);Et(new Sbe({id:"acceptRenameInput",precondition:RK,handler:n=>n.acceptRenameInput(!1),kbOpts:{weight:100+99,kbExpr:Ke.and(ee.focus,Ke.not("isComposing")),primary:3}}));Et(new Sbe({id:"acceptRenameInputWithPreview",precondition:Ke.and(RK,Ke.has("config.editor.rename.enablePreview")),handler:n=>n.acceptRenameInput(!0),kbOpts:{weight:100+99,kbExpr:Ke.and(ee.focus,Ke.not("isComposing")),primary:1024+3}}));Et(new Sbe({id:"cancelRenameInput",precondition:RK,handler:n=>n.cancelRenameInput(),kbOpts:{weight:100+99,kbExpr:ee.focus,primary:9,secondary:[1033]}}));Ib("_executeDocumentRenameProvider",function(n,e,t,...i){const[r]=i;to(typeof r=="string");const{renameProvider:o}=n.get(en);return Lcr(o,e,t,r)});Ib("_executePrepareRename",function(n,e,t){return sx(this,void 0,void 0,function*(){const{renameProvider:i}=n.get(en),o=yield new wbe(e,t,i).resolveRenameLocation(Mi.None);if(o!=null&&o.rejectReason)throw new Error(o.rejectReason);return o})});ds.as(O_.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:E("enablePreview","Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});function Acr(n){for(let e=0,t=n.length;e<t;e+=4){const i=n[e+0],r=n[e+1],o=n[e+2],s=n[e+3];n[e+0]=s,n[e+1]=o,n[e+2]=r,n[e+3]=i}}function Rcr(n){const e=new Uint8Array(n.buffer,n.byteOffset,n.length*4);return Tje()||Acr(e),GU.wrap(e)}function nZe(n){const e=new Uint32Array(Ncr(n));let t=0;if(e[t++]=n.id,n.type==="full")e[t++]=1,e[t++]=n.data.length,e.set(n.data,t),t+=n.data.length;else{e[t++]=2,e[t++]=n.deltas.length;for(const i of n.deltas)e[t++]=i.start,e[t++]=i.deleteCount,i.data?(e[t++]=i.data.length,e.set(i.data,t),t+=i.data.length):e[t++]=0}return Rcr(e)}function Ncr(n){let e=0;if(e+=1+1,n.type==="full")e+=1+n.data.length;else{e+=1,e+=(1+1+1)*n.deltas.length;for(const t of n.deltas)t.data&&(e+=t.data.length)}return e}var Dw=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function NK(n){return n&&!!n.data}function iZe(n){return n&&Array.isArray(n.edits)}class Ocr{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function rZe(n,e){return n.has(e)}function Pcr(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:[]}function oZe(n,e,t,i,r){return Dw(this,void 0,void 0,function*(){const o=Pcr(n,e),s=yield Promise.all(o.map(a=>Dw(this,void 0,void 0,function*(){let l,c=null;try{l=yield a.provideDocumentSemanticTokens(e,a===t?i:null,r)}catch(u){c=u,l=null}return(!l||!NK(l)&&!iZe(l))&&(l=null),new Ocr(a,l,c)})));for(const a of s){if(a.error)throw a.error;if(a.tokens)return a}return s.length>0?s[0]:null})}function Mcr(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:null}class Fcr{constructor(e,t){this.provider=e,this.tokens=t}}function Bcr(n,e){return n.has(e)}function sZe(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:[]}function Ebe(n,e,t,i){return Dw(this,void 0,void 0,function*(){const r=sZe(n,e),o=yield Promise.all(r.map(s=>Dw(this,void 0,void 0,function*(){let a;try{a=yield s.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){Sa(l),a=null}return(!a||!NK(a))&&(a=null),new Fcr(s,a)})));for(const s of o)if(s.tokens)return s;return o.length>0?o[0]:null})}Xi.registerCommand("_provideDocumentSemanticTokensLegend",(n,...e)=>Dw(void 0,void 0,void 0,function*(){const[t]=e;to(t instanceof Tn);const i=n.get(ts).getModel(t);if(!i)return;const{documentSemanticTokensProvider:r}=n.get(en),o=Mcr(r,i);return o?o[0].getLegend():n.get(Fs).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)}));Xi.registerCommand("_provideDocumentSemanticTokens",(n,...e)=>Dw(void 0,void 0,void 0,function*(){const[t]=e;to(t instanceof Tn);const i=n.get(ts).getModel(t);if(!i)return;const{documentSemanticTokensProvider:r}=n.get(en);if(!rZe(r,i))return n.get(Fs).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const o=yield oZe(r,i,null,null,Mi.None);if(!o)return;const{provider:s,tokens:a}=o;if(!a||!NK(a))return;const l=nZe({id:0,type:"full",data:a.data});return a.resultId&&s.releaseDocumentSemanticTokens(a.resultId),l}));Xi.registerCommand("_provideDocumentRangeSemanticTokensLegend",(n,...e)=>Dw(void 0,void 0,void 0,function*(){const[t,i]=e;to(t instanceof Tn);const r=n.get(ts).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:o}=n.get(en),s=sZe(o,r);if(s.length===0)return;if(s.length===1)return s[0].getLegend();if(!i||!q.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),s[0].getLegend();const a=yield Ebe(o,r,q.lift(i),Mi.None);if(a)return a.provider.getLegend()}));Xi.registerCommand("_provideDocumentRangeSemanticTokens",(n,...e)=>Dw(void 0,void 0,void 0,function*(){const[t,i]=e;to(t instanceof Tn),to(q.isIRange(i));const r=n.get(ts).getModel(t);if(!r)return;const{documentRangeSemanticTokensProvider:o}=n.get(en),s=yield Ebe(o,r,q.lift(i),Mi.None);if(!(!s||!s.tokens))return nZe({id:0,type:"full",data:s.tokens.data})}));const xbe="editor.semanticHighlighting";function Oce(n,e,t){var i;const r=(i=t.getValue(xbe,{overrideIdentifier:n.getLanguageId(),resource:n.uri}))===null||i===void 0?void 0:i.enabled;return typeof r=="boolean"?r:e.getColorTheme().semanticHighlighting}var aZe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},gv=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},p1;let Pce=class extends Ae{constructor(e,t,i,r,o,s){super(),this._watchers=Object.create(null);const a=u=>{this._watchers[u.uri.toString()]=new H4(u,e,i,o,s)},l=(u,d)=>{d.dispose(),delete this._watchers[u.uri.toString()]},c=()=>{for(const u of t.getModels()){const d=this._watchers[u.uri.toString()];Oce(u,i,r)?d||a(u):d&&l(u,d)}};this._register(t.onModelAdded(u=>{Oce(u,i,r)&&a(u)})),this._register(t.onModelRemoved(u=>{const d=this._watchers[u.uri.toString()];d&&l(u,d)})),this._register(r.onDidChangeConfiguration(u=>{u.affectsConfiguration(xbe)&&c()})),this._register(i.onDidColorThemeChange(c))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};Pce=aZe([gv(0,mq),gv(1,ts),gv(2,ll),gv(3,Ui),gv(4,Fg),gv(5,en)],Pce);let H4=p1=class extends Ae{constructor(e,t,i,r,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=r.for(this._provider,"DocumentSemanticTokens",{min:p1.REQUEST_MIN_DELAY,max:p1.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new so(()=>this._fetchDocumentSemanticTokensNow(),p1.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{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=()=>{Hr(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};s(),this._register(this._provider.onDidChange(()=>{s(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(a=>{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),Hr(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!rZe(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new da,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,r=oZe(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],s=this._model.onDidChangeContent(l=>{o.push(l)}),a=new $c(!1);r.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:c,tokens:u}=l,d=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,u||null,d,o)}},l=>{l&&(R_(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||fi(l),this._currentDocumentRequestCancellationTokenSource=null,s.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,r,o){o=Math.min(o,i.length-r,e.length-t);for(let s=0;s<o;s++)i[r+s]=e[t+s]}_setDocumentSemanticTokens(e,t,i,r){const o=this._currentDocumentResponse,s=()=>{(r.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),s();return}if(iZe(t)){if(!o){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:o.data};else{let a=0;for(const h of t.edits)a+=(h.data?h.data.length:0)-h.deleteCount;const l=o.data,c=new Uint32Array(l.length+a);let u=l.length,d=c.length;for(let h=t.edits.length-1;h>=0;h--){const g=t.edits[h];if(g.start>l.length){i.warnInvalidEditStart(o.resultId,t.resultId,h,g.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const p=u-(g.start+g.deleteCount);p>0&&(p1._copy(l,u-p,c,d-p,p),d-=p),g.data&&(p1._copy(g.data,0,c,d-g.data.length,g.data.length),d-=g.data.length),u=g.start}u>0&&p1._copy(l,0,c,0,u),t={resultId:t.resultId,data:c}}}if(NK(t)){this._currentDocumentResponse=new $cr(e,t.resultId,t.data);const a=LKe(t,i,this._model.getLanguageId());if(r.length>0)for(const l of r)for(const c of a)for(const u of l.changes)c.applyEdit(u.range,u.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);s()}};H4.REQUEST_MIN_DELAY=300;H4.REQUEST_MAX_DELAY=2e3;H4=p1=aZe([gv(1,mq),gv(2,ll),gv(3,Fg),gv(4,en)],H4);class $cr{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}Fq(Pce);var Vcr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},lN=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let W4=class extends Ae{constructor(e,t,i,r,o,s){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=r,this._editor=e,this._provider=s.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new so(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(l=>{this._cancelAll(),a()})),this._register(this._provider.onDidChange(()=>{this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(l=>{l.affectsConfiguration(xbe)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;t<i;t++)if(this._outstandingRequests[t]===e){this._outstandingRequests.splice(t,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!Oce(e,this._themeService,this._configurationService)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}if(!Bcr(this._provider,e)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}const t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(i=>this._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),r=za(s=>Promise.resolve(Ebe(this._provider,e,t,s))),o=new $c(!1);return r.then(s=>{if(this._debounceInformation.update(e,o.elapsed()),!s||!s.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=s,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,LKe(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(r),()=>this._removeOutstandingRequest(r)),r}};W4.ID="editor.contrib.viewportSemanticTokens";W4=Vcr([lN(1,mq),lN(2,ll),lN(3,Ui),lN(4,Fg),lN(5,en)],W4);gr(W4.ID,W4,1);class Hcr{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const r of t){const o=[];i.push(o),this.selectSubwords&&this._addInWordRanges(o,e,r),this._addWordRanges(o,e,r),this._addWhitespaceLine(o,e,r),o.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const r=t.getWordAtPosition(i);if(!r)return;const{word:o,startColumn:s}=r,a=i.column-s;let l=a,c=a,u=0;for(;l>=0;l--){const d=o.charCodeAt(l);if(l!==a&&(d===95||d===45))break;if(G1(d)&&dv(u))break;u=d}for(l+=1;c<o.length;c++){const d=o.charCodeAt(c);if(dv(d)&&G1(u))break;if(d===95||d===45)break;u=d}l<c&&e.push({range:new q(i.lineNumber,s+l,i.lineNumber,s+c)})}_addWordRanges(e,t,i){const r=t.getWordAtPosition(i);r&&e.push({range:new q(i.lineNumber,r.startColumn,i.lineNumber,r.endColumn)})}_addWhitespaceLine(e,t,i){t.getLineLength(i.lineNumber)>0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new q(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var Wcr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},zcr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},OK=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Mce;class kbe{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new kbe(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}let D2=Mce=class{static get(e){return e.getContribution(Mce.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)===null||e===void 0||e.dispose()}run(e){return OK(this,void 0,void 0,function*(){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||(yield cZe(this._languageFeaturesService.selectionRangeProvider,i,t.map(o=>o.getPosition()),this._editor.getOption(112),Mi.None).then(o=>{var s;if(!(!Fc(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!Qs(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;a<o.length;a++)o[a]=o[a].filter(l=>l.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),o[a].unshift(t[a]);this._state=o.map(a=>new kbe(0,a)),(s=this._selectionListener)===null||s===void 0||s.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)===null||a===void 0||a.dispose(),this._state=void 0)})}})),!this._state)return;this._state=this._state.map(o=>o.mov(e));const r=this._state.map(o=>ln.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(r)}finally{this._ignoreSelection=!1}})}};D2.ID="editor.contrib.smartSelectController";D2=Mce=Wcr([zcr(1,en)],D2);class lZe extends Gt{constructor(e,t){super(t),this._forward=e}run(e,t){return OK(this,void 0,void 0,function*(){const i=D2.get(t);i&&(yield i.run(this._forward))})}}class jcr extends lZe{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:E("smartSelect.expand","Expand Selection"),alias:"Expand Selection",precondition:void 0,kbOpts:{kbExpr:ee.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:J.MenubarSelectionMenu,group:"1_basic",title:E({key:"miSmartSelectGrow",comment:["&& denotes a mnemonic"]},"&&Expand Selection"),order:2}})}}Xi.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class Ucr extends lZe{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:E("smartSelect.shrink","Shrink Selection"),alias:"Shrink Selection",precondition:void 0,kbOpts:{kbExpr:ee.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:J.MenubarSelectionMenu,group:"1_basic",title:E({key:"miSmartSelectShrink",comment:["&& denotes a mnemonic"]},"&&Shrink Selection"),order:3}})}}gr(D2.ID,D2,4);ht(jcr);ht(Ucr);function cZe(n,e,t,i,r){return OK(this,void 0,void 0,function*(){const o=n.all(e).concat(new Hcr(i.selectSubwords));o.length===1&&o.unshift(new Dh);const s=[],a=[];for(const l of o)s.push(Promise.resolve(l.provideSelectionRanges(e,t,r)).then(c=>{if(Fc(c)&&c.length===t.length)for(let u=0;u<t.length;u++){a[u]||(a[u]=[]);for(const d of c[u])q.isIRange(d.range)&&q.containsPosition(d.range,t[u])&&a[u].push(q.lift(d.range))}},Sa));return yield Promise.all(s),a.map(l=>{if(l.length===0)return[];l.sort((h,g)=>Ce.isBefore(h.getStartPosition(),g.getStartPosition())?1:Ce.isBefore(g.getStartPosition(),h.getStartPosition())||Ce.isBefore(h.getEndPosition(),g.getEndPosition())?-1:Ce.isBefore(g.getEndPosition(),h.getEndPosition())?1:0);const c=[];let u;for(const h of l)(!u||q.containsRange(h,u)&&!q.equalsRange(h,u))&&(c.push(h),u=h);if(!i.selectLeadingAndTrailingWhitespace)return c;const d=[c[0]];for(let h=1;h<c.length;h++){const g=c[h-1],p=c[h];if(p.startLineNumber!==g.startLineNumber||p.endLineNumber!==g.endLineNumber){const m=new q(g.startLineNumber,e.getLineFirstNonWhitespaceColumn(g.startLineNumber),g.endLineNumber,e.getLineLastNonWhitespaceColumn(g.endLineNumber));m.containsRange(g)&&!m.equalsRange(g)&&p.containsRange(m)&&!p.equalsRange(m)&&d.push(m);const _=new q(g.startLineNumber,1,g.endLineNumber,e.getLineMaxColumn(g.endLineNumber));_.containsRange(g)&&!_.equalsRange(m)&&p.containsRange(_)&&!p.equalsRange(_)&&d.push(_)}d.push(p)}return d})})}Xi.registerCommand("_executeSelectionRangeProvider",function(n,...e){return OK(this,void 0,void 0,function*(){const[t,i]=e;to(Tn.isUri(t));const r=n.get(en).selectionRangeProvider,o=yield n.get(Pd).createModelReference(t);try{return cZe(r,o.object.textEditorModel,i,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},Mi.None)}finally{o.dispose()}})});const qcr=Object.freeze({View:{value:E("view","View"),original:"View"},Help:{value:E("help","Help"),original:"Help"},Test:{value:E("test","Test"),original:"Test"},File:{value:E("file","File"),original:"File"},Preferences:{value:E("preferences","Preferences"),original:"Preferences"},Developer:{value:E({key:"developer",comment:["A developer on Code itself or someone diagnosing issues in Code"]},"Developer"),original:"Developer"}});var Kcr=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class jNe{constructor(e,t,i,r=null){this.startLineNumbers=e,this.endLineNumbers=t,this.lastLineRelativePosition=i,this.showEndForLine=r}equals(e){return!!e&&this.lastLineRelativePosition===e.lastLineRelativePosition&&this.showEndForLine===e.showEndForLine&&Qs(this.startLineNumbers,e.startLineNumbers)&&Qs(this.endLineNumbers,e.endLineNumbers)}}const UNe=R0("stickyScrollViewLayer",{createHTML:n=>n}),BJ="data-sticky-line-index",qNe="data-sticky-is-line",Gcr="data-sticky-is-line-number",KNe="data-sticky-is-folding-icon";class Ycr extends Ae{constructor(e){super(),this._editor=e,this._foldingIconStore=new nt,this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._lineHeight=this._editor.getOption(66),this._stickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof ww),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(114).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(114)&&t(),i.hasChanged(66)&&(this._lineHeight=this._editor.getOption(66))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange(i=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getStickyLineForLine(e){return this._stickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i=1/0){if((!this._previousState&&!e||this._previousState&&this._previousState.equals(e))&&i===1/0)return;this._previousState=e;const r=this._stickyLines;if(this._clearStickyWidget(),!e||!this._editor._getViewModel())return;if(e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const s=[...e.startLineNumbers];e.showEndForLine!==null&&(s[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=s}else this._lastLineRelativePosition=0,this._lineNumbers=[];this._renderRootNode(r,t,i)}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_clearStickyWidget(){this._stickyLines=[],this._foldingIconStore.clear(),Gl(this._lineNumbersDomNode),Gl(this._linesDomNode),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._stickyLines){const i=t.foldingIcon;i&&i.setVisible(e?!0:i.isCollapsed)}}_renderRootNode(e,t,i=1/0){return Kcr(this,void 0,void 0,function*(){const r=this._editor.getLayoutInfo();for(const[s,a]of this._lineNumbers.entries()){const l=e[s],c=a>=i||(l==null?void 0:l.lineNumber)!==a?this._renderChildNode(s,a,t,r):this._updateTopAndZIndexOfStickyLine(l);c&&(this._linesDomNode.appendChild(c.lineDomNode),this._lineNumbersDomNode.appendChild(c.lineNumberDomNode),this._stickyLines.push(c))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const o=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;if(o===0){this._clearStickyWidget();return}this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${o}px`,this._linesDomNodeScrollable.style.height=`${o}px`,this._rootDomNode.style.height=`${o}px`,this._rootDomNode.style.marginLeft="0px",this._updateMinContentWidth(),this._editor.layoutOverlayWidget(this)})}_setFoldingHoverListeners(){this._editor.getOption(109)==="mouseover"&&(this._foldingIconStore.add(We(this._lineNumbersDomNode,Lt.MOUSE_ENTER,t=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(We(this._lineNumbersDomNode,Lt.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,r){const o=this._editor._getViewModel();if(!o)return;const s=o.coordinatesConverter.convertModelPositionToViewPosition(new Ce(t,1)).lineNumber,a=o.getViewLineRenderingData(s),l=this._editor.getOption(67);let c;try{c=Jd.filter(a.inlineDecorations,s,a.minColumn,a.maxColumn)}catch{c=[]}const u=new tS(!0,!0,a.content,a.continuesWithWrappedLine,a.isBasicASCII,a.containsRTL,0,a.tokens,c,a.tabSize,a.startVisibleColumn,1,1,1,500,"none",!0,!0,null),d=new SA(2e3),h=v5(u,d);let g;UNe?g=UNe.createHTML(d.build()):g=d.build();const p=document.createElement("span");p.setAttribute(BJ,String(e)),p.setAttribute(qNe,""),p.setAttribute("role","listitem"),p.tabIndex=0,p.className="sticky-line-content",p.classList.add(`stickyLine${t}`),p.style.lineHeight=`${this._lineHeight}px`,p.innerHTML=g;const m=document.createElement("span");m.setAttribute(BJ,String(e)),m.setAttribute(Gcr,""),m.className="sticky-line-number",m.style.lineHeight=`${this._lineHeight}px`;const _=r.contentLeft;m.style.width=`${_}px`;const v=document.createElement("span");l.renderType===1||l.renderType===3&&t%10===0?v.innerText=t.toString():l.renderType===2&&(v.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),v.className="sticky-line-number-inner",v.style.lineHeight=`${this._lineHeight}px`,v.style.width=`${r.lineNumbersWidth}px`,v.style.paddingLeft=`${r.lineNumbersLeft}px`,m.appendChild(v);const b=this._renderFoldingIconForLine(i,t);b&&m.appendChild(b.domNode),this._editor.applyFontInfo(p),this._editor.applyFontInfo(v),m.style.lineHeight=`${this._lineHeight}px`,p.style.lineHeight=`${this._lineHeight}px`,m.style.height=`${this._lineHeight}px`,p.style.height=`${this._lineHeight}px`;const y=new Qcr(e,t,p,m,b,h.characterMapping);return this._updateTopAndZIndexOfStickyLine(y)}_updateTopAndZIndexOfStickyLine(e){var t;const i=e.index,r=e.lineDomNode,o=e.lineNumberDomNode,s=i===this._lineNumbers.length-1,a="0",l="1";r.style.zIndex=s?a:l,o.style.zIndex=s?a:l;const c=`${i*this._lineHeight+this._lastLineRelativePosition+(!((t=e.foldingIcon)===null||t===void 0)&&t.isCollapsed?1:0)}px`,u=`${i*this._lineHeight}px`;return r.style.top=s?c:u,o.style.top=s?c:u,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(109);if(!e||i==="never")return;const r=e.regions,o=r.findRange(t),s=r.getStartLineNumber(o);if(!(t===s))return;const l=r.isCollapsed(o),c=new Xcr(l,s,r.getEndLineNumber(o),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||i==="always"),c.domNode.setAttribute(KNe,""),c}_updateMinContentWidth(){this._minContentWidthInPx=0;for(const e of this._stickyLines)e.lineDomNode.scrollWidth>this._minContentWidthInPx&&(this._minContentWidthInPx=e.lineDomNode.scrollWidth);this._minContentWidthInPx+=this._editor.getLayoutInfo().verticalScrollbarWidth}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:null}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e<this._stickyLines.length&&this._stickyLines[e].lineDomNode.focus()}getEditorPositionFromNode(e){if(!e||e.children.length>0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=u_e(t.characterMapping,e,0);return new Ce(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t,i;return(i=(t=this._getRenderedStickyLineFromChildDomNode(e))===null||t===void 0?void 0:t.lineNumber)!==null&&i!==void 0?i:null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._stickyLines.length?null:this._stickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,BJ);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,qNe)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,KNe)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class Qcr{constructor(e,t,i,r,o,s){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=r,this.foldingIcon=o,this.characterMapping=s}}class Xcr{constructor(e,t,i,r){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=r,this.domNode=document.createElement("div"),this.domNode.style.width=`${r}px`,this.domNode.style.height=`${r}px`,this.domNode.className=In.asClassName(e?gK:fK)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class aP{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class bW{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class uZe{constructor(e,t,i,r){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=r}}var PK=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},z4=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},GNe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},lP;(function(n){n.OUTLINE_MODEL="outlineModel",n.FOLDING_PROVIDER_MODEL="foldingProviderModel",n.INDENTATION_MODEL="indentationModel"})(lP||(lP={}));var aC;(function(n){n[n.VALID=0]="VALID",n[n.INVALID=1]="INVALID",n[n.CANCELED=2]="CANCELED"})(aC||(aC={}));let Fce=class extends Ae{constructor(e,t,i,r){super(),this._editor=e,this._languageConfigurationService=t,this._languageFeaturesService=i,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Gp(300)),this._updateOperation=this._register(new nt);const o=new Bce(i),s=new Vce(this._editor,i),a=new $ce(this._editor,t);switch(r){case lP.OUTLINE_MODEL:this._modelProviders.push(o),this._modelProviders.push(s),this._modelProviders.push(a);break;case lP.FOLDING_PROVIDER_MODEL:this._modelProviders.push(s),this._modelProviders.push(a);break;case lP.INDENTATION_MODEL:this._modelProviders.push(a);break}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}update(e,t,i){return GNe(this,void 0,void 0,function*(){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),yield this._updateScheduler.trigger(()=>GNe(this,void 0,void 0,function*(){for(const r of this._modelProviders){const{statusPromise:o,modelPromise:s}=r.computeStickyModel(e,t,i);this._modelPromise=s;const a=yield o;if(this._modelPromise!==s)return null;switch(a){case aC.CANCELED:return this._updateOperation.clear(),null;case aC.VALID:return r.stickyModel}}return null})).catch(r=>(fi(r),null))})}};Fce=PK([z4(1,xo),z4(2,en)],Fce);class dZe{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,aC.INVALID}computeStickyModel(e,t,i){if(i.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};const r=za(o=>this.createModelFromProvider(e,t,o));return{statusPromise:r.then(o=>this.isModelValid(o)?i.isCancellationRequested?aC.CANCELED:(this._stickyModel=this.createStickyModel(e,t,i,o),aC.VALID):this._invalid()).then(void 0,o=>(fi(o),aC.CANCELED)),modelPromise:r}}isModelValid(e){return!0}isProviderValid(e){return!0}}let Bce=class extends dZe{constructor(e){super(),this._languageFeaturesService=e}createModelFromProvider(e,t,i){return by.create(this._languageFeaturesService.documentSymbolProvider,e,i)}createStickyModel(e,t,i,r){var o;const{stickyOutlineElement:s,providerID:a}=this._stickyModelFromOutlineModel(r,(o=this._stickyModel)===null||o===void 0?void 0:o.outlineProviderId);return new uZe(e.uri,t,s,a)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(Pi.first(e.children.values())instanceof OXe){const a=Pi.find(e.children.values(),l=>l.id===t);if(a)i=a.children;else{let l="",c=-1,u;for(const[d,h]of e.children.entries()){const g=this._findSumOfRangesOfGroup(h);g>c&&(u=h,c=g,l=h.id)}t=l,i=u.children}}else i=e.children;const r=[],o=Array.from(i.values()).sort((a,l)=>{const c=new aP(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),u=new aP(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,u)});for(const a of o)r.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new bW(void 0,r,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const o of e.children.values())if(o.symbol.selectionRange.startLineNumber!==o.symbol.range.endLineNumber)if(o.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(o,o.symbol.selectionRange.startLineNumber));else for(const s of o.children.values())i.push(this._stickyModelFromOutlineElement(s,o.symbol.selectionRange.startLineNumber));i.sort((o,s)=>this._comparator(o.range,s.range));const r=new aP(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new bW(r,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof oce?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};Bce=PK([z4(0,en)],Bce);class hZe extends dZe{constructor(e){super(),this._foldingLimitReporter=new AXe(e)}createStickyModel(e,t,i,r){const o=this._fromFoldingRegions(r);return new uZe(e.uri,t,o,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],r=new bW(void 0,[],void 0);for(let o=0;o<t;o++){const s=e.getParentIndex(o);let a;s!==-1?a=i[s]:a=r;const l=new bW(new aP(e.getStartLineNumber(o),e.getEndLineNumber(o)+1),[],a);a.children.push(l),i.push(l)}return r}}let $ce=class extends hZe{constructor(e,t){super(e),this._languageConfigurationService=t}createModelFromProvider(e,t,i){return new lbe(e,this._languageConfigurationService,this._foldingLimitReporter).compute(i)}};$ce=PK([z4(1,xo)],$ce);let Vce=class extends hZe{constructor(e,t){super(e),this._languageFeaturesService=t}isProviderValid(e){return _b.getFoldingRangeProviders(this._languageFeaturesService,e).length>0}createModelFromProvider(e,t,i){const r=_b.getFoldingRangeProviders(this._languageFeaturesService,e);return new ube(e,r,()=>this.createModelFromProvider(e,t,i),this._foldingLimitReporter,void 0).compute(i)}};Vce=PK([z4(1,en)],Vce);var Zcr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},YNe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},QNe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Jcr{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}let Hce=class extends Ae{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new be),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._options=null,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new nt),this._updateSoon=this._register(new so(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(114)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._stickyModelProvider=null,this._sessionStore.clear(),this._options=this._editor.getOption(114),this._options.enabled&&(this._stickyModelProvider=this._sessionStore.add(new Fce(this._editor,this._languageConfigurationService,this._languageFeaturesService,this._options.defaultModel)),this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this.update())}getVersionId(){var e;return(e=this._model)===null||e===void 0?void 0:e.version}update(){var e;return QNe(this,void 0,void 0,function*(){(e=this._cts)===null||e===void 0||e.dispose(!0),this._cts=new da,yield this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()})}updateStickyModel(e){return QNe(this,void 0,void 0,function*(){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=this._editor.getModel(),i=t.getVersionId(),r=yield this._stickyModelProvider.update(t,i,e);e.isCancellationRequested||(this._model=r)})}updateIndex(e){return e===-1?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,r,o){if(t.children.length===0)return;let s=o;const a=[];for(let u=0;u<t.children.length;u++){const d=t.children[u];d.range&&a.push(d.range.startLineNumber)}const l=this.updateIndex(gM(a,e.startLineNumber,(u,d)=>u-d)),c=this.updateIndex(gM(a,e.startLineNumber+r,(u,d)=>u-d));for(let u=l;u<=c;u++){const d=t.children[u];if(!d)return;if(d.range){const h=d.range.startLineNumber,g=d.range.endLineNumber;e.startLineNumber<=g+1&&h-1<=e.endLineNumber&&h!==s&&(s=h,i.push(new Jcr(h,g-1,r+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,i,r+1,h))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,d,i,r,o)}}getCandidateStickyLinesIntersecting(e){var t,i;if(!(!((t=this._model)===null||t===void 0)&&t.element))return[];let r=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,r,0,-1);const o=(i=this._editor._getViewModel())===null||i===void 0?void 0:i.getHiddenAreas();if(o)for(const s of o)r=r.filter(a=>!(a.startLineNumber>=s.startLineNumber&&a.endLineNumber<=s.endLineNumber+1));return r}};Hce=Zcr([YNe(1,en),YNe(2,xo)],Hce);var eur=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},KT=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},$J=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Wce;let vb=Wce=class extends Ae{constructor(e,t,i,r,o,s,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=r,this._contextKeyService=a,this._sessionStore=new nt,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new Ycr(this._editor),this._stickyLineCandidateProvider=new Hce(this._editor,i,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new jNe([],[],0),this._readConfiguration();const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration(u=>{(u.hasChanged(114)||u.hasChanged(72)||u.hasChanged(66)||u.hasChanged(109))&&this._readConfiguration()})),this._register(We(l,Lt.CONTEXT_MENU,u=>$J(this,void 0,void 0,function*(){this._onContextMenu(u)}))),this._stickyScrollFocusedContextKey=ee.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=ee.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(lb(l));this._register(c.onDidBlur(u=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(c.onDidFocus(u=>{this.focus()})),this._registerMouseListeners(),this._register(We(l,Lt.MOUSE_DOWN,u=>{this._onMouseDown=!0}))}static get(e){return e.getContribution(Wce.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)===null||e===void 0||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new nt,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex<this._stickyScrollWidget.lineNumberCount-1&&this._focusNav(!0)}focusPrevious(){this._focusedStickyElementIndex>0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(q.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new nt),t=this._register(new Zq(this._editor,{extractLineNumberFromMouseEvent:o=>{const s=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);return s?s.lineNumber:0}})),i=o=>{if(!this._editor.hasModel()||o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return null;const s=o.target.element;if(!s||s.innerText!==s.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(s);return a?{range:new q(a.lineNumber,a.column,a.lineNumber,a.column+s.innerText.length),textElement:s}:null},r=this._stickyScrollWidget.getDomNode();this._register(ua(r,Lt.CLICK,o=>{if(o.ctrlKey||o.altKey||o.metaKey||!o.leftButton)return;if(o.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(c===null)return;const u=new Ce(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(u);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(o.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(o.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(o.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);if(c===null)return;l=new Ce(c,1)}this._revealPosition(l)})),this._register(ua(r,Lt.MOUSE_MOVE,o=>{if(o.shiftKey){const s=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(s===null||this._showEndForLine!==null&&this._showEndForLine===s)return;this._showEndForLine=s,this._renderStickyScroll();return}this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(We(r,Lt.MOUSE_LEAVE,o=>{this._showEndForLine!==null&&(this._showEndForLine=null,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([o,s])=>{const a=i(o);if(!a||!o.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:c}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(c.style.textDecoration==="underline")return;const u=new da;e.add(Gn(()=>u.dispose(!0)));let d;rK(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new Ce(l.startLineNumber,l.startColumn+1),u.token).then(h=>{if(!u.token.isCancellationRequested)if(h.length!==0){this._candidateDefinitionsLength=h.length;const g=c;d!==g?(e.clear(),d=g,d.style.textDecoration="underline",e.add(Gn(()=>{d.style.textDecoration="none"}))):d||(d=g,d.style.textDecoration="underline",e.add(Gn(()=>{d.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(o=>$J(this,void 0,void 0,function*(){if(o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return;const s=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);s&&(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:s.lineNumber,column:1})),this._instaService.invokeFunction(HXe,o,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor}))})))}_onContextMenu(e){const t=new og(e);this._contextMenuService.showContextMenu({menuId:J.StickyScrollContext,getAnchor:()=>t})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getStickyLineForLine(e),i=t==null?void 0:t.foldingIcon;if(!i)return;kXe(this._foldingModel,Number.MAX_VALUE,[e]),i.isCollapsed=!i.isCollapsed;const r=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(66)*t.index+1;this._editor.setScrollTop(r),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(114);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(i=>{i.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=null,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(67).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=null,this._renderStickyScroll()}))}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const r of e.ranges)if(i>=r.fromLineNumber&&i<=r.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(-1)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(66);this._maxStickyLines=Math.round(t*.25)}_renderStickyScroll(e=1/0){var t,i;return $J(this,void 0,void 0,function*(){const r=this._editor.getModel();if(!r||r.isTooLargeForTokenization()){this._foldingModel=null,this._stickyScrollWidget.setState(void 0,null,e);return}const o=this._stickyLineCandidateProvider.getVersionId();if(o===void 0||o===r.getVersionId())if(this._foldingModel=(i=yield(t=_b.get(this._editor))===null||t===void 0?void 0:t.getFoldingModel())!==null&&i!==void 0?i:null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(this._widgetState.startLineNumbers.length!==0),!this._focused)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e);else if(this._focusedStickyElementIndex===-1)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const s=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(s)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}})}findScrollWidgetState(){const e=this._editor.getOption(66),t=Math.min(this._maxStickyLines,this._editor.getOption(114).maxLineCount),i=this._editor.getScrollTop();let r=0;const o=[],s=[],a=this._editor.getVisibleRanges();if(a.length!==0){const l=new aP(a[0].startLineNumber,a[a.length-1].endLineNumber),c=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(l);for(const u of c){const d=u.startLineNumber,h=u.endLineNumber,g=u.nestingDepth;if(h-d>0){const p=(g-1)*e,m=g*e,_=this._editor.getBottomForLineNumber(d)-i,v=this._editor.getTopForLineNumber(h)-i,b=this._editor.getBottomForLineNumber(h)-i;if(p>v&&p<=b){o.push(d),s.push(h+1),r=b-m;break}else m>_&&m<=b&&(o.push(d),s.push(h+1));if(o.length===t)break}}}return this._endLineNumbers=s,new jNe(o,s,r,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};vb.ID="store.contrib.stickyScrollController";vb=Wce=eur([KT(1,om),KT(2,en),KT(3,Un),KT(4,xo),KT(5,Fg),KT(6,Yn)],vb);var tur=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class nur extends Cf{constructor(){super({id:"editor.action.toggleStickyScroll",title:{value:E("toggleStickyScroll","Toggle Sticky Scroll"),mnemonicTitle:E({key:"mitoggleStickyScroll",comment:["&& denotes a mnemonic"]},"&&Toggle Sticky Scroll"),original:"Toggle Sticky Scroll"},category:qcr.View,toggled:{condition:Ke.equals("config.editor.stickyScroll.enabled",!0),title:E("stickyScroll","Sticky Scroll"),mnemonicTitle:E({key:"miStickyScroll",comment:["&& denotes a mnemonic"]},"&&Sticky Scroll")},menu:[{id:J.CommandPalette},{id:J.MenubarAppearanceMenu,group:"4_editor",order:3},{id:J.StickyScrollContext}]})}run(e){return tur(this,void 0,void 0,function*(){const t=e.get(Ui),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)})}}const MK=100;class iur extends N_{constructor(){super({id:"editor.action.focusStickyScroll",title:{value:E("focusStickyScroll","Focus Sticky Scroll"),mnemonicTitle:E({key:"mifocusStickyScroll",comment:["&& denotes a mnemonic"]},"&&Focus Sticky Scroll"),original:"Focus Sticky Scroll"},precondition:Ke.and(Ke.has("config.editor.stickyScroll.enabled"),ee.stickyScrollVisible),menu:[{id:J.CommandPalette}]})}runEditorCommand(e,t){var i;(i=vb.get(t))===null||i===void 0||i.focus()}}class rur extends N_{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:{value:E("selectNextStickyScrollLine.title","Select next sticky scroll line"),original:"Select next sticky scroll line"},precondition:ee.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:MK,primary:18}})}runEditorCommand(e,t){var i;(i=vb.get(t))===null||i===void 0||i.focusNext()}}class our extends N_{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:{value:E("selectPreviousStickyScrollLine.title","Select previous sticky scroll line"),original:"Select previous sticky scroll line"},precondition:ee.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:MK,primary:16}})}runEditorCommand(e,t){var i;(i=vb.get(t))===null||i===void 0||i.focusPrevious()}}class sur extends N_{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:{value:E("goToFocusedStickyScrollLine.title","Go to focused sticky scroll line"),original:"Go to focused sticky scroll line"},precondition:ee.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:MK,primary:3}})}runEditorCommand(e,t){var i;(i=vb.get(t))===null||i===void 0||i.goToFocused()}}class aur extends N_{constructor(){super({id:"editor.action.selectEditor",title:{value:E("selectEditor.title","Select Editor"),original:"Select Editor"},precondition:ee.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:MK,primary:9}})}runEditorCommand(e,t){var i;(i=vb.get(t))===null||i===void 0||i.selectEditor()}}gr(vb.ID,vb,1);jo(nur);jo(iur);jo(our);jo(rur);jo(sur);jo(aur);var Tbe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ax=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},lur=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},ZS;class cur{constructor(e,t,i,r,o,s){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=r,this.command=o,this.completion=s}}let zce=class extends WFi{constructor(e,t,i,r,o,s){super(o.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=r,this._suggestMemoryService=s}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn<i.endColumn&&this.completionModel.getIncompleteProvider().size===0}get items(){var e;const t=[],{items:i}=this.completionModel,r=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},i),o=Pi.slice(i,r),s=Pi.slice(i,0,r);let a=5;for(const l of Pi.concat(o,s)){if(l.score===__.Default)continue;const c=new q(l.editStart.lineNumber,l.editStart.column,l.editInsertEnd.lineNumber,l.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),u=l.completion.insertTextRules&&l.completion.insertTextRules&4?{snippet:l.completion.insertText}:l.completion.insertText;t.push(new cur(c,u,(e=l.filterTextLow)!==null&&e!==void 0?e:l.labelLow,l.completion.additionalTextEdits,l.completion.command,l)),a-->=0&&l.resolve(Mi.None)}return t}};zce=Tbe([ax(5,vK)],zce);let jce=class{constructor(e,t,i,r){this._getEditorOption=e,this._languageFeatureService=t,this._clipboardService=i,this._suggestMemoryService=r}provideInlineCompletions(e,t,i,r){var o;return lur(this,void 0,void 0,function*(){if(i.selectedSuggestionInfo)return;const s=this._getEditorOption(88,e);if(iL.isAllOff(s))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(iL.valueFor(s,l)!=="inline")return;let c=e.getWordAtPosition(t),u;if(c!=null&&c.word||(u=this._getTriggerCharacterInfo(e,t)),!(c!=null&&c.word)&&!u||(c||(c=e.getWordUntilPosition(t)),c.endColumn!==t.column))return;let d;const h=e.getValueInRange(new q(t.lineNumber,1,t.lineNumber,t.column));if(!u&&(!((o=this._lastResult)===null||o===void 0)&&o.canBeReused(e,t.lineNumber,c))){const g=new BNe(h,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=g,this._lastResult.acquire(),d=this._lastResult}else{const g=yield fbe(this._languageFeatureService.completionProvider,e,t,new A4(void 0,void 0,u==null?void 0:u.providers),u&&{triggerKind:1,triggerCharacter:u.ch},r);let p;g.needsClipboard&&(p=yield this._clipboardService.readText());const m=new M1(g.items,t.column,new BNe(h,0),Km.None,this._getEditorOption(117,e),this._getEditorOption(111,e),{boostFullMatch:!1,firstMatchCanBeWeak:!1},p);d=new zce(e,t.lineNumber,c,m,g,this._suggestMemoryService)}return this._lastResult=d,d})}handleItemDidShow(e,t){t.completion.resolve(Mi.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var i;const r=e.getValueInRange(q.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),o=new Set;for(const s of this._languageFeatureService.completionProvider.all(e))!((i=s.triggerCharacters)===null||i===void 0)&&i.includes(r)&&o.add(s);if(o.size!==0)return{providers:o,ch:r}}};jce=Tbe([ax(1,en),ax(2,F0),ax(3,vK)],jce);let yW=ZS=class{constructor(e,t,i,r){if(++ZS._counter===1){const o=r.createInstance(jce,(s,a)=>{var l;return((l=i.listCodeEditors().find(u=>u.getModel()===a))!==null&&l!==void 0?l:e).getOption(s)});ZS._disposable=t.inlineCompletionsProvider.register("*",o)}}dispose(){var e;--ZS._counter===0&&((e=ZS._disposable)===null||e===void 0||e.dispose(),ZS._disposable=void 0)}};yW._counter=0;yW=ZS=Tbe([ax(1,en),ax(2,Lr),ax(3,Un)],yW);gr("suggest.inlineCompletionsProvider",yW,0);class uur extends Gt{constructor(){super({id:"editor.action.forceRetokenize",label:E("forceRetokenize","Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const r=new $c;i.tokenization.forceTokenization(i.getLineCount()),r.stop(),console.log(`tokenization took ${r.elapsed()}`)}}ht(uur);class FK extends Cf{constructor(){super({id:FK.ID,title:{value:E({key:"toggle.tabMovesFocus",comment:["Turn on/off use of tab key for moving focus around VS Code"]},"Toggle Tab Key Moves Focus"),original:"Toggle Tab Key Moves Focus"},precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},f1:!0})}run(){const t=!e2.getTabFocusMode();e2.setTabFocusMode(t),Pc(t?E("toggle.tabMovesFocus.on","Pressing Tab will now move focus to the next focusable element"):E("toggle.tabMovesFocus.off","Pressing Tab will now insert the tab character"))}}FK.ID="editor.action.toggleTabFocusMode";jo(FK);var dur=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},hur=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let Uce=class extends Ae{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}constructor(e,t,i={},r){var o;super(),this._link=t,this._enabled=!0,this.el=Ge(e,at("a.monaco-link",{tabIndex:(o=t.tabIndex)!==null&&o!==void 0?o:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const s=this._register(new Wi(this.el,"click")),a=this._register(new Wi(this.el,"keypress")),l=Pt.chain(a.event,d=>d.map(h=>new Oo(h)).filter(h=>h.keyCode===3)),c=this._register(new Wi(this.el,yo.Tap)).event;this._register(bo.addTarget(this.el));const u=Pt.any(s.event,l,c);this._register(u(d=>{this.enabled&&(yi.stop(d,!0),i!=null&&i.opener?i.opener(this._link.href):r.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}};Uce=dur([hur(3,mh)],Uce);var fZe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},gZe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};const fur=26;let qce=class extends Ae{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(Kce))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show(Object.assign(Object.assign({},e),{onClose:()=>{var t;this.hide(),(t=e.onClose)===null||t===void 0||t.call(e)}})),this._editor.setBanner(this.banner.element,fur)}};qce=fZe([gZe(1,Un)],qce);let Kce=class extends Ae{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(w0,{}),this.element=at("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=at("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Gl(this.element)}show(e){Gl(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=Ge(this.element,at("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(at(`div${In.asCSSSelector(e.icon)}`));const r=Ge(this.element,at("div.message-container"));if(r.setAttribute("aria-hidden","true"),r.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=Ge(this.element,at("div.message-actions-container")),e.actions)for(const s of e.actions)this._register(this.instantiationService.createInstance(Uce,this.messageActionsContainer,Object.assign(Object.assign({},s),{tabIndex:-1}),{}));const o=Ge(this.element,at("div.action-container"));this.actionBar=this._register(new Ig(o)),this.actionBar.push(this._register(new Gu("banner.close","Close Banner",In.asClassName(VGe),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};Kce=fZe([gZe(0,Un)],Kce);var Ibe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},YL=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Dc=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const gur=Js("extensions-warning-message",Ct.warning,E("warningIcon","Icon shown with a warning message in the extensions editor."));let A2=class extends Ae{constructor(e,t,i,r){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=o=>{if(o&&o.hasMore){if(this._bannerClosed)return;const s=Math.max(o.ambiguousCharacterCount,o.nonBasicAsciiCharacterCount,o.invisibleCharacterCount);let a;if(o.nonBasicAsciiCharacterCount>=s)a={message:E("unicodeHighlighting.thisDocumentHasManyNonBasicAsciiUnicodeCharacters","This document contains many non-basic ASCII unicode characters"),command:new VA};else if(o.ambiguousCharacterCount>=s)a={message:E("unicodeHighlighting.thisDocumentHasManyAmbiguousUnicodeCharacters","This document contains many ambiguous unicode characters"),command:new aS};else if(o.invisibleCharacterCount>=s)a={message:E("unicodeHighlighting.thisDocumentHasManyInvisibleUnicodeCharacters","This document contains many invisible unicode characters"),command:new $A};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:gur,actions:[{label:a.command.shortLabel,href:`command:${a.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(r.createInstance(qce,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(124),this._register(i.onDidChangeTrust(o=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(o=>{o.hasChanged(124)&&(this._options=e.getOption(124),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=pur(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?new Intl.NumberFormat().resolvedOptions().locale:i==="_vscode"?j5i:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new Gce(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new mur(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};A2.ID="editor.contrib.unicodeHighlighter";A2=Ibe([YL(1,lm),YL(2,BKe),YL(3,Un)],A2);function pur(n,e){return{nonBasicASCII:e.nonBasicASCII===Ih?!n:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Ih?!n:e.includeComments,includeStrings:e.includeStrings===Ih?!n:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let Gce=class extends Ae{constructor(e,t,i,r){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=r,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new so(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const r of t.ranges)i.push({range:r,options:CW.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!D_e(t,e))return null;const i=t.getValueInRange(e.range);return{reason:pZe(i,this._options),inComment:A_e(t,e),inString:R_e(t,e)}}};Gce=Ibe([YL(3,lm)],Gce);class mur extends Ae{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new so(()=>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._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const r of e){const o=Ume.computeUnicodeHighlights(this._model,this._options,r);for(const s of o.ranges)i.ranges.push(s);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||o.hasMore}if(!i.hasMore)for(const r of i.ranges)t.push({range:r,options:CW.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return D_e(t,e)?{reason:pZe(i,this._options),inComment:A_e(t,e),inString:R_e(t,e)}:null}}let Yce=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),r=this._editor.getContribution(A2.ID);if(!r)return[];const o=[],s=new Set;let a=300;for(const l of t){const c=r.getDecorationInfo(l);if(!c)continue;const d=i.getValueInRange(l.range).codePointAt(0),h=VJ(d);let g;switch(c.reason.kind){case 0:{f5(c.reason.confusableWith)?g=E("unicodeHighlight.characterIsAmbiguousASCII","The character {0} could be confused with the ASCII character {1}, which is more common in source code.",h,VJ(c.reason.confusableWith.codePointAt(0))):g=E("unicodeHighlight.characterIsAmbiguous","The character {0} could be confused with the character {1}, which is more common in source code.",h,VJ(c.reason.confusableWith.codePointAt(0)));break}case 1:g=E("unicodeHighlight.characterIsInvisible","The character {0} is invisible.",h);break;case 2:g=E("unicodeHighlight.characterIsNonBasicAscii","The character {0} is not a basic ASCII character.",h);break}if(s.has(g))continue;s.add(g);const p={codePoint:d,reason:c.reason,inComment:c.inComment,inString:c.inString},m=E("unicodeHighlight.adjustSettings","Adjust settings"),_=`command:${X5.ID}?${encodeURIComponent(JSON.stringify(p))}`,v=new hc("",!0).appendMarkdown(g).appendText(" ").appendLink(_,m);o.push(new Xm(this,l.range,[v],!1,a++))}return o}renderHoverParts(e,t){return UQe(e,t,this._editor,this._languageService,this._openerService)}};Yce=Ibe([YL(1,Qo),YL(2,mh)],Yce);function Qce(n){return`U+${n.toString(16).padStart(4,"0")}`}function VJ(n){let e=`\`${Qce(n)}\``;return Xv.isInvisibleCharacter(n)||(e+=` "${`${_ur(n)}`}"`),e}function _ur(n){return n===96?"`` ` ``":"`"+String.fromCodePoint(n)+"`"}function pZe(n,e){return Ume.computeUnicodeHighlightReason(n,e)}class CW{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let r=this.map.get(i);return r||(r=hi.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,r)),r}}CW.instance=new CW;class vur extends Gt{constructor(){super({id:aS.ID,label:E("action.unicodeHighlight.disableHighlightingInComments","Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=E("unicodeHighlight.disableHighlightingInComments.shortLabel","Disable Highlight In Comments")}run(e,t,i){return Dc(this,void 0,void 0,function*(){const r=e==null?void 0:e.get(Ui);r&&this.runAction(r)})}runAction(e){return Dc(this,void 0,void 0,function*(){yield e.updateValue(yd.includeComments,!1,2)})}}class bur extends Gt{constructor(){super({id:aS.ID,label:E("action.unicodeHighlight.disableHighlightingInStrings","Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=E("unicodeHighlight.disableHighlightingInStrings.shortLabel","Disable Highlight In Strings")}run(e,t,i){return Dc(this,void 0,void 0,function*(){const r=e==null?void 0:e.get(Ui);r&&this.runAction(r)})}runAction(e){return Dc(this,void 0,void 0,function*(){yield e.updateValue(yd.includeStrings,!1,2)})}}class aS extends Gt{constructor(){super({id:aS.ID,label:E("action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters","Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=E("unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel","Disable Ambiguous Highlight")}run(e,t,i){return Dc(this,void 0,void 0,function*(){const r=e==null?void 0:e.get(Ui);r&&this.runAction(r)})}runAction(e){return Dc(this,void 0,void 0,function*(){yield e.updateValue(yd.ambiguousCharacters,!1,2)})}}aS.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class $A extends Gt{constructor(){super({id:$A.ID,label:E("action.unicodeHighlight.disableHighlightingOfInvisibleCharacters","Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=E("unicodeHighlight.disableHighlightingOfInvisibleCharacters.shortLabel","Disable Invisible Highlight")}run(e,t,i){return Dc(this,void 0,void 0,function*(){const r=e==null?void 0:e.get(Ui);r&&this.runAction(r)})}runAction(e){return Dc(this,void 0,void 0,function*(){yield e.updateValue(yd.invisibleCharacters,!1,2)})}}$A.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class VA extends Gt{constructor(){super({id:VA.ID,label:E("action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters","Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=E("unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters.shortLabel","Disable Non ASCII Highlight")}run(e,t,i){return Dc(this,void 0,void 0,function*(){const r=e==null?void 0:e.get(Ui);r&&this.runAction(r)})}runAction(e){return Dc(this,void 0,void 0,function*(){yield e.updateValue(yd.nonBasicASCII,!1,2)})}}VA.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class X5 extends Gt{constructor(){super({id:X5.ID,label:E("action.unicodeHighlight.showExcludeOptions","Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}run(e,t,i){return Dc(this,void 0,void 0,function*(){const{codePoint:r,reason:o,inString:s,inComment:a}=i,l=String.fromCodePoint(r),c=e.get(P_),u=e.get(Ui);function d(p){return Xv.isInvisibleCharacter(p)?E("unicodeHighlight.excludeInvisibleCharFromBeingHighlighted","Exclude {0} (invisible character) from being highlighted",Qce(p)):E("unicodeHighlight.excludeCharFromBeingHighlighted","Exclude {0} from being highlighted",`${Qce(p)} "${l}"`)}const h=[];if(o.kind===0)for(const p of o.notAmbiguousInLocales)h.push({label:E("unicodeHighlight.allowCommonCharactersInLanguage",'Allow unicode characters that are more common in the language "{0}".',p),run:()=>Dc(this,void 0,void 0,function*(){Cur(u,[p])})});if(h.push({label:d(r),run:()=>yur(u,[r])}),a){const p=new vur;h.push({label:p.label,run:()=>Dc(this,void 0,void 0,function*(){return p.runAction(u)})})}else if(s){const p=new bur;h.push({label:p.label,run:()=>Dc(this,void 0,void 0,function*(){return p.runAction(u)})})}if(o.kind===0){const p=new aS;h.push({label:p.label,run:()=>Dc(this,void 0,void 0,function*(){return p.runAction(u)})})}else if(o.kind===1){const p=new $A;h.push({label:p.label,run:()=>Dc(this,void 0,void 0,function*(){return p.runAction(u)})})}else if(o.kind===2){const p=new VA;h.push({label:p.label,run:()=>Dc(this,void 0,void 0,function*(){return p.runAction(u)})})}else wur(o);const g=yield c.pick(h,{title:E("unicodeHighlight.configureUnicodeHighlightOptions","Configure Unicode Highlight Options")});g&&(yield g.run())})}}X5.ID="editor.action.unicodeHighlight.showExcludeOptions";function yur(n,e){return Dc(this,void 0,void 0,function*(){const t=n.getValue(yd.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const r of e)i[String.fromCodePoint(r)]=!0;yield n.updateValue(yd.allowedCharacters,i,2)})}function Cur(n,e){var t;return Dc(this,void 0,void 0,function*(){const i=(t=n.inspect(yd.allowedLocales).user)===null||t===void 0?void 0:t.value;let r;typeof i=="object"&&i?r=Object.assign({},i):r={};for(const o of e)r[o]=!0;yield n.updateValue(yd.allowedLocales,r,2)})}function wur(n){throw new Error(`Unexpected value: ${n}`)}ht(aS);ht($A);ht(VA);ht(X5);gr(A2.ID,A2,1);Kk.register(Yce);var Sur=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},XNe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Eur=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const mZe="ignoreUnusualLineTerminators";function xur(n,e,t){n.setModelProperty(e.uri,mZe,t)}function kur(n,e){return n.getModelProperty(e.uri,mZe)}let j4=class extends Ae{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(125),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(125)&&(this._config=this._editor.getOption(125),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(r=>{r.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}_checkForUnusualLineTerminators(){return Eur(this,void 0,void 0,function*(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||kur(this._codeEditorService,e)===!0||this._editor.getOption(90))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=yield this._dialogService.confirm({title:E("unusualLineTerminators.title","Unusual Line Terminators"),message:E("unusualLineTerminators.message","Detected unusual line terminators"),detail:E("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`.",Tg(e.uri)),primaryButton:E({key:"unusualLineTerminators.fix",comment:["&& denotes a mnemonic"]},"&&Remove Unusual Line Terminators"),cancelButton:E("unusualLineTerminators.ignore","Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){xur(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())})}};j4.ID="editor.contrib.unusualLineTerminatorsDetector";j4=Sur([XNe(1,I5),XNe(2,Lr)],j4);gr(j4.ID,j4,1);var Tur=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ZNe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},Xce;const BK=new Ft("hasWordHighlights",!1);function _Ze(n,e,t,i){const r=n.ordered(e);return MUe(r.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,i)).then(void 0,Sa)),Fc)}class vZe{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=za(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new q(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const r=t.startLineNumber,o=t.startColumn,s=t.endColumn,a=this._getCurrentWordRange(e,t);let l=!!(this._wordRange&&this._wordRange.equalsRange(a));for(let c=0,u=i.length;!l&&c<u;c++){const d=i.getRange(c);d&&d.startLineNumber===r&&d.startColumn<=o&&d.endColumn>=s&&(l=!0)}return l}cancel(){this.result.cancel()}}class Iur extends vZe{constructor(e,t,i,r){super(e,t,i),this._providers=r}_compute(e,t,i,r){return _Ze(this._providers,e,t.getPosition(),r).then(o=>o||[])}}class Lur extends vZe{constructor(e,t,i){super(e,t,i),this._selectionIsEmpty=t.isEmpty()}_compute(e,t,i,r){return cw(250,r).then(()=>{if(!t.isEmpty())return[];const o=e.getWordAtPosition(t.getPosition());return!o||o.word.length>1e3?[]:e.findMatches(o.word,!0,!1,!0,i,!1).map(a=>({range:a.range,kind:CM.Text}))})}isValid(e,t,i){const r=t.isEmpty();return this._selectionIsEmpty!==r?!1:super.isValid(e,t,i)}}function Dur(n,e,t,i){return n.has(e)?new Iur(e,t,i,n):new Lur(e,t,i)}Ib("_executeDocumentHighlights",(n,e,t)=>{const i=n.get(en);return _Ze(i.documentHighlightProvider,e,t,Mi.None)});class Aur{constructor(e,t,i,r){this.toUnhook=new nt,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=[],this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.linkedHighlighters=i,this._hasWordHighlights=BK.bindTo(r),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(80),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(o=>{this._ignorePositionChangeEvent||this.occurrencesHighlight&&this._onPositionChanged(o)})),this.toUnhook.add(e.onDidChangeModelContent(o=>{this._stopAll()})),this.toUnhook.add(e.onDidChangeConfiguration(o=>{const s=this.editor.getOption(80);this.occurrencesHighlight!==s&&(this.occurrencesHighlight=s,this._stopAll())})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight&&this._run()}_getSortedHighlights(){return this.decorations.getRanges().sort(q.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,r=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(r.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(r);const o=this._getWord();if(o){const s=this.editor.getModel().getLineContent(r.startLineNumber);Pc(`${s}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,r=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(r.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(r);const o=this._getWord();if(o){const s=this.editor.getModel().getLineContent(r.startLineNumber);Pc(`${s}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeDecorations(){this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1))}_stopAll(){this._removeDecorations(),this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(!this.occurrencesHighlight){this._stopAll();return}if(e.reason!==3){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.getWordAtPosition({lineNumber:t,column:i})}_run(){const e=this.editor.getSelection();if(e.startLineNumber!==e.endLineNumber){this._stopAll();return}const t=e.startColumn,i=e.endColumn,r=this._getWord();if(!r||r.startColumn>t||r.endColumn<i){this._stopAll();return}const o=this.workerRequest&&this.workerRequest.isValid(this.model,e,this.decorations);if(this.lastCursorPositionChangeTime=new Date().getTime(),o)this.workerRequestCompleted&&this.renderDecorationsTimer!==-1&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1,this._beginRenderDecorations());else{this._stopAll();const s=++this.workerRequestTokenId;this.workerRequestCompleted=!1,this.workerRequest=Dur(this.providers,this.model,this.editor.getSelection(),this.editor.getOption(129)),this.workerRequest.result.then(a=>{s===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=a||[],this._beginRenderDecorations())},fi)}}_beginRenderDecorations(){const 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;const e=[];for(const t of this.workerRequestValue)t.range&&e.push({range:t.range,options:ncr(t.kind)});this.decorations.set(e),this._hasWordHighlights.set(this.hasDecorations());for(const t of this.linkedHighlighters())(t==null?void 0:t.editor.getModel())===this.editor.getModel()&&(t._stopAll(),t.decorations.set(e),t._hasWordHighlights.set(t.hasDecorations()))}dispose(){this._stopAll(),this.toUnhook.dispose()}}let ak=Xce=class extends Ae{static get(e){return e.getContribution(Xce.ID)}constructor(e,t,i){super(),this.wordHighlighter=null,this.linkedContributions=new Set;const r=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this.wordHighlighter=new Aur(e,i.documentHighlightProvider,()=>Pi.map(this.linkedContributions,o=>o.wordHighlighter),t))};this._register(e.onDidChangeModel(o=>{this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),r()})),r()}saveViewState(){return!!(this.wordHighlighter&&this.wordHighlighter.hasDecorations())}moveNext(){var e;(e=this.wordHighlighter)===null||e===void 0||e.moveNext()}moveBack(){var e;(e=this.wordHighlighter)===null||e===void 0||e.moveBack()}restoreViewState(e){this.wordHighlighter&&e&&this.wordHighlighter.restore()}dispose(){this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),super.dispose()}};ak.ID="editor.contrib.wordHighlighter";ak=Xce=Tur([ZNe(1,Yn),ZNe(2,en)],ak);class bZe extends Gt{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=ak.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class Rur extends bZe{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:E("wordHighlight.next.label","Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:BK,kbOpts:{kbExpr:ee.editorTextFocus,primary:65,weight:100}})}}class Nur extends bZe{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:E("wordHighlight.previous.label","Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:BK,kbOpts:{kbExpr:ee.editorTextFocus,primary:1089,weight:100}})}}class Our extends Gt{constructor(){super({id:"editor.action.wordHighlight.trigger",label:E("wordHighlight.trigger.label","Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:BK.toNegated(),kbOpts:{kbExpr:ee.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const r=ak.get(t);r&&r.restoreViewState(!0)}}gr(ak.ID,ak,0);ht(Rur);ht(Nur);ht(Our);class $K extends kl{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const r=xg(t.getOption(129)),o=t.getModel(),a=t.getSelections().map(l=>{const c=new Ce(l.positionLineNumber,l.positionColumn),u=this._move(r,o,c,this._wordNavigationType);return this._moveTo(l,u,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,a.map(l=>lr.fromModelSelection(l))),a.length===1){const l=new Ce(a[0].positionLineNumber,a[0].positionColumn);t.revealPosition(l,0)}}_moveTo(e,t,i){return i?new ln(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new ln(t.lineNumber,t.column,t.lineNumber,t.column)}}class lS extends $K{_move(e,t,i,r){return Tr.moveWordLeft(e,t,i,r)}}class cS extends $K{_move(e,t,i,r){return Tr.moveWordRight(e,t,i,r)}}class Pur extends lS{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class Mur extends lS{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class Fur extends lS{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:Ke.and(ee.textInputFocus,(e=Ke.and(b5,Tq))===null||e===void 0?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class Bur extends lS{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class $ur extends lS{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class Vur extends lS{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:Ke.and(ee.textInputFocus,(e=Ke.and(b5,Tq))===null||e===void 0?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class Hur extends lS{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,r){return super._move(xg(A_.wordSeparators.defaultValue),t,i,r)}}class Wur extends lS{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,r){return super._move(xg(A_.wordSeparators.defaultValue),t,i,r)}}class zur extends cS{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class jur extends cS{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:Ke.and(ee.textInputFocus,(e=Ke.and(b5,Tq))===null||e===void 0?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class Uur extends cS{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class qur extends cS{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class Kur extends cS{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:Ke.and(ee.textInputFocus,(e=Ke.and(b5,Tq))===null||e===void 0?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class Gur extends cS{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class Yur extends cS{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,r){return super._move(xg(A_.wordSeparators.defaultValue),t,i,r)}}class Qur extends cS{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,r){return super._move(xg(A_.wordSeparators.defaultValue),t,i,r)}}class VK extends kl{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const r=e.get(xo);if(!t.hasModel())return;const o=xg(t.getOption(129)),s=t.getModel(),a=t.getSelections(),l=t.getOption(6),c=t.getOption(11),u=r.getLanguageConfiguration(s.getLanguageId()).getAutoClosingPairs(),d=t._getViewModel(),h=a.map(g=>{const p=this._delete({wordSeparators:o,model:s,selection:g,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:u,autoClosedCharacters:d.getCursorAutoClosedCharacters()},this._wordNavigationType);return new oc(p,"")});t.pushUndoStop(),t.executeCommands(this.id,h),t.pushUndoStop()}}class Lbe extends VK{_delete(e,t){const i=Tr.deleteWordLeft(e,t);return i||new q(1,1,1,1)}}class Dbe extends VK{_delete(e,t){const i=Tr.deleteWordRight(e,t);if(i)return i;const r=e.model.getLineCount(),o=e.model.getLineMaxColumn(r);return new q(r,o,r,o)}}class Xur extends Lbe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:ee.writable})}}class Zur extends Lbe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:ee.writable})}}class Jur extends Lbe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:ee.writable,kbOpts:{kbExpr:ee.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class edr extends Dbe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:ee.writable})}}class tdr extends Dbe{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:ee.writable})}}class ndr extends Dbe{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:ee.writable,kbOpts:{kbExpr:ee.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class idr extends Gt{constructor(){super({id:"deleteInsideWord",precondition:ee.writable,label:E("deleteInsideWord","Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const r=xg(t.getOption(129)),o=t.getModel(),a=t.getSelections().map(l=>{const c=Tr.deleteInsideWord(r,o,l);return new oc(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}Et(new Pur);Et(new Mur);Et(new Fur);Et(new Bur);Et(new $ur);Et(new Vur);Et(new zur);Et(new jur);Et(new Uur);Et(new qur);Et(new Kur);Et(new Gur);Et(new Hur);Et(new Wur);Et(new Yur);Et(new Qur);Et(new Xur);Et(new Zur);Et(new Jur);Et(new edr);Et(new tdr);Et(new ndr);ht(idr);class rdr extends VK{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:ee.writable,kbOpts:{kbExpr:ee.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=aq.deleteWordPartLeft(e);return i||new q(1,1,1,1)}}class odr extends VK{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:ee.writable,kbOpts:{kbExpr:ee.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=aq.deleteWordPartRight(e);if(i)return i;const r=e.model.getLineCount(),o=e.model.getLineMaxColumn(r);return new q(r,o,r,o)}}class yZe extends $K{_move(e,t,i,r){return aq.moveWordPartLeft(e,t,i)}}class sdr extends yZe{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:ee.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}Xi.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class adr extends yZe{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:ee.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}Xi.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class CZe extends $K{_move(e,t,i,r){return aq.moveWordPartRight(e,t,i)}}class ldr extends CZe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:ee.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class cdr extends CZe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:ee.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}Et(new rdr);Et(new odr);Et(new sdr);Et(new adr);Et(new ldr);Et(new cdr);class Zce extends Ae{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=oh.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(91);t||(this.editor.isSimpleWidget?t=new hc(E("editor.simple.readonly","Cannot edit in read-only input")):t=new hc(E("editor.readonly","Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}Zce.ID="editor.contrib.readOnlyMessageController";gr(Zce.ID,Zce,2);class Jce extends Ae{constructor(e){super(),this.editor=e,this.widget=null,C_&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(90);!this.widget&&e?this.widget=new HK(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}Jce.ID="editor.contrib.iPadShowKeyboard";class HK extends Ae{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(We(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(We(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return HK.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}HK.ID="editor.contrib.ShowKeyboardWidget";gr(Jce.ID,Jce,3);var udr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},JNe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},eue;let R2=eue=class extends Ae{static get(e){return e.getContribution(eue.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(r=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(r=>this.stop())),this._register(ps.onDidChange(r=>this.stop())),this._register(this._editor.onKeyUp(r=>r.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new WK(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};R2.ID="editor.contrib.inspectTokens";R2=eue=udr([JNe(1,Ef),JNe(2,Qo)],R2);class ddr extends Gt{constructor(){super({id:"editor.action.inspectTokens",label:Xse.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=R2.get(t);i==null||i.launch()}}function hdr(n){let e="";for(let t=0,i=n.length;t<i;t++){const r=n.charCodeAt(t);switch(r){case 9:e+="→";break;case 32:e+="·";break;default:e+=String.fromCharCode(r)}}return e}function fdr(n,e){const t=ps.get(e);if(t)return t;const i=n.encodeLanguageId(e);return{getInitialState:()=>JD,tokenize:(r,o,s)=>Xme(e,s),tokenizeEncoded:(r,o,s)=>eq(i,s)}}class WK extends Ae{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=fdr(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return WK._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){i=l;break}}let r=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){r=l;break}const o=this._model.getLineContent(e.lineNumber);let s="";if(i<t.tokens1.length){const l=t.tokens1[i].offset,c=i+1<t.tokens1.length?t.tokens1[i+1].offset:o.length;s=o.substring(l,c)}Yl(this._domNode,at("h2.tm-token",void 0,hdr(s),at("span.tm-token-length",void 0,`${s.length} ${s.length===1?"char":"chars"}`))),Ge(this._domNode,at("hr.tokens-inspect-separator",{style:"clear:both"}));const a=(r<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(r<<1)+1]):null;Ge(this._domNode,at("table.tm-metadata-table",void 0,at("tbody",void 0,at("tr",void 0,at("td.tm-metadata-key",void 0,"language"),at("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),at("tr",void 0,at("td.tm-metadata-key",void 0,"token type"),at("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),at("tr",void 0,at("td.tm-metadata-key",void 0,"font style"),at("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),at("tr",void 0,at("td.tm-metadata-key",void 0,"foreground"),at("td.tm-metadata-value",void 0,`${a?De.Format.CSS.formatHex(a.foreground):"-?-"}`)),at("tr",void 0,at("td.tm-metadata-key",void 0,"background"),at("td.tm-metadata-value",void 0,`${a?De.Format.CSS.formatHex(a.background):"-?-"}`))))),Ge(this._domNode,at("hr.tokens-inspect-separator")),i<t.tokens1.length&&Ge(this._domNode,at("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=ps.getColorMap(),i=dc.getLanguageId(e),r=dc.getTokenType(e),o=dc.getFontStyle(e),s=dc.getForeground(e),a=dc.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:r,fontStyle:o,foreground:t[s],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),e&8&&(t+="strikethrough "),t.length===0&&(t="---"),t}_getTokensAtLine(e){const t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),r=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:r.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}}WK._ID="editor.contrib.inspectTokensWidget";gr(R2.ID,R2,4);ht(ddr);var gdr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},eOe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},qN;let wW=qN=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=ds.as(Vk.Quickaccess)}provide(e){const t=new nt;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const r=this.registry.getQuickAccessProvider(i.substr(qN.PREFIX.length));r&&r.prefix&&r.prefix!==qN.PREFIX&&this.quickInputService.quickAccess.show(r.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==qN.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,r=i||"…";return{prefix:i,label:r,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:E("helpPickAriaLabel","{0}, {1}",r,t.description),description:t.description}})}};wW.PREFIX="?";wW=qN=gdr([eOe(0,P_),eOe(1,mo)],wW);ds.as(Vk.Quickaccess).registerQuickAccessProvider({ctor:wW,prefix:"",helpEntries:[{description:Zse.helpQuickAccessActionLabel}]});class wZe{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var i;const r=new nt;e.canAcceptInBackground=!!(!((i=this.options)===null||i===void 0)&&i.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=r.add(new Zl);return o.value=this.doProvide(e,t),r.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),r}doProvide(e,t){var i;const r=new nt,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const s={editor:o},a=gYe(o);if(a){let l=(i=o.saveViewState())!==null&&i!==void 0?i:void 0;r.add(a.onDidChangeCursorPosition(()=>{var c;l=(c=o.saveViewState())!==null&&c!==void 0?c:void 0})),s.restoreViewState=()=>{l&&o===this.activeTextEditorControl&&o.restoreViewState(l)},r.add(sw(t.onCancellationRequested)(()=>{var c;return(c=s.restoreViewState)===null||c===void 0?void 0:c.call(s)}))}r.add(Gn(()=>this.clearDecorations(o))),r.add(this.provideWithTextEditor(s,e,t))}else r.add(this.provideWithoutTextEditor(e,t));return r}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&fw(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return fYe(e)?(t=e.getModel())===null||t===void 0?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const r=[];this.rangeHighlightDecorationId&&(r.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),r.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:ms(Nqe),position:ff.Full}}}],[s,a]=i.deltaDecorations(r,o);this.rangeHighlightDecorationId={rangeHighlightId:s,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}class zK extends wZe{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=E("cannotRunGotoLine","Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,Ae.None}provideWithTextEditor(e,t,i){const r=e.editor,o=new nt;o.add(t.onDidAccept(l=>{const[c]=t.selectedItems;if(c){if(!this.isValidLineNumber(r,c.lineNumber))return;this.gotoLocation(e,{range:this.toRange(c.lineNumber,c.column),keyMods:t.keyMods,preserveFocus:l.inBackground}),l.inBackground||t.hide()}}));const s=()=>{const l=this.parsePosition(r,t.value.trim().substr(zK.PREFIX.length)),c=this.getPickLabel(r,l.lineNumber,l.column);if(t.items=[{lineNumber:l.lineNumber,column:l.column,label:c}],t.ariaLabel=c,!this.isValidLineNumber(r,l.lineNumber)){this.clearDecorations(r);return}const u=this.toRange(l.lineNumber,l.column);r.revealRangeInCenter(u,0),this.addDecorations(r,u)};s(),o.add(t.onDidChangeValue(()=>s()));const a=gYe(r);return a&&a.getOptions().get(67).renderType===2&&(a.updateOptions({lineNumbers:"on"}),o.add(Gn(()=>a.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map(o=>parseInt(o,10)).filter(o=>!isNaN(o)),r=this.lineCount(e)+1;return{lineNumber:i[0]>0?i[0]:r+i[0],column:i[1]}}getPickLabel(e,t,i){if(this.isValidLineNumber(e,t))return this.isValidColumn(e,t,i)?E("gotoLineColumnLabel","Go to line {0} and character {1}.",t,i):E("gotoLineLabel","Go to line {0}.",t);const r=e.getPosition()||{lineNumber:1,column:1},o=this.lineCount(e);return o>1?E("gotoLineLabelEmptyWithLimit","Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",r.lineNumber,r.column,o):E("gotoLineLabelEmpty","Current Line: {0}, Character: {1}. Type a line number to navigate to.",r.lineNumber,r.column)}isValidLineNumber(e,t){return!t||typeof t!="number"?!1:t>0&&t<=this.lineCount(e)}isValidColumn(e,t,i){if(!i||typeof i!="number")return!1;const r=this.getModel(e);if(!r)return!1;const o={lineNumber:t,column:i};return r.validatePosition(o).equals(o)}lineCount(e){var t,i;return(i=(t=this.getModel(e))===null||t===void 0?void 0:t.getLineCount())!==null&&i!==void 0?i:0}}zK.PREFIX=":";var pdr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},mdr=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let U4=class extends zK{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=Pt.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};U4=pdr([mdr(0,Lr)],U4);let Abe=class SZe extends Gt{constructor(){super({id:SZe.ID,label:mH.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:ee.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(P_).quickAccess.show(U4.PREFIX)}};Abe.ID="editor.action.gotoLine";ht(Abe);ds.as(Vk.Quickaccess).registerQuickAccessProvider({ctor:U4,prefix:U4.PREFIX,helpEntries:[{description:mH.gotoLineActionLabel,commandId:Abe.ID}]});const EZe=[void 0,[]];function HJ(n,e,t=0,i=0){const r=e;return r.values&&r.values.length>1?_dr(n,r.values,t,i):xZe(n,e,t,i)}function _dr(n,e,t,i){let r=0;const o=[];for(const s of e){const[a,l]=xZe(n,s,t,i);if(typeof a!="number")return EZe;r+=a,o.push(...l)}return[r,vdr(o)]}function xZe(n,e,t,i){const r=$x(e.original,e.originalLowercase,t,n,n.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return r?[r[0],D5(r)]:EZe}function vdr(n){const e=n.sort((r,o)=>r.start-o.start),t=[];let i;for(const r of e)!i||!bdr(i,r)?(i=r,t.push(r)):(i.start=Math.min(i.start,r.start),i.end=Math.max(i.end,r.end));return t}function bdr(n,e){return!(n.end<e.start||e.end<n.start)}function tOe(n){return n.startsWith('"')&&n.endsWith('"')}const kZe=" ";function tue(n){typeof n!="string"&&(n="");const e=n.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:r}=nOe(n),o=t.indexOf(f_)>=0,s=tOe(n);let a;const l=n.split(kZe);if(l.length>1)for(const c of l){const u=tOe(c),{pathNormalized:d,normalized:h,normalizedLowercase:g}=nOe(c);h&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:d,normalized:h,normalizedLowercase:g,expectContiguousMatch:u}))}return{original:n,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:r,values:a,containsPathSeparator:o,expectContiguousMatch:s}}function nOe(n){let e;vc?e=n.replace(/\//g,f_):e=n.replace(/\\/g,f_);const t=I6i(e).replace(/\s|"/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function iOe(n){return Array.isArray(n)?tue(n.map(e=>e.original).join(kZe)):tue(n.original)}var ydr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},rOe=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},cN=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},QL;let Jv=QL=class extends wZe{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,E("cannotRunGotoSymbolWithoutEditor","To go to a symbol, first open a text editor with symbol information.")),Ae.None}provideWithTextEditor(e,t,i){const r=e.editor,o=this.getModel(r);return o?this._languageFeaturesService.documentSymbolProvider.has(o)?this.doProvideWithEditorSymbols(e,o,t,i):this.doProvideWithoutEditorSymbols(e,o,t,i):Ae.None}doProvideWithoutEditorSymbols(e,t,i,r){const o=new nt;return this.provideLabelPick(i,E("cannotRunGotoSymbolWithoutSymbolProvider","The active text editor does not provide symbol information.")),cN(this,void 0,void 0,function*(){!(yield this.waitForLanguageSymbolRegistry(t,o))||r.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,i,r))}),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}waitForLanguageSymbolRegistry(e,t){return cN(this,void 0,void 0,function*(){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new UU,r=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(r.dispose(),i.complete(!0))}));return t.add(Gn(()=>i.complete(!1))),i.p})}doProvideWithEditorSymbols(e,t,i,r){var o;const s=e.editor,a=new nt;a.add(i.onDidAccept(d=>{const[h]=i.selectedItems;h&&h.range&&(this.gotoLocation(e,{range:h.range.selection,keyMods:i.keyMods,preserveFocus:d.inBackground}),d.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:d})=>{d&&d.range&&(this.gotoLocation(e,{range:d.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,r);let c;const u=d=>cN(this,void 0,void 0,function*(){c==null||c.dispose(!0),i.busy=!1,c=new da(r),i.busy=!0;try{const h=tue(i.value.substr(QL.PREFIX.length).trim()),g=yield this.doGetSymbolPicks(l,h,void 0,c.token);if(r.isCancellationRequested)return;if(g.length>0){if(i.items=g,d&&h.original.length===0){const p=HV(g,m=>!!(m.type!=="separator"&&m.range&&q.containsPosition(m.range.decoration,d)));p&&(i.activeItems=[p])}}else h.original.length>0?this.provideLabelPick(i,E("noMatchingSymbolResults","No matching editor symbols")):this.provideLabelPick(i,E("noSymbolResults","No editor symbols"))}finally{r.isCancellationRequested||(i.busy=!1)}});return a.add(i.onDidChangeValue(()=>u(void 0))),u((o=s.getSelection())===null||o===void 0?void 0:o.getPosition()),a.add(i.onDidChangeActive(()=>{const[d]=i.activeItems;d&&d.range&&(s.revealRangeInCenter(d.range.selection,0),this.addDecorations(s,d.range.decoration))})),a}doGetSymbolPicks(e,t,i,r){var o,s;return cN(this,void 0,void 0,function*(){const a=yield e;if(r.isCancellationRequested)return[];const l=t.original.indexOf(QL.SCOPE_PREFIX)===0,c=l?1:0;let u,d;t.values&&t.values.length>1?(u=iOe(t.values[0]),d=iOe(t.values.slice(1))):u=t;let h;const g=(s=(o=this.options)===null||o===void 0?void 0:o.openSideBySideDirection)===null||s===void 0?void 0:s.call(o);g&&(h=[{iconClass:g==="right"?In.asClassName(Ct.splitHorizontal):In.asClassName(Ct.splitVertical),tooltip:g==="right"?E("openToSide","Open to the Side"):E("openToBottom","Open to the Bottom")}]);const p=[];for(let v=0;v<a.length;v++){const b=a[v],y=k6i(b.name),C=`$(${TV.toIcon(b.kind).id}) ${y}`,x=C.length-y.length;let k=b.containerName;i!=null&&i.extraContainerLabel&&(k?k=`${i.extraContainerLabel} • ${k}`:k=i.extraContainerLabel);let I,L,D,R;if(t.original.length>c){let M=!1;if(u!==t&&([I,L]=HJ(C,Object.assign(Object.assign({},t),{values:void 0}),c,x),typeof I=="number"&&(M=!0)),typeof I!="number"&&([I,L]=HJ(C,u,c,x),typeof I!="number"))continue;if(!M&&d){if(k&&d.original.length>0&&([D,R]=HJ(k,d)),typeof D!="number")continue;typeof I=="number"&&(I+=D)}}const P=b.tags&&b.tags.indexOf(1)>=0;p.push({index:v,kind:b.kind,score:I,label:C,ariaLabel:w6i(b.name,b.kind),description:k,highlights:P?void 0:{label:L,description:R},range:{selection:q.collapseToStart(b.selectionRange),decoration:b.range},strikethrough:P,buttons:h})}const m=p.sort((v,b)=>l?this.compareByKindAndScore(v,b):this.compareByScore(v,b));let _=[];if(l){let C=function(){b&&typeof v=="number"&&y>0&&(b.label=Dx(zJ[v]||WJ,y))},v,b,y=0;for(const x of m)v!==x.kind?(C(),v=x.kind,y=1,b={type:"separator"},_.push(b)):y++,_.push(x);C()}else m.length>0&&(_=[{label:E("symbols","symbols ({0})",p.length),type:"separator"},...m]);return _})}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const i=zJ[e.kind]||WJ,r=zJ[t.kind]||WJ,o=i.localeCompare(r);return o===0?this.compareByScore(e,t):o}getDocumentSymbols(e,t){return cN(this,void 0,void 0,function*(){const i=yield this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()})}};Jv.PREFIX="@";Jv.SCOPE_PREFIX=":";Jv.PREFIX_BY_CATEGORY=`${QL.PREFIX}${QL.SCOPE_PREFIX}`;Jv=QL=ydr([rOe(0,en),rOe(1,pK)],Jv);const WJ=E("property","properties ({0})"),zJ={5:E("method","methods ({0})"),11:E("function","functions ({0})"),8:E("_constructor","constructors ({0})"),12:E("variable","variables ({0})"),4:E("class","classes ({0})"),22:E("struct","structs ({0})"),23:E("event","events ({0})"),24:E("operator","operators ({0})"),10:E("interface","interfaces ({0})"),2:E("namespace","namespaces ({0})"),3:E("package","packages ({0})"),25:E("typeParameter","type parameters ({0})"),1:E("modules","modules ({0})"),6:E("property","properties ({0})"),9:E("enum","enumerations ({0})"),21:E("enumMember","enumeration members ({0})"),14:E("string","strings ({0})"),0:E("file","files ({0})"),17:E("array","arrays ({0})"),15:E("number","numbers ({0})"),16:E("boolean","booleans ({0})"),18:E("object","objects ({0})"),19:E("key","keys ({0})"),7:E("field","fields ({0})"),13:E("constant","constants ({0})")};var Cdr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},jJ=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let nue=class extends Jv{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=Pt.None}get activeTextEditorControl(){var e;return(e=this.editorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}};nue=Cdr([jJ(0,Lr),jJ(1,en),jJ(2,pK)],nue);class Z5 extends Gt{constructor(){super({id:Z5.ID,label:t4.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:ee.hasDocumentSymbolProvider,kbOpts:{kbExpr:ee.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(P_).quickAccess.show(Jv.PREFIX,{itemActivation:Mm.NONE})}}Z5.ID="editor.action.quickOutline";ht(Z5);ds.as(Vk.Quickaccess).registerQuickAccessProvider({ctor:nue,prefix:Jv.PREFIX,helpEntries:[{description:t4.quickOutlineActionLabel,prefix:Jv.PREFIX,commandId:Z5.ID},{description:t4.quickOutlineByCategoryActionLabel,prefix:Jv.PREFIX_BY_CATEGORY}]});function UJ(n,e){return e&&(n.stack||n.stacktrace)?E("stackTrace.format","{0}: {1}",sOe(n),oOe(n.stack)||oOe(n.stacktrace)):sOe(n)}function oOe(n){return Array.isArray(n)?n.join(`
`):n}function sOe(n){return n.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${n.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof n.code=="string"&&typeof n.errno=="number"&&typeof n.syscall=="string"?E("nodeExceptionMessage","A system error occurred ({0})",n.message):n.message||E("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function TZe(n=null,e=!1){if(!n)return E("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(n)){const t=ob(n),i=TZe(t[0],e);return t.length>1?E("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(Ku(n))return n;if(n.detail){const t=n.detail;if(t.error)return UJ(t.error,e);if(t.exception)return UJ(t.exception,e)}return n.stack?UJ(n,e):n.message?n.message:E("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function wdr(n){var e;const t=new Map;for(const i of n)t.set(i,((e=t.get(i))!==null&&e!==void 0?e:0)+1);return t}class cP{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),r=new Map,o=[];for(const[s,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,i,r);c>0&&o.push({key:s,score:c})}}return o}static termFrequencies(e){return wdr(cP.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(i);const r=i.split(new RegExp("(?<=[a-z])(?=[A-Z])","g"));if(r.length>1)for(const o of r)o.length>2&&/\p{Letter}{3,}/gu.test(o)&&(yield t(o))}}updateDocuments(e){var t;for(const{key:i}of e)this.deleteDocument(i);for(const i of e){const r=[];for(const o of i.textChunks){const s=cP.termFrequencies(o);for(const a of s.keys())this.chunkOccurrences.set(a,((t=this.chunkOccurrences.get(a))!==null&&t!==void 0?t:0)+1);r.push({text:o,tf:s})}this.chunkCount+=r.length,this.documents.set(i.key,{chunks:r})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const r of i.tf.keys()){const o=this.chunkOccurrences.get(r);if(typeof o=="number"){const s=o-1;s<=0?this.chunkOccurrences.delete(r):this.chunkOccurrences.set(r,s)}}}}computeSimilarityScore(e,t,i){let r=0;for(const[o,s]of Object.entries(t)){const a=e.tf.get(o);if(!a)continue;let l=i.get(o);typeof l!="number"&&(l=this.computeIdf(o),i.set(o,l));const c=a*l;r+=c*s}return r}computeEmbedding(e){const t=cP.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){var t;const i=(t=this.chunkOccurrences.get(e))!==null&&t!==void 0?t:0;return i>0?Math.log((this.chunkCount+1)/i):0}computeTfidf(e){const t=Object.create(null);for(const[i,r]of e){const o=this.computeIdf(i);o>0&&(t[i]=r*o)}return t}}function Sdr(n){var e,t;const i=n.slice(0);i.sort((o,s)=>s.score-o.score);const r=(t=(e=i[0])===null||e===void 0?void 0:e.score)!==null&&t!==void 0?t:0;if(r>0)for(const o of i)o.score/=r;return i}var uN=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},rL;(function(n){n[n.NO_ACTION=0]="NO_ACTION",n[n.CLOSE_PICKER=1]="CLOSE_PICKER",n[n.REFRESH_PICKER=2]="REFRESH_PICKER",n[n.REMOVE_ITEM=3]="REMOVE_ITEM"})(rL||(rL={}));function qJ(n){const e=n;return Array.isArray(e.items)}function aOe(n){const e=n;return!!e.picks&&e.additionalPicks instanceof Promise}class Edr extends Ae{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var r;const o=new nt;e.canAcceptInBackground=!!(!((r=this.options)===null||r===void 0)&&r.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let s;const a=o.add(new Zl),l=()=>uN(this,void 0,void 0,function*(){const c=a.value=new nt;s==null||s.dispose(!0),e.busy=!1,s=new da(t);const u=s.token,d=e.value.substr(this.prefix.length).trim(),h=this._getPicks(d,c,u,i),g=(m,_)=>{var v;let b,y;if(qJ(m)?(b=m.items,y=m.active):b=m,b.length===0){if(_)return!1;(d.length>0||e.hideInput)&&(!((v=this.options)===null||v===void 0)&&v.noResultsPick)&&(_M(this.options.noResultsPick)?b=[this.options.noResultsPick(d)]:b=[this.options.noResultsPick])}return e.items=b,y&&(e.activeItems=[y]),!0},p=m=>uN(this,void 0,void 0,function*(){let _=!1,v=!1;yield Promise.all([(()=>uN(this,void 0,void 0,function*(){typeof m.mergeDelay=="number"&&(yield cw(m.mergeDelay),u.isCancellationRequested)||v||(_=g(m.picks,!0))}))(),(()=>uN(this,void 0,void 0,function*(){e.busy=!0;try{const b=yield m.additionalPicks;if(u.isCancellationRequested)return;let y,C;qJ(m.picks)?(y=m.picks.items,C=m.picks.active):y=m.picks;let x,k;if(qJ(b)?(x=b.items,k=b.active):x=b,x.length>0||!_){let I;if(!C&&!k){const L=e.activeItems[0];L&&y.indexOf(L)!==-1&&(I=L)}g({items:[...y,...x],active:C||k||I})}}finally{u.isCancellationRequested||(e.busy=!1),v=!0}}))()])});if(h!==null)if(aOe(h))yield p(h);else if(!(h instanceof Promise))g(h);else{e.busy=!0;try{const m=yield h;if(u.isCancellationRequested)return;aOe(m)?yield p(m):g(m)}finally{u.isCancellationRequested||(e.busy=!1)}}});return o.add(e.onDidChangeValue(()=>l())),l(),o.add(e.onDidAccept(c=>{const[u]=e.selectedItems;typeof(u==null?void 0:u.accept)=="function"&&(c.inBackground||e.hide(),u.accept(e.keyMods,c))})),o.add(e.onDidTriggerItemButton(({button:c,item:u})=>uN(this,void 0,void 0,function*(){var d,h;if(typeof u.trigger=="function"){const g=(h=(d=u.buttons)===null||d===void 0?void 0:d.indexOf(c))!==null&&h!==void 0?h:-1;if(g>=0){const p=u.trigger(g,e.keyMods),m=typeof p=="number"?p:yield p;if(t.isCancellationRequested)return;switch(m){case rL.NO_ACTION:break;case rL.CLOSE_PICKER:e.hide();break;case rL.REFRESH_PICKER:l();break;case rL.REMOVE_ITEM:{const _=e.items.indexOf(u);if(_!==-1){const v=e.items.slice(),b=v.splice(_,1),y=e.activeItems.filter(x=>x!==b[0]),C=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=v,y&&(e.activeItems=y),e.keepScrollPosition=C}break}}}}}))),o}}var IZe=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},gE=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},KJ=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},JS,Ya;let lk=JS=class extends Edr{constructor(e,t,i,r,o,s){super(JS.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=r,this.telemetryService=o,this.dialogService=s,this.commandsHistory=this._register(this.instantiationService.createInstance(ck)),this.options=e}_getPicks(e,t,i,r){var o,s,a,l;return KJ(this,void 0,void 0,function*(){const c=yield this.getCommandPicks(i);if(i.isCancellationRequested)return[];const u=sw(()=>{const v=new cP;v.updateDocuments(c.map(y=>({key:y.commandId,textChunks:[y.label+(y.commandAlias?` ${y.commandAlias}`:"")]})));const b=v.calculateScores(e,i);return Sdr(b).filter(y=>y.score>JS.TFIDF_THRESHOLD).slice(0,JS.TFIDF_MAX_RESULTS)}),d=[];for(const v of c){const b=(o=JS.WORD_FILTER(e,v.label))!==null&&o!==void 0?o:void 0,y=v.commandAlias&&(s=JS.WORD_FILTER(e,v.commandAlias))!==null&&s!==void 0?s:void 0;if(b||y)v.highlights={label:b,detail:this.options.showAlias?y:void 0},d.push(v);else if(e===v.commandId)d.push(v);else if(e.length>=3){const C=u();if(i.isCancellationRequested)return[];const x=C.find(k=>k.key===v.commandId);x&&(v.tfIdfScore=x.score,d.push(v))}}const h=new Map;for(const v of d){const b=h.get(v.label);b?(v.description=v.commandId,b.description=b.commandId):h.set(v.label,v)}d.sort((v,b)=>{if(v.tfIdfScore&&b.tfIdfScore)return v.tfIdfScore===b.tfIdfScore?v.label.localeCompare(b.label):b.tfIdfScore-v.tfIdfScore;if(v.tfIdfScore)return 1;if(b.tfIdfScore)return-1;const y=this.commandsHistory.peek(v.commandId),C=this.commandsHistory.peek(b.commandId);if(y&&C)return y>C?-1:1;if(y)return-1;if(C)return 1;if(this.options.suggestedCommandIds){const x=this.options.suggestedCommandIds.has(v.commandId),k=this.options.suggestedCommandIds.has(b.commandId);if(x&&k)return 0;if(x)return-1;if(k)return 1}return v.label.localeCompare(b.label)});const g=[];let p=!1,m=!0,_=!!this.options.suggestedCommandIds;for(let v=0;v<d.length;v++){const b=d[v];v===0&&this.commandsHistory.peek(b.commandId)&&(g.push({type:"separator",label:E("recentlyUsed","recently used")}),p=!0),m&&b.tfIdfScore!==void 0&&(g.push({type:"separator",label:E("suggested","similar commands")}),m=!1),_&&b.tfIdfScore===void 0&&!this.commandsHistory.peek(b.commandId)&&(!((a=this.options.suggestedCommandIds)===null||a===void 0)&&a.has(b.commandId))&&(g.push({type:"separator",label:E("commonlyUsed","commonly used")}),p=!0,_=!1),p&&b.tfIdfScore===void 0&&!this.commandsHistory.peek(b.commandId)&&!(!((l=this.options.suggestedCommandIds)===null||l===void 0)&&l.has(b.commandId))&&(g.push({type:"separator",label:E("morecCommands","other commands")}),p=!1),g.push(this.toCommandPick(b,r))}return this.hasAdditionalCommandPicks(e,i)?{picks:g,additionalPicks:(()=>KJ(this,void 0,void 0,function*(){var v;const b=yield this.getAdditionalCommandPicks(c,d,e,i);if(i.isCancellationRequested)return[];const y=b.map(C=>this.toCommandPick(C,r));return m&&((v=y[0])===null||v===void 0?void 0:v.type)!=="separator"&&y.unshift({type:"separator",label:E("suggested","similar commands")}),y}))()}:g})}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),r=i?E("commandPickAriaLabelWithKeybinding","{0}, {1}",e.label,i.getAriaLabel()):e.label;return Object.assign(Object.assign({},e),{ariaLabel:r,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:()=>KJ(this,void 0,void 0,function*(){var o,s;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(o=t==null?void 0:t.from)!==null&&o!==void 0?o:"quick open"});try{!((s=e.args)===null||s===void 0)&&s.length?yield this.commandService.executeCommand(e.commandId,...e.args):yield this.commandService.executeCommand(e.commandId)}catch(a){R_(a)||this.dialogService.error(E("canNotRun","Command '{0}' resulted in an error",e.label),TZe(a))}})})}};lk.PREFIX=">";lk.TFIDF_THRESHOLD=.5;lk.TFIDF_MAX_RESULTS=5;lk.WORD_FILTER=W_e(o4,OKi,HKe);lk=JS=IZe([gE(1,Un),gE(2,mo),gE(3,Fs),gE(4,wf),gE(5,I5)],lk);let ck=Ya=class extends Ae{constructor(e,t){super(),this.storageService=e,this.configurationService=t,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e)))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Ya.getConfiguredCommandHistoryLength(this.configurationService),Ya.cache&&Ya.cache.limit!==this.configuredCommandsHistoryLength&&(Ya.cache.limit=this.configuredCommandsHistoryLength,Ya.saveState(this.storageService)))}load(){const e=this.storageService.get(Ya.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch{}const i=Ya.cache=new eS(this.configuredCommandsHistoryLength,1);if(t){let r;t.usesLRU?r=t.entries:r=t.entries.sort((o,s)=>o.value-s.value),r.forEach(o=>i.set(o.key,o.value))}Ya.counter=this.storageService.getNumber(Ya.PREF_KEY_COUNTER,0,Ya.counter)}push(e){Ya.cache&&(Ya.cache.set(e,Ya.counter++),Ya.saveState(this.storageService))}peek(e){var t;return(t=Ya.cache)===null||t===void 0?void 0:t.peek(e)}static saveState(e){if(!Ya.cache)return;const t={usesLRU:!0,entries:[]};Ya.cache.forEach((i,r)=>t.entries.push({key:r,value:i})),e.store(Ya.PREF_KEY_CACHE,JSON.stringify(t),0,0),e.store(Ya.PREF_KEY_COUNTER,Ya.counter,0,0)}static getConfiguredCommandHistoryLength(e){var t,i;const o=(i=(t=e.getValue().workbench)===null||t===void 0?void 0:t.commandPalette)===null||i===void 0?void 0:i.history;return typeof o=="number"?o:Ya.DEFAULT_COMMANDS_HISTORY_LENGTH}};ck.DEFAULT_COMMANDS_HISTORY_LENGTH=50;ck.PREF_KEY_CACHE="commandPalette.mru.cache";ck.PREF_KEY_COUNTER="commandPalette.mru.counter";ck.counter=1;ck=Ya=IZe([gE(0,am),gE(1,Ui)],ck);class xdr extends lk{constructor(e,t,i,r,o,s){super(e,t,i,r,o,s)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions())t.push({commandId:i.id,commandAlias:i.alias,label:G_e(i.label)||i.id});return t}}var kdr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},GT=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}},lOe=globalThis&&globalThis.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(u){try{c(i.next(u))}catch(d){s(d)}}function l(u){try{c(i.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let q4=class extends xdr{get activeTextEditorControl(){var e;return(e=this.codeEditorService.getFocusedCodeEditor())!==null&&e!==void 0?e:void 0}constructor(e,t,i,r,o,s){super({showAlias:!1},e,i,r,o,s),this.codeEditorService=t}getCommandPicks(){return lOe(this,void 0,void 0,function*(){return this.getCodeEditorCommandPicks()})}hasAdditionalCommandPicks(){return!1}getAdditionalCommandPicks(){return lOe(this,void 0,void 0,function*(){return[]})}};q4=kdr([GT(0,Un),GT(1,Lr),GT(2,mo),GT(3,Fs),GT(4,wf),GT(5,I5)],q4);class J5 extends Gt{constructor(){super({id:J5.ID,label:_H.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:ee.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(P_).quickAccess.show(q4.PREFIX)}}J5.ID="editor.action.quickCommand";ht(J5);ds.as(Vk.Quickaccess).registerQuickAccessProvider({ctor:q4,prefix:q4.PREFIX,helpEntries:[{description:_H.quickCommandHelp,commandId:J5.ID}]});var Tdr=globalThis&&globalThis.__decorate||function(n,e,t,i){var r=arguments.length,o=r<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},YT=globalThis&&globalThis.__param||function(n,e){return function(t,i){e(t,i,n)}};let iue=class extends Ew{constructor(e,t,i,r,o,s,a){super(!0,e,t,i,r,o,s,a)}};iue=Tdr([YT(1,Yn),YT(2,Lr),YT(3,ga),YT(4,Un),YT(5,am),YT(6,Ui)],iue);gr(Ew.ID,iue,4);class Idr extends Gt{constructor(){super({id:"editor.action.toggleHighContrast",label:Jse.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(Ef),r=i.getColorTheme();m_(r.type)?(i.setTheme(this._originalThemeName||(i2(r.type)?UL:ky)),this._originalThemeName=null):(i.setTheme(i2(r.type)?nx:ix),this._originalThemeName=r.themeName)}}ht(Idr);const Ldr=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:vYe,Emitter:bYe,KeyCode:yYe,KeyMod:CYe,MarkerSeverity:kYe,MarkerTag:TYe,Position:wYe,Range:SYe,Selection:EYe,SelectionDirection:xYe,Token:LYe,Uri:IYe,editor:DYe,languages:AYe},Symbol.toStringTag,{value:"Module"}));function Ddr(){return new Worker("/editor.worker-94ffd778.js")}function Adr(){return new Worker("/json.worker-8dd963f3.js")}function Rdr(){return new Worker("/css.worker-c3850ceb.js")}function Ndr(){return new Worker("/html.worker-88b237e1.js")}function Odr(){return new Worker("/ts.worker-72c9fe54.js")}Ldn({dsn:{}.VITE_SENTRY_URL,integrations:[new Idn],tracesSampleRate:1});Rd.use(Wht).init({resources:{en:{translation:m3i}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});const Pdr=jft,Mdr=new _ht({defaultOptions:{queries:{retry:1}}});self.MonacoEnvironment={getWorker(n,e){return e==="json"?new Adr:e==="css"||e==="scss"||e==="less"?new Rdr:e==="html"||e==="handlebars"||e==="razor"?new Ndr:e==="typescript"||e==="javascript"?new Odr:new Ddr}};kU.config({monaco:Ldr});kU.init().then();const Fdr=document.getElementById("root");aje(Fdr).render(f(te.StrictMode,{children:f(wht,{client:Mdr,children:f(WMe,{store:y7,children:f(_3i,{children:f(Pdr,{children:f(Ddn,{children:f(Ean,{})})})})})})}));const rue=v3i();export{rfr as $,sl as A,Gi as B,Ot as C,jh as D,Ww as E,ha as F,Wa as G,_t as H,nn as I,Ut as J,bhr as K,ND as L,_Jt as M,Den as N,gi as O,Pe as P,S8e as Q,te as R,Vo as S,oA as T,Xn as U,zon as V,wct as W,$5 as X,GYe as Y,khr as Z,Ii as _,ai as a,Az as a$,po as a0,TJt as a1,Mo as a2,zo as a3,Zj as a4,Kr as a5,I0 as a6,D_ as a7,U as a8,Jn as a9,Y2 as aA,et as aB,efe as aC,cr as aD,iU as aE,nU as aF,rU as aG,Ti as aH,tb as aI,_p as aJ,i7 as aK,fhe as aL,QC as aM,Ife as aN,ao as aO,Lhr as aP,MHe as aQ,YHe as aR,HHe as aS,VHe as aT,_3 as aU,Rz as aV,nr as aW,Di as aX,D5e as aY,Zhe as aZ,XC as a_,ZP as aa,Ja as ab,FHe as ac,Ve as ad,tfe as ae,eZt as af,ie as ag,O5e as ah,du as ai,pc as aj,Uwe as ak,gt as al,oU as am,Ds as an,THe as ao,Ihr as ap,mXt as aq,gA as ar,vn as as,si as at,Rt as au,$hr as av,ri as aw,Ri as ax,Hpe as ay,Kw as az,Vhr as b,$pe as b$,A5e as b0,qdr as b1,hhr as b2,eg as b3,ahr as b4,K2 as b5,Xl as b6,Ql as b7,Pa as b8,ihr as b9,Ly as bA,aO as bB,Ea as bC,mk as bD,z2 as bE,K3e as bF,ki as bG,Hc as bH,i3 as bI,pu as bJ,Wpe as bK,Yw as bL,Bj as bM,ryt as bN,Fa as bO,Ege as bP,Vw as bQ,ah as bR,qw as bS,Dhr as bT,ZHe as bU,QHe as bV,A0 as bW,Hfe as bX,b3 as bY,yWe as bZ,tU as b_,D0 as ba,yf as bb,fA as bc,dA as bd,Lk as be,Ppe as bf,ec as bg,zp as bh,ib as bi,Tl as bj,Ci as bk,x0 as bl,Gj as bm,Qj as bn,f0 as bo,R5e as bp,Yj as bq,Bn as br,hn as bs,Uy as bt,Tpe as bu,E0 as bv,xj as bw,z8e as bx,L3 as by,Ng as bz,f as c,Bhr as c$,$4e as c0,Fhr as c1,y_ as c2,Jj as c3,Nh as c4,nXt as c5,ke as c6,Do as c7,vd as c8,Wp as c9,KQt as cA,Ehr as cB,ys as cC,rXt as cD,mhr as cE,v8e as cF,Kdr as cG,rhr as cH,Ere as cI,Udr as cJ,dAt as cK,Khr as cL,Ghr as cM,XHe as cN,nfe as cO,Bpe as cP,Wdr as cQ,Yhe as cR,tJt as cS,Oh as cT,rJt as cU,aM as cV,vXt as cW,Ydr as cX,Jhr as cY,tfr as cZ,yJt as c_,ql as ca,Vdr as cb,aZt as cc,OZt as cd,SC as ce,JXt as cf,jHe as cg,Yo as ch,QYt as ci,Fpe as cj,xHe as ck,Npe as cl,bQt as cm,hfr as cn,Qd as co,bs as cp,Ain as cq,Oin as cr,Nin as cs,Vin as ct,Rin as cu,PQt as cv,z9t as cw,dXt as cx,QQt as cy,iXt as cz,bf as d,oJt as d$,Jdr as d0,zdr as d1,afr as d2,lfr as d3,WJt as d4,ufr as d5,dfr as d6,Rhr as d7,ZXt as d8,Ahr as d9,mZt as dA,TQt as dB,aD as dC,xx as dD,sJt as dE,zpe as dF,cJt as dG,uJt as dH,K1 as dI,Yhr as dJ,CJt as dK,bJt as dL,Xhr as dM,Qhr as dN,efr as dO,BZt as dP,ol as dQ,Zhr as dR,wJt as dS,oue as dT,L_ as dU,Nd as dV,lhr as dW,Xp as dX,fhr as dY,R5t as dZ,JZt as d_,LXt as da,yXt as db,bXt as dc,Qhe as dd,Jhe as de,lM as df,eU as dg,Hp as dh,_f as di,Rg as dj,Gdr as dk,a7 as dl,l7 as dm,j8e as dn,fx as dp,Shr as dq,Mhr as dr,pA as ds,_Zt as dt,wZt as du,EZt as dv,Phr as dw,SZt as dx,xZt as dy,kZt as dz,ye as e,xhr as e$,iJt as e0,jhr as e1,qhr as e2,FZt as e3,Uhr as e4,_Xt as e5,ffr as e6,HJt as e7,VJt as e8,xJt as e9,zl as eA,eo as eB,T_t as eC,g_t as eD,iWe as eE,$p as eF,Tk as eG,SJt as eH,AJt as eI,whr as eJ,Chr as eK,Dpe as eL,Whr as eM,GZt as eN,zhr as eO,yZt as eP,lyt as eQ,q1 as eR,mQt as eS,gQt as eT,bc as eU,p4e as eV,Pw as eW,nhr as eX,wXt as eY,XXt as eZ,QXt as e_,lWe as ea,PJt as eb,IJt as ec,OJt as ed,Ny as ee,ifr as ef,q5t as eg,ghr as eh,_hr as ei,Up as ej,nfr as ek,cfr as el,ofr as em,oWe as en,FJt as eo,MJt as ep,rWe as eq,sfr as er,vhr as es,Qdr as et,ayt as eu,NJt as ev,zw as ew,Uw as ex,la as ey,jw as ez,Il as f,Nhr as f0,CXt as f1,fQt as f2,fZt as f3,kFe as f4,ohr as f5,ehr as f6,thr as f7,shr as f8,EHe as f9,Ss as fA,Vr as fB,yD as fC,S5i as fD,i_t as fE,gx as fF,U5t as fG,gfr as fH,Z6 as fI,kXt as fa,Rp as fb,KZt as fc,qZt as fd,Ohr as fe,tZt as ff,vZt as fg,Hhr as fh,Thr as fi,jdr as fj,wHe as fk,pQt as fl,YVe as fm,Xdr as fn,cyt as fo,y8e as fp,hQt as fq,$Kt as fr,O5t as fs,Zdr as ft,Sen as fu,Ms as fv,Zs as fw,bt as fx,yt as fy,Q3e as fz,Gw as g,dt as h,Cn as i,N as j,Pg as k,Hdr as l,Jr as m,ja as n,Co as o,w as p,jlt as q,Te as r,St as s,Yp as t,ue as u,IWt as v,gJt as w,vi as x,$dr as y,Vn as z};